@arbocollab/arbo-plugin-item-table 0.1.67 → 0.1.68

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.
@@ -141,7 +141,7 @@ This will fail in production.`);r=jl,r._s.has(e)||(s?qb(e,t,o,r):kA(e,o,r),q.env
141
141
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[ck]=this[ck]={accessors:{}}).accessors,s=this.prototype;function i(r){const a=nf(r);o[a]||(XZ(s,r),o[a]=!0)}return Ve.isArray(t)?t.forEach(i):i(t),this}};ds.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ve.reduceDescriptors(ds.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Ve.freezeMethods(ds);function aS(e,t){const n=this||tf,o=t||n,s=ds.from(o.headers);let i=o.data;return Ve.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function uk(e){return!!(e&&e.__CANCEL__)}function Fu(e,t,n){zt.call(this,e??"canceled",zt.ERR_CANCELED,t,n),this.name="CanceledError"}Ve.inherits(Fu,zt,{__CANCEL__:!0});function dk(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new zt("Request failed with status code "+n.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function JZ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function QZ(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=o[i];r||(r=c),n[s]=l,o[s]=c;let d=i,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-r<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function eX(e,t){let n=0,o=1e3/t,s,i;const r=(c,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=o?r(c,u):(s=c,i||(i=setTimeout(()=>{i=null,r(s)},o-d)))},()=>s&&r(s)]}const Mm=(e,t,n=3)=>{let o=0;const s=QZ(50,250);return eX(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-o,c=s(l),u=r<=a;o=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-r)/c:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},hk=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},fk=e=>(...t)=>Ve.asap(()=>e(...t)),tX=Go.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Go.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Go.origin),Go.navigator&&/(msie|trident)/i.test(Go.navigator.userAgent)):()=>!0,nX=Go.hasStandardBrowserEnv?{write(e,t,n,o,s,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Ve.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Ve.isString(o)&&a.push(`path=${o}`),Ve.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),Ve.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function oX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function pk(e,t,n){let o=!oX(t);return e&&(o||n==!1)?sX(e,t):t}const gk=e=>e instanceof ds?{...e}:e;function Jl(e,t){t=t||{};const n={};function o(c,u,d,h){return Ve.isPlainObject(c)&&Ve.isPlainObject(u)?Ve.merge.call({caseless:h},c,u):Ve.isPlainObject(u)?Ve.merge({},u):Ve.isArray(u)?u.slice():u}function s(c,u,d,h){if(Ve.isUndefined(u)){if(!Ve.isUndefined(c))return o(void 0,c,d,h)}else return o(c,u,d,h)}function i(c,u){if(!Ve.isUndefined(u))return o(void 0,u)}function r(c,u){if(Ve.isUndefined(u)){if(!Ve.isUndefined(c))return o(void 0,c)}else return o(void 0,u)}function a(c,u,d){if(d in t)return o(c,u);if(d in e)return o(void 0,c)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,u,d)=>s(gk(c),gk(u),d,!0)};return Ve.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||s,h=d(e[u],t[u],u);Ve.isUndefined(h)&&d!==a||(n[u]=h)}),n}const mk=e=>{const t=Jl({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=ds.from(r),t.url=ik(pk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Ve.isFormData(n)){if(Go.hasStandardBrowserEnv||Go.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Ve.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&r.set(u,d)})}}if(Go.hasStandardBrowserEnv&&(o&&Ve.isFunction(o)&&(o=o(t)),o||o!==!1&&tX(t.url))){const l=s&&i&&nX.read(i);l&&r.set(s,l)}return t},iX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const s=mk(e);let i=s.data;const r=ds.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,h,f,p;function g(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=ds.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};dk(function(x){n(x),g()},function(x){o(x),g()},E),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(y)},v.onabort=function(){v&&(o(new zt("Request aborted",zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const E=C&&C.message?C.message:"Network Error",D=new zt(E,zt.ERR_NETWORK,e,v);D.event=C||null,o(D),v=null},v.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||ak;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),o(new zt(C,E.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Ve.forEach(r.toJSON(),function(C,E){v.setRequestHeader(E,C)}),Ve.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),c&&([h,p]=Mm(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=Mm(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(u=S=>{v&&(o(!S||S.type?new Fu(null,e,v):S),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const b=JZ(s.url);if(b&&Go.protocols.indexOf(b)===-1){o(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},rX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const i=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;o.abort(u instanceof zt?u:new Fu(u instanceof Error?u.message:u))}};let r=t&&setTimeout(()=>{r=null,i(new zt(`timeout ${t} of ms exceeded`,zt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:l}=o;return l.unsubscribe=()=>Ve.asap(a),l}},aX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},lX=async function*(e,t){for await(const n of cX(e))yield*aX(n,t)},cX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},vk=(e,t,n,o)=>{const s=lX(e,t);let i=0,r,a=l=>{r||(r=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},yk=64*1024,{isFunction:Nm}=Ve,uX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ve.global),{ReadableStream:wk,TextEncoder:Ck}=Ve.global,bk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},dX=e=>{e=Ve.merge.call({skipUndefined:!0},uX,e);const{fetch:t,Request:n,Response:o}=e,s=t?Nm(t):typeof fetch=="function",i=Nm(n),r=Nm(o);if(!s)return!1;const a=s&&Nm(wk),l=s&&(typeof Ck=="function"?(p=>g=>p.encode(g))(new Ck):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=i&&a&&bk(()=>{let p=!1;const g=new n(Go.origin,{body:new wk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=r&&a&&bk(()=>Ve.isReadableStream(new o("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let y=g&&g[p];if(y)return y.call(g);throw new zt(`Response type '${p}' is not supported`,zt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Ve.isBlob(p))return p.size;if(Ve.isSpecCompliantForm(p))return(await new n(Go.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Ve.isArrayBufferView(p)||Ve.isArrayBuffer(p))return p.byteLength;if(Ve.isURLSearchParams(p)&&(p=p+""),Ve.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Ve.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:y,signal:b,cancelToken:S,timeout:C,onDownloadProgress:E,onUploadProgress:D,responseType:x,headers:A,withCredentials:k="same-origin",fetchOptions:T}=mk(p),R=t||fetch;x=x?(x+"").toLowerCase():"text";let F=rX([b,S&&S.toAbortSignal()],C),P=null;const $=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let te;try{if(D&&c&&v!=="get"&&v!=="head"&&(te=await f(A,y))!==0){let M=new n(g,{method:"POST",body:y,duplex:"half"}),j;if(Ve.isFormData(y)&&(j=M.headers.get("content-type"))&&A.setContentType(j),M.body){const[L,se]=hk(te,Mm(fk(D)));y=vk(M.body,yk,L,se)}}Ve.isString(k)||(k=k?"include":"omit");const U=i&&"credentials"in n.prototype,Y={...T,signal:F,method:v.toUpperCase(),headers:A.normalize().toJSON(),body:y,duplex:"half",credentials:U?k:void 0};P=i&&new n(g,Y);let X=await(i?R(P,T):R(g,Y));const ne=u&&(x==="stream"||x==="response");if(u&&(E||ne&&$)){const M={};["status","statusText","headers"].forEach(ce=>{M[ce]=X[ce]});const j=Ve.toFiniteNumber(X.headers.get("content-length")),[L,se]=E&&hk(j,Mm(fk(E),!0))||[];X=new o(vk(X.body,yk,L,()=>{se&&se(),$&&$()}),M)}x=x||"text";let Re=await d[Ve.findKey(d,x)||"text"](X,p);return!ne&&$&&$(),await new Promise((M,j)=>{dk(M,j,{data:Re,headers:ds.from(X.headers),status:X.status,statusText:X.statusText,config:p,request:P})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new zt("Network Error",zt.ERR_NETWORK,p,P),{cause:U.cause||U}):zt.from(U,U&&U.code,p,P)}}},hX=new Map,Sk=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,i=[o,s,n];let r=i.length,a=r,l,c,u=hX;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:dX(t)),u=c;return c};Sk();const lS={http:OZ,xhr:iX,fetch:{get:Sk}};Ve.forEach(lS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ek=e=>`- ${e}`,fX=e=>Ve.isFunction(e)||e===null||e===!1;function pX(e,t){e=Ve.isArray(e)?e:[e];const{length:n}=e;let o,s;const i={};for(let r=0;r<n;r++){o=e[r];let a;if(s=o,!fX(o)&&(s=lS[(a=String(o)).toLowerCase()],s===void 0))throw new zt(`Unknown adapter '${a}'`);if(s&&(Ve.isFunction(s)||(s=s.get(t))))break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
142
142
  `+r.map(Ek).join(`
143
143
  `):" "+Ek(r[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const _k={getAdapter:pX,adapters:lS};function cS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fu(null,e)}function Rk(e){return cS(e),e.headers=ds.from(e.headers),e.data=aS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_k.getAdapter(e.adapter||tf.adapter,e)(e).then(function(o){return cS(e),o.data=aS.call(e,e.transformResponse,o),o.headers=ds.from(o.headers),o},function(o){return uk(o)||(cS(e),o&&o.response&&(o.response.data=aS.call(e,e.transformResponse,o.response),o.response.headers=ds.from(o.response.headers))),Promise.reject(o)})}const Dk="1.13.2",Lm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Lm[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const Tk={};Lm.transitional=function(t,n,o){function s(i,r){return"[Axios v"+Dk+"] Transitional option '"+i+"'"+r+(o?". "+o:"")}return(i,r,a)=>{if(t===!1)throw new zt(s(r," has been removed"+(n?" in "+n:"")),zt.ERR_DEPRECATED);return n&&!Tk[r]&&(Tk[r]=!0,console.warn(s(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},Lm.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function gX(e,t,n){if(typeof e!="object")throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const i=o[s],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new zt("option "+i+" must be "+l,zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}}const Vm={assertOptions:gX,validators:Lm},lr=Vm.validators;let Ql=class{constructor(t){this.defaults=t||{},this.interceptors={request:new rk,response:new rk}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
144
- `+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jl(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&Vm.assertOptions(o,{silentJSONParsing:lr.transitional(lr.boolean),forcedJSONParsing:lr.transitional(lr.boolean),clarifyTimeoutError:lr.transitional(lr.boolean)},!1),s!=null&&(Ve.isFunction(s)?n.paramsSerializer={serialize:s}:Vm.assertOptions(s,{encode:lr.function,serialize:lr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Vm.assertOptions(n,{baseUrl:lr.spelling("baseURL"),withXsrfToken:lr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Ve.merge(i.common,i[n.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ds.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Rk.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{u=Rk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jl(this.defaults,t);const n=pk(t.baseURL,t.url,t.allowAbsoluteUrls);return ik(n,t.params,t.paramsSerializer)}};Ve.forEach(["delete","get","head","options"],function(t){Ql.prototype[t]=function(n,o){return this.request(Jl(o||{},{method:t,url:n,data:(o||{}).data}))}}),Ve.forEach(["post","put","patch"],function(t){function n(o){return function(i,r,a){return this.request(Jl(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ql.prototype[t]=n(),Ql.prototype[t+"Form"]=n(!0)});let mX=class jB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const o=this;this.promise.then(s=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const r=new Promise(a=>{o.subscribe(a),i=a}).then(s);return r.cancel=function(){o.unsubscribe(i)},r},t(function(i,r,a){o.reason||(o.reason=new Fu(i,r,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jB(function(s){t=s}),cancel:t}}};function vX(e){return function(n){return e.apply(null,n)}}function yX(e){return Ve.isObject(e)&&e.isAxiosError===!0}const uS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(uS).forEach(([e,t])=>{uS[t]=e});function xk(e){const t=new Ql(e),n=WA(Ql.prototype.request,t);return Ve.extend(n,Ql.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return xk(Jl(e,s))},n}const to=xk(tf);to.Axios=Ql,to.CanceledError=Fu,to.CancelToken=mX,to.isCancel=uk,to.VERSION=Dk,to.toFormData=km,to.AxiosError=zt,to.Cancel=to.CanceledError,to.all=function(t){return Promise.all(t)},to.spread=vX,to.isAxiosError=yX,to.mergeConfig=Jl,to.AxiosHeaders=ds,to.formToJSON=e=>lk(Ve.isHTMLForm(e)?new FormData(e):e),to.getAdapter=_k.getAdapter,to.HttpStatusCode=uS,to.default=to;const{Axios:I0e,AxiosError:F0e,CanceledError:P0e,isCancel:A0e,CancelToken:k0e,VERSION:O0e,all:M0e,Cancel:N0e,isAxiosError:wX,spread:L0e,toFormData:V0e,AxiosHeaders:B0e,HttpStatusCode:$0e,formToJSON:H0e,getAdapter:G0e,mergeConfig:U0e}=to,CX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const o=n.pop();return(o==null?void 0:o.split(";").shift())??null}return null},bX=6e4,Ik=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Bm=new Map,Fk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},SX=e=>{const t=Fk(e),n=Ik(t||"none"),s=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&s===a)||"default";Bm.has(i)||Bm.set(i,{ongoing:0,queue:[]});const r=Bm.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Pk=e=>{const t=Fk(e),n=Ik(t||"none"),s=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&s===a)||"default",r=Bm.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},EX=(()=>{const e=to.create({timeout:bX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await SX(n);const o=CX("account.token");return o&&t.headers&&(t.headers.Authorization=`Bearer ${o}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Pk(t.config.url||""),t),async t=>{var o,s,i;if(((o=t.response)==null?void 0:o.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Pk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((s=t.response)==null?void 0:s.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class of extends Error{constructor(t,n,o,s,i){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=i,Object.setPrototypeOf(this,of.prototype)}}const sf=e=>{var t,n;if(wX(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,i=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",r=(s==null?void 0:s.code)||e.code,a=(s==null?void 0:s.details)||s;let l="UNKNOWN";return!o||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":o>=500?l="SERVER":o===Tu.UNAUTHORIZED||o===Tu.FORBIDDEN?l="AUTH":o===Tu.UNPROCESSABLE_ENTITY||o===Tu.BAD_REQUEST?l="VALIDATION":o>=Tu.BAD_REQUEST&&(l="CLIENT"),new of(i,o,r,a,l)}return e instanceof Error?new of(e.message,void 0,void 0,void 0,"UNKNOWN"):new of("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class _X{constructor(){this.axios=EX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(s,String(r))):typeof i=="object"?n.append(s,JSON.stringify(i)):n.append(s,String(i)))});const o=n.toString();return o?`?${o}`:""}async get(t="",n,o){try{const s=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${s}${i}`,o)).data}catch(s){throw sf(s)}}async post(t="",n,o,s){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,o,s)).data}catch(i){throw sf(i)}}async put(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.put(s,n,o)).data}catch(s){throw sf(s)}}async patch(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.patch(s,n,o)).data}catch(s){throw sf(s)}}async delete(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.delete(s,{data:n,...o})).data}catch(s){throw sf(s)}}}const RX=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),DX=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class Ak extends _X{constructor(t,n){const o=n==null?void 0:n.domainApi,s=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=RX({domainApi:o,wsCode:s,entityId:i}),a={};Object.entries(r).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),this.apiConfig=a}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:i,responseType:r}){var c,u;const a=this.buildHeaders(s);let l;try{if(l=await this.axios.request({method:t,url:n,params:o,data:s,headers:a,responseType:r}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";DX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:o,payload:s,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,i])=>{o=o.replace(`{${s}}`,String(i))}),o}async request(t,n,o={}){const{url:s,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:r,path:a,params:o.params,payload:o.payload,code:i,responseType:o.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,o={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:o||1,name_like:s||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const i={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const i={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:i})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:i,filterParams:r}){const a={item_ids:n,start_date:o,due_date:s,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:i}=t,r={item_ids:o,ws_user_role_ids:s,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,i={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=s):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:i}=t,r={item_ids:o,ws_user_role_ids:s,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:i}){const r={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:i}=t,r={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:i}=t,r={item_ids:o,template_flow_status_id:s};return o.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:1,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:0,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:i,clear:r}=t,a={item_ids:o,metric_id:s,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const TX=(e,t,n,o,s,i,r)=>{const{apiServices:a}=Qn(n,o),l=B(!1),c=Z(()=>!!(s!=null&&s.value&&(i!=null&&i.value))),u=En("filterParams",null);return{isUpdating:l,handleUpdate:async h=>{var p;const f=h.value;l.value=!0;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:u!=null&&u.value?u.value:void 0};h.value==null?g.clear=1:g.value=f,c.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds;const v=await((p=a.value)==null?void 0:p.bulkUpdateMetric(g));(v==null?void 0:v.message)=="Done"&&t(h)}catch(g){console.error("Error during bulk metric update:",g)}l.value=!1}}},xX=St(it({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=$A(),o=B([]),s=e,i=t,r=B([]),a=B(null),l=X=>{var M,j,L;const ne=o.value.findIndex(se=>se.id===X.id);a.value=ne;const Re=(M=r.value[ne])==null?void 0:M.$el;(j=x.value)==null||j.scrollTo(ne*30),Re&&Re.scrollIntoView({behavior:"smooth",block:"center"}),c(ne),(L=r.value[ne])==null||L.show()},c=X=>{a.value=X,r.value.forEach((ne,Re)=>{Re!==X&&ne&&ne.hide()})},u=B(""),d=B(null),{popupRef:h,triggerRef:f,isVisible:p}=eo({appendTo:d.value||void 0}),g=()=>{u.value="",r.value.forEach(X=>{X==null||X.hide()}),a.value=null},v=Z(()=>s.selectedIds||[]),y=Z(()=>({itemIds:v.value,workspaceId:String(s.workspaceId)})),b=En("isSelectAll",B(!1)),S=En("bulkUpdate",B(!1)),{handleUpdate:C,isUpdating:E}=TX(y,X=>{i("update",X),g()},!1,s,S,b),D=X=>{g(),_t(()=>{var ne;(ne=x.value)==null||ne.focus()})},x=B(null);Je(()=>p.value,X=>{var ne;X?(ne=x.value)==null||ne.focus():g()});const A=B(!0),k=B(!0),{apiServices:T}=Qn(!1,s),R=async(X,ne,Re)=>{var M;try{return Re?k.value=!0:A.value=!0,await((M=T.value)==null?void 0:M.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:X,query:ne,per_page:10}))}catch(j){throw console.error("Failed to fetch metric list:",j),j}finally{A.value=!1,k.value=!1}},F=B(0),P=B(!0),$=X=>({id:String(X.id),label:String(X.name),value:String(X.id),description:X.morpheme_value?`${String(X.morpheme_value)}`:"",type:n.checkEditType(X),metricConfig:X}),te=X=>X.filter(ne=>!ne.formula).filter(ne=>{var Re;return((Re=ne==null?void 0:ne.auth_permission)==null?void 0:Re.permission)==2}).map($),U=async()=>{F.value+=1;const X=await R(F.value,u.value,!0);if(X&&X.data){const ne=te(X.data);o.value=[...o.value,...ne],P.value=X.meta.last_page!=X.meta.current_page}else P.value=!1},Y=async X=>{u.value=X,F.value=1;try{const ne=await R(F.value,u.value);ne&&ne.data?(o.value=te(ne.data),P.value=ne.meta.last_page!=ne.meta.current_page):o.value=[]}catch{o.value=[]}};return Je(()=>p.value,(X,ne)=>{X&&ne!==X&&Y("")},{immediate:!0,deep:!0}),(X,ne)=>(K(),ae("div",{ref_key:"wrapperRef",ref:d},[ue(ct,{class:"action-button",variant:s.variant,ref_key:"triggerRef",ref:f,loading:H(E)},{default:fe(()=>[ue(rt,{src:"SquareRootVariable",class:"icon"}),ne[1]||(ne[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading"]),pe("div",{ref_key:"popupRef",ref:h,style:{display:"none","border-radius":"4px"}},[ue(Jr,{ref_key:"searchListRef",ref:x,style:{width:"320px"},options:o.value,loading:A.value,"loading-more":k.value,"selected-id":void 0,"has-more":P.value,onSearch:Y,onSelect:l,onLoadMore:ne[0]||(ne[0]=()=>U())},{item:fe(({item:Re,index:M,selectedIndex:j})=>[ue(YY,{ref:L=>r.value[M]=L,label:Re.label,type:Re.type,morpheme:Re.description||"",onFocusOnSearch:D,onOpen:L=>c(M),attachTo:H(h),config:Re.metricConfig,onHandleUpdate:H(C),class:J(["metric-update-item",{selected:a.value===M||j===M}])},null,8,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":fe(()=>[...ne[2]||(ne[2]=[pe("div",{style:{width:"320px"}},null,-1)])]),"empty-list":fe(()=>[...ne[3]||(ne[3]=[nt("No options available.",-1)])]),_:1},8,["options","loading","loading-more","has-more"])],512)],512))}}),[["__scopeId","data-v-bf393fa6"]]),kk=St(it({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l}=eo({placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),c=Z(()=>l.value);Je(l,h=>{s(h?"open":"close")});const u=()=>{i()};t({closeDropdown:u,isOpen:c});const d=h=>{h.key==="Escape"&&a.value&&i()};return Xt(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.addEventListener("keydown",d)}),lo(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.removeEventListener("keydown",d)}),(h,f)=>(K(),ae("div",{ref_key:"triggerRef",ref:r,class:J(h.$style["dropdown-wrapper"])},[Pt(h.$slots,"trigger",{open:H(l),closeDropdown:u},()=>[pe("button",{class:J(h.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),pe("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:J(h.$style["dropdown-content"]),style:cn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Pt(h.$slots,"content",{closeDropdown:u,visible:H(l)},()=>[pe("div",{class:J(h.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),$m=Yl("bulkUpdate",()=>{const e=B(Ht.UNCHECK),t=Cs({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Cs({isBulkUpdating:!1});function i(u){s.isBulkUpdating=u}const r=B({}),a=u=>{r.value=u},l=(u,d)=>{r.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ht.CHECKED)}}}),Ok=it({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,i=n,r=B([]),a=B(!1),l=B(!1),c=B(null),u=B(o.INITIAL_PAGE),d=B(!0),h=B(0),f=B(""),p=Z(()=>{var $;return($=s.value)==null?void 0:$.id}),g=Z(()=>!!(s.id||s.ids&&s.ids.length>0)),v=$=>({label:$.name,value:$.id,selected:p.value===$.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:$,id:$.id,color:$.color}),y=Z(()=>{const $=new Set;return s.id&&$.add(String(s.id)),s.ids&&s.ids.forEach(te=>{te&&$.add(String(te))}),Array.from($)}),b=En("bulkUpdate",!1),{apiServices:S}=Qn(!b,s),C=$m(),{selectionStatus:E}=Ho(C),D=En("filterParams",null),x=async($=o.INITIAL_PAGE,te="",U=!1)=>{var Y,X,ne,Re;if(!g.value){console.error("Missing required props",s);return}U?l.value=!0:a.value=!0,c.value=null;try{const M={workspaceId:String(s.workspaceId),itemIds:y.value,page:$,perPage:o.PER_PAGE,name_like:te.trim(),...D||{}};if(((Y=S.value)==null?void 0:Y.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const j=await((X=S.value)==null?void 0:X.getAssignableStatus(M));if(!(j!=null&&j.data)){U||(r.value=[]),d.value=!1;return}const L=j.data.map(v);r.value=U?[...r.value,...L]:L,h.value=((ne=j.meta)==null?void 0:ne.total)??j.data.length,d.value=!((Re=j.meta)!=null&&Re.on_last_page),u.value=$}catch(M){console.error("Error fetching statuses:",M),c.value="Failed to load statuses",U||(r.value=[]),d.value=!1,i("error",c.value)}finally{a.value=!1,l.value=!1}},A=Di(async $=>{f.value=$,u.value=o.INITIAL_PAGE,await x(o.INITIAL_PAGE,$,!1)},ir),k=async()=>{!d.value||l.value||await x(u.value+1,f.value,!0)},T=()=>{var $;i("cancel"),($=s.params)==null||$.api.stopEditing()},R=async $=>{var te,U,Y;if(!g.value){console.error("Missing required props for updating status",s);return}try{const X={workspaceId:String(s.workspaceId),itemIds:y.value,statusId:String($.value),entityId:String(s.entityId),filterParams:D!=null&&D.value?D==null?void 0:D.value:void 0};if(E.value==Ht.CHECKED&&b&&(X.itemIds=void 0,X.entityId=String(s.entityId)),i("start-update"),!await S.value.updateItemStatus(X))throw new Error("Status update failed: empty response");const Re={workspaceId:String(s.workspaceId),itemIds:y.value,data:{id:$.id,name:$.label,color:$.color}};i("updated",Re),s.params&&((U=s.params)==null||U.node.setData({...(te=s.params)==null?void 0:te.node.data,status:{id:$.id,name:$.label,color:$.color}}),(Y=s.params)==null||Y.api.stopEditing())}catch(X){console.error("Error updating status:",X),c.value="Failed to update status",i("error",c.value)}finally{i("finish-update")}},F=Z(()=>r.value.map($=>({...$})));Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{x()},{deep:!0,immediate:!0});const P=B(null);return Xt(()=>{_t(()=>{var $;($=P.value)==null||$.focus()})}),t({refresh:()=>x(o.INITIAL_PAGE,f.value,!1),loadMore:k,focus:()=>{var $;return($=P.value)==null?void 0:$.focus()}}),($,te)=>{var U;return K(),ze(Jr,qt({ref_key:"popupRef",ref:P},s,{"selected-id":(U=s.value)==null?void 0:U.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(A),onSelect:R,onLoadMore:k,onCancel:T,onClose:T}),null,16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),IX=it({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,o=Z(()=>{const v=So();return v==null?void 0:v.appContext.config.globalProperties.apiServices}),{popupRef:s,triggerRef:i,isVisible:r,hide:a}=eo(),l=t,c=B(!1),u=v=>{c.value=!1,l("updated",v),setTimeout(()=>{a()},700)},d=Z(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=B(null),f=v=>{v.key==="Escape"&&s.value&&a()};Xt(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.addEventListener("keydown",f)}),lo(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.removeEventListener("keydown",f)}),qi("bulkUpdate",!0);const p=v=>{c.value=v},g=B(null);return Je(r,v=>{var y;v&&((y=g.value)==null||y.focus())}),(v,y)=>(K(),ae("div",{ref_key:"mainRef",ref:h},[ue(ct,{ref_key:"triggerRef",ref:i,variant:e.variant,loading:c.value},{default:fe(()=>[ue(rt,{src:"Square",class:"icon"}),y[3]||(y[3]=nt(" Status ",-1))]),_:1},8,["variant","loading"]),pe("div",{ref_key:"popupRef",ref:s},[Ue(ue(Ok,qt({ref_key:"statusRef",ref:g},d.value,{onUpdated:u,onCancel:H(a),onStartUpdate:y[0]||(y[0]=b=>p(!0)),onFinishUpdate:y[1]||(y[1]=b=>p(!1)),onError:y[2]||(y[2]=b=>p(!1)),callback:()=>p(!1)}),null,16,["onCancel","callback"]),[[_i,H(r)]])],512)],512))}}),Mk=St(it({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=Ji,s=e,i=Z(()=>(s==null?void 0:s.workspaceId)||""),r=Z(()=>(s==null?void 0:s.entityId)||""),a=()=>{var $,te,U;return(U=($=s.params)==null?void 0:$.api)==null?void 0:U.getCellRendererInstances({columns:["options"],rowNodes:(te=s.params)!=null&&te.node?[s.params.node]:[]})[0]},l=()=>{var te,U,Y,X;const $=a();(U=(te=$==null?void 0:$.componsenExposed)==null?void 0:te.blur)==null||U.call(te),console.log("Blurring option renderer for row:",s.id,$),(X=(Y=$==null?void 0:$.container)==null?void 0:Y.parentElement)==null||X.classList.remove("ag-cell-focus")},c=()=>{var U,Y,X;(Y=(U=s.params)==null?void 0:U.api)==null||Y.stopEditing(),l();const $=`scene-name-${s.id}`,te=document.getElementById($);(X=te==null?void 0:te.__sceneNameEditor)==null||X.startEdit()},{apiServices:u}=Qn(!0,s),d=Z(()=>{var $;return{ws_code:i.value,entity_id:r.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:($=s.data)==null?void 0:$.permissions}}),h=$=>{var U,Y,X,ne,Re,M;let te=(Y=(U=s.params)==null?void 0:U.api)==null?void 0:Y.getRowNode(String(s.id));if(te){const j={...te.data,isDeleted:$==="deleted",isArchived:$==="archived"?!0:te.data.isArchived,disabled:!0};(ne=(X=s.params)==null?void 0:X.api)==null||ne.redrawRows({rowNodes:[te]}),te.setData(j),(M=(Re=s.params)==null?void 0:Re.api)==null||M.redrawRows({rowNodes:[te]})}},f=Yh(),{openSceneHub:p}=f,g=()=>{_t(()=>{var U,Y,X,ne,Re,M;const $=((Y=(U=s.params)==null?void 0:U.node)==null?void 0:Y.rowIndex)||0,te=((ne=(X=s.params)==null?void 0:X.column)==null?void 0:ne.getColId())||"";(M=(Re=s.params)==null?void 0:Re.api)==null||M.setFocusedCell($,te)})},{options:v}=tY(d,h,c,p,g),y=n,b=()=>{var $,te,U,Y,X,ne;console.trace("Focusing current cell for row:",s.id),(ne=($=s.params)==null?void 0:$.api)==null||ne.setFocusedCell(((U=(te=s.params)==null?void 0:te.node)==null?void 0:U.rowIndex)||0,((X=(Y=s.params)==null?void 0:Y.column)==null?void 0:X.getColId())||"")},S=Z(()=>{var $;return($=s.params)==null?void 0:$.api}),C=($,te)=>{var U,Y,X,ne,Re,M,j,L;if(y("actionExecuted",$),$.id=="copy-link"){(Re=S.value)==null||Re.startEditingCell({rowIndex:(Y=(U=s.params)==null?void 0:U.node)==null?void 0:Y.rowIndex,colKey:(ne=(X=s.params)==null?void 0:X.column)==null?void 0:ne.getColId()});return}else{if($.id!=="copy-link"&&((M=S.value)==null||M.stopEditing()),$.id==="rename")(j=S.value)==null||j.stopEditing(),(L=S.value)==null||L.clearFocusedCell(),l();else if($.id==="copy-link"){const se=document.getElementById(te);setTimeout(()=>{var ce,De,Ie;(Ie=(De=(ce=se==null?void 0:se.__vueParentComponent)==null?void 0:ce.exposed)==null?void 0:De.focus)==null||Ie.call(De)},300)}else if(["delete-rendition","delete-thumbnail"].includes($.id)){setTimeout(()=>{b()},300);return}setTimeout(()=>{var se,ce;(ce=(se=s.params)==null?void 0:se.api)==null||ce.clearFocusedCell()},300)}},E=()=>{var $,te;(te=($=s.params)==null?void 0:$.api)==null||te.stopEditing()},D=$=>{var te,U,Y,X;return $==="archive"?!((U=(te=s.params)==null?void 0:te.data)!=null&&U.isArchived):$==="unarchive"?(X=(Y=s.params)==null?void 0:Y.data)==null?void 0:X.isArchived:!0},x=Z(()=>v.value.map($=>({...$,options:$.options.filter(te=>!te.hide&&D(te.id))})).filter($=>$.options.length>0)),A=B({}),k=B(null),T=Z(()=>{var te,U;if(s.focusableIndex)return s.focusableIndex;const $=(U=(te=s.params)==null?void 0:te.api)==null?void 0:U.getRowNode(String(s.id));return`${(($==null?void 0:$.rowIndex)??0)+10}`}),R=($,te)=>`${T.value}.${$*10+te}`,F=($,te)=>{if(te&&"focus"in te){A.value[$]=te;return}delete A.value[$]},P=$=>{$.preventDefault(),$.stopPropagation(),$.stopImmediatePropagation()};return Xt(()=>{var $;($=k.value)==null||$.focus()}),t({focus(){var U;const $=`${T.value}.0`,te=A.value[$];te&&te.focus?te.focus():(U=k.value)==null||U.focus()}}),($,te)=>Ue((K(),ae("div",{onKeydown:P,class:J([$.$style["more-option-section"],{[$.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:k,tabindex:"0",role:"menu"},[(K(!0),ae(xt,null,xn(x.value,(U,Y)=>(K(),ae("div",{key:U.id,style:cn({"--g-number":Math.min(U.options.length,4),"--g-size":U.type==="column"?"40px":"auto"}),class:J([$.$style["option-block"],$.$style[U.type]])},[(K(!0),ae(xt,null,xn(U.options,(X,ne)=>(K(),ae("div",{key:X.id,class:J($.$style["option-item"])},[ue(PX,{layer:s.layer,"scene-id":String(s.id),option:X,type:U.type,onActionExecuted:Re=>C(Re,`more-action-${Re.id}-${s.id}`),focusableIndex:R(Y,ne),ref_for:!0,ref:Re=>F(R(Y,ne),Re),onHandleHide:E,id:`more-action-${X.id}-${s.id}`},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id"])],2))),128))],6))),128))],34)),[[H(o),T.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1d9v2_1","option-block":"_option-block_1d9v2_8","option-item":"_option-item_1d9v2_18",row:"_row_1d9v2_22",column:"_column_1d9v2_28",block:"_block_1d9v2_32"}}]]),FX={key:0},PX=St(it({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=Ji,s=Yt,i=e,r=B(!1),a=B(!1),l=(A,k)=>{if(!k){p();return}const T=k.target;T.closest(".tippy-content")||T.closest(".tippy-box")||T.closest("[data-tippy-root]")||T.closest(".option-item")||p()},c=B(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=eo({interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async A=>{var k,T;if(!a.value){a.value=!0;try{await((T=(k=i.option).action)==null?void 0:T.call(k,A)),g("actionExecuted",i.option)}catch(R){console.error("Action execution failed:",R)}finally{a.value=!1,r.value=!1}}},y=async A=>{var k,T;if(A.preventDefault(),A.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((T=(k=i.option).action)==null?void 0:T.call(k,A)),g("actionExecuted",i.option)}catch(R){console.error("Action execution failed:",R)}finally{a.value=!1}return}}},b=A=>{g("actionExecuted",A),p()},S=A=>{A.key==="Escape"&&p()},C=A=>({row:"small",column:"large",block:"small"})[A]||"large",E=A=>{const k=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...k],column:["menu-item",...k],block:["secondary",...k]}[A]||[]},D=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{_t(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{y(new MouseEvent("click"))}});const x=A=>{var k;A.stopPropagation(),A.preventDefault(),console.log("Cancel action"),r.value=!1,(k=u.value)==null||k.focus()};return(A,k)=>{var T;return Ue((K(),ae("div",{ref_key:"wrapperRef",ref:c,class:J(A.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Tt(y,["stop","prevent"])},[Ue((K(),ze(ct,{ref_key:"triggerRef",ref:u,class:J(A.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||r.value,size:C(e.type),variant:E(e.type),onClick:Tt(y,["stop","prevent"]),onKeydown:S,onEscape:D},{prefix:fe(()=>[e.option.icon?Ue((K(),ze(rt,{key:0,src:e.option.icon,source:"remote"},null,8,["src"])),[[H(s),{content:e.option.label,delay:[300,0],contentClass:["extra-padding"]}]]):Ze("",!0)]),suffix:fe(()=>[e.option.subMenu?(K(),ze(rt,{key:0,src:"Play",source:"remote"})):Ze("",!0),e.option.isDanger&&r.value?(K(),ae("div",{key:1,class:J(A.$style["confirm-action"])},[Ue((K(),ze(ct,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:x},{default:fe(()=>[ue(rt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(o),`${i.focusableIndex}.0`],[H(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ue((K(),ze(ct,{variant:["danger","primary","icon"],size:"small",onClick:Tt(v,["stop","prevent"]),onEscape:k[0]||(k[0]=R=>r.value=!1)},{default:fe(()=>[ue(rt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${i.focusableIndex}.1`],[H(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ze("",!0)]),default:fe(()=>[e.option.label?(K(),ae("span",FX,yt(e.option.label),1)):Ze("",!0)]),_:1},8,["class","disabled","actived","size","variant"])),[[H(o),i.focusableIndex]]),e.option.subMenu?(K(),ae("div",{key:0,ref_key:"popupRef",ref:d,class:J(A.$style["submenu-container"])},[ue(Mk,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((T=e.option)==null?void 0:T.subMenu)||[]],"is-submenu":!1,onActionExecuted:b},null,8,["focusableIndex","layer","option-block"])],2)):Ze("",!0)],2)),[[H(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_82ug7_1","icon-wrapper":"_icon-wrapper_82ug7_11","confirm-action":"_confirm-action_82ug7_19"}}]]),AX={style:{"max-width":"225px","line-height":"14px"}},kX={style:{"max-width":"100px","line-height":"14px"}},OX=St(it({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Yt,o=Ji,s=e,i=t,r=$m(),{handelSelectAll:a}=r,{selectionStatus:l}=Ho(r),c=Z(()=>l.value===Ht.CHECKED),u=Z(()=>s.selectRowData.map(M=>M.id)),d=Z(()=>s.selectRowData.length>0);qi("bulkUpdate",d),qi("isSelectAll",c);const h=({itemIds:M,data:j})=>{const L=s.gridApi;M.forEach(se=>{if(!L){console.error("Grid API is undefined");return}const ce=L.getRowNode(se);if(ce){const De={...ce.data,status:j};ce.setData(De)}})},f=Z(()=>s.selectRowData),p=({itemIds:M,data:j})=>{const L=s.gridApi;if(!L){console.error("Grid API is undefined");return}M.forEach(se=>{const ce=L.getRowNode(se);if(ce){const De=ce.data.dateRange||[null,null];"startDate"in j&&j.startDate!==void 0&&(De[0]=j.startDate?new Date(j.startDate):null),"dueDate"in j&&j.dueDate!==void 0&&(De[1]=j.dueDate?new Date(j.dueDate):null);const Ie={...ce.data,dateRange:De};ce.setData(Ie)}}),i("updated")},g=Z(()=>s.selectRowData.map(M=>M.id)),v=M=>{const j=s.gridApi,{id:L,value:se}=M;if(!j){console.error("Grid API is undefined");return}g.value.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,[`metric_${L}`]:se};De.setData(Ie)}}),i("updated")},y=["primary"],b=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{i("unselect")},C=Rm(),{userPermissions:E}=Ho(C),D=Z(()=>E.value.includes(Dm)),x=()=>{const M=s.selectRowData.map(L=>L.id).join(","),j=Lo({type:"review_multiple_scenes",config:{reviewDomain:Cn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:M}}).url;window.open(j,"_blank")},A=M=>{const{assignees:j,type:L}=M,se=s.gridApi;if(!se){console.error("Grid API is not available for bulk update.");return}s.selectRowData.map(De=>{const Ie=se.getRowNode(De.id);if(!Ie)return null;const Ke=Ie.data.assignees||[];let z=[];switch(L){case"add":{const de=new Set(Ke.map(Fe=>Fe.id)),ie=j.filter(Fe=>!de.has(Fe.id));z=[...Ke,...ie];break}case"overwrite":{z=j;break}case"remove":{const de=new Set(j.map(ie=>ie.id));z=Ke.filter(ie=>!de.has(ie.id));break}case"removeAll":{z=[];break}}return{...Ie.data,assignees:z}}).filter(De=>De!==null).forEach(De=>{const Ie=se.getRowNode(De.id);Ie&&Ie.setData(De)})},{apiServices:k}=Qn(!1,s),T=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk delete.");return}const L=await((se=k.value)==null?void 0:se.bulkDeleteItems(P.value));(L==null?void 0:L.message)=="Done"&&(M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,isDeleted:!0,disabled:!0};De.setData(Ie)}}),j.deselectAll())},R=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id);if(!s.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const L=await((se=k.value)==null?void 0:se.bulkUnarchiveItems(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to unarchive items.");return}te(M,"isArchived",!1)},F=En("filterParams",void 0),P=Z(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:s.selectRowData.map(M=>M.id),entityId:s.entityId,filterParams:F!=null&&F.value?F.value:void 0})),$=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id);if(!s.gridApi){console.error("Grid API is not available for bulk archive.");return}const L=await((se=k.value)==null?void 0:se.bulkArchiveItems(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to archive items.");return}te(M,"isArchived",!0)},te=(M,j,L)=>{const se=s.gridApi;if(!se){console.error("Grid API is not available for bulk update.");return}const ce=M.map(De=>{const Ie=se.getRowNode(De);if(Ie){const Ke={...Ie.data,[j]:L};Ie.setData(Ke)}return Ie}).filter(De=>De!=null);se.redrawRows({rowNodes:ce})},U=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk thumbnail deletion.");return}const L=await((se=k.value)==null?void 0:se.deleteThumbnail(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to delete thumbnails.");return}M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,thumbnail:null};De.setData(Ie)}})},Y=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk rendition deletion.");return}const L=await((se=k.value)==null?void 0:se.deleteRendition(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to delete renditions.");return}M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,rendition:null};De.setData(Ie)}})},X=B(!1),ne=B(null),Re=async M=>{var j;console.log("Handling action:",M.id);try{switch(X.value=!0,M.id){case"unarchive":await R();break;case"delete":await T();break;case"archive":await $();break;case"delete-thumbnail":await U();break;case"delete-rendition":await Y();break;default:console.error("Unknown action:",M.id),X.value=!1;break}_t(()=>{X.value=!1})}catch{X.value=!1}finally{(j=ne.value)==null||j.focus()}};return(M,j)=>Ue((K(),ae("div",{class:J(M.$style["bulk-update-action"])},[pe("div",{class:J(M.$style["left-actions"])},[pe("div",{class:J(M.$style["selection-track"])},[ue(ct,{variant:["icon","tertiary"],onClick:S},{default:fe(()=>[ue(rt,{src:"XMarkSolid",source:"remote"})]),_:1}),H(l)==H(Ht).INDETERMINATE?(K(),ae("span",{key:0,class:J(M.$style["selected-count"])},yt(e.selectRowData.length)+" selected ",3)):Ze("",!0),H(l)==H(Ht).CHECKED?(K(),ae("span",{key:1,class:J(M.$style["selected-count"]),style:{"line-height":"14px"}},[j[0]||(j[0]=nt(' All in  " ',-1)),Ue((K(),ae("span",AX,[nt(yt(e.takeName),1)])),[[H(n),{content:e.takeName}]]),j[1]||(j[1]=nt(' " ',-1))],2)):Ze("",!0),!e.loading&&H(l)==H(Ht).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(K(),ze(ct,{key:2,variant:"secondary",onHandleClick:H(a)},{default:fe(()=>[pe("span",{class:J(M.$style["selected-count"]),style:{"line-height":"14px"}},[j[2]||(j[2]=nt(' Select all in  " ',-1)),Ue((K(),ae("span",kX,[nt(yt(e.takeName),1)])),[[H(n),{content:e.takeName}]]),j[3]||(j[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ze("",!0),pe("span",{class:J(M.$style.divider)},null,2)],2),ue(IX,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,onUpdated:h},null,8,["ids","workspace-id","entity-id"]),ue(bY,{onUpdate:A,ids:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),ue(MY,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,"row-selected":f.value,onUpdated:p},null,8,["ids","workspace-id","entity-id","row-selected"]),ue(xX,{onUpdate:v,selectedIds:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),pe("span",{class:J(M.$style.divider)},null,2),Ue((K(),ae("div",null,[D.value?(K(),ze(ct,{key:0,class:J(M.$style["action-button"]),variant:[...y,"icon"],onClick:x,disabled:s.selectRowData.length>40},{default:fe(()=>[ue(rt,{src:"PenRuler",class:J(M.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","disabled"])):Ze("",!0)])),[[H(n),s.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),pe("span",{class:J(M.$style.divider)},null,2),ue(kk,{placement:"top-end"},{trigger:fe(({open:L,closeDropdown:se})=>[Ue((K(),ze(ct,{onEscape:se,actived:L,ref_key:"moreActionRef",ref:ne,class:J(M.$style["action-button"]),variant:[...y,"icon"],loading:X.value},{default:fe(()=>[ue(rt,{src:"EllipsisVertical",class:J(M.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","variant","loading"])),[[H(o),"99999"],[H(n),{content:"More actions"}]])]),content:fe(({visible:L,closeDropdown:se})=>[(K(),ae(xt,null,xn(b,(ce,De)=>ue(ei,qt({clickable:!0,key:ce.id},{ref_for:!0},ce,{show:L,style:{borderLeft:0},"focus-index":"99999."+De,onClick:()=>{Re(ce),se()},onEscape:se}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1})],2)],2)),[[_i,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_16qqo_1","left-actions":"_left-actions_16qqo_19","right-actions":"_right-actions_16qqo_20","selection-track":"_selection-track_16qqo_25","close-icon":"_close-icon_16qqo_31","selected-count":"_selected-count_16qqo_35",divider:"_divider_16qqo_41","more-button":"_more-button_16qqo_46",dropdown:"_dropdown_16qqo_50","dropdown-content":"_dropdown-content_16qqo_53",delete:"_delete_16qqo_76","icon-btn":"_icon-btn_16qqo_83","selected-list":"_selected-list_16qqo_87"}}]]),Ga=St(it({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=as,n=Yt,o=e,s=Z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:i}=vo(s),r=Z(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=Z(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=ue(Sh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});Uw(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Z(()=>o.value===void 0);return(c,u)=>Ue((K(),ze(yo,nR(Pw(H(i))),{default:fe(()=>[pe("span",{class:J(c.$style["item-table-label-renderer"])},yt(o.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!r.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),MX=["placeholder","maxlength"],NX={key:0,class:"wrapper-suffix"},LX=St(it({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=as,s=Yt,i=e,r=n,a=B(i.value),l=B(null),c=B(null),u=B(i.value||""),d=B(!1),h=B(!1),f=Z(()=>{var R;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((R=i.value)==null?void 0:R.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p}=vo(f),g=R=>{const F=document.createElement("div");return F.textContent=R,F.innerHTML},v=()=>u.value!==a.value,y=()=>{h.value=!0,d.value=!1,u.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const R=g(l.value.value);if(!v()){d.value=!1;return}a.value=R,r("update:value",R),r("enter",R),d.value=!1},S=()=>{h.value||(i.saveOnBlur?b():y(),r("blur",u.value))},C=R=>{var F;if(R.key==="ArrowLeft"||R.key==="ArrowRight"){R.stopPropagation();return}R.ctrlKey&&R.key=="a"||R.key=="A"?(R.stopPropagation(),(F=l.value)==null||F.select()):R.key==="Enter"?(R.preventDefault(),R.stopPropagation(),b()):R.key==="Escape"&&(R.preventDefault(),R.stopPropagation(),y())},E=()=>{a.value=i.value,u.value=i.value,d.value=!0,_t(()=>{var R,F;(R=l.value)==null||R.click(),(F=l.value)==null||F.focus()})},D=()=>{var R;d.value?y():(R=l.value)==null||R.blur(),r("blur",u.value)},x={focus:()=>{E()}};Xt(()=>{var F;const R=(F=c.value)==null?void 0:F.$el;R&&(R.__sceneNameEditor=x)}),lo(()=>{const R=c.value;R&&delete R.__sceneNameEditor});const A=B(null),k=B(null);t({focus:E,blur:()=>{var R;return(R=l.value)==null?void 0:R.blur()},save:b,cancel:y,focusEditButton:()=>{_t(()=>{var R;(R=A.value)==null||R.focus()})},focusCancelButton:()=>{_t(()=>{var R;(R=k.value)==null||R.focus()})},startEdit:E});const T=Z(()=>i.value===void 0);return Xb(c,()=>{d.value&&S()}),(R,F)=>Ue((K(),ze(H(yo),qt(H(p),{ref_key:"wrapperRef",ref:c,bordered:i.bordered}),Yd({default:fe(()=>[d.value?Ze("",!0):Pt(R.$slots,"default",{key:0},()=>[Ue((K(),ae("span",{class:J(R.$style["label-renderer"])},[nt(yt(u.value),1)],2)),[[H(s),{content:u.value||void 0}]])]),Ue(pe("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":F[0]||(F[0]=P=>u.value=P),class:J(R.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:C,onBlur:S},null,42,MX),[[_i,d.value],[C1,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:fe(({hovered:P,focused:$})=>[P||$||e.keyboardFocusing?(K(),ae("div",NX,[(P||e.keyboardFocusing)&&!$?Ue((K(),ze(H(ct),{key:0,variant:["icon","secondary"],size:24,onClick:Tt(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:A,onKeydown:[Bn(Tt(E,["prevent","stop"]),["enter"]),Bn(Tt(D,["prevent","stop"]),["escape"])]},{default:fe(()=>[ue(H(rt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Edit"]]):$?Ue((K(),ze(H(ct),{key:1,variant:["icon","tertiary","danger"],size:24,onMousedown:Tt(y,["prevent"]),tabindex:"0",ref_key:"cancelButtonRef",ref:k,onKeydown:Bn(Tt(y,["prevent"]),["enter"])},{default:fe(()=>[ue(H(rt),{src:"XMarkSolid",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Cancel"]]):Ze("",!0)])):Ze("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(o),{isLoading:T.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),VX=["tabindex"],Nk=St(it({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Yt,s=as,i=e,r=n,a=B(i.value),l=B(i.value),c=B(null),u=B(null),d=En("bulkUpdate",!1),{apiServices:h}=Qn(!d,i),f=Z(()=>{var Y;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((Y=a==null?void 0:a.value)==null?void 0:Y.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=vo(f),g=Z(()=>{const Y=Cn.getInstance().getItem("ws.code"),X=Cn.getInstance().getItem("BASE_URL"),ne=Y||i.workspaceId;return Lo({type:"scene_hub",config:{baseDomain:X,ws_code:ne,scene_id:String(i.id)}}).url}),v=Z(()=>{var Y,X,ne;return((X=(Y=i.data)==null?void 0:Y.isProcessing)==null?void 0:X.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),y=Z(()=>{var Y,X,ne,Re,M;return((Y=i.data)==null?void 0:Y.isDeleted)==!0||((ne=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ne.state)==0||((M=(Re=i.data)==null?void 0:Re.isProcessing)==null?void 0:M.state)==1}),b=Z(()=>{var Y,X;return(X=(Y=i.data)==null?void 0:Y.isProcessing)==null?void 0:X.message}),S=Z(()=>{var Y;return((Y=i.data)==null?void 0:Y.isArchived)==1}),C=Z(()=>i.value===void 0),E=async Y=>{var X,ne,Re,M,j,L,se,ce,De,Ie;a.value=Y,p.value=!1;try{const Ke=await((ne=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:ne.call(X,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),z=PF.get(EF)||"UTC";if(Ke){const de=TF(Ke,z),ie={...i.data,...de};(Re=i.params)==null||Re.api.clearFocusedCell();const Fe=((j=(M=i.params)==null?void 0:M.column)==null?void 0:j.getColId())||"",G=((se=(L=i.params)==null?void 0:L.node)==null?void 0:se.rowIndex)||0;(ce=i.params)==null||ce.api.setFocusedCell(G,Fe),(Ie=(De=i.params)==null?void 0:De.node)==null||Ie.setData(ie),l.value=a.value,r("enter")}else a.value=l.value}catch(Ke){console.error("Failed to update scene name:",Ke),a.value=l.value}},D={focus:()=>{p.value=!0,_t(()=>{var Y;return(Y=u.value)==null?void 0:Y.focus()})},startEdit:()=>{var Y;(Y=u.value)==null||Y.startEdit()}},x=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Je(()=>i.value,Y=>{a.value=Y,l.value=Y}),Xt(()=>{const Y=x();Y&&(Y.__sceneNameEditor=D)}),lo(()=>{const Y=u.value,X=Y&&"$el"in Y?Y.$el:Y;X&&delete X.__sceneNameEditor});const A=Yh(),{openSceneHub:k}=A,T=Y=>{try{if(Y.ctrlKey||Y.metaKey){window.open(g.value,"_blank");return}k(String(i.id))}catch{window.open(g.value,"_blank")}finally{te()}},R=()=>{setTimeout(()=>{U.value=!0,F.value=0,_t(()=>{var Y;(Y=P.value)==null||Y.focus()})},300)},F=B(-1),P=B(null);t({focus:R,trigerFocus:R,startEdit:()=>{var Y;(Y=u.value)==null||Y.startEdit()}});const $=Y=>{if(Y.key==="Enter"){Y.preventDefault(),T(Y);return}if(Y.key==="Escape"){Y.preventDefault(),te();return}Y.key==="Tab"&&(Y.preventDefault(),Y.stopPropagation(),Y.stopImmediatePropagation(),_t(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},te=()=>{var ne,Re,M,j,L,se;U.value=!1,F.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const Y=((M=(Re=i.params)==null?void 0:Re.column)==null?void 0:M.getColId())||"",X=((L=(j=i.params)==null?void 0:j.node)==null?void 0:L.rowIndex)||0;(se=i.params)==null||se.api.setFocusedCell(X,Y)},U=B(!1);return(Y,X)=>Ue((K(),ze(LX,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:i.disabled,"read-only":i.readOnly||C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:E,"max-length":25,bordered:!0,keyboardFocusing:U.value,onBlur:te},{default:fe(()=>[Ue(pe("div",{class:J(Y.$style["scene-name-display"])},[Ue((K(),ae("a",{tabindex:F.value,ref_key:"nameRef",ref:P,onClick:Tt(T,["prevent"]),onKeydown:$,target:"_blank",class:J(Y.$style["scene-name-text"])},[nt(yt(a.value),1)],42,VX)),[[H(o),{content:a.value}]]),S.value?(K(),ae("div",{key:0,class:J([Y.$style["icon-processing"],Y.$style.archived])},[ue(rt,{src:"BoxArchive",color:"#959595"})],2)):Ze("",!0),y.value?Ue((K(),ae("div",{key:1,class:J([Y.$style["icon-processing"],Y.$style.processing,v.value&&Y.$style["icon-red"]])},[ue(rt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(o),b.value]]):Ze("",!0)],2),[[_i,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(s),{isLoading:C.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1460z_1","scene-name-display":"_scene-name-display_1460z_11","icon-processing":"_icon-processing_1460z_18",archived:"_archived_1460z_26",processing:"_processing_1460z_29","icon-red":"_icon-red_1460z_33","scene-name-text":"_scene-name-text_1460z_38"}}]]),dS=St(it({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const o=Ji,s=B([]),i=e,r=B(null),a=Z(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Z(()=>{let y=[];return typeof i.variant=="string"?y.push(i.variant):Array.isArray(i.variant)&&(y=[...i.variant]),[...y,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=eo({offset:[0,0]});function v(y){c("select",y),u()}return qd(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Je(d,y=>{var b;y&&((b=p.value)==null||b.focus())}),(y,b)=>(K(),ae("div",{class:J(y.$style["button-dropdown-wrapper"]),style:cn({"--button-size":a.value})},[pe("div",{class:J(y.$style["button-group"])},[Pt(y.$slots,"prefix"),pe("div",{ref_key:"triggerRef",ref:f,class:J(H(d)?y.$style.open:"")},[Pt(y.$slots,"triggerDropdown",{open:H(d)},()=>[i.readOnly?Ze("",!0):Ue((K(),ze(ct,{key:0,onEscape:H(u),ref_key:"mainButton",ref:r,actived:H(d),class:J(y.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:fe(()=>[Pt(y.$slots,"iconDropdown",{},()=>[ue(rt,{class:J(y.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(o),e.tabIndex]])])],2)],2),pe("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:J(y.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(K(!0),ae(xt,null,xn(e.options,(S,C)=>Ue((K(),ze(ei,qt({ref_for:!0,ref:E=>s.value[C]=E,key:S.value},{ref_for:!0},{...S},{"icon-name":S.icon,onClick:Tt(E=>v(S.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:fe(()=>[nt(yt(S.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(o),`${e.tabIndex}.${C}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),rf=St(it({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,o=e,s=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},r=Z(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(K(),ae("div",{class:J(a.$style["close-wrapper"])},[e.disableRemove?Ze("",!0):(K(),ae("div",{key:0,class:J(a.$style["close-button"])},[Ue((K(),ze(ct,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:fe(()=>[ue(rt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),r.value]])],2)),Pt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_bvkx4_1","close-button":"_close-button_bvkx4_5"}}]]),BX=St(it({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Yt,n=as,o=e,{isEditing:s}=Ru(o),i=B(o.value),r=B(null),a=B(null),{apiServices:l}=Qn(!0,o),c=B(!0),u=()=>{c.value=o.value===void 0};Zp(()=>{u()}),Xt(()=>{u()}),Je(()=>o.value,A=>{u()});const d=Z(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:r,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=vo(d),p=Z(()=>{var A;return((A=i.value)==null?void 0:A.slice(0,o.maxVisible))||[]}),g=Z(()=>{var A;return Math.max(0,(((A=i.value)==null?void 0:A.length)||0)-o.maxVisible)}),v=Z(()=>{var A;return g.value<=0?"":((A=i.value)==null?void 0:A.slice(o.maxVisible).map(k=>k.name).join(", "))||""}),y=Z(()=>p.value.map(A=>({id:A.id,name:A.name,initial:A.initial,avatarId:A.id,profile_image:A.profile_image,color:A.color,size:24,user:A}))),b=Z(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>o.value,A=>{i.value=A},{immediate:!0,deep:!0});const S=async A=>{var T,R,F;await x(A)&&(i.value=(T=i.value)==null?void 0:T.filter(P=>P.id!==A),(F=o.params)==null||F.node.setData({...(R=o.params)==null?void 0:R.node.data,assignees:i.value}))},C=A=>{var T;const k=Cn.getInstance().getItem("ws.code");return((T=l.value)==null?void 0:T.getUserInformation(k,A))||Promise.resolve(null)},{id:E}=Lp(o),D=A=>{var T,R;const k=(R=(T=o.params)==null?void 0:T.api)==null?void 0:R.getRowNode(String(E.value));k==null||k.setDataValue("assignees",Nx(A.assignees))},{removeAssignee:x}=um({...o,entityId:o.entityId,updateRowData:D,value:o.value,errorCallback:()=>{}});return(A,k)=>Ue((K(),ze(yo,qt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:fe(()=>{var T;return[pe("div",{class:J(A.$style.assigneeGroupRenderer)},[((T=i.value)==null?void 0:T.length)===0?(K(),ze(rt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:cn(b.value)},null,8,["style"])):Ze("",!0),(K(!0),ae(xt,null,xn(y.value,R=>(K(),ze(rf,{key:R.id,"disable-remove":o.readOnly||o.disabled,onClear:F=>S(R.id),style:{marginLeft:"0"}},{default:fe(()=>[ue(Zl,{user:R.user,"show-profile":!0,apiUpdateFunction:C,class:J(A.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ue((K(),ae("div",{key:1,class:J(A.$style["extra-avatars"])},[nt(" +"+yt(g.value),1)],2)),[[H(t),v.value]]):Ze("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),$X=St(it({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var D,x;const t=Yt,n=as,o=yb(),s=e,i=B(null),r=B(null),{isEditing:a}=Ru(s),l=A=>{if(A){if(typeof A=="string")return A;if(A instanceof Date)return A.toISOString()}},c=Z(()=>s.value===void 0),u=Z(()=>{var A;return(A=s.data)==null?void 0:A.isStarted}),d=Z(()=>{var A;return(A=s.data)==null?void 0:A.isCompleted}),h=Z(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=Z(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Z(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=vo(p),{startDate:v,endDate:y,startClasses:b,endClasses:S,fullStartDate:C,fullEndDate:E}=E7({start:l((D=s.value)==null?void 0:D[0]),end:l((x=s.value)==null?void 0:x[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(A,k)=>Ue((K(),ze(yo,qt(H(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:fe(()=>[c.value?Ze("",!0):(K(),ae("div",{key:0,class:J(A.$style.dateRangeRenderer)},[h.value?Ze("",!0):(K(),ze(rt,{key:0,src:"Calendar",class:J(A.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(K(),ae(xt,{key:1},[Ue((K(),ae("span",{class:J([A.$style.dateLabelDisplay,...H(b).map(T=>A.$style[T])])},[nt(yt(H(v)),1)],2)),[[H(t),H(C)]]),k[0]||(k[0]=pe("span",null,"→",-1)),Ue((K(),ae("span",{class:J([A.$style.dateLabelDisplay,...H(S).map(T=>A.$style[T])])},[nt(yt(H(y)),1)],2)),[[H(t),H(E)]])],64)):Ze("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),HX=it({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:yb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=B(null);Xt(()=>{_t(()=>{o.value&&o.value.focus()})});const s=e,i=n,r=()=>{var y;(y=s.params)==null||y.api.stopEditing(),i("closed")},a=y=>`${mt.fromJSDate(y,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async y=>{await v({startDate:y[0]?a(y[0]):null,dueDate:y[1]?a(y[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async y=>{await v({startDate:y?a(y):null})},h=async y=>{await v({dueDate:y?a(y):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=En("bulkUpdate",!1),{apiServices:g}=Qn(!p,s),v=async y=>{var b,S,C,E,D;try{const x=(b=o.value)==null?void 0:b.getValues(),A=await((C=(S=g.value)==null?void 0:S.changeDate)==null?void 0:C.call(S,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:y.startDate,dueDate:y.dueDate}));A!=null&&A.message&&((D=s.params)==null||D.node.setData({...(E=s.params)==null?void 0:E.node.data,dateRange:x==null?void 0:x.dateRange}))}catch(x){console.error("Failed to update scene name:",x)}};return t({focus:()=>{_t(()=>{var y;(y=o.value)==null||y.focus()})}}),(y,b)=>(K(),ze(xm,qt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:r,ref_key:"calendarRef",ref:o}),null,16))}}),GX=St(it({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=B(null),o=B(0);let s=null;Xt(()=>{n.value&&(s=new ResizeObserver(r=>{for(const a of r)o.value=a.contentRect.height}),s.observe(n.value))}),$c(()=>{s&&n.value&&s.unobserve(n.value)});const i=Z(()=>{const r=o.value;return r>120?r-42-36:0});return(r,a)=>(K(),ae("div",{class:J(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[pe("div",{class:J(r.$style["item-header"])},[pe("div",{class:J(r.$style["item-header__left"])},[Pt(r.$slots,"header-left",{},()=>[pe("h1",{class:J(r.$style["item-header__title"])},[Pt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),pe("div",{class:J(r.$style["item-header__spacer"])},null,2),pe("div",{class:J(r.$style["item-header__actions"])},[Pt(r.$slots,"header-actions")],2)],2),Pt(r.$slots,"grid",{availableHeight:i.value}),pe("div",{class:J(r.$style.footer)},[Pt(r.$slots,"footer")],2),Pt(r.$slots,"new-row"),Pt(r.$slots,"bulk-update-actions"),Pt(r.$slots,"snackbar"),Pt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Lk=(e,t)=>{const n=B(Number(e.value.value)),o=Z(()=>e.value.metricConfig),s=Z(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),i=17,r=Z(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:s,metricConfig:o,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Vk=St(it({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=as,o=Yt,s=e,i=ow(!1),r=B(null),a=B(null),{isEditing:l}=Ru(s),c=Z(()=>{var T,R;return{value:s.value,metricConfig:((R=(T=s.params)==null?void 0:T.colDef)==null?void 0:R.context)||s.config,error:s.error,hovered:i.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Lk(c,i),f=Z(()=>{var F,P,$;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const T=S.value,R=(F=d.value)==null?void 0:F.morpheme_type;return R==="prefix"?`${((P=d.value)==null?void 0:P.morpheme_value)||""} ${T}`.trim():R==="suffix"?`${T} ${(($=d.value)==null?void 0:$.morpheme_value)||""}`.trim():T}),p=Z(()=>{const{format_type:T,format_value:R}=d.value;if(T==="dropdown"&&typeof R=="string"&&R.startsWith("["))try{return JSON.parse(R)}catch{return[]}return[]}),g=Z(()=>({disabled:s.disabled,error:u.value.isError,inputRef:r,wrapperRef:a,clickable:!0,readOnly:s.readOnly,isEmpty:u.value.isEmpty})),{argsMain:v,isHover:y}=vo(g),b=(T,R,F="en-US")=>new Intl.NumberFormat(F,{minimumFractionDigits:R,maximumFractionDigits:R}).format(T),S=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const T=s.value,{format_type:R,format_value:F,mapping:P}=d.value;if(P&&typeof P=="object"&&!Array.isArray(P)){const $=P[`!${T}`];if($)return $}if(R==="dropdown"){const $=p.value.find(te=>String(te.name)===String(T));if($)return $.name}if(typeof T=="string"){const $=Number(T);return Number.isNaN($)?T:T.replace(/[.-]/g,"").length>16?C(T,F):C($,F)}return typeof T=="number"?C(T,F):String(T)}),C=(T,R)=>{const F=Number.parseInt(String(R)||"2",10),P=Number.isFinite(F)&&F>=0?F:2;try{if(typeof T=="string"){const $=T.split("."),te=$[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),U=$[1]?$[1].substring(0,P).padEnd(P,"0"):"0".repeat(P);return P>0?`${te}.${U}`:te}return b(T,P)}catch($){return console.error("Error formatting metric value:",$,{num:T,decimals:P}),String(T)}},{copyToClipboard:E,tooltip:D}=wb(S.value);Je(()=>s.value,(T,R)=>{const F=Number(T);Number.isFinite(F)&&F!==h.value?h.value=F:T==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const A=()=>{i.value=!0},k=()=>{i.value=!1};return(T,R)=>Ue((K(),ze(yo,qt(H(v),{onMouseenter:A,style:{"--icon-size":"24px"},onMouseleave:k,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:fe(()=>[s.disabled?Ze("",!0):(K(),ae("div",{key:0,class:J([T.$style.suffix,"wrapper-suffix"])},[i.value&&!H(u).isEmpty&&!H(u).isError?Ue((K(),ze(ct,{key:0,variant:["icon","secondary"],size:24,onClick:Tt(H(E),["prevent","stop"])},{default:fe(()=>[ue(rt,{src:"Copy",source:"remote",size:12})]),_:1},8,["onClick"])),[[H(o),{content:H(D),hideOnClick:!1,contentClass:"extra-padding"}]]):Ze("",!0)],2))]),default:fe(()=>{var F;return[pe("div",{class:J(T.$style["metric-wrapper"])},[pe("div",{class:J([T.$style["metric-content"],s.disabled?T.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(K(),ae(xt,{key:0},[H(u).pendingCalculation?Ue((K(),ae("span",{key:0,class:J(T.$style["metric-empty"])},[...R[0]||(R[0]=[nt(" - ",-1)])],2)),[[H(o),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(K(),ae("span",{key:1,class:J(T.$style["metric-empty"])}," - ",2)):Ze("",!0)],64)):Ze("",!0),H(u).isError?Ue((K(),ae("div",{key:1,class:J(T.$style["metric-error"])},[...R[1]||(R[1]=[nt(" Error ",-1)])],2)),[[H(o),"Something went wrong. Review formula, inputs and retry."]]):Ze("",!0),!H(u).isEmpty&&!H(u).isError?Ue((K(),ae("span",{key:2,class:J([T.$style["metric-value"],H(y)?T.$style.hovered:"",{[T.$style.disabled]:s.disabled}])},[nt(yt(S.value),1)],2)),[[H(o),{content:f.value,bypassOverflowCheck:!!((F=H(d))!=null&&F.morpheme_value)||H(u).isEmpty}]]):Ze("",!0)],2)],2)]}),_:1},16,["actived"])),[[H(n),{isLoading:H(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),UX={key:0,style:{color:"#6b6b6b"}},WX=St(it({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Yt,o={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},s={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},c=Z(()=>{var F,P;if(a.headerType)return a.headerType;if(((P=(F=a.params)==null?void 0:F.column)==null?void 0:P.getColId()).includes("metric"))return"default";const R=a.headerType??a.params.column.getColId();return l[R]||"default"}),u=B(),d=()=>{var R,F,P;const T=(F=(R=a.params)==null?void 0:R.column)==null?void 0:F.getColDef();if((P=T.colId)!=null&&P.includes("metric")){if(T.context.is_primary==1)return"primary";if(T.context.is_point_metric==1)return"secondary"}};qd(()=>{u.value=d()}),Xt(()=>{u.value=d()});const h=Z(()=>{var T,R;return((R=(T=a.params)==null?void 0:T.column.getColDef().context)==null?void 0:R.morpheme_value)||void 0}),f=Z(()=>{var T;return(T=a.params)==null?void 0:T.displayName}),p=Z(()=>{let T=[];switch(c.value){case"dateRange":T=Object.values(o).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;case"date":T=Object.values(s).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;case"number":T=Object.values(i).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;default:T=Object.values(r).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break}return v.value!=="none"&&T.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:x.value=="none"}),T}),g=Z(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=B(a.modelValue??"none"),y=T=>{E("update:modelValue",T),E("sort-changed",T)},b=T=>{v.value=T},S=Di(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let T;v.value==="none"?T="asc":v.value==="asc"?T="desc":T="none",v.value=T}else{const T=[o.START_ASC.value,o.START_DESC.value,o.DUE_ASC.value,o.DUE_DESC.value,"none"],F=(T.indexOf(v.value)+1)%T.length;v.value=T[F]}},ir),C=Z(()=>{if(v.value==="none")return"No sorting applied";const T=p.value.find(R=>R.value===v.value);return(T==null?void 0:T.label)||""}),E=t,D=Z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});Je(()=>a.modelValue,T=>{T!=v.value&&(v.value=T)}),Je(v,T=>{T!==a.modelValue&&y(T)});const x=B(v.value);Je(()=>v.value,T=>{x.value=T});const A=T=>{var $,te;if(a.readOnly||a.disabled)return;let R=0;T.key==="ArrowDown"?R=1:T.key==="ArrowUp"&&(R=-1);const F=p.value.findIndex(U=>U.value===x.value),P=p.value.length;if(T.key==="Enter"||T.key===" ")T.preventDefault(),v.value=x.value,($=k.value)==null||$.hide();else if(R!==0){T.preventDefault();let U=(F+R+P)%P;x.value=p.value[U].value}else T.key==="Escape"&&((te=k.value)==null||te.hide())},k=B(null);return Xt(()=>{var T,R;(R=(T=k.value)==null?void 0:T.$el)==null||R.addEventListener("keydown",A)}),$c(()=>{var T,R;(R=(T=k.value)==null?void 0:T.$el)==null||R.removeEventListener("keydown",A)}),(T,R)=>(K(),ze(dS,{ref_key:"dropdownRef",ref:k,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(S),onSelect:R[0]||(R[0]=F=>b(F))},{prefix:fe(()=>[ue(ct,{variant:["text"],onClick:H(S),size:"small"},{default:fe(()=>[Ue((K(),ae("b",null,[nt(yt(f.value),1)])),[[H(n),{content:f.value}]]),h.value?(K(),ae("small",UX," ("+yt(h.value)+") ",1)):Ze("",!0),u.value=="primary"?Ue((K(),ae("div",{key:1,class:J(T.$style["icon-metric"])},[ue(rt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Woohoo metric"]]):Ze("",!0),u.value=="secondary"?Ue((K(),ae("div",{key:2,class:J(T.$style["icon-metric"])},[ue(rt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Point Metric"]]):Ze("",!0)]),_:1},8,["onClick"])]),iconDropdown:fe(()=>[Ue(ue(rt,{src:g.value,source:"remote",color:D.value},null,8,["src","color"]),[[H(n),C.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),zX=["disabled","readonly","checked","indeterminate"],Bk=St(it({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Yt,o=Ji,s=e,i=t,r=Z(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=Z(()=>s.allowIndeterminate?[Ht.UNCHECK,Ht.INDETERMINATE,Ht.CHECKED]:[Ht.UNCHECK,Ht.CHECKED]),l=Z(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ht.UNCHECK:return s.tooltipText.unchecked;case Ht.INDETERMINATE:return s.tooltipText.indeterminate;case Ht.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=B(typeof s.modelValue=="boolean"?s.modelValue?Ht.CHECKED:Ht.UNCHECK:s.modelValue),d=Z(()=>({checked:u.value===Ht.CHECKED,indeterminate:u.value===Ht.INDETERMINATE,none:u.value===Ht.UNCHECK})),h=Z(()=>s.disabled||s.readOnly);return Je(()=>u.value,f=>{i("update:modelValue",f===Ht.CHECKED)}),(f,p)=>Ue((K(),ae("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:J([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:cn({"--input-size":r.value})},null,46,zX)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),jX=St(it({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Yt,o=$m(),{setSelectionStatus:s}=o,{rowCount:i,selectionStatus:r}=Ho(o),a=B(new Set);Je(r,C=>{s(C)},{immediate:!0});const l=Z(()=>r.value!==Ht.UNCHECK),c=Z(()=>({checked:r.value===Ht.CHECKED,indeterminate:r.value===Ht.INDETERMINATE,UNCHECK:r.value===Ht.UNCHECK})),u=Z(()=>({[Ht.UNCHECK]:"Click to select all",[Ht.INDETERMINATE]:"Click to clear selection",[Ht.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Z(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:C,state:E})=>{if(C)if(E===Ht.UNCHECK)C.deselectAll(),a.value.clear(),r.value=E;else if(E===Ht.CHECKED){const D=new Set;C.forEachNode(x=>{x.isSelected()&&D.add(x.id||"")}),a.value=D,C.forEachNode(x=>x.setSelected(!0)),r.value=E}else C.forEachNode(D=>D.setSelected(!0)),r.value=E},p=()=>{var D;const C=(D=t.params)==null?void 0:D.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ht.UNCHECK]:Ht.INDETERMINATE,[Ht.INDETERMINATE]:Ht.UNCHECK,[Ht.CHECKED]:Ht.UNCHECK};f({api:C,state:E[r.value]})},g=C=>{var x;const E=(x=t.params)==null?void 0:x.api;if(!E){console.error("no api");return}const D={INDETERMINATE:Ht.INDETERMINATE,GLOBAL:Ht.CHECKED,UNCHECK:Ht.UNCHECK};f({api:E,state:D[C]})},v=Di(C=>{const{selected:E,total:D}=h(C);if(D==0){r.value=Ht.UNCHECK;return}E===D?r.value=Ht.CHECKED:E===0?r.value=Ht.UNCHECK:r.value=Ht.INDETERMINATE},300);let y=[];const b=C=>{v(C)};Xt(()=>{var A;const C=(A=t.params)==null?void 0:A.api;if(!C)return;const E=k=>v(k.api),D=()=>b(C),x=()=>b(C);C.addEventListener("selectionChanged",E),C.addEventListener("rowDataUpdated",D),C.addEventListener("modelUpdated",D),y=[()=>C.removeEventListener("selectionChanged",E),()=>C.removeEventListener("rowDataUpdated",D),()=>C.removeEventListener("modelUpdated",x)]}),lo(()=>{y.forEach(C=>C())});const S=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,E)=>(K(),ze(dS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:fe(()=>[Ue((K(),ze(Bk,{"tab-index":"8",id:S,disabled:t.disabled,key:H(r),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(r),"onUpdate:modelValue":E[0]||(E[0]=D=>pn(r)?r.value=D:null),onChange:p,"aria-label":H(r)===H(Ht).CHECKED?"All items selected":"Select visible items",class:J(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),KX={key:1},qX=St(it({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=as,n=Yt,o=e,{isEditing:s}=Ru(o),i=B(null),r=B(null),a=Z(()=>o.value),l=Z(()=>a.value===void 0),c=Z(()=>{var f;return((f=a.value)==null?void 0:f.name)||"No status"}),u=Z(()=>{var p;const f=(p=a.value)==null?void 0:p.color;return{backgroundColor:wC(f)?f:"#fff",border:bh(f,"white")?"1px solid #ccc":"1px solid #fff"}}),d=Z(()=>{var f;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:rj((f=a.value)==null?void 0:f.label),inputRef:i,wrapperRef:r,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:h}=vo(d);return(f,p)=>Ue((K(),ze(H(yo),qt(H(h),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:fe(()=>[l.value?Ze("",!0):(K(),ae("div",{key:0,class:J(f.$style["status-renderer"])},[a.value?(K(),ae(xt,{key:0},[pe("div",{class:J(f.$style["status-renderer__color-code"]),style:cn(u.value)},null,6),Ue((K(),ae("div",{class:J(f.$style["status-renderer__status-name"])},[nt(yt(c.value),1)],2)),[[H(n),{content:c.value}]])],64)):l.value?Ze("",!0):(K(),ae("div",KX,"No status"))],2))]),_:1},16)),[[H(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_gdyr9_1","status-renderer__color-code":"_status-renderer__color-code_gdyr9_10","status-renderer__status-name":"_status-renderer__status-name_gdyr9_20"}}]]),$k=St(it({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,{popupRef:s,show:i,hide:r,isVisible:a}=I7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{o.closeOnEscape&&u.key==="Escape"&&a.value&&r()};Xt(()=>{document.addEventListener("keydown",l)}),lo(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const c=n;return Je(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=bs("tooltip");return K(),ae("div",{ref_key:"popupRef",ref:s,class:J(u.$style.popupContainer)},[pe("div",{class:J(u.$style.popupWrapper)},[pe("div",{class:J(u.$style.header)},[pe("span",{class:J(u.$style["header-title"])},yt(e.popupName),3),Ue((K(),ze(ct,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:H(r),"aria-label":"Close popup"},{default:fe(()=>[ue(rt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),pe("div",{class:J(u.$style.body)},[Pt(u.$slots,"default")],2),pe("div",{class:J(u.$style.footer)},[Pt(u.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),YX={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class ZX extends Error{}class Ua extends ZX{constructor(){super("Zone is an abstract class")}}class Hk{get type(){throw new Ua}get name(){throw new Ua}get ianaName(){return this.name}get isUniversal(){throw new Ua}offsetName(t,n){throw new Ua}formatOffset(t,n){throw new Ua}offset(t){throw new Ua}equals(t){throw new Ua}get isValid(){throw new Ua}}const hS=new Map;function XX(e){let t=hS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),hS.set(e,t)),t}const JX={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function QX(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,i,r,a,l,c,u]=o;return[r,s,i,a,l,c,u]}function eJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:i,value:r}=n[s],a=JX[i];i==="era"?o[a]=r:Gm(a)||(o[a]=parseInt(r,10))}return o}const fS=new Map;class Hm extends Hk{static create(t){let n=fS.get(t);return n===void 0&&fS.set(t,n=new Hm(t)),n}static resetCache(){fS.clear(),hS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Hm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return oJ(t,n,o,this.name)}formatOffset(t,n){return Wm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=XX(this.name);let[s,i,r,a,l,c,u]=o.formatToParts?eJ(o,n):QX(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=nJ({year:s,month:i,day:r,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let pS=null;class Pu extends Hk{static get utcInstance(){return pS===null&&(pS=new Pu(0)),pS}static instance(t){return t===0?Pu.utcInstance:new Pu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Pu(Uk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Wm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Wm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Wm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Gm(e){return typeof e>"u"}function Um(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function Gk(e){if(!(Gm(e)||e===null||e===""))return parseInt(e,10)}function tJ(e){if(!(Gm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function nJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function oJ(e,t,n,o=null){const s=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(i.timeZone=o);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Uk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Wm(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Um(n,2)}:${Um(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Um(n,2)}${Um(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Wk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Au(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function ku(...e){return t=>e.reduce(([n,o,s],i)=>{const[r,a,l]=i(t,s);return[{...n,...r},a||o,l]},[{},null,1]).slice(0,2)}function zk(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=Gk(t[n+s]);return[o,null,n+s]}}const jk=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,sJ=`(?:${jk.source}?(?:\\[(${Wk.source})\\])?)?`,Kk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,qk=RegExp(`${Kk.source}${sJ}`),gS=RegExp(`(?:T${qk.source})?`),iJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,rJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,aJ=/(\d{4})-?(\d{3})/,lJ=zk("weekYear","weekNumber","weekDay"),cJ=zk("year","ordinal"),uJ=/(\d{4})-(\d\d)-(\d\d)/,Yk=RegExp(`${Kk.source} ?(?:${jk.source}|(${Wk.source}))?`),dJ=RegExp(`(?: ${Yk.source})?`);function Ou(e,t,n){const o=e[t];return Gm(o)?n:Gk(o)}function hJ(e,t){return[{year:Ou(e,t),month:Ou(e,t+1,1),day:Ou(e,t+2,1)},null,t+3]}function Mu(e,t){return[{hours:Ou(e,t,0),minutes:Ou(e,t+1,0),seconds:Ou(e,t+2,0),milliseconds:tJ(e[t+3])},null,t+4]}function af(e,t){const n=!e[t]&&!e[t+1],o=Uk(e[t+1],e[t+2]),s=n?null:Pu.instance(o);return[{},s,t+3]}function lf(e,t){const n=e[t]?Hm.create(e[t]):null;return[{},n,t+1]}Au(iJ,gS),Au(rJ,gS),Au(aJ,gS),Au(qk),ku(hJ,Mu,af,lf),ku(lJ,Mu,af,lf),ku(cJ,Mu,af,lf),ku(Mu,af,lf),ku(Mu),Au(uJ,dJ),Au(Yk),ku(Mu,af,lf);function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var wo;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(wo||(wo={})),wo.review,wo.review_take,wo.review_scene,wo.review_rendition,wo.review_frame,wo.review_rendition_comment,wo.review_comment,wo.scene_hub,wo.hub_rendition,wo.hub_comment,wo.people_insight,wo.people_detail,wo.project,wo.woohoo,wo.update,wo.core,wo.project_focusMode;var mS=null;function fJ(e){mS=e}function zm(){if(!mS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return mS}function Zk(){try{var e=zm();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function pJ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Nu(o)==="object")Object.keys(o).forEach(function(r){var a="{".concat(r,"}"),l=o[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),s=s.replace(/{value}/g,i)}return s}function gJ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var i=s[o],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function Xk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function Jk(e,t){if(!e||Nu(e)!=="object")return null;try{var n=zm();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),i=0,r=s;i<r.length;i++){var a=r[i],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var y,b=t.toUpperCase();v=(y=p[g])===null||y===void 0||(y=y.errorMessages)===null||y===void 0||(y=y[b])===null||y===void 0||(y=y.validation_rules)===null||y===void 0?void 0:y[c]}if(!v){var S;v=(S=p[g])===null||S===void 0||(S=S.errorMessages)===null||S===void 0||(S=S.GEN)===null||S===void 0||(S=S.validation_rules)===null||S===void 0?void 0:S[c]}if(v&&typeof v=="string")return pJ(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function mJ(e){if(!e)return Zk();var t=e.code,n=e.error,o=e.details,s=e.message;if(Xk(o)&&o){var i=Jk(o,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=zm();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Nu(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l="errorMessages.".concat(a,".").concat(n.key),c=zm(),u=c.t(l);if(console.log("[Error Utils Debug]",u),u&&u!==l){var d=u;return o!=null&&o.context&&(d=gJ(d,o.context)),t!==""?"[".concat(t,"] ").concat(d):d}}catch(f){console.error("[Error Utils Debug]",f)}}if(n&&Nu(n)!=="object"&&Xk(o)){var h=Jk(o);if(h)return t!==""?"[".concat(t,"] ").concat(h):h}return s||Zk()}var Qk={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}",in:"Update failed. Only these values are allowed: {value}",between:"Update failed. Enter a value between {value}"},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const cf=Yl("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")s({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=mJ((c=l==null?void 0:l.res)==null?void 0:c.data);s({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=B([]),n=(l,c)=>{const u=YX[l];if(u){const d=u[c];if(d){s({id:l,type:c,message:d});return}}else s({id:l,type:c,message:l})},o=new Map,s=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{i(u.id),o.delete(u.id)},c);o.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function i(l){t.value=t.value.filter(u=>u.id!==l);const c=o.get(l);c&&(clearTimeout(c.timeoutId),o.delete(l))}function r(l){const c=o.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=o.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{i(l),o.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:s,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),vJ=["onMouseenter","onMouseleave"],yJ=["innerHTML"],wJ=["innerHTML"],CJ=["data-tooltip"],bJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},SJ=St(it({__name:"Snackbar",setup(e){const t=Yt,n=iU,o=cf(),{removeNotification:s}=o,{notifications:i}=Ho(o),r=f=>f.trim().startsWith("<svg"),a=B("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=B(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(K(),ze(GG,{name:"list",tag:"div",class:J(["notification-center",f.$style["notification-wrapper"]])},{default:fe(()=>[(K(!0),ae(xt,null,xn(H(i),g=>{var v;return Ue((K(),ae("div",{key:g.id,class:J([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:y=>d(g.id),onMouseleave:y=>h(g.id)},[pe("p",{class:J(f.$style.snackbar__message)},[pe("span",{class:J(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(K(),ze(rt,{key:0,src:"CircleCheck",source:"remote"})):Ze("",!0),!g.icon&&g.type=="interactive"?(K(),ze(rt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(K(),ze(rt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(K(),ae("i",{key:3,class:J(f.$style["icon-draw"]),innerHTML:g.icon},null,10,yJ)):g.icon&&!r(g.icon)?(K(),ze(rt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ze("",!0)],2),pe("span",{class:J(f.$style["error-message"])},[pe("span",{class:J(f.$style.message),innerHTML:g.message},null,10,wJ)],2)],2),g.actions?(K(),ae("div",{key:0,class:J(f.$style["actions-notification"]),"data-notification":"true"},[(K(!0),ae(xt,null,xn(g.actions,y=>(K(),ze(ct,qt({key:y.label},{ref_for:!0},y,{onClick:Tt(y.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:fe(()=>[y.btnIcon?(K(),ze(rt,{key:0,src:y.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ze("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ze("",!0),g.type!=="interactive"?Ue((K(),ae("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ue(ct,{variant:"secondary",onClick:y=>c(g.message),class:J(f.$style["copy-btn"])},{prefix:fe(()=>[ue(rt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,CJ)),[[H(t),a.value]]):Ze("",!0),g.type=="interactive"?Ue((K(),ae("div",bJ,[ue(ct,{variant:"tertiary",onClick:y=>H(s)(g.id),class:J(f.$style["close-btn"]),size:18},{default:fe(()=>[ue(rt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Ze("",!0)],42,vJ)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
144
+ `+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jl(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&Vm.assertOptions(o,{silentJSONParsing:lr.transitional(lr.boolean),forcedJSONParsing:lr.transitional(lr.boolean),clarifyTimeoutError:lr.transitional(lr.boolean)},!1),s!=null&&(Ve.isFunction(s)?n.paramsSerializer={serialize:s}:Vm.assertOptions(s,{encode:lr.function,serialize:lr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Vm.assertOptions(n,{baseUrl:lr.spelling("baseURL"),withXsrfToken:lr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Ve.merge(i.common,i[n.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ds.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Rk.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{u=Rk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jl(this.defaults,t);const n=pk(t.baseURL,t.url,t.allowAbsoluteUrls);return ik(n,t.params,t.paramsSerializer)}};Ve.forEach(["delete","get","head","options"],function(t){Ql.prototype[t]=function(n,o){return this.request(Jl(o||{},{method:t,url:n,data:(o||{}).data}))}}),Ve.forEach(["post","put","patch"],function(t){function n(o){return function(i,r,a){return this.request(Jl(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ql.prototype[t]=n(),Ql.prototype[t+"Form"]=n(!0)});let mX=class jB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const o=this;this.promise.then(s=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const r=new Promise(a=>{o.subscribe(a),i=a}).then(s);return r.cancel=function(){o.unsubscribe(i)},r},t(function(i,r,a){o.reason||(o.reason=new Fu(i,r,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jB(function(s){t=s}),cancel:t}}};function vX(e){return function(n){return e.apply(null,n)}}function yX(e){return Ve.isObject(e)&&e.isAxiosError===!0}const uS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(uS).forEach(([e,t])=>{uS[t]=e});function xk(e){const t=new Ql(e),n=WA(Ql.prototype.request,t);return Ve.extend(n,Ql.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return xk(Jl(e,s))},n}const to=xk(tf);to.Axios=Ql,to.CanceledError=Fu,to.CancelToken=mX,to.isCancel=uk,to.VERSION=Dk,to.toFormData=km,to.AxiosError=zt,to.Cancel=to.CanceledError,to.all=function(t){return Promise.all(t)},to.spread=vX,to.isAxiosError=yX,to.mergeConfig=Jl,to.AxiosHeaders=ds,to.formToJSON=e=>lk(Ve.isHTMLForm(e)?new FormData(e):e),to.getAdapter=_k.getAdapter,to.HttpStatusCode=uS,to.default=to;const{Axios:I0e,AxiosError:F0e,CanceledError:P0e,isCancel:A0e,CancelToken:k0e,VERSION:O0e,all:M0e,Cancel:N0e,isAxiosError:wX,spread:L0e,toFormData:V0e,AxiosHeaders:B0e,HttpStatusCode:$0e,formToJSON:H0e,getAdapter:G0e,mergeConfig:U0e}=to,CX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const o=n.pop();return(o==null?void 0:o.split(";").shift())??null}return null},bX=6e4,Ik=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Bm=new Map,Fk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},SX=e=>{const t=Fk(e),n=Ik(t||"none"),s=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&s===a)||"default";Bm.has(i)||Bm.set(i,{ongoing:0,queue:[]});const r=Bm.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Pk=e=>{const t=Fk(e),n=Ik(t||"none"),s=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&s===a)||"default",r=Bm.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},EX=(()=>{const e=to.create({timeout:bX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await SX(n);const o=CX("account.token");return o&&t.headers&&(t.headers.Authorization=`Bearer ${o}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Pk(t.config.url||""),t),async t=>{var o,s,i;if(((o=t.response)==null?void 0:o.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Pk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((s=t.response)==null?void 0:s.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class of extends Error{constructor(t,n,o,s,i){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=i,Object.setPrototypeOf(this,of.prototype)}}const sf=e=>{var t,n;if(wX(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,i=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",r=(s==null?void 0:s.code)||e.code,a=(s==null?void 0:s.details)||s;let l="UNKNOWN";return!o||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":o>=500?l="SERVER":o===Tu.UNAUTHORIZED||o===Tu.FORBIDDEN?l="AUTH":o===Tu.UNPROCESSABLE_ENTITY||o===Tu.BAD_REQUEST?l="VALIDATION":o>=Tu.BAD_REQUEST&&(l="CLIENT"),new of(i,o,r,a,l)}return e instanceof Error?new of(e.message,void 0,void 0,void 0,"UNKNOWN"):new of("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class _X{constructor(){this.axios=EX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(s,String(r))):typeof i=="object"?n.append(s,JSON.stringify(i)):n.append(s,String(i)))});const o=n.toString();return o?`?${o}`:""}async get(t="",n,o){try{const s=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${s}${i}`,o)).data}catch(s){throw sf(s)}}async post(t="",n,o,s){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,o,s)).data}catch(i){throw sf(i)}}async put(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.put(s,n,o)).data}catch(s){throw sf(s)}}async patch(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.patch(s,n,o)).data}catch(s){throw sf(s)}}async delete(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.delete(s,{data:n,...o})).data}catch(s){throw sf(s)}}}const RX=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),DX=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class Ak extends _X{constructor(t,n){const o=n==null?void 0:n.domainApi,s=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=RX({domainApi:o,wsCode:s,entityId:i}),a={};Object.entries(r).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),this.apiConfig=a}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:i,responseType:r}){var c,u;const a=this.buildHeaders(s);let l;try{if(l=await this.axios.request({method:t,url:n,params:o,data:s,headers:a,responseType:r}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";DX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:o,payload:s,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,i])=>{o=o.replace(`{${s}}`,String(i))}),o}async request(t,n,o={}){const{url:s,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:r,path:a,params:o.params,payload:o.payload,code:i,responseType:o.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,o={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:o||1,name_like:s||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const i={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const i={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:i})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:i,filterParams:r}){const a={item_ids:n,start_date:o,due_date:s,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:i}=t,r={item_ids:o,ws_user_role_ids:s,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,i={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=s):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:i}=t,r={item_ids:o,ws_user_role_ids:s,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:i}){const r={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:i}=t,r={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:i}=t,r={item_ids:o,template_flow_status_id:s};return o.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:1,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:0,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:i,clear:r}=t,a={item_ids:o,metric_id:s,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const TX=(e,t,n,o,s,i,r)=>{const{apiServices:a}=Qn(n,o),l=B(!1),c=Z(()=>!!(s!=null&&s.value&&(i!=null&&i.value))),u=En("filterParams",null);return{isUpdating:l,handleUpdate:async h=>{var p;const f=h.value;l.value=!0;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:u!=null&&u.value?u.value:void 0};h.value==null?g.clear=1:g.value=f,c.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds;const v=await((p=a.value)==null?void 0:p.bulkUpdateMetric(g));(v==null?void 0:v.message)=="Done"&&t(h)}catch(g){console.error("Error during bulk metric update:",g)}l.value=!1}}},xX=St(it({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=$A(),o=B([]),s=e,i=t,r=B([]),a=B(null),l=X=>{var M,j,L;const ne=o.value.findIndex(se=>se.id===X.id);a.value=ne;const Re=(M=r.value[ne])==null?void 0:M.$el;(j=x.value)==null||j.scrollTo(ne*30),Re&&Re.scrollIntoView({behavior:"smooth",block:"center"}),c(ne),(L=r.value[ne])==null||L.show()},c=X=>{a.value=X,r.value.forEach((ne,Re)=>{Re!==X&&ne&&ne.hide()})},u=B(""),d=B(null),{popupRef:h,triggerRef:f,isVisible:p}=eo({appendTo:d.value||void 0}),g=()=>{u.value="",r.value.forEach(X=>{X==null||X.hide()}),a.value=null},v=Z(()=>s.selectedIds||[]),y=Z(()=>({itemIds:v.value,workspaceId:String(s.workspaceId)})),b=En("isSelectAll",B(!1)),S=En("bulkUpdate",B(!1)),{handleUpdate:C,isUpdating:E}=TX(y,X=>{i("update",X),g()},!1,s,S,b),D=X=>{g(),_t(()=>{var ne;(ne=x.value)==null||ne.focus()})},x=B(null);Je(()=>p.value,X=>{var ne;X?(ne=x.value)==null||ne.focus():g()});const A=B(!0),k=B(!0),{apiServices:T}=Qn(!1,s),R=async(X,ne,Re)=>{var M;try{return Re?k.value=!0:A.value=!0,await((M=T.value)==null?void 0:M.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:X,query:ne,per_page:10}))}catch(j){throw console.error("Failed to fetch metric list:",j),j}finally{A.value=!1,k.value=!1}},F=B(0),P=B(!0),$=X=>({id:String(X.id),label:String(X.name),value:String(X.id),description:X.morpheme_value?`${String(X.morpheme_value)}`:"",type:n.checkEditType(X),metricConfig:X}),te=X=>X.filter(ne=>!ne.formula).filter(ne=>{var Re;return((Re=ne==null?void 0:ne.auth_permission)==null?void 0:Re.permission)==2}).map($),U=async()=>{F.value+=1;const X=await R(F.value,u.value,!0);if(X&&X.data){const ne=te(X.data);o.value=[...o.value,...ne],P.value=X.meta.last_page!=X.meta.current_page}else P.value=!1},Y=async X=>{u.value=X,F.value=1;try{const ne=await R(F.value,u.value);ne&&ne.data?(o.value=te(ne.data),P.value=ne.meta.last_page!=ne.meta.current_page):o.value=[]}catch{o.value=[]}};return Je(()=>p.value,(X,ne)=>{X&&ne!==X&&Y("")},{immediate:!0,deep:!0}),(X,ne)=>(K(),ae("div",{ref_key:"wrapperRef",ref:d},[ue(ct,{class:"action-button",variant:s.variant,ref_key:"triggerRef",ref:f,loading:H(E)},{default:fe(()=>[ue(rt,{src:"SquareRootVariable",class:"icon"}),ne[1]||(ne[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading"]),pe("div",{ref_key:"popupRef",ref:h,style:{display:"none","border-radius":"4px"}},[ue(Jr,{ref_key:"searchListRef",ref:x,style:{width:"320px"},options:o.value,loading:A.value,"loading-more":k.value,"selected-id":void 0,"has-more":P.value,onSearch:Y,onSelect:l,onLoadMore:ne[0]||(ne[0]=()=>U())},{item:fe(({item:Re,index:M,selectedIndex:j})=>[ue(YY,{ref:L=>r.value[M]=L,label:Re.label,type:Re.type,morpheme:Re.description||"",onFocusOnSearch:D,onOpen:L=>c(M),attachTo:H(h),config:Re.metricConfig,onHandleUpdate:H(C),class:J(["metric-update-item",{selected:a.value===M||j===M}])},null,8,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":fe(()=>[...ne[2]||(ne[2]=[pe("div",{style:{width:"320px"}},null,-1)])]),"empty-list":fe(()=>[...ne[3]||(ne[3]=[nt("No options available.",-1)])]),_:1},8,["options","loading","loading-more","has-more"])],512)],512))}}),[["__scopeId","data-v-bf393fa6"]]),kk=St(it({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:c}=eo({placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=Z(()=>l.value);Je(l,f=>{s(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&i()};return Xt(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),lo(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(K(),ae("div",{ref_key:"triggerRef",ref:r,class:J(f.$style["dropdown-wrapper"])},[Pt(f.$slots,"trigger",{open:H(l),toggle:H(c),closeDropdown:d},()=>[pe("button",{class:J(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),pe("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:J(f.$style["dropdown-content"]),style:cn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Pt(f.$slots,"content",{closeDropdown:d,visible:H(l)},()=>[pe("div",{class:J(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),$m=Yl("bulkUpdate",()=>{const e=B(Ht.UNCHECK),t=Cs({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Cs({isBulkUpdating:!1});function i(u){s.isBulkUpdating=u}const r=B({}),a=u=>{r.value=u},l=(u,d)=>{r.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ht.CHECKED)}}}),Ok=it({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,i=n,r=B([]),a=B(!1),l=B(!1),c=B(null),u=B(o.INITIAL_PAGE),d=B(!0),h=B(0),f=B(""),p=Z(()=>{var $;return($=s.value)==null?void 0:$.id}),g=Z(()=>!!(s.id||s.ids&&s.ids.length>0)),v=$=>({label:$.name,value:$.id,selected:p.value===$.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:$,id:$.id,color:$.color}),y=Z(()=>{const $=new Set;return s.id&&$.add(String(s.id)),s.ids&&s.ids.forEach(te=>{te&&$.add(String(te))}),Array.from($)}),b=En("bulkUpdate",!1),{apiServices:S}=Qn(!b,s),C=$m(),{selectionStatus:E}=Ho(C),D=En("filterParams",null),x=async($=o.INITIAL_PAGE,te="",U=!1)=>{var Y,X,ne,Re;if(!g.value){console.error("Missing required props",s);return}U?l.value=!0:a.value=!0,c.value=null;try{const M={workspaceId:String(s.workspaceId),itemIds:y.value,page:$,perPage:o.PER_PAGE,name_like:te.trim(),...D||{}};if(((Y=S.value)==null?void 0:Y.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const j=await((X=S.value)==null?void 0:X.getAssignableStatus(M));if(!(j!=null&&j.data)){U||(r.value=[]),d.value=!1;return}const L=j.data.map(v);r.value=U?[...r.value,...L]:L,h.value=((ne=j.meta)==null?void 0:ne.total)??j.data.length,d.value=!((Re=j.meta)!=null&&Re.on_last_page),u.value=$}catch(M){console.error("Error fetching statuses:",M),c.value="Failed to load statuses",U||(r.value=[]),d.value=!1,i("error",c.value)}finally{a.value=!1,l.value=!1}},A=Di(async $=>{f.value=$,u.value=o.INITIAL_PAGE,await x(o.INITIAL_PAGE,$,!1)},ir),k=async()=>{!d.value||l.value||await x(u.value+1,f.value,!0)},T=()=>{var $;i("cancel"),($=s.params)==null||$.api.stopEditing()},R=async $=>{var te,U,Y;if(!g.value){console.error("Missing required props for updating status",s);return}try{const X={workspaceId:String(s.workspaceId),itemIds:y.value,statusId:String($.value),entityId:String(s.entityId),filterParams:D!=null&&D.value?D==null?void 0:D.value:void 0};if(E.value==Ht.CHECKED&&b&&(X.itemIds=void 0,X.entityId=String(s.entityId)),i("start-update"),!await S.value.updateItemStatus(X))throw new Error("Status update failed: empty response");const Re={workspaceId:String(s.workspaceId),itemIds:y.value,data:{id:$.id,name:$.label,color:$.color}};i("updated",Re),s.params&&((U=s.params)==null||U.node.setData({...(te=s.params)==null?void 0:te.node.data,status:{id:$.id,name:$.label,color:$.color}}),(Y=s.params)==null||Y.api.stopEditing())}catch(X){console.error("Error updating status:",X),c.value="Failed to update status",i("error",c.value)}finally{i("finish-update")}},F=Z(()=>r.value.map($=>({...$})));Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{x()},{deep:!0,immediate:!0});const P=B(null);return Xt(()=>{_t(()=>{var $;($=P.value)==null||$.focus()})}),t({refresh:()=>x(o.INITIAL_PAGE,f.value,!1),loadMore:k,focus:()=>{var $;return($=P.value)==null?void 0:$.focus()}}),($,te)=>{var U;return K(),ze(Jr,qt({ref_key:"popupRef",ref:P},s,{"selected-id":(U=s.value)==null?void 0:U.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(A),onSelect:R,onLoadMore:k,onCancel:T,onClose:T}),null,16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),IX=it({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,o=Z(()=>{const v=So();return v==null?void 0:v.appContext.config.globalProperties.apiServices}),{popupRef:s,triggerRef:i,isVisible:r,hide:a}=eo(),l=t,c=B(!1),u=v=>{c.value=!1,l("updated",v),setTimeout(()=>{a()},700)},d=Z(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=B(null),f=v=>{v.key==="Escape"&&s.value&&a()};Xt(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.addEventListener("keydown",f)}),lo(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.removeEventListener("keydown",f)}),qi("bulkUpdate",!0);const p=v=>{c.value=v},g=B(null);return Je(r,v=>{var y;v&&((y=g.value)==null||y.focus())}),(v,y)=>(K(),ae("div",{ref_key:"mainRef",ref:h},[ue(ct,{ref_key:"triggerRef",ref:i,variant:e.variant,loading:c.value},{default:fe(()=>[ue(rt,{src:"Square",class:"icon"}),y[3]||(y[3]=nt(" Status ",-1))]),_:1},8,["variant","loading"]),pe("div",{ref_key:"popupRef",ref:s},[Ue(ue(Ok,qt({ref_key:"statusRef",ref:g},d.value,{onUpdated:u,onCancel:H(a),onStartUpdate:y[0]||(y[0]=b=>p(!0)),onFinishUpdate:y[1]||(y[1]=b=>p(!1)),onError:y[2]||(y[2]=b=>p(!1)),callback:()=>p(!1)}),null,16,["onCancel","callback"]),[[_i,H(r)]])],512)],512))}}),Mk=St(it({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=Ji,s=e,i=Z(()=>(s==null?void 0:s.workspaceId)||""),r=Z(()=>(s==null?void 0:s.entityId)||""),a=()=>{var $,te,U;return(U=($=s.params)==null?void 0:$.api)==null?void 0:U.getCellRendererInstances({columns:["options"],rowNodes:(te=s.params)!=null&&te.node?[s.params.node]:[]})[0]},l=()=>{var te,U,Y,X;const $=a();(U=(te=$==null?void 0:$.componsenExposed)==null?void 0:te.blur)==null||U.call(te),console.log("Blurring option renderer for row:",s.id,$),(X=(Y=$==null?void 0:$.container)==null?void 0:Y.parentElement)==null||X.classList.remove("ag-cell-focus")},c=()=>{var U,Y,X;(Y=(U=s.params)==null?void 0:U.api)==null||Y.stopEditing(),l();const $=`scene-name-${s.id}`,te=document.getElementById($);(X=te==null?void 0:te.__sceneNameEditor)==null||X.startEdit()},{apiServices:u}=Qn(!0,s),d=Z(()=>{var $;return{ws_code:i.value,entity_id:r.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:($=s.data)==null?void 0:$.permissions}}),h=$=>{var U,Y,X,ne,Re,M;let te=(Y=(U=s.params)==null?void 0:U.api)==null?void 0:Y.getRowNode(String(s.id));if(te){const j={...te.data,isDeleted:$==="deleted",isArchived:$==="archived"?!0:te.data.isArchived,disabled:!0};(ne=(X=s.params)==null?void 0:X.api)==null||ne.redrawRows({rowNodes:[te]}),te.setData(j),(M=(Re=s.params)==null?void 0:Re.api)==null||M.redrawRows({rowNodes:[te]})}},f=Yh(),{openSceneHub:p}=f,g=()=>{_t(()=>{var U,Y,X,ne,Re,M;const $=((Y=(U=s.params)==null?void 0:U.node)==null?void 0:Y.rowIndex)||0,te=((ne=(X=s.params)==null?void 0:X.column)==null?void 0:ne.getColId())||"";(M=(Re=s.params)==null?void 0:Re.api)==null||M.setFocusedCell($,te)})},{options:v}=tY(d,h,c,p,g),y=n,b=()=>{var $,te,U,Y,X,ne;console.trace("Focusing current cell for row:",s.id),(ne=($=s.params)==null?void 0:$.api)==null||ne.setFocusedCell(((U=(te=s.params)==null?void 0:te.node)==null?void 0:U.rowIndex)||0,((X=(Y=s.params)==null?void 0:Y.column)==null?void 0:X.getColId())||"")},S=Z(()=>{var $;return($=s.params)==null?void 0:$.api}),C=($,te)=>{var U,Y,X,ne,Re,M,j,L;if(y("actionExecuted",$),$.id=="copy-link"){(Re=S.value)==null||Re.startEditingCell({rowIndex:(Y=(U=s.params)==null?void 0:U.node)==null?void 0:Y.rowIndex,colKey:(ne=(X=s.params)==null?void 0:X.column)==null?void 0:ne.getColId()});return}else{if($.id!=="copy-link"&&((M=S.value)==null||M.stopEditing()),$.id==="rename")(j=S.value)==null||j.stopEditing(),(L=S.value)==null||L.clearFocusedCell(),l();else if($.id==="copy-link"){const se=document.getElementById(te);setTimeout(()=>{var ce,De,Ie;(Ie=(De=(ce=se==null?void 0:se.__vueParentComponent)==null?void 0:ce.exposed)==null?void 0:De.focus)==null||Ie.call(De)},300)}else if(["delete-rendition","delete-thumbnail"].includes($.id)){setTimeout(()=>{b()},300);return}setTimeout(()=>{var se,ce;(ce=(se=s.params)==null?void 0:se.api)==null||ce.clearFocusedCell()},300)}},E=()=>{var $,te;(te=($=s.params)==null?void 0:$.api)==null||te.stopEditing()},D=$=>{var te,U,Y,X;return $==="archive"?!((U=(te=s.params)==null?void 0:te.data)!=null&&U.isArchived):$==="unarchive"?(X=(Y=s.params)==null?void 0:Y.data)==null?void 0:X.isArchived:!0},x=Z(()=>v.value.map($=>({...$,options:$.options.filter(te=>!te.hide&&D(te.id))})).filter($=>$.options.length>0)),A=B({}),k=B(null),T=Z(()=>{var te,U;if(s.focusableIndex)return s.focusableIndex;const $=(U=(te=s.params)==null?void 0:te.api)==null?void 0:U.getRowNode(String(s.id));return`${(($==null?void 0:$.rowIndex)??0)+10}`}),R=($,te)=>`${T.value}.${$*10+te}`,F=($,te)=>{if(te&&"focus"in te){A.value[$]=te;return}delete A.value[$]},P=$=>{$.preventDefault(),$.stopPropagation(),$.stopImmediatePropagation()};return Xt(()=>{var $;($=k.value)==null||$.focus()}),t({focus(){var U;const $=`${T.value}.0`,te=A.value[$];te&&te.focus?te.focus():(U=k.value)==null||U.focus()}}),($,te)=>Ue((K(),ae("div",{onKeydown:P,class:J([$.$style["more-option-section"],{[$.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:k,tabindex:"0",role:"menu"},[(K(!0),ae(xt,null,xn(x.value,(U,Y)=>(K(),ae("div",{key:U.id,style:cn({"--g-number":Math.min(U.options.length,4),"--g-size":U.type==="column"?"40px":"auto"}),class:J([$.$style["option-block"],$.$style[U.type]])},[(K(!0),ae(xt,null,xn(U.options,(X,ne)=>(K(),ae("div",{key:X.id,class:J($.$style["option-item"])},[ue(PX,{layer:s.layer,"scene-id":String(s.id),option:X,type:U.type,onActionExecuted:Re=>C(Re,`more-action-${Re.id}-${s.id}`),focusableIndex:R(Y,ne),ref_for:!0,ref:Re=>F(R(Y,ne),Re),onHandleHide:E,id:`more-action-${X.id}-${s.id}`},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id"])],2))),128))],6))),128))],34)),[[H(o),T.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1d9v2_1","option-block":"_option-block_1d9v2_8","option-item":"_option-item_1d9v2_18",row:"_row_1d9v2_22",column:"_column_1d9v2_28",block:"_block_1d9v2_32"}}]]),FX={key:0},PX=St(it({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=Ji,s=Yt,i=e,r=B(!1),a=B(!1),l=(A,k)=>{if(!k){p();return}const T=k.target;T.closest(".tippy-content")||T.closest(".tippy-box")||T.closest("[data-tippy-root]")||T.closest(".option-item")||p()},c=B(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=eo({interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async A=>{var k,T;if(!a.value){a.value=!0;try{await((T=(k=i.option).action)==null?void 0:T.call(k,A)),g("actionExecuted",i.option)}catch(R){console.error("Action execution failed:",R)}finally{a.value=!1,r.value=!1}}},y=async A=>{var k,T;if(A.preventDefault(),A.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((T=(k=i.option).action)==null?void 0:T.call(k,A)),g("actionExecuted",i.option)}catch(R){console.error("Action execution failed:",R)}finally{a.value=!1}return}}},b=A=>{g("actionExecuted",A),p()},S=A=>{A.key==="Escape"&&p()},C=A=>({row:"small",column:"large",block:"small"})[A]||"large",E=A=>{const k=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...k],column:["menu-item",...k],block:["secondary",...k]}[A]||[]},D=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{_t(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{y(new MouseEvent("click"))}});const x=A=>{var k;A.stopPropagation(),A.preventDefault(),console.log("Cancel action"),r.value=!1,(k=u.value)==null||k.focus()};return(A,k)=>{var T;return Ue((K(),ae("div",{ref_key:"wrapperRef",ref:c,class:J(A.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Tt(y,["stop","prevent"])},[Ue((K(),ze(ct,{ref_key:"triggerRef",ref:u,class:J(A.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||r.value,size:C(e.type),variant:E(e.type),onClick:Tt(y,["stop","prevent"]),onKeydown:S,onEscape:D},{prefix:fe(()=>[e.option.icon?Ue((K(),ze(rt,{key:0,src:e.option.icon,source:"remote"},null,8,["src"])),[[H(s),{content:e.option.label,delay:[300,0],contentClass:["extra-padding"]}]]):Ze("",!0)]),suffix:fe(()=>[e.option.subMenu?(K(),ze(rt,{key:0,src:"Play",source:"remote"})):Ze("",!0),e.option.isDanger&&r.value?(K(),ae("div",{key:1,class:J(A.$style["confirm-action"])},[Ue((K(),ze(ct,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:x},{default:fe(()=>[ue(rt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(o),`${i.focusableIndex}.0`],[H(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ue((K(),ze(ct,{variant:["danger","primary","icon"],size:"small",onClick:Tt(v,["stop","prevent"]),onEscape:k[0]||(k[0]=R=>r.value=!1)},{default:fe(()=>[ue(rt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${i.focusableIndex}.1`],[H(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ze("",!0)]),default:fe(()=>[e.option.label?(K(),ae("span",FX,yt(e.option.label),1)):Ze("",!0)]),_:1},8,["class","disabled","actived","size","variant"])),[[H(o),i.focusableIndex]]),e.option.subMenu?(K(),ae("div",{key:0,ref_key:"popupRef",ref:d,class:J(A.$style["submenu-container"])},[ue(Mk,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((T=e.option)==null?void 0:T.subMenu)||[]],"is-submenu":!1,onActionExecuted:b},null,8,["focusableIndex","layer","option-block"])],2)):Ze("",!0)],2)),[[H(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_82ug7_1","icon-wrapper":"_icon-wrapper_82ug7_11","confirm-action":"_confirm-action_82ug7_19"}}]]),AX={style:{"max-width":"225px","line-height":"14px"}},kX={style:{"max-width":"100px","line-height":"14px"}},OX=St(it({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Yt,o=Ji,s=e,i=t,r=$m(),{handelSelectAll:a}=r,{selectionStatus:l}=Ho(r),c=Z(()=>l.value===Ht.CHECKED),u=Z(()=>s.selectRowData.map(M=>M.id)),d=Z(()=>s.selectRowData.length>0);qi("bulkUpdate",d),qi("isSelectAll",c);const h=({itemIds:M,data:j})=>{const L=s.gridApi;M.forEach(se=>{if(!L){console.error("Grid API is undefined");return}const ce=L.getRowNode(se);if(ce){const De={...ce.data,status:j};ce.setData(De)}})},f=Z(()=>s.selectRowData),p=({itemIds:M,data:j})=>{const L=s.gridApi;if(!L){console.error("Grid API is undefined");return}M.forEach(se=>{const ce=L.getRowNode(se);if(ce){const De=ce.data.dateRange||[null,null];"startDate"in j&&j.startDate!==void 0&&(De[0]=j.startDate?new Date(j.startDate):null),"dueDate"in j&&j.dueDate!==void 0&&(De[1]=j.dueDate?new Date(j.dueDate):null);const Ie={...ce.data,dateRange:De};ce.setData(Ie)}}),i("updated")},g=Z(()=>s.selectRowData.map(M=>M.id)),v=M=>{const j=s.gridApi,{id:L,value:se}=M;if(!j){console.error("Grid API is undefined");return}g.value.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,[`metric_${L}`]:se};De.setData(Ie)}}),i("updated")},y=["primary"],b=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{i("unselect")},C=Rm(),{userPermissions:E}=Ho(C),D=Z(()=>E.value.includes(Dm)),x=()=>{const M=s.selectRowData.map(L=>L.id).join(","),j=Lo({type:"review_multiple_scenes",config:{reviewDomain:Cn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:M}}).url;window.open(j,"_blank")},A=M=>{const{assignees:j,type:L}=M,se=s.gridApi;if(!se){console.error("Grid API is not available for bulk update.");return}s.selectRowData.map(De=>{const Ie=se.getRowNode(De.id);if(!Ie)return null;const Ke=Ie.data.assignees||[];let z=[];switch(L){case"add":{const de=new Set(Ke.map(Fe=>Fe.id)),ie=j.filter(Fe=>!de.has(Fe.id));z=[...Ke,...ie];break}case"overwrite":{z=j;break}case"remove":{const de=new Set(j.map(ie=>ie.id));z=Ke.filter(ie=>!de.has(ie.id));break}case"removeAll":{z=[];break}}return{...Ie.data,assignees:z}}).filter(De=>De!==null).forEach(De=>{const Ie=se.getRowNode(De.id);Ie&&Ie.setData(De)})},{apiServices:k}=Qn(!1,s),T=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk delete.");return}const L=await((se=k.value)==null?void 0:se.bulkDeleteItems(P.value));(L==null?void 0:L.message)=="Done"&&(M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,isDeleted:!0,disabled:!0};De.setData(Ie)}}),j.deselectAll())},R=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id);if(!s.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const L=await((se=k.value)==null?void 0:se.bulkUnarchiveItems(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to unarchive items.");return}te(M,"isArchived",!1)},F=En("filterParams",void 0),P=Z(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:s.selectRowData.map(M=>M.id),entityId:s.entityId,filterParams:F!=null&&F.value?F.value:void 0})),$=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id);if(!s.gridApi){console.error("Grid API is not available for bulk archive.");return}const L=await((se=k.value)==null?void 0:se.bulkArchiveItems(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to archive items.");return}te(M,"isArchived",!0)},te=(M,j,L)=>{const se=s.gridApi;if(!se){console.error("Grid API is not available for bulk update.");return}const ce=M.map(De=>{const Ie=se.getRowNode(De);if(Ie){const Ke={...Ie.data,[j]:L};Ie.setData(Ke)}return Ie}).filter(De=>De!=null);se.redrawRows({rowNodes:ce})},U=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk thumbnail deletion.");return}const L=await((se=k.value)==null?void 0:se.deleteThumbnail(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to delete thumbnails.");return}M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,thumbnail:null};De.setData(Ie)}})},Y=async()=>{var se;const M=s.selectRowData.map(ce=>ce.id),j=s.gridApi;if(!j){console.error("Grid API is not available for bulk rendition deletion.");return}const L=await((se=k.value)==null?void 0:se.deleteRendition(P.value));if((L==null?void 0:L.message)!="Done"){console.error("Failed to delete renditions.");return}M.forEach(ce=>{const De=j.getRowNode(ce);if(De){const Ie={...De.data,rendition:null};De.setData(Ie)}})},X=B(!1),ne=B(null),Re=async M=>{var j;console.log("Handling action:",M.id);try{switch(X.value=!0,M.id){case"unarchive":await R();break;case"delete":await T();break;case"archive":await $();break;case"delete-thumbnail":await U();break;case"delete-rendition":await Y();break;default:console.error("Unknown action:",M.id),X.value=!1;break}_t(()=>{X.value=!1})}catch{X.value=!1}finally{(j=ne.value)==null||j.focus()}};return(M,j)=>Ue((K(),ae("div",{class:J(M.$style["bulk-update-action"])},[pe("div",{class:J(M.$style["left-actions"])},[pe("div",{class:J(M.$style["selection-track"])},[ue(ct,{variant:["icon","tertiary"],onClick:S},{default:fe(()=>[ue(rt,{src:"XMarkSolid",source:"remote"})]),_:1}),H(l)==H(Ht).INDETERMINATE?(K(),ae("span",{key:0,class:J(M.$style["selected-count"])},yt(e.selectRowData.length)+" selected ",3)):Ze("",!0),H(l)==H(Ht).CHECKED?(K(),ae("span",{key:1,class:J(M.$style["selected-count"]),style:{"line-height":"14px"}},[j[0]||(j[0]=nt(' All in  " ',-1)),Ue((K(),ae("span",AX,[nt(yt(e.takeName),1)])),[[H(n),{content:e.takeName}]]),j[1]||(j[1]=nt(' " ',-1))],2)):Ze("",!0),!e.loading&&H(l)==H(Ht).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(K(),ze(ct,{key:2,variant:"secondary",onHandleClick:H(a)},{default:fe(()=>[pe("span",{class:J(M.$style["selected-count"]),style:{"line-height":"14px"}},[j[2]||(j[2]=nt(' Select all in  " ',-1)),Ue((K(),ae("span",kX,[nt(yt(e.takeName),1)])),[[H(n),{content:e.takeName}]]),j[3]||(j[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ze("",!0),pe("span",{class:J(M.$style.divider)},null,2)],2),ue(IX,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,onUpdated:h},null,8,["ids","workspace-id","entity-id"]),ue(bY,{onUpdate:A,ids:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),ue(MY,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,"row-selected":f.value,onUpdated:p},null,8,["ids","workspace-id","entity-id","row-selected"]),ue(xX,{onUpdate:v,selectedIds:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),pe("span",{class:J(M.$style.divider)},null,2),Ue((K(),ae("div",null,[D.value?(K(),ze(ct,{key:0,class:J(M.$style["action-button"]),variant:[...y,"icon"],onClick:x,disabled:s.selectRowData.length>40},{default:fe(()=>[ue(rt,{src:"PenRuler",class:J(M.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","disabled"])):Ze("",!0)])),[[H(n),s.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),pe("span",{class:J(M.$style.divider)},null,2),ue(kk,{placement:"top-end"},{trigger:fe(({open:L,toggle:se,closeDropdown:ce})=>[Ue((K(),ze(ct,{onEscape:ce,actived:L,ref_key:"moreActionRef",ref:ne,class:J(M.$style["action-button"]),variant:[...y,"icon"],loading:X.value,onClick:Tt(se,["stop"])},{default:fe(()=>[ue(rt,{src:"EllipsisVertical",class:J(M.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","variant","loading","onClick"])),[[H(o),"99999"],[H(n),{content:"More actions"}]])]),content:fe(({visible:L,closeDropdown:se})=>[(K(),ae(xt,null,xn(b,(ce,De)=>ue(ei,qt({clickable:!0,key:ce.id},{ref_for:!0},ce,{show:L,style:{borderLeft:0},"focus-index":"99999."+De,onClick:()=>{Re(ce),se()},onEscape:se}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1})],2)],2)),[[_i,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_16qqo_1","left-actions":"_left-actions_16qqo_19","right-actions":"_right-actions_16qqo_20","selection-track":"_selection-track_16qqo_25","close-icon":"_close-icon_16qqo_31","selected-count":"_selected-count_16qqo_35",divider:"_divider_16qqo_41","more-button":"_more-button_16qqo_46",dropdown:"_dropdown_16qqo_50","dropdown-content":"_dropdown-content_16qqo_53",delete:"_delete_16qqo_76","icon-btn":"_icon-btn_16qqo_83","selected-list":"_selected-list_16qqo_87"}}]]),Ga=St(it({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=as,n=Yt,o=e,s=Z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:i}=vo(s),r=Z(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=Z(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=ue(Sh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});Uw(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Z(()=>o.value===void 0);return(c,u)=>Ue((K(),ze(yo,nR(Pw(H(i))),{default:fe(()=>[pe("span",{class:J(c.$style["item-table-label-renderer"])},yt(o.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!r.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),MX=["placeholder","maxlength"],NX={key:0,class:"wrapper-suffix"},LX=St(it({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=as,s=Yt,i=e,r=n,a=B(i.value),l=B(null),c=B(null),u=B(i.value||""),d=B(!1),h=B(!1),f=Z(()=>{var R;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((R=i.value)==null?void 0:R.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p}=vo(f),g=R=>{const F=document.createElement("div");return F.textContent=R,F.innerHTML},v=()=>u.value!==a.value,y=()=>{h.value=!0,d.value=!1,u.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const R=g(l.value.value);if(!v()){d.value=!1;return}a.value=R,r("update:value",R),r("enter",R),d.value=!1},S=()=>{h.value||(i.saveOnBlur?b():y(),r("blur",u.value))},C=R=>{var F;if(R.key==="ArrowLeft"||R.key==="ArrowRight"){R.stopPropagation();return}R.ctrlKey&&R.key=="a"||R.key=="A"?(R.stopPropagation(),(F=l.value)==null||F.select()):R.key==="Enter"?(R.preventDefault(),R.stopPropagation(),b()):R.key==="Escape"&&(R.preventDefault(),R.stopPropagation(),y())},E=()=>{a.value=i.value,u.value=i.value,d.value=!0,_t(()=>{var R,F;(R=l.value)==null||R.click(),(F=l.value)==null||F.focus()})},D=()=>{var R;d.value?y():(R=l.value)==null||R.blur(),r("blur",u.value)},x={focus:()=>{E()}};Xt(()=>{var F;const R=(F=c.value)==null?void 0:F.$el;R&&(R.__sceneNameEditor=x)}),lo(()=>{const R=c.value;R&&delete R.__sceneNameEditor});const A=B(null),k=B(null);t({focus:E,blur:()=>{var R;return(R=l.value)==null?void 0:R.blur()},save:b,cancel:y,focusEditButton:()=>{_t(()=>{var R;(R=A.value)==null||R.focus()})},focusCancelButton:()=>{_t(()=>{var R;(R=k.value)==null||R.focus()})},startEdit:E});const T=Z(()=>i.value===void 0);return Xb(c,()=>{d.value&&S()}),(R,F)=>Ue((K(),ze(H(yo),qt(H(p),{ref_key:"wrapperRef",ref:c,bordered:i.bordered}),Yd({default:fe(()=>[d.value?Ze("",!0):Pt(R.$slots,"default",{key:0},()=>[Ue((K(),ae("span",{class:J(R.$style["label-renderer"])},[nt(yt(u.value),1)],2)),[[H(s),{content:u.value||void 0}]])]),Ue(pe("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":F[0]||(F[0]=P=>u.value=P),class:J(R.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:C,onBlur:S},null,42,MX),[[_i,d.value],[C1,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:fe(({hovered:P,focused:$})=>[P||$||e.keyboardFocusing?(K(),ae("div",NX,[(P||e.keyboardFocusing)&&!$?Ue((K(),ze(H(ct),{key:0,variant:["icon","secondary"],size:24,onClick:Tt(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:A,onKeydown:[Bn(Tt(E,["prevent","stop"]),["enter"]),Bn(Tt(D,["prevent","stop"]),["escape"])]},{default:fe(()=>[ue(H(rt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Edit"]]):$?Ue((K(),ze(H(ct),{key:1,variant:["icon","tertiary","danger"],size:24,onMousedown:Tt(y,["prevent"]),tabindex:"0",ref_key:"cancelButtonRef",ref:k,onKeydown:Bn(Tt(y,["prevent"]),["enter"])},{default:fe(()=>[ue(H(rt),{src:"XMarkSolid",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Cancel"]]):Ze("",!0)])):Ze("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(o),{isLoading:T.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),VX=["tabindex"],Nk=St(it({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Yt,s=as,i=e,r=n,a=B(i.value),l=B(i.value),c=B(null),u=B(null),d=En("bulkUpdate",!1),{apiServices:h}=Qn(!d,i),f=Z(()=>{var Y;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((Y=a==null?void 0:a.value)==null?void 0:Y.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=vo(f),g=Z(()=>{const Y=Cn.getInstance().getItem("ws.code"),X=Cn.getInstance().getItem("BASE_URL"),ne=Y||i.workspaceId;return Lo({type:"scene_hub",config:{baseDomain:X,ws_code:ne,scene_id:String(i.id)}}).url}),v=Z(()=>{var Y,X,ne;return((X=(Y=i.data)==null?void 0:Y.isProcessing)==null?void 0:X.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),y=Z(()=>{var Y,X,ne,Re,M;return((Y=i.data)==null?void 0:Y.isDeleted)==!0||((ne=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ne.state)==0||((M=(Re=i.data)==null?void 0:Re.isProcessing)==null?void 0:M.state)==1}),b=Z(()=>{var Y,X;return(X=(Y=i.data)==null?void 0:Y.isProcessing)==null?void 0:X.message}),S=Z(()=>{var Y;return((Y=i.data)==null?void 0:Y.isArchived)==1}),C=Z(()=>i.value===void 0),E=async Y=>{var X,ne,Re,M,j,L,se,ce,De,Ie;a.value=Y,p.value=!1;try{const Ke=await((ne=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:ne.call(X,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),z=PF.get(EF)||"UTC";if(Ke){const de=TF(Ke,z),ie={...i.data,...de};(Re=i.params)==null||Re.api.clearFocusedCell();const Fe=((j=(M=i.params)==null?void 0:M.column)==null?void 0:j.getColId())||"",G=((se=(L=i.params)==null?void 0:L.node)==null?void 0:se.rowIndex)||0;(ce=i.params)==null||ce.api.setFocusedCell(G,Fe),(Ie=(De=i.params)==null?void 0:De.node)==null||Ie.setData(ie),l.value=a.value,r("enter")}else a.value=l.value}catch(Ke){console.error("Failed to update scene name:",Ke),a.value=l.value}},D={focus:()=>{p.value=!0,_t(()=>{var Y;return(Y=u.value)==null?void 0:Y.focus()})},startEdit:()=>{var Y;(Y=u.value)==null||Y.startEdit()}},x=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Je(()=>i.value,Y=>{a.value=Y,l.value=Y}),Xt(()=>{const Y=x();Y&&(Y.__sceneNameEditor=D)}),lo(()=>{const Y=u.value,X=Y&&"$el"in Y?Y.$el:Y;X&&delete X.__sceneNameEditor});const A=Yh(),{openSceneHub:k}=A,T=Y=>{try{if(Y.ctrlKey||Y.metaKey){window.open(g.value,"_blank");return}k(String(i.id))}catch{window.open(g.value,"_blank")}finally{te()}},R=()=>{setTimeout(()=>{U.value=!0,F.value=0,_t(()=>{var Y;(Y=P.value)==null||Y.focus()})},300)},F=B(-1),P=B(null);t({focus:R,trigerFocus:R,startEdit:()=>{var Y;(Y=u.value)==null||Y.startEdit()}});const $=Y=>{if(Y.key==="Enter"){Y.preventDefault(),T(Y);return}if(Y.key==="Escape"){Y.preventDefault(),te();return}Y.key==="Tab"&&(Y.preventDefault(),Y.stopPropagation(),Y.stopImmediatePropagation(),_t(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},te=()=>{var ne,Re,M,j,L,se;U.value=!1,F.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const Y=((M=(Re=i.params)==null?void 0:Re.column)==null?void 0:M.getColId())||"",X=((L=(j=i.params)==null?void 0:j.node)==null?void 0:L.rowIndex)||0;(se=i.params)==null||se.api.setFocusedCell(X,Y)},U=B(!1);return(Y,X)=>Ue((K(),ze(LX,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:i.disabled,"read-only":i.readOnly||C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:E,"max-length":25,bordered:!0,keyboardFocusing:U.value,onBlur:te},{default:fe(()=>[Ue(pe("div",{class:J(Y.$style["scene-name-display"])},[Ue((K(),ae("a",{tabindex:F.value,ref_key:"nameRef",ref:P,onClick:Tt(T,["prevent"]),onKeydown:$,target:"_blank",class:J(Y.$style["scene-name-text"])},[nt(yt(a.value),1)],42,VX)),[[H(o),{content:a.value}]]),S.value?(K(),ae("div",{key:0,class:J([Y.$style["icon-processing"],Y.$style.archived])},[ue(rt,{src:"BoxArchive",color:"#959595"})],2)):Ze("",!0),y.value?Ue((K(),ae("div",{key:1,class:J([Y.$style["icon-processing"],Y.$style.processing,v.value&&Y.$style["icon-red"]])},[ue(rt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(o),b.value]]):Ze("",!0)],2),[[_i,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(s),{isLoading:C.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1460z_1","scene-name-display":"_scene-name-display_1460z_11","icon-processing":"_icon-processing_1460z_18",archived:"_archived_1460z_26",processing:"_processing_1460z_29","icon-red":"_icon-red_1460z_33","scene-name-text":"_scene-name-text_1460z_38"}}]]),dS=St(it({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const o=Ji,s=B([]),i=e,r=B(null),a=Z(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Z(()=>{let y=[];return typeof i.variant=="string"?y.push(i.variant):Array.isArray(i.variant)&&(y=[...i.variant]),[...y,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=eo({offset:[0,0]});function v(y){c("select",y),u()}return qd(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Je(d,y=>{var b;y&&((b=p.value)==null||b.focus())}),(y,b)=>(K(),ae("div",{class:J(y.$style["button-dropdown-wrapper"]),style:cn({"--button-size":a.value})},[pe("div",{class:J(y.$style["button-group"])},[Pt(y.$slots,"prefix"),pe("div",{ref_key:"triggerRef",ref:f,class:J(H(d)?y.$style.open:"")},[Pt(y.$slots,"triggerDropdown",{open:H(d)},()=>[i.readOnly?Ze("",!0):Ue((K(),ze(ct,{key:0,onEscape:H(u),ref_key:"mainButton",ref:r,actived:H(d),class:J(y.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:fe(()=>[Pt(y.$slots,"iconDropdown",{},()=>[ue(rt,{class:J(y.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(o),e.tabIndex]])])],2)],2),pe("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:J(y.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(K(!0),ae(xt,null,xn(e.options,(S,C)=>Ue((K(),ze(ei,qt({ref_for:!0,ref:E=>s.value[C]=E,key:S.value},{ref_for:!0},{...S},{"icon-name":S.icon,onClick:Tt(E=>v(S.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:fe(()=>[nt(yt(S.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(o),`${e.tabIndex}.${C}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),rf=St(it({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,o=e,s=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},r=Z(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(K(),ae("div",{class:J(a.$style["close-wrapper"])},[e.disableRemove?Ze("",!0):(K(),ae("div",{key:0,class:J(a.$style["close-button"])},[Ue((K(),ze(ct,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:fe(()=>[ue(rt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),r.value]])],2)),Pt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_bvkx4_1","close-button":"_close-button_bvkx4_5"}}]]),BX=St(it({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Yt,n=as,o=e,{isEditing:s}=Ru(o),i=B(o.value),r=B(null),a=B(null),{apiServices:l}=Qn(!0,o),c=B(!0),u=()=>{c.value=o.value===void 0};Zp(()=>{u()}),Xt(()=>{u()}),Je(()=>o.value,A=>{u()});const d=Z(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:r,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=vo(d),p=Z(()=>{var A;return((A=i.value)==null?void 0:A.slice(0,o.maxVisible))||[]}),g=Z(()=>{var A;return Math.max(0,(((A=i.value)==null?void 0:A.length)||0)-o.maxVisible)}),v=Z(()=>{var A;return g.value<=0?"":((A=i.value)==null?void 0:A.slice(o.maxVisible).map(k=>k.name).join(", "))||""}),y=Z(()=>p.value.map(A=>({id:A.id,name:A.name,initial:A.initial,avatarId:A.id,profile_image:A.profile_image,color:A.color,size:24,user:A}))),b=Z(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>o.value,A=>{i.value=A},{immediate:!0,deep:!0});const S=async A=>{var T,R,F;await x(A)&&(i.value=(T=i.value)==null?void 0:T.filter(P=>P.id!==A),(F=o.params)==null||F.node.setData({...(R=o.params)==null?void 0:R.node.data,assignees:i.value}))},C=A=>{var T;const k=Cn.getInstance().getItem("ws.code");return((T=l.value)==null?void 0:T.getUserInformation(k,A))||Promise.resolve(null)},{id:E}=Lp(o),D=A=>{var T,R;const k=(R=(T=o.params)==null?void 0:T.api)==null?void 0:R.getRowNode(String(E.value));k==null||k.setDataValue("assignees",Nx(A.assignees))},{removeAssignee:x}=um({...o,entityId:o.entityId,updateRowData:D,value:o.value,errorCallback:()=>{}});return(A,k)=>Ue((K(),ze(yo,qt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:fe(()=>{var T;return[pe("div",{class:J(A.$style.assigneeGroupRenderer)},[((T=i.value)==null?void 0:T.length)===0?(K(),ze(rt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:cn(b.value)},null,8,["style"])):Ze("",!0),(K(!0),ae(xt,null,xn(y.value,R=>(K(),ze(rf,{key:R.id,"disable-remove":o.readOnly||o.disabled,onClear:F=>S(R.id),style:{marginLeft:"0"}},{default:fe(()=>[ue(Zl,{user:R.user,"show-profile":!0,apiUpdateFunction:C,class:J(A.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ue((K(),ae("div",{key:1,class:J(A.$style["extra-avatars"])},[nt(" +"+yt(g.value),1)],2)),[[H(t),v.value]]):Ze("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),$X=St(it({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var D,x;const t=Yt,n=as,o=yb(),s=e,i=B(null),r=B(null),{isEditing:a}=Ru(s),l=A=>{if(A){if(typeof A=="string")return A;if(A instanceof Date)return A.toISOString()}},c=Z(()=>s.value===void 0),u=Z(()=>{var A;return(A=s.data)==null?void 0:A.isStarted}),d=Z(()=>{var A;return(A=s.data)==null?void 0:A.isCompleted}),h=Z(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=Z(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Z(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=vo(p),{startDate:v,endDate:y,startClasses:b,endClasses:S,fullStartDate:C,fullEndDate:E}=E7({start:l((D=s.value)==null?void 0:D[0]),end:l((x=s.value)==null?void 0:x[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(A,k)=>Ue((K(),ze(yo,qt(H(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:fe(()=>[c.value?Ze("",!0):(K(),ae("div",{key:0,class:J(A.$style.dateRangeRenderer)},[h.value?Ze("",!0):(K(),ze(rt,{key:0,src:"Calendar",class:J(A.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(K(),ae(xt,{key:1},[Ue((K(),ae("span",{class:J([A.$style.dateLabelDisplay,...H(b).map(T=>A.$style[T])])},[nt(yt(H(v)),1)],2)),[[H(t),H(C)]]),k[0]||(k[0]=pe("span",null,"→",-1)),Ue((K(),ae("span",{class:J([A.$style.dateLabelDisplay,...H(S).map(T=>A.$style[T])])},[nt(yt(H(y)),1)],2)),[[H(t),H(E)]])],64)):Ze("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),HX=it({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:yb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=B(null);Xt(()=>{_t(()=>{o.value&&o.value.focus()})});const s=e,i=n,r=()=>{var y;(y=s.params)==null||y.api.stopEditing(),i("closed")},a=y=>`${mt.fromJSDate(y,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async y=>{await v({startDate:y[0]?a(y[0]):null,dueDate:y[1]?a(y[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async y=>{await v({startDate:y?a(y):null})},h=async y=>{await v({dueDate:y?a(y):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=En("bulkUpdate",!1),{apiServices:g}=Qn(!p,s),v=async y=>{var b,S,C,E,D;try{const x=(b=o.value)==null?void 0:b.getValues(),A=await((C=(S=g.value)==null?void 0:S.changeDate)==null?void 0:C.call(S,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:y.startDate,dueDate:y.dueDate}));A!=null&&A.message&&((D=s.params)==null||D.node.setData({...(E=s.params)==null?void 0:E.node.data,dateRange:x==null?void 0:x.dateRange}))}catch(x){console.error("Failed to update scene name:",x)}};return t({focus:()=>{_t(()=>{var y;(y=o.value)==null||y.focus()})}}),(y,b)=>(K(),ze(xm,qt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:r,ref_key:"calendarRef",ref:o}),null,16))}}),GX=St(it({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=B(null),o=B(0);let s=null;Xt(()=>{n.value&&(s=new ResizeObserver(r=>{for(const a of r)o.value=a.contentRect.height}),s.observe(n.value))}),$c(()=>{s&&n.value&&s.unobserve(n.value)});const i=Z(()=>{const r=o.value;return r>120?r-42-36:0});return(r,a)=>(K(),ae("div",{class:J(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[pe("div",{class:J(r.$style["item-header"])},[pe("div",{class:J(r.$style["item-header__left"])},[Pt(r.$slots,"header-left",{},()=>[pe("h1",{class:J(r.$style["item-header__title"])},[Pt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),pe("div",{class:J(r.$style["item-header__spacer"])},null,2),pe("div",{class:J(r.$style["item-header__actions"])},[Pt(r.$slots,"header-actions")],2)],2),Pt(r.$slots,"grid",{availableHeight:i.value}),pe("div",{class:J(r.$style.footer)},[Pt(r.$slots,"footer")],2),Pt(r.$slots,"new-row"),Pt(r.$slots,"bulk-update-actions"),Pt(r.$slots,"snackbar"),Pt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Lk=(e,t)=>{const n=B(Number(e.value.value)),o=Z(()=>e.value.metricConfig),s=Z(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),i=17,r=Z(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:s,metricConfig:o,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Vk=St(it({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=as,o=Yt,s=e,i=ow(!1),r=B(null),a=B(null),{isEditing:l}=Ru(s),c=Z(()=>{var T,R;return{value:s.value,metricConfig:((R=(T=s.params)==null?void 0:T.colDef)==null?void 0:R.context)||s.config,error:s.error,hovered:i.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Lk(c,i),f=Z(()=>{var F,P,$;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const T=S.value,R=(F=d.value)==null?void 0:F.morpheme_type;return R==="prefix"?`${((P=d.value)==null?void 0:P.morpheme_value)||""} ${T}`.trim():R==="suffix"?`${T} ${(($=d.value)==null?void 0:$.morpheme_value)||""}`.trim():T}),p=Z(()=>{const{format_type:T,format_value:R}=d.value;if(T==="dropdown"&&typeof R=="string"&&R.startsWith("["))try{return JSON.parse(R)}catch{return[]}return[]}),g=Z(()=>({disabled:s.disabled,error:u.value.isError,inputRef:r,wrapperRef:a,clickable:!0,readOnly:s.readOnly,isEmpty:u.value.isEmpty})),{argsMain:v,isHover:y}=vo(g),b=(T,R,F="en-US")=>new Intl.NumberFormat(F,{minimumFractionDigits:R,maximumFractionDigits:R}).format(T),S=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const T=s.value,{format_type:R,format_value:F,mapping:P}=d.value;if(P&&typeof P=="object"&&!Array.isArray(P)){const $=P[`!${T}`];if($)return $}if(R==="dropdown"){const $=p.value.find(te=>String(te.name)===String(T));if($)return $.name}if(typeof T=="string"){const $=Number(T);return Number.isNaN($)?T:T.replace(/[.-]/g,"").length>16?C(T,F):C($,F)}return typeof T=="number"?C(T,F):String(T)}),C=(T,R)=>{const F=Number.parseInt(String(R)||"2",10),P=Number.isFinite(F)&&F>=0?F:2;try{if(typeof T=="string"){const $=T.split("."),te=$[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),U=$[1]?$[1].substring(0,P).padEnd(P,"0"):"0".repeat(P);return P>0?`${te}.${U}`:te}return b(T,P)}catch($){return console.error("Error formatting metric value:",$,{num:T,decimals:P}),String(T)}},{copyToClipboard:E,tooltip:D}=wb(S.value);Je(()=>s.value,(T,R)=>{const F=Number(T);Number.isFinite(F)&&F!==h.value?h.value=F:T==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const A=()=>{i.value=!0},k=()=>{i.value=!1};return(T,R)=>Ue((K(),ze(yo,qt(H(v),{onMouseenter:A,style:{"--icon-size":"24px"},onMouseleave:k,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:fe(()=>[s.disabled?Ze("",!0):(K(),ae("div",{key:0,class:J([T.$style.suffix,"wrapper-suffix"])},[i.value&&!H(u).isEmpty&&!H(u).isError?Ue((K(),ze(ct,{key:0,variant:["icon","secondary"],size:24,onClick:Tt(H(E),["prevent","stop"])},{default:fe(()=>[ue(rt,{src:"Copy",source:"remote",size:12})]),_:1},8,["onClick"])),[[H(o),{content:H(D),hideOnClick:!1,contentClass:"extra-padding"}]]):Ze("",!0)],2))]),default:fe(()=>{var F;return[pe("div",{class:J(T.$style["metric-wrapper"])},[pe("div",{class:J([T.$style["metric-content"],s.disabled?T.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(K(),ae(xt,{key:0},[H(u).pendingCalculation?Ue((K(),ae("span",{key:0,class:J(T.$style["metric-empty"])},[...R[0]||(R[0]=[nt(" - ",-1)])],2)),[[H(o),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(K(),ae("span",{key:1,class:J(T.$style["metric-empty"])}," - ",2)):Ze("",!0)],64)):Ze("",!0),H(u).isError?Ue((K(),ae("div",{key:1,class:J(T.$style["metric-error"])},[...R[1]||(R[1]=[nt(" Error ",-1)])],2)),[[H(o),"Something went wrong. Review formula, inputs and retry."]]):Ze("",!0),!H(u).isEmpty&&!H(u).isError?Ue((K(),ae("span",{key:2,class:J([T.$style["metric-value"],H(y)?T.$style.hovered:"",{[T.$style.disabled]:s.disabled}])},[nt(yt(S.value),1)],2)),[[H(o),{content:f.value,bypassOverflowCheck:!!((F=H(d))!=null&&F.morpheme_value)||H(u).isEmpty}]]):Ze("",!0)],2)],2)]}),_:1},16,["actived"])),[[H(n),{isLoading:H(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),UX={key:0,style:{color:"#6b6b6b"}},WX=St(it({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Yt,o={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},s={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},c=Z(()=>{var F,P;if(a.headerType)return a.headerType;if(((P=(F=a.params)==null?void 0:F.column)==null?void 0:P.getColId()).includes("metric"))return"default";const R=a.headerType??a.params.column.getColId();return l[R]||"default"}),u=B(),d=()=>{var R,F,P;const T=(F=(R=a.params)==null?void 0:R.column)==null?void 0:F.getColDef();if((P=T.colId)!=null&&P.includes("metric")){if(T.context.is_primary==1)return"primary";if(T.context.is_point_metric==1)return"secondary"}};qd(()=>{u.value=d()}),Xt(()=>{u.value=d()});const h=Z(()=>{var T,R;return((R=(T=a.params)==null?void 0:T.column.getColDef().context)==null?void 0:R.morpheme_value)||void 0}),f=Z(()=>{var T;return(T=a.params)==null?void 0:T.displayName}),p=Z(()=>{let T=[];switch(c.value){case"dateRange":T=Object.values(o).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;case"date":T=Object.values(s).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;case"number":T=Object.values(i).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break;default:T=Object.values(r).map(R=>({...R,selected:v.value===R.value,type:"text",hover:x.value===R.value}));break}return v.value!=="none"&&T.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:x.value=="none"}),T}),g=Z(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=B(a.modelValue??"none"),y=T=>{E("update:modelValue",T),E("sort-changed",T)},b=T=>{v.value=T},S=Di(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let T;v.value==="none"?T="asc":v.value==="asc"?T="desc":T="none",v.value=T}else{const T=[o.START_ASC.value,o.START_DESC.value,o.DUE_ASC.value,o.DUE_DESC.value,"none"],F=(T.indexOf(v.value)+1)%T.length;v.value=T[F]}},ir),C=Z(()=>{if(v.value==="none")return"No sorting applied";const T=p.value.find(R=>R.value===v.value);return(T==null?void 0:T.label)||""}),E=t,D=Z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});Je(()=>a.modelValue,T=>{T!=v.value&&(v.value=T)}),Je(v,T=>{T!==a.modelValue&&y(T)});const x=B(v.value);Je(()=>v.value,T=>{x.value=T});const A=T=>{var $,te;if(a.readOnly||a.disabled)return;let R=0;T.key==="ArrowDown"?R=1:T.key==="ArrowUp"&&(R=-1);const F=p.value.findIndex(U=>U.value===x.value),P=p.value.length;if(T.key==="Enter"||T.key===" ")T.preventDefault(),v.value=x.value,($=k.value)==null||$.hide();else if(R!==0){T.preventDefault();let U=(F+R+P)%P;x.value=p.value[U].value}else T.key==="Escape"&&((te=k.value)==null||te.hide())},k=B(null);return Xt(()=>{var T,R;(R=(T=k.value)==null?void 0:T.$el)==null||R.addEventListener("keydown",A)}),$c(()=>{var T,R;(R=(T=k.value)==null?void 0:T.$el)==null||R.removeEventListener("keydown",A)}),(T,R)=>(K(),ze(dS,{ref_key:"dropdownRef",ref:k,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(S),onSelect:R[0]||(R[0]=F=>b(F))},{prefix:fe(()=>[ue(ct,{variant:["text"],onClick:H(S),size:"small"},{default:fe(()=>[Ue((K(),ae("b",null,[nt(yt(f.value),1)])),[[H(n),{content:f.value}]]),h.value?(K(),ae("small",UX," ("+yt(h.value)+") ",1)):Ze("",!0),u.value=="primary"?Ue((K(),ae("div",{key:1,class:J(T.$style["icon-metric"])},[ue(rt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Woohoo metric"]]):Ze("",!0),u.value=="secondary"?Ue((K(),ae("div",{key:2,class:J(T.$style["icon-metric"])},[ue(rt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Point Metric"]]):Ze("",!0)]),_:1},8,["onClick"])]),iconDropdown:fe(()=>[Ue(ue(rt,{src:g.value,source:"remote",color:D.value},null,8,["src","color"]),[[H(n),C.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),zX=["disabled","readonly","checked","indeterminate"],Bk=St(it({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Yt,o=Ji,s=e,i=t,r=Z(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=Z(()=>s.allowIndeterminate?[Ht.UNCHECK,Ht.INDETERMINATE,Ht.CHECKED]:[Ht.UNCHECK,Ht.CHECKED]),l=Z(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ht.UNCHECK:return s.tooltipText.unchecked;case Ht.INDETERMINATE:return s.tooltipText.indeterminate;case Ht.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=B(typeof s.modelValue=="boolean"?s.modelValue?Ht.CHECKED:Ht.UNCHECK:s.modelValue),d=Z(()=>({checked:u.value===Ht.CHECKED,indeterminate:u.value===Ht.INDETERMINATE,none:u.value===Ht.UNCHECK})),h=Z(()=>s.disabled||s.readOnly);return Je(()=>u.value,f=>{i("update:modelValue",f===Ht.CHECKED)}),(f,p)=>Ue((K(),ae("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:J([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:cn({"--input-size":r.value})},null,46,zX)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),jX=St(it({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Yt,o=$m(),{setSelectionStatus:s}=o,{rowCount:i,selectionStatus:r}=Ho(o),a=B(new Set);Je(r,C=>{s(C)},{immediate:!0});const l=Z(()=>r.value!==Ht.UNCHECK),c=Z(()=>({checked:r.value===Ht.CHECKED,indeterminate:r.value===Ht.INDETERMINATE,UNCHECK:r.value===Ht.UNCHECK})),u=Z(()=>({[Ht.UNCHECK]:"Click to select all",[Ht.INDETERMINATE]:"Click to clear selection",[Ht.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Z(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:C,state:E})=>{if(C)if(E===Ht.UNCHECK)C.deselectAll(),a.value.clear(),r.value=E;else if(E===Ht.CHECKED){const D=new Set;C.forEachNode(x=>{x.isSelected()&&D.add(x.id||"")}),a.value=D,C.forEachNode(x=>x.setSelected(!0)),r.value=E}else C.forEachNode(D=>D.setSelected(!0)),r.value=E},p=()=>{var D;const C=(D=t.params)==null?void 0:D.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ht.UNCHECK]:Ht.INDETERMINATE,[Ht.INDETERMINATE]:Ht.UNCHECK,[Ht.CHECKED]:Ht.UNCHECK};f({api:C,state:E[r.value]})},g=C=>{var x;const E=(x=t.params)==null?void 0:x.api;if(!E){console.error("no api");return}const D={INDETERMINATE:Ht.INDETERMINATE,GLOBAL:Ht.CHECKED,UNCHECK:Ht.UNCHECK};f({api:E,state:D[C]})},v=Di(C=>{const{selected:E,total:D}=h(C);if(D==0){r.value=Ht.UNCHECK;return}E===D?r.value=Ht.CHECKED:E===0?r.value=Ht.UNCHECK:r.value=Ht.INDETERMINATE},300);let y=[];const b=C=>{v(C)};Xt(()=>{var A;const C=(A=t.params)==null?void 0:A.api;if(!C)return;const E=k=>v(k.api),D=()=>b(C),x=()=>b(C);C.addEventListener("selectionChanged",E),C.addEventListener("rowDataUpdated",D),C.addEventListener("modelUpdated",D),y=[()=>C.removeEventListener("selectionChanged",E),()=>C.removeEventListener("rowDataUpdated",D),()=>C.removeEventListener("modelUpdated",x)]}),lo(()=>{y.forEach(C=>C())});const S=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,E)=>(K(),ze(dS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:fe(()=>[Ue((K(),ze(Bk,{"tab-index":"8",id:S,disabled:t.disabled,key:H(r),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(r),"onUpdate:modelValue":E[0]||(E[0]=D=>pn(r)?r.value=D:null),onChange:p,"aria-label":H(r)===H(Ht).CHECKED?"All items selected":"Select visible items",class:J(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),KX={key:1},qX=St(it({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=as,n=Yt,o=e,{isEditing:s}=Ru(o),i=B(null),r=B(null),a=Z(()=>o.value),l=Z(()=>a.value===void 0),c=Z(()=>{var f;return((f=a.value)==null?void 0:f.name)||"No status"}),u=Z(()=>{var p;const f=(p=a.value)==null?void 0:p.color;return{backgroundColor:wC(f)?f:"#fff",border:bh(f,"white")?"1px solid #ccc":"1px solid #fff"}}),d=Z(()=>{var f;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:rj((f=a.value)==null?void 0:f.label),inputRef:i,wrapperRef:r,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:h}=vo(d);return(f,p)=>Ue((K(),ze(H(yo),qt(H(h),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:fe(()=>[l.value?Ze("",!0):(K(),ae("div",{key:0,class:J(f.$style["status-renderer"])},[a.value?(K(),ae(xt,{key:0},[pe("div",{class:J(f.$style["status-renderer__color-code"]),style:cn(u.value)},null,6),Ue((K(),ae("div",{class:J(f.$style["status-renderer__status-name"])},[nt(yt(c.value),1)],2)),[[H(n),{content:c.value}]])],64)):l.value?Ze("",!0):(K(),ae("div",KX,"No status"))],2))]),_:1},16)),[[H(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_gdyr9_1","status-renderer__color-code":"_status-renderer__color-code_gdyr9_10","status-renderer__status-name":"_status-renderer__status-name_gdyr9_20"}}]]),$k=St(it({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,{popupRef:s,show:i,hide:r,isVisible:a}=I7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{o.closeOnEscape&&u.key==="Escape"&&a.value&&r()};Xt(()=>{document.addEventListener("keydown",l)}),lo(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const c=n;return Je(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=bs("tooltip");return K(),ae("div",{ref_key:"popupRef",ref:s,class:J(u.$style.popupContainer)},[pe("div",{class:J(u.$style.popupWrapper)},[pe("div",{class:J(u.$style.header)},[pe("span",{class:J(u.$style["header-title"])},yt(e.popupName),3),Ue((K(),ze(ct,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:H(r),"aria-label":"Close popup"},{default:fe(()=>[ue(rt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),pe("div",{class:J(u.$style.body)},[Pt(u.$slots,"default")],2),pe("div",{class:J(u.$style.footer)},[Pt(u.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),YX={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class ZX extends Error{}class Ua extends ZX{constructor(){super("Zone is an abstract class")}}class Hk{get type(){throw new Ua}get name(){throw new Ua}get ianaName(){return this.name}get isUniversal(){throw new Ua}offsetName(t,n){throw new Ua}formatOffset(t,n){throw new Ua}offset(t){throw new Ua}equals(t){throw new Ua}get isValid(){throw new Ua}}const hS=new Map;function XX(e){let t=hS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),hS.set(e,t)),t}const JX={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function QX(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,i,r,a,l,c,u]=o;return[r,s,i,a,l,c,u]}function eJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:i,value:r}=n[s],a=JX[i];i==="era"?o[a]=r:Gm(a)||(o[a]=parseInt(r,10))}return o}const fS=new Map;class Hm extends Hk{static create(t){let n=fS.get(t);return n===void 0&&fS.set(t,n=new Hm(t)),n}static resetCache(){fS.clear(),hS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Hm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return oJ(t,n,o,this.name)}formatOffset(t,n){return Wm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=XX(this.name);let[s,i,r,a,l,c,u]=o.formatToParts?eJ(o,n):QX(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=nJ({year:s,month:i,day:r,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let pS=null;class Pu extends Hk{static get utcInstance(){return pS===null&&(pS=new Pu(0)),pS}static instance(t){return t===0?Pu.utcInstance:new Pu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Pu(Uk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Wm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Wm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Wm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Gm(e){return typeof e>"u"}function Um(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function Gk(e){if(!(Gm(e)||e===null||e===""))return parseInt(e,10)}function tJ(e){if(!(Gm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function nJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function oJ(e,t,n,o=null){const s=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(i.timeZone=o);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Uk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Wm(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Um(n,2)}:${Um(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Um(n,2)}${Um(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Wk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Au(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function ku(...e){return t=>e.reduce(([n,o,s],i)=>{const[r,a,l]=i(t,s);return[{...n,...r},a||o,l]},[{},null,1]).slice(0,2)}function zk(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=Gk(t[n+s]);return[o,null,n+s]}}const jk=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,sJ=`(?:${jk.source}?(?:\\[(${Wk.source})\\])?)?`,Kk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,qk=RegExp(`${Kk.source}${sJ}`),gS=RegExp(`(?:T${qk.source})?`),iJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,rJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,aJ=/(\d{4})-?(\d{3})/,lJ=zk("weekYear","weekNumber","weekDay"),cJ=zk("year","ordinal"),uJ=/(\d{4})-(\d\d)-(\d\d)/,Yk=RegExp(`${Kk.source} ?(?:${jk.source}|(${Wk.source}))?`),dJ=RegExp(`(?: ${Yk.source})?`);function Ou(e,t,n){const o=e[t];return Gm(o)?n:Gk(o)}function hJ(e,t){return[{year:Ou(e,t),month:Ou(e,t+1,1),day:Ou(e,t+2,1)},null,t+3]}function Mu(e,t){return[{hours:Ou(e,t,0),minutes:Ou(e,t+1,0),seconds:Ou(e,t+2,0),milliseconds:tJ(e[t+3])},null,t+4]}function af(e,t){const n=!e[t]&&!e[t+1],o=Uk(e[t+1],e[t+2]),s=n?null:Pu.instance(o);return[{},s,t+3]}function lf(e,t){const n=e[t]?Hm.create(e[t]):null;return[{},n,t+1]}Au(iJ,gS),Au(rJ,gS),Au(aJ,gS),Au(qk),ku(hJ,Mu,af,lf),ku(lJ,Mu,af,lf),ku(cJ,Mu,af,lf),ku(Mu,af,lf),ku(Mu),Au(uJ,dJ),Au(Yk),ku(Mu,af,lf);function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var wo;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(wo||(wo={})),wo.review,wo.review_take,wo.review_scene,wo.review_rendition,wo.review_frame,wo.review_rendition_comment,wo.review_comment,wo.scene_hub,wo.hub_rendition,wo.hub_comment,wo.people_insight,wo.people_detail,wo.project,wo.woohoo,wo.update,wo.core,wo.project_focusMode;var mS=null;function fJ(e){mS=e}function zm(){if(!mS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return mS}function Zk(){try{var e=zm();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function pJ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Nu(o)==="object")Object.keys(o).forEach(function(r){var a="{".concat(r,"}"),l=o[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),s=s.replace(/{value}/g,i)}return s}function gJ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var i=s[o],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function Xk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function Jk(e,t){if(!e||Nu(e)!=="object")return null;try{var n=zm();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),i=0,r=s;i<r.length;i++){var a=r[i],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var y,b=t.toUpperCase();v=(y=p[g])===null||y===void 0||(y=y.errorMessages)===null||y===void 0||(y=y[b])===null||y===void 0||(y=y.validation_rules)===null||y===void 0?void 0:y[c]}if(!v){var S;v=(S=p[g])===null||S===void 0||(S=S.errorMessages)===null||S===void 0||(S=S.GEN)===null||S===void 0||(S=S.validation_rules)===null||S===void 0?void 0:S[c]}if(v&&typeof v=="string")return pJ(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function mJ(e){if(!e)return Zk();var t=e.code,n=e.error,o=e.details,s=e.message;if(Xk(o)&&o){var i=Jk(o,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=zm();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Nu(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l="errorMessages.".concat(a,".").concat(n.key),c=zm(),u=c.t(l);if(console.log("[Error Utils Debug]",u),u&&u!==l){var d=u;return o!=null&&o.context&&(d=gJ(d,o.context)),t!==""?"[".concat(t,"] ").concat(d):d}}catch(f){console.error("[Error Utils Debug]",f)}}if(n&&Nu(n)!=="object"&&Xk(o)){var h=Jk(o);if(h)return t!==""?"[".concat(t,"] ").concat(h):h}return s||Zk()}var Qk={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}",in:"Update failed. Only these values are allowed: {value}",between:"Update failed. Enter a value between {value}"},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const cf=Yl("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")s({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=mJ((c=l==null?void 0:l.res)==null?void 0:c.data);s({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=B([]),n=(l,c)=>{const u=YX[l];if(u){const d=u[c];if(d){s({id:l,type:c,message:d});return}}else s({id:l,type:c,message:l})},o=new Map,s=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{i(u.id),o.delete(u.id)},c);o.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function i(l){t.value=t.value.filter(u=>u.id!==l);const c=o.get(l);c&&(clearTimeout(c.timeoutId),o.delete(l))}function r(l){const c=o.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=o.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{i(l),o.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:s,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),vJ=["onMouseenter","onMouseleave"],yJ=["innerHTML"],wJ=["innerHTML"],CJ=["data-tooltip"],bJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},SJ=St(it({__name:"Snackbar",setup(e){const t=Yt,n=iU,o=cf(),{removeNotification:s}=o,{notifications:i}=Ho(o),r=f=>f.trim().startsWith("<svg"),a=B("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=B(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(K(),ze(GG,{name:"list",tag:"div",class:J(["notification-center",f.$style["notification-wrapper"]])},{default:fe(()=>[(K(!0),ae(xt,null,xn(H(i),g=>{var v;return Ue((K(),ae("div",{key:g.id,class:J([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:y=>d(g.id),onMouseleave:y=>h(g.id)},[pe("p",{class:J(f.$style.snackbar__message)},[pe("span",{class:J(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(K(),ze(rt,{key:0,src:"CircleCheck",source:"remote"})):Ze("",!0),!g.icon&&g.type=="interactive"?(K(),ze(rt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(K(),ze(rt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(K(),ae("i",{key:3,class:J(f.$style["icon-draw"]),innerHTML:g.icon},null,10,yJ)):g.icon&&!r(g.icon)?(K(),ze(rt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ze("",!0)],2),pe("span",{class:J(f.$style["error-message"])},[pe("span",{class:J(f.$style.message),innerHTML:g.message},null,10,wJ)],2)],2),g.actions?(K(),ae("div",{key:0,class:J(f.$style["actions-notification"]),"data-notification":"true"},[(K(!0),ae(xt,null,xn(g.actions,y=>(K(),ze(ct,qt({key:y.label},{ref_for:!0},y,{onClick:Tt(y.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:fe(()=>[y.btnIcon?(K(),ze(rt,{key:0,src:y.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ze("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ze("",!0),g.type!=="interactive"?Ue((K(),ae("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ue(ct,{variant:"secondary",onClick:y=>c(g.message),class:J(f.$style["copy-btn"])},{prefix:fe(()=>[ue(rt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,CJ)),[[H(t),a.value]]):Ze("",!0),g.type=="interactive"?Ue((K(),ae("div",bJ,[ue(ct,{variant:"tertiary",onClick:y=>H(s)(g.id),class:J(f.$style["close-btn"]),size:18},{default:fe(()=>[ue(rt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Ze("",!0)],42,vJ)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
145
145
  * vue-draggable-next v2.3.0
146
146
  * (c) 2025 Anish George
147
147
  * @license MIT
@@ -247,4 +247,4 @@ See ${xN(e,t)}`;return Array.isArray(o)?o.concat(i):[o,i]}var Ope={1:"Charting A
247
247
  If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),$f(u)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);$f(`to see all the valid ${o} properties please check: ${l}`)}}};function tge(e,t,n){const o={},s=e.filter(i=>!t.some(r=>r===i));if(s.length>0)for(const i of s)o[i]=eE({inputValue:i,allSuggestions:n}).values;return o}var nge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),oge={moduleName:"Validation",version:ut,beans:[ege]};function T2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var sge=class extends He{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(o,s)=>{o.hasChildren()&&e&&!s?o.childrenAfterFilter=o.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):o.childrenAfterFilter=o.childrenAfterGroup,T2(o)};if(this.doingTreeDataFiltering()){const o=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(i.childrenAfterGroup[a],c):n(l,c)}n(i,r)},s=i=>o(i,!1);t.executeFromRootNode(s)}else{const o=s=>n(s,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},ige=class extends FE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,o,s){this.comp=e;const i=Kf(this,this.beans.context,s);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=o,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Ft(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}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=ci("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new fd(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.getLocaleTextFunc();Ju(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Hn(t)===this.eGui)return;const s=vc(t,this.eGui,null,e.shiftKey);if(s){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Cc(e);case Oe.ENTER:t&&mc(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&cc(e.relatedTarget,"ag-floating-filter");if(n&&o&&e.target===this.eGui){const s=this.lastFocusEvent,i=!!(s&&s.key===Oe.TAB);if(s&&i){const r=s.shiftKey;mc(this.eGui,r)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new IE(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!Ns(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:o}=this,s=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(o.get("enableFilterHandlers")){const u=i;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:s}),t!=null&&t.isFilterActive(n)&&s(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};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){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,s=this.active?o==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!s?this.updateCompDetails(e,s,n):i.then(r=>{!r||o!=null&&o.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,n):this.updateFloatingFilterParams(s,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var o;if(!e)return;let n=e.params;(o=this.comp.getFloatingFilterComp())==null||o.then(s=>{var i;typeof(s==null?void 0:s.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ro(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),s.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function rge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showColumnMenu({column:n,positionBy:"auto"})}function age(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var lge={moduleName:"SharedMenu",version:ut,beans:[wle],apiFunctions:{showColumnMenu:rge,hidePopupMenu:age}},cge=class extends $re{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:o}=e,s=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,s.top-i.top,0),c=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${c}px`,r=!0);const d=i.right-i.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return s.right-i.left-2}function p(){return s.left-i.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,n,o,s){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:o,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return fa(e)}},vy={moduleName:"Popup",version:ut,beans:[cge]},uge=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function dge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function hge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function fge(e,t){var o;const n=e.colModel.getColDefCol(t);if(n)return(o=e.colFilter)==null?void 0:o.destroyFilter(n,"api")}function pge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function gge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function mge(e,t,n){const{gos:o,colModel:s,colFilter:i}=e;n&&!o.get("enableFilterHandlers")&&(qe(288),n=!1);const r=s.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function vge(e,t,n){var o;return((o=e.filterManager)==null?void 0:o.setColumnFilterModel(t,n))??Promise.resolve()}function yge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function wge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Cge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(o=e.colFilter)==null?void 0:o.getHandler(n,!0)}function bge(e,t){const{colModel:n,colFilter:o,gos:s}=e;if(!s.get("enableFilterHandlers")){qe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(o==null||o.updateModel(a,r))}else o==null||o.updateAllModels(r)}var Sge={filterHandler:()=>({doesFilterPass:()=>!0})},Ege=class extends He{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...VL},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,o;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((o=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:o.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:o,dataTypeSvc:s,filterManager:i}=this.beans;if(s!=null&&s.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];r.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=o.getColDefCol(c)||o.getCol(c);if(!u){qe(62,{colId:c});return}if(!u.isFilterAllowed()){qe(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){qe(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});zn.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;If(h,f)||c.push(u.column)}),c.length>0?i==null||i.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:o,beans:{colModel:s}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);ht(l)&&(t[a]=l)}),!e)for(const r of Object.keys(o)){const a=o[r];ht(a)&&!n.has(r)&&((i=s.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const s=t[o];this.state.set(o,{model:Ro(this.model,o),state:s})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((o,s)=>{const i=o.state;i!=null&&(n=!0,t[s]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ro(this.model,n);const o=e.filter;return o?typeof o.getModel!="function"?(qe(66),null):o.getModel():Ro(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(qe(67),!1):!1,{colModel:t,gos:n}=this.beans,o=!!O0(n),s=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:o},i=[],r=[],a=(c,u,d)=>{u&&(s(c)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(zn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=il(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),zn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var o;const n=[];return this.allColumnFilters.forEach(s=>{const i=s.column;if(s.isHandler)n.push(zn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=il(s);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(o=this.beans.groupFilter)==null||o.updateFilterFlags(e,t),zn.all(n)}doFiltersPass(e,t,n){const{data:o,aggData:s}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?s:o,a=this.model;for(let l=0;l<i.length;l++){const c=i[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:r,model:Ro(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){Sn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,o=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,o=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(s=>{var a,l,c;const{column:i,isHandler:r}=s;o!==i.getColId()&&(r&&((l=(a=s.handler).onAnyFilterChanged)==null||l.call(a)),(c=il(s,r))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var i,r;const o=n.isHandler;o&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const s=il(n,o);s&&t.push(s.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),zn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:o}=this.beans;return(s,i)=>{const r=i?o.getCol(i):e;return r?n.getValue(r,s,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ro(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ht(Ro(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?il(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=il(t);return n?n.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Sse(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":uae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,o,s,i){const r=()=>{const c=this.createFilterCompParams(e,s,i),u=o(c,s);return Rie(this.beans.userCompFactory,t,u,n)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,o){var d,h;const s=this.beans.selectableFilter;s!=null&&s.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,o,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||qe(281,{colId:e.getColId()})),{compDetails:c,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:o}=this.beans;return Ft(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),s))??!0,rowModel:o})}createFilterCompParams(e,t,n,o){const s=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,o);if(i.filterChangedCallback=s,i.filterModifiedCallback=o?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=Ro(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{s({...u,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=n}return i}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const o=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(n),s}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:o,handlerParams:s,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...s,source:"init",model:Ro(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:o,handlerParams:s,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:o,frameworkOverrides:s,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(sL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=o.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:Jre.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:y}=cL(s,t);g?p=g:v==null&&y==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(no(o)&&qe(277,{colId:e.getColId()}),Sge):void 0}createHandler(e,t,n){const o=this.createHandlerFunc(e,t,n);if(!o)return;const s=$0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,s);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const o=e.getColDef(),s=t(Ft(this.gos,{column:e,colDef:o})),i=this.createHandlerParams(e,n);return{handler:s,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),o=e.getColId(),s=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(o,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(o,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{s({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:o}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const s=o&&e.every(i=>o.isGroupFilter(i));e.length>0&&!s&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:o,selectableFilter:s}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(Yf(p))})},r=e.getColDef(),a=s!=null&&s.isSelectable(r)?s.getFilterDef(e,r):r,l=gae(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=$0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Ft(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ro(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Fie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,o){const s="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,o);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const n=e.getColId(),o=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],o&&this.disposeFilterWrapper(o,t).then(s=>{var i;s&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:o,isHandler:s,filterUi:i}=e,r=o.getColId();s&&(n=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(i){if(i.created)return i.promise.then(l=>(n=s?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return zn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,y,b,S,C,E;const n=this.allColumnFilters.get(e);if(!n)return;const o=this.beans,s=n.column,i=s.getColDef(),r=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=o.selectableFilter,c=l!=null&&l.isSelectable(i)?l.getFilterDef(s,i):i,u=r?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(s,c,a,D=>D,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??$0(o.userCompFactory,c,this.createFilterCompParams(s,d,"colDef"));if(h){const D=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),x=Ro(this.model,e);if(n.handlerGenerator!=D){const A=n.handler,{handler:k,handlerParams:T}=this.createHandlerFromFunc(s,u.filterHandler,g);n.handler=k,n.handlerParams=T,n.handlerGenerator=D,delete this.model[e],(v=k.init)==null||v.call(k,{...T,source:"init",model:null}),this.destroyBean(A),x!=null&&((y=this.beans.filterManager)==null||y.onFilterChanged({columns:[s],source:t}))}else{const A=this.createHandlerParams(s,f==null?void 0:f.params);n.handlerParams=A,(S=(b=n.handler).refresh)==null||S.call(b,{...A,source:"colDef",model:x})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,s,f,p);return}n.filterUi.filterParams=g,(E=il(n,h))==null||E.then(D=>{(D!=null&&D.refresh?D.refresh(g):!0)===!1?this.destroyFilterUi(n,s,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:g})})}refreshHandlerAndUi(e,t,n,o,s){const i=this.cachedFilter(e);if(!i)return o&&this.getOrCreateFilterWrapper(e,!0),zn.resolve();if(!i.isHandler)return zn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return Qre(()=>{if(r){const{created:c,filterParams:u}=r;if(c)return r.promise.then(d=>d?{filter:d,filterParams:u}:void 0);r.refreshed=!0}return zn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,s)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:o}=t;return!(n===o||(n==null?void 0:n.render)&&(o==null?void 0:o.render)&&n.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(o=>{n.then(s=>{o(Yf(s))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:s}=this,i=e.getColId(),r=o.get(i);return r?r.model??null:Ro(s,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let o=()=>{};const s=new Promise(i=>{o=i});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(s=>o(s))})}getStateForColumn(e){return this.state.get(e)??{model:Ro(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),o=n?this.getOrCreateFilterWrapper(n,!0):null;return o?this.setModelOnFilterWrapper(o,t):zn.resolve()}setColDefPropsForDataType(e,t,n){var u;const o=e.filter,s=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof s!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:i,filterValueGetter:r}=aae(s,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,o)}setModelOnFilterWrapper(e,t,n){return new zn(o=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){o();return}this.refreshHandlerAndUi(i,t,"api").then(()=>o());return}const s=il(e);if(s){s.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){qe(65),o();return}(i.setModel(t)||zn.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){ht(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),o={model:t,state:n==null?void 0:n.state};this.state.set(e,o)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const o=e.getColId(),s=this.cachedFilter(e),i=()=>s==null?void 0:s.filterUi;HL(t,i,()=>Ro(this.model,o),()=>this.state.get(o),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=i())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((o,s)=>{var r;const i=this.beans.colModel.getColDefCol(s);i&&HL(e,()=>o.filterUi,()=>Ro(this.model,s),()=>this.state.get(s),a=>this.updateState(i,a),a=>{this.updateStoredModel(s,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}),n.length&&zn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();$L(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ro(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const s of n)if(s.source==="COLUMN_MENU")return!1;let o=!1;for(const s of e.keys()){const i=e.get(s);if(i.valid===!1)return!1;(i.model??null)!==Ro(t,s)&&(o=!0)}return o}hasUnappliedModel(e){var o;const{model:t,state:n}=this;return(((o=n.get(e))==null?void 0:o.model)??null)!==Ro(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function _ge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Rge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Dge=class extends He{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:o})=>this.onAdvFilterEnabledChanged(o),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.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var o;this.isAdvFilterEnabled()||(o=this.colFilter)==null||o.setState(e,t,n)}setFilterModel(e,t="api",n){var o;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(o=this.colFilter)==null||o.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){O0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):zn.resolve()).then(()=>{var i;const s={source:t,type:"filterChanged",columns:o};n&&ts(s,n),this.eventSvc.dispatchEvent(s),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!O0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){qe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},Tge=class extends He{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,o){e&&!e.isColumn||this.showPopup(e,s=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:s})},n,t.target,Ns(this.gos),o)}showMenuAfterButtonClick(e,t,n,o){if(e&&!e.isColumn)return;let s=-1,i="left";const r=Ns(this.gos);!r&&this.gos.get("enableRtl")&&(s=1,i="right");const a=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,o)}showPopup(e,t,n,o,s,i){var g;const r=e?this.createBean(new iae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){Sn(57);return}const a=so({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const c=()=>r==null?void 0:r.afterGuiDetached(),u=Ese(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{dV(e,!1,"contextMenu");const y=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),y&&o&&vr(o)){const b=mL(o);b==null||b.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=s&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),dV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||vc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),mc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},xge=class extends He{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const o=e.getColDef(),{selectableFilter:s,valueSvc:i}=this.beans,r=n??(s==null?void 0:s.getFilterValueGetter(e.getColId()))??o.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,o):i.getValue(e,t)}executeFilterValueGetter(e,t,n,o,s){const{expressionSvc:i,valueSvc:r}=this.beans,a=Ft(this.gos,{data:t,node:o,column:n,colDef:s,getValue:r.getValueCallback.bind(r,o)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},Ige={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Fge=class extends yn{constructor(){super(Ige,[Wv]),this.eFloatingFilterText=dt}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,o=n.getHandler();if(o.getModelAsString){const s=o.getModelAsString(n.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},a_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],o=s=>s.some(i=>t[i]!=null)?!0:(qe(72,{keys:s}),!1);if(!n.every(o)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;qe(73)}else qe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function lp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function yy(e){return e==null||typeof e=="string"&&e.trim().length===0}function Pge(e){return e==="AND"||e==="OR"?e:"AND"}function Age(e,t,n){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(s=>s==null))return o(t,n)}function kge(e,t){let n=e.length;return n>t&&(e.splice(t),qe(78),n=t),n}function cp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:s}=n;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var l_=class extends pae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new a_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Pge(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const o=n===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,o=!t.operator;if(!n&&o||n&&!o)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&tl(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),zn.resolve();if(e.operator){const o=e;let s=o.conditions;s==null&&(s=[],qe(77));const i=kge(s,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),zn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(qe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(qe(80),n=1),n>t&&(qe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new iE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,s=>this.resetInput(s)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=so({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,s),this.resetJoinOperatorOr(n,o,s),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const o=this.createManagedBean(new zie);e.push(o);const s="ag-filter-condition-operator";return o.addCss(s),o.addCss(`${s}-${n}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const o=e+1,s=n-o;s>0&&this.removeConditionsAndOperators(o,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,s)=>{const i=this.isConditionDisabled(s,e);o.setDisabled(i||this.filterListOptions.length<=1),s===1&&(kf(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((o,s)=>{Ln(o,this.isConditionBodyVisible(s))});const n=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!n,!0);for(const o of this.eJoinOrs)o.setValue(n,!0);this.forEachInput((o,s,i,r)=>{this.setElementDisplayed(o,s<r),this.setElementDisabled(o,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:o,eJoinPanels:s,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const o=lp(e,t,n);for(const s of o)Li(s)}removeComponents(e,t,n){const o=lp(e,t,n);for(const s of o)Li(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof yc&&this.isConditionBodyVisible(0)?n=o.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,o=!1;const s=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),o=!0,c&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&this.updateConditionStatusesAndValues(n,s),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),s=this.translate(o);n=this.filterPlaceholder({filterOptionKey:o,filterOption:s,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,o,s)=>{if(!(t instanceof yc))return;const i=n===0&&s>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&s>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,o)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof yc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){nL(e)&&Ln(e.getGui(),t)}setElementDisabled(e,t){nL(e)&&kf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof yc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const o=cp(t,this.optionsFactory),s=this.getInputs(e);for(let i=0;i<s.length;i++){const r=s[i];r!=null&&n(r,i,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return cp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==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){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,o,s){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,s,i)=>{i===t&&this.setElementValue(o,n[s]!=null?n[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,o)=>{this.setElementValue(t,n===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},x2=class{constructor(e,t,n,o,s,i){this.alive=!0,this.context=e,this.eParent=s;const r=Die(t,n,o);r&&r.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),i==null||i(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Ln(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},c_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function I2(e,t){const{dateFrom:n,dateTo:o,type:s}=e||{};return[n&&gs(n,void 0,!0)||null,o&&gs(o,void 0,!0)||null].slice(0,cp(s,t))}var F2=1e3,P2=1/0,Oge=class extends l_{constructor(){super("dateFilter",I2,c_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=F2,this.maxValidYear=P2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))qe(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",F2),o=t("maxValidYear",P2);this.minValidYear=n,this.maxValidYear=o,n>o&&qe(83);const{minValidDate:s,maxValidDate:i}=e,r=s instanceof Date?s:gs(s);this.minValidDate=r;const a=i instanceof Date?i:gs(i);this.maxValidDate=a,r&&a&&r>a&&qe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:o},params:s}=this,i=new x2(n,t,s.colDef,Ft(o,{onDateChanged:()=>this.onUiChanged(),filterParams:s,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=so({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,o){const s=so({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(s),e.appendChild(s),n.push(this.createDateCompWrapper(s))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),lp(this.eConditionPanelsFrom,e,t),lp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const o=lp(e,t,n);for(const s of o)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:o,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,o,s,i)=>{s!==e||!t||o>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},o=this.getValues(e),s=this.params.useIsoSeparator?"T":" ";return o.length>0&&(n.dateFrom=Ls(o[0],!0,s)),o.length>1&&(n.dateTo=Ls(o[1],!0,s)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},A2=class extends He{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new a_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,o=[];if(n){const r=t;o.push(...r.conditions??[])}else o.push(t);const s=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return o[s](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:o}}=e;if(t==null)return;let i=KL(t)?t.conditions:[t];const r=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!i||i.every(u=>r.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((i&&!i.every(u=>u.filterType===c)||t.filterType!==c)&&(i=i.map(u=>({...u,filterType:c})),l=!0),typeof o=="number"&&i&&i.length>o&&(i=i.slice(0,o),l=!0),l){const u=i.length>1?{...t,filterType:c,conditions:i}:{...i[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const o=this.optionsFactory,s=this.mapValuesFromModel(t,o),i=o.getCustomOption(t.type),r=Age(i,s,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,n,t,e))}},k2=class extends A2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:o,includeBlanksInLessThan:s,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const o=n.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const s=this.comparator(),i=e[0]!=null?s(e[0],t):0;switch(o){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=s(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return yy(t);case"notBlank":return!yy(t);default:return qe(76,{filterModelType:o}),!0}}},O2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Mge={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},u_=class extends He{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?rl(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(c=>this.getModelAsString(c,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${rl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?rl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?n(a,l):this.conditionToString(i,o,i.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,o,s,i){let r;const a=this.getTypeKey(e);return a&&(r=rl(this,a)),s&&i&&(r=this.getLocaleTextFunc()(s,i)),r!=null?t?`${r} ${rl(this,"filterSummaryInRangeValues",[n(),o()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},M2=class extends u_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:o,valueSvc:s}=this.beans,i=t.column,r=o==null?void 0:o.getDateFormatterFunction(i),a=r?r(n??void 0):n;return s.formatValue(i,null,a)}),this.filterTypeKeys=O2}conditionToString(e,t,n,o,s){const{type:i}=e,r=gs(e.dateFrom),a=gs(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Q0(h,l),u=()=>r!==null?c(r):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(i,n,u,d,o,s);if(h!=null)return h}return n?`${u()}-${d()}`:r!=null?c(r):`${i}`}};function Nge(e,t){const n=t;return n<e?-1:n>e?1:0}var Lge=class extends k2{constructor(){super(I2,c_),this.filterType="date",this.FilterModelFormatterClass=M2}comparator(){return this.params.filterParams.comparator??Nge}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},N2=class extends yn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new a_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(n);this.setEditable(o)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:o,model:s}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Vge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},Bge=class extends N2{constructor(){super(Vge,[Wv]),this.eReadOnlyText=dt,this.eDateWrapper=dt,this.FilterModelFormatterClass=M2,this.filterType="date",this.defaultOptions=c_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?gs(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Ln(this.eDateWrapper,e),Ln(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,o=Ls(e),s=o==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=pE(e,this.defaultDebounceMs);return Ft(this.gos,{onDateChanged:Po(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:o}=this;this.dateComp=new x2(e,t,o.column.getColDef(),this.getDateComponentParams(),n,s=>{s.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},$ge={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Hge=class extends yn{constructor(){super($ge,[Wv]),this.eDateInput=dt,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&nl();const{minValidYear:o,maxValidYear:s,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&o&&qe(85),r&&s&&qe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:gs(g));f&&p&&f.getTime()>p.getTime()&&qe(87)}i?i instanceof Date?t.min=Q0(i):t.min=i:o&&(t.min=`${o}-01-01`),r?r instanceof Date?t.max=Q0(r):t.max=r:s&&(t.max=`${s}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return gs(this.eDateInput.getValue())}setDate(e){var o;const t=this.params.filterParams.colDef.cellDataType,n=((o=this.beans.dataTypeSvc)==null?void 0:o.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ls(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},d_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function h_(e){const{allowedCharPattern:t}=e??{};return t??null}function f_(e){return e==null||isNaN(e)?null:e}function L2(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[f_(n),f_(o)].slice(0,cp(s,t))}var Gge=class extends l_{constructor(){super("numberFilter",L2,d_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:o}=this.params,s=!n&&o?o(t??null):t;super.setElementValue(e,s)}createEValue(){const e=h_(this.params),t=so({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,o){const s=this.createManagedBean(o?new wc({allowedCharPattern:o}):new sE);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=o=>this.removeComponents(o,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(f_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=sa(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},V2=class extends u_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=O2}conditionToString(e,t,n,o,s){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),o,s);if(c!=null)return c}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Uge=class extends k2{constructor(){super(L2,d_),this.filterType="number",this.FilterModelFormatterClass=V2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},B2=class extends He{constructor(e){super(),this.params=e,this.eInput=dt,this.onValueChanged=()=>{}}setupGui(e){var o;this.eInput=this.createManagedBean(new wc((o=this.params)==null?void 0:o.config));const t=this.eInput.getGui();e.appendChild(t);const n=s=>this.onValueChanged(s);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function p_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function $2(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[n||null,o||null].slice(0,cp(s,t))}var Wge={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},H2=class extends N2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=dt,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Wge)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:o,readOnly:s}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Yv(e.filterParams),!s){const i=pE(e.filterParams,o),r=Po(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Fo(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:s,lastType:i}=this;let r=o.getValue();if(s.filterParams.trimInput&&(r=p_(r),o.setValue(r,!0)),n){const a=s,l=a.model,c=this.convertValue(r),u=c==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},zge=class extends He{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new sE),this.eTextInput=this.createManagedBean(new wc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(n,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=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.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},jge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=V2,this.filterType="number",this.defaultOptions=d_}updateParams(e){h_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=h_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new B2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new zge)}convertValue(e){return e?Number(e):null}},g_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Kge=class extends l_{constructor(){super("textFilter",$2,g_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(sa(n.getValue()))}),t}createEValue(){const e=so({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const o=this.createManagedBean(new wc);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:o,eValuesTo:s}=this;n(o),n(s)}},G2=class extends u_{constructor(){super(...arguments),this.filterTypeKeys=Mge}conditionToString(e,t,n,o,s){const{filter:i,filterTo:r,type:a}=e;if(t){const l=u=>()=>rl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(i),l(r),o,s);if(c!=null)return c}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},qge=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const o=t.lastIndexOf(n);return o>=0&&o===t.length-n.length}default:return!1}},Yge=e=>e,Zge=e=>e==null?null:e.toString().toLowerCase(),Xge=class extends A2{constructor(){super($2,g_),this.filterType="text",this.FilterModelFormatterClass=G2}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??qge,this.formatter=t.textFormatter??(t.caseSensitive?Yge:Zge)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,o){const s=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return yy(t);if(n.type==="notBlank")return!yy(t);const d={api:r,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:n.type,value:i,textFormatter:u};return s.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const o={...n},{filter:s,filterTo:i}=n;return s&&(o.filter=p_(s)??null),i&&(o.filterTo=p_(i)??null),o};return KL(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Jge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=G2,this.filterType="text",this.defaultOptions=g_}createFloatingFilterInputService(){return this.createManagedBean(new B2)}};function Qge(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function eme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function tme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var nme=class extends He{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:o}=this.beans,s=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(s&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=o==null?void 0:o.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ht(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){qe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const o=this.getTextForColumn(n,e);return ht(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:o,matcher:s}=this;return s(o,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const s=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:o});n=o.getQuickFilterText(s)}return ht(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const o=this.getTextForColumn(n,e);ht(o)&&t.push(o)}return t.join(`
248
248
  `)}},ome={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[sge]},m_={moduleName:"FilterCore",version:ut,beans:[Dge],apiFunctions:{isAnyFilterPresent:_ge,onFilterChanged:Rge},css:[uge],dependsOn:[ome]},U2={moduleName:"FilterValue",version:ut,beans:[xge]},wy={moduleName:"ColumnFilter",version:ut,beans:[Ege,Tge],dynamicBeans:{headerFilterCellCtrl:ige},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:dge,getColumnFilterInstance:hge,destroyFilter:fge,setFilterModel:pge,getFilterModel:gge,getColumnFilterModel:mge,setColumnFilterModel:vge,showColumnFilter:yge,hideColumnFilter:wge,getColumnFilterHandler:Cge,doFilterAction:bge},dependsOn:[m_,vy,U2,lge]},sme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Fge},dependsOn:[wy]},ime={moduleName:"TextFilter",version:ut,dependsOn:[wy],userComponents:{agTextColumnFilter:{classImp:Kge,params:{useForm:!0}},agTextColumnFloatingFilter:Jge},dynamicBeans:{agTextColumnFilterHandler:Xge}},rme={moduleName:"NumberFilter",version:ut,dependsOn:[wy],userComponents:{agNumberColumnFilter:{classImp:Gge,params:{useForm:!0}},agNumberColumnFloatingFilter:jge},dynamicBeans:{agNumberColumnFilterHandler:Uge}},ame={moduleName:"DateFilter",version:ut,dependsOn:[wy],userComponents:{agDateColumnFilter:{classImp:Oge,params:{useForm:!0}},agDateInput:Hge,agDateColumnFloatingFilter:Bge},dynamicBeans:{agDateColumnFilterHandler:Lge}},lme={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[nme],dependsOn:[m_,U2]},cme={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:Qge,getQuickFilter:eme,resetQuickFilter:tme},dependsOn:[lme]},ume={moduleName:"ExternalFilter",version:ut,dependsOn:[m_]},dme=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",v_=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,r=s||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},hme=class extends He{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,i=r_(s),{column:r,eGui:a}=t,l=r.getColDef();!o&&i&&!l.headerComponent&&(o=_v(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(s,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,i=r_(s),{column:r,eGui:a}=t,l=r.getColGroupDef();!o&&i&&!(l!=null&&l.headerGroupComponent)&&(o=_v(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(s,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:i}=o,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(i!=null&&i.isEditing(e))&&v_(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&ht(g))return sp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(s,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=r_(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&v_(o,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=_v(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(s,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const i={getGui:()=>s,getTooltipValue:()=>v_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ht(t.tooltipField)||ht(t.tooltipValueGetter)||ht(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},fme=class extends Lre{createTooltipComp(e,t){const n=Iie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},W2={moduleName:"Tooltip",version:ut,beans:[hme],dynamicBeans:{tooltipFeature:FL,highlightTooltipFeature:Vre,tooltipStateManager:fme},userComponents:{agTooltipComponent:Hre},dependsOn:[vy],css:[dme]},bd=class{constructor(e){this.cellValueChanges=e}},y_=class extends bd{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},pme=10,z2=class{constructor(e){this.actionStack=[],this.maxStackSize=e||pme,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}},gme=class extends He{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&TV(this.activeCellEdit,t),o=this.activeRowEdit!==null&&Vce(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:c}=e,u={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new z2(n),this.redoStack=new z2(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[o],s),i instanceof y_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:i,columnId:r}=o,a={rowIndex:s,rowPinned:i},l=pa(this.beans,a);l.displayed&&l.setDataValue(r,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const i=o.startRow,r=o.endRow;s===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},i=pa(this.beans,s),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:i,rangeSvc:r}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};i.setFocusedCell({...c,forceBrowserFocus:!0}),r==null||r.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new bd(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 n=new bd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new y_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&ra(n)?e=new y_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new bd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new bd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},mme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",vme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},yme=class extends ry{constructor(){super(vme,[oE]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Cv(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Cy=class extends ry{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;o?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?r="":s&&s.length===1?i?a=!1:r=s:(r=t.getStartValue(),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;nl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},wme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Cme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return wme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:i}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ht(n)&&!ht(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ls(e,this.includeTime??!1)}},bme=class extends Cy{constructor(){super(new Cme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Sme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Eme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Sme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:i}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:i,getValidationErrors:r}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const u=new Date(i);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ht(n)&&!ht(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ls(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):gs(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ls(e??null,this.includeTime??!1)??void 0}},_me=class extends Cy{constructor(){super(new Eme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Rme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Dme=class extends ry{constructor(){super(Rme,[Kie]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ht(o)&&!ht(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let i=[];return typeof s=="string"&&t!=null&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,internalErrors:i,cellEditorParams:e}):i}},Tme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},xme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Tme}getAgComponents(){return[qie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:i}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ht(n)&&!ht(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Ime=class extends Cy{constructor(){super(new xme(()=>this.getLocaleTextFunc()))}},Fme={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Pme=class extends ry{constructor(){super(Fme,[ire]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:i,eventKey:r}=e;if(Nn(s)){qe(58);return}this.startedByEnter=r!=null?r===Oe.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const i=this.getLocaleTextFunc();s.push(i("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},Ame={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},kme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Ame}getAgComponents(){return[Wv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let i=[];return t!=null&&typeof o=="string"&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ht(n)&&!ht(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ht(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},j2=class extends Cy{constructor(){super(new kme(()=>this.getLocaleTextFunc()))}};function Ome(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Mme(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function K2(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function q2(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Nme(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Lme(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Vme(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Bme(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function $me(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,i)=>{const{rowIndex:r,rowPinned:a}=i;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=ga(l);let g=u??d;g===di&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Hme(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else _c(e,{persist:!0});yd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Gme(e,t){var o;const n=Gn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function Ume(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(o);if(!l){qe(12,{colKey:o});return}const u=pa(e,{rowIndex:s,rowPinned:i||null});if(!u){qe(290,{rowIndex:s,rowPinned:i});return}if(!l.isCellEditable(u))return;i==null&&q2(e,s),K2(e,o),r==null||r.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Wme(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function zme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function jme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Kme={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},qme=class extends H0{constructor(e){super(Kme),this.params=e}postConstruct(){fc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{SE(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function Yme(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=Zme(e.gos,r),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function Zme(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function w_(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,s)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Xme(e,t,n="ui"){const o=w_(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(i=>w_(e,{rowNode:t.rowNode,column:i},n))}var by=(e,t=!1)=>{if(e!==void 0)return ga(e)||t&&e.state==="editing"};function Y2(e,t,n=!1){var o;return by((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var Z2=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const i=e[o];if(i.data&&(by(t==null?void 0:t.getEdit({rowNode:i,column:n}))||by(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||Z2(i.childrenAfterGroup,t,n))return!0}};function X2(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:Z2(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function J2(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return by((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var Jme=class extends He{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=Y2(n,e)||X2(n,e)||J2(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Qme=class extends He{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return Y2(n,c,!0)||X2(n,c)||J2(n,c)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var s,i;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",o&&t),r.toggleCss("ag-row-batch-edit",o&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},eve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(i=>o.has(i)&&s.add(i)),t==null||t.forEachPinnedRow("top",i=>o.has(i)&&s.add(i)),t==null||t.forEachPinnedRow("bottom",i=>o.has(i)&&s.add(i));for(const i of o)s.has(i)||n.removeEdits({rowNode:i});return s},tve=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:s,column:r}))},nve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());tve(e,eve(e,o),t)},ove=new Set(["undo","redo","paste","bulk","rangeSvc"]),sve=new Set(["ui","api"]),Q2={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},ive=new Set(Object.keys(Q2)),rve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Sy={cancel:!0,source:"api"},ave={cancel:!1,source:"api"},Sd={checkSiblings:!0},up={force:!0,suppressFlash:!0},lve=class extends He{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,Sy),this.createStrategy(o)});const t=nve(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Sy):this.isEditing()&&(this.isBatchEditing()?yd(e,this.model.getEditPositions()):this.stopEditing(void 0,ave)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Sy)):(this.stopEditing(void 0,Sy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=eB(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=Yme(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return Efe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Sd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,y,b;const{event:n,cancel:o,source:s="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(ive.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?Q2[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Sd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Gn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(r??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(i??!1);if(p||g){_c(a,{persist:!0,isCancelling:g||o,isStopping:p});const S=l.getEditMap(),C=this.processEdits(S,o,s);(v=this.strategy)==null||v.stop(o,n);for(const E of C)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(S)){const D=Gn(a,E),x=ga(E);D==null||D.refreshCell({force:!0,suppressFlash:!x})}h=S,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((y=this.strategy)!=null&&y.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:S}=n,C=S===Oe.ENTER,E=S===Oe.ESCAPE,D=S===Oe.TAB;(C||D||E)&&(C||D?_c(a,{persist:!0}):E&&this.revertSingleCellEdit(d),this.isBatchEditing()?(b=this.strategy)==null||b.cleanupEditors():yd(a,l.getEditPositions(),{event:n,cancel:E}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else _c(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),JE(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Oe.ENTER||!a)return;const l=r?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of o){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),u={rowNode:r,column:l},d=ga(c);!t&&d&&!s&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,n)||i.push(u))}}return i}setNodeDataValue(e,t,n,o,s="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=sve.has(s)?"edit":s;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),o&&(r==null||r.refreshCell(up)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=up;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...cve(e),...up}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:i,rowModel:r}=o;no(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!u.parent&&u.sibling&&i.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Gn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=Gn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const i=eB(o)==="fullRow"?Xme(s,e,t):w_(s,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,i,r;const n=Gn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(yd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),vd(this.beans,e,{silent:!0}),Rc(this.beans),n==null||n.refreshCell(up),t&&(n==null||n.focusCell(),(r=(i=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var o;Rc(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(up),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof wd&&i&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,r)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!r&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const r=this.model.getEdit({rowNode:s,column:t});r&&(o=r)}const i=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return i===di||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){vfe(this,this.beans,e)}createPopupEditorWrapper(e){return new qme(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!rve.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||ove.has(n))return fy(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return fy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return fy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Cfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Sd))return;const{rowNode:o,column:s}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(o,Sd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,Sd);if(r!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Ft(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:i}=this;_c(o,{persist:!0});const r=this.model.getEditMap(!0),a=(u=(c=r.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=pa(o,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let y=i.parseValue(g,f??null,a,v);Number.isNaN(y)&&(y=null),p.set(g,{editorValue:void 0,pendingValue:y,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),JE(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Jme(e,t)}createRowStyleFeature(e,t){return new Qme(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=r?o.getCol(r):l?o.getCol(l):a;if(!f)continue;const p=pa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ga({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=di),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Gn(this.beans,e);if(!t||!this.isEditing(t,Sd))return;const n=this.model.getEdit(t);if(!n||!ga(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function cve(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function eB(e,t){return t??e.get("editType")??"singleCell"}var tB=class extends He{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:o,beans:s}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(s,n));const{gos:r,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:pa(s,{rowIndex:u,rowPinned:d})},f=r.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,i;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const r of n){o.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(r);continue}o.pass.push(r)}if(e)for(const r of n)py(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(o);if(r.destroy.length>0)for(const a of r.destroy)py(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Gn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){_c(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);yd(this.beans,o),JE(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,i;return(i=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:i.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;wfe(this.beans,i,s,r,t,o)}dispatchCellEvent(e,t,n,o){const s=Gn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=ZE(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Oe.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,i)=>{s.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),i=s.pendingValue===di?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,s);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},uve=class extends tB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!ZE(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(r)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const u of c){const d={rowNode:r,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(ga(a)){o.push(r);break}}}),Rc(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of o)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),u=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||vd(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var i;if(n!=="editing")return;const s=Gn(this.beans,{rowNode:t,column:o});s&&!((i=s.comp)!=null&&i.getCellEditor())&&vd(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},dve=class extends tB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:i}=e||{};return(!this.rowNode||!this.column)&&s&&i?null:this.rowNode!==s||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:i}=e,r=pa(this.beans,{rowIndex:o,rowPinned:i}),a=XE(s),l=t.getCol(a),c=e.previousParams;if(c){const u=XE(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,y,b,S;const i=this.beans.focusSvc.getFocusedCell();i&&(e=gd(this.beans,i)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((y=a.comp)!=null&&y.getCellEditor())){const C=(b=this.editSvc)==null?void 0:b.isEditing(a,{withOpenEditor:!0});vd(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(S=e.rowCtrl)==null||S.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},ul={moduleName:"EditCore",version:ut,beans:[mfe,lve],apiFunctions:{getEditingCells:$me,getEditRowValues:Bme,getCellEditorInstances:yfe,startEditingCell:Ume,stopEditing:Hme,isEditing:Gme,validateEdit:Wme},dynamicBeans:{singleCell:dve,fullRow:uve},dependsOn:[vy,W2],css:[mme]},hve={moduleName:"UndoRedoEdit",version:ut,beans:[gme],apiFunctions:{undoCellEditing:Lme,redoCellEditing:Vme,getCurrentUndoSize:zme,getCurrentRedoSize:jme},dependsOn:[ul]},fve={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:j2,agTextCellEditor:j2},dependsOn:[ul]},pve={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Ime}},dependsOn:[ul]},gve={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:bme,agDateStringCellEditor:_me},dependsOn:[ul]},mve={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:yme},dependsOn:[ul]},vve={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Pme},dependsOn:[ul]},yve={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:Dme},dependsOn:[ul]},wve={moduleName:"CustomEditor",version:ut,dependsOn:[ul]},Cve=class extends He{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,rd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Pse(e))}createColumns(e,t){var h,f;const n=()=>{var p;Lv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,r=this.generateSelectionCols();if(Fse(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(r,c))??[];this.columns={list:r,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!la(v));return[...r,...g]})}updateColumns(e){var n;const t=rd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),Bi(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>jf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!dc(e))return!1;const o=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!id(n),i=Pv(n);return s||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:UN,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new pc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?id(t):void 0,s=e&&typeof e!="string"?id(e):void 0,i=o!==s,r=t&&typeof t!="string"?Pv(t):void 0,a=e&&typeof e!="string"?Pv(e):void 0,l=r!==a,c=Av(e),u=Av(t);(i||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Lv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const i=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Vi(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(WN))?2:1)===o&&i()}};function bve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!tp(a)?(qe(59),!1):a.id===void 0?(qe(60),!1):!0))return;const{nodes:o,source:s,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:o,source:s??"api",newValue:i})}function Sve(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function Eve(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function _ve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Rve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Dve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Tve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function xve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Ive(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Fve=class extends Ule{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=kv(e),this.groupSelectsDescendants=Wf(e),this.groupSelectsFiltered=Ov(e)==="filteredDescendants",this.masterSelectsDetail=VN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Wf(e),n=kv(e),o=Ov(e)==="filteredDescendants";this.masterSelectsDetail=VN(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?oB(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:i,keepDescendants:r=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!dc(a)&&e)return qe(132),0;if(o.length>1&&!this.isMultiSelect())return qe(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=Ed(d);if(h.rowPinned&&!tp(h)){qe(59);continue}if(h.id===void 0){qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,i))}return n||(o.length===1&&i==="api"&&this.selectionCtx.setRoot(Ed(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ed(o[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const i=Ed(s);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!no(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new op(!0,s),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!Ave(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&o.set(i.parent.id,i.parent)}}),o.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&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)}createDaemonNode(e){if(!e.id)return;const t=new sl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!no(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=no(this.gos);let o=!1;const s=i=>{const r=this.selectRowNode(Ed(i),!1,void 0,e);o||(o=r)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);o||(o=i)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return nB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let i=o;i<=s;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!dc(t)){qe(132);return}if(vse(t)&&!Uf(t)){qe(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let i=!1;if(this.getNodesToSelect(s).forEach(r=>{const a=this.selectRowNode(Ed(r),!0,void 0,o);i||(i=a)}),n.selectAll=!0,no(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(o);i||(i=r)}i&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Sn(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(i=>{o.has(i.id)&&s.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return no(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!dc(t))return;const o="selectableChanged",s=e!==void 0,i=no(t)&&this.groupSelectsDescendants,r=[],a=c=>{var d;if(s&&!c.group)return;if(i&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&r.push(c)};if(i){if(e===void 0){const c=n.rootNode;e=c?new op(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:o}),!s&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const o=Pve(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Uf(t)){qe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const i of o){const r=n.getRowNode(i);r&&s.push(r)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ed(e){return tp(e)?e.pinnedSibling:e.footer?e.sibling:e}function Pve(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),nB(t,n)}function nB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function Ave(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function oB(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(oB))??!1;return t||n}var kve={moduleName:"SharedRowSelection",version:ut,beans:[Cve],apiFunctions:{setNodesSelected:bve,selectAll:Sve,deselectAll:Eve,selectAllFiltered:_ve,deselectAllFiltered:Rve,selectAllOnCurrentPage:Dve,deselectAllOnCurrentPage:Tve,getSelectedNodes:xve,getSelectedRows:Ive}},Ove={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Fve],dependsOn:[kve]};function Mve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function Nve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function sB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function iB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){qe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function Lve(e,t,n){var s,i;const o=Vpe(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){Sn(238);return}o.setRowCount(t,n);return}Sn(28);return}(i=my(e))==null||i.setRowCount(t,n)}function Vve(e){var t;return nd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function Bve(e){return e.rowModel.isLastRowIndexKnown()}var $ve={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:Mve,collapseAll:Nve}},Hve={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:sB,resetRowHeights:iB}},Gve={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:Lve,getCacheBlockState:Vve,isLastRowIndexKnown:Bve}},Uve=class extends He{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{var i;if(!o){Sn(18),t||Sn(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(i=s.current)==null?void 0:i.api:(s.api||Sn(19),s.api)}).filter(o=>!!o&&!o.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){if(!this.consuming)for(const t of this.getAlignedGridApis())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.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}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":qe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:i,colModel:r}=o;if(t&&(n=r.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Bi(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Bi(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Bi(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=i.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},Wve={moduleName:"AlignedGrids",version:ut,beans:[Uve],dependsOn:[UV]},zve=class extends He{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},rB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=rB(this.rootNode),i=new Array(e.length);s._leafs=i;let r=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const y=a(g);y&&c(v,y)}}};c(s,e),i.length=r}setImmutableRowData(e,t){var y;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=sd(o),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,c=[],u=(y=this.beans.groupStage)==null?void 0:y.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(b,S)=>{if(!d&&d!==void 0){const C=b.sourceRowIndex;d=C<=h,h=C}b.data!==S&&(b.updateData(S),r.has(b)||a.add(b),!b.selectable&&b.isSelected()&&c.push(b))},g=(b,S,C)=>{for(let E=0,D=S.length;E<D;++E){const x=S[E];if(!x)continue;let A=this.getRowNode(s({data:x,level:C}));if(A?(p(A,x),f||(f=!!u&&A.treeParent!==b)):(A=this.createRowNode(x,C),r.add(A)),!u||l.has(A)){l.add(A);continue}l.add(A),A.treeParent=b;const k=u(x);k&&g(A,k,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,c)||d||r.size>0;if(v){const b=n._leafs??(n._leafs=[]);d===void 0?Zve(b,l,i):Yve(b,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,i=o.length;s<i;s++){const r=o[s];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return qe(268),{remove:[],update:[],add:[]};const n=[],o=sd(this.gos),s=this.executeRemove(o,e,t,n),i=this.executeUpdate(o,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&qve(r,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),r[a++]=u,n.has(u)||o.add(u))}return r.length=a,r}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=s+r;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(r),u=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new sl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&qe(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return Kve(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(Sn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=jve(e,t)),t}},jve=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},rB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=o,i.childrenAfterFilter=s,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Kve=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return Sn(5,{data:t}),null},qve=(e,t,n,o,s)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Yve=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===o?i||(i=s):(a>=0?i=!0:s=!0,r.sourceRowIndex=o,e[o]=r),++o}return i},Zve=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let i=0;for(let r=0;r<s;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of o)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},aB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const i=t[o],r=o===0,a=o===s;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==o&&(i.childIndex=o,i.dispatchRowEvent("childIndexChanged"))}},Xve=class extends He{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,o){const{gos:s,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=i.getCols().some(b=>b.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const y=b=>{var D,x;const S=f&&b.leafGroup;let C=u&&d&&!b.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let E=null;if(C){let A=!1;if(h){const k=b.level+1;k<h.length&&(A=h[k].getSort()===null)}A||(E=eye(b))}else!e.length||S||(t&&n?E=Jve(a,b,n,o,e):E=a.doFullSort(b.childrenAfterAggFilter,e));if(E||(E=((D=b.childrenAfterAggFilter)==null?void 0:D.slice(0))??[]),g||(g=((x=b.childrenAfterSort)==null?void 0:x[0])!==E[0]),b.childrenAfterSort=E,aB(b),p){const A={nodes:b.childrenAfterSort};p(A)}};if(o==null||o.forEachChangedNodeDepthFirst(y),g&&s.get("groupHideOpenParents")){const b=c==null?void 0:c.getShowRowGroupCols();b!=null&&b.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(br(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Jve=(e,t,n,o,s)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),Qve(e,s,l,d)},Qve=(e,t,n,o)=>{let s=0,i=0;const r=n.length,a=o.length,l=new Array(r+a);let c=0;for(;s<r&&i<a;){const u=n[s],d=o[i];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++i)}for(;s<r;)l[c++]=n[s++].rowNode;for(;i<a;)l[c++]=o[i++].rowNode;return l},eye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const i=new Array(s),r=new Set;for(let l=0;l<s;++l)r.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];r.delete(c)&&(i[a++]=c)}if(r.size===0&&a===o)return t;for(const l of r)i[a++]=l;return i.length=a,i},tye=class extends He{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Po(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new sl(e);this.rootNode=t,this.nodeManager=this.createBean(new zve(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var i;const s=(i=o.changeSet)==null?void 0:i.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,i=!1;do{s=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=Qa(this.beans,d);d.setRowHeight(h.height),s=!0,i=!0}}s&&this.setRowTopAndRowIndex()}while(s);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const i=new Set(e),r=s==null?void 0:s.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,qe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new ly,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let i=0,r=e.length;i<r&&s;++i)s=Math.min(s,n.get(e[i])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const i=Ao(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=Qa(t,l,i,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(r),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},s=r=>{o(r),o(r.detailNode),o(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},i=this.rootNode;i&&s(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let c=i[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let i=s.parent;for(;i&&i!==t;)s=i,i=s.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:od(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:od(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:od(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new op(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(s&&r&&o.dispatchEvent({type:"rowDataUpdated"}),!s||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),r&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],i=Wf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(o)return;if(n&&(r===t||r===e)&&(o=!0,i&&r.group)){lB(s,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(o=!0)}(!r.group||!i)&&s.push(r)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let r=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),r===o&&a===s))return l;r=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,o=this.rootNode,s=0){let i=s;if(!o)return i;const r=o===this.rootNode;if(r||e(o,i++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,o,e,t,r,"top"))??i;for(const c of a)i=this.depthFirstSearchRowNodes(e,t,n,c,i);return(l==null?void 0:l.addTotalRows(i,o,e,t,r,"bottom"))??i}}return i}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),aB(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,T2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(dE)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],i=[],r=new ly;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,r);s.push(u),c&&i.push(c.bind(null,u))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,c=i.length;l<c;l++)i[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new ly,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},lB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const i=n[o];i.data&&e.push(i),i.group&&lB(e,i)}};function nye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function oye(e,t){const n=cl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function sye(e){var t;return((t=cl(e))==null?void 0:t.isEmpty())??!0}function iye(e,t){var n;(n=cl(e))==null||n.forEachLeafNode(t)}function rye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilter(t)}function aye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function lye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=cl(e))==null?void 0:n.updateRowData(t)})}function cye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=cl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function uye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=cl(e))==null?void 0:t.flushAsyncTransactions()})}function dye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var cB={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[tye,Xve],dependsOn:[y2]},hye={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:nye,refreshClientSideRowModel:oye,isRowDataEmpty:sye,forEachLeafNode:iye,forEachNodeAfterFilter:rye,forEachNodeAfterFilterAndSort:aye,applyTransaction:lye,applyTransactionAsync:cye,flushAsyncTransactions:uye,getBestCostNodeSelection:dye,resetRowHeights:iB,onRowHeightChanged:sB},dependsOn:[$ve,Hve]},fye=class extends He{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:o,skipRowGroups:s,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&gse(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(Ft(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Ft(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new tL,{colGroupSvc:s}=this.beans,i=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,i)=>{o.onColumn(s,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,i;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=no(this.gos),i=nd(this.gos),r=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||r){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||i?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):s(i.parent,r.parent):i.level>r.level?s(i.parent,r):s(i,r.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,i;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),c=h=>la(h)?!1:!ca(h)||o;if(s!=null&&s.length)return i.getColsForKeys(s).filter(c);const u=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!L0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const i=s;if(i.getChildren)for(const r of i.getChildren()??[])o.push(r)}e.length>0&&oo(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const i of t){const r=i;let a;n?a=n(Ft(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Rn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(r,a||"",s++,r.getLeafColumns().length-1,c)}}},pye={moduleName:"SharedExport",version:ut,beans:[fye]},uB=`\r
249
249
  `,gye=class extends Wpe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,uB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}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,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.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():(qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=uB),this.isFirstLine=!1}},mye=class extends Upe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){qe(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;zpe(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new gye({colModel:t,colNames:n,valueSvc:s,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function vye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function yye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var wye={moduleName:"CsvExport",version:ut,beans:[mye],apiFunctions:{getDataAsCsv:vye,exportDataAsCsv:yye},dependsOn:[pye]},Cye=class extends He{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let i=0;i<e;i++){const r=n+i,a=new sl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Nn(this.params.datasource.getRows)){qe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Ft(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,i)=>{const r=e.rowData?e.rowData[i]:void 0;!s.id&&s.alreadyRendered&&r&&(t[i]=new sl(n),t[i].setRowIndex(s.rowIndex),t[i].setRowTop(s.rowTop),t[i].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},bye=2,Sye=class extends He{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new Cye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Ja(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,i=bye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}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{blockSize:n,overflowSize:o}=this.params,i=(e.id+1)*n+o;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(s&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},i,this.rowCount)}return r||s?[]:n}},Eye=class extends He{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new sl(e);this.rootNode=t,t.level=-1,this.rowHeight=hc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=hc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!If(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;sd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:hc(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Sye(this.cacheParams)),s.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.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function _ye(e){var t;(t=my(e))==null||t.refreshCache()}function Rye(e){var t;(t=my(e))==null||t.purgeCache()}function Dye(e){var t;return(t=my(e))==null?void 0:t.getRowCount()}var Tye=class extends He{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=mse(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Po(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Vi(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Ja(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){Ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},xye={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[Eye,Tye]},Iye={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:_ye,purgeInfiniteCache:Rye,getInfiniteRowCount:Dye},dependsOn:[xye,Gve]},Fye="↑",Pye="↓",Aye={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},kye=class extends yn{constructor(){super(Aye),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ht(o)?o:n,i=t>=0,r=this.eDelta;i?r.textContent=Fye+s:r.textContent=Pye+s,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Fo(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:i,beans:r}=this;if(n===i||(ht(o)?s.textContent=o:ht(n)?s.textContent=n:Fo(s),(c=r.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return i&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Oye=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Mye={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Nye=class extends yn{constructor(){super(Mye),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Oye)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=so({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Nn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ht(e.valueFormatted)?o.textContent=e.valueFormatted:ht(e.value)?o.textContent=n:Fo(o),!0}},Lye=class extends He{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const i=Date.now(),r=i+n,a=i+n+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,i=`${s}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=r;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(i,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Nce(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Vye(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Bye={moduleName:"HighlightChanges",version:ut,beans:[Lye],userComponents:{agAnimateShowChangeCellRenderer:kye,agAnimateSlideCellRenderer:Nye},apiFunctions:{flashCells:Vye}};function $ye(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Hye(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function dB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Gye(e)),e.version=ut,e}function Gye(e){return e.cellSelection=Uye(e,"rangeSelection"),e}function Uye(e,t){if(e&&typeof e=="object")return e[t]}var Wye=class extends He{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Po(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Po(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Po(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=no(e);const o=dB(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=dB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(i,s,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return $pe(Bv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(R,F)=>{const P=!(o!=null&&o.has(R))&&!!(F||t==="api");return h||(h=P),P},p={},g=R=>{let F=p[R];return F||(F={colId:R},p[R]=F,F)},v={},y=f("sort",s);y&&(s==null||s.sortModel.forEach(({colId:R,sort:F},P)=>{const $=g(R);$.sort=F,$.sortIndex=P})),(y||!n)&&(v.sort=null,v.sortIndex=null);const b=f("rowGroup",i);b&&(i==null||i.groupColIds.forEach((R,F)=>{const P=g(R);P.rowGroup=!0,P.rowGroupIndex=F})),(b||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=f("aggregation",r);S&&(r==null||r.aggregationModel.forEach(({colId:R,aggFunc:F})=>{g(R).aggFunc=F})),(S||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((R,F)=>{const P=g(R);P.pivot=!0,P.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const R of(l==null?void 0:l.leftColIds)??[])g(R).pinned="left";for(const R of(l==null?void 0:l.rightColIds)??[])g(R).pinned="right"}(E||!n)&&(v.pinned=null);const D=f("columnVisibility",c);if(D)for(const R of(c==null?void 0:c.hiddenColIds)??[])g(R).hide=!0;(D||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:R,flex:F,width:P}of(u==null?void 0:u.columnSizingModel)??[]){const $=g(R);$.flex=F??null,$.width=P}(x||!n)&&(v.flex=null);const A=d==null?void 0:d.orderedColIds,k=!!(A!=null&&A.length)&&!(o!=null&&o.has("columnOrder")),T=k?A.map(R=>g(R)):Object.values(p);(T.length||h)&&(this.columnStates=T,Bi(this.beans,{state:T,applyOrder:k,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:i,colGroupSvc:r}=s;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Bi(s,{state:a,applyOrder:e},t)}o&&(r==null||r.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Hpe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:i,endRow:r,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ra(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of r.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:i,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),i==null||i.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:i}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const i=t[s];If(i,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),If(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},zye={moduleName:"GridState",version:ut,beans:[Wye],apiFunctions:{getState:$ye,setState:Hye}};function jye(e){return e.rowModel.isLastRowIndexKnown()}function Kye(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function qye(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Yye(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Zye(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Xye(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Jye(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Qye(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function ewe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function twe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var nwe=class extends He{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.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.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(hc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Po(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},dp="paginationPageSizeSelector",owe={tag:"span",cls:"ag-paging-page-size"},swe=class extends yn{constructor(){super(owe),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.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(dp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.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(){Fo(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(dp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),i=this.gos.get(dp)!==!0;qe(94,{pageSizeSet:s,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:dp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(tl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new iE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(dp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},iwe={selector:"AG-PAGE-SIZE-SELECTOR",component:swe},rwe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",awe=class extends SV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(rwe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[iwe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",ci(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",ci(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",ci(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",ci(e?"first":"last",this.beans)),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:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):nle(this.beans,i),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(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{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)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}tle(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Gpe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){moe(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*s+1,a=r+i-1,e&&a>o&&(a=o));const l=r+i-1,c=!e&&n<l,u=this.formatNumber(r);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,y;if(e)v=this.formatNumber(t),y=this.formatNumber(o);else{const b=h("more","more");v=b,y=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=y,this.announceAriaStatus(u,d,y,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${r} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},lwe={selector:"AG-PAGINATION",component:awe},cwe=class extends He{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return lwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.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){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!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.beans.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 ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.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 n=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}n!==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(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,i=n*s;let r=n*(s+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},uwe={moduleName:"Pagination",version:ut,beans:[cwe,nwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:jye,paginationGetPageSize:Kye,paginationGetCurrentPage:qye,paginationGetTotalPages:Yye,paginationGetRowCount:Zye,paginationGoToNextPage:Xye,paginationGoToPreviousPage:Jye,paginationGoToFirstPage:Qye,paginationGoToLastPage:ewe,paginationGoToPage:twe},dependsOn:[vy]};function dwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function hB(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&hB(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function hwe(e,t){return e.rowModel.getRowNode(t)}function fwe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function pwe(e){return e.rowRenderer.getRenderedNodes()}function gwe(e,t,n){e.rowModel.forEachNode(t,n)}function mwe(e){return e.rowRenderer.firstRenderedRow}function vwe(e){return e.rowRenderer.lastRenderedRow}function ywe(e,t){return e.rowModel.getRow(t)}function wwe(e){return e.rowModel.getRowCount()}var Cwe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:dwe,setRowNodeExpanded:hB,getRowNode:hwe,addRenderedRowListener:fwe,getRenderedNodes:pwe,forEachNode:gwe,getFirstDisplayedRowIndex:mwe,getLastDisplayedRowIndex:vwe,getDisplayedRowAtIndex:ywe,getDisplayedRowCount:wwe}},bwe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Ome,getHorizontalPixelRange:Mme,ensureColumnVisible:K2,ensureIndexVisible:q2,ensureNodeVisible:Nme}};function Swe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function Ewe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function _we(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Rwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function Dwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Twe(e){return{rowHeight:hc(e),headerHeight:Jf(e)}}function xwe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(Yf(a))}if((i=t.columns)!=null&&i.length)return n;const o=[],s=n_(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(s&&!o_(r.rowNode,s)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(Yf(c))}}return[...o,...n]}var Iwe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:Swe,refreshCells:Ewe,refreshHeader:_we,isAnimationFrameQueueEmpty:Rwe,flushAllAnimationFrames:Dwe,getSizesForCurrentTheme:Twe,getCellRendererInstances:xwe}};function Fwe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function fB({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Pwe(e,t){var n;t&&typeof t=="object"?fB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Awe=class extends He{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");o=i!=null&&i.length>0&&no(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>ad(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const i=pB(this.beans),r=u=>n.leftCols.some(d=>jf(d,u)),a=u=>n.rightCols.some(d=>jf(d,u)),l=e.colKeys.filter(u=>!la(u)&&!ca(u)&&!r(u)&&!a(u));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let y=-1;const b=Object.fromEntries(c.map(({colId:E,...D})=>[E,D])),S=s??this.gos.get("skipHeaderOnAutoSize"),C=i??S;for(;y!==0;){y=0;const E=[];for(const D of o){if(!D||Ise(D))continue;const x=f.getCol(D);if(!x||v.has(x))continue;const A=p.getPreferredWidthForColumn(x,S);if(A>0){const k=b[x.colId]??{};k.minWidth??(k.minWidth=l),k.maxWidth??(k.maxWidth=a);const T=kwe(x,A,k);x.setActualWidth(T,u),v.add(x),y++}E.push(x)}E.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,i=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||i.add(c),c=c.getParent()}let a;for(const l of i){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Sc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=pB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):qe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...y}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=y;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=aa(i);if(o!=null&&o.onlyScaleUp&&r>e||e===r&&i.every(y=>{if(y.colDef.suppressSizeToFit)return!0;const b=s==null?void 0:s[y.getId()],S=(b==null?void 0:b.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(b==null?void 0:b.maxWidth)??(o==null?void 0:o.defaultMaxWidth),E=y.getActualWidth();return(S==null||E>=S)&&(C==null||E<=C)}))return;const l=[],c=[];for(const v of i){const y=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(b=>jf(v,b)))??!0;v.getColDef().suppressSizeToFit||!y?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Vi(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const y=s==null?void 0:s[v.getId()],b=(y==null?void 0:y.minWidth)??(o==null?void 0:o.defaultMinWidth),S=(y==null?void 0:y.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof b=="number"&&C<b?v.setActualWidth(b,t,!0):typeof S=="number"&&C>S&&v.setActualWidth(S,t,!0)}for(;!d;){d=!0;const v=e-aa(c);if(v<=0)for(const y of l){const b=((g=s==null?void 0:s[y.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??y.minWidth;y.setActualWidth(b,t,!0)}else{const y=v/aa(l);let b=v;for(let S=l.length-1;S>=0;S--){const C=l[S],E=s==null?void 0:s[C.getId()],D=(E==null?void 0:E.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(E==null?void 0:E.maxWidth)??(o==null?void 0:o.defaultMaxWidth),A=C.getMinWidth(),k=C.getMaxWidth(),T=typeof D=="number"&&D>A?D:A,R=typeof x=="number"&&x<k?x:k;let F=Math.round(C.getActualWidth()*y);F<T?(F=T,h(C),d=!1):F>R?(F=R,h(C),d=!1):S===0&&(F=b),C.setActualWidth(F,t,!0),b-=F}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&ad(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:i,defaultMaxWidth:r}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function kwe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function pB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Of(n.eGridBody)-s}var Owe={moduleName:"ColumnAutoSize",version:ut,beans:[Awe],apiFunctions:{sizeColumnsToFit:Fwe,autoSizeColumns:fB,autoSizeAllColumns:Pwe},dependsOn:[BV]},Mwe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function Nwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function Lwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Vwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Bwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function $we(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var Hwe={moduleName:"PinnedRow",version:ut,beans:[Vle],css:[Mwe],apiFunctions:{getPinnedTopRowCount:Nwe,getPinnedBottomRowCount:Lwe,getPinnedTopRow:Vwe,getPinnedBottomRow:Bwe,forEachPinnedRow:$we},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},Gwe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},Uwe=class extends He{constructor(e){super(),this.column=e}buildCache(e){var S;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const y=(C,E)=>{p=C,g=null,v=E},b=C=>{const E=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!E){y(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){y(C,i.getValue(t,C));return}const D=i.getValue(t,C);if(f){const x=Ft(n,{valueA:v,nodeA:p,valueB:D,nodeB:C,column:t,colDef:a});if(!h(x)){y(C,D);return}}else if(d?!d(v,D):v!==D){y(C,D);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new Gwe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(S=s.forEachDisplayedNode)==null||S.call(s,C=>{(!r||r.isRowInPage(C.rowIndex))&&b(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},Wwe=class extends He{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Po(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Po(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new Uwe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,i=this.spanningColumns.get(o);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(s);break;default:r=n.getRow(s)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},zwe=class extends wd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,i,r){this.eWrapper=n,super.setComp(e,t,n,o,s,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||wv(e,t.rowIndex)}setAriaRowSpan(){boe(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(iy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},jwe=class extends gy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new zwe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Kwe=class extends He{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(i.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){i.set(u.firstNode,d),n.delete(u.firstNode);return}r=!0;const h=new jwe(u.firstNode,this.beans,!1,!1,!1);i.set(u.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===o;if(!(!r&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},qwe={moduleName:"CellSpan",version:ut,beans:[Wwe,Kwe]},Ywe=class extends He{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);e_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const i of s)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},Zwe=class extends He{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){e_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new Ywe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},Xwe={moduleName:"CellStyle",version:ut,beans:[Zwe]},Jwe={moduleName:"RowStyle",version:ut,beans:[Vfe]};function Qwe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var eCe=class extends He{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:i,columns:r}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},tCe="ag-column-hover",nCe=class extends He{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(tCe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new eCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},oCe={moduleName:"ColumnHover",version:ut,beans:[nCe],apiFunctions:{isColumnHovered:Qwe}},sCe=class extends He{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,o=!hy.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{hy.has(r)&&t(r,a)},o=(r,a)=>{hy.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:r,asyncListener:a}=o.get(s);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function iCe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function rCe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function aCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function lCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var cCe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:iCe,addGlobalListener:aCe,removeEventListener:rCe,removeGlobalListener:lCe},beans:[sCe]},uCe={moduleName:"Locale",version:ut,beans:[Bpe]},dCe=class extends He{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Po(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Qa(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const y=n==null?void 0:n.getCellSpan(g,d);if(y){if(y.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",r),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",r),(c=t.forEachDisplayedNode)==null||c.call(t,r),i&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=s.getLeftColsForRow(t);break;case"right":i=s.getRightColsForRow(t);break;case null:i=o.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:i}=e,r=this.beans,a=u=>{var b;if((b=this.beans.editSvc)!=null&&b.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=uc(o),g=d+h+f+p,y=t.offsetHeight+g;if(u<5){const S=_o(r),C=!(S!=null&&S.contains(t)),E=y==0;if(C||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,y,i)},l=()=>a(0);l();const c=Za(r,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},hCe={moduleName:"RowAutoHeight",version:ut,beans:[dCe]},fCe={moduleName:"AllCommunity",version:ut,dependsOn:[cB,wye,Iye,oge,fve,pve,gve,mve,vve,yve,wve,hve,ime,rme,ame,sme,cme,ume,zye,Wve,uwe,UV,Cwe,bwe,Iwe,Owe,Jce,Hwe,Ove,Cpe,Xwe,oCe,Jwe,cCe,Epe,Bye,W2,uCe,hCe,Xce,hye,qwe]};let gB=!1;gB||(ise.registerModules([fCe,cB]),gB=!0);class pCe{constructor(t,n){Xn(this,"gridApi",null);Xn(this,"container");Xn(this,"config");Xn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Mpe(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const gCe=YV.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),mCe=it({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(null);Xb(i,()=>{var v;console.log("Grid container lost focus, clearing focused cell");const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=B(null),a=Z(()=>({width:"100%",height:o.height||"500px"})),l=Z(()=>({...o,theme:gCe}));function c(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};r.value=new pCe(i.value,g),r.value.init(),u()}function u(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var y,b;if(!g)return;(y=r.value)==null||y.updateColumnDefs(g);const v=g.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width}:null).filter(S=>S!==null);(b=r.value)==null||b.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return Je(()=>o.columnDefs,(g,v)=>{const y=g==null?void 0:g.filter(S=>!S.hide).map(S=>S.field).join(","),b=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(",");y!==b&&d(g)},{deep:!0}),lo(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Xt(()=>{c()}),lo(()=>{h()}),(g,v)=>(K(),ae("div",{ref_key:"gridContainerRef",ref:i,style:cn(a.value),class:J(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function _d(e){return qM(e)}const vCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:_d(oc),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var o,s,i;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((i=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var o,s,i;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((i=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>xf.fromType(n))],Ey={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},yCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},wCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Ey.WIDTH,minWidth:Ey.WIDTH,maxWidth:Ey.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Ey.HEADER_CLASS,headerComponent:yv(jX),suppressMovable:!0}),CCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},bCe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=wh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const u=await o(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=B([]),a=wCe(),l=async u=>{const d=await i(),h=new Map;d==null||d.forEach(F=>{F.width&&h.set(F.field,F.width)});const f=vCe(),p=xf.fromType(CCe),v=((u==null?void 0:u.map(F=>{var P;return{headerName:F.name,field:`metric_${F.id}`,editable:((P=F==null?void 0:F.auth_permission)==null?void 0:P.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:yv(oc),headerComponentParams:$=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${F.id}`)}}))||[]).map(F=>xf.fromType(F)),y=[a,...f,...v,yCe,p],b=y.filter(F=>F.pinned==="left"),S=y.filter(F=>F.pinned==="right"||F.field==="blank"),C=y.filter(F=>!F.pinned&&F.field!=="blank");if(!d||d.length===0){r.value=y;return}const E=new Map(d.map(F=>[F.field,F])),D=new Map(C.map(F=>[F.field,F])),x=[];for(const F of d)if(F.field&&D.has(F.field)){const P=D.get(F.field);x.push({...P,hide:F.hide,width:F.width}),D.delete(F.field)}const A=Array.from(D.values()),k=[...x,...A],T=b.map(F=>{const P=E.get(F.field);return P!=null&&P.width?{...F,width:P.width}:F}),R=S.map(F=>{const P=E.get(F.field);return P!=null&&P.width?{...F,width:P.width}:F});r.value=[...T,...k,...R]};Je(e,u=>l(u),{immediate:!0});const c=Di((u,d)=>{var y,b;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(y=n==null?void 0:n.value)==null?void 0:y.getColumnDefs(),f=(b=n==null?void 0:n.value)==null?void 0:b.getColumnState().reduce((S,C)=>(S[C.colId]=Number(C.width),S),{}),p=new Map;Object.entries(f||{}).forEach(([S,C])=>{p.set(S,C)}),r.value=h||r.value;const g=h==null?void 0:h.filter(S=>!S.pinned&&S.field!=="blank"),v=(g==null?void 0:g.map(S=>({field:S.field,hide:S.hide,width:p.get(S.field)||S.width,pinned:S.pinned})))||[];d&&s(t,JSON.stringify(v))},ir);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:c}},SCe=()=>{const e=Cn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},ECe=e=>{var F,P,$;const{showMessage:t,showErrorNetMessage:n}=cf(),o=So(),s={domainApi:SCe(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=($=(P=(F=o==null?void 0:o.appContext)==null?void 0:F.config)==null?void 0:P.globalProperties)==null?void 0:$.apiConfig;if(!i||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Ak(i,s);r.on("call-api",te=>{te.success?t(te.apiCode,"success"):n(te)});const a=Cs({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=D7(),v=te=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:te}),y=50,b=async(te,U,Y)=>{if(!te.length)return[];const X=N4(te,U);return(await Promise.all(X.map(Y))).flat()},S=async te=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:te})).data.map(Y=>[Y==null?void 0:Y.id,Y.permission])}catch(U){return console.error("Failed to fetch item permissions chunk:",U),[]}},C=async(te,U)=>{try{const Y=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:te,per_page:te.length*U.length,metric_ids:U}),X=Y.data.map(Re=>{const M=new Map(Re.item_metrics.map(L=>[L.metric_id,{value:L.value,auth_permission:L==null?void 0:L.auth_permission}])),j=Object.fromEntries(U.map(L=>[L,M.get(L)??null]));return[Re==null?void 0:Re.id,j]}),ne=new Set(Y.data.map(Re=>Re==null?void 0:Re.id));for(const Re of te)if(!ne.has(Re)){const M=Object.fromEntries(U.map(j=>[j,{value:null,auth_permission:void 0}]));X.push([Re,M])}return X}catch(Y){return console.error("Failed to fetch a chunk of metric values:",Y),te.map(ne=>[ne,Object.fromEntries(U.map(Re=>[Re,void 0]))])}},E=async te=>{try{const U=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:te,per_page:te.length}),Y=U.data.flatMap(X=>X.assignees);return g(Y),U.data.map(X=>[X==null?void 0:X.id,X==null?void 0:X.assignees])}catch(U){return console.error("Failed to fetch a chunk of assigned users:",U),[]}},D=async te=>{if(!te.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const U=await b(te,y,S);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch item permissions:",U),{}}},x=async(te,U)=>!te.length||!U.length?{}:(p=p.then(async()=>{try{const ne=[];let Re=0;for(let j=0;j<U.length;j+=5){Re++;const L=U.slice(j,j+5),se=[];for(let De=0;De<L.length;De++){const Ie=L[De],Ke=await b(te,y,z=>C(z,[Ie]));se.push(Ke),await new Promise(z=>setTimeout(z,500))}ne.push(...se);const ce=j+5>=U.length}const M={};for(const j of ne.flat()){const[L,se]=j;M[L]||(M[L]={}),Object.assign(M[L],se)}return M}catch(Y){return console.error("Failed to fetch metric values:",Y),{}}}),p),A=async te=>{if(!te.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const U=await b(te,y,E);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch assigned users:",U),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async te=>{const{cursor:U,offset:Y,size:X,searchQuery:ne}=te;let Re=[];c.value=!0,u.value=null;try{const M=await r.getAllItem_cursor({...te,cursor:U||void 0,offset:Y||void 0,pageSize:X||f.value,...v(ne),sortBy:te.sort_by});return l.value=M.data,d.value=M.meta,h.value=M.meta.current_page||0,Re=M.data.map(j=>j==null?void 0:j.id),M}catch(M){throw u.value=M,console.error("Failed to fetch items (cursor):",M),M}finally{const M=async()=>{try{const[j,L]=await Promise.all([A(Re),D(Re)]);e.value.updateItemData({assignees:j,permission:L},Re);const se=await x(Re,e.value.metricIds);e.value.setMetricValues(se,new Set(Re),e.value.metricIds)}catch(j){console.error("Post-fetch processing failed:",j)}};c.value=!1,setTimeout(M)}},getAssignableStatus:async te=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:te})}catch(U){throw console.error("Failed to fetch assignable status:",U),U}},getMetricList:async te=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:te})}catch(U){throw console.error("Failed to fetch metric list:",U),U}},getMetricValues:x,getAssignedUsers:A}};function _Ce(e){return{updateRowData:(o,s)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(i.push(u),o.assignees){const h=h7((o.assignees[c]||[]).map(RF));u.data.assignees=h,r.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(o,s,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(s).map(c=>[c,new Map(i.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(c=>`metric_${c}`),force:!0})}}}function RCe(e,t,n,o,s){let i=!0;return{async getRows(r){try{o(!0),i&&(s(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),o(!1),s(!1)}}}}function DCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:i}=e,r=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(r.value=!1,s.value=v,!v)return null;const{addEventListener:y,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=RCe(i,e.perPage,()=>o.value,C=>{r.value=C},C=>{a.value=C});return b==null||b("datasource",S),y==null||y("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var y,b;if((y=s.value)==null||y.hideOverlay(),v!==void 0&&(o.value=v),(b=s.value)==null||b.deselectAll(),t.value=[],r.value=!0,!s.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=Di(v=>{d(v)},ir),p=()=>{s.value},g=B(!1);return{isLoading:r,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const TCe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},xCe=e=>{var t;return(t=Object.entries(TCe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},ICe={key:1},FCe=St(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=B(null),s=e,i=()=>{o.value&&o.value.show()},r=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=Qn(!1,{}),u=B(!1),d=async()=>{u.value=!0;const x=s.workspaceId,A=s.entityId;if(!x||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(x,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),b()},p=async x=>{var T,R,F;const A=new FormData,k=((T=x.name.split(".").pop())==null?void 0:T.toString())||"";if(A.append("file",x),A.append("format",k),A.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,A),g()}catch(P){throw console.error("Error uploading file:",P),v(((F=(R=P.response)==null?void 0:R.data)==null?void 0:F.message)||"An unknown error occurred during file upload."),P}},g=()=>{a.value="success"},v=x=>{r.value=x,a.value="error"},y=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var x;D(),(x=o.value)==null||x.hide()};t({close:b,open:i});const S=Z(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=Z(()=>l.value.file?!1:(console.error("No file selected"),!0)),E=B(null),D=()=>{var x;(x=E.value)==null||x.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(x,A)=>(K(),ze(H($k),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:D},Yd({default:fe(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),ze(UM,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(K(),ae("div",ICe,[pe("div",{class:J(x.$style["step-section"])},[pe("span",{class:J(x.$style["step-title"])},"Step 1: Download current data",2),pe("span",{class:J(x.$style["step-description"])},[...A[1]||(A[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),pe("br",null,null,-1),pe("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ue(H(ct),{class:J(x.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:fe(()=>[ue(H(rt),{src:"Download"})]),default:fe(()=>[A[2]||(A[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),pe("div",{class:J(x.$style["step-section"])},[pe("span",{class:J(x.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(DO),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:E},null,8,["modelValue"])],2),pe("div",{class:J(x.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(WM)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:fe(()=>[ue(H(ct),{style:{flex:"1"},variant:"secondary",onClick:b},{default:fe(()=>[...A[3]||(A[3]=[nt(" Cancel ",-1)])]),_:1}),ue(H(ct),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:y},{default:fe(()=>[...A[4]||(A[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:fe(()=>[ue(H(ct),{style:{flex:"1"},variant:"primary",onClick:f},{default:fe(()=>[...A[5]||(A[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:fe(()=>[ue(H(ct),{style:{flex:"1"},variant:"primary",onClick:D},{default:fe(()=>[...A[6]||(A[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),PCe={key:0},ACe=St(it({__name:"OpenInTake",props:{entityId:{},workspaceId:{},loading:{type:Boolean}},setup(e,{expose:t}){const n=Yt,o=e,{triggerRef:s,popupRef:i,hide:r,isVisible:a}=eo({placement:"bottom-end",offset:[0,0]}),l=Cn.getInstance().getItem("BASE_REVIEW_URL"),c=Cn.getInstance().getItem("BASE_URL"),u=()=>{const S=Lo({type:"review_take",config:{reviewDomain:l,ws_code:o.workspaceId,take_id:o.entityId}});window.open(S.url,"_blank")},d=()=>{const S=Lo({type:"update",config:{baseDomain:c,ws_code:o.workspaceId,entity_id:o.entityId}});window.open(S.url,"_blank")},h=()=>{const S=Lo({type:"woohoo",config:{baseDomain:c,ws_code:o.workspaceId,woohoo_id:o.entityId}});window.open(S.url,"_blank")},f=Rm(),{userPermissions:p}=Ho(f),g=Z(()=>p.value.includes(Dm)),v=Z(()=>p.value.includes(MA)),y=Z(()=>p.value.includes(OA)),b=as;return t({triggerRef:s,popupRef:i,hide:r}),Je(a,S=>{S&&setTimeout(()=>{var C;(C=i.value)==null||C.focus()},0)}),(S,C)=>{const E=bs("focusable");return g.value||v.value||y.value?(K(),ae("div",PCe,[pe("div",{ref_key:"triggerRef",ref:s},[Ue((K(),ze(H(ct),{variant:["secondary","icon"],width:"32px",onEscape:H(r)},{default:fe(()=>[ue(H(rt),{src:"ArrowUpRightFromSquare"})]),_:1},8,["onEscape"])),[[H(b),{isLoading:e.loading,fullwidth:!0}],[H(n),"Open in"],[E,"6"]])],512),Ue((K(),ae("div",{ref_key:"popupRef",ref:i,style:{width:"200px",borderRadius:"7px",overflow:"hidden"},class:J(S.$style["dropdown-list"]),tabindex:"0"},[g.value?Ue((K(),ze(H(ei),{key:0,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(u,["stop"])},{prefix:fe(()=>[pe("div",{class:J(S.$style.icon)},[ue(H(rt),{src:"PenRuler",color:"#A6A6A6"})],2)]),label:fe(()=>[...C[0]||(C[0]=[nt("Review",-1)])]),_:1})),[[E,"6.1"]]):Ze("",!0),v.value?Ue((K(),ze(H(ei),{key:1,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(d,["stop"])},{prefix:fe(()=>[pe("div",{class:J(S.$style.icon)},[ue(H(rt),{src:"UserCheck",color:"#A6A6A6"})],2)]),label:fe(()=>[...C[1]||(C[1]=[nt("Update",-1)])]),_:1})),[[E,"6.2"]]):Ze("",!0),y.value?Ue((K(),ze(H(ei),{key:2,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(h,["stop"])},{prefix:fe(()=>[pe("div",{class:J(S.$style.icon)},[ue(H(rt),{src:"ChartPie",color:"#A6A6A6"})],2)]),label:fe(()=>[...C[2]||(C[2]=[nt("Woohoo Details",-1)])]),_:1})),[[E,"6.3"]]):Ze("",!0)],2)),[[E,"6.0"]])])):Ze("",!0)}}}),[["__cssModules",{$style:{icon:"_icon_1tz8l_1","dropdown-list":"_dropdown-list_1tz8l_9"}}]]),kCe={style:{cursor:"help"}},OCe=St(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=as,o=Rm(),{setUserPermissions:s,setEntityPermissions:i}=o,{entityPermissions:r}=Ho(o),a=Yt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=Z(()=>{var je;const Ae=((je=r.value)==null?void 0:je.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;xf.initialize({wrapVueCellRenderer:yv,wrapVueCellEditor:qM});const f=Yh(),{switchInstanceFunc:p}=Ho(f);Xt(()=>{const Ae=So();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const je=new BroadcastChannel("focusable_channel");_t(()=>{setTimeout(()=>{je.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),y=$m(),{rowCount:b}=Ho(y),S=B(!1),C=B(""),E=B(),D=$A(),{metricList:x}=Ho(D),A=B(""),k=B(!1),T=B(new Set),R=B(new Map),{apiServices:F}=Qn(!1,h),{columnDefs:P,checkboxColumn:$,saveColumnConfig:te}=bCe(x,h.entityId,g),U=B();Je(()=>P,()=>{var Ae;(Ae=U.value)==null||Ae.updateColumnDefs(P.value)},{deep:!0});const Y=(Ae,je)=>{te(Ae,je)},{updateRowData:X,setMetricValues:ne}=_Ce(g),Re=Z(()=>({isSearching:C.value.length>0,isFiltering:!(Object.keys(we.value||{}).length==1&&Object.keys(we.value)[0]=="preflight_status")&&Object.keys(we.value||{}).length>0})),M=Z(sm),j=Z(()=>P.value.filter(Ae=>{var je;return((je=Ae.field)==null?void 0:je.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var je;return((je=Ae.field)==null?void 0:je.replace("metric_",""))||""}));qi("timezone",M);const L=Z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:j.value,updateItemData:X,setMetricValues:ne})),{fetchItems:se,getMetricList:ce,cusorMap:De,getMetricValues:Ie}=ECe(L),Ke=Z(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),z=Z(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),de=(Ae,je)=>{var Qt,Gt,ko;b.value.total=Ae.meta.total??0,(Qt=Ae.meta.next)!=null&&Qt.cursor&&(De[je+1]=Ae.meta.next.cursor),A.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?(Gt=g.value)==null||Gt.showNoRowsOverlay():(ko=g.value)==null||ko.hideOverlay()},ie=RO(),Fe=B(null),{sortingAPIConfiguration:G,isSortingRunning:Q}=Ho(ie),we=B({preflight_status:"1"}),ke=Z(()=>({...we.value,search:C.value}));qi("filterParams",ke);const Pe=B([]),O=async({page:Ae,pageSize:je,filterText:Qt})=>{var Vs;(Vs=g.value)==null||Vs.hideOverlay();const Gt=De[Ae],ko=!Gt&&Ae>1?(Ae-1)*je:void 0,va=G.value;va.length>0&&(Q.value=!0);try{const ya={cursor:Gt,size:je,searchQuery:Qt,offset:ko,sort_by:va,...we.value},ns=await se(ya);if(!ns)return{rows:[],total:0};const hp=(jn=>{const Ar=jn.data.map(ys=>TF(ys,M.value));return Ar.forEach(ys=>{T.value.add(String(ys.id)),R.value.set(String(ys.id),{})}),Ar})(ns);return de(ns,Ae),{rows:hp,total:b.value.total}}catch(ya){return console.error("Failed to fetch items:",ya),{rows:[],total:0}}finally{Q.value=!1}},{isLoading:V,toggleSidebar:ee,onGridReady:ye,handleUnSelect:Me,handleSelectAll:Ye,onSearch:ge,firstLoad:le}=DCe({selectRowData:B([]),isSidebarOpen:S,quickFilterText:C,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:O}),Ce=B([]),Qe=()=>{var Ae;Ce.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},at=Cs({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),It=Z(()=>({blockLoadDebounceMillis:1e3,columnDefs:P.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:nn,noRowsOverlayComponent:yv(FQ),noRowsOverlayComponentParams:()=>Re.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const je=["row-highlight"];return Ae.data.id||je.push("row-inactive"),Ae.data.isDeleted&&je.push("row-deleted"),Ae.data.disabled&&je.push("row-deleted"),Ae.data.isArchived&&je.push("row-archived"),je},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:F.value,sorting:Q.value},onCellEditRequest:Ae=>{console.log("Cell edit requested:",Ae)},onCellKeyDown:Ae=>{var je,Qt,Gt;if(console.log("Cell key down:",Ae),Ae.data.isDeleted)return!1;if(((je=Ae==null?void 0:Ae.event)==null?void 0:je.key)==="Enter"){const{api:ko,node:va,column:Vs}=Ae,ya=ko.getCellRendererInstances({rowNodes:[va],columns:[Vs]});if(ya.length>0){const ns=ya[0];ns&&typeof((Qt=ns.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Gt=ns.componsenExposed)==null||Gt.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var Gt;if((Gt=Ae.data)!=null&&Gt.isDeleted)return!0;const je=Ae.event.key,Qt=Ae.editing;return Qt&&je==="Tab"?!0:Qt&&je==="Enter"?!1:je==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):je==="ArrowUp"||je==="ArrowDown"||je==="ArrowLeft"||je==="ArrowRight"||je==="Tab"||je==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const je=Ae.api.getFirstDisplayedRowIndex(),Qt=Ae.api.getLastDisplayedRowIndex();at.rowsDisplay.fromIndex=je,at.rowsDisplay.toIndex=Qt,at.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Gt=>Gt.getColId())},onViewportChanged:Ae=>{at.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(je=>je.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),console.log("Cell editing started:",Ae),Ae.colDef.field=="options"){const je=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});je.length>0&&je[0].focusUi()}},tabToNextCell:Ae=>{let je=Ae.nextCellPosition;if(je&&je.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=Ae.api.getAllDisplayedColumns(),Gt=Qt.indexOf(je.column),ko=Ae.backwards?-1:1,va=Qt[Gt+ko];if(va)return{rowIndex:je.rowIndex,column:va,rowPinned:je.rowPinned}}return je}}));function nn(){if(!g.value)return;let Ae=0;g.value.forEachNode(je=>{je.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}Je(()=>G,()=>{g.value&&(A.value="",T.value.clear(),g.value.deselectAll(),Object.keys(De).forEach(Ae=>delete De[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Nt=B(),on=B(),ln=()=>{var Ae;(Ae=on.value)==null||Ae.open()},Le=()=>{var Ae;(Ae=Nt.value)==null||Ae.open()},Ge=async()=>{le.value=!0,g.value&&(A.value="",T.value.clear(),Object.keys(De).forEach(Ae=>delete De[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},bt=Z(()=>Cn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),kt=B(),Ut=Z(()=>{var Ae;return(Ae=xCe(bt.value))==null?void 0:Ae.map(je=>`<div>• ${je}</div>`).join(`
250
- `)});function tt(Ae){var je;Ae==="new_scene"?(je=kt.value)==null||je.show():Ae==="import_scenes"?Le():Ae==="overwrite_scenes"&&ln()}const Do=Ae=>{v.value=Ae.api.getSelectedRows().map(je=>je.id)},Hi=Ae=>{const je=ye(Ae);return je&&(je.addEventListener("modelUpdated",nn),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",Qe),je.addEventListener("columnMoved",Gt=>Y(Gt,!0)),je.addEventListener("columnResized",Gt=>Y(Gt,!0)),je.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),je},Ir=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Xt(()=>{_t(()=>{Ir()}),window.addEventListener("resize",Ir);function Ae(){requestAnimationFrame(Ae)}Ae()}),lo(()=>{window.removeEventListener("resize",Ir)});const hi=async({code:Ae,name:je})=>{await ge(Ae),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(je)},300)},ma=Ae=>{if(!g.value)return;const je=g.value.getRowNode(Ae);je?(g.value.ensureIndexVisible(Number(je.rowIndex),"middle"),g.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ae=>Ae.metric_type.code==="number"?"number":"default",Fr=async()=>{if(h.entityId)try{const Ae=await ce(h.entityId);x.value=Ae.data.map(je=>({...je,sortType:dl(je)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),x.value=[]}},Pr=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},fi=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Gi=lv(),{setUser:Rd}=Gi,An=async()=>{if(F.value)try{const Ae=await F.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},po=async()=>{var Ae;if(F.value)try{const je=await F.value.getWorkspaces(h.workspaceId),Qt=(Ae=je.data[0])==null?void 0:Ae.ws_user_role_id;return Qt&&Gi.setUserRoleId(Qt),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,je])=>{!Ae||!je||(An(),po(),Fr(),Pr(),fi())},{immediate:!0,deep:!0}),Je(j,(Ae,je)=>{const Qt=Ae.filter(Gt=>!(je!=null&&je.includes(Gt)));Qt.length>0&&Ie(Array.from(T.value),Qt).then(Gt=>{ne(Gt,T.value,Qt)})},{immediate:!0,deep:!0}),Je(A,(Ae,je)=>{k.value=!!(je&&Ae&&je!==Ae)}),t({refreshTable:Ge});const b_=Ae=>{we.value=Ae,Ge()},Dd=Ae=>{Pe.value=Ae,Ge()},Td=Ae=>{P.value=Ae||[],Y({},!0)},xd=Z(()=>{var Gt;const Ae=Cn.getInstance().getItem("ws.terminology"),je=Ae?JSON.parse(Ae):null;return`New ${((Gt=je==null?void 0:je.find(ko=>ko.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ae,je)=>{const Qt=bs("focusable");return K(),ze(H(GX),{"is-sidebar-open":S.value,onCloseSidebar:H(ee),onSidebarClear:H(ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(ee)},{"header-left":fe(()=>{var Gt;return[((Gt=H(r))==null?void 0:Gt.has_create_item_permission)==1?(K(),ze(H(dS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:je[1]||(je[1]=ko=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:fe(()=>[Ue(ue(H(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=ko=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),pe("div",{class:J(Ae.$style["beta-tag"])},"Beta",2),Ue((K(),ae("span",kCe,[nt(yt(bt.value),1)])),[[H(a),Ut.value||""]])]}),"header-actions":fe(()=>[ue(H(hee),{"onUpdate:assignees":Dd,onApplyFilter:b_,loading:H(le),entityId:h.entityId},null,8,["loading","entityId"]),Ue(ue(H(Qb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":je[2]||(je[2]=Gt=>C.value=Gt),onSearch:H(ge),class:J(Ae.$style.itemSearchBox),onClear:je[3]||(je[3]=Gt=>H(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(le),fullwidth:!0}]]),Ue((K(),ze(H(NA),{status:H(V)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:fe(()=>[Ue((K(),ze(H(ct),{variant:["secondary","icon"],disabled:H(V),onClick:Ge},{default:fe(()=>[ue(H(rt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(le),fullwidth:!0}]]),ue(ACe,{loading:H(le),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),Ue(ue(H(hQ),{"model-value":H(P),onChange:je[4]||(je[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":H($),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(le),fullwidth:!0}]])]),grid:fe(({availableHeight:Gt})=>[ue(H(mCe),qt({id:"item_table_main",ref_key:"agGrid",ref:Fe},It.value,{height:Gt+"px",isSorting:H(Q),onOnGridReady:Hi,onSelectionChanged:Do}),null,16,["height","isSorting"])]),footer:fe(()=>[pe("div",{class:J(Ae.$style.tableFooter),id:"table_footer"},[pe("span",null,[je[5]||(je[5]=nt(" Showing ",-1)),pe("b",null,yt(H(b).loaded)+" of "+yt(H(b).total),1)])],2)]),"new-row":fe(()=>[ue(H(UQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:hi,onFocusOnId:ma},null,512)]),"bulk-update-actions":fe(()=>[Ue(ue(H(OX),{selectRowData:Ce.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(Me),onSelectAll:H(Ye),"take-name":z.value,"selected-all":Ke.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:Qe,loading:H(V)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[_i,!S.value&&v.value.length>0]])]),snackbar:fe(()=>[ue(H(SJ))]),popup:fe(()=>[ue(Yne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ue(FCe,{ref_key:"popupOverwriteScenesRef",ref:on,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.67",MCe={key:0},NCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=Cs({id:"",workspaceId:"",apiConfig:{}}),o=cf(),{showMessage:s,showErrorNetMessage:i}=o,r=["basicInfor"],a=h=>{h.success?s(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=B(null),c=()=>{const h=Cn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Zp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=So(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||Cn.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ak(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),lo(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return qi("workspaceId",d),qi("entityId",u),(h,f)=>(K(),ae("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(K(),ae("span",MCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),ze(H(OCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=E1(NCe),o=Xq();n.use(o);const s=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${mB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Ji);const r=await jne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),kn.default=C_,kn.initDashboard=C_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
250
+ `)});function tt(Ae){var je;Ae==="new_scene"?(je=kt.value)==null||je.show():Ae==="import_scenes"?Le():Ae==="overwrite_scenes"&&ln()}const Do=Ae=>{v.value=Ae.api.getSelectedRows().map(je=>je.id)},Hi=Ae=>{const je=ye(Ae);return je&&(je.addEventListener("modelUpdated",nn),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",Qe),je.addEventListener("columnMoved",Gt=>Y(Gt,!0)),je.addEventListener("columnResized",Gt=>Y(Gt,!0)),je.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),je},Ir=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Xt(()=>{_t(()=>{Ir()}),window.addEventListener("resize",Ir);function Ae(){requestAnimationFrame(Ae)}Ae()}),lo(()=>{window.removeEventListener("resize",Ir)});const hi=async({code:Ae,name:je})=>{await ge(Ae),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(je)},300)},ma=Ae=>{if(!g.value)return;const je=g.value.getRowNode(Ae);je?(g.value.ensureIndexVisible(Number(je.rowIndex),"middle"),g.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ae=>Ae.metric_type.code==="number"?"number":"default",Fr=async()=>{if(h.entityId)try{const Ae=await ce(h.entityId);x.value=Ae.data.map(je=>({...je,sortType:dl(je)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),x.value=[]}},Pr=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},fi=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Gi=lv(),{setUser:Rd}=Gi,An=async()=>{if(F.value)try{const Ae=await F.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},po=async()=>{var Ae;if(F.value)try{const je=await F.value.getWorkspaces(h.workspaceId),Qt=(Ae=je.data[0])==null?void 0:Ae.ws_user_role_id;return Qt&&Gi.setUserRoleId(Qt),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,je])=>{!Ae||!je||(An(),po(),Fr(),Pr(),fi())},{immediate:!0,deep:!0}),Je(j,(Ae,je)=>{const Qt=Ae.filter(Gt=>!(je!=null&&je.includes(Gt)));Qt.length>0&&Ie(Array.from(T.value),Qt).then(Gt=>{ne(Gt,T.value,Qt)})},{immediate:!0,deep:!0}),Je(A,(Ae,je)=>{k.value=!!(je&&Ae&&je!==Ae)}),t({refreshTable:Ge});const b_=Ae=>{we.value=Ae,Ge()},Dd=Ae=>{Pe.value=Ae,Ge()},Td=Ae=>{P.value=Ae||[],Y({},!0)},xd=Z(()=>{var Gt;const Ae=Cn.getInstance().getItem("ws.terminology"),je=Ae?JSON.parse(Ae):null;return`New ${((Gt=je==null?void 0:je.find(ko=>ko.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ae,je)=>{const Qt=bs("focusable");return K(),ze(H(GX),{"is-sidebar-open":S.value,onCloseSidebar:H(ee),onSidebarClear:H(ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(ee)},{"header-left":fe(()=>{var Gt;return[((Gt=H(r))==null?void 0:Gt.has_create_item_permission)==1?(K(),ze(H(dS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:je[1]||(je[1]=ko=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:fe(()=>[Ue(ue(H(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=ko=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),pe("div",{class:J(Ae.$style["beta-tag"])},"Beta",2),Ue((K(),ae("span",kCe,[nt(yt(bt.value),1)])),[[H(a),Ut.value||""]])]}),"header-actions":fe(()=>[ue(H(hee),{"onUpdate:assignees":Dd,onApplyFilter:b_,loading:H(le),entityId:h.entityId},null,8,["loading","entityId"]),Ue(ue(H(Qb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":je[2]||(je[2]=Gt=>C.value=Gt),onSearch:H(ge),class:J(Ae.$style.itemSearchBox),onClear:je[3]||(je[3]=Gt=>H(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(le),fullwidth:!0}]]),Ue((K(),ze(H(NA),{status:H(V)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:fe(()=>[Ue((K(),ze(H(ct),{variant:["secondary","icon"],disabled:H(V),onClick:Ge},{default:fe(()=>[ue(H(rt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(le),fullwidth:!0}]]),ue(ACe,{loading:H(le),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),Ue(ue(H(hQ),{"model-value":H(P),onChange:je[4]||(je[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":H($),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(le),fullwidth:!0}]])]),grid:fe(({availableHeight:Gt})=>[ue(H(mCe),qt({id:"item_table_main",ref_key:"agGrid",ref:Fe},It.value,{height:Gt+"px",isSorting:H(Q),onOnGridReady:Hi,onSelectionChanged:Do}),null,16,["height","isSorting"])]),footer:fe(()=>[pe("div",{class:J(Ae.$style.tableFooter),id:"table_footer"},[pe("span",null,[je[5]||(je[5]=nt(" Showing ",-1)),pe("b",null,yt(H(b).loaded)+" of "+yt(H(b).total),1)])],2)]),"new-row":fe(()=>[ue(H(UQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:hi,onFocusOnId:ma},null,512)]),"bulk-update-actions":fe(()=>[Ue(ue(H(OX),{selectRowData:Ce.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(Me),onSelectAll:H(Ye),"take-name":z.value,"selected-all":Ke.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:Qe,loading:H(V)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[_i,!S.value&&v.value.length>0]])]),snackbar:fe(()=>[ue(H(SJ))]),popup:fe(()=>[ue(Yne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ue(FCe,{ref_key:"popupOverwriteScenesRef",ref:on,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.68",MCe={key:0},NCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=Cs({id:"",workspaceId:"",apiConfig:{}}),o=cf(),{showMessage:s,showErrorNetMessage:i}=o,r=["basicInfor"],a=h=>{h.success?s(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=B(null),c=()=>{const h=Cn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Zp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=So(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||Cn.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ak(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),lo(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return qi("workspaceId",d),qi("entityId",u),(h,f)=>(K(),ae("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(K(),ae("span",MCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),ze(H(OCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=E1(NCe),o=Xq();n.use(o);const s=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${mB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Ji);const r=await jne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),kn.default=C_,kn.initDashboard=C_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});