@mongodb-js/compass-web 1.1.1 → 1.2.0

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.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 972.6d0cfa0d39c1080e6e7f.mjs.LICENSE.txt */
2
+ export const __webpack_esm_id__=972;export const __webpack_esm_ids__=[972];export const __webpack_esm_modules__={2511:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(86834);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},5652:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(34633))},7386:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(91705);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},8069:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(45928);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},8633:(e,t,s)=>{var i=s(15088).process;Object.defineProperty(t,"__esModule",{value:!0}),t.signals=void 0,t.signals=[],t.signals.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==i.platform&&t.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===i.platform&&t.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")},11088:(e,t,s)=>{s.d(t,{Ay:()=>o,J0:()=>n});var i=s(8069);const o=i.default,n=(i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString)},13068:(e,t,s)=>{var i=s(15088).process;e.exports=async function(e,t,s,n){s instanceof Function&&(n=s,s={});const d=async function(e,t,s={}){let n,d;"string"==typeof s&&(s={encoding:s});const u=r(p((()=>d))),f=a.resolve(e);try{await function(e){return new Promise((t=>{c[e]||(c[e]=[]),c[e].push(t),1===c[e].length&&t()}))}(f);const r=await l(o.realpath)(e).catch((()=>e));if(d=h(r),!s.mode||!s.chown){const e=await l(o.stat)(r).catch((()=>{}));e&&(null==s.mode&&(s.mode=e.mode),null==s.chown&&i.getuid&&(s.chown={uid:e.uid,gid:e.gid}))}n=await l(o.open)(d,"w",s.mode),s.tmpfileCreated&&await s.tmpfileCreated(d),ArrayBuffer.isView(t)?await l(o.write)(n,t,0,t.length,0):null!=t&&await l(o.write)(n,String(t),0,String(s.encoding||"utf8")),!1!==s.fsync&&await l(o.fsync)(n),await l(o.close)(n),n=null,s.chown&&await l(o.chown)(d,s.chown.uid,s.chown.gid).catch((e=>{if(!g(e))throw e})),s.mode&&await l(o.chmod)(d,s.mode).catch((e=>{if(!g(e))throw e})),await l(o.rename)(d,r)}finally{n&&await l(o.close)(n).catch((()=>{})),u(),await l(o.unlink)(d).catch((()=>{})),c[f].shift(),c[f].length>0?c[f][0]():delete c[f]}}(e,t,s);if(n)try{return n(await d)}catch(e){return n(e)}return d},e.exports.sync=function(e,t,s){"string"==typeof s?s={encoding:s}:s||(s={});try{e=o.realpathSync(e)}catch(e){}const n=h(e);if(!s.mode||!s.chown)try{const t=o.statSync(e);(s=Object.assign({},s)).mode||(s.mode=t.mode),!s.chown&&i.getuid&&(s.chown={uid:t.uid,gid:t.gid})}catch(e){}let a;const l=p(n),c=r(l);let d=!0;try{if(a=o.openSync(n,"w",s.mode||438),s.tmpfileCreated&&s.tmpfileCreated(n),ArrayBuffer.isView(t)?o.writeSync(a,t,0,t.length,0):null!=t&&o.writeSync(a,String(t),0,String(s.encoding||"utf8")),!1!==s.fsync&&o.fsyncSync(a),o.closeSync(a),a=null,s.chown)try{o.chownSync(n,s.chown.uid,s.chown.gid)}catch(e){if(!g(e))throw e}if(s.mode)try{o.chmodSync(n,s.mode)}catch(e){if(!g(e))throw e}o.renameSync(n,e),d=!1}finally{if(a)try{o.closeSync(a)}catch(e){}c(),d&&l()}},e.exports._getTmpname=h,e.exports._cleanupOnExit=p;const o=s(4308),n=s(53021),{onExit:r}=s(22784),a=s(78773),{promisify:l}=s(13390),c={},d=function(){try{return s(86983).threadId}catch(e){return 0}}();let u=0;function h(e){return e+"."+n("/index.js").hash(String(i.pid)).hash(String(d)).hash(String(++u)).result()}function p(e){return()=>{try{o.unlinkSync("function"==typeof e?e():e)}catch{}}}function g(e){return"ENOSYS"===e.code||!(i.getuid&&0===i.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}},13310:(e,t,s)=>{s.d(t,{Ay:()=>o,J0:()=>a,QZ:()=>r,Y6:()=>n});var i=s(23409);const o=i.default,n=i.CommaAndColonSeparatedRecord,r=i.ConnectionString,a=i.redactConnectionString},15644:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(23409))},15684:(e,t,s)=>{s.d(t,{$UK:()=>P,$ii:()=>F,Aag:()=>fe,Agl:()=>at,Arb:()=>it,Axr:()=>Pi,BiZ:()=>is,BxM:()=>$,DDm:()=>i,DlC:()=>St,DqG:()=>st,ELu:()=>ut,Ejd:()=>mo,F4t:()=>ie,GUt:()=>Xe,GXs:()=>E,Gei:()=>Mt,HVY:()=>ge,HW9:()=>Fe,HkI:()=>ni,IQD:()=>Ve,I_I:()=>vi,Ikv:()=>Es,J82:()=>Ys,JHD:()=>$e,JJT:()=>we,K05:()=>Ge,KCH:()=>Qe,LW4:()=>Fs,M9x:()=>qe,MSA:()=>_i,MWY:()=>H,MbN:()=>xe,Moh:()=>et,MpY:()=>I,MwW:()=>Be,NPD:()=>po,NUe:()=>Te,NuO:()=>ft,O65:()=>bt,OP3:()=>R,OSi:()=>M,Oxm:()=>V,PFX:()=>yt,PIC:()=>se,PZy:()=>Ki,Pfo:()=>vt,QSI:()=>tt,Qmv:()=>B,QyW:()=>ye,Rq4:()=>co,SjP:()=>Ui,T$n:()=>me,T2p:()=>Ce,TGw:()=>re,Tj4:()=>ws,TvF:()=>cs,UlD:()=>U,V1O:()=>ui,V67:()=>z,Vbm:()=>As,WB3:()=>Ds,WOR:()=>Nt,Wd2:()=>Ae,Wh2:()=>Ye,WpO:()=>_e,WyG:()=>Ts,X17:()=>Je,X3e:()=>si,X7E:()=>O,XfX:()=>zt,YE1:()=>pi,YR0:()=>$i,YtT:()=>gi,ZL7:()=>d,Zio:()=>It,ZoY:()=>gt,_oU:()=>wt,aC_:()=>fo,aas:()=>Ee,awo:()=>ce,b5C:()=>gs,bOs:()=>Zi,bfc:()=>xi,c7o:()=>de,cBy:()=>he,cdx:()=>zi,cvw:()=>ze,dDw:()=>Ze,dHu:()=>fi,dPS:()=>pt,dRA:()=>Et,da2:()=>Ut,e3J:()=>rs,e4J:()=>We,eaQ:()=>N,ey2:()=>mi,fDi:()=>Oe,g3$:()=>hi,gKP:()=>j,glw:()=>Dt,gs1:()=>ne,hVb:()=>Pt,hfN:()=>Yi,hv8:()=>kt,iDr:()=>_,j0N:()=>W,jPA:()=>Ne,jcS:()=>Rs,jv:()=>qi,kA8:()=>D,keA:()=>Vt,lXX:()=>ee,lfG:()=>ri,lju:()=>as,mMZ:()=>je,mmw:()=>Si,nJR:()=>oe,nf2:()=>Is,nl0:()=>Ie,o$6:()=>ao,oAJ:()=>le,oGr:()=>Ke,oRP:()=>ks,oY$:()=>x,oqb:()=>Oi,pWr:()=>T,pZu:()=>Gi,pkA:()=>Ht,pp6:()=>ve,puL:()=>ls,pw8:()=>Ai,q5V:()=>Ri,q8f:()=>hs,q_t:()=>Vi,qiO:()=>k,ql4:()=>Ps,qmx:()=>ue,qpX:()=>ke,qph:()=>G,rGl:()=>te,rqk:()=>De,rsR:()=>ds,sC6:()=>A,sK4:()=>Bt,sNX:()=>Y,sZb:()=>io,sbo:()=>yi,sgi:()=>Gt,tAb:()=>so,u6m:()=>lo,uI6:()=>us,v4T:()=>mt,vMu:()=>He,vwK:()=>pe,w$:()=>ho,x1P:()=>xt,xmb:()=>uo,xo4:()=>be,yN4:()=>Qi,yXy:()=>Ue,ykk:()=>C,yu_:()=>wi});var i={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},o=65,n=67,r=86,a=68,l=90,c=89;function d(e){const{keyCode:t}=e;let s;switch(t){case o:s=i.A;break;case n:s=i.C;break;case r:s=i.V;break;case a:s=i.D;break;case l:s=i.Z;break;case c:s=i.Y;break;default:s=e.code}return s}var u="36.2.0",h="object"!=typeof window||!window?.document?.fonts?.forEach,p=()=>!!h,g=(e,t,s,i,o,n,r=!1)=>{if(p())return;let a=e;i&&(a=`@layer ${CSS.escape(i).replaceAll("\\.",".")} { ${e} }`);let l=w.map.get(t);if(l||(l=[],w.map.set(t,l)),l.some((e=>e.injectedCss===a)))return;const c=document.createElement("style");n&&c.setAttribute("nonce",n),c.dataset.agCss=s,c.dataset.agCssVersion=u,c.textContent=a;const d={rawCss:e,injectedCss:a,el:c,priority:o,isParams:r};let h;for(const e of l){if(e.priority>o)break;h=e}if(h){h.el.after(c);const e=l.indexOf(h);l.splice(e+1,0,d)}else"STYLE"===t.nodeName?t.after(c):t.insertBefore(c,t.querySelector(":not(title, meta)")),l.push(d)},f=(e,t,s,i)=>{g(':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){font-family:inherit;font-size:inherit;line-height:inherit;padding:0}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-aria-description-container{border:0;clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;z-index:9999}.ag-popup{background-color:var(--ag-wrapper-background-color)}.ag-popup-child{max-width:min(100%,calc(100vw - 30px));top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-styled-root{cursor:default;display:contents;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-toolbar) .ag-react-container:where(:not(.ag-react-wrapper-block)){display:contents}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',e,"shared",t,0,s),i?.forEach(((i,o)=>i.forEach((i=>g(i,e,o,t,0,s)))))},m=(e,t=!1)=>{const s=new Set;for(const t of w.grids.values())t.styleContainer===e&&s.add(t.paramsCss);const i=w.map.get(e)??[];for(let e=i.length-1;e>=0;e--)(t||i[e].isParams&&!s.has(i[e].rawCss))&&(i[e].el.remove(),i.splice(e,1))},v=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(u);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(u,t)),t},w=v(),C=e=>new S(e),y="$default",b=0,S=class{constructor({feature:e,params:t,modeParams:s={},css:i,cssImports:o}){this.feature=e,this.css=i,this.cssImports=o,this.modeParams={[y]:{...s[y]??{},...t??{}},...s}}use(e,t,s){let i=this._inject;if(null==i){let{css:e}=this;if(e){const t=`ag-theme-${this.feature??"part"}-${++b}`;"function"==typeof e&&(e=e()),e=`:where(.${t}) {\n${e}\n}\n`;for(const t of this.cssImports??[])e=`@import url(${JSON.stringify(t)});\n${e}`;i={css:e,class:t}}else i=!1;this._inject=i}return i&&e&&g(i.css,e,i.class,t,1,s),!!i&&i.class}},x=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e((e=>this.onDone(e)),(e=>this.onReject(e)))}static all(t){return t.length?new e((e=>{let s=t.length;const i=new Array(s);t.forEach(((t,o)=>{t.then((t=>{i[o]=t,s--,0===s&&e(i)}))}))})):e.resolve()}static resolve(t=null){return new e((e=>e(t)))}then(t){return new e((e=>{1===this.status?e(t(this.resolution)):this.waiters.push((s=>e(t(s))))}))}onDone(e){this.status=1,this.resolution=e;for(const t of this.waiters)t(e)}onReject(e){}},R=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(R||{}),P=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,s){const i=t?this.allAsyncListeners:this.allSyncListeners;let o=i.get(e);return!o&&s&&(o=new Set,i.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,s=!1){this.getListeners(e,s,!0).add(t)}removeEventListener(e,t,s=!1){const i=this.getListeners(e,s,!1);i&&(i.delete(t),0===i.size&&(s?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const s=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const{frameworkOverrides:i}=this,o=e=>{const s=i?()=>i.wrapIncoming(e):e;t?this.dispatchAsync(s):s()},n=this.getListeners(s,t,!1);if((n?.size??0)>0){const t=new Set(n);for(const s of t)n?.has(s)&&o((()=>s(e)))}const r=this.getGlobalListeners(t);if(r.size>0){const t=new Set(r);for(const i of t)o((()=>i(s,e)))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},t=this.frameworkOverrides;t?t.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function E(e){const t=e?.length;return t?e[t-1]:void 0}function I(e,t,s){if(e===t)return!0;if(!e||!t)return null==e&&null==t;const i=e.length;if(i!==t.length)return!1;if(s){for(let o=0;o<i;++o){const i=e[o],n=t[o];if(i!==n&&!s(i,n))return!1}return!0}for(let s=0;s<i;++s)if(e[s]!==t[s])return!1;return!0}function k(e,t){if(!t)return[];const s=t.length;if(e&&e!==t&&e.length===s){for(let i=0;i<s;++i)if(e[i]!==t[i])return t.slice();return e}return t.slice()}function F(e,t){const s=e.indexOf(t);s>=0&&e.splice(s,1)}function D(e,t){const s=e.length,i=t.length;if(!s||!i)return;let o=0;const n=new Set(t);for(let t=0;t<s;++t){const s=e[t];n.has(s)||(t!==o&&(e[o]=s),++o)}o<s&&(e.length=o)}function T(e,t,s){const i=t.length;for(let s=0;s<i;++s)F(e,t[s]);for(let o=i-1;o>=0;o--)e.splice(s,0,t[o])}function A(e,t){if(e===t)return[];const s=e?.length,i=t?.length;if(!s)return t?t.slice():[];if(!i)return e?e.slice():[];const o=new Set(e);for(let e=0;e<i;++e){const s=t[e];o.delete(s)||o.add(s)}return Array.from(o)}function M(e,t,s){const i=e.get(t);void 0!==i?i.push(s):e.set(t,[s])}function N(e){const t=new Map;if(e)for(let s=0,i=e.length;s<i;++s)t.set(e[s],s);return t}var L=Object.prototype.hasOwnProperty;function V(e,t){return"__proto__"!==t&&L.call(e,t)}function _(e,t){return null!=e&&V(e,t)?e[t]:void 0}var O=e=>null==e||""===e?null:e;function B(e){return null!=e&&""!==e}function H(e){return!B(e)}var G=e=>null!=e&&"function"==typeof e.toString?e.toString():null,z=(e,t)=>(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null),W=(e,t,s=!1)=>("object"==typeof e&&null!==e&&"function"==typeof e.toNumber&&(e=e.toNumber()),"object"==typeof t&&null!==t&&"function"==typeof t.toNumber&&(t=t.toNumber()),null==e?null==t?0:-1:null==t?1:s&&"string"==typeof e?e.localeCompare(t):e>t?1:e<t?-1:0);function j(e){return e.eRootDiv.getRootNode()}function U(e){return j(e).activeElement}function $(e){const{gos:t,eRootDiv:s}=e;let i=null;const o=t.get("getDocument");return o&&B(o)?i=o():s&&(i=s.ownerDocument),i&&B(i)?i:document}function Y(e){const t=U(e);return null===t||t===$(e).body}function K(e){return $(e).defaultView||window}function q(e){let t,s=null;try{s=$(e).fullscreenElement}catch{}finally{s||(s=j(e));t=s.querySelector("body")||(s instanceof ShadowRoot?s:s instanceof Document?s?.documentElement:s)}return t}function Z(e,t,s){null==s||"string"==typeof s&&""==s?J(e,t):Q(e,t,s)}function Q(e,t,s){e.setAttribute(X(t),s.toString())}function J(e,t){e.removeAttribute(X(t))}function X(e){return`aria-${e}`}function ee(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function te(e){return e.getAttribute("aria-label")}function se(e,t){Z(e,"label",t)}function ie(e,t){Z(e,"labelledby",t)}function oe(e,t){Z(e,"live",t)}function ne(e,t){Z(e,"invalid",t)}function re(e,t){Z(e,"disabled",t)}function ae(e,t){Z(e,"hidden",t)}function le(e,t){Q(e,"expanded",t)}function ce(e,t){Q(e,"setsize",t)}function de(e,t){Q(e,"posinset",t)}function ue(e,t){Q(e,"multiselectable",t)}function he(e,t){Q(e,"rowcount",t)}function pe(e,t){Q(e,"rowindex",t)}function ge(e,t){Q(e,"rowspan",t)}function fe(e,t){Q(e,"colcount",t)}function me(e,t){Q(e,"colindex",t)}function ve(e,t){Q(e,"colspan",t)}function we(e,t){Q(e,"sort",t)}function Ce(e){J(e,"sort")}function ye(e,t){Z(e,"selected",t)}function be(e,t){Z(e,"controls",t)}function Se(e,t){Z(e,"owns",t)}function xe(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Re="[tabindex], input, select, button, textarea, [href]",Pe="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *, .ag-hidden, .ag-hidden *";function Ee(e){return!!e&&(!!e.matches("input, select, button, textarea")&&(!e.matches(Pe)&&Ge(e)))}function Ie(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-hidden",!t),i||ae(e,!t)}function ke(e,t){const s="disabled",i=t?e=>e.setAttribute(s,""):e=>e.removeAttribute(s);i(e);const o=e.querySelectorAll("input")??[];for(const e of o)i(e)}function Fe(e,t,s){let i=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof s){if(++i>s)break}else if(e===s)break}return!1}function De(e){const{height:t,width:s,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:d,marginTop:u,marginRight:h,marginBottom:p,marginLeft:g,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(s||"0"),borderTopWidth:m(i||"0"),borderRightWidth:m(o||"0"),borderBottomWidth:m(n||"0"),borderLeftWidth:m(r||"0"),paddingTop:m(a||"0"),paddingRight:m(l||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(u||"0"),marginRight:m(h||"0"),marginBottom:m(p||"0"),marginLeft:m(g||"0"),boxSizing:f}}function Te(e){const t=De(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function Ae(e){const t=De(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Me(e){const{height:t,marginBottom:s,marginTop:i}=De(e);return Math.floor(t+s+i)}function Ne(e){const{width:t,marginLeft:s,marginRight:i}=De(e);return Math.floor(t+s+i)}function Le(e){const t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:n}=De(e);return{top:t.top+(s||0),left:t.left+(i||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function Ve(e,t){let s=e.scrollLeft;return t&&(s=Math.abs(s)),s}function _e(e,t,s){s&&(t*=-1),e.scrollLeft=t}function Oe(e){for(;e?.firstChild;)e.firstChild.remove()}function Be(e){e?.parentNode&&e.remove()}function He(e){return!!e.offsetParent}function Ge(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!He(e)||"visible"!==window.getComputedStyle(e).visibility)}function ze(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function We(e,t,s){s?.nextSibling!==t&&(e.firstChild?s?s.nextSibling?e.insertBefore(t,s.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function je(e,t){for(let s=0;s<t.length;s++){const i=t[s],o=e.children[s];o!==i&&e.insertBefore(i,o)}}function Ue(e,t){if(t)for(const s of Object.keys(t)){const i=t[s];if(!s?.length||null==i)continue;const o=s.replace(/[A-Z]/g,(e=>`-${e.toLocaleLowerCase()}`)),n=i.toString(),r=n.replace(/\s*!important/g,""),a=r.length!=n.length?"important":void 0;e.style.setProperty(o,r,a)}}function $e(e){return()=>{const t=e();return!t||Ye(t)||function(e){return e.clientHeight<e.scrollHeight}(t)}}function Ye(e){return e.clientWidth<e.scrollWidth}function Ke(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):qe(e,t)}function qe(e,t){t=Qe(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Ze(e,t){t=Qe(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Qe(e){return"number"==typeof e?`${e}px`:e}function Je(e){return e instanceof Node||e instanceof HTMLElement}function Xe(e,t,s){null==s||""===s?e.removeAttribute(t):e.setAttribute(t,s.toString())}function et(e,t){if(!t.isContentEditable)return;const s=K(e).getSelection();if(!s)return;const i=$(e).createRange();i.selectNodeContents(t),i.collapse(!1),s.removeAllRanges(),s.addRange(i)}function tt(e,t,s){const i=K(e).ResizeObserver,o=i?new i(s):null;return o?.observe(t),()=>o?.disconnect()}function st(e,t,s,i){const o=K(e).IntersectionObserver,n=o?new o((e=>{s(E(e))}),i):null;return n?.observe(t),()=>n?.disconnect()}function it(e,t){const s=K(e);s.requestAnimationFrame?s.requestAnimationFrame(t):s.webkitRequestAnimationFrame?s.webkitRequestAnimationFrame(t):s.setTimeout(t,0)}var ot,nt="data-ref";function rt(){return ot??(ot=document.createTextNode(" ")),ot.cloneNode()}function at(e){const{attrs:t,children:s,cls:i,ref:o,role:n,tag:r}=e,a=document.createElement(r);if(i&&(a.className=i),o&&a.setAttribute(nt,o),n&&a.setAttribute("role",n),t)for(const e of Object.keys(t))a.setAttribute(e,t[e]);if(s)if("string"==typeof s)a.textContent=s;else{let e=!0;for(const t of s)t&&("string"==typeof t?(a.appendChild(document.createTextNode(t)),e=!1):"function"==typeof t?a.appendChild(t()):(e&&(a.appendChild(rt()),e=!1),a.append(at(t)),a.appendChild(rt())))}return a}var lt=["touchstart","touchend","touchmove","touchcancel","scroll"],ct=["wheel"],dt={},ut=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof dt[t])return dt[t];const s=document.createElement(e[t]||"div");return dt[t="on"+t]=t in s}})();function ht(e,t){return!(!t||!e)&&function(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():function(e){const t=[];let s=e.target;for(;s;)t.push(s),s=s.parentElement;return t}(t)}(t).indexOf(e)>=0}function pt(e,t,s){if(0===s)return!1;const i=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(i,o)<=s}var gt=(e,t)=>{const s=e.identifier;for(let e=0,i=t.length;e<i;++e){const i=t[e];if(i.identifier===s)return i}return null};function ft(e,t){return e.gos.isElementInThisInstance(t.target)}var mt=(e,...t)=>{for(const s of t){const[t,i,o,n]=s;t.addEventListener(i,o,n),e.push(s)}},vt=e=>{if(e){for(const[t,s,i,o]of e)t.removeEventListener(s,i,o);e.length=0}},wt=e=>{e.cancelable&&e.preventDefault()};function Ct(e,t){return t}function yt(e){return e?.getLocaleTextFunc()??Ct}function bt(e,t,s,i){const o=t[s];return e.getLocaleTextFunc()(s,"function"==typeof o?o(i):o,i)}function St(e){return(t,s,i)=>e({key:t,defaultValue:s,variableValues:i})}function xt(e){return(t,s,i)=>{let o=e?.[t];if(o&&i?.length){let e=0;for(;!(e>=i.length)&&-1!==o.indexOf("${variable}");)o=o.replace("${variable}",i[e++])}return o??s}}var Rt={type:"destroyed"},Pt=class{constructor(){this.beans=null,this.gos=null,this.eventSvc=null,this.destroyed=!1,this.localEventService=null,this.stubContext=null,this.destroyFunctions=null,this.propertyListenerId=0,this.lastChangeSetIdLookup=null}preWireBeans(e){this.beans=e,this.gos=e.gos,this.eventSvc=e.eventSvc,this.stubContext=e.context}destroy(){const e=this.destroyFunctions;if(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}this.destroyed=!0,this.dispatchLocalEvent(Rt)}addEventListener(e,t,s){let i=this.localEventService;i||(i=new P,this.localEventService=i),i.addEventListener(e,t,s)}removeEventListener(e,t,s){this.localEventService?.removeEventListener(e,t,s)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const s=[],i=Object.keys(t);for(let o=0,n=i.length;o<n;++o){const n=i[o],r=t[n];r&&s.push(this._setupListener(e,n,r))}return s}_setupListener(e,t,s){if(this.destroyed)return()=>null;let i;if(function(e){return void 0!==e.__addEventListener}(e))e.__addEventListener(t,s),i=()=>(e.__removeEventListener(t,s),null);else{const o=function(e){return"global"===e.eventServiceType}(e);e instanceof HTMLElement?function(e,t,s){const i=(e=>{const t=lt.includes(e),s=ct.includes(e);return!!t||!s&&void 0})(t);let o;null!=i&&(o={passive:i}),e.addEventListener(t,s,o)}(e,t,s):o?e.addListener(t,s):e.addEventListener(t,s),i=o?()=>(e.removeListener(t,s),null):()=>(e.removeEventListener(t,s),null)}return this.registerDestroyFunc(i)}setupPropertyListener(e,t){const{gos:s}=this;return s.addPropertyEventListener(e,t),this.registerDestroyFunc((()=>(s.removePropertyEventListener(e,t),null)))}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,i=e=>{const i=e.changeSet;if(i){let e=this.lastChangeSetIdLookup;if(e||(e={},this.lastChangeSetIdLookup=e),i.id===e[s])return;e[s]=i.id}const o={type:"propertyChanged",changeSet:i,source:e.source};t(o)};for(let t=0,s=e.length;t<s;++t)this.setupPropertyListener(e[t],i)}isAlive(){return!this.destroyed}getLocaleTextFunc(){return yt(this.beans.localeSvc)}pushDestroyFunc(e){const t=this.destroyFunctions;t?t.push(e):this.destroyFunctions=[e]}registerDestroyFunc(e){return this.pushDestroyFunc(e),()=>{e();const t=this.destroyFunctions;return t&&F(t,e),null}}addDestroyFunc(e){this.destroyed?e():this.pushDestroyFunc(e)}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};Pt.prototype.__v_skip=!0;var Et=null;function It(e){return"function"==typeof e?.getGui}var kt=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(e){if(e.includes(" ")){const s=(e||"").split(" ");if(s.length>1){for(const e of s)this.toggleCss(e,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}}},Ft=0,Dt=class extends Pt{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Ft++,this.cssManager=new kt((()=>this.eGui)),this.componentSelectors=new Map((t??[]).map((e=>[e.selector,e]))),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(nt):null}applyElementsToComponent(e,t,s,i=null){if(void 0===t&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===Et)this[t]=i??e;else{const e=s?.[t];if(!this.suppressDataRefValidation&&!e)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const s=[];for(const t of e.childNodes??[])s.push(t);for(const i of s){if(!(i instanceof HTMLElement))continue;const s=this.createComponentFromElement(i,(e=>{const t=e.getGui();if(t)for(const e of i.attributes??[])t.setAttribute(e.name,e.value)}),t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}}createComponentFromElement(e,t,s){const i=e.nodeName,o=this.getDataRefAttribute(e),n=0===i.indexOf("AG-"),r=n?this.componentSelectors.get(i):null;let a=null;if(r){const e=s&&o?s[o]:void 0;a=new r.component(e),a.setParentComponent(this),this.createBean(a,null,t)}else if(n)throw new Error(`selector: ${i}`);return this.applyElementsToComponent(e,o,s,a),a}swapComponentForNode(e,t,s){const i=e.getGui();t.replaceChild(i,s),t.insertBefore(document.createComment(s.nodeName),i),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const s=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const t of e)t.setAttribute("tabindex",s.toString())}setTemplate(e,t,s){let i;i="string"==typeof e||null==e?ze(e):at(e),this.setTemplateFromElement(i,t,s)}setTemplateFromElement(e,t,s,i=!1){if(this.eGui=e,this.suppressDataRefValidation=i,t)for(let e=0;e<t.length;e++){const s=t[e];this.componentSelectors.set(s.selector,s)}this.wireTemplate(e,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let s=t;return null==e?null:(s||(s=this.eGui),Je(e)?{element:e,parent:s}:{element:e.getGui(),parent:s})}prependChild(e,t){const{element:s,parent:i}=this.getContainerAndElement(e,t)||{};s&&i&&i.prepend(s)}appendChild(e,t){const{element:s,parent:i}=this.getContainerAndElement(e,t)||{};s&&i&&i.appendChild(s)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:s}=t;!function(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-invisible",!t),i||ae(e,!t)}(this.eGui,e,{skipAriaHidden:s})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:s}=t;Ie(this.eGui,e,{skipAriaHidden:s});const i={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(i)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,s){this.eGui.addEventListener(e,t,s),this.addDestroyFunc((()=>this.eGui.removeEventListener(e,t)))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===Tt?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=Tt}},Tt=Symbol(),At=1,Mt=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=At++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const e=new t;e.beanName?this.beans[e.beanName]=e:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(e)}for(const t of e.derivedBeans??[]){const{beanName:e,bean:s}=t(this);this.beans[e]=s,this.createdBeans.push(s)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const s=this.beans;for(const t of e)t.preWireBeans?.(s),t.wireBeans?.(s);for(const t of e)t.preConstruct?.();t&&e.forEach(t);for(const t of e)t.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},Nt=!1,Lt=new Set,Vt=(e,t)=>{Lt.has(t)||(Lt.add(t),e())};Vt._set=Lt;var _t={pending:!1,funcs:[]},Ot={pending:!1,funcs:[]};function Bt(e,t="setTimeout",s){const i="raf"===t?Ot:_t;if(i.funcs.push(e),i.pending)return;i.pending=!0;const o=()=>{const e=i.funcs.slice();i.funcs.length=0,i.pending=!1;for(const t of e)t()};"raf"===t?it(s,o):window.setTimeout(o,0)}function Ht(e,t,s){let i;return function(...o){const n=this;return window.clearTimeout(i),i=window.setTimeout((function(){e.isAlive()&&t.apply(n,o)}),s),i}}function Gt(e,t){let s=0;return function(...i){const o=Date.now();o-s<t||(s=o,e.apply(this,i))}}function zt(e,t,s,i=100){const o=Date.now();let n=null,r=!1;const a=()=>{null!=n&&(window.clearInterval(n),n=null)};e.addDestroyFunc(a);const l=()=>{const e=Date.now()-o>i;(t()||e)&&(s(),r=!0,a())};l(),r||(n=window.setInterval(l,10))}var Wt=Nt?0:200,jt=Nt?0:50,Ut=class extends Pt{constructor(){super(),this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.announcementGenerations=new Map,this.lastAnnouncement="",this.updateAnnouncement=Ht(this,this.updateAnnouncement.bind(this),Wt)}setDescriptionContainer(e){this.descriptionContainer=e,oe(e,"polite"),Z(e,"relevant","additions text"),Z(e,"atomic",!0),this.updateAnnouncement()}announceValue(e,t){const s=(this.announcementGenerations.get(t)??0)+1;this.announcementGenerations.set(t,s),this.pendingAnnouncements.set(t,{generation:s,value:e}),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;const e=Array.from(this.pendingAnnouncements,(([e,t])=>({...t,key:e})));this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout((()=>{const t=e.filter((({generation:e,key:t})=>this.announcementGenerations.get(t)===e)).map((({value:e})=>e)).join(". ");this.handleAnnouncementUpdate(t)}),jt)}handleAnnouncementUpdate(e){if(!this.isAlive()||!this.descriptionContainer)return;let t=e;null!=t&&""!=t.replace(/[ .]/g,"")?(this.lastAnnouncement===t&&(t=`${t}​`),this.lastAnnouncement=t,this.descriptionContainer.textContent=t):this.lastAnnouncement=""}destroy(){super.destroy(),this.descriptionContainer=null,this.pendingAnnouncements.clear(),this.announcementGenerations.clear()}};function $t(e,t,s){const[i,o]=function(e,t){const[s,i]=function(){const e={tag:"div",cls:"ag-styled-root"},t=at({...e,children:[{...e,children:[e]}]});return[t,t.firstElementChild.firstElementChild]}();return i.appendChild(t),[s,Yt(e,i)]}(e,s);return t.appendChild(i),()=>{o(),i.remove()}}function Yt(e,t,s,i,o){const n=t.parentElement,r=n.parentElement,a=()=>{const[a,l,c]=e.getStyledRootClasses(i,o);r.className=["ag-styled-root",a].join(" "),n.className=["ag-styled-root",l].join(" "),t.className=["ag-styled-root",c].join(" "),s?.()};return a(),e.onThemeChanged(a)}var Kt,qt,Zt,Qt,Jt,Xt,es,ts,ss,is=class extends Pt{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.disconnect=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(e,t=!1){const s={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:t=>this.onDragStart(e,t),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(s),this.beans.dragSvc.addDragSource(s)}setDragImageCompIcon(e,t=!1){const s=this.dragImageComp;s&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,s.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:s}=this;for(let i=0,o=t.length;i<o;i++)if(t[i].dragSource===e){const e=t[i];s.dragSvc?.removeDragSource(e),t.splice(i,1);break}}destroy(){const{dragSourceAndParamsList:e,dropTargets:t,beans:s}=this,i=s.dragSvc;for(const t of e)i?.removeDragSource(t);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){const e=this.lastMouseEvent;e&&this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();const s=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-s.left,this.dragInitialSourcePointerOffsetY=t.clientY-s.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){const{dragSource:t,lastDropTarget:s}=this;if(t?.onDragStopped?.(),s){const t=this.dropTargetEvent(s,e,!1);s.onDragStop?.(t)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t,lastMouseEvent:s}=this;if(e?.onDragCancelled?.(),t&&s){const e=this.dropTargetEvent(t,s,!1);t.onDragCancel?.(e)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);const s=this.findCurrentDropTarget(e),{lastDropTarget:i,dragSource:o,dragItem:n}=this;let r=!1;if(s!==i){if(r=!0,i){const s=this.dropTargetEvent(i,e,t);i.onDragLeave?.(s)}if(null===i||s?null===i&&s&&this.handleEnter(o,n):this.handleExit(o,n),s){const i=this.dropTargetEvent(s,e,t);s.onDragEnter?.(i)}this.lastDropTarget=s}else if(s){const i=this.dropTargetEvent(s,e,t);s.onDragging?.(i),i?.changed&&(r=!0)}this.lastMouseEvent=e,r&&this.updateDragImageComp()}clearDragAndDropProperties(){this.removeDragImageComp(this.dragImageComp),this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.lastDropTarget=null,this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.dragSource=null}getAllContainersFromDropTarget(e){const t=e.getContainer(),s=e.getSecondaryContainers?.(),i=s?.length;if(!i)return[[t]];const o=new Array(i+1);o[0]=[t];for(let e=0;e<i;++e)o[e+1]=s[e];return o}isMouseOnDropTarget(e,t){const s=this.getAllContainersFromDropTarget(t);let i=!1;const o=(e,t)=>{for(const s of t){const{width:t,height:i,left:o,right:n,top:r,bottom:a}=s.getBoundingClientRect();if(0===t||0===i)return!1;const l=e.clientX>=o&&e.clientX<n,c=e.clientY>=r&&e.clientY<a;if(!l||!c)return!1}return!0};for(const t of s)if(o(e,t)){i=!0;break}const{eElement:n,type:r}=this.dragSource;return!(t.targetContainsSource&&!t.getContainer().contains(n))&&i&&t.isInterestedIn(r,n)}findCurrentDropTarget(e){const t=[],s=this.dropTargets;for(let i=0,o=s.length;i<o;++i){const o=s[i];this.isMouseOnDropTarget(e,o)&&t.push(o)}const i=t.length;if(0===i)return null;if(1===i)return t[0];const o=j(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let e=0,s=o.length;e<s;++e){const s=o[e];for(let e=0,i=t.length;e<i;e++){const i=t[e],o=this.getAllContainersFromDropTarget(i);let n=!1;for(let e=0,t=o.length;e<t&&!n;e++){const t=o[e];for(let e=0,i=t.length;e<i;e++)if(t[e]===s){n=!0;break}}if(n)return i}}return null}addDropTarget(e){this.dropTargets.push(e),e.external&&this.externalDropZoneCount++}removeDropTarget(e){const t=e.getContainer(),s=this.dropTargets;let i=0;for(let e=0,o=s.length;e<o;++e){const o=s[e];o.getContainer()!==t?(i!==e&&(s[i]=o),++i):o.external&&--this.externalDropZoneCount}s.length=i}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){const t=this.dropTargets;for(let s=0,i=t.length;s<i;++s){const i=t[s];if(i.external&&i.getContainer()===e)return i}return null}dropTargetEvent(e,t,s){const{dragSource:i,dragItem:o,lastDraggingEvent:n,lastMouseEvent:r,dragInitialSourcePointerOffsetX:a,dragInitialSourcePointerOffsetY:l}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:u,clientY:h}=t,p=u-(r?.clientX||0),g=h-(r?.clientY||0),f=this.createEvent({event:t,x:u-d.left,y:h-d.top,vDirection:g>0?"down":g<0?"up":null,hDirection:p<0?"left":p>0?"right":null,initialSourcePointerOffsetX:a,initialSourcePointerOffsetY:l,dragSource:i,fromNudge:s,dragItem:o,dropZoneTarget:c,dropTarget:n?.dropTarget??null,changed:!!n?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&function(e,t,s){const i=e.getBoundingClientRect().height,o=function(e){const t=q(e);return t?.clientWidth??(window.innerWidth||-1)}(s)-2,n=function(e){const t=q(e);return t?.clientHeight??(window.innerHeight||-1)}(s)-2;if(!e.offsetParent)return;const r=Le(e.offsetParent),{clientY:a,clientX:l}=t;let c=a-r.top-i/2,d=l-r.left-10;const u=$(s),h=u.defaultView||window,p=h.pageYOffset||u.documentElement.scrollTop,g=h.pageXOffset||u.documentElement.scrollLeft;o>0&&d+e.clientWidth>o+g&&(d=o+g-e.clientWidth),d<0&&(d=0),n>0&&c+e.clientHeight>n+p&&(c=n+p-e.clientHeight),c<0&&(c=0),e.style.left=`${d}px`,e.style.top=`${c}px`}(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(this.disconnect?.(),this.disconnect=null,this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then((e=>{const s=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!s||!this.isAlive())return void this.destroyBean(e);this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const i=this.dragImageComp;i!==e&&(this.dragImageComp=e,this.removeDragImageComp(i)),e&&(this.appendDragImageComp(e),this.updateDragImageComp(),this.positionDragImageComp(s))}))}appendDragImageComp(e){const t=e.getGui(),s=t.style;s.position="absolute",s.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(s.pointerEvents="none"),this.gos.setInstanceDomData(t),s.top="20px",s.left="20px";const i=q(this.beans);i?this.disconnect=$t(this.beans.environment,i,t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:s,lastDraggingEvent:i,dragImageLastLabel:o}=this;if(!e)return;this.setDragImageCompIcon(s?.getIconName?.(i)??null);let n=t?.dragItemName;"function"==typeof n&&(n=n(i)),n||(n=""),o!==n&&(this.dragImageLastLabel=n,e.setLabel(n))}},os=(e,t)=>{if(null!=t&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},ns=e=>{const{eElement:t,onLost:s}=e;t&&s&&(t.removeEventListener("lostpointercapture",s),e.onLost=null)};function rs(){return void 0===Kt&&(Kt=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Kt}function as(){return void 0===qt&&(qt=/(firefox)/i.test(navigator.userAgent)),qt}function ls(){return void 0===Zt&&(Zt=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Zt}function cs(){return void 0===Qt&&(Qt=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),Qt}function ds(e){if(!e)return null;const t=e.tabIndex,s=e.getAttribute("tabIndex");return-1!==t||null!==s&&(""!==s||as())?t.toString():null}function us(){if(void 0!==es)return es;if(!document.body)return-1;let e=1e6;const t=as()?6e6:1e9,s=document.createElement("div");for(document.body.appendChild(s);;){const i=2*e;if(s.style.height=i+"px",i>t||s.clientHeight!==i)break;e=i}return s.remove(),es=e,e}function hs(){return null==Xt&&ps(),Xt}function ps(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let s=t.offsetWidth-t.clientWidth;0===s&&0===t.clientWidth&&(s=null),t.parentNode&&t.remove(),null!=s&&(Xt=s,Jt=0===s)}function gs(){return null==Jt&&ps(),Jt}var fs={passive:!0},ms={passive:!1},vs=e=>{if(ss){if(ss.has(e))return!1}else ss=new WeakSet;return ss.add(e),!0},ws=class extends Pt{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!ts?.has(j(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!(!e||!this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)Cs(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let s=0,i=t.length;s<i;++s){const i=t[s];if(i.params===e){t.splice(s,1),Cs(i);break}}}addDragSource(e){if(!this.isAlive())return;const{eElement:t,includeTouch:s}=e,i=[];let o;if(s){const e=t.style;e&&(o=e.touchAction,e.touchAction="none")}const n={handlers:i,params:e,oldTouchAction:o};this.dragSources.push(n),mt(i,[t,"pointerdown",t=>this.onPointerDown(e,t),ms],[t,"mousedown",t=>this.onMouseDown(e,t)]);const r=this.gos.get("suppressTouch");s&&!r&&mt(i,[t,"touchstart",t=>this.onTouchStart(e,t),ms])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return("mousemove"===t||"pointermove"===t)&&e.cancelable&&ft(this.beans,e)&&!Ee(bs(e))}initDrag(e,...t){this.drag=e;const s=this.beans,i=e=>this.onScroll(e),o=j(s),n=$(s);mt(e.handlers,[o,"contextmenu",wt],[o,"keydown",e=>this.onKeyDown(e)],[n,"scroll",i,{capture:!0}],[n.defaultView||window,"scroll",i],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;ts?.get(t)===e&&ts.delete(t),this.drag=null,(e=>{if(!e)return;ns(e);const{eElement:t,pointerId:s}=e;if(t){try{t.releasePointerCapture(s)}catch{}e.eElement=null}})(e.pointerCapture),vt(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const s=this.beans;if(ss?.has(t))return;const i=t.pointerType;if("touch"===i){if(s.gos.get("suppressTouch")||!e.includeTouch)return;if(e.stopPropagationForTouch&&t.stopPropagation(),Ee(bs(t)))return}if(!t.isPrimary)return;if("mouse"===i&&0!==t.button)return;this.destroyDrag();const o=j(s),n=e.eElement,r=t.pointerId,a=new ys(o,e,t,r);ts??(ts=new WeakMap),ts.set(o,a);const l=e=>this.draggingPreventDefault(e);this.initDrag(a,[o,"pointerup",e=>{e.pointerId===r&&this.onMouseOrPointerUp(e)}],[o,"pointercancel",e=>{e.pointerId===r&&vs(e)&&this.cancelDrag()}],[o,"pointermove",e=>{e.pointerId===r&&this.onMouseOrPointerMove(e)},ms],[o,"touchmove",l,ms],[n,"mousemove",l,ms]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):vs(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch)return;if(!vs(t))return;if(Ee(bs(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer())return void(this.dragging&&wt(t));this.destroyDrag();const s=this.beans,i=j(s),o=new ys(i,e,t.touches[0]),n=e=>this.onTouchUp(e),r=e=>this.onTouchCancel(e),a=j(s),l=t.target??e.eElement;this.initDrag(o,[l,"touchmove",e=>this.onTouchMove(e),fs],[l,"touchend",n,fs],[l,"touchcancel",r,fs],[a,"touchmove",e=>this.draggingPreventDefault(e),ms],[a,"touchend",n,ms],[a,"touchcancel",r,ms]),0===e.dragStartPixels&&this.onMove(o.start)}draggingPreventDefault(e){this.dragging&&wt(e)}onMouseDown(e,t){if(0!==t.button)return;if(ss?.has(t))return;if(this.isPointer())return;const s=this.beans;this.destroyDrag();const i=new ys(j(s),e,t),o=j(s);this.initDrag(i,[o,"mousemove",e=>this.onMouseOrPointerMove(e)],[o,"mouseup",e=>this.onMouseOrPointerUp(e)]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):vs(t)}onScroll(e){if(!vs(e))return;const t=this.drag,s=t?.lastDrag;s&&this.dragging&&t.params?.onDragging?.(s)}onMouseOrPointerMove(e){vs(e)&&(rs()&&$(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&wt(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;t&&vs(e)&&gt(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!vs(e))return;const s=gt(t.start,e.touches);s&&(this.onMove(s),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const s=t.params;if(!this.dragging){const i=t.start;if(pt(e,i,s.dragStartPixels??4))return;if(this.dragging=!0,s.capturePointer&&(t.pointerCapture=((e,t)=>{if("undefined"==typeof PointerEvent||!(t instanceof PointerEvent))return null;const s=t.pointerId;if(!os(e,s))return null;const i={eElement:e,pointerId:s,onLost(e){((e,t)=>{ns(e);const{eElement:s,pointerId:i}=e;s&&t.pointerId===i&&os(s,i)})(i,e)}};return e.addEventListener("lostpointercapture",i.onLost),i})(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:s.eElement}),s.onDragStart?.(i),this.drag!==t)return;if(s.onDragging?.(i),this.drag!==t)return}s.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&vs(e)&&this.onUp(gt(t.start,e.changedTouches))}onMouseOrPointerUp(e){vs(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===i.ESCAPE&&this.cancelDrag()}},Cs=e=>{vt(e.handlers);const t=e.oldTouchAction;if(null!=t){const s=e.params.eElement.style;s&&(s.touchAction=t)}},ys=class{constructor(e,t,s,i=null){this.rootEl=e,this.params=t,this.start=s,this.pointerId=i,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},bs=e=>{const t=e.target;return t instanceof Element?t:null},Ss=e=>{return`--ag-${t=e,t.replace(/[A-Z]|\d+/g,(e=>`-${e}`)).toLowerCase()}`;var t},xs=e=>`var(${Ss(e)})`,Rs=e=>({ref:"accentColor",mix:e}),Ps=e=>({ref:"foregroundColor",mix:e}),Es=e=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),Is=e=>({ref:"foregroundColor",mix:e,onto:"headerBackgroundColor"}),ks={ref:"backgroundColor"},Fs={ref:"foregroundColor"},Ds={ref:"accentColor"},Ts={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:Ps(.15),chromeBackgroundColor:Es(.02),browserColorScheme:"light"},As=()=>["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],Ms={...Ts,textColor:Fs,accentColor:"#2196f3",rowHoverColor:Rs(.08),invalidColor:"#e02525",fontFamily:As(),subtleTextColor:{ref:"textColor",mix:.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:400,focusShadow:{spread:3,color:Rs(.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:ks,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:Ds,toggleButtonOffBackgroundColor:Es(.3),toggleButtonSwitchBackgroundColor:ks,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:.25}},panelBackgroundColor:ks,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,pickerFieldHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},dialogShadow:{ref:"popupShadow"},dialogBorder:{color:Ps(.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, headerFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:Ps(.2)},menuBackgroundColor:Es(.03),menuTextColor:Es(.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},Ns=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],Ls=(()=>{const e=new Map;return t=>{const s=t;return e.has(s)||e.set(s,(i=(i=t).toLowerCase(),Ns.find((e=>i.endsWith(e.toLowerCase())))??"length")),e.get(s);var i}})(),Vs=e=>"object"==typeof e&&e?.ref?xs(e.ref):"string"==typeof e?e:"number"==typeof e&&String(e),_s=e=>{if("string"==typeof e)return e;if("object"==typeof e&&e&&"ref"in e){const t=xs(e.ref);return null==e.mix?t:`color-mix(in srgb, ${e.onto?xs(e.onto):"transparent"}, ${t} ${(e=>Math.max(0,Math.min(100,e)))(100*e.mix)}%)`}return!1},Os=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"object"==typeof e&&e&&"calc"in e?`calc(${e.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,(e=>"-"===e[0]?e:" "+xs(e)+" "))})`:!("object"!=typeof e||!e||!("ref"in e))&&xs(e.ref),Bs=(e,t)=>"string"==typeof e?e:!0===e?Bs({},t):!1===e?"columnBorder"===t?Bs({color:"transparent"},t):"none":"object"==typeof e&&e&&"ref"in e?xs(e.ref):Gs(e.style??"solid")+" "+Os(e.width??{ref:"borderWidth"})+" "+_s(e.color??{ref:"borderColor"}),Hs=e=>[Os(e.offsetX??0),Os(e.offsetY??0),Os(e.radius??0),Os(e.spread??0),_s(e.color??{ref:"foregroundColor"}),...e.inset?["inset"]:[]].join(" "),Gs=Vs,zs=e=>"string"==typeof e?e.includes(",")?e:Ws(e):"object"==typeof e&&e&&"googleFont"in e?zs(e.googleFont):"object"==typeof e&&e&&"ref"in e?xs(e.ref):!!Array.isArray(e)&&e.map((e=>("object"==typeof e&&"googleFont"in e&&(e=e.googleFont),Ws(e)))).join(", "),Ws=e=>/^[\w-]+$|\w\(/.test(e)?e:JSON.stringify(e),js=e=>"string"==typeof e?e:"object"==typeof e&&e&&"url"in e?`url(${JSON.stringify(e.url)})`:"object"==typeof e&&e&&"svg"in e?js({url:`data:image/svg+xml,${encodeURIComponent(e.svg)}`}):!("object"!=typeof e||!e||!("ref"in e))&&xs(e.ref),Us={color:_s,colorScheme:Vs,length:Os,scale:Vs,border:Bs,borderStyle:Gs,shadow:e=>"string"==typeof e?e:!1===e?"none":"object"==typeof e&&e&&"ref"in e?xs(e.ref):Array.isArray(e)?e.map(Hs).join(", "):Hs(e),image:js,fontFamily:zs,fontWeight:Vs,duration:(e,t,s)=>"string"==typeof e?e:"number"==typeof e?(e>=10&&s?.warn(104,{value:e,param:t}),`${e}s`):!("object"!=typeof e||!e||!("ref"in e))&&xs(e.ref)},$s=(e,t,s)=>{const i=Ls(e);return Us[i](t,e,s)},Ys=(e,t)=>new Ks({themeLogger:e,overridePrefix:t}),Ks=class e{constructor(e,t=[]){this.params=e,this.parts=t}withPart(t){return"function"==typeof t&&(t=t()),t instanceof S?new e(this.params,[...this.parts,t]):(this.params.themeLogger.preInitErr(259,"Invalid part",{part:t}),this)}withoutPart(e){return this.withPart(C({feature:e}))}withParams(e,t=y){return this.withPart(C({modeParams:{[t]:e}}))}_startUse({styleContainer:e,cssLayer:t,nonce:s,loadThemeGoogleFonts:i,moduleCss:o}){if(p())return;Js(),f(e,t,s,o);const n=Zs(this);if(n.length>0)for(const e of n)i&&Xs(e,s);for(const i of this.parts)i.use(e,t,s)}_getCssClasses(){return this._cssClassCache??(this._cssClassCache=[this._getParamsClassName(!0),qs(this.parts).map((e=>e.use(void 0,void 0,void 0))).filter(Boolean).concat(this._getParamsClassName()).join(" ")])}_getClassNamesId(){return this._classNamesId??(this._classNamesId=++v().paramsId)}_getParamsClassName(e=!1){return`ag-theme-${e?"inherit":"params"}-${this._getClassNamesId()}`}_getModeParams(){let e=this._paramsCache;if(!e){const t={[y]:{...Ms}};for(const e of qs(this.parts))for(const s of Object.keys(e.modeParams)){const i=e.modeParams[s];if(i){const e=t[s]??(t[s]={}),o=new Set;for(const t of Object.keys(i)){const s=i[t];void 0!==s&&(e[t]=s,o.add(t))}if(s===y)for(const e of Object.keys(t)){const s=t[e];if(e!==y)for(const e of o)delete s[e]}}}this._paramsCache=e=t}return e}_getParamsCss(){if(!this._paramsCssCache){let e="",t="";const s=this._getModeParams(),{overridePrefix:i,themeLogger:o}=this.params,n=i?`--ag-${i}-`:void 0;for(const i of Object.keys(s)){const r=s[i];if(i!==y){const s="object"==typeof CSS?CSS.escape(i):i,o=`:where(html[data-ag-theme-mode="${s}"],body[data-ag-theme-mode="${s}"],.ag-theme-mode[data-ag-theme-mode="${s}"]) & {\n`;e+=o,t+=o}for(const s of Object.keys(r).sort()){const i=r[s],a=$s(s,i,o);if(!1===a)o.error(107,{key:s,value:i});else{const i=Ss(s),o=n?i.replace("--ag-",n):i,r=i.replace("--ag-","--ag-inherited-");e+=`\t${i}: var(${r}, ${a});\n`,t+=`\t${r}: var(${o});\n`}}i!==y&&(e+="}\n",t+="}\n")}let r=`:where(.${this._getParamsClassName()}) {\n${e}}\n`;r+=`:where(.${this._getParamsClassName(!0)}) {\n${t}}\n`,this._paramsCssCache=r}return this._paramsCssCache}},qs=e=>{const t=new Map;for(const s of e)t.set(s.feature,s);const s=[];for(const i of e)i.feature&&t.get(i.feature)!==i||s.push(i);return s},Zs=e=>{const t=new Set,s=e=>{if(Array.isArray(e))e.forEach(s);else{const s=e?.googleFont;"string"==typeof s&&t.add(s)}};return Object.values(e._getModeParams()).flatMap((e=>Object.values(e))).forEach(s),Array.from(t).sort()},Qs=!1,Js=()=>{if(!Qs){Qs=!0;for(const e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))e.remove()}},Xs=async(e,t)=>{const s=`@import url('https://${ei}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap');\n`;g(s,document.head,`googleFont:${e}`,void 0,0,t)},ei="fonts.googleapis.com",ti={changeKey:"listItemHeight",type:"length",defaultValue:24},si=class extends Pt{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(e){this.eRootDiv=e.eRootDiv}postConstruct(){const{gos:e,eRootDiv:t}=this;e.setInstanceDomData(t);const s=e.get("themeStyleContainer"),i="undefined"!=typeof ShadowRoot,o=i&&t.getRootNode()instanceof ShadowRoot;this.eStyleContainer=("function"==typeof s?s():s)??(o?t:document.head),s||o||!i||oi(t,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this)),this.cssLayer=e.get("themeCssLayer"),this.styleNonce=e.get("styleNonce"),this.addManagedPropertyListener("theme",(()=>this.handleThemeChange())),this.handleThemeChange(),this.mutationObserver=new MutationObserver((()=>{this.fireStylesChangedEvent("theme")})),this.addDestroyFunc((()=>this.mutationObserver.disconnect())),this.initStyledRoot(),this.getSizeEl(ti),this.initVariables(),this.addDestroyFunc((()=>(e=>{const t=w.grids.get(e)?.styleContainer;t&&(w.grids.delete(e),Array.from(w.grids.values()).some((e=>e.styleContainer===t))?m(t):(m(t,!0),w.map.delete(t)))})(this)))}getStyledRootClasses(e,t){const{theme:s}=this,[i,o]=s?s._getCssClasses():["",this.useLegacyThemeClasses(t)],n=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";return e?["","",n]:[i,o,n]}useLegacyThemeClasses(e){const t=new Set;this.mutationObserver.disconnect();let s=this.eRootDiv.parentElement;for(;s;){if(!s.classList.contains("ag-styled-root")){let e=!1;for(const i of s.classList)i.startsWith("ag-theme-")&&(e=!0,t.add(i));e&&this.mutationObserver.observe(s,{attributes:!0,attributeFilter:["class"]})}s=s.parentElement}return e?"":[...t].join(" ")}onThemeChanged(e){const t=t=>{t.themeChanged&&e()};return this.eventSvc.addListener("stylesChanged",t),()=>this.eventSvc.removeListener("stylesChanged",t)}addGlobalCSS(e,t){this.theme?g(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce):this.globalCSS.push([e,t])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(ti)}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const s=this.measureSizeEl(e);return"number"!=typeof s?e.defaultValue:(this.lastKnownValues.set(e,s),s)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const s=t.offsetWidth-1;return s===ii?"no-styles":(this.sizesMeasured=!0,s<0?"no-length":s)}getMeasurementContainer(){let e=this.eMeasurementContainer;return e||(e=this.eMeasurementContainer=at({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(e),this.addDestroyFunc((()=>e?.remove()))),e}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;const s=this.getMeasurementContainer();t=at({tag:"div"});const i=this.setSizeElStyles(t,e);s.appendChild(t),this.sizeEls.set(e,t);const{type:o,noWarn:n}=e;if("length"!==o&&"border"!==o)return t;let r=this.measureSizeEl(e);"no-styles"!==r||n||this.varError(i,e.defaultValue);const a=tt(this.beans,t,(()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,"no-length"===t?e.defaultValue:t),t!==r&&(r=t,this.fireStylesChangedEvent(e.changeKey)))}));return this.addDestroyFunc((()=>a())),t}setSizeElStyles(e,t){const{changeKey:s,type:i}=t;let o=Ss(s);return"border"===i?(o.endsWith("-width")&&(o=o.slice(0,-6)),e.className="ag-measurement-element-border",e.style.paddingLeft="1px",e.style.setProperty("--ag-internal-measurement-border",`var(${o}, solid ${ii}px)`)):e.style.width=`calc(var(${o}, ${ii}px) + 1px)`,o}handleThemeChange(){const{gos:e,theme:t}=this,s=e.get("theme");let i;if("legacy"===s)i=void 0;else{const e=s??this.getDefaultTheme();e instanceof Ks?i=e:this.themeError(e)}i!==t&&this.handleNewTheme(i),this.postProcessThemeChange(i,s)}handleNewTheme(e){const{gos:t,globalCSS:s}=this,i=this.getAdditionalCss();if(e){f(this.eStyleContainer,this.cssLayer,this.styleNonce,i);for(const[e,t]of s)g(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce);s.length=0}this.theme=e,e?._startUse({loadThemeGoogleFonts:t.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:i}),((e,t,s,i,o,n)=>{if(p())return;const r=w.grids.get(e);r?r.paramsCss=t:w.grids.set(e,{styleContainer:i,paramsCss:t}),m(i),t&&s&&g(t,i,s,o,2,n,!0)})(this,e?._getParamsCss()??null,e?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(e){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${e}Changed`]:!0})}initStyledRoot(){this.addDestroyFunc(Yt(this,this.eRootDiv,void 0,this.beans.hasAncestorStyledRoot,!0))}},ii=15538,oi=(e,t,s)=>{let i=60;const o=setInterval((()=>{"undefined"!=typeof ShadowRoot&&e.getRootNode()instanceof ShadowRoot&&(t(),clearInterval(o)),(e.isConnected||--i<0)&&clearInterval(o)}),1e3);s((()=>clearInterval(o)))},ni=class extends Pt{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...s){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const i=this.dynamicBeans[e];if(null!=i)return new i(...s);if(t)throw new Error(this.getDynamicError(e,!1))}},ri=class extends Pt{constructor(){super(...arguments),this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new P}addListener(e,t,s){this.globalSvc.addEventListener(e,t,s)}removeListener(e,t,s){this.globalSvc.removeEventListener(e,t,s)}addGlobalListener(e,t=!1){this.globalSvc.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalSvc.removeGlobalListener(e,t)}dispatchEvent(e){this.globalSvc.dispatchEvent(this.gos.addCommon(e))}dispatchEventOnce(e){this.globalSvc.dispatchEventOnce(this.gos.addCommon(e))}},ai="ag-focus-managed",li=!1,ci=0;function di(e){const t=li,s="keydown"===e.type;s&&(e.ctrlKey||e.metaKey||e.altKey)||t!==s&&(li=s)}function ui(e){const t=$(e);var s;return s=t,ci>0||(s.addEventListener("keydown",di),s.addEventListener("mousedown",di)),ci++,()=>{ci--,function(e){ci>0||(e.removeEventListener("keydown",di),e.removeEventListener("mousedown",di))}(t)}}function hi(){return li}function pi(e,t,s=!1){const i=Re;let o=Pe;t&&(o+=", "+t),s&&(o+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(i)).filter((e=>Ge(e))),r=new Set(e.querySelectorAll(o));return r.size?n.filter((e=>!r.has(e))):n}function gi(e,t=!1,s=!1,i=!1){const o=pi(e,i?".ag-tab-guard":null,s),n=t?E(o):o[0];return!!n&&(n.focus({preventScroll:!0}),!0)}function fi(e,t=!1,s=!1){const i=pi(e,s?".ag-tab-guard":null),o=i.filter((e=>e.tabIndex>=0)),n=o.length?o:i.filter((t=>{const s=t.closest(`.${ai}`);return null!==s&&e.contains(s)})),r=t?E(n):n[0];return!!r&&(r.focus({preventScroll:!0}),!0)}function mi(e){const{beans:t,rootNode:s,onlyManaged:i,onlyUnmanaged:o,backwards:n}=e,r=U(t);let a=pi(s,i?':not([tabindex="-1"])':null);o&&(a=a.filter((e=>e===r||"-1"!==ds(e))));const l=(i?a.findIndex((e=>e.contains(r))):a.indexOf(r))+(n?-1:1);return l<0||l>=a.length?null:a[l]}function vi(e,t=5){let s=0;for(;e&&null===ds(e)&&++s<=t;)e=e.parentElement;return null===ds(e)?null:e}function wi(e){let t=e;for(;t&&!Ci(t);){const e=t.parentElement;t=e?.className.startsWith("ag-")?e:null}if(!t)return;e===pi(t,null,!0)[0]&&(t.scrollLeft=0);const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.left<s.left?t.scrollLeft-=s.left-i.left:i.right>s.right&&(t.scrollLeft+=i.right-s.right)}function Ci(e){const t=getComputedStyle(e).overflowX;return"auto"===t||"scroll"===t}var yi=class extends Pt{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},s={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=s,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=mi({beans:this.beans,rootNode:this.eFocusable,backwards:e.shiftKey});t&&(t.focus(),e.preventDefault())},...s}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:s}}=this;e.classList.add(ai),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),s&&this.addManagedElementListeners(e,{focusout:s})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{if(e.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(e))return;const{callbacks:t}=this;t.shouldStopEventPropagation(e)?this.stopPropagationCallbacks.stopPropagation(e):e.key===i.TAB?t.onTabKeyDown(e):t.handleKeyDown&&t.handleKeyDown(e)}})}},bi="ag-tab-guard",Si=class extends Pt{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.lastFocusedElementInside=null,this.allowFocus=!1;const{comp:s,eTopGuard:i,eBottomGuard:o,focusTrapActive:n,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:a,focusInnerElement:l,onFocusIn:c,onFocusOut:d,onGuardFocusedFromInside:u,shouldStopEventPropagation:h,onTabKeyDown:p,handleKeyDown:g,isEmpty:f,eFocusableElement:m}=e;this.comp=s,this.eTopGuard=i,this.eBottomGuard=o,this.providedFocusInnerElement=l,this.eFocusableElement=m,this.focusTrapActive=!!n,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!a,this.providedFocusIn=c,this.providedFocusOut=d,this.providedOnGuardFocusedFromInside=u,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=p,this.providedHandleKeyDown=g,this.providedIsEmpty=f}postConstruct(){this.createManagedBean(new yi(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():0===pi(this.eFocusableElement,".ag-tab-guard").length))return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget)){const t=e.target===this.eBottomGuard,s=this.providedOnGuardFocusedFromInside?.(t);if(!0===s&&$(this.beans).activeElement===e.target){const t=e.relatedTarget,s=t.classList.contains(bi)?this.lastFocusedElementInside:t;s?.focus()}else!1===s&&this.findNextElementOutsideAndFocus(!t);return}const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e,t){const s=pi($(this.beans).body,null,!0).filter((e=>e.tabIndex>=0)).map(((e,t)=>({element:e,domIndex:t}))).sort(((e,t)=>(e.element.tabIndex||Number.MAX_SAFE_INTEGER)-(t.element.tabIndex||Number.MAX_SAFE_INTEGER)||e.domIndex-t.domIndex)).map((({element:e})=>e)),i=e?this.eTopGuard:this.eBottomGuard,o=s.indexOf(i);if(-1===o)return!1;const n=e?-1:1;for(let e=o+n;e>=0&&e<s.length;e+=n){const i=s[e];if(!t?.some((e=>e.contains(i))))return i.focus(),!0}return!1}onFocusIn(e){if(this.focusTrapActive||this.forcingFocusOut)return;const t=e.target;t.classList.contains(bi)||(this.lastFocusedElementInside=t),this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards()}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const s=this.getNextFocusableElement(e.shiftKey);t&&setTimeout((()=>this.activateTabGuards()),0),s&&(s.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=pi(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),!!t.length&&(t[e?t.length-1:0].focus({preventScroll:!0}),!0)}getNextFocusableElement(e){return mi({beans:this.beans,rootNode:this.eFocusableElement,backwards:e})}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout((()=>{this.forcingFocusOut=!1,this.activateTabGuards()}))}focusNextElementOutsideContainer(e,t){return this.findNextElementOutsideAndFocus(e,t)}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},xi=class extends Pt{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:s,eFocusableElement:i,stopPropagationCallbacks:o}=this,n=[t,s],r={setTabIndex:e=>{for(const t of n)null==e?t.removeAttribute("tabindex"):t.setAttribute("tabindex",e)}};this.addTabGuards(t,s);const{focusTrapActive:a=!1,onFocusIn:l,onFocusOut:c,onGuardFocusedFromInside:d,focusInnerElement:u,handleKeyDown:h,onTabKeyDown:p,shouldStopEventPropagation:g,isEmpty:f,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:v}=e;this.tabGuardCtrl=this.createManagedBean(new Si({comp:r,focusTrapActive:a,eTopGuard:t,eBottomGuard:s,eFocusableElement:i,onFocusIn:l,onFocusOut:c,onGuardFocusedFromInside:d,focusInnerElement:u,handleKeyDown:h,onTabKeyDown:p,shouldStopEventPropagation:g,isEmpty:f,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:v},o))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=$(this.beans).createElement("div"),s="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add(bi,s),ee(t,"presentation"),t}addTabGuards(e,t){const s=this.eFocusableElement;s.prepend(e),s.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Oe(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}focusNextElementOutsideContainer(e,t){return this.tabGuardCtrl.focusNextElementOutsideContainer(e,t)}appendChild(e,t,s){Je(t)||(t=t.getGui());const{eBottomGuard:i}=this;i?i.before(t):e(t,s)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;Be(e),Be(t),super.destroy()}},Ri=class extends Dt{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new xi(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}focusNextElementOutsideContainer(e,t){return this.tabGuardFeature.focusNextElementOutsideContainer(e,t)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},Pi=class extends Dt{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent,t=e?.isAlive();t&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}};function Ei(e,t){return{top:e.top-t.top,left:e.left-t.left,right:e.right-t.left,bottom:e.bottom-t.top}}function Ii(e,t,s,i=0){const[o,n]=s.split("-"),r=ki(e,n),a=(c=o,ki({top:0,left:0,right:(l=t).width,bottom:l.height},c));var l,c;const d=function(e,t){const s=Fi(e),i=Fi(t),o=Di(e),n=Di(t);return{dx:Math.sign(i-s),dy:Math.sign(n-o)}}(o,n);return{x:r.x-a.x+d.dx*i,y:r.y-a.y+d.dy*i}}function ki(e,t){const s=(e.left+e.right)/2,i=(e.top+e.bottom)/2;switch(t){case"tl":return{x:e.left,y:e.top};case"tc":return{x:s,y:e.top};case"tr":return{x:e.right,y:e.top};case"l":return{x:e.left,y:i};case"c":return{x:s,y:i};case"r":return{x:e.right,y:i};case"bl":return{x:e.left,y:e.bottom};case"bc":return{x:s,y:e.bottom};case"br":return{x:e.right,y:e.bottom}}}function Fi(e){const t=2===e.length?e[1]:e;return"l"===t?-1:"r"===t?1:0}function Di(e){return 1===e.length?0:e.startsWith("t")?-1:e.startsWith("b")?1:0}var Ti=0,Ai=class extends Pt{constructor(){super(...arguments),this.beanName="popupSvc",this.popupList=[]}getPopupParent(){return this.gos.get("popupParent")||this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:s,nudgeY:i,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,e.type,e.ePopup,null,e.mouseEvent)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:o,eventSource:n,alignSide:r="left",position:a="over",type:l}=e,c=n.getBoundingClientRect(),d=this.getParentRect();this.setAlignedTo(n,t),this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:o,updatePosition:()=>{const s=Ei(c,d),o={width:t.offsetWidth,height:t.offsetHeight},n="right"===r;if("over"===a)return this.setAlignedStyles(t,"over"),Ii(s,o,n?"tr-tr":"tl-tl");if(this.setAlignedStyles(t,"under"),"under"===this.shouldRenderUnderOrAbove(t,c,d,e.nudgeY||0))return Ii(s,o,n?"tr-br":"tl-bl");const l=Ii(s,o,n?"br-tr":"bl-tl");return l.y-=2*(i||0),l},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,l,t,n,null)})}positionPopupForMenu(e){const{eventSource:t,ePopup:s,event:i}=e,o=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,s);let r=!1;this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:()=>{const e=Ei(o,n),t=this.keepXYWithinBounds(s,e.top,0),i=s.clientWidth>0?s.clientWidth:200;r||(s.style.minWidth=`${i}px`,r=!0);const a=n.right-n.left-i,l={width:i,height:s.offsetHeight},c=Ii(e,l,"tl-tr").x-2,d=Ii(e,l,"tr-tl").x;let u;return this.gos.get("enableRtl")?(u=d,u<0&&(u=c,this.setAlignedStyles(s,"left")),u>a&&(u=0,this.setAlignedStyles(s,"right"))):(u=c,u>a&&(u=d,this.setAlignedStyles(s,"right")),u<0&&(u=0,this.setAlignedStyles(s,"left"))),{x:u,y:t}},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",s,t,i instanceof KeyboardEvent?void 0:i)})}shouldRenderUnderOrAbove(e,t,s,i){const o=s.bottom-t.bottom,n=t.top-s.top,r=e.offsetHeight+i;return o>r?"under":n>r||n>o?"above":"under"}setAlignedStyles(e,t){const s=this.getPopupIndex(e);if(-1===s)return;const i=this.popupList[s],{alignedToElement:o}=i;if(!o)return;const n=["right","left","over","above","under"];for(const t of n)o.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`);t&&(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}setAlignedTo(e,t){const s=this.getPopupIndex(t);-1!==s&&(this.popupList[s].alignedToElement=e)}positionPopup(e){const{ePopup:t,keepWithinBounds:s,nudgeX:i,nudgeY:o,skipObserver:n,updatePosition:r}=e,a={width:0,height:0},l=(n=!1)=>{let{x:l,y:c}=r();n&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,i&&(l+=i),o&&(c+=o),s&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const e=tt(this.beans,t,(()=>l(!0)));setTimeout((()=>e()),200)}}getParentRect(){const e=$(this.beans);let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),Le(t)}keepXYWithinBounds(e,t,s){const i=0===s,o=i?"clientHeight":"clientWidth",n=i?"top":"left",r=i?"height":"width",a=i?"scrollTop":"scrollLeft",l=$(this.beans),c=l.documentElement,d=this.getPopupParent(),u=e.getBoundingClientRect(),h=d.getBoundingClientRect(),p=l.documentElement.getBoundingClientRect(),g=d===l.body,f=Math.ceil(u[r]);let m=g?(i?Me:Ne)(c)+c[a]:d[o];g&&(m-=Math.abs(p[n]-h[n]));const v=m-f;return Math.min(Math.max(t,0),Math.max(v,0))}addPopup(e){const{eChild:t,ariaLabel:s,ariaOwns:i,alwaysOnTop:o,positionCallback:n,anchorToElement:r}=e,a=this.getPopupIndex(t);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t),t.classList.add("ag-popup-child"),t.hasAttribute("role")||ee(t,"dialog"),s?se(t,s):i&&(t.id||(t.id=`popup-component-${Ti}`),Se(i,t.id));const l=at({tag:"div",cls:"ag-popup"});l.appendChild(t);const c=$t(this.beans.environment,this.getPopupParent(),l);o?this.setAlwaysOnTop(t,!0):this.bringPopupToFront(t);const d=this.addEventListenersToPopup({...e,wrapperEl:l,disconnect:c});return n&&n(),this.addPopupToPopupList(t,d,r),{hideFunc:d}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();B(e.style.top)||(e.style.top=-1*t.top+"px"),B(e.style.left)||(e.style.left=-1*t.left+"px")}addEventListenersToPopup(e){const t=this.beans,s=$(t),{wrapperEl:o,eChild:n,closedCallback:r,afterGuiAttached:a,closeOnEsc:l,modal:c,ariaOwns:d,eventSourceToIgnore:u}=e;let h=!1;const p=e=>{o.contains(U(t))&&(e.key!==i.ESCAPE||this.isStopPropagation(e)||m({keyboardEvent:e}))},g=e=>m({mouseEvent:e}),f=e=>m({touchEvent:e}),m=(t={})=>{const{mouseEvent:i,touchEvent:o,keyboardEvent:a,forceHide:l}=t,c=i??o,m="mousedown"===i?.type&&0===i.button||"touchstart"===o?.type;!l&&(this.isEventFromCurrentPopup({mouseEvent:i,touchEvent:o},n)||u&&m&&c&&ht(u,c)||h)||(h=!0,e.disconnect(),s.removeEventListener("keydown",p),s.removeEventListener("mousedown",g),s.removeEventListener("touchstart",f),s.removeEventListener("contextmenu",g),this.eventSvc.removeListener("dragStarted",g),r&&r(i||o||a),this.removePopupFromPopupList(n,d))};return a&&a({hidePopup:m}),window.setTimeout((()=>{l&&s.addEventListener("keydown",p),c&&(s.addEventListener("mousedown",g),this.eventSvc.addListener("dragStarted",g),s.addEventListener("touchstart",f),s.addEventListener("contextmenu",g))}),0),m}addPopupToPopupList(e,t,s){this.popupList.push({element:e,hideFunc:t,instanceId:Ti,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s),Ti+=1}getPopupIndex(e){return this.popupList.findIndex((t=>t.element===e))}setPopupPositionRelatedToElement(e,t){const s=this.getPopupIndex(e);if(-1===s)return;const i=this.popupList[s];if(i.stopAnchoringPromise&&i.stopAnchoringPromise.then((e=>e?.())),i.stopAnchoringPromise=void 0,i.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:i.hideFunc});return i.stopAnchoringPromise=o,i.isAnchored=!0,o}removePopupFromPopupList(e,t){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t&&Se(t,null),this.popupList=this.popupList.filter((t=>t.element!==e))}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),s=t.getBoundingClientRect(),{element:i,ePopup:o}=e,n=i.getBoundingClientRect(),r=e=>Number.parseInt(e.substring(0,e.length-1),10),a=(e,t)=>{const i=s[e]-n[e],a=r(o.style[e]);return{initialDiff:i,lastDiff:i,initial:a,last:a,direction:t}},l=a("top",0),c=a("left",1),d=this.beans.frameworkOverrides;return new x((s=>{d.wrapIncoming((()=>{var n;(n=()=>{const s=t.getBoundingClientRect(),n=i.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const a=(e,t)=>{const i=r(o.style[t]);e.last!==i&&(e.initial=i,e.last=i);const a=s[t]-n[t];if(a!=e.lastDiff){const s=this.keepXYWithinBounds(o,e.initial+e.initialDiff-a,e.direction);o.style[t]=`${s}px`,e.last=s}e.lastDiff=a};a(l,"top"),a(c,"left")},new x((e=>{e(window.setInterval(n,200))}))).then((e=>{s((()=>{null!=e&&window.clearInterval(e)}))}))}),"popupPositioning")}))}isEventFromCurrentPopup(e,t){const{mouseEvent:s,touchEvent:i}=e,o=s||i;if(!o)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++)if(ht(this.popupList[e].element,o))return!0;return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=$(this.beans);for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}getPopupRoot(e){const t=this.getPopupParent();let s=e;for(;s.parentElement&&s.parentElement!==t;)s=s.parentElement;return s}setAlwaysOnTop(e,t){const s=this.getWrapper(e);s&&(s.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(s))}bringPopupToFront(e){const t=this.getPopupParent(),s=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),i=s.length,o=this.getWrapper(e);if(!o||i<=1||!t.contains(e))return;const n=[],r=[];for(const e of s)e!==o&&(e.classList.contains("ag-always-on-top")?r.push(e):n.push(e));const a=[],l=r.length,c=o.classList.contains("ag-always-on-top")||!l?[...n,...r,o]:[...n,o,...r];for(let e=0;e<=i;e++){const i=c[e];if(s[e]===c[e]||i===o)continue;const n=i.querySelectorAll("div");for(const e of n)0!==e.scrollTop&&a.push([e,e.scrollTop]);0===e?t.prepend(this.getPopupRoot(i)):this.getPopupRoot(c[e-1]).after(this.getPopupRoot(i))}for(;a.length;){const e=a.pop();e[0].scrollTop=e[1]}}},Mi="ag-resizer-wrapper",Ni=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),Li={tag:"div",cls:Mi,children:[Ni("eTopLeft","topLeft"),Ni("eTop","top"),Ni("eTopRight","topRight"),Ni("eRight","right"),Ni("eBottomRight","bottomRight"),Ni("eBottom","bottom"),Ni("eBottomLeft","bottomLeft"),Ni("eLeft","left")]},Vi=class extends Pt{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:s}=this.offsetParent,i=s/2-this.getWidth()/2,o=t/2-this.getHeight()/2;this.offsetElement(i,o,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:s,minWidth:i,width:o,minHeight:n,height:r,x:a,y:l}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const u=Ge(this.element);if(u){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const s=e.offsetWidth-this.element.offsetWidth;d=Number.parseInt(t.minWidth,10)-s}if(null!=t.minHeight){const s=e.offsetHeight-this.element.offsetHeight;c=Number.parseInt(t.minHeight,10)-s}}if(this.minHeight=n||c,this.minWidth=i||d,o&&this.setWidth(o),r&&this.setHeight(r),o&&r||this.refreshSize(),t)this.center(e);else if(a||l)this.offsetElement(a,l,e);else if(u&&s){let t=this.boundaryEl,s=!0;if(t||(t=this.findBoundaryElement(),s=!1),t){const i=Number.parseFloat(t.style.top),o=Number.parseFloat(t.style.left);s?this.offsetElement(Number.isNaN(o)?0:o,Number.isNaN(i)?0:i,e):this.setPosition(o,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const s=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(s),this.moveElementDragListener=s):(this.dragSvc?.removeDragSource(s),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const s=!!e[t],i=this.getResizerElement(t),o={dragStartPixels:0,eElement:i,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragSvc?.addDragSource(o),this.resizeListeners.push(o),i.style.pointerEvents="all"):i.style.pointerEvents="none",this.resizable[t]=s)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,s=this.element;let i=!1;if("string"==typeof e&&e.includes("%"))Ze(s,e),e=Me(s),i=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}""!==s.style.height&&this.getHeight()===e||(i?(s.style.maxHeight="unset",s.style.minHeight="unset"):t?Ze(s,e):(s.style.height=`${e}px`,s.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:s}=this.offsetParent;if(!s)return null;const i=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:i.top,r=e?0:o.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-i.bottom}}return s+r-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:s}=this.config;let i=!1;if("string"==typeof e&&e.includes("%"))qe(t,e),e=Ne(t),i=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,i=s?this.position.x:this.element.getBoundingClientRect().left;t&&e+i>t&&(e=t-i)}this.getWidth()!==e&&(i?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?qe(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,s){const{forcePopupParentAsOffsetParent:i}=this.config,o=i?this.boundaryEl:this.element;o&&(this.popupSvc?.positionPopup({ePopup:o,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:s}),this.setPosition(Number.parseFloat(o.style.left),Number.parseFloat(o.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=tt(this.beans,this.popupSvc?.getPopupParent(),(()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)}))):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:s,isTop:i,anywhereWithin:o,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!s,!!o,r)?0:r,movementY:this.shouldSkipY(t,!!i,n,a)?0:a}}shouldSkipX(e,t,s,i){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:o.left;let l=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!l||(l=t?i<0&&e.clientX>a+n.left||i>0&&e.clientX<a+n.left:s?i<0&&e.clientX>r.right||i>0&&e.clientX<a+n.left:i<0&&e.clientX>r.right||i>0&&e.clientX<r.right,l)}shouldSkipY(e,t,s=0,i){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:o.top;let l=a<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!l||(l=t?i<0&&e.clientY>a+n.top+s||i>0&&e.clientY<a+n.top:i<0&&e.clientY>r.bottom||i>0&&e.clientY<r.bottom,l)}createResizeMap(){const e=e=>({element:this.element.querySelector(`[data-ref=${e}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(at(Li)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Mi}`);e?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:s,forcePopupParentAsOffsetParent:i}=this.config;s||i||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter((e=>!e.classList.contains("ag-hidden"))):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,s=0;for(const i of e){const e=!!i.style.flex&&"0 0 auto"!==i.style.flex;if(i===this.element)continue;let o=this.minHeight||0,n=this.minWidth||0;if(e){const e=window.getComputedStyle(i);e.minHeight&&(o=Number.parseInt(e.minHeight,10)),e.minWidth&&(n=Number.parseInt(e.minWidth,10))}else o=i.offsetHeight,n=i.offsetWidth;t+=o,s+=n}return{height:t,width:s}}applySizeToSiblings(e){let t=null;const s=this.getSiblings();if(s){for(let i=0;i<s.length;i++){const o=s[i];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=s[i+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some((e=>e))}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:s}=this.config,{isTop:i,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,a=o||r,l=n||i,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:r,isTop:i}),u=this.position.x,h=this.position.y;let p=0,g=0;if(a&&c){const e=r?-1:1,t=this.getWidth(),s=t+c*e;let i=!1;r&&(p=t-s,(u+p<=0||s<=this.minWidth)&&(i=!0,p=0)),i||this.setWidth(s)}if(l&&d){const e=i?-1:1,t=this.getHeight(),s=t+d*e;let o=!1;i?(g=t-s,(h+g<=0||s<=this.minHeight)&&(o=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<s&&this.getMinSizeOfSiblings().height+s>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(s)}this.updateDragStartPosition(e.clientX,e.clientY),((t||s)&&p||g)&&this.offsetElement(u+p,h+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:s}=this.position;let i;this.config.calculateTopBuffer&&(i=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:i});this.offsetElement(t+o,s+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},_i=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1),this.getTopOffset=e.getTopOffset||(()=>0),this.getBottomOffset=e.getBottomOffset||(()=>0)}get scrolling(){return null!==this.tickingInterval}check(e,t=!1){const s=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),i=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(s&&i)return;const o=this.scrollContainer.getBoundingClientRect(),n=this.scrollByTick,r=this.getTopOffset(),a=this.getBottomOffset();this.tickLeft=!i&&e.clientX<o.left+n,this.tickRight=!i&&e.clientX>o.right-n,this.tickUp=!s&&e.clientY<o.top+r+n,this.tickDown=!s&&e.clientY>o.bottom-a-n,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Oi=class extends Pt{constructor(e,t){super(),this.ctrl=e,this.getLatestTooltip=()=>(this.updateTooltipText(),this.tooltip),t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){const s="title",i=this.ctrl.getGui();i&&(null==e||""==e&&!t?i.removeAttribute(s):i.setAttribute(s,e))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){if(null==this.tooltipManager){const e=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,this.getLatestTooltip);e&&(this.tooltipManager=this.createBean(e,this.beans.context))}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(e){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips");const t=this.tooltipManager;t?.isShowing()&&t.hideTooltip(!0),this.browserTooltips?(this.updateTooltipText(),this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)):(this.setBrowserTooltip(e?"":null,e),this.createTooltipFeatureIfNeeded())}destroy(){this.setBrowserTooltip(null),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},Bi=new WeakMap,Hi=0,Gi=class extends Pt{constructor(e,t){super(),this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1,this.showEventDispatched=!1}wireBeans(e){this.popupSvc=e.popupSvc}getPopupPositionParams(){}postConstruct(){let e=Bi.get(this.gos);e||(e={},Bi.set(this.gos,e)),this.sharedState=e,this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.tooltipCtrl.getGui();0===this.tooltipTrigger&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.interactionEnabled&&1!==this.tooltipTrigger&&this.addManagedListeners(t,{focusout:this.onFocusOut.bind(this)}),this.interactionEnabled&&this.addManagedListeners(t,{keydown:this.onInteractiveSourceKeyDown.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getTooltipDelay(e){const t=this.tooltipCtrl[`getTooltip${e}DelayOverride`]?.()??this.gos.get(`tooltip${e}Delay`);return Math.max(0,t)}destroy(){this.hideTooltip(!0),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}isShowing(){return 2===this.state}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout());const t=e.sourceCapabilities?.firesTouchEvents;cs()||t||(this.isLocked()?this.showTooltipTimeoutId=window.setTimeout((()=>{this.prepareToShowTooltip(e)}),100):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled&&2===this.state?this.lockService():this.setToDoNothing()}onFocusIn(){!1!==this.tooltipCtrl.shouldDisplayTooltipOnFocus?.()&&this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,s=this.tooltipCtrl.getGui(),i=this.tooltipComp?.getGui();this.isInteractingWithTooltip||s.contains(t)||this.interactionEnabled&&i?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e,t){if(0!=this.state||this.isLocked())return;let s=null==t?0:Math.max(0,t);e&&null==t&&(s=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),s),this.state=1}canShowTooltip(){return B(this.getTooltipValue())&&(!this.tooltipCtrl.shouldDisplayTooltip||this.tooltipCtrl.shouldDisplayTooltip())}isLastTooltipHiddenRecently(){const e=Date.now(),t=this.sharedState.lastHideTime;return null!=t&&e-t<1e3}setToDoNothing(e){e||2!==this.state||this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.clearEventHandlers(),this.onDocumentKeyDownCallback&&(this.onDocumentKeyDownCallback(),this.onDocumentKeyDownCallback=void 0),this.onDocumentTouchStartCallback&&(this.onDocumentTouchStartCallback(),this.onDocumentTouchStartCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=this.getTooltipValue(),t=this.tooltipCtrl;if(!B(e)||t.shouldDisplayTooltip&&!t.shouldDisplayTooltip())return void this.setToDoNothing();const s=this.gos.addCommon({location:t.getLocation?.()??"UNKNOWN",value:e,hideTooltipCallback:()=>this.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(s,i)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),this.sharedState.lastHideTime=Date.now()),this.showEventDispatched&&(this.showEventDispatched=!1,this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()})),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const s=t.getGui();this.tooltipComp=t,s.classList.contains("ag-tooltip")||s.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&s.classList.add("ag-tooltip-animate"),this.interactionEnabled&&s.classList.add("ag-tooltip-interactive"),s.hasAttribute("role")||ee(s,this.interactionEnabled?"dialog":"tooltip"),this.connectAriaDescription(s);const i=this.getLocaleTextFunc(),o=this.popupSvc?.addPopup({eChild:s,...this.interactionEnabled?{ariaLabel:i("ariaLabelTooltip","Tooltip")}:{ariaOwns:this.tooltipCtrl.getGui()}});if(o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=()=>this.hideTooltip(!0);[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:e}),this.setEventHandlers(e)}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(s,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners($(this.beans),{keydown:e=>{e&&this.onDocumentKeyDown(e,s)}}),[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(s,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)})),[this.onDocumentTouchStartCallback]=this.addManagedElementListeners($(this.beans),{touchstart:e=>{e&&!s.contains(e.target)&&this.hideTooltip(!0)}}),this.showEventDispatched=!0,this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:s,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}connectAriaDescription(e){e.id||(e.id="ag-tooltip-"+ ++Hi);const t=e.id,s=this.tooltipCtrl.getGui(),i=s.getAttribute("aria-describedby")?.split(/\s+/).filter(Boolean)??[];i.includes(t)||s.setAttribute("aria-describedby",[...i,t].join(" ")),this.describedById=t,this.describedBySource=s}disconnectAriaDescription(){const e=this.describedById,t=this.describedBySource;if(!e||!t)return;this.describedById=void 0,this.describedBySource=void 0;const s=t.getAttribute("aria-describedby")?.split(/\s+/).filter((t=>t&&t!==e));s?.length?t.setAttribute("aria-describedby",s.join(" ")):t.removeAttribute("aria-describedby")}onDocumentKeyDown(e,t){const s=this.tooltipCtrl.getGui();if("Escape"===e.key){const i=e.target,o=t.contains(i);return(o||s.contains(i))&&(e.preventDefault(),e.stopPropagation()),o&&s.isConnected&&s.focus({preventScroll:!0}),void this.hideTooltip(!0)}if("Tab"===e.key&&s.contains(e.target)){const s=pi(t),i=e.shiftKey?s.at(-1):s[0];if(i)return e.preventDefault(),this.isInteractingWithTooltip=!0,void i.focus()}t.contains(e.target)||this.onKeyDown()}onInteractiveSourceKeyDown(e){if(2!==this.state||!this.tooltipComp)return;if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void this.hideTooltip(!0);if("Tab"!==e.key)return;const t=pi(this.tooltipComp.getGui()),s=e.shiftKey?t.at(-1):t[0];s&&(e.preventDefault(),e.stopPropagation(),this.isInteractingWithTooltip=!0,s.focus())}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){const e=this.tooltipComp?.getGui(),t=U(this.beans);return!!e&&e.contains(t)}onTooltipFocusOut(e){const t=this.tooltipCtrl.getGui(),s=this.tooltipComp?.getGui(),i=e.relatedTarget;this.isTooltipFocused()||s?.contains(i)||(this.isInteractingWithTooltip=!1,t.contains(i)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack,additionalParams:this.getPopupPositionParams()};this.lastMouseEvent?this.popupSvc?.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupSvc?.positionPopupByComponent({...e,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.disconnectAriaDescription();const e=this.tooltipComp.getGui();e.classList.remove("ag-tooltip-interactive"),e.classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,s=this.tooltipComp,i=0===this.tooltipTrigger?1e3:0;window.setTimeout((()=>{t?.(),this.destroyBean(s)}),i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(const e of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])e&&e();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){this.sharedState.lockOwner=this,this.interactiveTooltipTimeoutId=window.setTimeout((()=>{this.unlockService(),this.setToDoNothing()}),100)}unlockService(){this.sharedState.lockOwner===this&&(this.sharedState.lockOwner=void 0),this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0,this.sharedState.lockOwner===this&&(this.sharedState.lockOwner=void 0))}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}isLocked(){return null!=this.sharedState.lockOwner}},zi=class extends Oi{constructor(e,t,s){super(e,s),this.highlightTracker=t,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",(({currentValue:e})=>{this.setTooltipMode(e)})),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(e){1===this.tooltipMode&&(e.highlighted?this.attemptToShowTooltip():this.attemptToHideTooltip())}setTooltipMode(e="focus"){this.tooltipMode="focus"===e?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},Wi=/[&<>"']/g,ji={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ui(e){return e?.toString().toString()??null}function $i(e){return Ui(e)?.replace(Wi,(e=>ji[e]))??null}function Yi(e,t,s){return"string"==typeof e&&(s&&(e=e.trim()),"string"==typeof e&&e.length>t)}function Ki(e){return Yi(e,1)&&61===e.codePointAt(0)}function qi(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map((e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):""))).join(" "):null}var Zi=class extends Pi{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){const{value:t}=e,s=this.getGui();s.textContent=Ui(t);const i=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();s.classList.add(`ag-${i}-tooltip`)}},Qi=e=>{if("bigint"==typeof e)return e;let t;if("number"==typeof e)t=e;else if("string"==typeof e){if(t=e.trim(),""===t)return null;if(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))return null}if(null==t)return null;try{return BigInt(t)}catch{return null}},Ji="T",Xi=new RegExp(`[${Ji} ]`),eo=new RegExp(`^\\d{4}-\\d{2}-\\d{2}([${Ji} ]\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}(:?\\d{2})?)?)?$`);function to(e,t){return e.toString().padStart(t,"0")}function so(e,t=!0,s=Ji){if(!e)return null;let i=[to(e.getFullYear(),4),to(e.getMonth()+1,2),to(e.getDate(),2)].join("-");return t&&(i+=s+[e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>to(e,2))).join(":")),i}function io(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),to(e.getDate(),2),to(e.getHours(),2),`:${to(e.getMinutes(),2)}`,`:${to(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,to(e.getDate(),2)].map(String):null}var oo=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},no=["January","February","March","April","May","June","July","August","September","October","November","December"],ro=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ao(e,t){if(null==t)return so(e,!1);const s=to(e.getFullYear(),4),i={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>no[e.getMonth()],MMM:()=>no[e.getMonth()].slice(0,3),MM:()=>to(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${oo(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${oo(e.getDate())}`,DD:()=>to(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>ro[e.getDay()],ddd:()=>ro[e.getDay()].slice(0,3),dd:()=>ro[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${oo(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(i).join("|"),"g");return t.replace(o,(e=>e in i?i[e]():e))}function lo(e,t=!1){return!!uo(e,t)}function co(e){return lo(e,!0)}function uo(e,t=!1,s){if(!e)return null;if(!s&&!eo.test(e))return null;const[i,o]=e.split(Xi);if(!i)return null;const n=i.split("-").map((e=>Number.parseInt(e,10)));if(3!==n.filter((e=>!isNaN(e))).length)return null;const[r,a,l]=n,c=new Date(r,a-1,l);if(r>=0&&r<100&&c.setFullYear(r,a-1,l),c.getFullYear()!==r||c.getMonth()!==a-1||c.getDate()!==l)return null;if(!o&&t)return null;if(!o||"00:00:00"===o)return c;const[d,u,h]=o.split(":").map((e=>Number.parseInt(e,10)));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(u>=0&&u<60)c.setMinutes(u);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function ho(e,t){const s=document.defaultView??window;if(!s)return;const i=document.createElement("a"),o=s.URL.createObjectURL(t);i.setAttribute("href",o),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:s})),i.remove(),s.setTimeout((()=>{s.URL.revokeObjectURL(o)}),0)}function po(e){const{inputValue:t,allSuggestions:s,hideIrrelevant:i,maxSuggestions:o}=e;let n=(s??[]).map(((e,s)=>({value:e,relevance:go(t,e),idx:s})));n.sort(((e,t)=>e.relevance-t.relevance)),i&&(n=n.filter((e=>e.relevance<Math.max(e.value.length,t.length)))),null!=o&&o>0&&(n=n.slice(0,o));const r=[],a=[];for(const e of n)r.push(e.value),a.push(e.idx);return{values:r,indices:a}}function go(e,t){const s=e.length,i=t.length;if(0===i)return s||0;let o,n=e.toLocaleLowerCase(),r=t.toLocaleLowerCase();if(s>0){const e=r.indexOf(n);if(e>=0)return.01*e}e.length<t.length&&(o=r,r=n,n=o,o=t,t=e,e=o);let a=new Uint16Array(i+1),l=new Uint16Array(i+1);for(let e=0;e<=i;e++)a[e]=e;let c=0;const d=s/2-10;for(let u=1;u<=s;u++){const s=e[u-1],h=n[u-1];l[0]=u;for(let o=1;o<=i;o++){const i=t[o-1];if(h===r[o-1]){if(c++,s===i&&c++,u>1&&o>1){const s=e[u-2],i=n[u-2],a=t[o-2];i===r[o-2]&&(c++,s===a&&c++)}u<d&&c++,l[o]=a[o-1]}else{const e=l[o-1],t=a[o],s=a[o-1];let i=e<t?e:t;s<i&&(i=s),l[o]=i+1|0}}o=a,a=l,l=o}return a[i]/(c+1)}function fo(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key?.length}function mo(e,t){const s=t.split(".");let i=e;for(let e=0;e<s.length;e++){if(null==i)return;i=i[s[e]]}return i}},16924:(e,t,s)=>{s.d(t,{ry:()=>oi});var i,o,n,r,a,l,c="vercel.ai.error",d=Symbol.for(c),u=class e extends(o=Error,i=d,o){constructor({name:e,message:t,cause:s}){super(t),this[i]=!0,this.name=e,this.cause=s}static isInstance(t){return e.hasMarker(t,c)}static hasMarker(e,t){const s=Symbol.for(t);return null!=e&&"object"==typeof e&&s in e&&"boolean"==typeof e[s]&&!0===e[s]}},h="AI_APICallError",p=`vercel.ai.error.${h}`,g=Symbol.for(p),f=class extends(r=u,n=g,r){constructor({message:e,url:t,requestBodyValues:s,statusCode:i,responseHeaders:o,responseBody:r,cause:a,isRetryable:l=null!=i&&(408===i||409===i||429===i||i>=500),data:c}){super({name:h,message:e,cause:a}),this[n]=!0,this.url=t,this.requestBodyValues=s,this.statusCode=i,this.responseHeaders=o,this.responseBody=r,this.isRetryable=l,this.data=c}static isInstance(e){return u.hasMarker(e,p)}},m="AI_EmptyResponseBodyError",v=`vercel.ai.error.${m}`,w=Symbol.for(v),C=class extends(l=u,a=w,l){constructor({message:e="Empty response body"}={}){super({name:m,message:e}),this[a]=!0}static isInstance(e){return u.hasMarker(e,v)}};function y(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var b,S,x,R,P,E,I,k,F,D,T,A,M,N,L,V,_="AI_InvalidArgumentError",O=`vercel.ai.error.${_}`,B=Symbol.for(O),H=class extends(S=u,b=B,S){constructor({message:e,cause:t,argument:s}){super({name:_,message:e,cause:t}),this[b]=!0,this.argument=s}static isInstance(e){return u.hasMarker(e,O)}},G="AI_InvalidPromptError",z=`vercel.ai.error.${G}`,W=Symbol.for(z),j=class extends(R=u,x=W,R){constructor({prompt:e,message:t,cause:s}){super({name:G,message:`Invalid prompt: ${t}`,cause:s}),this[x]=!0,this.prompt=e}static isInstance(e){return u.hasMarker(e,z)}},U="AI_InvalidResponseDataError",$=`vercel.ai.error.${U}`,Y=Symbol.for($),K=class extends(E=u,P=Y,E){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:U,message:t}),this[P]=!0,this.data=e}static isInstance(e){return u.hasMarker(e,$)}},q="AI_JSONParseError",Z=`vercel.ai.error.${q}`,Q=Symbol.for(Z),J=class extends(k=u,I=Q,k){constructor({text:e,cause:t}){super({name:q,message:`JSON parsing failed: Text: ${e}.\nError message: ${y(t)}`,cause:t}),this[I]=!0,this.text=e}static isInstance(e){return u.hasMarker(e,Z)}},X="AI_LoadAPIKeyError",ee=`vercel.ai.error.${X}`,te=Symbol.for(ee),se=class extends(D=u,F=te,D){constructor({message:e}){super({name:X,message:e}),this[F]=!0}static isInstance(e){return u.hasMarker(e,ee)}},ie=Symbol.for("vercel.ai.error.AI_LoadSettingError"),oe=`vercel.ai.error.${"AI_NoContentGeneratedError"}`,ne=Symbol.for(oe),re=`vercel.ai.error.${"AI_NoSuchModelError"}`,ae=Symbol.for(re),le="AI_TooManyEmbeddingValuesForCallError",ce=`vercel.ai.error.${le}`,de=Symbol.for(ce),ue=class extends(A=u,T=de,A){constructor(e){super({name:le,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[T]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return u.hasMarker(e,ce)}},he="AI_TypeValidationError",pe=`vercel.ai.error.${he}`,ge=Symbol.for(pe),fe=class e extends(N=u,M=ge,N){constructor({value:e,cause:t}){super({name:he,message:`Type validation failed: Value: ${JSON.stringify(e)}.\nError message: ${y(t)}`,cause:t}),this[M]=!0,this.value=e}static isInstance(e){return u.hasMarker(e,pe)}static wrap({value:t,cause:s}){return e.isInstance(s)&&s.value===t?s:new e({value:t,cause:s})}},me="AI_UnsupportedFunctionalityError",ve=`vercel.ai.error.${me}`,we=Symbol.for(ve),Ce=class extends(V=u,L=we,V){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:me,message:t}),this[L]=!0,this.functionality=e}static isInstance(e){return u.hasMarker(e,ve)}},ye=s(58750),be=s(9364),Se=s(33868),xe=s(24730),Re=s(15088).process;function Pe(...e){return e.reduce(((e,t)=>({...e,...null!=t?t:{}})),{})}function Ee(e){return Object.fromEntries([...e.headers])}var{btoa:Ie,atob:ke}=globalThis;function Fe(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),s=ke(t);return Uint8Array.from(s,(e=>e.codePointAt(0)))}function De(e){return e instanceof Uint8Array?function(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCodePoint(e[s]);return Ie(t)}(e):e}function Te(e,t={}){const{useArrayBrackets:s=!0}=t,i=new FormData;for(const[t,o]of Object.entries(e))if(null!=o)if(Array.isArray(o)){if(1===o.length){i.append(t,o[0]);continue}const e=s?`${t}[]`:t;for(const t of o)i.append(e,t)}else i.append(t,o);return i}var Ae,Me,Ne="AI_DownloadError",Le=`vercel.ai.error.${Ne}`,Ve=Symbol.for(Le),_e=class extends(Me=u,Ae=Ve,Me){constructor({url:e,statusCode:t,statusText:s,cause:i,message:o=(null==i?`Failed to download ${e}: ${t} ${s}`:`Failed to download ${e}: ${i}`)}){super({name:Ne,message:o,cause:i}),this[Ae]=!0,this.url=e,this.statusCode=t,this.statusText=s}static isInstance(e){return u.hasMarker(e,Le)}};async function Oe(e){try{const t=await fetch(e);if(!t.ok)throw new _e({url:e,statusCode:t.status,statusText:t.statusText});return await t.blob()}catch(t){if(_e.isInstance(t))throw t;throw new _e({url:e,cause:t})}}var Be=(({prefix:e,size:t=16,alphabet:s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:i="-"}={})=>{const o=()=>{const e=s.length,i=new Array(t);for(let o=0;o<t;o++)i[o]=s[Math.random()*e|0];return i.join("")};if(null==e)return o;if(s.includes(i))throw new H({argument:"separator",message:`The separator "${i}" must not be part of the alphabet "${s}".`});return()=>`${e}${i}${o()}`})();function He(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var Ge=["fetch failed","failed to fetch"];function ze(e=globalThis){var t,s,i;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(i=null==(s=e.process)?void 0:s.versions)?void 0:i.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function We(e,...t){const s=new Headers(function(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,s)=>{t[s.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[s,i]of e)null!=i&&(t[s.toLowerCase()]=i)}return t}(e)),i=s.get("user-agent")||"";return s.set("user-agent",[i,...t].filter(Boolean).join(" ")),Object.fromEntries(s.entries())}function je(e){return null!=e}function Ue({apiKey:e,environmentVariableName:t,apiKeyParameterName:s="apiKey",description:i}){if("string"==typeof e)return e;if(null!=e)throw new se({message:`${i} API key must be a string.`});if(void 0===Re)throw new se({message:`${i} API key is missing. Pass it using the '${s}' parameter. Environment variables is not supported in this environment.`});if(null==(e=Re.env[t]))throw new se({message:`${i} API key is missing. Pass it using the '${s}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new se({message:`${i} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}var $e=/"__proto__"\s*:/,Ye=/"constructor"\s*:/;function Ke(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===$e.test(e)&&!1===Ye.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const s of e){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in s){const i=s[e];i&&"object"==typeof i&&t.push(i)}}}return e}(t)}function qe(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return Ke(e)}try{return Ke(e)}finally{Error.stackTraceLimit=t}}function Ze(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=Qe(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(Qe):Qe(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(Qe)),null!=e.allOf&&(e.allOf=e.allOf.map(Qe)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(Qe));const{definitions:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=Qe(t[e]);return e}function Qe(e){return"boolean"==typeof e?e:Ze(e)}var Je=Symbol("Let zodToJsonSchema decide on which parser to use"),Xe={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function et(e,t){return mt(e.type._def,t)}function tt(e,t,s){const i=null!=s?s:t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map(((s,i)=>tt(e,t,s)))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return st(e)}}var st=e=>{const t={type:"integer",format:"unix-time"};for(const s of e.checks)switch(s.kind){case"min":t.minimum=s.value;break;case"max":t.maximum=s.value}return t},it=void 0,ot={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===it&&(it=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),it),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function nt(e,t){const s={type:"string"};if(e.checks)for(const i of e.checks)switch(i.kind){case"min":s.minLength="number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value;break;case"max":s.maxLength="number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value;break;case"email":switch(t.emailStrategy){case"format:email":lt(s,"email",i.message,t);break;case"format:idn-email":lt(s,"idn-email",i.message,t);break;case"pattern:zod":ct(s,ot.email,i.message,t)}break;case"url":lt(s,"uri",i.message,t);break;case"uuid":lt(s,"uuid",i.message,t);break;case"regex":ct(s,i.regex,i.message,t);break;case"cuid":ct(s,ot.cuid,i.message,t);break;case"cuid2":ct(s,ot.cuid2,i.message,t);break;case"startsWith":ct(s,RegExp(`^${rt(i.value,t)}`),i.message,t);break;case"endsWith":ct(s,RegExp(`${rt(i.value,t)}$`),i.message,t);break;case"datetime":lt(s,"date-time",i.message,t);break;case"date":lt(s,"date",i.message,t);break;case"time":lt(s,"time",i.message,t);break;case"duration":lt(s,"duration",i.message,t);break;case"length":s.minLength="number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,s.maxLength="number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value;break;case"includes":ct(s,RegExp(rt(i.value,t)),i.message,t);break;case"ip":"v6"!==i.version&&lt(s,"ipv4",i.message,t),"v4"!==i.version&&lt(s,"ipv6",i.message,t);break;case"base64url":ct(s,ot.base64url,i.message,t);break;case"jwt":ct(s,ot.jwt,i.message,t);break;case"cidr":"v6"!==i.version&&ct(s,ot.ipv4Cidr,i.message,t),"v4"!==i.version&&ct(s,ot.ipv6Cidr,i.message,t);break;case"emoji":ct(s,ot.emoji(),i.message,t);break;case"ulid":ct(s,ot.ulid,i.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":lt(s,"binary",i.message,t);break;case"contentEncoding:base64":s.contentEncoding="base64";break;case"pattern:zod":ct(s,ot.base64,i.message,t)}break;case"nanoid":ct(s,ot.nanoid,i.message,t)}return s}function rt(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let s=0;s<e.length;s++)at.has(e[s])||(t+="\\"),t+=e[s];return t}(e):e}var at=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function lt(e,t,s,i){var o;e.format||(null==(o=e.anyOf)?void 0:o.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...s&&i.errorMessages&&{errorMessage:{format:s}}})):e.format=t}function ct(e,t,s,i){var o;e.pattern||(null==(o=e.allOf)?void 0:o.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:dt(t,i),...s&&i.errorMessages&&{errorMessage:{pattern:s}}})):e.pattern=dt(t,i)}function dt(e,t){var s;if(!t.applyRegexFlags||!e.flags)return e.source;const i=e.flags.includes("i"),o=e.flags.includes("m"),n=e.flags.includes("s"),r=i?e.source.toLowerCase():e.source;let a="",l=!1,c=!1,d=!1;for(let e=0;e<r.length;e++)if(l)a+=r[e],l=!1;else{if(i)if(c){if(r[e].match(/[a-z]/)){d?(a+=r[e],a+=`${r[e-2]}-${r[e]}`.toUpperCase(),d=!1):"-"===r[e+1]&&(null==(s=r[e+2])?void 0:s.match(/[a-z]/))?(a+=r[e],d=!0):a+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){a+=`[${r[e]}${r[e].toUpperCase()}]`;continue}if(o){if("^"===r[e]){a+="(^|(?<=[\r\n]))";continue}if("$"===r[e]){a+="($|(?=[\r\n]))";continue}}n&&"."===r[e]?a+=c?`${r[e]}\r\n`:`[${r[e]}\r\n]`:(a+=r[e],"\\"===r[e]?l=!0:c&&"]"===r[e]?c=!1:c||"["!==r[e]||(c=!0))}try{new RegExp(a)}catch(s){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function ut(e,t){var s,i,o,n,r,a;const l={type:"object",additionalProperties:null!=(s=mt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?s:t.allowedAdditionalProperties};if((null==(i=e.keyType)?void 0:i._def.typeName)===Se.kY.ZodString&&(null==(o=e.keyType._def.checks)?void 0:o.length)){const{type:s,...i}=nt(e.keyType._def,t);return{...l,propertyNames:i}}if((null==(n=e.keyType)?void 0:n._def.typeName)===Se.kY.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(r=e.keyType)?void 0:r._def.typeName)===Se.kY.ZodBranded&&e.keyType._def.type._def.typeName===Se.kY.ZodString&&(null==(a=e.keyType._def.type._def.checks)?void 0:a.length)){const{type:s,...i}=et(e.keyType._def,t);return{...l,propertyNames:i}}return l}var ht={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function pt(e){try{return e.isOptional()}catch(e){return!0}}var gt=(e,t,s)=>{switch(t){case Se.kY.ZodString:return nt(e,s);case Se.kY.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"int":t.type="integer";break;case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value}return t}(e);case Se.kY.ZodObject:return function(e,t){const s={type:"object",properties:{}},i=[],o=e.shape();for(const e in o){let n=o[e];if(void 0===n||void 0===n._def)continue;const r=pt(n),a=mt(n._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==a&&(s.properties[e]=a,r||i.push(e))}i.length&&(s.required=i);const n=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return mt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==n&&(s.additionalProperties=n),s}(e,s);case Se.kY.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value}return t}(e);case Se.kY.ZodBoolean:return{type:"boolean"};case Se.kY.ZodDate:return tt(e,s);case Se.kY.ZodUndefined:return{not:{}};case Se.kY.ZodNull:return{type:"null"};case Se.kY.ZodArray:return function(e,t){var s,i,o;const n={type:"array"};return(null==(s=e.type)?void 0:s._def)&&(null==(o=null==(i=e.type)?void 0:i._def)?void 0:o.typeName)!==Se.kY.ZodAny&&(n.items=mt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}(e,s);case Se.kY.ZodUnion:case Se.kY.ZodDiscriminatedUnion:return function(e,t){const s=e.options instanceof Map?Array.from(e.options.values()):e.options;if(s.every((e=>e._def.typeName in ht&&(!e._def.checks||!e._def.checks.length)))){const e=s.reduce(((e,t)=>{const s=ht[t._def.typeName];return s&&!e.includes(s)?[...e,s]:e}),[]);return{type:e.length>1?e:e[0]}}if(s.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=s.reduce(((e,t)=>{const s=typeof t._def.value;switch(s){case"string":case"number":case"boolean":return[...e,s];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===s.length){const t=e.filter(((e,t,s)=>s.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:s.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(s.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:s.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const s=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,s)=>mt(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return s.length?{anyOf:s}:void 0})(e,t)}(e,s);case Se.kY.ZodIntersection:return function(e,t){const s=[mt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),mt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),i=[];return s.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:s,...i}=e;t=i}i.push(t)}else i.push(...e.allOf);var t})),i.length?{allOf:i}:void 0}(e,s);case Se.kY.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,s)=>mt(e._def,{...t,currentPath:[...t.currentPath,"items",`${s}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:mt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,s)=>mt(e._def,{...t,currentPath:[...t.currentPath,"items",`${s}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,s);case Se.kY.ZodRecord:return ut(e,s);case Se.kY.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case Se.kY.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case Se.kY.ZodNativeEnum:return function(e){const t=e.values,s=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),i=Array.from(new Set(s.map((e=>typeof e))));return{type:1===i.length?"string"===i[0]?"string":"number":["string","number"],enum:s}}(e);case Se.kY.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ht[e.innerType._def.typeName],"null"]};const s=mt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return s&&{anyOf:[s,{type:"null"}]}}(e,s);case Se.kY.ZodOptional:return((e,t)=>{var s;if(t.currentPath.toString()===(null==(s=t.propertyPath)?void 0:s.toString()))return mt(e.innerType._def,t);const i=mt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:{}},i]}:{}})(e,s);case Se.kY.ZodMap:return function(e,t){return"record"===t.mapStrategy?ut(e,t):{type:"array",maxItems:125,items:{type:"array",items:[mt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},mt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,s);case Se.kY.ZodSet:return function(e,t){const s={type:"array",uniqueItems:!0,items:mt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(s.minItems=e.minSize.value),e.maxSize&&(s.maxItems=e.maxSize.value),s}(e,s);case Se.kY.ZodLazy:return()=>e.getter()._def;case Se.kY.ZodPromise:return function(e,t){return mt(e.type._def,t)}(e,s);case Se.kY.ZodNaN:case Se.kY.ZodNever:return{not:{}};case Se.kY.ZodEffects:return function(e,t){return"input"===t.effectStrategy?mt(e.schema._def,t):{}}(e,s);case Se.kY.ZodAny:case Se.kY.ZodUnknown:return{};case Se.kY.ZodDefault:return function(e,t){return{...mt(e.innerType._def,t),default:e.defaultValue()}}(e,s);case Se.kY.ZodBranded:return et(e,s);case Se.kY.ZodReadonly:case Se.kY.ZodCatch:return((e,t)=>mt(e.innerType._def,t))(e,s);case Se.kY.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return mt(e.in._def,t);if("output"===t.pipeStrategy)return mt(e.out._def,t);const s=mt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[s,mt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",s?"1":"0"]})].filter((e=>void 0!==e))}})(e,s);case Se.kY.ZodFunction:case Se.kY.ZodVoid:case Se.kY.ZodSymbol:default:return}},ft=(e,t)=>{let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];s++);return[(e.length-s).toString(),...t.slice(s)].join("/")};function mt(e,t,s=!1){var i;const o=t.seen.get(e);if(t.override){const n=null==(i=t.override)?void 0:i.call(t,e,t,o,s);if(n!==Je)return n}if(o&&!s){const e=vt(o,t);if(void 0!==e)return e}const n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);const r=gt(e,e.typeName,t),a="function"==typeof r?mt(r(),t):r;if(a&&wt(e,t,a),t.postProcess){const s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}var vt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ft(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,s)=>t.currentPath[s]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},wt=(e,t,s)=>(e.description&&(s.description=e.description),s),Ct=(e,t)=>{var s;const i=(e=>{const t=(e=>"string"==typeof e?{...Xe,name:e}:{...Xe,...e})(e),s=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:s,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let o="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,s])=>{var o;return{...e,[t]:null!=(o=mt(s._def,{...i,currentPath:[...i.basePath,i.definitionPath,t]},!0))?o:{}}}),{}):void 0;const n="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,r=null!=(s=mt(e._def,void 0===n?i:{...i,currentPath:[...i.basePath,i.definitionPath,n]},!1))?s:{},a="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==a&&(r.title=a);const l=void 0===n?o?{...r,[i.definitionPath]:o}:r:{$ref:[..."relative"===i.$refStrategy?[]:i.basePath,i.definitionPath,n].join("/"),[i.definitionPath]:{...o,[n]:r}};return l.$schema="http://json-schema.org/draft-07/schema#",l},yt=Symbol.for("vercel.ai.schema");function bt(e){let t;return()=>(null==t&&(t=e()),t)}function St(e,{validate:t}={}){return{[yt]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function xt(e,t){return function(e){return"_zod"in e}(e)?function(e,t){var s;const i=null!=(s=null==t?void 0:t.useReferences)&&s;return St((()=>Ze(ye.b(e,{target:"draft-7",io:"input",reused:i?"ref":"inline"}))),{validate:async t=>{const s=await be.bp(e,t);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}(e,t):function(e,t){var s;const i=null!=(s=null==t?void 0:t.useReferences)&&s;return St((()=>Ct(e,{$refStrategy:i?"root":"none"})),{validate:async t=>{const s=await e.safeParseAsync(t);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}(e,t)}async function Rt({value:e,schema:t}){const s=await Pt({value:e,schema:t});if(!s.success)throw fe.wrap({value:e,cause:s.error});return s.value}async function Pt({value:e,schema:t}){const s=function(e){return null==e?St({properties:{},additionalProperties:!1}):"object"==typeof(s=e)&&null!==s&&yt in s&&!0===s[yt]&&"jsonSchema"in s&&"validate"in s?e:"~standard"in e?"zod"===e["~standard"].vendor?xt(e):(t=e,St((()=>Ze(t["~standard"].jsonSchema.input({target:"draft-07"}))),{validate:async e=>{const s=await t["~standard"].validate(e);return"value"in s?{success:!0,value:s.value}:{success:!1,error:new fe({value:e,cause:s.issues})}}})):e();var t,s}(t);try{if(null==s.validate)return{success:!0,value:e,rawValue:e};const t=await s.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:fe.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:fe.wrap({value:e,cause:t}),rawValue:e}}}async function Et({text:e,schema:t}){try{const s=qe(e);return null==t?{success:!0,value:s,rawValue:s}:await Pt({value:s,schema:t})}catch(t){return{success:!1,error:J.isInstance(t)?t:new J({text:e,cause:t}),rawValue:void 0}}}function It(e){try{return qe(e),!0}catch(e){return!1}}function kt({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new xe.Z).pipeThrough(new TransformStream({async transform({data:e},s){"[DONE]"!==e&&s.enqueue(await Et({text:e,schema:t}))}}))}async function Ft({provider:e,providerOptions:t,schema:s}){if(null==(null==t?void 0:t[e]))return;const i=await Pt({value:t[e],schema:s});if(!i.success)throw new H({argument:"providerOptions",message:`invalid ${e} provider options`,cause:i.error});return i.value}var Dt=()=>globalThis.fetch,Tt=async({url:e,headers:t,body:s,failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r})=>Mt({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(s),values:s},failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r}),At=async({url:e,headers:t,formData:s,failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r})=>Mt({url:e,headers:t,body:{content:s,values:Object.fromEntries(s.entries())},failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r}),Mt=async({url:e,headers:t={},body:s,successfulResponseHandler:i,failedResponseHandler:o,abortSignal:n,fetch:r=Dt()})=>{try{const a=await r(e,{method:"POST",headers:We(t,"ai-sdk/provider-utils/4.0.5",ze()),body:s.content,signal:n}),l=Ee(a);if(!a.ok){let t;try{t=await o({response:a,url:e,requestBodyValues:s.values})}catch(t){if(He(t)||f.isInstance(t))throw t;throw new f({message:"Failed to process error response",cause:t,statusCode:a.status,url:e,responseHeaders:l,requestBodyValues:s.values})}throw t.value}try{return await i({response:a,url:e,requestBodyValues:s.values})}catch(t){if(t instanceof Error&&(He(t)||f.isInstance(t)))throw t;throw new f({message:"Failed to process successful response",cause:t,statusCode:a.status,url:e,responseHeaders:l,requestBodyValues:s.values})}}catch(t){throw function({error:e,url:t,requestBodyValues:s}){if(He(e))return e;if(e instanceof TypeError&&Ge.includes(e.message.toLowerCase())){const i=e.cause;if(null!=i)return new f({message:`Cannot connect to API: ${i.message}`,cause:i,url:t,requestBodyValues:s,isRetryable:!0})}return e}({error:t,url:e,requestBodyValues:s.values})}};function Nt({id:e,inputSchema:t,outputSchema:s,supportsDeferredResults:i}){return({execute:o,needsApproval:n,toModelOutput:r,onInputStart:a,onInputDelta:l,onInputAvailable:c,...d})=>({type:"provider",id:e,args:d,inputSchema:t,outputSchema:s,execute:o,needsApproval:n,toModelOutput:r,onInputStart:a,onInputDelta:l,onInputAvailable:c,supportsDeferredResults:i})}var Lt=e=>async({response:t})=>{const s=Ee(t);if(null==t.body)throw new C({});return{responseHeaders:s,value:kt({stream:t.body,schema:e})}},Vt=e=>async({response:t,url:s,requestBodyValues:i})=>{const o=await t.text(),n=await Et({text:o,schema:e}),r=Ee(t);if(!n.success)throw new f({message:"Invalid JSON response",cause:n.error,statusCode:t.status,responseHeaders:r,responseBody:o,url:s,requestBodyValues:i});return{responseHeaders:r,value:n.value,rawValue:n.rawValue}},_t=s(42343),Ot=s(26070),Bt=s(21655).URL,Ht=_t.Ik({error:_t.Ik({message:_t.Yj(),type:_t.Yj().nullish(),param:_t.bz().nullish(),code:_t.KC([_t.Yj(),_t.ai()]).nullish()})}),Gt=(({errorSchema:e,errorToMessage:t,isRetryable:s})=>async({response:i,url:o,requestBodyValues:n})=>{const r=await i.text(),a=Ee(i);if(""===r.trim())return{responseHeaders:a,value:new f({message:i.statusText,url:o,requestBodyValues:n,statusCode:i.status,responseHeaders:a,responseBody:r,isRetryable:null==s?void 0:s(i)})};try{const l=await async function({text:e,schema:t}){try{const s=qe(e);return null==t?s:Rt({value:s,schema:t})}catch(t){if(J.isInstance(t)||fe.isInstance(t))throw t;throw new J({text:e,cause:t})}}({text:r,schema:e});return{responseHeaders:a,value:new f({message:t(l),url:o,requestBodyValues:n,statusCode:i.status,responseHeaders:a,responseBody:r,data:l,isRetryable:null==s?void 0:s(i,l)})}}catch(e){return{responseHeaders:a,value:new f({message:i.statusText,url:o,requestBodyValues:n,statusCode:i.status,responseHeaders:a,responseBody:r,isRetryable:null==s?void 0:s(i)})}}})({errorSchema:Ht,errorToMessage:e=>e.error.message});function zt(e){const t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),s=e.startsWith("gpt-4")||e.startsWith("gpt-5-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")||e.startsWith("o3")||e.startsWith("o4-mini"),i=e.startsWith("o1")||e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("codex-mini")||e.startsWith("computer-use-preview")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat");return{supportsFlexProcessing:t,supportsPriorityProcessing:s,isReasoningModel:i,systemMessageMode:i?"developer":"system",supportsNonReasoningParameters:e.startsWith("gpt-5.1")||e.startsWith("gpt-5.2")}}function Wt(e){var t,s,i,o,n,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const a=null!=(t=e.prompt_tokens)?t:0,l=null!=(s=e.completion_tokens)?s:0,c=null!=(o=null==(i=e.prompt_tokens_details)?void 0:i.cached_tokens)?o:0,d=null!=(r=null==(n=e.completion_tokens_details)?void 0:n.reasoning_tokens)?r:0;return{inputTokens:{total:a,noCache:a-c,cacheRead:c,cacheWrite:void 0},outputTokens:{total:l,text:l-d,reasoning:d},raw:e}}function jt({id:e,model:t,created:s}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:s?new Date(1e3*s):void 0}}function Ut(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var $t=bt((()=>xt(_t.Ik({id:_t.Yj().nullish(),created:_t.ai().nullish(),model:_t.Yj().nullish(),choices:_t.YO(_t.Ik({message:_t.Ik({role:_t.eu("assistant").nullish(),content:_t.Yj().nullish(),tool_calls:_t.YO(_t.Ik({id:_t.Yj().nullish(),type:_t.eu("function"),function:_t.Ik({name:_t.Yj(),arguments:_t.Yj()})})).nullish(),annotations:_t.YO(_t.Ik({type:_t.eu("url_citation"),url_citation:_t.Ik({start_index:_t.ai(),end_index:_t.ai(),url:_t.Yj(),title:_t.Yj()})})).nullish()}),index:_t.ai(),logprobs:_t.Ik({content:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai(),top_logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai()}))})).nullish()}).nullish(),finish_reason:_t.Yj().nullish()})),usage:_t.Ik({prompt_tokens:_t.ai().nullish(),completion_tokens:_t.ai().nullish(),total_tokens:_t.ai().nullish(),prompt_tokens_details:_t.Ik({cached_tokens:_t.ai().nullish()}).nullish(),completion_tokens_details:_t.Ik({reasoning_tokens:_t.ai().nullish(),accepted_prediction_tokens:_t.ai().nullish(),rejected_prediction_tokens:_t.ai().nullish()}).nullish()}).nullish()})))),Yt=bt((()=>xt(_t.KC([_t.Ik({id:_t.Yj().nullish(),created:_t.ai().nullish(),model:_t.Yj().nullish(),choices:_t.YO(_t.Ik({delta:_t.Ik({role:_t.k5(["assistant"]).nullish(),content:_t.Yj().nullish(),tool_calls:_t.YO(_t.Ik({index:_t.ai(),id:_t.Yj().nullish(),type:_t.eu("function").nullish(),function:_t.Ik({name:_t.Yj().nullish(),arguments:_t.Yj().nullish()})})).nullish(),annotations:_t.YO(_t.Ik({type:_t.eu("url_citation"),url_citation:_t.Ik({start_index:_t.ai(),end_index:_t.ai(),url:_t.Yj(),title:_t.Yj()})})).nullish()}).nullish(),logprobs:_t.Ik({content:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai(),top_logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai()}))})).nullish()}).nullish(),finish_reason:_t.Yj().nullish(),index:_t.ai()})),usage:_t.Ik({prompt_tokens:_t.ai().nullish(),completion_tokens:_t.ai().nullish(),total_tokens:_t.ai().nullish(),prompt_tokens_details:_t.Ik({cached_tokens:_t.ai().nullish()}).nullish(),completion_tokens_details:_t.Ik({reasoning_tokens:_t.ai().nullish(),accepted_prediction_tokens:_t.ai().nullish(),rejected_prediction_tokens:_t.ai().nullish()}).nullish()}).nullish()}),Ht])))),Kt=bt((()=>xt(_t.Ik({logitBias:_t.g1(Ot.number(),_t.ai()).optional(),logprobs:_t.KC([_t.zM(),_t.ai()]).optional(),parallelToolCalls:_t.zM().optional(),user:_t.Yj().optional(),reasoningEffort:_t.k5(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:_t.ai().optional(),store:_t.zM().optional(),metadata:_t.g1(_t.Yj().max(64),_t.Yj().max(512)).optional(),prediction:_t.g1(_t.Yj(),_t.bz()).optional(),serviceTier:_t.k5(["auto","flex","priority","default"]).optional(),strictJsonSchema:_t.zM().optional(),textVerbosity:_t.k5(["low","medium","high"]).optional(),promptCacheKey:_t.Yj().optional(),promptCacheRetention:_t.k5(["in_memory","24h"]).optional(),safetyIdentifier:_t.Yj().optional(),systemMessageMode:_t.k5(["system","developer","remove"]).optional(),forceReasoning:_t.zM().optional()})))),qt=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:s,topP:i,topK:o,frequencyPenalty:n,presencePenalty:r,stopSequences:a,responseFormat:l,seed:c,tools:d,toolChoice:u,providerOptions:h}){var p,g,f,m,v;const w=[],C=null!=(p=await Ft({provider:"openai",providerOptions:h,schema:Kt}))?p:{},y=zt(this.modelId),b=null!=(g=C.forceReasoning)?g:y.isReasoningModel;null!=o&&w.push({type:"unsupported",feature:"topK"});const{messages:S,warnings:x}=function({prompt:e,systemMessageMode:t="system"}){var s;const i=[],o=[];for(const{role:n,content:r}of e)switch(n){case"system":switch(t){case"system":i.push({role:"system",content:r});break;case"developer":i.push({role:"developer",content:r});break;case"remove":o.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${t}`)}break;case"user":if(1===r.length&&"text"===r[0].type){i.push({role:"user",content:r[0].text});break}i.push({role:"user",content:r.map(((e,t)=>{var s,i,o;switch(e.type){case"text":return{type:"text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"image_url",image_url:{url:e.data instanceof Bt?e.data.toString():`data:${t};base64,${De(e.data)}`,detail:null==(i=null==(s=e.providerOptions)?void 0:s.openai)?void 0:i.imageDetail}}}if(!e.mediaType.startsWith("audio/")){if("application/pdf"===e.mediaType){if(e.data instanceof Bt)throw new Ce({functionality:"PDF file parts with URLs"});return{type:"file",file:"string"==typeof e.data&&e.data.startsWith("file-")?{file_id:e.data}:{filename:null!=(o=e.filename)?o:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${De(e.data)}`}}}throw new Ce({functionality:`file part media type ${e.mediaType}`})}if(e.data instanceof Bt)throw new Ce({functionality:"audio file parts with URLs"});switch(e.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:De(e.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:De(e.data),format:"mp3"}};default:throw new Ce({functionality:`audio content parts with media type ${e.mediaType}`})}}}))});break;case"assistant":{let e="";const t=[];for(const s of r)switch(s.type){case"text":e+=s.text;break;case"tool-call":t.push({id:s.toolCallId,type:"function",function:{name:s.toolName,arguments:JSON.stringify(s.input)}})}i.push({role:"assistant",content:e,tool_calls:t.length>0?t:void 0});break}case"tool":for(const e of r){if("tool-approval-response"===e.type)continue;const t=e.output;let o;switch(t.type){case"text":case"error-text":o=t.value;break;case"execution-denied":o=null!=(s=t.reason)?s:"Tool execution denied.";break;case"content":case"json":case"error-json":o=JSON.stringify(t.value)}i.push({role:"tool",tool_call_id:e.toolCallId,content:o})}break;default:throw new Error(`Unsupported role: ${n}`)}return{messages:i,warnings:o}}({prompt:e,systemMessageMode:null!=(f=C.systemMessageMode)?f:b?"developer":y.systemMessageMode});w.push(...x);const R=null==(m=C.strictJsonSchema)||m,P={model:this.modelId,logit_bias:C.logitBias,logprobs:!0===C.logprobs||"number"==typeof C.logprobs||void 0,top_logprobs:"number"==typeof C.logprobs?C.logprobs:"boolean"==typeof C.logprobs&&C.logprobs?0:void 0,user:C.user,parallel_tool_calls:C.parallelToolCalls,max_tokens:t,temperature:s,top_p:i,frequency_penalty:n,presence_penalty:r,response_format:"json"===(null==l?void 0:l.type)?null!=l.schema?{type:"json_schema",json_schema:{schema:l.schema,strict:R,name:null!=(v=l.name)?v:"response",description:l.description}}:{type:"json_object"}:void 0,stop:a,seed:c,verbosity:C.textVerbosity,max_completion_tokens:C.maxCompletionTokens,store:C.store,metadata:C.metadata,prediction:C.prediction,reasoning_effort:C.reasoningEffort,service_tier:C.serviceTier,prompt_cache_key:C.promptCacheKey,prompt_cache_retention:C.promptCacheRetention,safety_identifier:C.safetyIdentifier,messages:S};b?("none"===C.reasoningEffort&&y.supportsNonReasoningParameters||(null!=P.temperature&&(P.temperature=void 0,w.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=P.top_p&&(P.top_p=void 0,w.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),null!=P.logprobs&&(P.logprobs=void 0,w.push({type:"other",message:"logprobs is not supported for reasoning models"}))),null!=P.frequency_penalty&&(P.frequency_penalty=void 0,w.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),null!=P.presence_penalty&&(P.presence_penalty=void 0,w.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),null!=P.logit_bias&&(P.logit_bias=void 0,w.push({type:"other",message:"logitBias is not supported for reasoning models"})),null!=P.top_logprobs&&(P.top_logprobs=void 0,w.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),null!=P.max_tokens&&(null==P.max_completion_tokens&&(P.max_completion_tokens=P.max_tokens),P.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&null!=P.temperature&&(P.temperature=void 0,w.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),"flex"!==C.serviceTier||y.supportsFlexProcessing||(w.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),P.service_tier=void 0),"priority"!==C.serviceTier||y.supportsPriorityProcessing||(w.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),P.service_tier=void 0);const{tools:E,toolChoice:I,toolWarnings:k}=function({tools:e,toolChoice:t}){const s=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:s};const i=[];for(const t of e)"function"===t.type?i.push({type:"function",function:{name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}}}):s.push({type:"unsupported",feature:`tool type: ${t.type}`});if(null==t)return{tools:i,toolChoice:void 0,toolWarnings:s};const o=t.type;switch(o){case"auto":case"none":case"required":return{tools:i,toolChoice:o,toolWarnings:s};case"tool":return{tools:i,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:s};default:throw new Ce({functionality:`tool choice type: ${o}`})}}({tools:d,toolChoice:u});return{args:{...P,tools:E,tool_choice:I},warnings:[...w,...k]}}async doGenerate(e){var t,s,i,o,n,r,a;const{args:l,warnings:c}=await this.getArgs(e),{responseHeaders:d,value:u,rawValue:h}=await Tt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:l,failedResponseHandler:Gt,successfulResponseHandler:Vt($t),abortSignal:e.abortSignal,fetch:this.config.fetch}),p=u.choices[0],g=[],f=p.message.content;null!=f&&f.length>0&&g.push({type:"text",text:f});for(const e of null!=(t=p.message.tool_calls)?t:[])g.push({type:"tool-call",toolCallId:null!=(s=e.id)?s:Be(),toolName:e.function.name,input:e.function.arguments});for(const e of null!=(i=p.message.annotations)?i:[])g.push({type:"source",sourceType:"url",id:Be(),url:e.url_citation.url,title:e.url_citation.title});const m=null==(o=u.usage)?void 0:o.completion_tokens_details,v=(null==(n=u.usage)||n.prompt_tokens_details,{openai:{}});return null!=(null==m?void 0:m.accepted_prediction_tokens)&&(v.openai.acceptedPredictionTokens=null==m?void 0:m.accepted_prediction_tokens),null!=(null==m?void 0:m.rejected_prediction_tokens)&&(v.openai.rejectedPredictionTokens=null==m?void 0:m.rejected_prediction_tokens),null!=(null==(r=p.logprobs)?void 0:r.content)&&(v.openai.logprobs=p.logprobs.content),{content:g,finishReason:{unified:Ut(p.finish_reason),raw:null!=(a=p.finish_reason)?a:void 0},usage:Wt(u.usage),request:{body:l},response:{...jt(u),headers:d,body:h},warnings:c,providerMetadata:v}}async doStream(e){const{args:t,warnings:s}=await this.getArgs(e),i={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:o,value:n}=await Tt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:i,failedResponseHandler:Gt,successfulResponseHandler:Lt(Yt),abortSignal:e.abortSignal,fetch:this.config.fetch}),r=[];let a,l={unified:"other",raw:void 0},c=!1,d=!1;const u={openai:{}};return{stream:n.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:s})},transform(t,s){var i,o,n,h,p,g,f,m,v,w,C,y,b,S,x,R,P;if(e.includeRawChunks&&s.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return l={unified:"error",raw:void 0},void s.enqueue({type:"error",error:t.error});const E=t.value;if("error"in E)return l={unified:"error",raw:void 0},void s.enqueue({type:"error",error:E.error});if(!c){const e=jt(E);Object.values(e).some(Boolean)&&(c=!0,s.enqueue({type:"response-metadata",...jt(E)}))}null!=E.usage&&(a=E.usage,null!=(null==(i=E.usage.completion_tokens_details)?void 0:i.accepted_prediction_tokens)&&(u.openai.acceptedPredictionTokens=null==(o=E.usage.completion_tokens_details)?void 0:o.accepted_prediction_tokens),null!=(null==(n=E.usage.completion_tokens_details)?void 0:n.rejected_prediction_tokens)&&(u.openai.rejectedPredictionTokens=null==(h=E.usage.completion_tokens_details)?void 0:h.rejected_prediction_tokens));const I=E.choices[0];if(null!=(null==I?void 0:I.finish_reason)&&(l={unified:Ut(I.finish_reason),raw:I.finish_reason}),null!=(null==(p=null==I?void 0:I.logprobs)?void 0:p.content)&&(u.openai.logprobs=I.logprobs.content),null==(null==I?void 0:I.delta))return;const k=I.delta;if(null!=k.content&&(d||(s.enqueue({type:"text-start",id:"0"}),d=!0),s.enqueue({type:"text-delta",id:"0",delta:k.content})),null!=k.tool_calls)for(const e of k.tool_calls){const t=e.index;if(null==r[t]){if("function"!==e.type)throw new K({data:e,message:"Expected 'function' type."});if(null==e.id)throw new K({data:e,message:"Expected 'id' to be a string."});if(null==(null==(g=e.function)?void 0:g.name))throw new K({data:e,message:"Expected 'function.name' to be a string."});s.enqueue({type:"tool-input-start",id:e.id,toolName:e.function.name}),r[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(f=e.function.arguments)?f:""},hasFinished:!1};const i=r[t];null!=(null==(m=i.function)?void 0:m.name)&&null!=(null==(v=i.function)?void 0:v.arguments)&&(i.function.arguments.length>0&&s.enqueue({type:"tool-input-delta",id:i.id,delta:i.function.arguments}),It(i.function.arguments)&&(s.enqueue({type:"tool-input-end",id:i.id}),s.enqueue({type:"tool-call",toolCallId:null!=(w=i.id)?w:Be(),toolName:i.function.name,input:i.function.arguments}),i.hasFinished=!0));continue}const i=r[t];i.hasFinished||(null!=(null==(C=e.function)?void 0:C.arguments)&&(i.function.arguments+=null!=(b=null==(y=e.function)?void 0:y.arguments)?b:""),s.enqueue({type:"tool-input-delta",id:i.id,delta:null!=(S=e.function.arguments)?S:""}),null!=(null==(x=i.function)?void 0:x.name)&&null!=(null==(R=i.function)?void 0:R.arguments)&&It(i.function.arguments)&&(s.enqueue({type:"tool-input-end",id:i.id}),s.enqueue({type:"tool-call",toolCallId:null!=(P=i.id)?P:Be(),toolName:i.function.name,input:i.function.arguments}),i.hasFinished=!0))}if(null!=k.annotations)for(const e of k.annotations)s.enqueue({type:"source",sourceType:"url",id:Be(),url:e.url_citation.url,title:e.url_citation.title})},flush(e){d&&e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:l,usage:Wt(a),...null!=u?{providerMetadata:u}:{}})}})),request:{body:i},response:{headers:o}}}};function Zt(e){var t,s,i,o;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const n=null!=(t=e.prompt_tokens)?t:0,r=null!=(s=e.completion_tokens)?s:0;return{inputTokens:{total:null!=(i=e.prompt_tokens)?i:void 0,noCache:n,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:null!=(o=e.completion_tokens)?o:void 0,text:r,reasoning:void 0},raw:e}}function Qt({id:e,model:t,created:s}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=s?new Date(1e3*s):void 0}}function Jt(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var Xt=bt((()=>xt(_t.Ik({id:_t.Yj().nullish(),created:_t.ai().nullish(),model:_t.Yj().nullish(),choices:_t.YO(_t.Ik({text:_t.Yj(),finish_reason:_t.Yj(),logprobs:_t.Ik({tokens:_t.YO(_t.Yj()),token_logprobs:_t.YO(_t.ai()),top_logprobs:_t.YO(_t.g1(_t.Yj(),_t.ai())).nullish()}).nullish()})),usage:_t.Ik({prompt_tokens:_t.ai(),completion_tokens:_t.ai(),total_tokens:_t.ai()}).nullish()})))),es=bt((()=>xt(_t.KC([_t.Ik({id:_t.Yj().nullish(),created:_t.ai().nullish(),model:_t.Yj().nullish(),choices:_t.YO(_t.Ik({text:_t.Yj(),finish_reason:_t.Yj().nullish(),index:_t.ai(),logprobs:_t.Ik({tokens:_t.YO(_t.Yj()),token_logprobs:_t.YO(_t.ai()),top_logprobs:_t.YO(_t.g1(_t.Yj(),_t.ai())).nullish()}).nullish()})),usage:_t.Ik({prompt_tokens:_t.ai(),completion_tokens:_t.ai(),total_tokens:_t.ai()}).nullish()}),Ht])))),ts=bt((()=>xt(_t.Ik({echo:_t.zM().optional(),logitBias:_t.g1(_t.Yj(),_t.ai()).optional(),suffix:_t.Yj().optional(),user:_t.Yj().optional(),logprobs:_t.KC([_t.zM(),_t.ai()]).optional()})))),ss=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:s,topP:i,topK:o,frequencyPenalty:n,presencePenalty:r,stopSequences:a,responseFormat:l,tools:c,toolChoice:d,seed:u,providerOptions:h}){const p=[],g={...await Ft({provider:"openai",providerOptions:h,schema:ts}),...await Ft({provider:this.providerOptionsName,providerOptions:h,schema:ts})};null!=o&&p.push({type:"unsupported",feature:"topK"}),(null==c?void 0:c.length)&&p.push({type:"unsupported",feature:"tools"}),null!=d&&p.push({type:"unsupported",feature:"toolChoice"}),null!=l&&"text"!==l.type&&p.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});const{prompt:f,stopSequences:m}=function({prompt:e,user:t="user",assistant:s="assistant"}){let i="";"system"===e[0].role&&(i+=`${e[0].content}\n\n`,e=e.slice(1));for(const{role:o,content:n}of e)switch(o){case"system":throw new j({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":i+=`${t}:\n${n.map((e=>{if("text"===e.type)return e.text})).filter(Boolean).join("")}\n\n`;break;case"assistant":i+=`${s}:\n${n.map((e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new Ce({functionality:"tool-call messages"})}})).join("")}\n\n`;break;case"tool":throw new Ce({functionality:"tool messages"});default:throw new Error(`Unsupported role: ${o}`)}return i+=`${s}:\n`,{prompt:i,stopSequences:[`\n${t}:`]}}({prompt:e}),v=[...null!=m?m:[],...null!=a?a:[]];return{args:{model:this.modelId,echo:g.echo,logit_bias:g.logitBias,logprobs:!0===(null==g?void 0:g.logprobs)?0:!1===(null==g?void 0:g.logprobs)||null==g?void 0:g.logprobs,suffix:g.suffix,user:g.user,max_tokens:t,temperature:s,top_p:i,frequency_penalty:n,presence_penalty:r,seed:u,prompt:f,stop:v.length>0?v:void 0},warnings:p}}async doGenerate(e){var t;const{args:s,warnings:i}=await this.getArgs(e),{responseHeaders:o,value:n,rawValue:r}=await Tt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:s,failedResponseHandler:Gt,successfulResponseHandler:Vt(Xt),abortSignal:e.abortSignal,fetch:this.config.fetch}),a=n.choices[0],l={openai:{}};return null!=a.logprobs&&(l.openai.logprobs=a.logprobs),{content:[{type:"text",text:a.text}],usage:Zt(n.usage),finishReason:{unified:Jt(a.finish_reason),raw:null!=(t=a.finish_reason)?t:void 0},request:{body:s},response:{...Qt(n),headers:o,body:r},providerMetadata:l,warnings:i}}async doStream(e){const{args:t,warnings:s}=await this.getArgs(e),i={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:o,value:n}=await Tt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:i,failedResponseHandler:Gt,successfulResponseHandler:Lt(es),abortSignal:e.abortSignal,fetch:this.config.fetch});let r={unified:"other",raw:void 0};const a={openai:{}};let l,c=!0;return{stream:n.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:s})},transform(t,s){if(e.includeRawChunks&&s.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return r={unified:"error",raw:void 0},void s.enqueue({type:"error",error:t.error});const i=t.value;if("error"in i)return r={unified:"error",raw:void 0},void s.enqueue({type:"error",error:i.error});c&&(c=!1,s.enqueue({type:"response-metadata",...Qt(i)}),s.enqueue({type:"text-start",id:"0"})),null!=i.usage&&(l=i.usage);const o=i.choices[0];null!=(null==o?void 0:o.finish_reason)&&(r={unified:Jt(o.finish_reason),raw:o.finish_reason}),null!=(null==o?void 0:o.logprobs)&&(a.openai.logprobs=o.logprobs),null!=(null==o?void 0:o.text)&&o.text.length>0&&s.enqueue({type:"text-delta",id:"0",delta:o.text})},flush(e){c||e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:r,providerMetadata:a,usage:Zt(l)})}})),request:{body:i},response:{headers:o}}}},is=bt((()=>xt(_t.Ik({dimensions:_t.ai().optional(),user:_t.Yj().optional()})))),os=bt((()=>xt(_t.Ik({data:_t.YO(_t.Ik({embedding:_t.YO(_t.ai())})),usage:_t.Ik({prompt_tokens:_t.ai()}).nullish()})))),ns=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:s,providerOptions:i}){var o;if(e.length>this.maxEmbeddingsPerCall)throw new ue({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});const n=null!=(o=await Ft({provider:"openai",providerOptions:i,schema:is}))?o:{},{responseHeaders:r,value:a,rawValue:l}=await Tt({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:Pe(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:n.dimensions,user:n.user},failedResponseHandler:Gt,successfulResponseHandler:Vt(os),abortSignal:s,fetch:this.config.fetch});return{warnings:[],embeddings:a.data.map((e=>e.embedding)),usage:a.usage?{tokens:a.usage.prompt_tokens}:void 0,response:{headers:r,body:l}}}},rs=bt((()=>xt(_t.Ik({created:_t.ai().nullish(),data:_t.YO(_t.Ik({b64_json:_t.Yj(),revised_prompt:_t.Yj().nullish()})),background:_t.Yj().nullish(),output_format:_t.Yj().nullish(),size:_t.Yj().nullish(),quality:_t.Yj().nullish(),usage:_t.Ik({input_tokens:_t.ai().nullish(),output_tokens:_t.ai().nullish(),total_tokens:_t.ai().nullish(),input_tokens_details:_t.Ik({image_tokens:_t.ai().nullish(),text_tokens:_t.ai().nullish()}).nullish()}).nullish()})))),as={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10,"gpt-image-1.5":10},ls=["gpt-image-1-mini","gpt-image-1.5","gpt-image-1"],cs=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return null!=(e=as[this.modelId])?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,files:t,mask:s,n:i,size:o,aspectRatio:n,seed:r,providerOptions:a,headers:l,abortSignal:c}){var d,u,h,p,g,f,m,v,w,C,y;const b=[];null!=n&&b.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),null!=r&&b.push({type:"unsupported",feature:"seed"});const S=null!=(h=null==(u=null==(d=this.config._internal)?void 0:d.currentDate)?void 0:u.call(d))?h:new Date;if(null!=t){const{value:n,responseHeaders:r}=await At({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:Pe(this.config.headers(),l),formData:Te({model:this.modelId,prompt:e,image:await Promise.all(t.map((e=>"file"===e.type?new Blob([e.data instanceof Uint8Array?new Blob([e.data],{type:e.mediaType}):new Blob([Fe(e.data)],{type:e.mediaType})],{type:e.mediaType}):Oe(e.url)))),mask:null!=s?await ds(s):void 0,n:i,size:o,...null!=(p=a.openai)?p:{}}),failedResponseHandler:Gt,successfulResponseHandler:Vt(rs),abortSignal:c,fetch:this.config.fetch});return{images:n.data.map((e=>e.b64_json)),warnings:b,usage:null!=n.usage?{inputTokens:null!=(g=n.usage.input_tokens)?g:void 0,outputTokens:null!=(f=n.usage.output_tokens)?f:void 0,totalTokens:null!=(m=n.usage.total_tokens)?m:void 0}:void 0,response:{timestamp:S,modelId:this.modelId,headers:r},providerMetadata:{openai:{images:n.data.map((e=>{var t,s,i,o,r;return{...e.revised_prompt?{revisedPrompt:e.revised_prompt}:{},created:null!=(t=n.created)?t:void 0,size:null!=(s=n.size)?s:void 0,quality:null!=(i=n.quality)?i:void 0,background:null!=(o=n.background)?o:void 0,outputFormat:null!=(r=n.output_format)?r:void 0}}))}}}}const{value:x,responseHeaders:R}=await Tt({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:Pe(this.config.headers(),l),body:{model:this.modelId,prompt:e,n:i,size:o,...null!=(v=a.openai)?v:{},...(P=this.modelId,ls.some((e=>P.startsWith(e)))?{}:{response_format:"b64_json"})},failedResponseHandler:Gt,successfulResponseHandler:Vt(rs),abortSignal:c,fetch:this.config.fetch});var P;return{images:x.data.map((e=>e.b64_json)),warnings:b,usage:null!=x.usage?{inputTokens:null!=(w=x.usage.input_tokens)?w:void 0,outputTokens:null!=(C=x.usage.output_tokens)?C:void 0,totalTokens:null!=(y=x.usage.total_tokens)?y:void 0}:void 0,response:{timestamp:S,modelId:this.modelId,headers:R},providerMetadata:{openai:{images:x.data.map((e=>{var t,s,i,o,n;return{...e.revised_prompt?{revisedPrompt:e.revised_prompt}:{},created:null!=(t=x.created)?t:void 0,size:null!=(s=x.size)?s:void 0,quality:null!=(i=x.quality)?i:void 0,background:null!=(o=x.background)?o:void 0,outputFormat:null!=(n=x.output_format)?n:void 0}}))}}}}};async function ds(e){if(!e)return;if("url"===e.type)return Oe(e.url);const t=e.data instanceof Uint8Array?e.data:Fe(e.data);return new Blob([t],{type:e.mediaType})}var us=bt((()=>xt(_t.Ik({callId:_t.Yj(),operation:_t.gM("type",[_t.Ik({type:_t.eu("create_file"),path:_t.Yj(),diff:_t.Yj()}),_t.Ik({type:_t.eu("delete_file"),path:_t.Yj()}),_t.Ik({type:_t.eu("update_file"),path:_t.Yj(),diff:_t.Yj()})])})))),hs=bt((()=>xt(_t.Ik({status:_t.k5(["completed","failed"]),output:_t.Yj().optional()})))),ps=(bt((()=>xt(_t.Ik({})))),Nt({id:"openai.apply_patch",inputSchema:us,outputSchema:hs})),gs=bt((()=>xt(_t.Ik({code:_t.Yj().nullish(),containerId:_t.Yj()})))),fs=bt((()=>xt(_t.Ik({outputs:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("logs"),logs:_t.Yj()}),_t.Ik({type:_t.eu("image"),url:_t.Yj()})])).nullish()})))),ms=bt((()=>xt(_t.Ik({container:_t.KC([_t.Yj(),_t.Ik({fileIds:_t.YO(_t.Yj()).optional()})]).optional()})))),vs=Nt({id:"openai.code_interpreter",inputSchema:gs,outputSchema:fs}),ws=_t.Ik({key:_t.Yj(),type:_t.k5(["eq","ne","gt","gte","lt","lte","in","nin"]),value:_t.KC([_t.Yj(),_t.ai(),_t.zM(),_t.YO(_t.Yj())])}),Cs=_t.Ik({type:_t.k5(["and","or"]),filters:_t.YO(_t.KC([ws,_t.RZ((()=>Cs))]))}),ys=bt((()=>xt(_t.Ik({vectorStoreIds:_t.YO(_t.Yj()),maxNumResults:_t.ai().optional(),ranking:_t.Ik({ranker:_t.Yj().optional(),scoreThreshold:_t.ai().optional()}).optional(),filters:_t.KC([ws,Cs]).optional()})))),bs=bt((()=>xt(_t.Ik({queries:_t.YO(_t.Yj()),results:_t.YO(_t.Ik({attributes:_t.g1(_t.Yj(),_t.L5()),fileId:_t.Yj(),filename:_t.Yj(),score:_t.ai(),text:_t.Yj()})).nullable()})))),Ss=Nt({id:"openai.file_search",inputSchema:_t.Ik({}),outputSchema:bs}),xs=bt((()=>xt(_t.Ik({background:_t.k5(["auto","opaque","transparent"]).optional(),inputFidelity:_t.k5(["low","high"]).optional(),inputImageMask:_t.Ik({fileId:_t.Yj().optional(),imageUrl:_t.Yj().optional()}).optional(),model:_t.Yj().optional(),moderation:_t.k5(["auto"]).optional(),outputCompression:_t.ai().int().min(0).max(100).optional(),outputFormat:_t.k5(["png","jpeg","webp"]).optional(),partialImages:_t.ai().int().min(0).max(3).optional(),quality:_t.k5(["auto","low","medium","high"]).optional(),size:_t.k5(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict()))),Rs=Nt({id:"openai.image_generation",inputSchema:bt((()=>xt(_t.Ik({})))),outputSchema:bt((()=>xt(_t.Ik({result:_t.Yj()}))))}),Ps=bt((()=>xt(_t.Ik({action:_t.Ik({type:_t.eu("exec"),command:_t.YO(_t.Yj()),timeoutMs:_t.ai().optional(),user:_t.Yj().optional(),workingDirectory:_t.Yj().optional(),env:_t.g1(_t.Yj(),_t.Yj()).optional()})})))),Es=bt((()=>xt(_t.Ik({output:_t.Yj()})))),Is=Nt({id:"openai.local_shell",inputSchema:Ps,outputSchema:Es}),ks=bt((()=>xt(_t.Ik({action:_t.Ik({commands:_t.YO(_t.Yj()),timeoutMs:_t.ai().optional(),maxOutputLength:_t.ai().optional()})})))),Fs=bt((()=>xt(_t.Ik({output:_t.YO(_t.Ik({stdout:_t.Yj(),stderr:_t.Yj(),outcome:_t.gM("type",[_t.Ik({type:_t.eu("timeout")}),_t.Ik({type:_t.eu("exit"),exitCode:_t.ai()})])}))})))),Ds=Nt({id:"openai.shell",inputSchema:ks,outputSchema:Fs}),Ts=bt((()=>xt(_t.Ik({externalWebAccess:_t.zM().optional(),filters:_t.Ik({allowedDomains:_t.YO(_t.Yj()).optional()}).optional(),searchContextSize:_t.k5(["low","medium","high"]).optional(),userLocation:_t.Ik({type:_t.eu("approximate"),country:_t.Yj().optional(),city:_t.Yj().optional(),region:_t.Yj().optional(),timezone:_t.Yj().optional()}).optional()})))),As=Nt({id:"openai.web_search",inputSchema:bt((()=>xt(_t.Ik({})))),outputSchema:bt((()=>xt(_t.Ik({action:_t.gM("type",[_t.Ik({type:_t.eu("search"),query:_t.Yj().optional()}),_t.Ik({type:_t.eu("openPage"),url:_t.Yj().nullish()}),_t.Ik({type:_t.eu("findInPage"),url:_t.Yj().nullish(),pattern:_t.Yj().nullish()})]),sources:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("url"),url:_t.Yj()}),_t.Ik({type:_t.eu("api"),name:_t.Yj()})])).optional()}))))}),Ms=bt((()=>xt(_t.Ik({searchContextSize:_t.k5(["low","medium","high"]).optional(),userLocation:_t.Ik({type:_t.eu("approximate"),country:_t.Yj().optional(),city:_t.Yj().optional(),region:_t.Yj().optional(),timezone:_t.Yj().optional()}).optional()})))),Ns=Nt({id:"openai.web_search_preview",inputSchema:bt((()=>xt(_t.Ik({})))),outputSchema:bt((()=>xt(_t.Ik({action:_t.gM("type",[_t.Ik({type:_t.eu("search"),query:_t.Yj().optional()}),_t.Ik({type:_t.eu("openPage"),url:_t.Yj().nullish()}),_t.Ik({type:_t.eu("findInPage"),url:_t.Yj().nullish(),pattern:_t.Yj().nullish()})])}))))}),Ls=_t.RZ((()=>_t.KC([_t.Yj(),_t.ai(),_t.zM(),_t.ch(),_t.YO(Ls),_t.g1(_t.Yj(),Ls)]))),Vs=bt((()=>xt(_t.Ik({serverLabel:_t.Yj(),allowedTools:_t.KC([_t.YO(_t.Yj()),_t.Ik({readOnly:_t.zM().optional(),toolNames:_t.YO(_t.Yj()).optional()})]).optional(),authorization:_t.Yj().optional(),connectorId:_t.Yj().optional(),headers:_t.g1(_t.Yj(),_t.Yj()).optional(),requireApproval:_t.KC([_t.k5(["always","never"]),_t.Ik({never:_t.Ik({toolNames:_t.YO(_t.Yj()).optional()}).optional()})]).optional(),serverDescription:_t.Yj().optional(),serverUrl:_t.Yj().optional()}).refine((e=>null!=e.serverUrl||null!=e.connectorId),"One of serverUrl or connectorId must be provided.")))),_s=Nt({id:"openai.mcp",inputSchema:bt((()=>xt(_t.Ik({})))),outputSchema:bt((()=>xt(_t.Ik({type:_t.eu("call"),serverLabel:_t.Yj(),name:_t.Yj(),arguments:_t.Yj(),output:_t.Yj().nullish(),error:_t.KC([_t.Yj(),Ls]).optional()}))))}),Os={applyPatch:ps,codeInterpreter:(e={})=>vs(e),fileSearch:Ss,imageGeneration:(e={})=>Rs(e),localShell:Is,shell:Ds,webSearchPreview:Ns,webSearch:(e={})=>As(e),mcp:e=>_s(e)};function Bs(e){var t,s,i,o;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const n=e.input_tokens,r=e.output_tokens,a=null!=(s=null==(t=e.input_tokens_details)?void 0:t.cached_tokens)?s:0,l=null!=(o=null==(i=e.output_tokens_details)?void 0:i.reasoning_tokens)?o:0;return{inputTokens:{total:n,noCache:n-a,cacheRead:a,cacheWrite:void 0},outputTokens:{total:r,text:r-l,reasoning:l},raw:e}}function Hs(e,t){return!!t&&t.some((t=>e.startsWith(t)))}var Gs=_t.Ik({itemId:_t.Yj().nullish(),reasoningEncryptedContent:_t.Yj().nullish()});function zs({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"other"}}var Ws=bt((()=>xt(_t.KC([_t.Ik({type:_t.eu("response.output_text.delta"),item_id:_t.Yj(),delta:_t.Yj(),logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai(),top_logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai()}))})).nullish()}),_t.Ik({type:_t.k5(["response.completed","response.incomplete"]),response:_t.Ik({incomplete_details:_t.Ik({reason:_t.Yj()}).nullish(),usage:_t.Ik({input_tokens:_t.ai(),input_tokens_details:_t.Ik({cached_tokens:_t.ai().nullish()}).nullish(),output_tokens:_t.ai(),output_tokens_details:_t.Ik({reasoning_tokens:_t.ai().nullish()}).nullish()}),service_tier:_t.Yj().nullish()})}),_t.Ik({type:_t.eu("response.created"),response:_t.Ik({id:_t.Yj(),created_at:_t.ai(),model:_t.Yj(),service_tier:_t.Yj().nullish()})}),_t.Ik({type:_t.eu("response.output_item.added"),output_index:_t.ai(),item:_t.gM("type",[_t.Ik({type:_t.eu("message"),id:_t.Yj()}),_t.Ik({type:_t.eu("reasoning"),id:_t.Yj(),encrypted_content:_t.Yj().nullish()}),_t.Ik({type:_t.eu("function_call"),id:_t.Yj(),call_id:_t.Yj(),name:_t.Yj(),arguments:_t.Yj()}),_t.Ik({type:_t.eu("web_search_call"),id:_t.Yj(),status:_t.Yj()}),_t.Ik({type:_t.eu("computer_call"),id:_t.Yj(),status:_t.Yj()}),_t.Ik({type:_t.eu("file_search_call"),id:_t.Yj()}),_t.Ik({type:_t.eu("image_generation_call"),id:_t.Yj()}),_t.Ik({type:_t.eu("code_interpreter_call"),id:_t.Yj(),container_id:_t.Yj(),code:_t.Yj().nullable(),outputs:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("logs"),logs:_t.Yj()}),_t.Ik({type:_t.eu("image"),url:_t.Yj()})])).nullable(),status:_t.Yj()}),_t.Ik({type:_t.eu("mcp_call"),id:_t.Yj(),status:_t.Yj(),approval_request_id:_t.Yj().nullish()}),_t.Ik({type:_t.eu("mcp_list_tools"),id:_t.Yj()}),_t.Ik({type:_t.eu("mcp_approval_request"),id:_t.Yj()}),_t.Ik({type:_t.eu("apply_patch_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed"]),operation:_t.gM("type",[_t.Ik({type:_t.eu("create_file"),path:_t.Yj(),diff:_t.Yj()}),_t.Ik({type:_t.eu("delete_file"),path:_t.Yj()}),_t.Ik({type:_t.eu("update_file"),path:_t.Yj(),diff:_t.Yj()})])}),_t.Ik({type:_t.eu("shell_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed","incomplete"]),action:_t.Ik({commands:_t.YO(_t.Yj())})})])}),_t.Ik({type:_t.eu("response.output_item.done"),output_index:_t.ai(),item:_t.gM("type",[_t.Ik({type:_t.eu("message"),id:_t.Yj()}),_t.Ik({type:_t.eu("reasoning"),id:_t.Yj(),encrypted_content:_t.Yj().nullish()}),_t.Ik({type:_t.eu("function_call"),id:_t.Yj(),call_id:_t.Yj(),name:_t.Yj(),arguments:_t.Yj(),status:_t.eu("completed")}),_t.Ik({type:_t.eu("code_interpreter_call"),id:_t.Yj(),code:_t.Yj().nullable(),container_id:_t.Yj(),outputs:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("logs"),logs:_t.Yj()}),_t.Ik({type:_t.eu("image"),url:_t.Yj()})])).nullable()}),_t.Ik({type:_t.eu("image_generation_call"),id:_t.Yj(),result:_t.Yj()}),_t.Ik({type:_t.eu("web_search_call"),id:_t.Yj(),status:_t.Yj(),action:_t.gM("type",[_t.Ik({type:_t.eu("search"),query:_t.Yj().nullish(),sources:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("url"),url:_t.Yj()}),_t.Ik({type:_t.eu("api"),name:_t.Yj()})])).nullish()}),_t.Ik({type:_t.eu("open_page"),url:_t.Yj().nullish()}),_t.Ik({type:_t.eu("find_in_page"),url:_t.Yj().nullish(),pattern:_t.Yj().nullish()})])}),_t.Ik({type:_t.eu("file_search_call"),id:_t.Yj(),queries:_t.YO(_t.Yj()),results:_t.YO(_t.Ik({attributes:_t.g1(_t.Yj(),_t.KC([_t.Yj(),_t.ai(),_t.zM()])),file_id:_t.Yj(),filename:_t.Yj(),score:_t.ai(),text:_t.Yj()})).nullish()}),_t.Ik({type:_t.eu("local_shell_call"),id:_t.Yj(),call_id:_t.Yj(),action:_t.Ik({type:_t.eu("exec"),command:_t.YO(_t.Yj()),timeout_ms:_t.ai().optional(),user:_t.Yj().optional(),working_directory:_t.Yj().optional(),env:_t.g1(_t.Yj(),_t.Yj()).optional()})}),_t.Ik({type:_t.eu("computer_call"),id:_t.Yj(),status:_t.eu("completed")}),_t.Ik({type:_t.eu("mcp_call"),id:_t.Yj(),status:_t.Yj(),arguments:_t.Yj(),name:_t.Yj(),server_label:_t.Yj(),output:_t.Yj().nullish(),error:_t.KC([_t.Yj(),_t.Ik({type:_t.Yj().optional(),code:_t.KC([_t.ai(),_t.Yj()]).optional(),message:_t.Yj().optional()}).loose()]).nullish(),approval_request_id:_t.Yj().nullish()}),_t.Ik({type:_t.eu("mcp_list_tools"),id:_t.Yj(),server_label:_t.Yj(),tools:_t.YO(_t.Ik({name:_t.Yj(),description:_t.Yj().optional(),input_schema:_t.bz(),annotations:_t.g1(_t.Yj(),_t.L5()).optional()})),error:_t.KC([_t.Yj(),_t.Ik({type:_t.Yj().optional(),code:_t.KC([_t.ai(),_t.Yj()]).optional(),message:_t.Yj().optional()}).loose()]).optional()}),_t.Ik({type:_t.eu("mcp_approval_request"),id:_t.Yj(),server_label:_t.Yj(),name:_t.Yj(),arguments:_t.Yj(),approval_request_id:_t.Yj().optional()}),_t.Ik({type:_t.eu("apply_patch_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed"]),operation:_t.gM("type",[_t.Ik({type:_t.eu("create_file"),path:_t.Yj(),diff:_t.Yj()}),_t.Ik({type:_t.eu("delete_file"),path:_t.Yj()}),_t.Ik({type:_t.eu("update_file"),path:_t.Yj(),diff:_t.Yj()})])}),_t.Ik({type:_t.eu("shell_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed","incomplete"]),action:_t.Ik({commands:_t.YO(_t.Yj())})})])}),_t.Ik({type:_t.eu("response.function_call_arguments.delta"),item_id:_t.Yj(),output_index:_t.ai(),delta:_t.Yj()}),_t.Ik({type:_t.eu("response.image_generation_call.partial_image"),item_id:_t.Yj(),output_index:_t.ai(),partial_image_b64:_t.Yj()}),_t.Ik({type:_t.eu("response.code_interpreter_call_code.delta"),item_id:_t.Yj(),output_index:_t.ai(),delta:_t.Yj()}),_t.Ik({type:_t.eu("response.code_interpreter_call_code.done"),item_id:_t.Yj(),output_index:_t.ai(),code:_t.Yj()}),_t.Ik({type:_t.eu("response.output_text.annotation.added"),annotation:_t.gM("type",[_t.Ik({type:_t.eu("url_citation"),start_index:_t.ai(),end_index:_t.ai(),url:_t.Yj(),title:_t.Yj()}),_t.Ik({type:_t.eu("file_citation"),file_id:_t.Yj(),filename:_t.Yj(),index:_t.ai()}),_t.Ik({type:_t.eu("container_file_citation"),container_id:_t.Yj(),file_id:_t.Yj(),filename:_t.Yj(),start_index:_t.ai(),end_index:_t.ai()}),_t.Ik({type:_t.eu("file_path"),file_id:_t.Yj(),index:_t.ai()})])}),_t.Ik({type:_t.eu("response.reasoning_summary_part.added"),item_id:_t.Yj(),summary_index:_t.ai()}),_t.Ik({type:_t.eu("response.reasoning_summary_text.delta"),item_id:_t.Yj(),summary_index:_t.ai(),delta:_t.Yj()}),_t.Ik({type:_t.eu("response.reasoning_summary_part.done"),item_id:_t.Yj(),summary_index:_t.ai()}),_t.Ik({type:_t.eu("response.apply_patch_call_operation_diff.delta"),item_id:_t.Yj(),output_index:_t.ai(),delta:_t.Yj(),obfuscation:_t.Yj().nullish()}),_t.Ik({type:_t.eu("response.apply_patch_call_operation_diff.done"),item_id:_t.Yj(),output_index:_t.ai(),diff:_t.Yj()}),_t.Ik({type:_t.eu("error"),sequence_number:_t.ai(),error:_t.Ik({type:_t.Yj(),code:_t.Yj(),message:_t.Yj(),param:_t.Yj().nullish()})}),_t.Ik({type:_t.Yj()}).loose().transform((e=>({type:"unknown_chunk",message:e.type})))])))),js=bt((()=>xt(_t.Ik({id:_t.Yj().optional(),created_at:_t.ai().optional(),error:_t.Ik({message:_t.Yj(),type:_t.Yj(),param:_t.Yj().nullish(),code:_t.Yj()}).nullish(),model:_t.Yj().optional(),output:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("message"),role:_t.eu("assistant"),id:_t.Yj(),content:_t.YO(_t.Ik({type:_t.eu("output_text"),text:_t.Yj(),logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai(),top_logprobs:_t.YO(_t.Ik({token:_t.Yj(),logprob:_t.ai()}))})).nullish(),annotations:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("url_citation"),start_index:_t.ai(),end_index:_t.ai(),url:_t.Yj(),title:_t.Yj()}),_t.Ik({type:_t.eu("file_citation"),file_id:_t.Yj(),filename:_t.Yj(),index:_t.ai()}),_t.Ik({type:_t.eu("container_file_citation"),container_id:_t.Yj(),file_id:_t.Yj(),filename:_t.Yj(),start_index:_t.ai(),end_index:_t.ai()}),_t.Ik({type:_t.eu("file_path"),file_id:_t.Yj(),index:_t.ai()})]))}))}),_t.Ik({type:_t.eu("web_search_call"),id:_t.Yj(),status:_t.Yj(),action:_t.gM("type",[_t.Ik({type:_t.eu("search"),query:_t.Yj().nullish(),sources:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("url"),url:_t.Yj()}),_t.Ik({type:_t.eu("api"),name:_t.Yj()})])).nullish()}),_t.Ik({type:_t.eu("open_page"),url:_t.Yj().nullish()}),_t.Ik({type:_t.eu("find_in_page"),url:_t.Yj().nullish(),pattern:_t.Yj().nullish()})])}),_t.Ik({type:_t.eu("file_search_call"),id:_t.Yj(),queries:_t.YO(_t.Yj()),results:_t.YO(_t.Ik({attributes:_t.g1(_t.Yj(),_t.KC([_t.Yj(),_t.ai(),_t.zM()])),file_id:_t.Yj(),filename:_t.Yj(),score:_t.ai(),text:_t.Yj()})).nullish()}),_t.Ik({type:_t.eu("code_interpreter_call"),id:_t.Yj(),code:_t.Yj().nullable(),container_id:_t.Yj(),outputs:_t.YO(_t.gM("type",[_t.Ik({type:_t.eu("logs"),logs:_t.Yj()}),_t.Ik({type:_t.eu("image"),url:_t.Yj()})])).nullable()}),_t.Ik({type:_t.eu("image_generation_call"),id:_t.Yj(),result:_t.Yj()}),_t.Ik({type:_t.eu("local_shell_call"),id:_t.Yj(),call_id:_t.Yj(),action:_t.Ik({type:_t.eu("exec"),command:_t.YO(_t.Yj()),timeout_ms:_t.ai().optional(),user:_t.Yj().optional(),working_directory:_t.Yj().optional(),env:_t.g1(_t.Yj(),_t.Yj()).optional()})}),_t.Ik({type:_t.eu("function_call"),call_id:_t.Yj(),name:_t.Yj(),arguments:_t.Yj(),id:_t.Yj()}),_t.Ik({type:_t.eu("computer_call"),id:_t.Yj(),status:_t.Yj().optional()}),_t.Ik({type:_t.eu("reasoning"),id:_t.Yj(),encrypted_content:_t.Yj().nullish(),summary:_t.YO(_t.Ik({type:_t.eu("summary_text"),text:_t.Yj()}))}),_t.Ik({type:_t.eu("mcp_call"),id:_t.Yj(),status:_t.Yj(),arguments:_t.Yj(),name:_t.Yj(),server_label:_t.Yj(),output:_t.Yj().nullish(),error:_t.KC([_t.Yj(),_t.Ik({type:_t.Yj().optional(),code:_t.KC([_t.ai(),_t.Yj()]).optional(),message:_t.Yj().optional()}).loose()]).nullish(),approval_request_id:_t.Yj().nullish()}),_t.Ik({type:_t.eu("mcp_list_tools"),id:_t.Yj(),server_label:_t.Yj(),tools:_t.YO(_t.Ik({name:_t.Yj(),description:_t.Yj().optional(),input_schema:_t.bz(),annotations:_t.g1(_t.Yj(),_t.L5()).optional()})),error:_t.KC([_t.Yj(),_t.Ik({type:_t.Yj().optional(),code:_t.KC([_t.ai(),_t.Yj()]).optional(),message:_t.Yj().optional()}).loose()]).optional()}),_t.Ik({type:_t.eu("mcp_approval_request"),id:_t.Yj(),server_label:_t.Yj(),name:_t.Yj(),arguments:_t.Yj(),approval_request_id:_t.Yj().optional()}),_t.Ik({type:_t.eu("apply_patch_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed"]),operation:_t.gM("type",[_t.Ik({type:_t.eu("create_file"),path:_t.Yj(),diff:_t.Yj()}),_t.Ik({type:_t.eu("delete_file"),path:_t.Yj()}),_t.Ik({type:_t.eu("update_file"),path:_t.Yj(),diff:_t.Yj()})])}),_t.Ik({type:_t.eu("shell_call"),id:_t.Yj(),call_id:_t.Yj(),status:_t.k5(["in_progress","completed","incomplete"]),action:_t.Ik({commands:_t.YO(_t.Yj())})})])).optional(),service_tier:_t.Yj().nullish(),incomplete_details:_t.Ik({reason:_t.Yj()}).nullish(),usage:_t.Ik({input_tokens:_t.ai(),input_tokens_details:_t.Ik({cached_tokens:_t.ai().nullish()}).nullish(),output_tokens:_t.ai(),output_tokens_details:_t.Ik({reasoning_tokens:_t.ai().nullish()}).nullish()}).optional()})))),Us=bt((()=>xt(_t.Ik({conversation:_t.Yj().nullish(),include:_t.YO(_t.k5(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:_t.Yj().nullish(),logprobs:_t.KC([_t.zM(),_t.ai().min(1).max(20)]).optional(),maxToolCalls:_t.ai().nullish(),metadata:_t.bz().nullish(),parallelToolCalls:_t.zM().nullish(),previousResponseId:_t.Yj().nullish(),promptCacheKey:_t.Yj().nullish(),promptCacheRetention:_t.k5(["in_memory","24h"]).nullish(),reasoningEffort:_t.Yj().nullish(),reasoningSummary:_t.Yj().nullish(),safetyIdentifier:_t.Yj().nullish(),serviceTier:_t.k5(["auto","flex","priority","default"]).nullish(),store:_t.zM().nullish(),strictJsonSchema:_t.zM().nullish(),textVerbosity:_t.k5(["low","medium","high"]).nullish(),truncation:_t.k5(["auto","disabled"]).nullish(),user:_t.Yj().nullish(),systemMessageMode:_t.k5(["system","developer","remove"]).optional(),forceReasoning:_t.zM().optional()}))));function $s(e){var t,s;const i={};for(const o of e)if("assistant"===o.role)for(const e of o.content){if("tool-call"!==e.type)continue;const o=null==(s=null==(t=e.providerOptions)?void 0:t.openai)?void 0:s.approvalRequestId;null!=o&&(i[o]=e.toolCallId)}return i}var Ys=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:s,topP:i,topK:o,presencePenalty:n,frequencyPenalty:r,seed:a,prompt:l,providerOptions:c,tools:d,toolChoice:u,responseFormat:h}){var p,g,f,m,v,w;const C=[],y=zt(this.modelId);null!=o&&C.push({type:"unsupported",feature:"topK"}),null!=a&&C.push({type:"unsupported",feature:"seed"}),null!=n&&C.push({type:"unsupported",feature:"presencePenalty"}),null!=r&&C.push({type:"unsupported",feature:"frequencyPenalty"}),null!=s&&C.push({type:"unsupported",feature:"stopSequences"});const b=this.config.provider.includes("azure")?"azure":"openai";let S=await Ft({provider:b,providerOptions:c,schema:Us});null==S&&"openai"!==b&&(S=await Ft({provider:"openai",providerOptions:c,schema:Us}));const x=null!=(p=null==S?void 0:S.forceReasoning)?p:y.isReasoningModel;(null==S?void 0:S.conversation)&&(null==S?void 0:S.previousResponseId)&&C.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});const R=function({tools:e=[],providerToolNames:t}){const s={},i={};for(const o of e)if("provider"===o.type&&o.id in t){const e=t[o.id];s[o.name]=e,i[e]=o.name}return{toProviderToolName:e=>{var t;return null!=(t=s[e])?t:e},toCustomToolName:e=>{var t;return null!=(t=i[e])?t:e}}}({tools:d,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch"}}),{input:P,warnings:E}=await async function({prompt:e,toolNameMapping:t,systemMessageMode:s,providerOptionsName:i,fileIdPrefixes:o,store:n,hasLocalShellTool:r=!1,hasShellTool:a=!1,hasApplyPatchTool:l=!1}){var c,d,u,h,p,g,f,m,v,w,C,y,b;const S=[],x=[],R=new Set;for(const{role:P,content:E}of e)switch(P){case"system":switch(s){case"system":S.push({role:"system",content:E});break;case"developer":S.push({role:"developer",content:E});break;case"remove":x.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${s}`)}break;case"user":S.push({role:"user",content:E.map(((e,t)=>{var s,n,r;switch(e.type){case"text":return{type:"input_text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"input_image",...e.data instanceof Bt?{image_url:e.data.toString()}:"string"==typeof e.data&&Hs(e.data,o)?{file_id:e.data}:{image_url:`data:${t};base64,${De(e.data)}`},detail:null==(n=null==(s=e.providerOptions)?void 0:s[i])?void 0:n.imageDetail}}if("application/pdf"===e.mediaType)return e.data instanceof Bt?{type:"input_file",file_url:e.data.toString()}:{type:"input_file",..."string"==typeof e.data&&Hs(e.data,o)?{file_id:e.data}:{filename:null!=(r=e.filename)?r:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${De(e.data)}`}};throw new Ce({functionality:`file part media type ${e.mediaType}`})}}))});break;case"assistant":{const e={};for(const s of E)switch(s.type){case"text":{const e=null==(d=null==(c=s.providerOptions)?void 0:c[i])?void 0:d.itemId;if(n&&null!=e){S.push({type:"item_reference",id:e});break}S.push({role:"assistant",content:[{type:"output_text",text:s.text}],id:e});break}case"tool-call":{const e=null!=(f=null==(h=null==(u=s.providerOptions)?void 0:u[i])?void 0:h.itemId)?f:null==(g=null==(p=s.providerMetadata)?void 0:p[i])?void 0:g.itemId;if(s.providerExecuted){n&&null!=e&&S.push({type:"item_reference",id:e});break}if(n&&null!=e){S.push({type:"item_reference",id:e});break}const o=t.toProviderToolName(s.toolName);if(r&&"local_shell"===o){const t=await Rt({value:s.input,schema:Ps});S.push({type:"local_shell_call",call_id:s.toolCallId,id:e,action:{type:"exec",command:t.action.command,timeout_ms:t.action.timeoutMs,user:t.action.user,working_directory:t.action.workingDirectory,env:t.action.env}});break}if(a&&"shell"===o){const t=await Rt({value:s.input,schema:ks});S.push({type:"shell_call",call_id:s.toolCallId,id:e,status:"completed",action:{commands:t.action.commands,timeout_ms:t.action.timeoutMs,max_output_length:t.action.maxOutputLength}});break}S.push({type:"function_call",call_id:s.toolCallId,name:o,arguments:JSON.stringify(s.input),id:e});break}case"tool-result":if("execution-denied"===s.output.type||"json"===s.output.type&&"object"==typeof s.output.value&&null!=s.output.value&&"type"in s.output.value&&"execution-denied"===s.output.value.type)break;if(n){const e=null!=(w=null==(v=null==(m=s.providerMetadata)?void 0:m[i])?void 0:v.itemId)?w:s.toolCallId;S.push({type:"item_reference",id:e})}else x.push({type:"other",message:`Results for OpenAI tool ${s.toolName} are not sent to the API when store is false`});break;case"reasoning":{const t=await Ft({provider:i,providerOptions:s.providerOptions,schema:Gs}),o=null==t?void 0:t.itemId;if(null!=o){const i=e[o];if(n)void 0===i&&(S.push({type:"item_reference",id:o}),e[o]={type:"reasoning",id:o,summary:[]});else{const n=[];s.text.length>0?n.push({type:"summary_text",text:s.text}):void 0!==i&&x.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(s)}.`}),void 0===i?(e[o]={type:"reasoning",id:o,encrypted_content:null==t?void 0:t.reasoningEncryptedContent,summary:n},S.push(e[o])):(i.summary.push(...n),null!=(null==t?void 0:t.reasoningEncryptedContent)&&(i.encrypted_content=t.reasoningEncryptedContent))}}else x.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(s)}.`});break}}break}case"tool":for(const e of E){if("tool-approval-response"===e.type){const t=e;if(R.has(t.approvalId))continue;R.add(t.approvalId),n&&S.push({type:"item_reference",id:t.approvalId}),S.push({type:"mcp_approval_response",approval_request_id:t.approvalId,approve:t.approved});continue}const s=e.output;if("execution-denied"===s.type&&(null==(y=null==(C=s.providerOptions)?void 0:C.openai)?void 0:y.approvalId))continue;const i=t.toProviderToolName(e.toolName);if(r&&"local_shell"===i&&"json"===s.type){const t=await Rt({value:s.value,schema:Es});S.push({type:"local_shell_call_output",call_id:e.toolCallId,output:t.output});continue}if(a&&"shell"===i&&"json"===s.type){const t=await Rt({value:s.value,schema:Fs});S.push({type:"shell_call_output",call_id:e.toolCallId,output:t.output.map((e=>({stdout:e.stdout,stderr:e.stderr,outcome:"timeout"===e.outcome.type?{type:"timeout"}:{type:"exit",exit_code:e.outcome.exitCode}})))});continue}if(l&&"apply_patch"===e.toolName&&"json"===s.type){const t=await Rt({value:s.value,schema:hs});S.push({type:"apply_patch_call_output",call_id:e.toolCallId,status:t.status,output:t.output});continue}let o;switch(s.type){case"text":case"error-text":o=s.value;break;case"execution-denied":o=null!=(b=s.reason)?b:"Tool execution denied.";break;case"json":case"error-json":o=JSON.stringify(s.value);break;case"content":o=s.value.map((e=>{var t;switch(e.type){case"text":return{type:"input_text",text:e.text};case"image-data":return{type:"input_image",image_url:`data:${e.mediaType};base64,${e.data}`};case"image-url":return{type:"input_image",image_url:e.url};case"file-data":return{type:"input_file",filename:null!=(t=e.filename)?t:"data",file_data:`data:${e.mediaType};base64,${e.data}`};default:return void x.push({type:"other",message:`unsupported tool content part type: ${e.type}`})}})).filter(je)}S.push({type:"function_call_output",call_id:e.toolCallId,output:o})}break;default:throw new Error(`Unsupported role: ${P}`)}return{input:S,warnings:x}}({prompt:l,toolNameMapping:R,systemMessageMode:null!=(g=null==S?void 0:S.systemMessageMode)?g:x?"developer":y.systemMessageMode,providerOptionsName:b,fileIdPrefixes:this.config.fileIdPrefixes,store:null==(f=null==S?void 0:S.store)||f,hasLocalShellTool:D("openai.local_shell"),hasShellTool:D("openai.shell"),hasApplyPatchTool:D("openai.apply_patch")});C.push(...E);const I=null==(m=null==S?void 0:S.strictJsonSchema)||m;let k=null==S?void 0:S.include;function F(e){null==k?k=[e]:k.includes(e)||(k=[...k,e])}function D(e){return null!=(null==d?void 0:d.find((t=>"provider"===t.type&&t.id===e)))}const T="number"==typeof(null==S?void 0:S.logprobs)?null==S?void 0:S.logprobs:!0===(null==S?void 0:S.logprobs)?20:void 0;T&&F("message.output_text.logprobs");const A=null==(v=null==d?void 0:d.find((e=>"provider"===e.type&&("openai.web_search"===e.id||"openai.web_search_preview"===e.id))))?void 0:v.name;A&&F("web_search_call.action.sources"),D("openai.code_interpreter")&&F("code_interpreter_call.outputs");const M=null==S?void 0:S.store;!1===M&&x&&F("reasoning.encrypted_content");const N={model:this.modelId,input:P,temperature:t,top_p:i,max_output_tokens:e,...("json"===(null==h?void 0:h.type)||(null==S?void 0:S.textVerbosity))&&{text:{..."json"===(null==h?void 0:h.type)&&{format:null!=h.schema?{type:"json_schema",strict:I,name:null!=(w=h.name)?w:"response",description:h.description,schema:h.schema}:{type:"json_object"}},...(null==S?void 0:S.textVerbosity)&&{verbosity:S.textVerbosity}}},conversation:null==S?void 0:S.conversation,max_tool_calls:null==S?void 0:S.maxToolCalls,metadata:null==S?void 0:S.metadata,parallel_tool_calls:null==S?void 0:S.parallelToolCalls,previous_response_id:null==S?void 0:S.previousResponseId,store:M,user:null==S?void 0:S.user,instructions:null==S?void 0:S.instructions,service_tier:null==S?void 0:S.serviceTier,include:k,prompt_cache_key:null==S?void 0:S.promptCacheKey,prompt_cache_retention:null==S?void 0:S.promptCacheRetention,safety_identifier:null==S?void 0:S.safetyIdentifier,top_logprobs:T,truncation:null==S?void 0:S.truncation,...x&&(null!=(null==S?void 0:S.reasoningEffort)||null!=(null==S?void 0:S.reasoningSummary))&&{reasoning:{...null!=(null==S?void 0:S.reasoningEffort)&&{effort:S.reasoningEffort},...null!=(null==S?void 0:S.reasoningSummary)&&{summary:S.reasoningSummary}}}};x?"none"===(null==S?void 0:S.reasoningEffort)&&y.supportsNonReasoningParameters||(null!=N.temperature&&(N.temperature=void 0,C.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=N.top_p&&(N.top_p=void 0,C.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(null!=(null==S?void 0:S.reasoningEffort)&&C.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),null!=(null==S?void 0:S.reasoningSummary)&&C.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),"flex"!==(null==S?void 0:S.serviceTier)||y.supportsFlexProcessing||(C.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete N.service_tier),"priority"!==(null==S?void 0:S.serviceTier)||y.supportsPriorityProcessing||(C.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete N.service_tier);const{tools:L,toolChoice:V,toolWarnings:_}=await async function({tools:e,toolChoice:t}){const s=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:s};const i=[];for(const t of e)switch(t.type){case"function":i.push({type:"function",name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":switch(t.id){case"openai.file_search":{const e=await Rt({value:t.args,schema:ys});i.push({type:"file_search",vector_store_ids:e.vectorStoreIds,max_num_results:e.maxNumResults,ranking_options:e.ranking?{ranker:e.ranking.ranker,score_threshold:e.ranking.scoreThreshold}:void 0,filters:e.filters});break}case"openai.local_shell":i.push({type:"local_shell"});break;case"openai.shell":i.push({type:"shell"});break;case"openai.apply_patch":i.push({type:"apply_patch"});break;case"openai.web_search_preview":{const e=await Rt({value:t.args,schema:Ms});i.push({type:"web_search_preview",search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.web_search":{const e=await Rt({value:t.args,schema:Ts});i.push({type:"web_search",filters:null!=e.filters?{allowed_domains:e.filters.allowedDomains}:void 0,external_web_access:e.externalWebAccess,search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.code_interpreter":{const e=await Rt({value:t.args,schema:ms});i.push({type:"code_interpreter",container:null==e.container?{type:"auto",file_ids:void 0}:"string"==typeof e.container?e.container:{type:"auto",file_ids:e.container.fileIds}});break}case"openai.image_generation":{const e=await Rt({value:t.args,schema:xs});i.push({type:"image_generation",background:e.background,input_fidelity:e.inputFidelity,input_image_mask:e.inputImageMask?{file_id:e.inputImageMask.fileId,image_url:e.inputImageMask.imageUrl}:void 0,model:e.model,moderation:e.moderation,partial_images:e.partialImages,quality:e.quality,output_compression:e.outputCompression,output_format:e.outputFormat,size:e.size});break}case"openai.mcp":{const e=await Rt({value:t.args,schema:Vs}),s=e=>({tool_names:e.toolNames}),o=e.requireApproval,n=null==o?void 0:"string"==typeof o?o:null!=o.never?{never:s(o.never)}:void 0;i.push({type:"mcp",server_label:e.serverLabel,allowed_tools:Array.isArray(e.allowedTools)?e.allowedTools:e.allowedTools?{read_only:e.allowedTools.readOnly,tool_names:e.allowedTools.toolNames}:void 0,authorization:e.authorization,connector_id:e.connectorId,headers:e.headers,require_approval:null!=n?n:"never",server_description:e.serverDescription,server_url:e.serverUrl});break}}break;default:s.push({type:"unsupported",feature:`function tool ${t}`})}if(null==t)return{tools:i,toolChoice:void 0,toolWarnings:s};const o=t.type;switch(o){case"auto":case"none":case"required":return{tools:i,toolChoice:o,toolWarnings:s};case"tool":return{tools:i,toolChoice:"code_interpreter"===t.toolName||"file_search"===t.toolName||"image_generation"===t.toolName||"web_search_preview"===t.toolName||"web_search"===t.toolName||"mcp"===t.toolName||"apply_patch"===t.toolName?{type:t.toolName}:{type:"function",name:t.toolName},toolWarnings:s};default:throw new Ce({functionality:`tool choice type: ${o}`})}}({tools:d,toolChoice:u});return{webSearchToolName:A,args:{...N,tools:L,tool_choice:V},warnings:[...C,..._],store:M,toolNameMapping:R,providerOptionsName:b}}async doGenerate(e){var t,s,i,o,n,r,a,l,c,d,u,h,p,g,m,v,w,C,y,b,S,x,R,P,E;const{args:I,warnings:k,webSearchToolName:F,toolNameMapping:D,providerOptionsName:T}=await this.getArgs(e),A=this.config.url({path:"/responses",modelId:this.modelId}),M=$s(e.prompt),{responseHeaders:N,value:L,rawValue:V}=await Tt({url:A,headers:Pe(this.config.headers(),e.headers),body:I,failedResponseHandler:Gt,successfulResponseHandler:Vt(js),abortSignal:e.abortSignal,fetch:this.config.fetch});if(L.error)throw new f({message:L.error.message,url:A,requestBodyValues:I,statusCode:400,responseHeaders:N,responseBody:V,isRetryable:!1});const _=[],O=[];let B=!1;for(const f of L.output)switch(f.type){case"reasoning":0===f.summary.length&&f.summary.push({type:"summary_text",text:""});for(const e of f.summary)_.push({type:"reasoning",text:e.text,providerMetadata:{[T]:{itemId:f.id,reasoningEncryptedContent:null!=(t=f.encrypted_content)?t:null}}});break;case"image_generation_call":_.push({type:"tool-call",toolCallId:f.id,toolName:D.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),_.push({type:"tool-result",toolCallId:f.id,toolName:D.toCustomToolName("image_generation"),result:{result:f.result}});break;case"local_shell_call":_.push({type:"tool-call",toolCallId:f.call_id,toolName:D.toCustomToolName("local_shell"),input:JSON.stringify({action:f.action}),providerMetadata:{[T]:{itemId:f.id}}});break;case"shell_call":_.push({type:"tool-call",toolCallId:f.call_id,toolName:D.toCustomToolName("shell"),input:JSON.stringify({action:{commands:f.action.commands}}),providerMetadata:{[T]:{itemId:f.id}}});break;case"message":for(const t of f.content){(null==(i=null==(s=e.providerOptions)?void 0:s[T])?void 0:i.logprobs)&&t.logprobs&&O.push(t.logprobs);const v={itemId:f.id,...t.annotations.length>0&&{annotations:t.annotations}};_.push({type:"text",text:t.text,providerMetadata:{[T]:v}});for(const e of t.annotations)"url_citation"===e.type?_.push({type:"source",sourceType:"url",id:null!=(r=null==(n=(o=this.config).generateId)?void 0:n.call(o))?r:Be(),url:e.url,title:e.title}):"file_citation"===e.type?_.push({type:"source",sourceType:"document",id:null!=(c=null==(l=(a=this.config).generateId)?void 0:l.call(a))?c:Be(),mediaType:"text/plain",title:e.filename,filename:e.filename,providerMetadata:{[T]:{type:e.type,fileId:e.file_id,index:e.index}}}):"container_file_citation"===e.type?_.push({type:"source",sourceType:"document",id:null!=(h=null==(u=(d=this.config).generateId)?void 0:u.call(d))?h:Be(),mediaType:"text/plain",title:e.filename,filename:e.filename,providerMetadata:{[T]:{type:e.type,fileId:e.file_id,containerId:e.container_id}}}):"file_path"===e.type&&_.push({type:"source",sourceType:"document",id:null!=(m=null==(g=(p=this.config).generateId)?void 0:g.call(p))?m:Be(),mediaType:"application/octet-stream",title:e.file_id,filename:e.file_id,providerMetadata:{[T]:{type:e.type,fileId:e.file_id,index:e.index}}})}break;case"function_call":B=!0,_.push({type:"tool-call",toolCallId:f.call_id,toolName:f.name,input:f.arguments,providerMetadata:{[T]:{itemId:f.id}}});break;case"web_search_call":_.push({type:"tool-call",toolCallId:f.id,toolName:D.toCustomToolName(null!=F?F:"web_search"),input:JSON.stringify({}),providerExecuted:!0}),_.push({type:"tool-result",toolCallId:f.id,toolName:D.toCustomToolName(null!=F?F:"web_search"),result:qs(f.action)});break;case"mcp_call":{const e=null!=f.approval_request_id&&null!=(v=M[f.approval_request_id])?v:f.id,t=`mcp.${f.name}`;_.push({type:"tool-call",toolCallId:e,toolName:t,input:f.arguments,providerExecuted:!0,dynamic:!0}),_.push({type:"tool-result",toolCallId:e,toolName:t,result:{type:"call",serverLabel:f.server_label,name:f.name,arguments:f.arguments,...null!=f.output?{output:f.output}:{},...null!=f.error?{error:f.error}:{}},providerMetadata:{[T]:{itemId:f.id}}});break}case"mcp_list_tools":break;case"mcp_approval_request":{const e=null!=(w=f.approval_request_id)?w:f.id,t=null!=(b=null==(y=(C=this.config).generateId)?void 0:y.call(C))?b:Be(),s=`mcp.${f.name}`;_.push({type:"tool-call",toolCallId:t,toolName:s,input:f.arguments,providerExecuted:!0,dynamic:!0}),_.push({type:"tool-approval-request",approvalId:e,toolCallId:t});break}case"computer_call":_.push({type:"tool-call",toolCallId:f.id,toolName:D.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),_.push({type:"tool-result",toolCallId:f.id,toolName:D.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:f.status||"completed"}});break;case"file_search_call":_.push({type:"tool-call",toolCallId:f.id,toolName:D.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),_.push({type:"tool-result",toolCallId:f.id,toolName:D.toCustomToolName("file_search"),result:{queries:f.queries,results:null!=(x=null==(S=f.results)?void 0:S.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?x:null}});break;case"code_interpreter_call":_.push({type:"tool-call",toolCallId:f.id,toolName:D.toCustomToolName("code_interpreter"),input:JSON.stringify({code:f.code,containerId:f.container_id}),providerExecuted:!0}),_.push({type:"tool-result",toolCallId:f.id,toolName:D.toCustomToolName("code_interpreter"),result:{outputs:f.outputs}});break;case"apply_patch_call":_.push({type:"tool-call",toolCallId:f.call_id,toolName:D.toCustomToolName("apply_patch"),input:JSON.stringify({callId:f.call_id,operation:f.operation}),providerMetadata:{[T]:{itemId:f.id}}})}const H={[T]:{responseId:L.id}};O.length>0&&(H[T].logprobs=O),"string"==typeof L.service_tier&&(H[T].serviceTier=L.service_tier);const G=L.usage;return{content:_,finishReason:{unified:zs({finishReason:null==(R=L.incomplete_details)?void 0:R.reason,hasFunctionCall:B}),raw:null!=(E=null==(P=L.incomplete_details)?void 0:P.reason)?E:void 0},usage:Bs(G),request:{body:I},response:{id:L.id,timestamp:new Date(1e3*L.created_at),modelId:L.model,headers:N,body:V},providerMetadata:H,warnings:k}}async doStream(e){const{args:t,warnings:s,webSearchToolName:i,toolNameMapping:o,store:n,providerOptionsName:r}=await this.getArgs(e),{responseHeaders:a,value:l}=await Tt({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:Gt,successfulResponseHandler:Lt(Ws),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=this,d=$s(e.prompt),u=new Map;let h,p={unified:"other",raw:void 0};const g=[];let f=null;const m={},v=[];let w=!1;const C={};let y;return{stream:l.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:s})},transform(t,s){var a,l,b,S,x,R,P,E,I,k,F,D,T,A,M,N,L,V,_,O,B,H,G,z,W,j,U,$,Y,K;if(e.includeRawChunks&&s.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return p={unified:"error",raw:void 0},void s.enqueue({type:"error",error:t.error});const q=t.value;if(Ks(q))if("function_call"===q.item.type)m[q.output_index]={toolName:q.item.name,toolCallId:q.item.call_id},s.enqueue({type:"tool-input-start",id:q.item.call_id,toolName:q.item.name});else if("web_search_call"===q.item.type)m[q.output_index]={toolName:o.toCustomToolName(null!=i?i:"web_search"),toolCallId:q.item.id},s.enqueue({type:"tool-input-start",id:q.item.id,toolName:o.toCustomToolName(null!=i?i:"web_search"),providerExecuted:!0}),s.enqueue({type:"tool-input-end",id:q.item.id}),s.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:o.toCustomToolName(null!=i?i:"web_search"),input:JSON.stringify({}),providerExecuted:!0});else if("computer_call"===q.item.type)m[q.output_index]={toolName:o.toCustomToolName("computer_use"),toolCallId:q.item.id},s.enqueue({type:"tool-input-start",id:q.item.id,toolName:o.toCustomToolName("computer_use"),providerExecuted:!0});else if("code_interpreter_call"===q.item.type)m[q.output_index]={toolName:o.toCustomToolName("code_interpreter"),toolCallId:q.item.id,codeInterpreter:{containerId:q.item.container_id}},s.enqueue({type:"tool-input-start",id:q.item.id,toolName:o.toCustomToolName("code_interpreter"),providerExecuted:!0}),s.enqueue({type:"tool-input-delta",id:q.item.id,delta:`{"containerId":"${q.item.container_id}","code":"`});else if("file_search_call"===q.item.type)s.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:o.toCustomToolName("file_search"),input:"{}",providerExecuted:!0});else if("image_generation_call"===q.item.type)s.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:o.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0});else if("mcp_call"===q.item.type||"mcp_list_tools"===q.item.type||"mcp_approval_request"===q.item.type);else if("apply_patch_call"===q.item.type){const{call_id:e,operation:t}=q.item;if(m[q.output_index]={toolName:o.toCustomToolName("apply_patch"),toolCallId:e,applyPatch:{hasDiff:"delete_file"===t.type,endEmitted:"delete_file"===t.type}},s.enqueue({type:"tool-input-start",id:e,toolName:o.toCustomToolName("apply_patch")}),"delete_file"===t.type){const i=JSON.stringify({callId:e,operation:t});s.enqueue({type:"tool-input-delta",id:e,delta:i}),s.enqueue({type:"tool-input-end",id:e})}else s.enqueue({type:"tool-input-delta",id:e,delta:`{"callId":"${Zs(e)}","operation":{"type":"${Zs(t.type)}","path":"${Zs(t.path)}","diff":"`})}else"shell_call"===q.item.type?m[q.output_index]={toolName:o.toCustomToolName("shell"),toolCallId:q.item.call_id}:"message"===q.item.type?(v.splice(0,v.length),s.enqueue({type:"text-start",id:q.item.id,providerMetadata:{[r]:{itemId:q.item.id}}})):Ks(q)&&"reasoning"===q.item.type&&(C[q.item.id]={encryptedContent:q.item.encrypted_content,summaryParts:{0:"active"}},s.enqueue({type:"reasoning-start",id:`${q.item.id}:0`,providerMetadata:{[r]:{itemId:q.item.id,reasoningEncryptedContent:null!=(a=q.item.encrypted_content)?a:null}}}));else if(function(e){return"response.output_item.done"===e.type}(q)){if("message"===q.item.type)s.enqueue({type:"text-end",id:q.item.id,providerMetadata:{[r]:{itemId:q.item.id,...v.length>0&&{annotations:v}}}});else if("function_call"===q.item.type)m[q.output_index]=void 0,w=!0,s.enqueue({type:"tool-input-end",id:q.item.call_id}),s.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:q.item.name,input:q.item.arguments,providerMetadata:{[r]:{itemId:q.item.id}}});else if("web_search_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:o.toCustomToolName(null!=i?i:"web_search"),result:qs(q.item.action)});else if("computer_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-input-end",id:q.item.id}),s.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:o.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),s.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:o.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:q.item.status||"completed"}});else if("file_search_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:o.toCustomToolName("file_search"),result:{queries:q.item.queries,results:null!=(b=null==(l=q.item.results)?void 0:l.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?b:null}});else if("code_interpreter_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:o.toCustomToolName("code_interpreter"),result:{outputs:q.item.outputs}});else if("image_generation_call"===q.item.type)s.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:o.toCustomToolName("image_generation"),result:{result:q.item.result}});else if("mcp_call"===q.item.type){m[q.output_index]=void 0;const e=null!=(S=q.item.approval_request_id)?S:void 0,t=null!=e&&null!=(R=null!=(x=u.get(e))?x:d[e])?R:q.item.id,i=`mcp.${q.item.name}`;s.enqueue({type:"tool-call",toolCallId:t,toolName:i,input:q.item.arguments,providerExecuted:!0,dynamic:!0}),s.enqueue({type:"tool-result",toolCallId:t,toolName:i,result:{type:"call",serverLabel:q.item.server_label,name:q.item.name,arguments:q.item.arguments,...null!=q.item.output?{output:q.item.output}:{},...null!=q.item.error?{error:q.item.error}:{}},providerMetadata:{[r]:{itemId:q.item.id}}})}else if("mcp_list_tools"===q.item.type)m[q.output_index]=void 0;else if("apply_patch_call"===q.item.type){const e=m[q.output_index];(null==e?void 0:e.applyPatch)&&!e.applyPatch.endEmitted&&"delete_file"!==q.item.operation.type&&(e.applyPatch.hasDiff||s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Zs(q.item.operation.diff)}),s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}}'}),s.enqueue({type:"tool-input-end",id:e.toolCallId}),e.applyPatch.endEmitted=!0),e&&"completed"===q.item.status&&s.enqueue({type:"tool-call",toolCallId:e.toolCallId,toolName:o.toCustomToolName("apply_patch"),input:JSON.stringify({callId:q.item.call_id,operation:q.item.operation}),providerMetadata:{[r]:{itemId:q.item.id}}}),m[q.output_index]=void 0}else if("mcp_approval_request"===q.item.type){m[q.output_index]=void 0;const e=null!=(I=null==(E=(P=c.config).generateId)?void 0:E.call(P))?I:Be(),t=null!=(k=q.item.approval_request_id)?k:q.item.id;u.set(t,e);const i=`mcp.${q.item.name}`;s.enqueue({type:"tool-call",toolCallId:e,toolName:i,input:q.item.arguments,providerExecuted:!0,dynamic:!0}),s.enqueue({type:"tool-approval-request",approvalId:t,toolCallId:e})}else if("local_shell_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:o.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:q.item.action.command,timeoutMs:q.item.action.timeout_ms,user:q.item.action.user,workingDirectory:q.item.action.working_directory,env:q.item.action.env}}),providerMetadata:{[r]:{itemId:q.item.id}}});else if("shell_call"===q.item.type)m[q.output_index]=void 0,s.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:o.toCustomToolName("shell"),input:JSON.stringify({action:{commands:q.item.action.commands}}),providerMetadata:{[r]:{itemId:q.item.id}}});else if("reasoning"===q.item.type){const e=C[q.item.id],t=Object.entries(e.summaryParts).filter((([e,t])=>"active"===t||"can-conclude"===t)).map((([e])=>e));for(const e of t)s.enqueue({type:"reasoning-end",id:`${q.item.id}:${e}`,providerMetadata:{[r]:{itemId:q.item.id,reasoningEncryptedContent:null!=(F=q.item.encrypted_content)?F:null}}});delete C[q.item.id]}}else if(function(e){return"response.function_call_arguments.delta"===e.type}(q)){const e=m[q.output_index];null!=e&&s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:q.delta})}else if(function(e){return"response.apply_patch_call_operation_diff.delta"===e.type}(q)){const e=m[q.output_index];(null==e?void 0:e.applyPatch)&&(s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Zs(q.delta)}),e.applyPatch.hasDiff=!0)}else if(function(e){return"response.apply_patch_call_operation_diff.done"===e.type}(q)){const e=m[q.output_index];(null==e?void 0:e.applyPatch)&&!e.applyPatch.endEmitted&&(e.applyPatch.hasDiff||(s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Zs(q.diff)}),e.applyPatch.hasDiff=!0),s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}}'}),s.enqueue({type:"tool-input-end",id:e.toolCallId}),e.applyPatch.endEmitted=!0)}else if(function(e){return"response.image_generation_call.partial_image"===e.type}(q))s.enqueue({type:"tool-result",toolCallId:q.item_id,toolName:o.toCustomToolName("image_generation"),result:{result:q.partial_image_b64},preliminary:!0});else if(function(e){return"response.code_interpreter_call_code.delta"===e.type}(q)){const e=m[q.output_index];null!=e&&s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Zs(q.delta)})}else if(function(e){return"response.code_interpreter_call_code.done"===e.type}(q)){const e=m[q.output_index];null!=e&&(s.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}'}),s.enqueue({type:"tool-input-end",id:e.toolCallId}),s.enqueue({type:"tool-call",toolCallId:e.toolCallId,toolName:o.toCustomToolName("code_interpreter"),input:JSON.stringify({code:q.code,containerId:e.codeInterpreter.containerId}),providerExecuted:!0}))}else if(function(e){return"response.created"===e.type}(q))f=q.response.id,s.enqueue({type:"response-metadata",id:q.response.id,timestamp:new Date(1e3*q.response.created_at),modelId:q.response.model});else if(function(e){return"response.output_text.delta"===e.type}(q))s.enqueue({type:"text-delta",id:q.item_id,delta:q.delta}),(null==(T=null==(D=e.providerOptions)?void 0:D[r])?void 0:T.logprobs)&&q.logprobs&&g.push(q.logprobs);else if("response.reasoning_summary_part.added"===q.type){if(q.summary_index>0){const e=C[q.item_id];e.summaryParts[q.summary_index]="active";for(const t of Object.keys(e.summaryParts))"can-conclude"===e.summaryParts[t]&&(s.enqueue({type:"reasoning-end",id:`${q.item_id}:${t}`,providerMetadata:{[r]:{itemId:q.item_id}}}),e.summaryParts[t]="concluded");s.enqueue({type:"reasoning-start",id:`${q.item_id}:${q.summary_index}`,providerMetadata:{[r]:{itemId:q.item_id,reasoningEncryptedContent:null!=(M=null==(A=C[q.item_id])?void 0:A.encryptedContent)?M:null}}})}}else"response.reasoning_summary_text.delta"===q.type?s.enqueue({type:"reasoning-delta",id:`${q.item_id}:${q.summary_index}`,delta:q.delta,providerMetadata:{[r]:{itemId:q.item_id}}}):"response.reasoning_summary_part.done"===q.type?n?(s.enqueue({type:"reasoning-end",id:`${q.item_id}:${q.summary_index}`,providerMetadata:{[r]:{itemId:q.item_id}}}),C[q.item_id].summaryParts[q.summary_index]="concluded"):C[q.item_id].summaryParts[q.summary_index]="can-conclude":function(e){return"response.completed"===e.type||"response.incomplete"===e.type}(q)?(p={unified:zs({finishReason:null==(N=q.response.incomplete_details)?void 0:N.reason,hasFunctionCall:w}),raw:null!=(V=null==(L=q.response.incomplete_details)?void 0:L.reason)?V:void 0},h=q.response.usage,"string"==typeof q.response.service_tier&&(y=q.response.service_tier)):function(e){return"response.output_text.annotation.added"===e.type}(q)?(v.push(q.annotation),"url_citation"===q.annotation.type?s.enqueue({type:"source",sourceType:"url",id:null!=(B=null==(O=(_=c.config).generateId)?void 0:O.call(_))?B:Be(),url:q.annotation.url,title:q.annotation.title}):"file_citation"===q.annotation.type?s.enqueue({type:"source",sourceType:"document",id:null!=(z=null==(G=(H=c.config).generateId)?void 0:G.call(H))?z:Be(),mediaType:"text/plain",title:q.annotation.filename,filename:q.annotation.filename,providerMetadata:{[r]:{type:q.annotation.type,fileId:q.annotation.file_id,index:q.annotation.index}}}):"container_file_citation"===q.annotation.type?s.enqueue({type:"source",sourceType:"document",id:null!=(U=null==(j=(W=c.config).generateId)?void 0:j.call(W))?U:Be(),mediaType:"text/plain",title:q.annotation.filename,filename:q.annotation.filename,providerMetadata:{[r]:{type:q.annotation.type,fileId:q.annotation.file_id,containerId:q.annotation.container_id}}}):"file_path"===q.annotation.type&&s.enqueue({type:"source",sourceType:"document",id:null!=(K=null==(Y=($=c.config).generateId)?void 0:Y.call($))?K:Be(),mediaType:"application/octet-stream",title:q.annotation.file_id,filename:q.annotation.file_id,providerMetadata:{[r]:{type:q.annotation.type,fileId:q.annotation.file_id,index:q.annotation.index}}})):function(e){return"error"===e.type}(q)&&s.enqueue({type:"error",error:q})},flush(e){const t={[r]:{responseId:f}};g.length>0&&(t[r].logprobs=g),void 0!==y&&(t[r].serviceTier=y),e.enqueue({type:"finish",finishReason:p,usage:Bs(h),providerMetadata:t})}})),request:{body:t},response:{headers:a}}}};function Ks(e){return"response.output_item.added"===e.type}function qs(e){var t;switch(e.type){case"search":return{action:{type:"search",query:null!=(t=e.query)?t:void 0},...null!=e.sources&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}function Zs(e){return JSON.stringify(e).slice(1,-1)}var Qs=bt((()=>xt(_t.Ik({instructions:_t.Yj().nullish(),speed:_t.ai().min(.25).max(4).default(1).nullish()})))),Js=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:s="mp3",speed:i,instructions:o,language:n,providerOptions:r}){const a=[],l=await Ft({provider:"openai",providerOptions:r,schema:Qs}),c={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:i,instructions:o};if(s&&(["mp3","opus","aac","flac","wav","pcm"].includes(s)?c.response_format=s:a.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${s}. Using mp3 instead.`})),l){const e={};for(const t in e){const s=e[t];void 0!==s&&(c[t]=s)}}return n&&a.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${n}" was ignored.`}),{requestBody:c,warnings:a}}async doGenerate(e){var t,s,i;const o=null!=(i=null==(s=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:s.call(t))?i:new Date,{requestBody:n,warnings:r}=await this.getArgs(e),{value:a,responseHeaders:l,rawValue:c}=await Tt({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),body:n,failedResponseHandler:Gt,successfulResponseHandler:async({response:e,url:t,requestBodyValues:s})=>{const i=Ee(e);if(!e.body)throw new f({message:"Response body is empty",url:t,requestBodyValues:s,statusCode:e.status,responseHeaders:i,responseBody:void 0});try{const t=await e.arrayBuffer();return{responseHeaders:i,value:new Uint8Array(t)}}catch(o){throw new f({message:"Failed to read response as array buffer",url:t,requestBodyValues:s,statusCode:e.status,responseHeaders:i,responseBody:void 0,cause:o})}},abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:a,warnings:r,request:{body:JSON.stringify(n)},response:{timestamp:o,modelId:this.modelId,headers:l,body:c}}}},Xs=bt((()=>xt(_t.Ik({text:_t.Yj(),language:_t.Yj().nullish(),duration:_t.ai().nullish(),words:_t.YO(_t.Ik({word:_t.Yj(),start:_t.ai(),end:_t.ai()})).nullish(),segments:_t.YO(_t.Ik({id:_t.ai(),seek:_t.ai(),start:_t.ai(),end:_t.ai(),text:_t.Yj(),tokens:_t.YO(_t.ai()),temperature:_t.ai(),avg_logprob:_t.ai(),compression_ratio:_t.ai(),no_speech_prob:_t.ai()})).nullish()})))),ei=bt((()=>xt(_t.Ik({include:_t.YO(_t.Yj()).optional(),language:_t.Yj().optional(),prompt:_t.Yj().optional(),temperature:_t.ai().min(0).max(1).default(0).optional(),timestampGranularities:_t.YO(_t.k5(["word","segment"])).default(["segment"]).optional()})))),ti={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},si=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:s}){const i=await Ft({provider:"openai",providerOptions:s,schema:ei}),o=new FormData,n=e instanceof Uint8Array?new Blob([e]):new Blob([Fe(e)]);o.append("model",this.modelId);const r=function(e){var t;const[s,i=""]=e.toLowerCase().split("/");return null!=(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[i])?t:i}(t);if(o.append("file",new File([n],"audio",{type:t}),`audio.${r}`),i){const e={include:i.include,language:i.language,prompt:i.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:i.temperature,timestamp_granularities:i.timestampGranularities};for(const[t,s]of Object.entries(e))if(null!=s)if(Array.isArray(s))for(const e of s)o.append(`${t}[]`,String(e));else o.append(t,String(s))}return{formData:o,warnings:[]}}async doGenerate(e){var t,s,i,o,n,r,a,l;const c=null!=(i=null==(s=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:s.call(t))?i:new Date,{formData:d,warnings:u}=await this.getArgs(e),{value:h,responseHeaders:p,rawValue:g}=await At({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:Pe(this.config.headers(),e.headers),formData:d,failedResponseHandler:Gt,successfulResponseHandler:Vt(Xs),abortSignal:e.abortSignal,fetch:this.config.fetch}),f=null!=h.language&&h.language in ti?ti[h.language]:void 0;return{text:h.text,segments:null!=(a=null!=(r=null==(o=h.segments)?void 0:o.map((e=>({text:e.text,startSecond:e.start,endSecond:e.end}))))?r:null==(n=h.words)?void 0:n.map((e=>({text:e.word,startSecond:e.start,endSecond:e.end}))))?a:[],language:f,durationInSeconds:null!=(l=h.duration)?l:void 0,warnings:u,response:{timestamp:c,modelId:this.modelId,headers:p,body:g}}}},ii="3.0.9";function oi(e={}){var t,s;const i=null!=(t=null==(o=function({settingValue:e,environmentVariableName:t}){return"string"==typeof e||null==e&&void 0!==Re&&null!=(e=Re.env[t])&&"string"==typeof e?e:void 0}({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"}))?void 0:o.replace(/\/$/,""))?t:"https://api.openai.com/v1";var o;const n=null!=(s=e.name)?s:"openai",r=()=>We({Authorization:`Bearer ${Ue({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${ii}`),a=t=>new ns(t,{provider:`${n}.embedding`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),l=t=>new cs(t,{provider:`${n}.image`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),c=t=>new si(t,{provider:`${n}.transcription`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),d=t=>new Js(t,{provider:`${n}.speech`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),u=e=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return h(e)},h=t=>new Ys(t,{provider:`${n}.responses`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch,fileIdPrefixes:["file-"]}),p=function(e){return u(e)};return p.specificationVersion="v3",p.languageModel=u,p.chat=t=>new qt(t,{provider:`${n}.chat`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),p.completion=t=>new ss(t,{provider:`${n}.completion`,url:({path:e})=>`${i}${e}`,headers:r,fetch:e.fetch}),p.responses=h,p.embedding=a,p.embeddingModel=a,p.textEmbedding=a,p.textEmbeddingModel=a,p.image=l,p.imageModel=l,p.transcription=c,p.transcriptionModel=c,p.speech=d,p.speechModel=d,p.tools=Os,p}oi()},18776:function(e,t){!function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],i="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",o={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},n="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",r={5:n,"5module":n+" export import",6:n+" const class extends export import super"},a=/^in(stanceof)?$/,l=new RegExp("["+i+"]"),c=new RegExp("["+i+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function d(e,t){for(var s=65536,i=0;i<t.length;i+=2){if((s+=t[i])>e)return!1;if((s+=t[i+1])>=e)return!0}return!1}function u(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&d(e,s)))}function h(e,i){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==i&&(d(e,s)||d(e,t)))))}var p=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function g(e,t){return new p(e,{beforeExpr:!0,binop:t})}var f={beforeExpr:!0},m={startsExpr:!0},v={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,v[e]=new p(e,t)}var C={num:new p("num",m),regexp:new p("regexp",m),string:new p("string",m),name:new p("name",m),privateId:new p("privateId",m),eof:new p("eof"),bracketL:new p("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new p("]"),braceL:new p("{",{beforeExpr:!0,startsExpr:!0}),braceR:new p("}"),parenL:new p("(",{beforeExpr:!0,startsExpr:!0}),parenR:new p(")"),comma:new p(",",f),semi:new p(";",f),colon:new p(":",f),dot:new p("."),question:new p("?",f),questionDot:new p("?."),arrow:new p("=>",f),template:new p("template"),invalidTemplate:new p("invalidTemplate"),ellipsis:new p("...",f),backQuote:new p("`",m),dollarBraceL:new p("${",{beforeExpr:!0,startsExpr:!0}),eq:new p("=",{beforeExpr:!0,isAssign:!0}),assign:new p("_=",{beforeExpr:!0,isAssign:!0}),incDec:new p("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new p("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:g("||",1),logicalAND:g("&&",2),bitwiseOR:g("|",3),bitwiseXOR:g("^",4),bitwiseAND:g("&",5),equality:g("==/!=/===/!==",6),relational:g("</>/<=/>=",7),bitShift:g("<</>>/>>>",8),plusMin:new p("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:g("%",10),star:g("*",10),slash:g("/",10),starstar:new p("**",{beforeExpr:!0}),coalesce:g("??",1),_break:w("break"),_case:w("case",f),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",f),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",f),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",m),_if:w("if"),_return:w("return",f),_switch:w("switch"),_throw:w("throw",f),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",m),_super:w("super",m),_class:w("class",m),_extends:w("extends",f),_export:w("export"),_import:w("import",m),_null:w("null",m),_true:w("true",m),_false:w("false",m),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},y=/\r\n?|\n|\u2028|\u2029/,b=new RegExp(y.source,"g");function S(e){return 10===e||13===e||8232===e||8233===e}function x(e,t,s){void 0===s&&(s=e.length);for(var i=t;i<s;i++){var o=e.charCodeAt(i);if(S(o))return i<s-1&&13===o&&10===e.charCodeAt(i+1)?i+2:i+1}return-1}var R=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,P=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,E=Object.prototype,I=E.hasOwnProperty,k=E.toString,F=Object.hasOwn||function(e,t){return I.call(e,t)},D=Array.isArray||function(e){return"[object Array]"===k.call(e)},T=Object.create(null);function A(e){return T[e]||(T[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function M(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var N=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var V=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function _(e,t){for(var s=1,i=0;;){var o=x(e,i,t);if(o<0)return new L(s,t-i);++s,i=o}}var O={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},B=!1;function H(e){var t={};for(var s in O)t[s]=e&&F(e,s)?e[s]:O[s];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!B&&"object"==typeof console&&console.warn&&(B=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),D(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}if(D(t.onComment)&&(t.onComment=function(e,t){return function(s,i,o,n,r,a){var l={type:s?"Block":"Line",value:i,start:o,end:n};e.locations&&(l.loc=new V(this,r,a)),e.ranges&&(l.range=[o,n]),t.push(l)}}(t,t.onComment)),"commonjs"===t.sourceType&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}var G=256,z=259;function W(e,t){return 2|(e?4:0)|(t?8:0)}var j=function(e,t,s){this.options=e=H(e),this.sourceFile=e.sourceFile,this.keywords=A(r[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";!0!==e.allowReserved&&(i=o[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(i+=" await")),this.reservedWords=A(i);var n=(i?i+" ":"")+o.strict;this.reservedWordsStrict=A(n),this.reservedWordsStrictBind=A(n+" "+o.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=s||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):s?(this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(y).length)):this.lineStart=0,this.type=C.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||!0===e.strict||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},U={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};j.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow((function(){return e.parseTopLevel(t)}))},U.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},U.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},U.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},U.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},U.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},U.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},U.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},U.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},U.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},U.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e||!this.inModule&&1&e)},U.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&G)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i<e.length;i++)s=e[i](s);return s},j.parse=function(e,t){return new this(t,e).parse()},j.parseExpressionAt=function(e,t,s){var i=new this(s,e,t);return i.nextToken(),i.parseExpression()},j.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(j.prototype,U);var $=j.prototype,Y=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;$.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){P.lastIndex=e,e+=P.exec(this.input)[0].length;var t=Y.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){P.lastIndex=e+t[0].length;var s=P.exec(this.input),i=s.index+s[0].length,o=this.input.charAt(i);return";"===o||"}"===o||y.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(o)||"!"===o&&"="===this.input.charAt(i+1))}e+=t[0].length,P.lastIndex=e,e+=P.exec(this.input)[0].length,";"===this.input[e]&&e++}},$.eat=function(e){return this.type===e&&(this.next(),!0)},$.isContextual=function(e){return this.type===C.name&&this.value===e&&!this.containsEsc},$.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},$.catchStackOverflow=function(e){try{return e()}catch(e){if(!(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message))))throw e;this.raise(this.start,"Not enough stack space to parse input")}},$.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},$.canInsertSemicolon=function(){return this.type===C.eof||this.type===C.braceR||y.test(this.input.slice(this.lastTokEnd,this.start))},$.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},$.semicolon=function(){this.eat(C.semi)||this.insertSemicolon()||this.unexpected()},$.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},$.expect=function(e){this.eat(e)||this.unexpected()},$.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var K=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};$.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,t?"Assigning to rvalue":"Parenthesized pattern")}},$.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},$.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},$.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var q=j.prototype;q.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==C.eof;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var i=0,o=Object.keys(this.undefinedExports);i<o.length;i+=1){var n=o[i];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(e,"Program")};var Z={kind:"loop"},Q={kind:"switch"};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;P.lastIndex=this.pos;var t=P.exec(this.input),s=this.pos+t[0].length,i=this.fullCharCodeAt(s);if(91===i||92===i)return!0;if(e)return!1;if(123===i)return!0;if(u(i)){var o=s;do{s+=i<=65535?1:2}while(h(i=this.fullCharCodeAt(s)));if(92===i)return!0;var n=this.input.slice(o,s);if(!a.test(n))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;P.lastIndex=this.pos;var e,t=P.exec(this.input),s=this.pos+t[0].length;return!(y.test(this.input.slice(this.pos,s))||"function"!==this.input.slice(s,s+8)||s+8!==this.input.length&&(h(e=this.fullCharCodeAt(s+8))||92===e))},q.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;P.lastIndex=this.pos;var s=P.exec(this.input),i=this.pos+s[0].length;if(y.test(this.input.slice(this.pos,i)))return!1;if(e){var o,n=i+5;if("using"!==this.input.slice(i,n)||n===this.input.length||h(o=this.fullCharCodeAt(n))||92===o)return!1;P.lastIndex=n;var r=P.exec(this.input);if(i=n+r[0].length,r&&y.test(this.input.slice(n,i)))return!1}var l=this.fullCharCodeAt(i);if(!u(l)&&92!==l)return!1;var c=i;do{i+=l<=65535?1:2}while(h(l=this.fullCharCodeAt(i)));if(92===l)return!0;var d=this.input.slice(c,i);return!(a.test(d)||t&&!e&&"of"===d&&(P.lastIndex=i,i+=P.exec(this.input)[0].length,61!==this.input.charCodeAt(i)||61===(l=this.input.charCodeAt(i+1))||62===l))},q.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},q.isUsing=function(e){return this.isUsingKeyword(!1,e)},q.parseStatement=function(e,t,s){var i,o=this.type,n=this.startNode();switch(this.isLet(e)&&(o=C._var,i="let"),o){case C._break:case C._continue:return this.parseBreakContinueStatement(n,o.keyword);case C._debugger:return this.parseDebuggerStatement(n);case C._do:return this.parseDoStatement(n);case C._for:return this.parseForStatement(n);case C._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case C._class:return e&&this.unexpected(),this.parseClass(n,!0);case C._if:return this.parseIfStatement(n);case C._return:return this.parseReturnStatement(n);case C._switch:return this.parseSwitchStatement(n);case C._throw:return this.parseThrowStatement(n);case C._try:return this.parseTryStatement(n);case C._const:case C._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(n,i);case C._while:return this.parseWhileStatement(n);case C._with:return this.parseWithStatement(n);case C.braceL:return this.parseBlock(!0,n);case C.semi:return this.parseEmptyStatement(n);case C._export:case C._import:if(this.options.ecmaVersion>10&&o===C._import){P.lastIndex=this.pos;var r=P.exec(this.input),a=this.pos+r[0].length,l=this.input.charCodeAt(a);if(40===l||46===l)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),o===C._import?this.parseImport(n):this.parseExport(n,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),"await using"===c&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(n,!1,c),this.semicolon(),this.finishNode(n,"VariableDeclaration");var d=this.value,u=this.parseExpression();return o===C.name&&"Identifier"===u.type&&this.eat(C.colon)?this.parseLabeledStatement(n,d,u,e):this.parseExpressionStatement(n,u)}},q.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(C.semi)||this.insertSemicolon()?e.label=null:this.type!==C.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var o=this.labels[i];if(null==e.label||o.name===e.label.name){if(null!=o.kind&&(s||"loop"===o.kind))break;if(e.label&&s)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},q.parseDoStatement=function(e){return this.next(),this.labels.push(Z),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(C._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(C.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Z),this.enterScope(0),this.expect(C.parenL),this.type===C.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===C._var||this.type===C._const||s){var i=this.startNode(),o=s?"let":this.value;return this.next(),this.parseVar(i,!0,o),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}var n=this.isContextual("let"),r=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){var l=this.startNode();return this.next(),"await using"===a&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(l,!0,a),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var c=this.containsEsc,d=new K,u=this.start,h=t>-1?this.parseExprSubscripts(d,"await"):this.parseExpression(!0,d);return this.type===C._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===C._in&&this.unexpected(t),e.await=!0):r&&this.options.ecmaVersion>=8&&(h.start!==u||c||"Identifier"!==h.type||"async"!==h.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),n&&r&&this.raise(h.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(h,!1,d),this.checkLValPattern(h),this.parseForIn(e,h)):(this.checkExpressionErrors(d,!0),t>-1&&this.unexpected(t),this.parseFor(e,h))},q.parseForAfterInit=function(e,t,s){return(this.type===C._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.type===C._in?("using"!==t.kind&&"await using"!==t.kind||t.declarations[0].init||this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&s>-1&&this.unexpected(s)):this.options.ecmaVersion>=9&&(e.await=s>-1),this.parseForIn(e,t)):(s>-1&&this.unexpected(s),this.parseFor(e,t))},q.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,X|(s?0:ee),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(C._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},q.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(C.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},q.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(C.braceL),this.labels.push(Q),this.enterScope(1024);for(var s=!1;this.type!==C.braceR;)if(this.type===C._case||this.type===C._default){var i=this.type===C._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(C.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},q.parseThrowStatement=function(e){return this.next(),y.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var J=[];q.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(C.parenR),e},q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===C._catch){var t=this.startNode();this.next(),this.eat(C.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(C._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},q.parseVarStatement=function(e,t,s){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Z),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},q.parseLabeledStatement=function(e,t,s,i){for(var o=0,n=this.labels;o<n.length;o+=1)n[o].name===t&&this.raise(s.start,"Label '"+t+"' is already declared");for(var r=this.type.isLoop?"loop":this.type===C._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var l=this.labels[a];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=r}return this.labels.push({name:t,kind:r,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},q.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(C.braceL),e&&this.enterScope(0);this.type!==C.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},q.parseFor=function(e,t){return e.init=t,this.expect(C.semi),e.test=this.type===C.semi?null:this.parseExpression(),this.expect(C.semi),e.update=this.type===C.parenR?null:this.parseExpression(),this.expect(C.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},q.parseForIn=function(e,t){var s=this.type===C._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(C.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},q.parseVar=function(e,t,s,i){for(e.declarations=[],e.kind=s;;){var o=this.startNode();if(this.parseVarId(o,s),this.eat(C.eq)?o.init=this.parseMaybeAssign(t):i||"const"!==s||this.type===C._in||this.options.ecmaVersion>=6&&this.isContextual("of")?i||"using"!==s&&"await using"!==s||!(this.options.ecmaVersion>=17)||this.type===C._in||this.isContextual("of")?i||"Identifier"===o.id.type||t&&(this.type===C._in||this.isContextual("of"))?o.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(C.comma))break}return e},q.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var X=1,ee=2;function te(e,t){var s=t.key.name,i=e[s],o="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(o=(t.static?"s":"i")+t.kind),"iget"===i&&"iset"===o||"iset"===i&&"iget"===o||"sget"===i&&"sset"===o||"sset"===i&&"sget"===o?(e[s]="true",!1):!!i||(e[s]=o,!1)}function se(e,t){var s=e.computed,i=e.key;return!s&&("Identifier"===i.type&&i.name===t||"Literal"===i.type&&i.value===t)}q.parseFunction=function(e,t,s,i,o){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===C.star&&t&ee&&this.unexpected(),e.generator=this.eat(C.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&X&&(e.id=4&t&&this.type!==C.name?null:this.parseIdent(),!e.id||t&ee||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(W(e.async,e.generator)),t&X||(e.id=this.type===C.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,o),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,t&X?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(C.parenL),e.params=this.parseBindingList(C.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),o=this.startNode(),n=!1;for(o.body=[],this.expect(C.braceL);this.type!==C.braceR;){var r=this.parseClassElement(null!==e.superClass);r&&(o.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind?(n&&this.raiseRecoverable(r.start,"Duplicate constructor in the same class"),n=!0):r.key&&"PrivateIdentifier"===r.key.type&&te(i,r)&&this.raiseRecoverable(r.key.start,"Identifier '#"+r.key.name+"' has already been declared"))}return this.strict=s,this.next(),e.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},q.parseClassElement=function(e){if(this.eat(C.semi))return null;var t=this.options.ecmaVersion,s=this.startNode(),i="",o=!1,n=!1,r="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(C.braceL))return this.parseClassStaticBlock(s),s;this.isClassElementNameStart()||this.type===C.star?a=!0:i="static"}if(s.static=a,!i&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==C.star||this.canInsertSemicolon()?i="async":n=!0),!i&&(t>=9||!n)&&this.eat(C.star)&&(o=!0),!i&&!n&&!o){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?r=l:i=l)}if(i?(s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=i,this.finishNode(s.key,"Identifier")):this.parseClassElementName(s),t<13||this.type===C.parenL||"method"!==r||o||n){var c=!s.static&&se(s,"constructor"),d=c&&e;c&&"method"!==r&&this.raise(s.key.start,"Constructor can't have get/set modifier"),s.kind=c?"constructor":r,this.parseClassMethod(s,o,n,d)}else this.parseClassField(s);return s},q.isClassElementNameStart=function(){return this.type===C.name||this.type===C.privateId||this.type===C.num||this.type===C.string||this.type===C.bracketL||this.type.keyword},q.parseClassElementName=function(e){this.type===C.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},q.parseClassMethod=function(e,t,s,i){var o=e.key;"constructor"===e.kind?(t&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method")):e.static&&se(e,"prototype")&&this.raise(o.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,s,i);return"get"===e.kind&&0!==n.params.length&&this.raiseRecoverable(n.start,"getter should have no params"),"set"===e.kind&&1!==n.params.length&&this.raiseRecoverable(n.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===n.params[0].type&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},q.parseClassField=function(e){return se(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&se(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(C.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},q.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==C.braceR;){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},q.parseClassId=function(e,t){this.type===C.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(C._extends)?this.parseExprSubscripts(null,!1):null},q.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},q.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,s=e.used;if(this.options.checkPrivateFields)for(var i=this.privateNameStack.length,o=0===i?null:this.privateNameStack[i-1],n=0;n<s.length;++n){var r=s[n];F(t,r.name)||(o?o.used.push(r):this.raiseRecoverable(r.start,"Private field '#"+r.name+"' must be declared in an enclosing class"))}},q.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==C.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},q.parseExport=function(e,t){if(this.next(),this.eat(C.star))return this.parseExportAllDeclaration(e,t);if(this.eat(C._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==C.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var s=0,i=e.specifiers;s<i.length;s+=1){var o=i[s];this.checkUnreserved(o.local),this.checkLocalExport(o.local),"Literal"===o.local.type&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},q.parseExportDeclaration=function(e){return this.parseStatement(null)},q.parseExportDefaultDeclaration=function(){var e;if(this.type===C._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|X,!1,e)}if(this.type===C._class){var s=this.startNode();return this.parseClass(s,"nullableID")}var i=this.parseMaybeAssign();return this.semicolon(),i},q.checkExport=function(e,t,s){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),F(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},q.checkPatternExport=function(e,t){var s=t.type;if("Identifier"===s)this.checkExport(e,t,t.start);else if("ObjectPattern"===s)for(var i=0,o=t.properties;i<o.length;i+=1){var n=o[i];this.checkPatternExport(e,n)}else if("ArrayPattern"===s)for(var r=0,a=t.elements;r<a.length;r+=1){var l=a[r];l&&this.checkPatternExport(e,l)}else"Property"===s?this.checkPatternExport(e,t.value):"AssignmentPattern"===s?this.checkPatternExport(e,t.left):"RestElement"===s&&this.checkPatternExport(e,t.argument)},q.checkVariableExport=function(e,t){if(e)for(var s=0,i=t;s<i.length;s+=1){var o=i[s];this.checkPatternExport(e,o.id)}},q.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},q.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(C.braceL);!this.eat(C.braceR);){if(s)s=!1;else if(this.expect(C.comma),this.afterTrailingComma(C.braceR))break;t.push(this.parseExportSpecifier(e))}return t},q.parseImport=function(e){return this.next(),this.type===C.string?(e.specifiers=J,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===C.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},q.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},q.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},q.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===C.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(C.comma)))return e;if(this.type===C.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(C.braceL);!this.eat(C.braceR);){if(t)t=!1;else if(this.expect(C.comma),this.afterTrailingComma(C.braceR))break;e.push(this.parseImportSpecifier())}return e},q.parseWithClause=function(){var e=[];if(!this.eat(C._with))return e;this.expect(C.braceL);for(var t={},s=!0;!this.eat(C.braceR);){if(s)s=!1;else if(this.expect(C.comma),this.afterTrailingComma(C.braceR))break;var i=this.parseImportAttribute(),o="Identifier"===i.key.type?i.key.name:i.key.value;F(t,o)&&this.raiseRecoverable(i.key.start,"Duplicate attribute key '"+o+"'"),t[o]=!0,e.push(i)}return e},q.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===C.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(C.colon),this.type!==C.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},q.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===C.string){var e=this.parseLiteral(this.value);return N.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var ie=j.prototype;ie.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,o=e.properties;i<o.length;i+=1){var n=o[i];this.toAssignable(n,t),"RestElement"!==n.type||"ArrayPattern"!==n.argument.type&&"ObjectPattern"!==n.argument.type||this.raise(n.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},ie.toAssignableList=function(e,t){for(var s=e.length,i=0;i<s;i++){var o=e[i];o&&this.toAssignable(o,t)}if(s){var n=e[s-1];6===this.options.ecmaVersion&&t&&n&&"RestElement"===n.type&&"Identifier"!==n.argument.type&&this.unexpected(n.argument.start)}return e},ie.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ie.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==C.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ie.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case C.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(C.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case C.braceL:return this.parseObj(!0)}return this.parseIdent()},ie.parseBindingList=function(e,t,s,i){for(var o=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(C.comma),t&&this.type===C.comma)o.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===C.ellipsis){var r=this.parseRestBinding();this.parseBindingListItem(r),o.push(r),this.type===C.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}o.push(this.parseAssignableListItem(i))}return o},ie.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ie.parseBindingListItem=function(e){return e},ie.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(C.eq))return s;var i=this.startNodeAt(e,t);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},ie.checkLValSimple=function(e,t,s){void 0===t&&(t=0);var i=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(F(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}},ie.checkLValPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var i=0,o=e.properties;i<o.length;i+=1){var n=o[i];this.checkLValInnerPattern(n,t,s)}break;case"ArrayPattern":for(var r=0,a=e.elements;r<a.length;r+=1){var l=a[r];l&&this.checkLValInnerPattern(l,t,s)}break;default:this.checkLValSimple(e,t,s)}},ie.checkLValInnerPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var oe=function(e,t,s,i,o){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!o},ne={b_stat:new oe("{",!1),b_expr:new oe("{",!0),b_tmpl:new oe("${",!1),p_stat:new oe("(",!1),p_expr:new oe("(",!0),q_tmpl:new oe("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new oe("function",!1),f_expr:new oe("function",!0),f_expr_gen:new oe("function",!0,!1,null,!0),f_gen:new oe("function",!1,!1,null,!0)},re=j.prototype;re.initialContext=function(){return[ne.b_stat]},re.curContext=function(){return this.context[this.context.length-1]},re.braceIsBlock=function(e){var t=this.curContext();return t===ne.f_expr||t===ne.f_stat||(e!==C.colon||t!==ne.b_stat&&t!==ne.b_expr?e===C._return||e===C.name&&this.exprAllowed?y.test(this.input.slice(this.lastTokEnd,this.start)):e===C._else||e===C.semi||e===C.eof||e===C.parenR||e===C.arrow||(e===C.braceL?t===ne.b_stat:e!==C._var&&e!==C._const&&e!==C.name&&!this.exprAllowed):!t.isExpr)},re.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},re.updateContext=function(e){var t,s=this.type;s.keyword&&e===C.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},re.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},C.parenR.updateContext=C.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ne.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},C.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ne.b_stat:ne.b_expr),this.exprAllowed=!0},C.dollarBraceL.updateContext=function(){this.context.push(ne.b_tmpl),this.exprAllowed=!0},C.parenL.updateContext=function(e){var t=e===C._if||e===C._for||e===C._with||e===C._while;this.context.push(t?ne.p_stat:ne.p_expr),this.exprAllowed=!0},C.incDec.updateContext=function(){},C._function.updateContext=C._class.updateContext=function(e){!e.beforeExpr||e===C._else||e===C.semi&&this.curContext()!==ne.p_stat||e===C._return&&y.test(this.input.slice(this.lastTokEnd,this.start))||(e===C.colon||e===C.braceL)&&this.curContext()===ne.b_stat?this.context.push(ne.f_stat):this.context.push(ne.f_expr),this.exprAllowed=!1},C.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},C.backQuote.updateContext=function(){this.curContext()===ne.q_tmpl?this.context.pop():this.context.push(ne.q_tmpl),this.exprAllowed=!1},C.star.updateContext=function(e){if(e===C._function){var t=this.context.length-1;this.context[t]===ne.f_expr?this.context[t]=ne.f_expr_gen:this.context[t]=ne.f_gen}this.exprAllowed=!0},C.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==C.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ae=j.prototype;function le(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&le(e.expression)}function ce(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&ce(e.expression)||"ParenthesizedExpression"===e.type&&ce(e.expression)}ae.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,o=e.key;switch(o.type){case"Identifier":i=o.name;break;case"Literal":i=String(o.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===i&&"init"===n&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=o.start):this.raiseRecoverable(o.start,"Redefinition of __proto__ property")),t.proto=!0);else{var r=t[i="$"+i];r?("init"===n?this.strict&&r.init||r.get||r.set:r.init||r[n])&&this.raiseRecoverable(o.start,"Redefinition of property"):r=t[i]={init:!1,get:!1,set:!1},r[n]=!0}}},ae.parseExpression=function(e,t){var s=this;return this.catchStackOverflow((function(){var i=s.start,o=s.startLoc,n=s.parseMaybeAssign(e,t);if(s.type===C.comma){var r=s.startNodeAt(i,o);for(r.expressions=[n];s.eat(C.comma);)r.expressions.push(s.parseMaybeAssign(e,t));return s.finishNode(r,"SequenceExpression")}return n}))},ae.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,o=-1,n=-1,r=-1;t?(o=t.parenthesizedAssign,n=t.trailingComma,r=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new K,i=!0);var a=this.start,l=this.startLoc;this.type!==C.parenL&&this.type!==C.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(s&&(c=s.call(this,c,a,l)),this.type.isAssign){var d=this.startNodeAt(a,l);return d.operator=this.value,this.type===C.eq&&(c=this.toAssignable(c,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===C.eq?this.checkLValPattern(c):this.checkLValSimple(c),d.left=c,this.next(),d.right=this.parseMaybeAssign(e),r>-1&&(t.doubleProto=r),this.finishNode(d,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),o>-1&&(t.parenthesizedAssign=o),n>-1&&(t.trailingComma=n),c},ae.parseMaybeConditional=function(e,t){var s=this.start,i=this.startLoc,o=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return o;if(("ArrowFunctionExpression"!==o.type||o.start!==s)&&this.eat(C.question)){var n=this.startNodeAt(s,i);return n.test=o,n.consequent=this.parseMaybeAssign(),this.expect(C.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return o},ae.parseExprOps=function(e,t){var s=this.start,i=this.startLoc,o=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||o.start===s&&"ArrowFunctionExpression"===o.type?o:this.parseExprOp(o,s,i,-1,e)},ae.parseExprOp=function(e,t,s,i,o){var n=this.type.binop;if(null!=n&&(!o||this.type!==C._in)&&n>i){var r=this.type===C.logicalOR||this.type===C.logicalAND,a=this.type===C.coalesce;a&&(n=C.logicalAND.binop);var l=this.value;this.next();var c=this.start,d=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,o),c,d,n,o),h=this.buildBinary(t,s,e,u,l,r||a);return(r&&this.type===C.coalesce||a&&(this.type===C.logicalOR||this.type===C.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(h,t,s,i,o)}return e},ae.buildBinary=function(e,t,s,i,o,n){"PrivateIdentifier"===i.type&&this.raise(i.start,"Private identifier can only be left side of binary expression");var r=this.startNodeAt(e,t);return r.left=s,r.operator=o,r.right=i,this.finishNode(r,n?"LogicalExpression":"BinaryExpression")},ae.parseMaybeUnary=function(e,t,s,i){var o,n=this.start,r=this.startLoc;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(i),t=!0;else if(this.type.prefix){var a=this.startNode(),l=this.type===C.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0,l,i),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&le(a.argument)?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):"delete"===a.operator&&ce(a.argument)?this.raiseRecoverable(a.start,"Private fields can not be deleted"):t=!0,o=this.finishNode(a,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==C.privateId){if(o=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(n,r);c.operator=this.value,c.prefix=!1,c.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(c,"UpdateExpression")}}else(i||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==C._in&&this.unexpected();return s||"ArrowFunctionExpression"===o.type&&o.start===n||!this.eat(C.starstar)?o:t?void this.unexpected(this.lastTokStart):this.buildBinary(n,r,o,this.parseMaybeUnary(null,!1,!1,i),"**",!1)},ae.parseExprSubscripts=function(e,t){var s=this.start,i=this.startLoc,o=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===o.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return o;var n=this.parseSubscripts(o,s,i,!1,t);return e&&"MemberExpression"===n.type&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n},ae.parseSubscripts=function(e,t,s,i,o){for(var n=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,r=!1;;){var a=this.parseSubscript(e,t,s,i,n,r,o);if(a.optional&&(r=!0),a===e||"ArrowFunctionExpression"===a.type){if(r){var l=this.startNodeAt(t,s);l.expression=a,a=this.finishNode(l,"ChainExpression")}return a}e=a}},ae.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(C.arrow)},ae.parseSubscriptAsyncArrow=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!0,i)},ae.parseSubscript=function(e,t,s,i,o,n,r){var a=this.options.ecmaVersion>=11,l=a&&this.eat(C.questionDot);i&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(C.bracketL);if(c||l&&this.type!==C.parenL&&this.type!==C.backQuote||this.eat(C.dot)){var d=this.startNodeAt(t,s);d.object=e,c?(d.property=this.parseExpression(),this.expect(C.bracketR)):this.type===C.privateId&&"Super"!==e.type?d.property=this.parsePrivateIdent():d.property=this.parseIdent("never"!==this.options.allowReserved),d.computed=!!c,a&&(d.optional=l),e=this.finishNode(d,"MemberExpression")}else if(!i&&this.eat(C.parenL)){var u=new K,h=this.yieldPos,p=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(C.parenR,this.options.ecmaVersion>=8,!1,u);if(o&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,s,f,r);this.checkExpressionErrors(u,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var m=this.startNodeAt(t,s);m.callee=e,m.arguments=f,a&&(m.optional=l),e=this.finishNode(m,"CallExpression")}else if(this.type===C.backQuote){(l||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var v=this.startNodeAt(t,s);v.tag=e,v.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(v,"TaggedTemplateExpression")}return e},ae.parseExprAtom=function(e,t,s){this.type===C.slash&&this.readRegexp();var i,o=this.potentialArrowAt===this.start;switch(this.type){case C._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type!==C.parenL||this.allowDirectSuper||this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==C.dot&&this.type!==C.bracketL&&this.type!==C.parenL&&this.unexpected(),this.finishNode(i,"Super");case C._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case C.name:var n=this.start,r=this.startLoc,a=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat(C._function))return this.overrideContext(ne.f_expr),this.parseFunction(this.startNodeAt(n,r),0,!1,!0,t);if(o&&!this.canInsertSemicolon()){if(this.eat(C.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===C.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(C.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[l],!0,t)}return l;case C.regexp:var c=this.value;return(i=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},i;case C.num:case C.string:return this.parseLiteral(this.value);case C._null:case C._true:case C._false:return(i=this.startNode()).value=this.type===C._null?null:this.type===C._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case C.parenL:var d=this.start,u=this.parseParenAndDistinguishExpression(o,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=d),e.parenthesizedBind<0&&(e.parenthesizedBind=d)),u;case C.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(C.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case C.braceL:return this.overrideContext(ne.b_expr),this.parseObj(!1,e);case C._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case C._class:return this.parseClass(this.startNode(),!1);case C._new:return this.parseNew();case C.backQuote:return this.parseTemplate();case C._import:return this.options.ecmaVersion>=11?this.parseExprImport(s):this.unexpected();default:return this.parseExprAtomDefault()}},ae.parseExprAtomDefault=function(){this.unexpected()},ae.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===C.parenL&&!e)return this.parseDynamicImport(t);if(this.type===C.dot){var s=this.startNodeAt(t.start,t.loc&&t.loc.start);return s.name="import",t.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(t)}this.unexpected()},ae.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(C.parenR)?e.options=null:(this.expect(C.comma),this.afterTrailingComma(C.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(C.parenR)||(this.expect(C.comma),this.afterTrailingComma(C.parenR)||this.unexpected())));else if(!this.eat(C.parenR)){var t=this.start;this.eat(C.comma)&&this.eat(C.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ae.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ae.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ae.parseParenExpression=function(){this.expect(C.parenL);var e=this.parseExpression();return this.expect(C.parenR),e},ae.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ae.parseParenAndDistinguishExpression=function(e,t){var s,i=this.start,o=this.startLoc,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,a=this.start,l=this.startLoc,c=[],d=!0,u=!1,h=new K,p=this.yieldPos,g=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==C.parenR;){if(d?d=!1:this.expect(C.comma),n&&this.afterTrailingComma(C.parenR,!0)){u=!0;break}if(this.type===C.ellipsis){r=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===C.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var f=this.lastTokEnd,m=this.lastTokEndLoc;if(this.expect(C.parenR),e&&this.shouldParseArrow(c)&&this.eat(C.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=g,this.parseParenArrowList(i,o,c,t);c.length&&!u||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=g||this.awaitPos,c.length>1?((s=this.startNodeAt(a,l)).expressions=c,this.finishNodeAt(s,"SequenceExpression",f,m)):s=c[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(i,o);return v.expression=s,this.finishNode(v,"ParenthesizedExpression")}return s},ae.parseParenItem=function(e){return e},ae.parseParenArrowList=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!1,i)};var de=[];ae.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===C.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var i=this.start,o=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),i,o,!0,!1),"Super"===e.callee.type&&this.raiseRecoverable(i,"Invalid use of 'super'"),this.eat(C.parenL)?e.arguments=this.parseExprList(C.parenR,this.options.ecmaVersion>=8,!1):e.arguments=de,this.finishNode(e,"NewExpression")},ae.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===C.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===C.backQuote,this.finishNode(s,"TemplateElement")},ae.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===C.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(C.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(C.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},ae.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===C.name||this.type===C.num||this.type===C.string||this.type===C.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===C.star)&&!y.test(this.input.slice(this.lastTokEnd,this.start))},ae.parseObj=function(e,t){var s=this.startNode(),i=!0,o={};for(s.properties=[],this.next();!this.eat(C.braceR);){if(i)i=!1;else if(this.expect(C.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(C.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,o,t),s.properties.push(n)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},ae.parseProperty=function(e,t){var s,i,o,n,r=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(C.ellipsis))return e?(r.argument=this.parseIdent(!1),this.type===C.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(r,"RestElement")):(r.argument=this.parseMaybeAssign(!1,t),this.type===C.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(r,"SpreadElement"));this.options.ecmaVersion>=6&&(r.method=!1,r.shorthand=!1,(e||t)&&(o=this.start,n=this.startLoc),e||(s=this.eat(C.star)));var a=this.containsEsc;return this.parsePropertyName(r),!e&&!a&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(r)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(C.star),this.parsePropertyName(r)):i=!1,this.parsePropertyValue(r,e,s,i,o,n,t,a),this.finishNode(r,"Property")},ae.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var s="get"===e.kind?0:1;if(e.value.params.length!==s){var i=e.value.start;"get"===e.kind?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ae.parsePropertyValue=function(e,t,s,i,o,n,r,a){(s||i)&&this.type===C.colon&&this.unexpected(),this.eat(C.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,r),e.kind="init"):this.options.ecmaVersion>=6&&this.type===C.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(s,i),e.kind="init"):t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===C.comma||this.type===C.braceR||this.type===C.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=o),t?e.value=this.parseMaybeDefault(o,n,this.copyNode(e.key)):this.type===C.eq&&r?(r.shorthandAssign<0&&(r.shorthandAssign=this.start),e.value=this.parseMaybeDefault(o,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((s||i)&&this.unexpected(),this.parseGetterSetter(e))},ae.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(C.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(C.bracketR),e.key;e.computed=!1}return e.key=this.type===C.num||this.type===C.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ae.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ae.parseMethod=function(e,t,s){var i=this.startNode(),o=this.yieldPos,n=this.awaitPos,r=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|W(t,i.generator)|(s?128:0)),this.expect(C.parenL),i.params=this.parseBindingList(C.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=o,this.awaitPos=n,this.awaitIdentPos=r,this.finishNode(i,"FunctionExpression")},ae.parseArrowExpression=function(e,t,s,i){var o=this.yieldPos,n=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|W(s,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=o,this.awaitPos=n,this.awaitIdentPos=r,this.finishNode(e,"ArrowFunctionExpression")},ae.parseFunctionBody=function(e,t,s,i){var o=t&&this.type!==C.braceL,n=this.strict,r=!1;if(o)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);n&&!a||(r=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(e,!n&&!r&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,r&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},ae.isSimpleParamList=function(e){for(var t=0,s=e;t<s.length;t+=1)if("Identifier"!==s[t].type)return!1;return!0},ae.checkParams=function(e,t){for(var s=Object.create(null),i=0,o=e.params;i<o.length;i+=1){var n=o[i];this.checkLValInnerPattern(n,1,t?null:s)}},ae.parseExprList=function(e,t,s,i){for(var o=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(C.comma),t&&this.afterTrailingComma(e))break;var r=void 0;s&&this.type===C.comma?r=null:this.type===C.ellipsis?(r=this.parseSpread(i),i&&this.type===C.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):r=this.parseMaybeAssign(!1,i),o.push(r)}return o},ae.checkUnreserved=function(e){var t=e.start,s=e.end,i=e.name;this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&z||"arguments"!==i||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==i&&"await"!==i||this.raise(t,"Cannot use "+i+" in class static initialization block"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,s).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(this.inAsync||"await"!==i||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},ae.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},ae.parseIdentNode=function(){var e=this.startNode();return this.type===C.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=C.name):this.unexpected(),e},ae.parsePrivateIdent=function(){var e=this.startNode();return this.type===C.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ae.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===C.semi||this.canInsertSemicolon()||this.type!==C.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(C.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ae.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ue=j.prototype;ue.raise=function(e,t){var s=_(this.input,e);t+=" ("+s.line+":"+s.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var i=new SyntaxError(t);throw i.pos=e,i.loc=s,i.raisedAt=this.pos,i},ue.raiseRecoverable=ue.raise,ue.curPosition=function(){if(this.options.locations)return new L(this.curLine,this.pos-this.lineStart)};var he=j.prototype,pe=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};he.enterScope=function(e){this.scopeStack.push(new pe(e))},he.exitScope=function(){this.scopeStack.pop()},he.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},he.declareName=function(e,t,s){var i=!1;if(2===t){var o=this.currentScope();i=o.lexical.indexOf(e)>-1||o.functions.indexOf(e)>-1||o.var.indexOf(e)>-1,o.lexical.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var n=this.currentScope();i=this.treatFunctionsAsVar?n.lexical.indexOf(e)>-1:n.lexical.indexOf(e)>-1||n.var.indexOf(e)>-1,n.functions.push(e)}else for(var r=this.scopeStack.length-1;r>=0;--r){var a=this.scopeStack[r];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){i=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],a.flags&z)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},he.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},he.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},he.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},he.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var ge=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new V(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fe=j.prototype;function me(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}fe.startNode=function(){return new ge(this,this.start,this.startLoc)},fe.startNodeAt=function(e,t){return new ge(this,e,t)},fe.finishNode=function(e,t){return me.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fe.finishNodeAt=function(e,t,s,i){return me.call(this,e,t,s,i)},fe.copyNode=function(e){var t=new ge(this,e.start,this.startLoc);for(var s in e)t[s]=e[s];return t};var ve,we,Ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ye=Ce+" Extended_Pictographic",be=ye+" EBase EComp EMod EPres ExtPict",Se={9:Ce,10:ye,11:ye,12:be,13:be,14:be},xe={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Re="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Pe="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ee=Pe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ie=Ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ke=Ie+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Fe=ke+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",De={9:Pe,10:Ee,11:Ie,12:ke,13:Fe,14:Fe+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},Te={};for(var Ae=0,Me=[9,10,11,12,13,14];Ae<Me.length;Ae+=1)we=void 0,(we=Te[ve=Me[Ae]]={binary:A(Se[ve]+" "+Re),binaryOfStrings:A(xe[ve]),nonBinary:{General_Category:A(Re),Script:A(De[ve])}}).nonBinary.Script_Extensions=we.nonBinary.Script,we.nonBinary.gc=we.nonBinary.General_Category,we.nonBinary.sc=we.nonBinary.Script,we.nonBinary.scx=we.nonBinary.Script_Extensions;var Ne=j.prototype,Le=function(e,t){this.parent=e,this.base=t||this};Le.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var s=e;s;s=s.parent)if(t.base===s.base&&t!==s)return!0;return!1},Le.prototype.sibling=function(){return new Le(this.parent,this.base)};var Ve=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Te[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function _e(e){return 105===e||109===e||115===e}function Oe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Be(e){return e>=65&&e<=90||e>=97&&e<=122}Ve.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("v"),o=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=o&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=o&&this.parser.options.ecmaVersion>=9)},Ve.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Ve.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var o=s.charCodeAt(e);if(!t&&!this.switchU||o<=55295||o>=57344||e+1>=i)return o;var n=s.charCodeAt(e+1);return n>=56320&&n<=57343?(o<<10)+n-56613888:o},Ve.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var o,n=s.charCodeAt(e);return!t&&!this.switchU||n<=55295||n>=57344||e+1>=i||(o=s.charCodeAt(e+1))<56320||o>57343?e+1:e+2},Ve.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Ve.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Ve.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Ve.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Ve.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var s=this.pos,i=0,o=e;i<o.length;i+=1){var n=o[i],r=this.at(s,t);if(-1===r||r!==n)return!1;s=this.nextIndex(s,t)}return this.pos=s,!0},Ne.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=!1,o=!1,n=0;n<s.length;n++){var r=s.charAt(n);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),s.indexOf(r,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===r&&(i=!0),"v"===r&&(o=!0)}this.options.ecmaVersion>=15&&i&&o&&this.raise(e.start,"Invalid regular expression flag")},Ne.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Ne.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t<s.length;t+=1){var i=s[t];e.groupNames[i]||e.raise("Invalid named capture referenced")}},Ne.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Le(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Ne.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Ne.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Ne.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},Ne.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Ne.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Ne.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,o=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(o=e.lastIntValue),e.eat(125)))return-1!==o&&o<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=s}return!1},Ne.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Ne.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Ne.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var s=this.regexp_eatModifiers(e),i=e.eat(45);if(s||i){for(var o=0;o<s.length;o++){var n=s.charAt(o);s.indexOf(n,o+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(i){var r=this.regexp_eatModifiers(e);s||r||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var a=0;a<r.length;a++){var l=r.charAt(a);(r.indexOf(l,a+1)>-1||s.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Ne.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Ne.regexp_eatModifiers=function(e){for(var t="",s=0;-1!==(s=e.current())&&_e(s);)t+=M(s),e.advance();return t},Ne.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Ne.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Ne.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Oe(t)&&(e.lastIntValue=t,e.advance(),!0)},Ne.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!Oe(s);)e.advance();return e.pos!==t},Ne.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Ne.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,s=e.groupNames[e.lastStringValue];if(s)if(t)for(var i=0,o=s;i<o.length;i+=1)o[i].separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(s||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Ne.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Ne.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=M(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=M(e.lastIntValue);return!0}return!1},Ne.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return u(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Ne.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return h(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Ne.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Ne.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},Ne.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Ne.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Ne.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Ne.regexp_eatZero=function(e){return 48===e.current()&&!ze(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Ne.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Ne.regexp_eatControlLetter=function(e){var t=e.current();return!!Be(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Ne.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s,i=e.pos,o=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(o&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(n-55296)+(a-56320)+65536,!0}e.pos=r,e.lastIntValue=n}return!0}if(o&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((s=e.lastIntValue)>=0&&s<=1114111))return!0;o&&e.raise("Invalid unicode escape"),e.pos=i}return!1},Ne.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Ne.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function He(e){return Be(e)||95===e}function Ge(e){return He(e)||ze(e)}function ze(e){return e>=48&&e<=57}function We(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function je(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ue(e){return e>=48&&e<=55}Ne.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var s=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((s=80===t)||112===t)){var i;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(i=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return s&&2===i&&e.raise("Invalid property name"),i;e.raise("Invalid property name")}return 0},Ne.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var o=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,o)}return 0},Ne.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){F(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},Ne.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Ne.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";He(t=e.current());)e.lastStringValue+=M(t),e.advance();return""!==e.lastStringValue},Ne.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ge(t=e.current());)e.lastStringValue+=M(t),e.advance();return""!==e.lastStringValue},Ne.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Ne.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),s=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===s&&e.raise("Negated character class may contain strings"),!0}return!1},Ne.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Ne.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;!e.switchU||-1!==t&&-1!==s||e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},Ne.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||Ue(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},Ne.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Ne.regexp_classSetExpression=function(e){var t,s=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(s=2);for(var i=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(s=1):e.raise("Invalid character in character class");if(i!==e.pos)return s;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(i!==e.pos)return s}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return s;2===t&&(s=2)}},Ne.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;return-1!==s&&-1!==i&&s>i&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Ne.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Ne.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var s=e.eat(94),i=this.regexp_classContents(e);if(e.eat(93))return s&&2===i&&e.raise("Negated character class may contain strings"),i;e.pos=t}if(e.eat(92)){var o=this.regexp_eatCharacterClassEscape(e);if(o)return o;e.pos=t}return null},Ne.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var s=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return s}else e.raise("Invalid escape");e.pos=t}return null},Ne.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Ne.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Ne.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var s=e.current();return!(s<0||s===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(s)||function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(s)||(e.advance(),e.lastIntValue=s,0))},Ne.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Ne.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!ze(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Ne.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Ne.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;ze(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},Ne.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;We(s=e.current());)e.lastIntValue=16*e.lastIntValue+je(s),e.advance();return e.pos!==t},Ne.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},Ne.regexp_eatOctalDigit=function(e){var t=e.current();return Ue(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Ne.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var o=e.current();if(!We(o))return e.pos=s,!1;e.lastIntValue=16*e.lastIntValue+je(o),e.advance()}return!0};var $e=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new V(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Ye=j.prototype;function Ke(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}Ye.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new $e(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ye.getToken=function(){return this.next(),new $e(this)},"undefined"!=typeof Symbol&&(Ye[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===C.eof,value:t}}}}),Ye.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(C.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ye.readToken=function(e){return u(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ye.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var s=this.input.charCodeAt(e+1);return s<=56319||s>=57344?t:(t<<10)+s-56613888},Ye.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Ye.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(var i=void 0,o=t;(i=x(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,s),t,this.pos,e,this.curPosition())},Ye.skipLineComment=function(e){for(var t=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!S(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,s,this.curPosition())},Ye.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&R.test(String.fromCharCode(e))))break e;++this.pos}}},Ye.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},Ye.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(C.ellipsis)):(++this.pos,this.finishToken(C.dot))},Ye.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(C.assign,2):this.finishOp(C.slash,1)},Ye.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?C.star:C.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=C.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(C.assign,s+1):this.finishOp(i,s)},Ye.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(C.assign,3):this.finishOp(124===e?C.logicalOR:C.logicalAND,2):61===t?this.finishOp(C.assign,2):this.finishOp(124===e?C.bitwiseOR:C.bitwiseAND,1)},Ye.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(C.assign,2):this.finishOp(C.bitwiseXOR,1)},Ye.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!y.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(C.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(C.assign,2):this.finishOp(C.plusMin,1)},Ye.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(C.assign,s+1):this.finishOp(C.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(C.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ye.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(C.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(C.arrow)):this.finishOp(61===e?C.eq:C.prefix,1)},Ye.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(C.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(C.assign,3):this.finishOp(C.coalesce,2)}return this.finishOp(C.question,1)},Ye.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,u(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(C.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+M(e)+"'")},Ye.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(C.parenL);case 41:return++this.pos,this.finishToken(C.parenR);case 59:return++this.pos,this.finishToken(C.semi);case 44:return++this.pos,this.finishToken(C.comma);case 91:return++this.pos,this.finishToken(C.bracketL);case 93:return++this.pos,this.finishToken(C.bracketR);case 123:return++this.pos,this.finishToken(C.braceL);case 125:return++this.pos,this.finishToken(C.braceR);case 58:return++this.pos,this.finishToken(C.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(C.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(C.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+M(e)+"'")},Ye.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},Ye.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(y.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var o=this.input.slice(s,this.pos);++this.pos;var n=this.pos,r=this.readWord1();this.containsEsc&&this.unexpected(n);var a=this.regexpState||(this.regexpState=new Ve(this));a.reset(s,o,r),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var l=null;try{l=new RegExp(o,r)}catch(e){}return this.finishToken(C.regexp,{pattern:o,flags:r,value:l})},Ye.readInt=function(e,t,s){for(var i=this.options.ecmaVersion>=12&&void 0===t,o=s&&48===this.input.charCodeAt(this.pos),n=this.pos,r=0,a=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var d=this.input.charCodeAt(this.pos),u=void 0;if(i&&95===d)o&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=d;else{if((u=d>=97?d-97+10:d>=65?d-65+10:d>=48&&d<=57?d-48:1/0)>=e)break;a=d,r=r*e+u}}return i&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||null!=t&&this.pos-n!==t?null:r},Ye.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s=Ke(this.input.slice(t,this.pos)),++this.pos):u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(C.num,s)},Ye.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var o=Ke(this.input.slice(t,this.pos));return++this.pos,u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(C.num,o)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46!==i||s||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||s||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n,r=(n=this.input.slice(t,this.pos),s?parseInt(n,8):parseFloat(n.replace(/_/g,"")));return this.finishToken(C.num,r)},Ye.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Ye.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):8232===i||8233===i?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(S(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(C.string,t)};var qe={};Ye.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==qe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ye.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qe;this.raise(e,t)},Ye.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==C.template&&this.type!==C.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(C.template,e)):36===s?(this.pos+=2,this.finishToken(C.dollarBraceL)):(++this.pos,this.finishToken(C.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(S(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ye.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(C.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},Ye.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return M(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(i,8);return o>255&&(i=i.slice(0,-1),o=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(o)}return S(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Ye.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},Ye.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var o=this.fullCharCodeAtPos();if(h(o,i))this.pos+=o<=65535?1:2;else{if(92!==o)break;this.containsEsc=!0,e+=this.input.slice(s,this.pos);var n=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var r=this.readCodePoint();(t?u:h)(r,i)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=M(r),s=this.pos}t=!1}return e+this.input.slice(s,this.pos)},Ye.readWord=function(){var e=this.readWord1(),t=C.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Ze="8.18.0";j.acorn={Parser:j,version:Ze,defaultOptions:O,Position:L,SourceLocation:V,getLineInfo:_,Node:ge,TokenType:p,tokTypes:C,keywordTypes:v,TokContext:oe,tokContexts:ne,isIdentifierChar:h,isIdentifierStart:u,Token:$e,isNewLine:S,lineBreak:y,lineBreakG:b,nonASCIIwhitespace:R},e.Node=ge,e.Parser=j,e.Position=L,e.SourceLocation=V,e.TokContext=oe,e.Token=$e,e.TokenType=p,e.defaultOptions=O,e.getLineInfo=_,e.isIdentifierChar=h,e.isIdentifierStart=u,e.isNewLine=S,e.keywordTypes=v,e.lineBreak=y,e.lineBreakG=b,e.nonASCIIwhitespace=R,e.parse=function(e,t){return j.parse(e,t)},e.parseExpressionAt=function(e,t,s){return j.parseExpressionAt(e,t,s)},e.tokContexts=ne,e.tokTypes=C,e.tokenizer=function(e,t){return j.tokenizer(e,t)},e.version=Ze}(t)},20930:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},22784:(e,t,s)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.unload=t.load=t.onExit=t.signals=void 0;const o=s(8633);Object.defineProperty(t,"signals",{enumerable:!0,get:function(){return o.signals}});const n=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,r=Symbol.for("signal-exit emitter"),a=globalThis,l=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(a[r])return a[r];l(a,r,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const s=this.listeners[e],i=s.indexOf(t);-1!==i&&(0===i&&1===s.length?s.length=0:s.splice(i,1))}emit(e,t,s){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const o of this.listeners[e])i=!0===o(t,s)||i;return"exit"===e&&(i=this.emit("afterExit",t,s)||i),i}}class d{}const u=globalThis.process;var h;h=n(u)?new class extends d{#e="win32"===u.platform?"SIGINT":"SIGHUP";#t=new c;#s;#i;#o;#n={};#r=!1;constructor(e){super(),this.#s=e,this.#n={};for(const t of o.signals)this.#n[t]=()=>{const s=this.#s.listeners(t);let{count:i}=this.#t;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(i+=o.__signal_exit_emitter__.count),s.length===i){this.unload();const s=this.#t.emit("exit",null,t),i="SIGHUP"===t?this.#e:t;s||e.kill(e.pid,i)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!n(this.#s))return()=>{};!1===this.#r&&this.load();const s=t?.alwaysLast?"afterExit":"exit";return this.#t.on(s,e),()=>{this.#t.removeListener(s,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(const e of o.signals)try{const t=this.#n[e];t&&this.#s.on(e,t)}catch(e){}this.#s.emit=(e,...t)=>this.#a(e,...t),this.#s.reallyExit=e=>this.#l(e)}}unload(){this.#r&&(this.#r=!1,o.signals.forEach((e=>{const t=this.#n[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#s.removeListener(e,t)}catch(e){}})),this.#s.emit=this.#i,this.#s.reallyExit=this.#o,this.#t.count-=1)}#l(e){return n(this.#s)?(this.#s.exitCode=e||0,this.#t.emit("exit",this.#s.exitCode,null),this.#o.call(this.#s,this.#s.exitCode)):0}#a(e,...t){const s=this.#i;if("exit"===e&&n(this.#s)){"number"==typeof t[0]&&(this.#s.exitCode=t[0]);const i=s.call(this.#s,e,...t);return this.#t.emit("exit",this.#s.exitCode,null),i}return s.call(this.#s,e,...t)}}(u):new class extends d{onExit(){return()=>{}}load(){}unload(){}},i={onExit:(e,t)=>h.onExit(e,t),load:()=>h.load(),unload:()=>h.unload()},t.onExit=i.onExit,t.load=i.load,t.unload=i.unload},23409:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(15644);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},27587:(e,t,s)=>{s.d(t,{W6:()=>Le});var i=s(96652),o=s(77458),n=s(46410),r=s(15684),a=o.XQb,l=o.Cf3,c=o.pow,d="36.2.0";function u(e){return null!=e&&""!==e}function h(e,t,s){e.setAttribute(p(t),s.toString())}function p(e){return`aria-${e}`}function g(e){e?.parentNode&&e.remove()}"object"!=typeof window||window,(()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(d);t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(d,t))})();var f=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(e){if(e.includes(" ")){const s=(e||"").split(" ");if(s.length>1){for(const e of s)this.toggleCss(e,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}}},m=e=>({ref:"accentColor",mix:e}),v=e=>({ref:"foregroundColor",mix:e}),w=e=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),C=(v(.15),w(.02),m(.08),m(.5),w(.3),v(.2),v(.2),w(.03),w(.95),(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}));C("eTopLeft","topLeft"),C("eTop","top"),C("eTopRight","topRight"),C("eRight","right"),C("eBottomRight","bottomRight"),C("eBottom","bottom"),C("eBottomLeft","bottomLeft"),C("eLeft","left"),new RegExp("[T ]"),new RegExp("^\\d{4}-\\d{2}-\\d{2}([T ]\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}(:?\\d{2})?)?)?$");var y=i.createContext({}),b=i.createContext("default"),S=(e,t,s,i)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const o=e.newAgStackInstance();let n,r,a=!1;return o.then((e=>{a?t.destroyBean(e):(n=e,r=n.getGui?.(),r&&s.appendChild(r),x(i,n))})),()=>{a=!0,n&&(r?.remove(),t.destroyBean(n),i&&x(i,void 0))}},x=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},R=(...e)=>e.filter((e=>null!=e&&""!==e)).join(" "),P=class e{constructor(...e){this.classesMap={};for(const t of e)this.classesMap[t]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const i=new e;return i.classesMap={...this.classesMap},i.classesMap[t]=s,i}toString(){return Object.keys(this.classesMap).filter((e=>this.classesMap[e])).join(" ")}},E=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),I=i.version?.split(".")[0],k="16"===I||"17"===I,F=!1,D=(e,t)=>{k||!e||F?t():n.flushSync(t)};function T(e,t,s){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(s||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const i=[],o=[],n=new Map,r=new Map;for(let e=0;e<t.length;e++){const s=t[e];r.set(s.instanceId,s)}for(let t=0;t<e.length;t++){const s=e[t];n.set(s.instanceId,s),r.has(s.instanceId)&&i.push(s)}for(let e=0;e<t.length;e++){const s=t[e],i=s.instanceId;n.has(i)||o.push(s)}return i.length===e.length&&0===o.length?e:0===i.length&&o.length===t.length?t:0===i.length?o:0===o.length?i:[...i,...o]}var A=(0,i.forwardRef)(((e,t)=>{const{registry:s,context:o}=(0,i.useContext)(y),n=(0,i.useRef)(null),r=(0,i.useRef)(null),a=(0,i.useRef)(null),l=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(),[u,h]=(0,i.useState)(),[p,g]=(0,i.useState)(),[f,m]=(0,i.useState)(),[v,w]=(0,i.useState)((()=>new P)),[C,b]=(0,i.useState)((()=>new P("ag-hidden"))),[x,R]=(0,i.useState)(!0),[E,I]=(0,i.useState)((()=>new P("ag-hidden"))),[k,F]=(0,i.useState)(!0),[D,T]=(0,i.useState)((()=>new P("ag-invisible"))),[M,N]=(0,i.useState)(!0);(0,i.useImperativeHandle)(t,(()=>({refresh:()=>!1}))),(0,i.useLayoutEffect)((()=>S(u,o,r.current)),[u]);const L=(0,i.useCallback)((t=>{if(n.current=t,!t||o.isDestroyed())return void(d.current=o.destroyBean(d.current));const i={setInnerRenderer:(e,t)=>{h(e),m(t)},setChildCount:e=>g(e),toggleCss:(e,t)=>w((s=>s.setClass(e,t))),setContractedDisplayed:e=>{I((t=>t.setClass("ag-hidden",!e))),F(!e)},setExpandedDisplayed:e=>{b((t=>t.setClass("ag-hidden",!e))),R(!e)},setCheckboxVisible:e=>{T((t=>t.setClass("ag-invisible",!e))),N(!e)},setCheckboxSpacing:e=>T((t=>t.setClass("ag-group-checkbox-spacing",e)))},r=s.createDynamicBean("groupCellRendererCtrl",!0);r&&(d.current=o.createBean(r),d.current.init(i,t,a.current,l.current,c.current,A,e))}),[]),V=(0,i.useMemo)((()=>`ag-cell-wrapper ${v.toString()}`),[v]),_=(0,i.useMemo)((()=>`ag-group-expanded ${C.toString()}`),[C]),O=(0,i.useMemo)((()=>`ag-group-contracted ${E.toString()}`),[E]),B=(0,i.useMemo)((()=>`ag-group-checkbox ${D.toString()}`),[D]),H=u?.componentFromFramework,G=H?u.componentClass:void 0,z=null==u&&null!=f,W=(j=f,j?.toString().toString()??null);var j;return i.createElement("span",{className:V,ref:L,...e.colDef?{}:{role:d.current?.getCellAriaRole()}},i.createElement("span",{className:_,ref:l,"aria-hidden":x}),i.createElement("span",{className:O,ref:c,"aria-hidden":k}),i.createElement("span",{className:B,ref:a,"aria-hidden":M}),i.createElement("span",{className:"ag-group-value",ref:r},z?W:H?i.createElement(G,{...u.params}):null),i.createElement("span",{className:"ag-group-child-count"},p))})),M=A,N=(0,i.createContext)({setMethods:()=>{}}),L=(0,i.memo)((e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:n}=e,[{key:r,...a},l]=(0,i.useState)(t);return(0,i.useEffect)((()=>{s((e=>l(e)))}),[]),i.createElement(N.Provider,{value:{setMethods:n}},i.createElement(o,{key:r,...a}))})),V=0;function _(){return"agPortalKey_"+ ++V}var O=class{constructor(e,t,s,i){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=_(),this.portalKey=_(),this.instanceCreated=this.isStatelessComponent()?r.oY$.resolve(!1):new r.oY$((e=>{this.resolveInstanceCreated=e}))}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),this.componentType.requiresBlockWrapper&&s.classList.add("ag-react-wrapper-block"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s)return void setTimeout((()=>this.callMethod(e,t)));const i=s[e];return i?i.apply(s,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new r.oY$((e=>this.createReactComponent(e)))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{this.componentInstance=e,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=(0,n.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,i.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function B(e,t,s){for(const i of e){const e=t[i];e&&(s[i]=e)}}var H=class extends O{constructor(){super(...arguments),this.awaitUpdateCallback=new r.oY$((e=>{this.resolveUpdateCallback=e})),this.wrapperComponent=L}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then((()=>this.componentInstance))}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new r.oY$((e=>{setTimeout((()=>{e()}))}))),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,B(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new r.oY$((e=>this.awaitUpdateCallback.then((()=>{this.updateCallback().then((()=>e()))}))))}},G=class extends H{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},z=class extends H{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},W=class extends H{refresh(e){this.sourceParams=e,this.refreshProps()}},j=class extends H{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},U=class extends H{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:i}=this;return e.label=t,e.icon=s,e.shake=i,e}},$=class extends H{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new r.oY$((e=>{this.resolveSetMethodsCallback=e}))}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then((()=>this.providedMethods?.afterGuiAttached?.(e)))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){!1===this.expectingNewMethods&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout((()=>{this.sourceParams.filterChangedCallback()})),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new r.oY$((e=>{this.resolveFilterPassCallback=e}));this.setModel(e).then((()=>{t.then((()=>{this.sourceParams.filterChangedCallback()}))}))}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},Y=class extends H{constructor(){super(...arguments),this.awaitSetMethodsCallback=new r.oY$((e=>{this.resolveSetMethodsCallback=e}))}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then((()=>this.providedMethods?.afterGuiAttached?.(e)))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function K(e,t){e.parentFilterInstance((s=>{((s instanceof o.Q5x?s.setModel(t,!0):s.setModel(t))||r.oY$.resolve()).then((()=>{e.filterParams.filterChangedCallback()}))}))}var q=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){B(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),K(this.floatingFilterParams,e)}},Z=class extends H{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),K(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},Q=class extends H{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},J=class extends H{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},X=class extends H{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then((()=>this.sourceParams.onItemActivated()))}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},ee=class extends H{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},te=class extends H{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}init(e){return this.applyInitialState(e),super.init(e)}refresh(e){return this.sourceParams=e,this.applyInitialState(e),this.refreshProps(),!0}applyInitialState(e){void 0!==e.initialState&&e!==this.appliedParams&&(this.state=e.initialState),this.appliedParams=e}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function se(e){(0,o.DHs)(e,231)}var ie=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||1e3}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter((t=>t!==e)),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout((()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)})),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return D(!0,(()=>this.refresher())),void(e.rendered()&&t(e));window.setTimeout((()=>{this.waitForInstance(e,t,s)}))}}},oe=i.createContext(null),ne=i.createContext(void 0),re=(0,i.memo)((({ctrl:e})=>{const t=e.isAlive(),{context:s}=(0,i.useContext)(y),[n,r]=(0,i.useState)(),[a,l]=(0,i.useState)(),c=(0,i.useRef)(),d=(0,i.useRef)(null),u=(0,i.useRef)(null),g=(0,i.useRef)(null),m=(0,i.useRef)(),v=(0,i.useRef)();t&&!v.current&&(v.current=new f((()=>d.current)));const w=(0,i.useCallback)((t=>{if(d.current=t,!t||!e.isAlive()||s.isDestroyed())return void(c.current=s.destroyBean(c.current));c.current=s.createBean(new o.dQD);const i=()=>{const t=e.getSelectAllGui();t&&(u.current?.insertAdjacentElement("afterend",t),c.current.addDestroyFunc((()=>t.remove())))},n={setWidth:e=>{d.current&&(d.current.style.width=e)},toggleCss:(e,t)=>v.current.toggleCss(e,t),setUserStyles:e=>l(e),setAriaSort:e=>{d.current&&(e?function(e,t){h(e,"sort",t)}(d.current,e):function(e){e.removeAttribute(p("sort"))}(d.current))},setUserCompDetails:e=>r(e),getUserCompInstance:()=>m.current||void 0,refreshSelectAllGui:i,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(n,t,u.current,g.current,c.current),i()}),[]);(0,i.useLayoutEffect)((()=>S(n,s,g.current,m)),[n]),(0,i.useEffect)((()=>{e.setDragSource(d.current)}),[n]);const C=(0,i.useMemo)((()=>!(!n?.componentFromFramework||!E(n.componentClass))),[n]),b=n?.componentFromFramework,x=n?.componentClass;return i.createElement("div",{ref:w,style:a,className:"ag-header-cell",role:"columnheader"},i.createElement("div",{ref:u,className:"ag-header-cell-resize",role:"presentation"}),i.createElement("div",{ref:g,className:"ag-header-cell-comp-wrapper",role:"presentation"},b?C?i.createElement(x,{...n.params}):i.createElement(x,{...n.params,ref:m}):null))})),ae=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){B(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},le=(0,i.memo)((({ctrl:e})=>{const{context:t,gos:s}=(0,i.useContext)(y),[n,a]=(0,i.useState)(),[l,c]=(0,i.useState)((()=>new P("ag-header-cell","ag-floating-filter"))),[d,u]=(0,i.useState)((()=>new P)),[h,p]=(0,i.useState)((()=>new P("ag-floating-filter-button","ag-hidden"))),[g,f]=(0,i.useState)("false"),[m,v]=(0,i.useState)(),[,w]=(0,i.useState)(1),C=(0,i.useRef)(),b=(0,i.useRef)(null),x=(0,i.useRef)(null),R=(0,i.useRef)(null),I=(0,i.useRef)(null),k=(0,i.useRef)(),F=(0,i.useRef)(),D=e=>{null!=e&&k.current?.(e)},T=(0,i.useCallback)((s=>{if(b.current=s,!s||!e.isAlive()||t.isDestroyed())return void(C.current=t.destroyBean(C.current));C.current=t.createBean(new o.dQD),F.current=new r.oY$((e=>{k.current=e}));const i={toggleCss:(e,t)=>c((s=>s.setClass(e,t))),setUserStyles:e=>a(e),addOrRemoveBodyCssClass:(e,t)=>u((s=>s.setClass(e,t))),setButtonWrapperDisplayed:e=>{p((t=>t.setClass("ag-hidden",!e))),f(e?"false":"true")},setWidth:e=>{b.current&&(b.current.style.width=e)},setCompDetails:e=>v(e),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:e=>I.current?.appendChild(e)};e.setComp(i,s,I.current,x.current,C.current)}),[]);(0,i.useLayoutEffect)((()=>S(m,t,x.current,D)),[m]);const A=(0,i.useMemo)((()=>l.toString()),[l]),M=(0,i.useMemo)((()=>d.toString()),[d]),L=(0,i.useMemo)((()=>h.toString()),[h]),V=(0,i.useMemo)((()=>!!(m&&m.componentFromFramework&&E(m.componentClass))),[m]),_=(0,i.useMemo)((()=>s.get("reactiveCustomComponents")),[]),O=(0,i.useMemo)((()=>s.get("enableFilterHandlers")),[]),[B,H]=(0,i.useState)();(0,i.useEffect)((()=>{if(m?.componentFromFramework)if(_){const e=new(O?ae:q)(m.params,(()=>w((e=>e+1))));D(e),H(e)}else se(t.getId())}),[m]);const G=B?.getProps(),z=m?.componentFromFramework,W=m?.componentClass;return i.createElement("div",{ref:T,style:n,className:A,role:"gridcell"},i.createElement("div",{ref:x,className:M,role:"presentation"},z?_?G&&i.createElement(N.Provider,{value:{setMethods:e=>B.setMethods(e)}},i.createElement(W,{...G})):i.createElement(W,{...m.params,ref:V?()=>{}:D}):null),i.createElement("div",{ref:R,"aria-hidden":g,className:L,role:"presentation"},i.createElement("button",{ref:I,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))})),ce=(0,i.memo)((({ctrl:e})=>{const{context:t}=(0,i.useContext)(y),[s,n]=(0,i.useState)(),[r,a]=(0,i.useState)((()=>new P)),[l,c]=(0,i.useState)((()=>new P)),[d,u]=(0,i.useState)("false"),[h,p]=(0,i.useState)(),[g,f]=(0,i.useState)(),m=(0,i.useRef)(),v=(0,i.useRef)(null),w=(0,i.useRef)(null),C=(0,i.useRef)(null),b=(0,i.useRef)(),x=(0,i.useCallback)((s=>{if(v.current=s,!s||!e.isAlive()||t.isDestroyed())return void(m.current=t.destroyBean(m.current));m.current=t.createBean(new o.dQD);const i={setWidth:e=>{v.current&&(v.current.style.width=e)},toggleCss:(e,t)=>a((s=>s.setClass(e,t))),setUserStyles:e=>n(e),setHeaderWrapperHidden:e=>{C.current&&(0,o.ufU)(C.current,e)},setHeaderWrapperMaxHeight:e=>{C.current&&(0,o.ZLI)(C.current,e)},setUserCompDetails:e=>f(e),setResizableDisplayed:e=>{c((t=>t.setClass("ag-hidden",!e))),u(e?"false":"true")},setAriaExpanded:e=>p(e),getUserCompInstance:()=>b.current||void 0};e.setComp(i,s,w.current,C.current,m.current)}),[]);(0,i.useLayoutEffect)((()=>S(g,t,C.current,b)),[t,g]),(0,i.useEffect)((()=>{v.current&&e.setDragSource(v.current)}),[g]);const R=(0,i.useMemo)((()=>!(!g?.componentFromFramework||!E(g.componentClass))),[g]),I=(0,i.useMemo)((()=>"ag-header-group-cell "+r.toString()),[r]),k=(0,i.useMemo)((()=>"ag-header-cell-resize "+l.toString()),[l]),F=g?.componentFromFramework,D=g?.componentClass;return i.createElement("div",{ref:x,style:s,className:I,role:"columnheader","aria-expanded":h},i.createElement("div",{ref:C,className:"ag-header-cell-comp-wrapper",role:"presentation"},F?R?i.createElement(D,{...g.params}):i.createElement(D,{...g.params,ref:b}):null),i.createElement("div",{ref:w,"aria-hidden":d,className:k}))})),de=(0,i.memo)((({ctrl:e,setGuiRef:t})=>{const s=(0,i.useContext)(y),{context:n,visibleCols:r,gos:a}=s,l=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(null),p=(0,i.useRef)(),g=(0,i.useRef)([]),f=(0,i.useRef)([]),m=(0,i.useRef)(""),v=(0,i.useRef)(!1),[w,C]=(0,i.useState)([]),[b,S]=(0,i.useState)((()=>(0,o.t3u)(s)?void 0:a.get("tabIndex"))),x=(0,i.useRef)({pinnedLeftWidth:void 0,centerWidth:void 0,pinnedRightWidth:void 0}),R=(0,i.useCallback)((()=>{if(!c.current||!d.current||!u.current)return;const e="print"===a.get("domLayout");(0,o.jf6)(r,e,{ePinnedLeft:c.current,eScrolling:d.current,ePinnedRight:u.current},x.current)}),[a,r]),P=(0,i.useCallback)((s=>{if(l.current=s,t?.(s),!s||!e.isAlive()||n.isDestroyed())return void(p.current=n.destroyBean(p.current));p.current=n.createBean(new o.dQD);const i={setTop:e=>{l.current&&(l.current.style.top=e)},setHeight:e=>{l.current&&(l.current.style.height=e)},setHeaderCtrls:(e,t,s)=>{v.current=t,g.current=e,(e=>{const t="print"===a.get("domLayout"),s=function(e,t){return t?"print":e.map((e=>{const t=e.column?.getPinned()??"center";return`${e.instanceId}:${t}`})).join("|")}(g.current,t),i=m.current!==s?g.current:T(f.current,g.current,v.current);i!==f.current&&(f.current=i,m.current=s,D(e,(()=>C(i))))})(s)},refreshPinnedCellGroupWidths:()=>R(),setWidth:e=>{l.current&&(l.current.style.width=e)},setRowIndex:e=>{l.current&&(function(e,t){h(e,"rowindex",t)}(l.current,e),l.current.classList.toggle("ag-header-row-not-first",1!==e))},setTabIndex:S};e.setComp(i,p.current)}),[n,e,R,t]),E="print"===a.get("domLayout"),{left:I,center:k,right:F}=(0,i.useMemo)((()=>E?{left:[],center:w,right:[]}:(0,o.$YQ)(w,(e=>e.column?.getPinned()))),[w,E]),A=(0,i.useCallback)((t=>{switch(e.type){case"group":return i.createElement(ce,{ctrl:t,key:t.instanceId});case"filter":return i.createElement(le,{ctrl:t,key:t.instanceId});default:return i.createElement(re,{ctrl:t,key:t.instanceId})}}),[e.type]);return i.createElement("div",{ref:P,className:e.headerRowClass,role:"row",tabIndex:b},i.createElement("div",{ref:c,className:"ag-grid-pinned-left-cells",role:"presentation"},i.createElement("div",{className:"ag-grid-container-wrapper",role:"presentation"},I.map(A))),i.createElement("div",{ref:d,className:"ag-grid-scrolling-cells",role:"presentation"},k.map(A)),i.createElement("div",{ref:u,className:"ag-grid-pinned-right-cells",role:"presentation"},i.createElement("div",{className:"ag-grid-container-wrapper",role:"presentation"},F.map(A))))})),ue=(0,i.memo)((({eGui:e,eGridViewport:t,setHeaderRowFocusableElements:s})=>{const{context:n}=(0,i.useContext)(y),[r,a]=(0,i.useState)([]),l=(0,i.useRef)(),c=(0,i.useRef)(new Map),d=(0,i.useCallback)(((e,t)=>{t?c.current.set(e,t):c.current.delete(e)}),[]);return(0,i.useLayoutEffect)((()=>{s&&s(r.map((e=>c.current.get(e.instanceId))).filter((e=>!!e)))}),[r,s]),(0,i.useLayoutEffect)((()=>{if(!e||n.isDestroyed())return void(l.current=n.destroyBean(l.current));const i={setCtrls:e=>a(e),setViewportScrollLeft:e=>{}};return l.current=n.createBean(new o.OPU),l.current.setComp(i,e,t),()=>{s&&s([]),l.current=n.destroyBean(l.current)}}),[n,e,t,s]),i.createElement(i.Fragment,null,r.map((e=>i.createElement(de,{ctrl:e,key:e.instanceId,setGuiRef:t=>d(e.instanceId,t)}))))})),he=(0,i.memo)((({eGridViewport:e})=>{const{context:t}=(0,i.useContext)(y),s=(0,i.useRef)(),n=(0,i.useRef)(),r=(0,i.useRef)(null),[a,l]=(0,i.useState)(null),[c,d]=(0,i.useState)(!1);n.current||(n.current=new f((()=>r.current)));const u=(0,i.useCallback)((e=>{s.current?.setHeaderRowFocusableElements(e)}),[]),h=(0,i.useCallback)((i=>{if(r.current=i,l(i),!i||t.isDestroyed())return s.current=t.destroyBean(s.current),void d(!1);n.current.toggleCss("ag-header",!0);const a={toggleCss:(e,t)=>n.current.toggleCss(e,t)};s.current=t.createBean(new o.vBt),s.current.setComp(a,i,e),d(!0)}),[t,e]);return i.createElement("div",{ref:h,role:"presentation"},c&&a&&i.createElement(ue,{eGui:a,eGridViewport:e,setHeaderRowFocusableElements:u}))})),pe=(e,t)=>{(0,i.useEffect)((()=>{const s=t.current;if(s){const t=s.parentElement;if(t){const i=document.createComment(e);return t.insertBefore(i,s),()=>{i.remove()}}}}),[e])},ge=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new r.oY$((e=>{this.resolveInstanceCreated=e})),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){B(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then((()=>this.componentInstance))}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},fe=(0,i.memo)((e=>{const[t,s]=(0,i.useState)(),o=(0,i.useContext)(y),{context:r,popupSvc:a,gos:l,editSvc:c}=o,{editDetails:d,cellCtrl:u,eParentCell:h}=e;return(()=>{const t=(0,i.useRef)((()=>{const{compDetails:t}=d,i=l.get("stopEditingWhenCellsLoseFocus");let o,n;if(!r.isDestroyed()){n=r.createBean(c.createPopupEditorWrapper(t.params));const l=n.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&l.appendChild(t)}const{column:p,rowNode:g}=u,f={column:p,rowNode:g,type:"popupCellEditor",eventSource:h,ePopup:l,position:d.popupPosition,keepWithinBounds:!0},m=a?.positionPopupByComponent.bind(a,f),v=a?.addPopup({modal:i,eChild:l,closeOnEsc:!0,closedCallback:e=>{c.onPopupEditorClosed(u,e)},anchorToElement:h,positionCallback:m,ariaOwns:h});o=v?v.hideFunc:void 0,s(n),e.jsChildComp?.afterGuiAttached?.()}return()=>{o?.(),r.destroyBean(n)}})),o=(0,i.useRef)(),n=(0,i.useRef)(!1),p=(0,i.useRef)(!1),[,g]=(0,i.useState)(0);n.current&&(p.current=!0),(0,i.useEffect)((()=>(n.current||(o.current=t.current(),n.current=!0),g((e=>e+1)),()=>{p.current&&o.current?.()})),[])})(),(0,i.useLayoutEffect)((()=>()=>{u.isCellFocused()&&t?.getGui().contains(function(e){return function(e){return e.eRootDiv.getRootNode()}(e).activeElement}(o))&&h.focus({preventScroll:!0})}),[t]),t&&e.wrappedContent?(0,n.createPortal)(e.wrappedContent,t.getGui()):null})),me=(e,t,s)=>e.compProxy?((e,t,s)=>{const{compProxy:o}=e;s(o);const n=o.getProps(),r=E(t);return i.createElement(N.Provider,{value:{setMethods:e=>o.setMethods(e)}},r?i.createElement(t,{...n}):i.createElement(t,{...n,ref:e=>o.setRef(e)}))})(e,t,s):i.createElement(t,{...e.compDetails.params,ref:s}),ve=(e,t,s,o,n,r,a=!1,l)=>{const{context:c}=(0,i.useContext)(y),d=(0,i.useRef)(l);d.current=l;const u=(0,i.useCallback)(((e=!0)=>{const t=n.current;if(!t)return;const s=t.getGui();s&&s.parentElement&&s.remove(),c.destroyBean(t),n.current=void 0,e&&d.current?.()}),[]);(0,i.useEffect)((()=>{const i=null!=e&&!a,o=e?.compDetails&&!e.compDetails.componentFromFramework;if(!i||!o||t&&null==s)return void u();const l=e.compDetails;if(n.current){const t=n.current,s=!(null==t.refresh||0!=e.force)&&t.refresh(l.params);if(!0===s||void 0===s)return;u()}l.newAgStackInstance().then((e=>{if(!e)return;const i=e.getGui();i&&((t?s:r.current).appendChild(i),n.current=e)}))}),[e,t,o,a]),(0,i.useEffect)((()=>()=>u(!1)),[])},we=({cellCtrl:e,parent:t})=>{const s=(0,i.useRef)(),o=(0,i.useMemo)((()=>{const{loadingComp:t}=e.getDeferLoadingCellRenderer();return t?{value:void 0,compDetails:t,force:!1}:void 0}),[e]);if(ve(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const e=o.compDetails.componentClass;return i.createElement(e,{...o.compDetails.params})}return i.createElement(i.Fragment,null)},Ce=(0,i.memo)((({cellCtrl:e,printLayout:t,editingCell:s})=>{const n=(0,i.useContext)(y),{context:r}=n,{column:{colIdSanitised:a},instanceId:l}=e,c=(0,i.useRef)(),[d,u]=(0,i.useState)((()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1})),[h,p]=(0,i.useState)(),[m,v]=(0,i.useState)(1),[w,C]=(0,i.useState)(),[b,S]=(0,i.useState)(!1),[x,R]=(0,i.useState)(!1),[P,I]=(0,i.useState)(!1),F=(0,i.useRef)(null),[D,T]=(0,i.useState)(),A=(0,i.useMemo)((()=>e.isForceWrapper()),[e]),M=(0,i.useMemo)((()=>e.getCellAriaRole()),[e]),N=(0,i.useRef)(null),L=(0,i.useRef)(null),V=(0,i.useRef)(null),_=(0,i.useRef)(),O=(0,i.useRef)(),B=(0,i.useRef)(),H=(0,i.useRef)([]),G=(0,i.useRef)(),z=(0,i.useRef)(),[W,j]=(0,i.useState)(0),U=(0,i.useCallback)((e=>{z.current=e,j((e=>e+1))}),[]),$=null!=d&&(b||P||x)&&(null==h||!!h.popup),Y=A||$,K=(0,i.useMemo)((()=>e.getCellValueClass()),[e]),q=(0,i.useCallback)((t=>{if(O.current=t,t){const s=t.isCancelBeforeStart&&t.isCancelBeforeStart();setTimeout((()=>{e.isAlive()&&!r.isDestroyed()&&(s?(e.stopEditing(!0),e.focusCell({forceBrowserFocus:!0})):(n.editSvc?.onEditorAttached(e),e.enableEditorTooltipFeature(t)))}))}}),[e]),Z=(0,i.useRef)();Z.current||(Z.current=new f((()=>N.current)));const Q=!!h&&!h.popup,J=(0,i.useCallback)((()=>e.resetCellRendererTooltip()),[e]);ve(d,Y,z.current,W,_,N,Q,J);const X=(0,i.useRef)();(0,i.useLayoutEffect)((()=>{const t=X.current,s=d;X.current=d;const i=t?.compDetails,o=s?.compDetails;null!=i&&null!=o&&i!==o&&(G.current?.refreshVisibility(),i.componentClass==o.componentClass&&null!=V.current?.refresh&&1!=V.current.refresh(o.params)&&(e.resetCellRendererTooltip(),v((e=>e+1))))}),[d]),(0,i.useLayoutEffect)((()=>{if(!h||h.compDetails.componentFromFramework||r.isDestroyed())return;const t=h.compDetails,s=!0===h.popup,i=t.newAgStackInstance();return i.then((e=>{if(!e)return;const t=e.getGui();if(q(e),!s){const s=(A?B:N).current;s?.appendChild(t),e.afterGuiAttached?.()}T(e)})),()=>{i.then((t=>{const s=t.getGui();e.disableEditorTooltipFeature(),r.destroyBean(t),q(void 0),T(void 0),s?.remove()}))}}),[h]);const ee=(0,i.useCallback)((t=>{if(B.current=t,!t||r.isDestroyed()||!e.isAlive()){const e=H.current;H.current=[];for(const t of e)t();return}let s;const i=e=>{e&&(t.insertAdjacentElement("afterbegin",e.getGui()),H.current.push((()=>{g(e.getGui()),r.destroyBean(e),G.current===s&&(G.current=void 0)})))};b&&i(e.createSelectionCheckbox()),P&&i(e.createDndSource()),x&&(s=e.createRowDragComp(),G.current=s,s&&(i(s),s.refreshVisibility()))}),[e,r,P,x,b]),te=(0,i.useCallback)((()=>{const a=!e.isCellSpanning()||L.current,l=N.current;if(!l||!a||!e?.isAlive()||r.isDestroyed())return void(c.current=r.destroyBean(c.current));c.current=r.createBean(new o.dQD);const d={toggleCss:(e,t)=>Z.current.toggleCss(e,t),setUserStyles:e=>C(e),getFocusableElement:()=>N.current,setIncludeSelection:e=>S(e),setIncludeRowDrag:e=>R(e),setIncludeDndSource:e=>I(e),setRowResizerElement:e=>{F.current&&g(F.current),F.current=e,e&&N.current&&N.current.appendChild(e)},getCellEditor:()=>O.current??null,getCellRenderer:()=>V.current??_.current,getParentOfValue:()=>z.current??B.current??N.current,setRenderDetails:(t,s,o)=>{const n=()=>{u((i=>{if(i?.compDetails!==t||i?.value!==s||i?.force!==o){const n=i?.compDetails,r=null!=n&&null==t,a=null!=n&&null!=t&&n.componentClass!==t.componentClass;return(r||a)&&e.resetCellRendererTooltip(),{value:s,compDetails:t,force:o}}return i}))};if(t?.params?.deferRender&&!e.rowNode.group){const{loadingComp:t,onReady:s}=e.getDeferLoadingCellRenderer();if(t)return u({value:void 0,compDetails:t,force:!1}),void s.then((()=>{return e=n,void(k?e():i.startTransition(e));var e}))}n()},setEditDetails:(t,s,i,o)=>{if(t){let e;t.componentFromFramework&&(o?e=new ge(t.params,(()=>v((e=>e+1)))):se(n.context.getId())),p({compDetails:t,popup:s,popupPosition:i,compProxy:e}),s||u(void 0)}else e.hasBrowserFocus()&&d.getFocusableElement().focus({preventScroll:!0}),O.current=void 0,p(void 0)},refreshEditStyles:(e,t)=>{if(!N.current)return;const{current:s}=Z;s.toggleCss("ag-cell-value",!Y),s.toggleCss("ag-cell-inline-editing",!!e&&!t),s.toggleCss("ag-cell-popup-editing",!!e&&!!t),s.toggleCss("ag-cell-not-inline-editing",!e||!!t)}},h=B.current||void 0;e.setComp(d,l,L.current??void 0,h,t,s,c.current)}),[]),ie=(0,i.useCallback)((e=>{N.current=e,te()}),[]),oe=(0,i.useCallback)((e=>{L.current=e,te()}),[]),ne=(0,i.useMemo)((()=>!(!d?.compDetails?.componentFromFramework||!E(d.compDetails.componentClass))),[d]);(0,i.useLayoutEffect)((()=>{if(!N.current)return;const{current:e}=Z;e.toggleCss("ag-cell-value",!Y),e.toggleCss("ag-cell-inline-editing",!!h&&!h.popup),e.toggleCss("ag-cell-popup-editing",!!h&&!!h.popup),e.toggleCss("ag-cell-not-inline-editing",!h||!!h.popup)}));const re=()=>{const{compDetails:t,value:s}=d;if(!t)return s?.toString?.()??s;if(t.componentFromFramework){const s=t.componentClass;return i.createElement(i.Suspense,{fallback:i.createElement(we,{cellCtrl:e,parent:N})},ne?i.createElement(s,{...t.params,key:m}):i.createElement(s,{...t.params,key:m,ref:V}))}},ae=()=>{const t=()=>null==d?null:Y?i.createElement("span",{role:"presentation",id:`cell-${l}`,className:K,ref:U},re()):re(),s=t=>((e,t,s,o,n)=>{const r=e.compDetails,a=r.componentClass,l=r.componentFromFramework&&!e.popup,c=r.componentFromFramework&&e.popup,d=!r.componentFromFramework&&e.popup;return l?me(e,a,t):c?i.createElement(fe,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:me(e,a,t)}):d&&n?i.createElement(fe,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:n}):null})(t,q,N.current,e,D);return null!=h?h.popup?i.createElement(i.Fragment,null,t(),s(h)):s(h):t()},le=()=>i.createElement("div",{ref:ie,style:w,role:M,"col-id":a},Y?i.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:ee},ae()):ae());return e.isCellSpanning()?i.createElement("div",{ref:oe,className:"ag-spanned-cell-wrapper",role:"presentation"},le()):le()})),ye=(0,i.memo)((({rowCtrl:e,containerType:t})=>{const{context:s,gos:n,editSvc:r}=(0,i.useContext)(y),a="default"===(0,i.useContext)(b),l=(0,i.useRef)(),c=(0,i.useRef)(e.getDomOrder()),d=e.isFullWidth(),u=e.getFullWidthAnchorRole(),h=e.rowNode.displayed,[p,g]=(0,i.useState)((()=>h?e.rowNode.getRowIndexString():null)),[m,v]=(0,i.useState)((()=>e.rowId)),[w,C]=(0,i.useState)((()=>e.businessKey)),[x,R]=(0,i.useState)((()=>e.rowStyles)),[P,I]=(0,i.useState)((()=>e.getInitialCellCtrls(t))),k=(0,i.useRef)(P),[F,A]=(0,i.useState)(),[M,N]=(0,i.useState)(),L=(0,i.useRef)(),[V,_]=(0,i.useState)((()=>h?e.getInitialRowTop():void 0)),[O,B]=(0,i.useState)((()=>h?e.getInitialTransform():void 0)),H=(0,i.useRef)(null),G=(0,i.useRef)(null),z=(0,i.useRef)(null),W=(0,i.useRef)(null),j=(0,i.useRef)(null),U=(0,i.useRef)(),$=(0,i.useRef)(),Y=(0,i.useRef)(),K=(0,i.useRef)(),q=(0,i.useRef)(),Z=(0,i.useRef)(),Q=(0,i.useRef)(),J=(0,i.useRef)(),[,X]=(0,i.useState)((()=>e.embeddedSectionHasContent)),[,ee]=(0,i.useState)(0),te=(0,i.useRef)(!1),[se,ie]=(0,i.useState)(0);(0,i.useEffect)((()=>{if(te.current||!F||se>10)return;const t=G.current?.firstChild;t?(e.setupDetailRowAutoHeight(t),te.current=!0):ie((e=>e+1))}),[F,se]);const oe=(0,i.useRef)();oe.current||(oe.current=new f((()=>H.current)));const ne=(0,i.useRef)((()=>{})),re=(ae=(0,i.useCallback)((e=>(ne.current=e,()=>{ne.current=()=>{}})),[]),le=()=>k.current,ce=[],i.useSyncExternalStore?i.useSyncExternalStore(ae,le):ce);var ae,le,ce;const de=a?re:P,ue=(0,i.useCallback)((i=>{if(H.current=i,l.current=i?s.createBean(new o.dQD):s.destroyBean(l.current),!i)return void e.unsetComp(t);if(!e.isAlive()||s.isDestroyed())return;const r={setTop:_,setTransform:B,toggleCss:(e,t)=>oe.current.toggleCss(e,t),setDomOrder:e=>c.current=e,setRowIndex:g,setRowId:v,setRowBusinessKey:C,setUserStyles:R,setCellCtrls:(e,t)=>{const s=k.current,i=T(s,e,c.current);i!==s&&(k.current=i,a?ne.current():D(t,(()=>I(i))))},getPinnedLeftRowElement:()=>z.current??void 0,getScrollingRowElement:()=>W.current??void 0,getPinnedRightRowElement:()=>j.current??void 0,refreshPinnedSections:()=>ee((e=>e+1)),showFullWidth:e=>{L.current=void 0,N(void 0),X({left:!0,center:!0,right:!0}),q.current=e.params,A(e)},showEmbeddedFullWidth:e=>{A(void 0),X({left:!0,center:!0,right:!0}),Z.current=e.left.params,Q.current=e.center.params,J.current=e.right.params,L.current=e,N(e)},getFullWidthCellRenderers:()=>e.isEmbeddedFullWidth?[$.current,Y.current,K.current].filter((e=>null!=e)):U.current?[U.current]:[],getFullWidthCellRendererParams:()=>q.current??Q.current,getFullWidthCellRendererParamsForPinned:e=>"left"===e?Z.current:"right"===e?J.current:Q.current,refreshFullWidth:e=>{const t=e();return q.current=t,Ee.current?(A((e=>({...e,params:t}))),!0):!(!U.current||!U.current.refresh)&&U.current.refresh(t)},refreshEmbeddedFullWidth:t=>{const s=t("left"),i=t(null),o=t("right");Z.current=s,Q.current=i,J.current=o;const r=$.current,a=Y.current,l=K.current,c=L.current;let d;const u=(e,t,s,i)=>{const o=c?.[e];return o?.componentFromFramework&&E(o.componentClass)?!(!n.get("reactiveCustomComponents")||!c||(d??(d={...c}),d[e]={...o,params:t},0)):s?.refresh?.(t)??!i},h=u("left",s,r,e.embeddedSectionHasContent.left),p=u("center",i,a,!0),g=u("right",o,l,e.embeddedSectionHasContent.right);return d&&(L.current=d,N(d)),h&&p&&g}};e.setComp(r,i,t,l.current)}),[]),he=d&&e.shouldCreateCellSections();(0,i.useLayoutEffect)((()=>S(F,s,G.current??H.current,U)),[F]),(0,i.useLayoutEffect)((()=>{if(z.current)return S(M?.left,s,z.current,$)}),[M?.left]),(0,i.useLayoutEffect)((()=>{if(W.current)return S(M?.center,s,W.current,Y)}),[M?.center]),(0,i.useLayoutEffect)((()=>{if(j.current)return S(M?.right,s,j.current,K)}),[M?.right]),(0,i.useLayoutEffect)((()=>{if(!he)return;const t=()=>{const t={left:!!z.current?.firstElementChild,center:!!W.current?.firstElementChild,right:!!j.current?.firstElementChild};e.embeddedSectionHasContent=t,X((e=>e.left===t.left&&e.center===t.center&&e.right===t.right?e:t))};t();const s=new MutationObserver(t);return z.current&&s.observe(z.current,{childList:!0}),W.current&&s.observe(W.current,{childList:!0}),j.current&&s.observe(j.current,{childList:!0}),()=>s.disconnect()}),[he,M]);const pe=(0,i.useMemo)((()=>{const e={top:V,transform:O};return Object.assign(e,x),e}),[V,O,x]),ge=d&&F?.componentFromFramework,fe=!d&&null!=de,{leftCellCtrls:me,centerCellCtrls:ve,rightCellCtrls:we}=(0,i.useMemo)((()=>{const t=[],s=[],i=[];for(const o of de??[]){const n=e.getCellLane(o);"left"===n?t.push(o):"right"===n?i.push(o):s.push(o)}return{leftCellCtrls:t,centerCellCtrls:s,rightCellCtrls:i}}),[de,e]),{leftWidth:ye,centerWidth:be,rightWidth:Se,renderLeft:xe,renderRight:Re}=e.getMappedPinnedCellGroupWidths(),Pe=(0,i.useMemo)((()=>!(!F?.componentFromFramework||!E(F.componentClass))),[F]),Ee=(0,i.useRef)(!1);(0,i.useEffect)((()=>{Ee.current=Pe&&!!F&&!!n.get("reactiveCustomComponents")}),[Pe,F]);const Ie=t=>t.map((t=>i.createElement(Ce,{cellCtrl:t,editingCell:r?.isEditing(t,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:t.instanceId}))),ke=e=>{const t=M?.[e];if(!t?.componentFromFramework)return null;const s=t.componentClass,o="left"===e?$:"right"===e?K:Y;return E(t.componentClass)?i.createElement(s,{...t.params}):i.createElement(s,{...t.params,ref:o})},Fe=(e,t,s,o,n=!1,r=!0)=>r?n?i.createElement("div",{className:e,role:"presentation",style:{width:`${s}px`}},i.createElement("div",{className:"ag-grid-container-wrapper",role:"presentation",ref:t},o)):i.createElement("div",{className:e,role:"presentation",ref:t,style:{width:`${s}px`}},o):null;return i.createElement("div",{ref:ue,role:"row",style:pe,"row-index":p,"row-id":m,"row-business-key":w},fe||he?i.createElement(i.Fragment,null,Fe("ag-grid-pinned-left-cells",z,ye,fe?Ie(me):ke("left"),!0,xe),Fe("ag-grid-scrolling-cells",W,be,fe?Ie(ve):ke("center")),Fe("ag-grid-pinned-right-cells",j,Se,fe?Ie(we):ke("right"),!0,Re)):ge?i.createElement("div",{className:"ag-full-width-anchor",role:u,ref:G},(()=>{const e=F.componentClass;return Pe?i.createElement(e,{...F.params}):i.createElement(e,{...F.params,ref:U})})()):d?i.createElement("div",{className:"ag-full-width-anchor",role:u,ref:G}):null)})),be=(0,i.memo)((({name:e,viewportElement:t,extraClassName:s})=>{const{context:n,gos:r}=(0,i.useContext)(y),a=(0,i.useMemo)((()=>(0,o.BEv)(e)),[e]),l=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)([]),u=(0,i.useRef)([]),[h,p]=(0,i.useState)(!0),[g,f]=(0,i.useState)((()=>[])),m=!!r.get("enableCellSpan")&&!!a.getSpannedRowCtrls,v=(0,i.useRef)([]),w=(0,i.useRef)([]),[C,b]=(0,i.useState)((()=>[])),S=(0,i.useRef)(!1),x=(0,i.useRef)(),P=(0,i.useMemo)((()=>R((0,o.Hky)(e),h?"ag-hidden":null,s)),[s,e,h]),E=(0,i.useMemo)((()=>R("ag-spanning-container",(0,o.bUh)(e))),[e]);pe(" AG Row Container "+e+" ",l);const I=(0,i.useCallback)((()=>{if(null==l.current&&null==c.current&&(x.current=n.destroyBean(x.current)),n.isDestroyed())return;const s=l.current,i=t??l.current;if(!s||!i||m&&!c.current)return;if(x.current)return;const r=c.current??void 0,a=e=>{const t=T(u.current,d.current,S.current);t!==u.current&&(u.current=t,D(e,(()=>f(t))))},h={setRowCtrls:({rowCtrls:e,useFlushSync:t})=>{const s=!!t&&d.current.length>0&&e.length>0;d.current=e,a(s)},setSpannedRowCtrls:(e,t)=>{const s=!!t&&v.current.length>0&&e.length>0;v.current=e,(e=>{const t=T(w.current,v.current,S.current);t!==w.current&&(w.current=t,D(e,(()=>b(t))))})(s)},setDomOrder:e=>{S.current!==e&&(S.current=e,a(!1))},setContainerWidth:e=>{s&&(s.style.width=e),r&&(r.style.width=e)},setOffsetTop:e=>{s.style.transform=`translateY(${e})`,r&&(r.style.transform=`translateY(${e})`)},setHidden:e=>p(e)};x.current=n.createBean(new o.Rlq(e)),x.current.setComp(h,s,r,i)}),[n,m,e,t]);(0,i.useEffect)((()=>()=>{x.current=n.destroyBean(x.current)}),[n,e]);const k=(0,i.useCallback)((e=>{l.current=e,I()}),[I]),F=(0,i.useCallback)((e=>{c.current=e,I()}),[I]),A=g.map((e=>i.createElement(ye,{rowCtrl:e,containerType:a.type,key:e.instanceId})));return i.createElement("div",{className:P,ref:k,role:"presentation"},A,m?i.createElement("div",{className:E,ref:F,role:"presentation"},C.map((e=>i.createElement(ye,{rowCtrl:e,containerType:a.type,key:e.instanceId})))):null)})),Se=(0,i.memo)((()=>{const{context:e,gos:t,overlays:s,rangeSvc:n}=(0,i.useContext)(y),[r,a]=(0,i.useState)(""),[l,c]=(0,i.useState)({top:{height:0,invisible:!0},bottom:{height:0,invisible:!0}}),[d,u]=(0,i.useState)("0px"),[p,g]=(0,i.useState)("100%"),[m,v]=(0,i.useState)(null),[w,C]=(0,i.useState)(null),[b,S]=(0,i.useState)(!1),[x,P]=(0,i.useState)("ag-layout-normal"),E=(0,i.useRef)();E.current||(E.current=new f((()=>I.current)));const I=(0,i.useRef)(null),[k,F]=(0,i.useState)(null),D=(0,i.useRef)(null),[T,A]=(0,i.useState)(null),M=(0,i.useRef)(null),[N,L]=(0,i.useState)(null),V=(0,i.useRef)(null),_=(0,i.useRef)(null),O=(0,i.useRef)(null),B=(0,i.useRef)(null);pe(" AG Grid Body ",I),pe(" AG Pinned Top ",D),pe(" AG Middle ",M),pe(" AG Pinned Bottom ",O);const H=(0,i.useCallback)((e=>{I.current=e,F(e)}),[]),G=(0,i.useCallback)(((e,t)=>{c((s=>{const i=s[e];return i.height===t.height&&i.invisible===t.invisible?s:{...s,[e]:t}}))}),[]);(0,i.useEffect)((()=>{if(!k||e.isDestroyed()||!M.current||!_.current||!D.current||!O.current||!B.current)return;const i=[],r=[],l=(e,t)=>{e.appendChild(t),r.push((()=>t.remove()))},c=(t,s,o)=>{l(t,document.createComment(o)),l(t,(t=>{const s=e.createBean(new t);return i.push(s),s})(s).getGui())};c(k,o.ifX," AG Fake Horizontal Scroll "),c(k,o.AR_," AG Fake Vertical Scroll ");const d=s?.getOverlayWrapperCompClass();d&&c(k,d," AG Overlay Wrapper ");const p={setColumnCount:e=>{M.current&&h(M.current,"colcount",e)},setRowCount:e=>{M.current&&h(M.current,"rowcount",e)},setPinnedSection:G,setColumnMovingCss:(e,t)=>E.current.toggleCss(e,t),updateLayoutClasses:P,setCellSelectableCss:(e,t)=>v(t?e:null),setRowAnimationCssOnScrollableArea:e=>a(e?"ag-row-animation":"ag-row-no-animation"),setPreventRowAnimationCssOnContainers:e=>C(e?"ag-prevent-animation":null),setGridScrollableAreaWidth:e=>{V.current&&(V.current.style.width=e)},setPinnedColumnsOverflowing:S,setStickyBottomHeight:u,setStickyBottomWidth:g,setGridRole:e=>{M.current&&function(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}(M.current,e)}},f=e.createBean(new o.m20);return i.push(f),f.setComp(p,k,M.current,_.current,D.current,B.current,O.current),M.current&&(n&&(0,o.Jch)(t)||(0,o.F_Q)(t))&&h(M.current,"multiselectable",!0),()=>{e.destroyBeans(i);for(const e of r)e()}}),[e,t,s,n,k]);const z=(0,i.useMemo)((()=>R("ag-root","ag-unselectable",x)),[x]),W=(0,i.useMemo)((()=>R("ag-grid-viewport",x,b?"ag-pinned-columns-overflow":null)),[x,b]),j=(0,i.useMemo)((()=>R("ag-grid-scrolling-rows",x,m)),[x,m]),U=l.top,$=l.bottom,Y=(0,i.useMemo)((()=>R("ag-grid-pinned-top-rows",m)),[m,U.invisible]),K=Number.parseFloat(d)||0,q=$.height<=0&&K<=0,Z=(0,i.useMemo)((()=>R("ag-grid-scrollable-area",U.invisible?null:"ag-has-top-pinned-rows",$.invisible?null:"ag-has-bottom-pinned-rows")),[$.invisible,U.invisible]),Q=(0,i.useMemo)((()=>R("ag-grid-pinned-bottom-rows",q?"ag-hidden":null,m)),[$.invisible,q,m]),J=(0,i.useMemo)((()=>R(r,w)),[w,r]),X=(0,i.useMemo)((()=>({"--ag-internal-top-rows-height":`${U.height}px`,"--ag-internal-bottom-rows-height":`${$.height}px`})),[U.height,$.height]),ee=(0,i.useMemo)((()=>{const e=`calc(var(--ag-internal-header-rows-height, 0px) + ${U.height}px)`;return{minHeight:e,height:e}}),[U.height]),te=(0,i.useMemo)((()=>({height:`calc(${$.height}px + ${d})`,minHeight:`calc(${$.height}px + ${d})`,width:p})),[$.height,d,p]),se=(0,i.useCallback)((e=>{D.current=e,A(e)}),[]),ie=(0,i.useCallback)((e=>{M.current=e,L(e)}),[]);return i.createElement("div",{ref:H,className:z,role:"presentation"},i.createElement("div",{ref:ie,className:W,role:"presentation",style:X},i.createElement("div",{ref:V,className:Z,role:"rowgroup"},i.createElement("div",{ref:se,className:Y,role:"presentation",style:ee},T&&N&&i.createElement(he,{eGridViewport:N}),i.createElement("div",{ref:B,className:"ag-extra-rows-container",role:"presentation"}),i.createElement(be,{name:"pinnedTop",viewportElement:N,extraClassName:J}),i.createElement(be,{name:"stickyTop",viewportElement:N})),i.createElement("div",{className:j,ref:_,role:"presentation"},i.createElement(be,{name:"scrolling",viewportElement:N,extraClassName:J})),i.createElement("div",{className:Q,ref:O,role:"presentation",style:te},i.createElement(be,{name:"stickyBottom",viewportElement:N}),i.createElement(be,{name:"pinnedBottom",viewportElement:N,extraClassName:J})))))})),xe=(0,i.forwardRef)(((e,t)=>{const{children:s,eFocusableElement:n,onTabKeyDown:r,gridCtrl:a,forceFocusOutWhenTabGuardsAreEmpty:l,isEmpty:c}=e,{context:d}=(0,i.useContext)(y),u=(0,i.useRef)(null),h=(0,i.useRef)(null),p=(0,i.useRef)(),g=e=>{const t=null==e?void 0:parseInt(e,10).toString();for(const e of[u,h])void 0===t?e.current?.removeAttribute("tabindex"):e.current?.setAttribute("tabindex",t)};(0,i.useImperativeHandle)(t,(()=>({forceFocusOutOfContainer(e){p.current?.forceFocusOutOfContainer(e)},focusNextElementOutsideContainer:(e,t)=>p.current?.focusNextElementOutsideContainer(e,t)??!1})));const f=(0,i.useCallback)((()=>{const e=u.current,t=h.current;if(!e&&!t||d.isDestroyed())p.current=d.destroyBean(p.current);else if(e&&t){const s={setTabIndex:g};p.current=d.createBean(new o.Udn({comp:s,eTopGuard:e,eBottomGuard:t,eFocusableElement:n,onTabKeyDown:r,forceFocusOutWhenTabGuardsAreEmpty:l,focusInnerElement:e=>a.focusInnerElement(e),isEmpty:c}))}}),[]),m=(0,i.useCallback)((e=>{u.current=e,f()}),[f]),v=(0,i.useCallback)((e=>{h.current=e,f()}),[f]),w=e=>{const t="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return i.createElement("div",{className:`ag-tab-guard ${t}`,role:"presentation",ref:"top"===e?m:v})};return i.createElement(i.Fragment,null,w("top"),s,w("bottom"))})),Re=(0,i.memo)(xe),Pe=(0,i.memo)((({context:e})=>{const[t,s]=(0,i.useState)(""),[n,r]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[c,d]=(0,i.useState)(!1),[u,h]=(0,i.useState)(),p=(0,i.useRef)(),g=(0,i.useRef)(null),f=(0,i.useRef)(null),m=(0,i.useRef)(),[v,w]=(0,i.useState)(null),C=(0,i.useRef)((()=>{})),b=(0,i.useRef)(),S=(0,i.useRef)([]),x=(0,i.useCallback)((()=>{}),[]);pe(" AG Grid ",g);const P=(0,i.useCallback)((t=>{if(g.current=t,p.current=t?e.createBean(new o.s1r):e.destroyBean(p.current),!t||e.isDestroyed())return;const i=p.current;C.current=i.focusInnerElement.bind(i);const n={destroyGridUi:()=>{},forceFocusOutOfContainer:e=>{e||!b.current?.isDisplayed()?m.current?.forceFocusOutOfContainer(e):b.current.forceFocusOutOfContainer(e)},focusNextElementOutsideContainer:(e,t)=>{const s=g.current;return!!s&&(m.current?.focusNextElementOutsideContainer(e,[s,...t])??!1)},updateLayoutClasses:s,getFocusableContainers:()=>{const e=[],t=[],s=g.current?.querySelector(".ag-root");for(const s of S.current){if(!s.isDisplayed())continue;const i=s.getFocusableContainerName();"toolbar"!==i&&"rowGroupToolbar"!==i&&"pivotToolbar"!==i?t.push(s):e.push(s)}const i=[...e];return s&&i.push({getGui:()=>s,getFocusableContainerName:()=>"gridBody"}),i.push(...t),i},setCursor:r,setUserSelect:l};i.setComp(n,t,f.current),d(!0)}),[]);(0,i.useEffect)((()=>{const t=p.current,s=g.current;if(!u||!t||!v||!s||e.isDestroyed())return;const i=[];S.current=[],b.current=void 0;const{watermarkSelector:o,paginationSelector:n,sideBarSelector:r,statusBarSelector:a,toolbarSelector:l,gridHeaderDropZonesSelector:c}=t.getOptionalSelectors(),d=[],h=(t,o="beforeend")=>{const n=e.createBean(new t),r=n.getGui();return s.insertAdjacentElement(o,r),d.push(r),i.push(n),n};if(l){const e=h(l.component,"afterbegin");S.current.push(e)}if(c){const t=e.createBean(new c.component),o=t.getGui(),n=s.querySelector(".ag-toolbar");n?n.after(o):s.prepend(o),d.push(o),i.push(t),S.current.push(...t.getFocusableContainers?.()??[])}if(r){const t=e.createBean(new r.component),s=t.getGui(),o=v.querySelector(".ag-tab-guard-bottom");o&&(o.insertAdjacentElement("beforebegin",s),d.push(s)),i.push(t),S.current.push(t)}if(a){const e=h(a.component);S.current.push(e)}if(n){const e=h(n.component);b.current=e,S.current.push(e)}return o&&h(o.component),()=>{e.destroyBeans(i),S.current=[],b.current=void 0;for(const e of d)e.remove()}}),[u,v,e]);const E=(0,i.useMemo)((()=>R("ag-root-wrapper",t)),[t]),I=(0,i.useMemo)((()=>R("ag-root-wrapper-body","ag-focus-managed",t)),[t]),k=(0,i.useMemo)((()=>({userSelect:null!=a?a:"",WebkitUserSelect:null!=a?a:"",cursor:null!=n?n:""})),[a,n]),F=(0,i.useCallback)((e=>{m.current=e,h(null!==e)}),[]),D=(0,i.useCallback)((()=>!p.current?.isFocusable()),[]);return i.createElement("div",{ref:P,className:E,style:k,role:"presentation"},i.createElement("div",{className:"ag-aria-description-container",ref:f}),i.createElement("div",{className:I,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&i.createElement(y.Provider,{value:e.getBeans()},i.createElement(Re,{ref:F,eFocusableElement:v,onTabKeyDown:x,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:D},i.createElement(Se,null)))))})),Ee=class extends a{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout((()=>{e.processResizeOperations()}),0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getAllCtrls().every((e=>e.areCellsRendered()))??!0}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every((e=>e.isRowRendered()&&e.getAllCellCtrls().every((e=>!!e.eGui))))}},Ie={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},ke={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,hasAncestorStyledRoot:void 0,componentWrappingElement:void 0,...Ie},Fe=new Set(Object.keys(ke)),De=new Set(Object.keys(Ie)),Te=e=>{const t=(0,i.useContext)(oe),s=(0,i.useContext)(ne),n=null!==t,r=(0,i.useRef)(),a=(0,i.useRef)(null),l=(0,i.useRef)(null),c=(0,i.useRef)([]),d=(0,i.useRef)([]),u=(0,i.useRef)(e),h=(0,i.useRef)(),p=(0,i.useRef)(),g=(0,i.useRef)(!1),[f,m]=(0,i.useState)(void 0),[,v]=(0,i.useState)(0),w=(0,i.useCallback)((i=>{if(!i){g.current=!1;for(const e of c.current)e();return void(c.current.length=0)}const u=[...e.modules??[],...t??[]];s&&(0,o.zlI)(u)?.setLicenseKey(s),l.current||(l.current=new ie((()=>v((e=>e+1))),e.componentWrappingElement,e.maxComponentCreationTimeMs),c.current.push((()=>{l.current?.destroy(),l.current=null})));const f=(0,o.zsR)(e.gridOptions,e,Object.keys(e).filter((e=>!Fe.has(e)))),w=new Ne((()=>{if(g.current){const e=()=>h.current?.shouldQueueUpdates()?void 0:d.current.shift();let t=e();for(;t;)t(),t=e()}}),n);h.current=w;const C=new Ee,y={providedBeanInstances:{frameworkCompWrapper:new Ae(l.current,f),renderStatus:C},modules:u,frameworkOverrides:w,hasAncestorStyledRoot:e.hasAncestorStyledRoot},b=new o.Ug$;f.gridId??(f.gridId=p.current),r.current=b.create(i,a.current,f,(t=>{m(t),t.createBean(C),c.current.push((()=>{t.destroy()})),t.getBean("ctrlsSvc").whenReady({addDestroyFunc:e=>{c.current.push(e)}},(()=>{if(t.isDestroyed())return;const s=r.current;s&&e.passGridApi?.(s)}))}),(e=>{e.getBean("ctrlsSvc").whenReady({addDestroyFunc:e=>{c.current.push(e)}},(()=>{for(const e of d.current)e();d.current.length=0,g.current=!0}))}),y),c.current.push((()=>{r.current=void 0})),r.current&&(p.current=r.current.getGridId())}),[]),C=(0,i.useMemo)((()=>({width:"100%",height:"100%",...e.containerStyle||{}})),[e.containerStyle]),y=(0,i.useCallback)((e=>{g.current&&!h.current?.shouldQueueUpdates()?e():d.current.push(e)}),[]);(0,i.useEffect)((()=>{const t=function(e,t,s){const i={};for(const n of Object.keys(s)){if(Fe.has(n)){De.has(n)&&(e?(0,o.DHs)(e,274,{prop:n}):(0,o.NbO)(274,{prop:n}));continue}const r=s[n];t[n]!==r&&(i[n]=r)}return i}(p.current,u.current,e);u.current=e,y((()=>{r.current&&(0,o.Y6t)(t,r.current)}))}),[e]);const S=i.useSyncExternalStore&&"legacy"!==(0,o.Fzc)(e,"renderingMode")?"default":"legacy";return i.createElement("div",{className:e.className,style:C,ref:w},i.createElement("div",null,i.createElement("div",null,i.createElement("div",{ref:a},i.createElement(b.Provider,{value:S},f&&!f.isDestroyed()?i.createElement(Pe,{key:f.instanceId,context:f}):null,l.current?.getPortals()??null)))))},Ae=class extends l{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if((0,o.Fzc)(s,"reactiveCustomComponents")){const i=(e=>{switch(e){case"filter":return(0,o.Fzc)(s,"enableFilterHandlers")?Y:$;case"floatingFilterComponent":return(0,o.Fzc)(s,"enableFilterHandlers")?Q:Z;case"dateComponent":return j;case"dragAndDropImageComponent":return U;case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":return W;case"statusPanel":return ee;case"toolPanel":return te;case"menuItem":return X;case"cellRenderer":return G;case"columnLabelRenderer":return z;case"innerHeaderComponent":return J}})(t.name);if(i)return new i(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"activeOverlay":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":case"columnLabelRenderer":se(this.gridId)}const i=!t.supportsJsFunction&&"toolPanel"!==t.name;return new O(e,this.parent,t,i)}},Me=(0,i.forwardRef)(((e,t)=>{const s=(0,i.useContext)(y),{registry:n,context:r,gos:a,rowModel:l}=s,[c,d]=(0,i.useState)((()=>new P)),[h,p]=(0,i.useState)((()=>new P)),[g,f]=(0,i.useState)(),[m,v]=(0,i.useState)(),w=(0,i.useRef)(),C=(0,i.useRef)(null),b=(0,i.useRef)(),S=(0,i.useMemo)((()=>(0,o.Dii)(e.api.getGridId(),g?.rowModelType??"clientSide")),[e]),x=(0,i.useMemo)((()=>c.toString()+" ag-details-row"),[c]),R=(0,i.useMemo)((()=>h.toString()+" ag-details-grid"),[h]);t&&(0,i.useImperativeHandle)(t,(()=>({refresh:()=>w.current?.refresh()??!1}))),e.template&&s.log.warn(230);const E=(0,i.useCallback)((t=>{if(C.current=t,!t||r.isDestroyed())return w.current=r.destroyBean(w.current),void b.current?.();const i={toggleCss:(e,t)=>d((s=>s.setClass(e,t))),toggleDetailGridCss:(e,t)=>p((s=>s.setClass(e,t))),setDetailGrid:e=>f(e),setRowData:e=>v(e),getGui:()=>C.current},c=n.createDynamicBean("detailCellRendererCtrl",!0);if(c&&(r.createBean(c),c.init(i,e),w.current=c,a.get("detailRowAutoHeight"))){const i=()=>{if(null==C.current)return;const t=C.current.clientHeight;null!=t&&t>0&&setTimeout((()=>{e.node.setRowHeight(t),((0,o.dbY)(a,l)||(0,o.TiQ)(a,l))&&l.onRowHeightChanged()}),0)};b.current=function(e,t,s){const i=function(e){const t=function(e){const{gos:t,eRootDiv:s}=e;let i=null;const o=t.get("getDocument");return o&&u(o)?i=o():s&&(i=s.ownerDocument),i&&u(i)?i:document}(e);return t.defaultView||window}(e).ResizeObserver,o=i?new i(s):null;return o?.observe(t),()=>o?.disconnect()}(s,t,i),i()}}),[]),I=(0,i.useCallback)((e=>{w.current?.registerDetailWithMaster(e)}),[]);return i.createElement("div",{className:x,ref:E},g&&i.createElement(Te,{className:R,...g,modules:S,rowData:m,passGridApi:I,hasAncestorStyledRoot:!0}))})),Ne=class extends c{constructor(e,t){super("react"),this.processQueuedUpdates=e,this.usesAgGridProvider=t,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:M,agGroupRowRenderer:M,agDetailCellRenderer:Me},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(s=e,F||setTimeout((()=>F=!1),0),F=!0,s()):e();var s}}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return"19"===I}},Le=class extends i.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return i.createElement(Te,{...this.props,passGridApi:this.setGridApi})}}},28742:e=>{var t={};e.exports=function(e,s){var i=function(e){if(void 0===t[e]){var s=document.querySelector(e);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}t[e]=s}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(s)}},30149:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(68446))},33997:(e,t,s)=>{s.d(t,{$C:()=>I,$b:()=>O,Ds:()=>Ae,G1:()=>M,GU:()=>Ee,ID:()=>ve,N8:()=>xe,R:()=>B,W:()=>R,WZ:()=>L,Z9:()=>m,ZZ:()=>Se,_Z:()=>Re,ae:()=>Ne,cS:()=>P,cV:()=>Me,cb:()=>d,e1:()=>h,hK:()=>E,hd:()=>De,jN:()=>ye,k5:()=>be,m2:()=>c,mD:()=>Ce,nV:()=>x,n_:()=>v,o8:()=>Le,qs:()=>H,qx:()=>N,sl:()=>Te,u1:()=>k,wA:()=>Fe,x3:()=>G,z6:()=>ke,zf:()=>F});var i=s(86637),o=s(9364),n=s(58750),r=s(33868),a=s(24730),l=s(15088).process;function c(...e){return e.reduce(((e,t)=>({...e,...null!=t?t:{}})),{})}async function d(e,t){if(null==e)return Promise.resolve();const s=null==t?void 0:t.abortSignal;return new Promise(((t,i)=>{if(null==s?void 0:s.aborted)return void i(u());const o=setTimeout((()=>{n(),t()}),e),n=()=>{clearTimeout(o),null==s||s.removeEventListener("abort",r)},r=()=>{n(),i(u())};null==s||s.addEventListener("abort",r)}))}function u(){return new DOMException("Delay was aborted","AbortError")}var h=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise||(this._promise=new Promise(((e,t)=>{"resolved"===this.status.type?e(this.status.value):"rejected"===this.status.type&&t(this.status.error),this._resolve=e,this._reject=t}))),this._promise}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&(null==(t=this._resolve)||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&(null==(t=this._reject)||t.call(this,e))}isResolved(){return"resolved"===this.status.type}isRejected(){return"rejected"===this.status.type}isPending(){return"pending"===this.status.type}};function p(e){return Object.fromEntries([...e.headers])}var{btoa:g,atob:f}=globalThis;function m(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),s=f(t);return Uint8Array.from(s,(e=>e.codePointAt(0)))}function v(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCodePoint(e[s]);return g(t)}var w,C,y="AI_DownloadError",b=`vercel.ai.error.${y}`,S=Symbol.for(b),x=class extends(C=i.bD,w=S,C){constructor({url:e,statusCode:t,statusText:s,cause:i,message:o=(null==i?`Failed to download ${e}: ${t} ${s}`:`Failed to download ${e}: ${i}`)}){super({name:y,message:o,cause:i}),this[w]=!0,this.url=e,this.statusCode=t,this.statusText=s}static isInstance(e){return i.bD.hasMarker(e,b)}},R=2147483648;async function P({response:e,url:t,maxBytes:s=R}){const i=e.headers.get("content-length");if(null!=i){const e=parseInt(i,10);if(!isNaN(e)&&e>s)throw new x({url:t,message:`Download of ${t} exceeded maximum size of ${s} bytes (Content-Length: ${e}).`})}const o=e.body;if(null==o)return new Uint8Array(0);const n=o.getReader(),r=[];let a=0;try{for(;;){const{done:e,value:i}=await n.read();if(e)break;if(a+=i.length,a>s)throw new x({url:t,message:`Download of ${t} exceeded maximum size of ${s} bytes.`});r.push(i)}}finally{try{await n.cancel()}finally{n.releaseLock()}}const l=new Uint8Array(a);let c=0;for(const e of r)l.set(e,c),c+=e.length;return l}var E=({prefix:e,size:t=16,alphabet:s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{const n=()=>{const e=s.length,i=new Array(t);for(let o=0;o<t;o++)i[o]=s[Math.random()*e|0];return i.join("")};if(null==e)return n;if(s.includes(o))throw new i.Di({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${s}".`});return()=>`${e}${o}${n()}`},I=E();function k(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function F(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var D=["fetch failed","failed to fetch"],T=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function A({error:e,url:t,requestBodyValues:s}){if(F(e))return e;if(e instanceof TypeError&&D.includes(e.message.toLowerCase())){const o=e.cause;if(null!=o)return new i.hL({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:s,isRetryable:!0})}return function(e){if(!(e instanceof Error))return!1;const t=e.code;return!("string"!=typeof t||!T.includes(t))}(e)?new i.hL({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:s,isRetryable:!0}):e}function M(e=globalThis){var t,s,i;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(i=null==(s=e.process)?void 0:s.versions)?void 0:i.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function N(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,s)=>{t[s.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[s,i]of e)null!=i&&(t[s.toLowerCase()]=i)}return t}function L(e,...t){const s=new Headers(N(e)),i=s.get("user-agent")||"";return s.set("user-agent",[i,...t].filter(Boolean).join(" ")),Object.fromEntries(s.entries())}var V="4.0.15",_=()=>globalThis.fetch,O=async({url:e,headers:t={},successfulResponseHandler:s,failedResponseHandler:o,abortSignal:n,fetch:r=_()})=>{try{const a=await r(e,{method:"GET",headers:L(t,`ai-sdk/provider-utils/${V}`,M()),signal:n}),l=p(a);if(!a.ok){let t;try{t=await o({response:a,url:e,requestBodyValues:{}})}catch(t){if(F(t)||i.hL.isInstance(t))throw t;throw new i.hL({message:"Failed to process error response",cause:t,statusCode:a.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw t.value}try{return await s({response:a,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(F(t)||i.hL.isInstance(t)))throw t;throw new i.hL({message:"Failed to process successful response",cause:t,statusCode:a.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(t){throw A({error:t,url:e,requestBodyValues:{}})}};function B(e){return null!=e}function H({mediaType:e,url:t,supportedUrls:s}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(s).map((([e,t])=>{const s=e.toLowerCase();return"*"===s||"*/*"===s?{mediaTypePrefix:"",regexes:t}:{mediaTypePrefix:s.replace(/\*/,""),regexes:t}})).filter((({mediaTypePrefix:t})=>e.startsWith(t))).flatMap((({regexes:e})=>e)).some((e=>e.test(t)))}function G({settingValue:e,environmentVariableName:t}){return"string"==typeof e||null==e&&void 0!==l&&null!=(e=l.env[t])&&"string"==typeof e?e:void 0}var z=/"__proto__"\s*:/,W=/"constructor"\s*:/;function j(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===z.test(e)&&!1===W.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const s of e){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in s){const i=s[e];i&&"object"==typeof i&&t.push(i)}}}return e}(t)}function U(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return j(e)}try{return j(e)}finally{Error.stackTraceLimit=t}}function $(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=Y(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(Y):Y(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(Y)),null!=e.allOf&&(e.allOf=e.allOf.map(Y)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(Y));const{definitions:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=Y(t[e]);return e}function Y(e){return"boolean"==typeof e?e:$(e)}var K=Symbol("Let zodToJsonSchema decide on which parser to use"),q={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function Z(e,t){return he(e.type._def,t)}function Q(e,t,s){const i=null!=s?s:t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map(((s,i)=>Q(e,t,s)))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return J(e)}}var J=e=>{const t={type:"integer",format:"unix-time"};for(const s of e.checks)switch(s.kind){case"min":t.minimum=s.value;break;case"max":t.maximum=s.value}return t},X=void 0,ee={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===X&&(X=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),X),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function te(e,t){const s={type:"string"};if(e.checks)for(const i of e.checks)switch(i.kind){case"min":s.minLength="number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value;break;case"max":s.maxLength="number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value;break;case"email":switch(t.emailStrategy){case"format:email":oe(s,"email",i.message,t);break;case"format:idn-email":oe(s,"idn-email",i.message,t);break;case"pattern:zod":ne(s,ee.email,i.message,t)}break;case"url":oe(s,"uri",i.message,t);break;case"uuid":oe(s,"uuid",i.message,t);break;case"regex":ne(s,i.regex,i.message,t);break;case"cuid":ne(s,ee.cuid,i.message,t);break;case"cuid2":ne(s,ee.cuid2,i.message,t);break;case"startsWith":ne(s,RegExp(`^${se(i.value,t)}`),i.message,t);break;case"endsWith":ne(s,RegExp(`${se(i.value,t)}$`),i.message,t);break;case"datetime":oe(s,"date-time",i.message,t);break;case"date":oe(s,"date",i.message,t);break;case"time":oe(s,"time",i.message,t);break;case"duration":oe(s,"duration",i.message,t);break;case"length":s.minLength="number"==typeof s.minLength?Math.max(s.minLength,i.value):i.value,s.maxLength="number"==typeof s.maxLength?Math.min(s.maxLength,i.value):i.value;break;case"includes":ne(s,RegExp(se(i.value,t)),i.message,t);break;case"ip":"v6"!==i.version&&oe(s,"ipv4",i.message,t),"v4"!==i.version&&oe(s,"ipv6",i.message,t);break;case"base64url":ne(s,ee.base64url,i.message,t);break;case"jwt":ne(s,ee.jwt,i.message,t);break;case"cidr":"v6"!==i.version&&ne(s,ee.ipv4Cidr,i.message,t),"v4"!==i.version&&ne(s,ee.ipv6Cidr,i.message,t);break;case"emoji":ne(s,ee.emoji(),i.message,t);break;case"ulid":ne(s,ee.ulid,i.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":oe(s,"binary",i.message,t);break;case"contentEncoding:base64":s.contentEncoding="base64";break;case"pattern:zod":ne(s,ee.base64,i.message,t)}break;case"nanoid":ne(s,ee.nanoid,i.message,t)}return s}function se(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let s=0;s<e.length;s++)ie.has(e[s])||(t+="\\"),t+=e[s];return t}(e):e}var ie=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function oe(e,t,s,i){var o;e.format||(null==(o=e.anyOf)?void 0:o.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...s&&i.errorMessages&&{errorMessage:{format:s}}})):e.format=t}function ne(e,t,s,i){var o;e.pattern||(null==(o=e.allOf)?void 0:o.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:re(t,i),...s&&i.errorMessages&&{errorMessage:{pattern:s}}})):e.pattern=re(t,i)}function re(e,t){var s;if(!t.applyRegexFlags||!e.flags)return e.source;const i=e.flags.includes("i"),o=e.flags.includes("m"),n=e.flags.includes("s"),r=i?e.source.toLowerCase():e.source;let a="",l=!1,c=!1,d=!1;for(let e=0;e<r.length;e++)if(l)a+=r[e],l=!1;else{if(i)if(c){if(r[e].match(/[a-z]/)){d?(a+=r[e],a+=`${r[e-2]}-${r[e]}`.toUpperCase(),d=!1):"-"===r[e+1]&&(null==(s=r[e+2])?void 0:s.match(/[a-z]/))?(a+=r[e],d=!0):a+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){a+=`[${r[e]}${r[e].toUpperCase()}]`;continue}if(o){if("^"===r[e]){a+="(^|(?<=[\r\n]))";continue}if("$"===r[e]){a+="($|(?=[\r\n]))";continue}}n&&"."===r[e]?a+=c?`${r[e]}\r\n`:`[${r[e]}\r\n]`:(a+=r[e],"\\"===r[e]?l=!0:c&&"]"===r[e]?c=!1:c||"["!==r[e]||(c=!0))}try{new RegExp(a)}catch(s){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function ae(e,t){var s,i,o,n,a,l;const c={type:"object",additionalProperties:null!=(s=he(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?s:t.allowedAdditionalProperties};if((null==(i=e.keyType)?void 0:i._def.typeName)===r.kY.ZodString&&(null==(o=e.keyType._def.checks)?void 0:o.length)){const{type:s,...i}=te(e.keyType._def,t);return{...c,propertyNames:i}}if((null==(n=e.keyType)?void 0:n._def.typeName)===r.kY.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if((null==(a=e.keyType)?void 0:a._def.typeName)===r.kY.ZodBranded&&e.keyType._def.type._def.typeName===r.kY.ZodString&&(null==(l=e.keyType._def.type._def.checks)?void 0:l.length)){const{type:s,...i}=Z(e.keyType._def,t);return{...c,propertyNames:i}}return c}var le={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ce(e){try{return e.isOptional()}catch(e){return!0}}var de=(e,t,s)=>{switch(t){case r.kY.ZodString:return te(e,s);case r.kY.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"int":t.type="integer";break;case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value}return t}(e);case r.kY.ZodObject:return function(e,t){const s={type:"object",properties:{}},i=[],o=e.shape();for(const e in o){let n=o[e];if(void 0===n||void 0===n._def)continue;const r=ce(n),a=he(n._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==a&&(s.properties[e]=a,r||i.push(e))}i.length&&(s.required=i);const n=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return he(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==n&&(s.additionalProperties=n),s}(e,s);case r.kY.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value}return t}(e);case r.kY.ZodBoolean:return{type:"boolean"};case r.kY.ZodDate:return Q(e,s);case r.kY.ZodUndefined:return{not:{}};case r.kY.ZodNull:return{type:"null"};case r.kY.ZodArray:return function(e,t){var s,i,o;const n={type:"array"};return(null==(s=e.type)?void 0:s._def)&&(null==(o=null==(i=e.type)?void 0:i._def)?void 0:o.typeName)!==r.kY.ZodAny&&(n.items=he(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}(e,s);case r.kY.ZodUnion:case r.kY.ZodDiscriminatedUnion:return function(e,t){const s=e.options instanceof Map?Array.from(e.options.values()):e.options;if(s.every((e=>e._def.typeName in le&&(!e._def.checks||!e._def.checks.length)))){const e=s.reduce(((e,t)=>{const s=le[t._def.typeName];return s&&!e.includes(s)?[...e,s]:e}),[]);return{type:e.length>1?e:e[0]}}if(s.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=s.reduce(((e,t)=>{const s=typeof t._def.value;switch(s){case"string":case"number":case"boolean":return[...e,s];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===s.length){const t=e.filter(((e,t,s)=>s.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:s.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(s.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:s.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const s=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,s)=>he(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return s.length?{anyOf:s}:void 0})(e,t)}(e,s);case r.kY.ZodIntersection:return function(e,t){const s=[he(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),he(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),i=[];return s.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:s,...i}=e;t=i}i.push(t)}else i.push(...e.allOf);var t})),i.length?{allOf:i}:void 0}(e,s);case r.kY.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,s)=>he(e._def,{...t,currentPath:[...t.currentPath,"items",`${s}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:he(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,s)=>he(e._def,{...t,currentPath:[...t.currentPath,"items",`${s}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,s);case r.kY.ZodRecord:return ae(e,s);case r.kY.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case r.kY.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case r.kY.ZodNativeEnum:return function(e){const t=e.values,s=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),i=Array.from(new Set(s.map((e=>typeof e))));return{type:1===i.length?"string"===i[0]?"string":"number":["string","number"],enum:s}}(e);case r.kY.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[le[e.innerType._def.typeName],"null"]};const s=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return s&&{anyOf:[s,{type:"null"}]}}(e,s);case r.kY.ZodOptional:return((e,t)=>{var s;if(t.currentPath.toString()===(null==(s=t.propertyPath)?void 0:s.toString()))return he(e.innerType._def,t);const i=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:{}},i]}:{}})(e,s);case r.kY.ZodMap:return function(e,t){return"record"===t.mapStrategy?ae(e,t):{type:"array",maxItems:125,items:{type:"array",items:[he(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,s);case r.kY.ZodSet:return function(e,t){const s={type:"array",uniqueItems:!0,items:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(s.minItems=e.minSize.value),e.maxSize&&(s.maxItems=e.maxSize.value),s}(e,s);case r.kY.ZodLazy:return()=>e.getter()._def;case r.kY.ZodPromise:return function(e,t){return he(e.type._def,t)}(e,s);case r.kY.ZodNaN:case r.kY.ZodNever:return{not:{}};case r.kY.ZodEffects:return function(e,t){return"input"===t.effectStrategy?he(e.schema._def,t):{}}(e,s);case r.kY.ZodAny:case r.kY.ZodUnknown:return{};case r.kY.ZodDefault:return function(e,t){return{...he(e.innerType._def,t),default:e.defaultValue()}}(e,s);case r.kY.ZodBranded:return Z(e,s);case r.kY.ZodReadonly:case r.kY.ZodCatch:return((e,t)=>he(e.innerType._def,t))(e,s);case r.kY.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return he(e.in._def,t);if("output"===t.pipeStrategy)return he(e.out._def,t);const s=he(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[s,he(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",s?"1":"0"]})].filter((e=>void 0!==e))}})(e,s);case r.kY.ZodFunction:case r.kY.ZodVoid:case r.kY.ZodSymbol:default:return}},ue=(e,t)=>{let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];s++);return[(e.length-s).toString(),...t.slice(s)].join("/")};function he(e,t,s=!1){var i;const o=t.seen.get(e);if(t.override){const n=null==(i=t.override)?void 0:i.call(t,e,t,o,s);if(n!==K)return n}if(o&&!s){const e=pe(o,t);if(void 0!==e)return e}const n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);const r=de(e,e.typeName,t),a="function"==typeof r?he(r(),t):r;if(a&&ge(e,t,a),t.postProcess){const s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}var pe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ue(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,s)=>t.currentPath[s]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},ge=(e,t,s)=>(e.description&&(s.description=e.description),s),fe=(e,t)=>{var s;const i=(e=>{const t=(e=>"string"==typeof e?{...q,name:e}:{...q,...e})(e),s=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:s,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let o="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,s])=>{var o;return{...e,[t]:null!=(o=he(s._def,{...i,currentPath:[...i.basePath,i.definitionPath,t]},!0))?o:{}}}),{}):void 0;const n="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,r=null!=(s=he(e._def,void 0===n?i:{...i,currentPath:[...i.basePath,i.definitionPath,n]},!1))?s:{},a="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==a&&(r.title=a);const l=void 0===n?o?{...r,[i.definitionPath]:o}:r:{$ref:[..."relative"===i.$refStrategy?[]:i.basePath,i.definitionPath,n].join("/"),[i.definitionPath]:{...o,[n]:r}};return l.$schema="http://json-schema.org/draft-07/schema#",l},me=Symbol.for("vercel.ai.schema");function ve(e){let t;return()=>(null==t&&(t=e()),t)}function we(e,{validate:t}={}){return{[me]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function Ce(e){return null==e?we({properties:{},additionalProperties:!1}):"object"==typeof(s=e)&&null!==s&&me in s&&!0===s[me]&&"jsonSchema"in s&&"validate"in s?e:"~standard"in e?"zod"===e["~standard"].vendor?ye(e):(t=e,we((()=>$(t["~standard"].jsonSchema.input({target:"draft-07"}))),{validate:async e=>{const s=await t["~standard"].validate(e);return"value"in s?{success:!0,value:s.value}:{success:!1,error:new i.iM({value:e,cause:s.issues})}}})):e();var t,s}function ye(e,t){return function(e){return"_zod"in e}(e)?function(e,t){var s;const i=null!=(s=null==t?void 0:t.useReferences)&&s;return we((()=>$(n.b(e,{target:"draft-7",io:"input",reused:i?"ref":"inline"}))),{validate:async t=>{const s=await o.bp(e,t);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}(e,t):function(e,t){var s;const i=null!=(s=null==t?void 0:t.useReferences)&&s;return we((()=>fe(e,{$refStrategy:i?"root":"none"})),{validate:async t=>{const s=await e.safeParseAsync(t);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}(e,t)}async function be({value:e,schema:t,context:s}){const o=await Se({value:e,schema:t,context:s});if(!o.success)throw i.iM.wrap({value:e,cause:o.error,context:s});return o.value}async function Se({value:e,schema:t,context:s}){const o=Ce(t);try{if(null==o.validate)return{success:!0,value:e,rawValue:e};const t=await o.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:i.iM.wrap({value:e,cause:t.error,context:s}),rawValue:e}}catch(t){return{success:!1,error:i.iM.wrap({value:e,cause:t,context:s}),rawValue:e}}}async function xe({text:e,schema:t}){try{const s=U(e);return null==t?{success:!0,value:s,rawValue:s}:await Se({value:s,schema:t})}catch(t){return{success:!1,error:i.u6.isInstance(t)?t:new i.u6({text:e,cause:t}),rawValue:void 0}}}function Re({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new a.Z).pipeThrough(new TransformStream({async transform({data:e},s){"[DONE]"!==e&&s.enqueue(await xe({text:e,schema:t}))}}))}var Pe=()=>globalThis.fetch,Ee=async({url:e,headers:t,body:s,failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r})=>Ie({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(s),values:s},failedResponseHandler:i,successfulResponseHandler:o,abortSignal:n,fetch:r}),Ie=async({url:e,headers:t={},body:s,successfulResponseHandler:o,failedResponseHandler:n,abortSignal:r,fetch:a=Pe()})=>{try{const l=await a(e,{method:"POST",headers:L(t,`ai-sdk/provider-utils/${V}`,M()),body:s.content,signal:r}),c=p(l);if(!l.ok){let t;try{t=await n({response:l,url:e,requestBodyValues:s.values})}catch(t){if(F(t)||i.hL.isInstance(t))throw t;throw new i.hL({message:"Failed to process error response",cause:t,statusCode:l.status,url:e,responseHeaders:c,requestBodyValues:s.values})}throw t.value}try{return await o({response:l,url:e,requestBodyValues:s.values})}catch(t){if(t instanceof Error&&(F(t)||i.hL.isInstance(t)))throw t;throw new i.hL({message:"Failed to process successful response",cause:t,statusCode:l.status,url:e,responseHeaders:c,requestBodyValues:s.values})}}catch(t){throw A({error:t,url:e,requestBodyValues:s.values})}};function ke(e){return e}function Fe({id:e,inputSchema:t,outputSchema:s,supportsDeferredResults:i}){return({execute:o,needsApproval:n,toModelOutput:r,onInputStart:a,onInputDelta:l,onInputAvailable:c,...d})=>({type:"provider",id:e,args:d,inputSchema:t,outputSchema:s,execute:o,needsApproval:n,toModelOutput:r,onInputStart:a,onInputDelta:l,onInputAvailable:c,supportsDeferredResults:i})}async function De(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var Te=({errorSchema:e,errorToMessage:t,isRetryable:s})=>async({response:o,url:n,requestBodyValues:r})=>{const a=await o.text(),l=p(o);if(""===a.trim())return{responseHeaders:l,value:new i.hL({message:o.statusText,url:n,requestBodyValues:r,statusCode:o.status,responseHeaders:l,responseBody:a,isRetryable:null==s?void 0:s(o)})};try{const c=await async function({text:e,schema:t}){try{const s=U(e);return null==t?s:be({value:s,schema:t})}catch(t){if(i.u6.isInstance(t)||i.iM.isInstance(t))throw t;throw new i.u6({text:e,cause:t})}}({text:a,schema:e});return{responseHeaders:l,value:new i.hL({message:t(c),url:n,requestBodyValues:r,statusCode:o.status,responseHeaders:l,responseBody:a,data:c,isRetryable:null==s?void 0:s(o,c)})}}catch(e){return{responseHeaders:l,value:new i.hL({message:o.statusText,url:n,requestBodyValues:r,statusCode:o.status,responseHeaders:l,responseBody:a,isRetryable:null==s?void 0:s(o)})}}},Ae=e=>async({response:t})=>{const s=p(t);if(null==t.body)throw new i.Tt({});return{responseHeaders:s,value:Re({stream:t.body,schema:e})}},Me=e=>async({response:t,url:s,requestBodyValues:o})=>{const n=await t.text(),r=await xe({text:n,schema:e}),a=p(t);if(!r.success)throw new i.hL({message:"Invalid JSON response",cause:r.error,statusCode:t.status,responseHeaders:a,responseBody:n,url:s,requestBodyValues:o});return{responseHeaders:a,value:r.value,rawValue:r.rawValue}};function Ne(e){return null==e?void 0:e.replace(/\/$/,"")}async function*Le({execute:e,input:t,options:s}){const i=e(t,s);if(null!=(o=i)&&"function"==typeof o[Symbol.asyncIterator]){let e;for await(const t of i)e=t,yield{type:"preliminary",output:t};yield{type:"final",output:e}}else yield{type:"final",output:await i};var o}},34633:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(5652);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},36743:(e,t,s)=>{s.d(t,{A:()=>f});const i={strip:["script"],clobberPrefix:"user-content-",clobber:["name","id"],ancestors:{tbody:["table"],tfoot:["table"],thead:["table"],td:["table"],th:["table"],tr:["table"]},protocols:{href:["http","https","mailto","xmpp","irc","ircs"],cite:["http","https"],src:["http","https"],longDesc:["http","https"]},tagNames:["h1","h2","h3","h4","h5","h6","br","b","i","strong","em","a","pre","code","img","tt","div","ins","del","sup","sub","p","ol","ul","table","thead","tbody","tfoot","blockquote","dl","dt","dd","kbd","q","samp","var","hr","ruby","rt","rp","li","tr","td","th","s","strike","summary","details","caption","figure","figcaption","abbr","bdo","cite","dfn","mark","small","span","time","wbr","input"],attributes:{a:["href"],img:["src","longDesc"],input:[["type","checkbox"],["disabled",!0]],li:[["className","task-list-item"]],div:["itemScope","itemType"],blockquote:["cite"],del:["cite"],ins:["cite"],q:["cite"],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","ariaDescribedBy","ariaHidden","ariaLabel","ariaLabelledBy","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","cols","colSpan","color","compact","coords","dateTime","dir","disabled","encType","htmlFor","frame","headers","height","hrefLang","hSpace","isMap","id","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rel","rev","rows","rowSpan","rules","scope","selected","shape","size","span","start","summary","tabIndex","target","title","type","useMap","vAlign","value","vSpace","width","itemProp"]},required:{input:{type:"checkbox",disabled:!0}}},o={}.hasOwnProperty,n={root:{children:a},doctype:function(e){return e.allowDoctypes?{name:l}:void 0},comment:function(e){return e.allowComments?{value:d}:void 0},element:{tagName:c,properties:function(e,t,s,i){const n=c(e,s.tagName,0,i),r=e.attributes||{},a=e.required||{},l=t||{},d=Object.assign({},g(r["*"]),g(n&&o.call(r,n)?r[n]:[])),u={};let f;for(f in l)if(o.call(l,f)){let t,s=l[f];if(o.call(d,f))t=d[f];else{if(!((m=f).length>4&&"data"===m.slice(0,4).toLowerCase()&&o.call(d,"data*")))continue;t=d["data*"]}s=Array.isArray(s)?h(e,s,f,t):p(e,s,f,t),null!=s&&(u[f]=s)}var m;if(n&&o.call(a,n))for(f in a[n])o.call(u,f)||(u[f]=a[n][f]);return u},children:a},text:{value:function(e,t){return"string"==typeof t?t:""}},"*":{data:u,position:u}};function r(e,t,s){const i=t&&t.type,r={type:t.type};let a;if(o.call(n,i)){let l=n[i];if("function"==typeof l&&(l=l(e,t)),l){const i=Object.assign({},l,n["*"]);let c;for(c in a=!0,i)if(o.call(i,c)){const o=i[c](e,t[c],t,s);!1===o?(a=void 0,r[c]=t[c]):null!=o&&(r[c]=o)}}}return a?r:"element"===r.type&&e.strip&&!e.strip.includes(r.tagName)?r.children:void 0}function a(e,t,s,i){const o=[];if(Array.isArray(t)){let n=-1;for("element"===s.type&&i.push(s.tagName);++n<t.length;){const s=r(e,t[n],i);s&&(Array.isArray(s)?o.push(...s):o.push(s))}"element"===s.type&&i.pop()}return o}function l(){return"html"}function c(e,t,s,i){const n="string"==typeof t?t:"";let r=-1;if(!n||"*"===n||e.tagNames&&!e.tagNames.includes(n))return!1;if(e.ancestors&&o.call(e.ancestors,n)){for(;++r<e.ancestors[n].length;)if(i.includes(e.ancestors[n][r]))return n;return!1}return n}function d(e,t){const s="string"==typeof t?t:"",i=s.indexOf("--\x3e");return i<0?s:s.slice(0,i)}function u(e,t){return t}function h(e,t,s,i){let o=-1;const n=[];for(;++o<t.length;){const r=p(e,t[o],s,i);null!=r&&n.push(r)}return n}function p(e,t,s,i){if(("boolean"==typeof t||"number"==typeof t||"string"==typeof t)&&function(e,t,s){const i=String(t),n=i.indexOf(":"),r=i.indexOf("?"),a=i.indexOf("#"),l=i.indexOf("/"),c=e.protocols&&o.call(e.protocols,s)?e.protocols[s].concat():[];let d=-1;if(0===c.length||n<0||l>-1&&n>l||r>-1&&n>r||a>-1&&n>a)return!0;for(;++d<c.length;)if(n===c[d].length&&i.slice(0,c[d].length)===c[d])return!0;return!1}(e,t,s)&&(0===i.length||i.some((e=>e&&"object"==typeof e&&"flags"in e?e.test(String(t)):e===t))))return e.clobberPrefix&&e.clobber&&e.clobber.includes(s)?e.clobberPrefix+t:t}function g(e){const t={};let s=-1;for(;++s<e.length;){const i=e[s];Array.isArray(i)?t[i[0]]=i.slice(1):t[i]=[]}return t}function f(e=i){return t=>function(e,t){let s={type:"root",children:[]};if(e&&"object"==typeof e&&e.type){const o=r(Object.assign({},i,t||{}),e,[]);o&&(Array.isArray(o)?1===o.length?s=o[0]:s.children=o:s=o)}return s}(t,e)}},37385:(e,t,s)=>{e.exports=function(e){var t=s.nc;t&&e.setAttribute("nonce",t)}},45928:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(8069))},47772:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(66099);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},56565:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t),t}},64159:(e,t,s)=>{s.d(t,{Ay:()=>o});var i=s(47772);const o=i.default;i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString},65317:function(e){!function(t){const s="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${s}\\.${s}\\.${s}\\.${s}$`,"i"),threeOctet:new RegExp(`^${s}\\.${s}\\.${s}$`,"i"),twoOctet:new RegExp(`^${s}\\.${s}$`,"i"),longValue:new RegExp(`^${s}$`,"i")},o=new RegExp("^0[0-7]+$","i"),n=new RegExp("^0x[a-f0-9]+$","i"),r="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(r,"i"),native:new RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${r})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${s}\\.${s}\\.${s}\\.${s}(${r})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${s}\\.${s}\\.${s}\\.${s}(${r})?$`,"i")};function c(e,t){if(e.indexOf("::")!==e.lastIndexOf("::"))return null;let s,i,o=0,n=-1,r=(e.match(l.zoneIndex)||[])[0];for(r&&(r=r.substring(1),e=e.replace(/%.+$/,""));(n=e.indexOf(":",n+1))>=0;)o++;if("::"===e.substr(0,2)&&o--,"::"===e.substr(-2,2)&&o--,o>=t)return null;for(i=t-o,s=":";i--;)s+="0:";return":"===(e=e.replace("::",s))[0]&&(e=e.slice(1)),":"===e[e.length-1]&&(e=e.slice(0,-1)),{parts:t=function(){const t=e.split(":"),s=[];for(let e=0;e<t.length;e++)s.push(t[e].length>4?NaN:parseInt(t[e],16));return s}(),zoneId:r}}function d(e,t,s,i){if(e.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let o,n=0;for(;i>0;){if(o=s-i,o<0&&(o=0),e[n]>>o!=t[n]>>o)return!1;i-=s,n+=1}return!0}function u(e){if(n.test(e))return parseInt(e,16);if("0"===e[0]&&!isNaN(parseInt(e[1],10))){if(o.test(e))return parseInt(e,8);throw new Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function h(e,t){for(;e.length<t;)e=`0${e}`;return e}const p={};p.IPv4=function(){function e(e){if(4!==e.length)throw new Error("ipaddr: ipv4 octet count should be 4");let t,s;for(t=0;t<e.length;t++)if(s=e[t],!(0<=s&&s<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return"ipv4"},e.prototype.match=function(e,t){let s;if(void 0===t&&(s=e,e=s[0],t=s[1]),"ipv4"!==e.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const s={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let i,o,n;for(i=3;i>=0;i-=1){if(o=this.octets[i],!(o in s))return null;if(n=s[o],t&&0!==n)return null;8!==n&&(t=!0),e+=n}return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(".")},e}(),p.IPv4.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),s=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let n=0;for(;n<4;)o.push(parseInt(s[n],10)|255^parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format",{cause:e})}},p.IPv4.isIPv4=function(e){return null!==this.parser(e)},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!(!p.IPv4.isValid(e)||!e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){const t=e.match(/^(.+)\/(\d+)$/);return!(!p.IPv4.isValidCIDR(e)||!t)&&p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,s,i,o,n;try{for(t=this.parseCIDR(e),i=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],s=0;s<4;)o.push(parseInt(i[s],10)&parseInt(n[s],10)),s++;return new this(o)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format",{cause:e})}},p.IPv4.parse=function(e){const t=this.parser(e);if(null===t)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){const e=parseInt(t[2]);if(e>=0&&e<=32){const s=[this.parse(t[1]),e];return Object.defineProperty(s,"toString",{value:function(){return this.join("/")}}),s}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(e){let t,s,o;if(t=e.match(i.fourOctet))return function(){const e=t.slice(1,6),i=[];for(let t=0;t<e.length;t++)s=e[t],i.push(u(s));return i}();if(t=e.match(i.longValue)){if(o=u(t[1]),o>4294967295||o<0)throw new Error("ipaddr: address outside defined range");return function(){const e=[];let t;for(t=0;t<=24;t+=8)e.push(o>>t&255);return e}().reverse()}return(t=e.match(i.twoOctet))?function(){const e=t.slice(1,4),s=[];if(o=u(e[1]),o>16777215||o<0)throw new Error("ipaddr: address outside defined range");return s.push(u(e[0])),s.push(o>>16&255),s.push(o>>8&255),s.push(255&o),s}():(t=e.match(i.threeOctet))?function(){const e=t.slice(1,5),s=[];if(o=u(e[2]),o>65535||o<0)throw new Error("ipaddr: address outside defined range");return s.push(u(e[0])),s.push(u(e[1])),s.push(o>>8&255),s.push(255&o),s}():null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),Number.isNaN(e)||e<0||e>32)throw new Error("ipaddr: invalid IPv4 prefix length");const t=[0,0,0,0];let s=0;const i=Math.floor(e/8);for(;s<i;)t[s]=255,s++;return i<4&&(t[i]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},p.IPv6=function(){function e(e,t){let s,i;if(16===e.length)for(this.parts=[],s=0;s<=14;s+=2)this.parts.push(e[s]<<8|e[s+1]);else{if(8!==e.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=e}for(s=0;s<this.parts.length;s++)if(i=this.parts[s],!(0<=i&&i<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},e.prototype.kind=function(){return"ipv6"},e.prototype.match=function(e,t){let s;if(void 0===t&&(s=e,e=s[0],t=s[1]),"ipv6"!==e.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const s={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let i,o;for(let n=7;n>=0;n-=1){if(i=this.parts[n],!(i in s))return null;if(o=s[i],t&&0!==o)return null;16!==o&&(t=!0),e+=o}return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e;const t=[],s=this.parts;for(let i=0;i<s.length;i++)e=s[i],t.push(e>>8),t.push(255&e);return t},e.prototype.toFixedLengthString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(h(this.parts[t].toString(16),4));return e}.call(this).join(":");let t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const e=this.parts.slice(-2),t=e[0],s=e[1];return new p.IPv4([t>>8,255&t,s>>8,255&s])},e.prototype.toNormalizedString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}.call(this).join(":");let t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){const e=/((^|:)(0(:|$)){2,})/g;let t="";this.zoneId&&(t=`%${this.zoneId}`);const s=this.toNormalizedString(),i=s.slice(0,s.length-t.length);let o,n=0,r=-1,a=-1;for(;o=e.exec(i);){const e=(o[0].match(/0/g)||[]).length;e>a&&(a=e,n=o.index,r=o[0].length)}return r<0?i+t:`${i.substring(0,n)}::${i.substring(n+r)}${t}`},e.prototype.toString=function(){return this.toRFC5952String()},e}(),p.IPv6.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),s=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let n=0;for(;n<16;)o.push(parseInt(s[n],10)|255^parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format",{cause:e})}},p.IPv6.isIPv6=function(e){return null!==this.parser(e)},p.IPv6.isValid=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{const t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,s,i,o,n;try{for(t=this.parseCIDR(e),i=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],s=0;s<16;)o.push(parseInt(i[s],10)&parseInt(n[s],10)),s++;return new this(o)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format",{cause:e})}},p.IPv6.parse=function(e){const t=this.parser(e);if(null===t)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,s,i;if((s=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(s[2]),t>=0&&t<=128))return i=[this.parse(s[1]),t],Object.defineProperty(i,"toString",{value:function(){return this.join("/")}}),i;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(e){let t,s,i,o,n,r;if(i=e.match(l.deprecatedTransitional))return this.parser(`::ffff:${i[1]}`);if(l.native.test(e))return c(e,8);if((i=e.match(l.transitional))&&(r=i[6]||"",t=i[1],i[1].endsWith("::")||(t=t.slice(0,-1)),t=c(t+r,6),t&&t.parts)){for(n=[parseInt(i[2]),parseInt(i[3]),parseInt(i[4]),parseInt(i[5])],s=0;s<n.length;s++)if(o=n[s],!(0<=o&&o<=255))return null;return t.parts.push(n[0]<<8|n[1]),t.parts.push(n[2]<<8|n[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),Number.isNaN(e)||e<0||e>128)throw new Error("ipaddr: invalid IPv6 prefix length");const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let s=0;const i=Math.floor(e/8);for(;s<i;)t[s]=255,s++;return i<16&&(t[i]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){const t=e.length;if(4===t)return new p.IPv4(e);if(16===t)return new p.IPv6(e);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch(e){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format",{cause:e})}}},p.process=function(e){const t=this.parse(e);return"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,s){let i,o,n,r;for(o in null==s&&(s="unicast"),t)if(Object.prototype.hasOwnProperty.call(t,o))for(n=t[o],!n[0]||n[0]instanceof Array||(n=[n]),i=0;i<n.length;i++)if(r=n[i],e.kind()===r[0].kind()&&e.match.apply(e,r))return o;return s},e.exports?e.exports=p:t.ipaddr=p}(this)},66099:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(47772))},68446:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(30149);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d},74770:(e,t,s)=>{s.d(t,{JS:()=>Le,jN:()=>F});var i,o,n,r,a,l,c,d,u,h,p,g,f,m,v=s(33997),w=s(86637),C=s(42343),y=s(33868),b=s(18578),S=s(21655).URL,x=s(34110).Buffer,R=Symbol.for("vercel.ai.gateway.error"),P=class e extends(o=Error,i=R,o){constructor({message:e,statusCode:t=500,cause:s,generationId:o}){super(o?`${e} [${o}]`:e),this[i]=!0,this.statusCode=t,this.cause=s,this.generationId=o}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&R in e&&!0===e[R]}},E="GatewayAuthenticationError",I=`vercel.ai.gateway.error.${E}`,k=Symbol.for(I),F=class e extends(r=P,n=k,r){constructor({message:e="Authentication failed",statusCode:t=401,cause:s,generationId:i}={}){super({message:e,statusCode:t,cause:s,generationId:i}),this[n]=!0,this.name=E,this.type="authentication_error"}static isInstance(e){return P.hasMarker(e)&&k in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:s,message:i="Authentication failed",statusCode:o=401,cause:n,generationId:r}){let a;return a=t?"AI Gateway authentication failed: Invalid API key.\n\nCreate a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\n\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.":s?"AI Gateway authentication failed: Invalid OIDC token.\n\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.\n\nAlternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys":"AI Gateway authentication failed: No authentication provided.\n\nOption 1 - API key:\nCreate an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.\n\nOption 2 - OIDC token:\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.",new e({message:a,statusCode:o,cause:n,generationId:r})}},D="GatewayInvalidRequestError",T=`vercel.ai.gateway.error.${D}`,A=Symbol.for(T),M=class extends(l=P,a=A,l){constructor({message:e="Invalid request",statusCode:t=400,cause:s,generationId:i}={}){super({message:e,statusCode:t,cause:s,generationId:i}),this[a]=!0,this.name=D,this.type="invalid_request_error"}static isInstance(e){return P.hasMarker(e)&&A in e}},N="GatewayRateLimitError",L=`vercel.ai.gateway.error.${N}`,V=Symbol.for(L),_=class extends(d=P,c=V,d){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:s,generationId:i}={}){super({message:e,statusCode:t,cause:s,generationId:i}),this[c]=!0,this.name=N,this.type="rate_limit_exceeded"}static isInstance(e){return P.hasMarker(e)&&V in e}},O="GatewayModelNotFoundError",B=`vercel.ai.gateway.error.${O}`,H=Symbol.for(B),G=(0,v.ID)((()=>(0,v.jN)(C.Ik({modelId:C.Yj()})))),z=class extends(h=P,u=H,h){constructor({message:e="Model not found",statusCode:t=404,modelId:s,cause:i,generationId:o}={}){super({message:e,statusCode:t,cause:i,generationId:o}),this[u]=!0,this.name=O,this.type="model_not_found",this.modelId=s}static isInstance(e){return P.hasMarker(e)&&H in e}},W="GatewayInternalServerError",j=`vercel.ai.gateway.error.${W}`,U=Symbol.for(j),$=class extends(g=P,p=U,g){constructor({message:e="Internal server error",statusCode:t=500,cause:s,generationId:i}={}){super({message:e,statusCode:t,cause:s,generationId:i}),this[p]=!0,this.name=W,this.type="internal_server_error"}static isInstance(e){return P.hasMarker(e)&&U in e}},Y="GatewayResponseError",K=`vercel.ai.gateway.error.${Y}`,q=Symbol.for(K),Z=class extends(m=P,f=q,m){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:s,validationError:i,cause:o,generationId:n}={}){super({message:e,statusCode:t,cause:o,generationId:n}),this[f]=!0,this.name=Y,this.type="response_error",this.response=s,this.validationError=i}static isInstance(e){return P.hasMarker(e)&&q in e}};async function Q({response:e,statusCode:t,defaultMessage:s="Gateway request failed",cause:i,authMethod:o}){var n;const r=await(0,v.ZZ)({value:e,schema:ee});if(!r.success){const o="object"==typeof e&&null!==e&&"generationId"in e?e.generationId:void 0;return new Z({message:`Invalid error response format: ${s}`,statusCode:t,response:e,validationError:r.error,cause:i,generationId:o})}const a=r.value,l=a.error.type,c=a.error.message,d=null!=(n=a.generationId)?n:void 0;switch(l){case"authentication_error":return F.createContextualError({apiKeyProvided:"api-key"===o,oidcTokenProvided:"oidc"===o,statusCode:t,cause:i,generationId:d});case"invalid_request_error":return new M({message:c,statusCode:t,cause:i,generationId:d});case"rate_limit_exceeded":return new _({message:c,statusCode:t,cause:i,generationId:d});case"model_not_found":{const e=await(0,v.ZZ)({value:a.error.param,schema:G});return new z({message:c,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:i,generationId:d})}default:return new $({message:c,statusCode:t,cause:i,generationId:d})}}var J,X,ee=(0,v.ID)((()=>(0,v.jN)(C.Ik({error:C.Ik({message:C.Yj(),type:C.Yj().nullish(),param:C.L5().nullish(),code:C.KC([C.Yj(),C.ai()]).nullish()}),generationId:C.Yj().nullish()})))),te="GatewayTimeoutError",se=`vercel.ai.gateway.error.${te}`,ie=Symbol.for(se),oe=class e extends(X=P,J=ie,X){constructor({message:e="Request timed out",statusCode:t=408,cause:s,generationId:i}={}){super({message:e,statusCode:t,cause:s,generationId:i}),this[J]=!0,this.name=te,this.type="timeout_error"}static isInstance(e){return P.hasMarker(e)&&ie in e}static createTimeoutError({originalMessage:t,statusCode:s=408,cause:i,generationId:o}){return new e({message:`Gateway request timed out: ${t}\n\n This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`,statusCode:s,cause:i,generationId:o})}};function ne(e){if(!(e instanceof Error))return!1;const t=e.code;return"string"==typeof t&&["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t)}async function re(e,t){var s;return P.isInstance(e)?e:ne(e)?oe.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):w.hL.isInstance(e)?e.cause&&ne(e.cause)?oe.createTimeoutError({originalMessage:e.message,cause:e}):await Q({response:ae(e),statusCode:null!=(s=e.statusCode)?s:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await Q({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function ae(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}var le="ai-gateway-auth-method";async function ce(e){const t=await(0,v.ZZ)({value:e[le],schema:de});return t.success?t.value:void 0}var de=(0,v.ID)((()=>(0,v.jN)(C.KC([C.eu("api-key"),C.eu("oidc")])))),ue=class{constructor(e){this.config=e}async getAvailableModels(){try{const{value:e}=await(0,v.$b)({url:`${this.config.baseURL}/config`,headers:await(0,v.hd)(this.config.headers()),successfulResponseHandler:(0,v.cV)(he),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await re(e)}}async getCredits(){try{const e=new S(this.config.baseURL),{value:t}=await(0,v.$b)({url:`${e.origin}/v1/credits`,headers:await(0,v.hd)(this.config.headers()),successfulResponseHandler:(0,v.cV)(pe),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await re(e)}}},he=(0,v.ID)((()=>(0,v.jN)(C.Ik({models:C.YO(C.Ik({id:C.Yj(),name:C.Yj(),description:C.Yj().nullish(),pricing:C.Ik({input:C.Yj(),output:C.Yj(),input_cache_read:C.Yj().nullish(),input_cache_write:C.Yj().nullish()}).transform((({input:e,output:t,input_cache_read:s,input_cache_write:i})=>({input:e,output:t,...s?{cachedInputTokens:s}:{},...i?{cacheCreationInputTokens:i}:{}}))).nullish(),specification:C.Ik({specificationVersion:C.eu("v3"),provider:C.Yj(),modelId:C.Yj()}),modelType:C.k5(["embedding","image","language","video"]).nullish()}))})))),pe=(0,v.ID)((()=>(0,v.jN)(C.Ik({balance:C.Yj(),total_used:C.Yj()}).transform((({balance:e,total_used:t})=>({balance:e,totalUsed:t})))))),ge=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){const{abortSignal:t,...s}=e;return{args:this.maybeEncodeFileParts(s),warnings:[]}}async doGenerate(e){const{args:t,warnings:s}=await this.getArgs(e),{abortSignal:i}=e,o=await(0,v.hd)(this.config.headers());try{const{responseHeaders:n,value:r,rawValue:a}=await(0,v.GU)({url:this.getUrl(),headers:(0,v.m2)(o,e.headers,this.getModelConfigHeaders(this.modelId,!1),await(0,v.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,v.cV)(C.bz()),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),...i&&{abortSignal:i},fetch:this.config.fetch});return{...r,request:{body:t},response:{headers:n,body:a},warnings:s}}catch(e){throw await re(e,await ce(o))}}async doStream(e){const{args:t,warnings:s}=await this.getArgs(e),{abortSignal:i}=e,o=await(0,v.hd)(this.config.headers());try{const{value:n,responseHeaders:r}=await(0,v.GU)({url:this.getUrl(),headers:(0,v.m2)(o,e.headers,this.getModelConfigHeaders(this.modelId,!0),await(0,v.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,v.Ds)(C.bz()),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),...i&&{abortSignal:i},fetch:this.config.fetch});return{stream:n.pipeThrough(new TransformStream({start(e){s.length>0&&e.enqueue({type:"stream-start",warnings:s})},transform(t,s){if(t.success){const i=t.value;if("raw"===i.type&&!e.includeRawChunks)return;"response-metadata"===i.type&&i.timestamp&&"string"==typeof i.timestamp&&(i.timestamp=new Date(i.timestamp)),s.enqueue(i)}else s.error(t.error)}})),request:{body:t},response:{headers:r}}}catch(e){throw await re(e,await ce(o))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(const t of e.prompt)for(const e of t.content)if(this.isFilePart(e)){const t=e;if(t.data instanceof Uint8Array){const e=Uint8Array.from(t.data),s=x.from(e).toString("base64");t.data=new S(`data:${t.mediaType||"application/octet-stream"};base64,${s}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},fe=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:s,providerOptions:i}){var o;const n=await(0,v.hd)(this.config.headers());try{const{responseHeaders:r,value:a,rawValue:l}=await(0,v.GU)({url:this.getUrl(),headers:(0,v.m2)(n,null!=t?t:{},this.getModelConfigHeaders(),await(0,v.hd)(this.config.o11yHeaders)),body:{values:e,...i?{providerOptions:i}:{}},successfulResponseHandler:(0,v.cV)(me),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),...s&&{abortSignal:s},fetch:this.config.fetch});return{embeddings:a.embeddings,usage:null!=(o=a.usage)?o:void 0,providerMetadata:a.providerMetadata,response:{headers:r,body:l},warnings:[]}}catch(e){throw await re(e,await ce(n))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},me=(0,v.ID)((()=>(0,v.jN)(C.Ik({embeddings:C.YO(C.YO(C.ai())),usage:C.Ik({tokens:C.ai()}).nullish(),providerMetadata:C.g1(C.Yj(),C.g1(C.Yj(),C.L5())).optional()})))),ve=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:s,aspectRatio:i,seed:o,files:n,mask:r,providerOptions:a,headers:l,abortSignal:c}){var d,u,h,p;const g=await(0,v.hd)(this.config.headers());try{const{responseHeaders:f,value:m,rawValue:w}=await(0,v.GU)({url:this.getUrl(),headers:(0,v.m2)(g,null!=l?l:{},this.getModelConfigHeaders(),await(0,v.hd)(this.config.o11yHeaders)),body:{prompt:e,n:t,...s&&{size:s},...i&&{aspectRatio:i},...o&&{seed:o},...a&&{providerOptions:a},...n&&{files:n.map((e=>we(e)))},...r&&{mask:we(r)}},successfulResponseHandler:(0,v.cV)(Se),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),...c&&{abortSignal:c},fetch:this.config.fetch});return{images:m.images,warnings:null!=(d=m.warnings)?d:[],providerMetadata:m.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:f},...null!=m.usage&&{usage:{inputTokens:null!=(u=m.usage.inputTokens)?u:void 0,outputTokens:null!=(h=m.usage.outputTokens)?h:void 0,totalTokens:null!=(p=m.usage.totalTokens)?p:void 0}}}}catch(e){throw await re(e,await ce(g))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function we(e){return"file"===e.type&&e.data instanceof Uint8Array?{...e,data:(0,v.n_)(e.data)}:e}var Ce=C.Ik({images:C.YO(C.L5()).optional()}).catchall(C.L5()),ye=C.gM("type",[C.Ik({type:C.eu("unsupported"),feature:C.Yj(),details:C.Yj().optional()}),C.Ik({type:C.eu("compatibility"),feature:C.Yj(),details:C.Yj().optional()}),C.Ik({type:C.eu("other"),message:C.Yj()})]),be=C.Ik({inputTokens:C.ai().nullish(),outputTokens:C.ai().nullish(),totalTokens:C.ai().nullish()}),Se=C.Ik({images:C.YO(C.Yj()),warnings:C.YO(ye).optional(),providerMetadata:C.g1(C.Yj(),Ce).optional(),usage:be.optional()}),xe=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:s,resolution:i,duration:o,fps:n,seed:r,image:a,providerOptions:l,headers:c,abortSignal:d}){var u;const h=await(0,v.hd)(this.config.headers());try{const{responseHeaders:g,value:f,rawValue:m}=await(0,v.GU)({url:this.getUrl(),headers:(0,v.m2)(h,null!=c?c:{},this.getModelConfigHeaders(),await(0,v.hd)(this.config.o11yHeaders)),body:{prompt:e,n:t,...s&&{aspectRatio:s},...i&&{resolution:i},...o&&{duration:o},...n&&{fps:n},...r&&{seed:r},...l&&{providerOptions:l},...a&&{image:(p=a,"file"===p.type&&p.data instanceof Uint8Array?{...p,data:(0,v.n_)(p.data)}:p)}},successfulResponseHandler:(0,v.cV)(Ie),failedResponseHandler:(0,v.sl)({errorSchema:C.bz(),errorToMessage:e=>e}),...d&&{abortSignal:d},fetch:this.config.fetch});return{videos:f.videos,warnings:null!=(u=f.warnings)?u:[],providerMetadata:f.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:g}}}catch(e){throw await re(e,await ce(h))}var p}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}};var Re=C.Ik({videos:C.YO(C.L5()).optional()}).catchall(C.L5()),Pe=C.KC([C.Ik({type:C.eu("url"),url:C.Yj(),mediaType:C.Yj()}),C.Ik({type:C.eu("base64"),data:C.Yj(),mediaType:C.Yj()})]),Ee=C.gM("type",[C.Ik({type:C.eu("unsupported"),feature:C.Yj(),details:C.Yj().optional()}),C.Ik({type:C.eu("compatibility"),feature:C.Yj(),details:C.Yj().optional()}),C.Ik({type:C.eu("other"),message:C.Yj()})]),Ie=C.Ik({videos:C.YO(Pe),warnings:C.YO(Ee).optional(),providerMetadata:C.g1(C.Yj(),Re).optional()}),ke=(0,v.ID)((()=>(0,v.jN)(y.Ik({objective:y.Yj().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:y.YO(y.Yj()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:y.k5(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:y.ai().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:y.Ik({include_domains:y.YO(y.Yj()).optional().describe("List of domains to include in search results."),exclude_domains:y.YO(y.Yj()).optional().describe("List of domains to exclude from search results."),after_date:y.Yj().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:y.Ik({max_chars_per_result:y.ai().optional().describe("Maximum characters per result."),max_chars_total:y.ai().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:y.Ik({max_age_seconds:y.ai().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")})))),Fe=(0,v.ID)((()=>(0,v.jN)(y.KC([y.Ik({searchId:y.Yj(),results:y.YO(y.Ik({url:y.Yj(),title:y.Yj(),excerpt:y.Yj(),publishDate:y.Yj().nullable().optional(),relevanceScore:y.ai().optional()}))}),y.Ik({error:y.k5(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:y.ai().optional(),message:y.Yj()})])))),De=(0,v.wA)({id:"gateway.parallel_search",inputSchema:ke,outputSchema:Fe}),Te=(0,v.ID)((()=>(0,v.jN)(y.Ik({query:y.KC([y.Yj(),y.YO(y.Yj())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:y.ai().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:y.ai().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:y.ai().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:y.Yj().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:y.YO(y.Yj()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:y.YO(y.Yj()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:y.Yj().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:y.Yj().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:y.Yj().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:y.Yj().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:y.k5(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")})))),Ae=(0,v.ID)((()=>(0,v.jN)(y.KC([y.Ik({results:y.YO(y.Ik({title:y.Yj(),url:y.Yj(),snippet:y.Yj(),date:y.Yj().optional(),lastUpdated:y.Yj().optional()})),id:y.Yj()}),y.Ik({error:y.k5(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:y.ai().optional(),message:y.Yj()})])))),Me=(0,v.wA)({id:"gateway.perplexity_search",inputSchema:Te,outputSchema:Ae}),Ne={parallelSearch:(e={})=>De(e),perplexitySearch:(e={})=>Me(e)},Le=function(e={}){var t,s;let i=null,o=null;const n=null!=(t=e.metadataCacheRefreshMillis)?t:3e5;let r=0;const a=null!=(s=(0,v.ae)(e.baseURL))?s:"https://ai-gateway.vercel.sh/v3/ai",l=async()=>{try{const t=await async function(e){const t=(0,v.x3)({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await(0,b.getVercelOidcToken)(),authMethod:"oidc"}}(e);return(0,v.WZ)({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[le]:t.authMethod,...e.headers},"ai-sdk/gateway/3.0.46")}catch(e){throw F.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:e})}},c=()=>{const e=(0,v.x3)({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=(0,v.x3)({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),s=(0,v.x3)({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{const i=await async function(){var e;return null==(e=(0,b.getContext)().headers)?void 0:e["x-vercel-id"]}();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...s&&{"ai-o11y-region":s},...i&&{"ai-o11y-request-id":i}}}},d=t=>new ge(t,{provider:"gateway",baseURL:a,headers:l,fetch:e.fetch,o11yHeaders:c()}),u=function(e){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(e)};u.specificationVersion="v3",u.getAvailableModels=async()=>{var t,s,c;const d=null!=(c=null==(s=null==(t=e._internal)?void 0:t.currentDate)?void 0:s.call(t).getTime())?c:Date.now();return(!i||d-r>n)&&(r=d,i=new ue({baseURL:a,headers:l,fetch:e.fetch}).getAvailableModels().then((e=>(o=e,e))).catch((async e=>{throw await re(e,await ce(await l()))}))),o?Promise.resolve(o):i},u.getCredits=async()=>new ue({baseURL:a,headers:l,fetch:e.fetch}).getCredits().catch((async e=>{throw await re(e,await ce(await l()))})),u.imageModel=t=>new ve(t,{provider:"gateway",baseURL:a,headers:l,fetch:e.fetch,o11yHeaders:c()}),u.languageModel=d;const h=t=>new fe(t,{provider:"gateway",baseURL:a,headers:l,fetch:e.fetch,o11yHeaders:c()});return u.embeddingModel=h,u.textEmbeddingModel=h,u.videoModel=t=>new xe(t,{provider:"gateway",baseURL:a,headers:l,fetch:e.fetch,o11yHeaders:c()}),u.chat=u.languageModel,u.embedding=u.embeddingModel,u.image=u.imageModel,u.video=u.videoModel,u.tools=Ne,u}()},77458:(e,t,s)=>{s.d(t,{$YQ:()=>Ai,AR_:()=>Co,BEv:()=>Ho,Cf3:()=>hm,DHs:()=>_n,Dii:()=>an,F_Q:()=>fe,Fzc:()=>Re,Hky:()=>Oo,JKr:()=>um,Jch:()=>de,NbO:()=>Vn,OPU:()=>ho,Q5x:()=>Ss,Rlq:()=>zo,TiQ:()=>z,Udn:()=>pm,Ug$:()=>qc,XQb:()=>ke,Y6t:()=>Se,ZLI:()=>ro,bUh:()=>Bo,dQD:()=>Oi,dbY:()=>B,ifX:()=>vo,jf6:()=>Di,m20:()=>Ro,pow:()=>Uc,s1r:()=>Qo,t3u:()=>fi,ufU:()=>no,vBt:()=>Mi,zl0:()=>ul,zlI:()=>ln,zsR:()=>be});var i=s(15684),o=s(21655).URLSearchParams,n=i.hVb,r=i.BiZ,a=i.q_t,l=i.glw,c=i.sbo,d=i.Axr,u=i.q5V,h=i.Tj4,p=i.glw,g=i.HkI,f=i.X3e,m=i.lfG,v=i.da2,w=i.pw8,C=i.pZu,y=i.glw,b=i.glw,S=i.Axr,x=i.mmw,R=(i.bfc,{numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}}),P=e=>"__proto__"===e||"constructor"===e||"prototype"===e,E=e=>{const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},I=e=>null!==e&&"object"==typeof e&&E(e),k=(e,t,s,i,o)=>{let n=e[t];n!==s&&(null!==s&&"object"==typeof s?(o&&null==n&&E(s)&&(n={},e[t]=n),null===n||"object"!=typeof n||Array.isArray(n)?e[t]=s:F(n,s,i,o)):(i||void 0!==s)&&(e[t]=s))},F=(e,t,s=!0,i=!1)=>{if(null!=t&&""!==t)if(Array.isArray(t))for(let o=0,n=t.length;o<n;++o)k(e,o,t[o],s,i);else for(const o of Object.keys(t))P(o)||k(e,o,t[o],s,i)},D=e=>{if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){const t=e.length,s=new Array(t);for(let i=0;i<t;++i)s[i]=D(e[i]);return s}if(!E(e))return e;const t={};for(const s of Object.keys(e))P(s)||(t[s]=D(e[s]));return t},T=(e,t,s)=>{if(e===t)return!0;if(null===e||null===t||"object"!=typeof e||"object"!=typeof t)return!1;const o=Array.isArray(e);if(o!==Array.isArray(t))return!1;if(o)return(0,i.MpY)(e,t);if(!E(e)||!E(t))return!1;const n=Object.keys(e),r=Object.keys(t),a=n.length,l=r.length;if(void 0===s){if(a!==l)return!1;for(let s=0;s<a;++s){const i=n[s];if(!(i in t)||!T(e[i],t[i]))return!1}return!0}let c=0;for(let i=0;i<a;++i){const o=n[i];if(0!==c||o!==s){if(!(o in t)||!T(e[o],t[o]))return!1}else c=1}return a-c==l-(s in t?1:0)},A=class e{static applyGlobalGridOptions(t){if(!e.gridOptions)return{...t};let s={};return F(s,e.gridOptions,!0,!0),"deep"===e.mergeStrategy?F(s,t,!0,!0):s={...s,...t},e.gridOptions.context&&(s.context=e.gridOptions.context),t.context&&("deep"===e.mergeStrategy&&s.context&&F(t.context,s.context,!0,!0),s.context=t.context),s}static applyGlobalGridOption(t,s){if("deep"===e.mergeStrategy){const i=N(t);if(i&&"object"==typeof i&&"object"==typeof s)return e.applyGlobalGridOptions({[t]:s})[t]}return s}};A.gridOptions=void 0,A.mergeStrategy="shallow";var M=A;function N(e){return M.gridOptions?.[e]}var L={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,loadingRows:!1,suppressPdfExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,includeHiddenColumnsInCharts:!0,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,suppressInputClearButton:!1,enableInputAutoComplete:!1,rowBuffer:10,stickyRowsMaxViewportRatio:.5,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,pivotPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,suppressContentVisibilityAuto:!0,contentVisibilityAutoDelay:1e3,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1};function V(e){return"number"==typeof e&&Number.isFinite(e)}function _(e,t,s){return Math.max(t,Math.min(e,s))}function O(e,t){return e.get("rowModelType")===t}function B(e,t){return O(e,"clientSide")}function H(e){return B(e)&&!0===e.get("loading")&&!!e.get("loadingRows")}function G(e,t){return!!t.stub&&B(e)}function z(e,t){return O(e,"serverSide")}function W(e,t){return e.get("domLayout")===t}function j(e){const{gos:t,environment:s}=e;return W(t,"normal")||W(t,"autoHeight")&&null!=s.getAutoHeightMaxBodyHeight()}function U(e){return void 0!==ge(e)}function $(e){return"function"==typeof e.get("getRowHeight")}function Y(e,t,s=!1,i){const{gos:o,environment:n}=e;if(null==i&&(i=n.getDefaultRowHeight()),$(o)){if(s)return{height:i,estimated:!0};const n={node:t,data:t.data},r=o.getCallback("getRowHeight")(n);if(V(r))return 0===r&&e.log.warn(23),{height:Math.max(1,r),estimated:!1}}if(t.detail&&o.get("masterDetail"))return function(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return V(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}(o);const r=o.get("rowHeight");return{height:r&&V(r)?r:i,estimated:!1}}function K(e,t){e.addManagedEventListeners({stylesChanged:e=>{e.rowHeightChanged&&t()}})}function q(e){const{environment:t,gos:s}=e,o=s.get("rowHeight");if(!o||(0,i.MWY)(o))return t.getDefaultRowHeight();const n=t.refreshRowHeightVariable();return-1!==n?n:(e.log.warn(24),t.getDefaultRowHeight())}function Z(e,t,s){const i=t[e.getDomDataKey()];return i?i[s]:void 0}function Q(e,t,s,o){const n=e.getDomDataKey();let r=t[n];(0,i.MWY)(r)&&(r={},t[n]=r),r[s]=o}function J(e){return!e.get("ensureDomOrder")&&e.get("animateRows")}function X(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||W(e,"print"))}function ee(e){const t=e.get("autoGroupColumnDef");return!t?.comparator&&!e.get("treeData")}function te(e){const t=e.get("groupAggFiltering");return"function"==typeof t?e.getCallback("groupAggFiltering"):!0===t?()=>!0:void 0}function se(e){return e.get("grandTotalRow")}function ie(e,t){return!t&&"groupRows"===e.get("groupDisplayType")}function oe(e,t,s){return!!t.group&&!t.footer&&ie(e,s)}function ne(e){const t=e.gos.getCallback("getRowId");return void 0===t?t:s=>{let o=t(s);return"string"!=typeof o&&((0,i.keA)((()=>e.log.warn(25,{id:o})),`getRowIdString:${e.context.getId()}`),o=String(o)),o}}function re(e){return e?.checkboxes??!0}function ae(e){return"multiRow"===e?.mode&&(e.headerCheckbox??!0)}function le(e){if("object"==typeof e)return e.checkboxLocation??"selectionColumn"}function ce(e){return e?.hideDisabledCheckboxes??!1}function de(e){const t=e.get("cellSelection");return void 0!==t?!!t:e.get("enableRangeSelection")}function ue(e){const t=e.get("cellSelection")??!1;return("object"==typeof t&&t.enableColumnSelection)??!1}function he(e){const t=e.get("rowSelection")??"single";if("string"==typeof t){const t=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return(!t||!s)&&(t?"enableDeselection":!s||"enableSelection")}return("singleRow"===t.mode||"multiRow"===t.mode)&&(t.enableClickSelection??!1)}function pe(e){const t=e.get("rowSelection");return"string"==typeof t?e.get("isRowSelectable"):t?.isRowSelectable}function ge(e){const t="beanName"in e&&"gos"===e.beanName?e.get("rowSelection"):e.rowSelection;if("string"==typeof t)switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function fe(e){return"multiRow"===ge(e)}function me(e){const t=e.get("rowSelection");if("string"==typeof t){const t=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return t&&s?"filteredDescendants":t?"descendants":"self"}return"multiRow"===t?.mode?t.groupSelects:void 0}function ve(e,t=!0){const s=e.get("rowSelection");return"object"!=typeof s?t?"all":void 0:"multiRow"===s.mode?s.selectAll:"all"}function we(e){const t=me(e);return"descendants"===t||"filteredDescendants"===t}function Ce(e){const t=e.get("rowSelection");return"object"==typeof t&&t.masterSelects||"self"}function ye(e){return"legacy"===e.get("columnMenu")}function be(e,t,s){"object"!=typeof e&&(e={});const i={...e};for(const e of s){const s=t[e];void 0!==s&&(i[e]=s)}return i}function Se(e,t){if(!e)return;const s={};let i=!1;for(const t of Object.keys(e))s[t]=e[t],i=!0;if(!i)return;const o={type:"gridOptionsChanged",options:s};t.dispatchEvent(o);const n={type:"componentStateChanged",...s};t.dispatchEvent(n)}function xe(e,t){return e.addCommon(t)}function Re(e,t){return e[t]??e.gridOptions?.[t]??N(t)??L[t]}function Pe(e,t,s,i,o){const n=Ee(e,t,s),r=new lt(n,t,s,i,"user");return r.buildToken=o,e.context.createBean(r),r}function Ee(e,t,s,i){const{gos:o,dataTypeSvc:n}=e,r={},a=o.get("defaultColDef");F(r,a,!1,!0);const l=n?.updateColDefAndGetColumnType(r,t,s),c=t.type??l??r.type;r.type=c,c&&function(e,t,s){const i=t.length;if(0===i)return;const o=e.gos.get("columnTypes");if(null==o)return void Ie(e,s,t,i,R);const n={...R},r=Object.keys(o);for(let t=0,s=r.length;t<s;++t){const s=r[t],i=o[s];s in n?e.log.warn(34,{key:s}):(i.type&&e.log.warn(35),n[s]=i)}Ie(e,s,t,i,n)}(e,Rt(c),r);const d=r.cellDataType;F(r,t,!1,!0),void 0!==d&&(r.cellDataType=d);const u=o.get("autoGroupColumnDef");return u&&t.rowGroup&&ee(o)&&F(r,{sort:u.sort,initialSort:u.initialSort},!1,!0),n?.postProcess(r),n?.validateColDef(r,t,a,s),o.validateColDef(r,s,i),r}function Ie(e,t,s,i,o){for(let n=0;n<i;++n){const i=s[n].trim(),r=o[i];r?F(t,r,!1,!0):e.log.warn(36,{type:i})}}var ke=class extends n{warn(...e){this.beans.log.warn(...e)}error(...e){this.beans.log.error(...e)}deprecated(...e){this.beans.log.deprecated(...e)}};function Fe(e){return e instanceof De}var De=class extends ke{constructor(e,t,s,i){super(),this.colGroupDef=e,this.groupId=t,this.padding=s,this.level=i,this.isColumn=!1,this.expandable=!1,this.expanded=!1,this.buildToken=0,this.displayInstances=null,this.lastVisible=!1,this.instanceId=ot(),this.expanded=!!e?.openByDefault}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){const e=this.children;for(let t=0,s=e.length;t<s;++t)if(e[t].isVisible())return!0;return!1}isPadding(){return this.padding}setExpanded(e){return e=!!e,this.expanded!==e&&(this.expanded=e,this.dispatchLocalEvent({type:"expandedChanged"}),!0)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.groupId}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){const t=this.children;for(let s=0,i=t.length;s<i;++s){const i=t[s];i.isColumn?e.push(i):i.addLeafColumns(e)}}getColumnGroupShow(){return this.colGroupDef?.columnGroupShow}setExpandable(){if(this.padding)return!0;const e=Ae(this.children,0),t=e===Te;this.expandable!==t&&(this.expandable=t,this.dispatchLocalEvent({type:"expandableChanged"}));const s=0!==e;return this.lastVisible!==s&&(this.lastVisible=s,!0)}},Te=7,Ae=(e,t)=>{for(let s=0,i=e.length;s<i;++s){const i=e[s];if(Fe(i)&&i.padding)t=Ae(i.children,t);else if(i.isVisible()){const e=i.getColumnGroupShow();t|="open"===e?5:"closed"===e?6:3}if(t===Te)return t}return t};function Me(e,t){let s=0,i=0;const o=e.length;let n,r,a,l=o,c=-1,d=o,u=-1;for(let t=0;t<o;++t){const n=e[t].colDef.lockPosition;"right"===n?(++i,d===o&&(d=t),u=t):"left"!==n&&!0!==n||(++s,l===o&&(l=t),c=t)}if(0===s&&0===i)return e;if(t.get("enableRtl")){if(u===i-1&&l===o-s)return e;a=0,r=i,n=o-s}else{if(c===s-1&&d===o-i)return e;n=0,r=s,a=o-i}const h=new Array(o);for(let t=0;t<o;++t){const s=e[t],i=s.colDef.lockPosition;let o;o="right"===i?a++:"left"===i||!0===i?n++:r++,h[o]=s}return h}function Ne(e,t){const s=(0,i.eaQ)(e);let o=0,n=0,r=0;const a=e=>{for(let t=0,i=e.length;t<i;++t){const i=e[t];if(Fe(i)){a(i.children);continue}const l=s.get(i)??-1;0===r?(o=l,n=l):l<o?o=l:l>n&&(n=l),++r}},l=e=>{for(let t=0,s=e.length;t<s;++t){const s=e[t];if(Fe(s)){if(s.colGroupDef?.marryChildren&&(r=0,a(s.children),r>1&&n-o>r-1))return!1;if(!l(s.children))return!1}}return!0};return l(t)}function Le(e,t){if(!e||0==e.length)return;const s=t(e[0]);for(let i=1;i<e.length;i++)if(s!==t(e[i]))return;return s}function Ve(e,t,s){if(!t.length)return;const i=1===t.length?t[0]:null,o=Le(t,(e=>e.getPinned()));e.dispatchEvent({type:"columnPinned",pinned:null!=o?o:null,columns:t,column:i,source:s})}function _e(e,t,s){if(!t.length)return;const i=1===t.length?t[0]:null,o=Le(t,(e=>e.isVisible()));e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:i,source:s})}function Oe(e,t,s,i){e.dispatchEvent({type:t,columns:s,column:1==s?.length?s[0]:null,source:i})}function Be(e,t,s,i,o=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:1===t.length?t[0]:null,flexColumns:o,finished:s,source:i})}var He=(e,t,s,i,o,n,r,a)=>{const{sortSvc:l,pinnedCols:c,colFlex:d}=e;void 0!==s&&t.setVisible(!s,a),l&&(l.updateColSort(t,i,a),void 0!==o&&l.setColSortIndex(t,o)),void 0!==n&&c?.setColPinned(t,n),void 0!==r&&d?.setColFlex(t,r)};function Ge(e,t,s=!1,i,o=!1){const n=e.colModel,r=!0===s;let a=null;for(let e=0,s=t.length;e<s;++e){const s=t[e],l="string"==typeof s?n.getCol(s):s;void 0===l||o&&l.colDef.lockVisible||l.visible!==r&&(l.setVisible(r,i),a??(a=[]),a.push(l))}if(a){const{colAnimation:t,eventSvc:s}=e;t?.start();try{n.refreshColsDerivedState(),e.visibleCols.refresh(i,!1),s.dispatchEvent({type:"columnEverythingChanged",source:i}),_e(s,a,i)}finally{t?.finish()}}}function ze(e,t,s){const{colModel:i,colAnimation:o,calculatedColsSvc:n}=e,r=t.state;if(r&&!Array.isArray(r))return e.log.warn(32),!1;r&&n?.restoreDynamicColumnDefs(r)&&n.refreshDynamicColumns(s);const a=i.colDefList,l=e.selectionColSvc?.column;if(!a.length&&!l)return!1;o?.start();try{const i=Ye(e);let o=We(e,r??null,a,t,s,!0);if(null!==o||t.defaultState){const i=e.pivotResultCols?.pivotCols;o=We(e,o,i,t,s,!1)}return $e(e,t,s,i),null===o}finally{o?.finish()}}function We(e,t,s,i,o,n){const r=e.colModel,a=i.defaultState;let l=null,c=null,d=null;const u=a?new Set:null;if(t)for(let s=0,i=t.length;s<i;++s){const i=t[s],h=i.colId;let p;if(null!=h){if(h.startsWith(vt)){l??(l=[]),l.push(i);continue}if(h.startsWith(wt)){c??(c=[]),c.push(i);continue}if(n)p=r.getNonPivotColById(h);else{const e=r.getCol(h);p=null==e?.colDef.pivotKeys?null:e}}p?(Ue(e,p,i,a,o),u?.add(p)):(d??(d=[]),d.push(i))}if(null!==u&&s)for(let t=0,i=s.length;t<i;++t){const i=s[t];u.has(i)||Ue(e,i,null,a,o)}return n&&function(e,t,s,i,o){const{autoColSvc:n,selectionColSvc:r,rowGroupColsSvc:a,pivotColsSvc:l,valueColsSvc:c}=e;a?.sortByPendingState(),l?.sortByPendingState(),c?.sortByPendingState(),e.colModel.refreshCols(!1,o);const d=r?.column;je(e,t,n?.columns??[],i,o),je(e,s,d?[d]:[],i,o)}(e,l,c,a,o),d}function je(e,t,s,i,o){let n=null;if(null!==t){n=new Set;for(let r=0,a=t.length;r<a;++r){const a=t[r],l=a.colId;for(let t=0,r=s.length;t<r;++t){const r=s[t];if(r.colId===l){n.add(r),Ue(e,r,a,i,o);break}}}}if(i)for(let t=0,r=s.length;t<r;++t){const r=s[t];n?.has(r)||Ue(e,r,null,i,o)}}function Ue(e,t,s,i,o){const n=Je(s?.flex,i?.flex),r=Je(s?.sort,i?.sort),a=Je(s?.sortType,i?.sortType),l=dt(r)||ut(a)?{type:mt(a),direction:ft(r)}:void 0;He(e,t,Je(s?.hide,i?.hide),l,Je(s?.sortIndex,i?.sortIndex),Je(s?.pinned,i?.pinned),n,o);const c=Je(s?.headerName,i?.headerName);if(void 0!==c&&t.setHeaderNameOverride(c),null==n){const n=Je(s?.width,i?.width);if(null!=n){const s=t.colDef.minWidth??e.environment.getDefaultColumnMinWidth();null!=s&&n>=s&&(t.setUserSized(!0),t.setActualWidth(n,o))}}if("auto-group"===t.colKind||!t.primary)return;e.valueColsSvc?.syncColState(t,s,i,o),e.rowGroupColsSvc?.syncColState(t,s,i,o),e.pivotColsSvc?.syncColState(t,s,i,o),e.showValuesAsSvc?.syncColState(t,s,i,o);const d=Je(s?.pivotSort,i?.pivotSort);void 0!==d&&(t.pivotSort=ft(d))}function $e(e,t,s,o){!function(e,t){const s=e.colModel,o=t.state;if(!t.applyOrder||!o||!s.ready)return;const n=s.colsById,r=s.colsList,a=new Set,l=[];for(let e=0,t=o.length;e<t;++e){const t=o[e].colId;if(null==t)continue;const s=n[t];null!=s&&s.inColsList&&!a.has(s)&&(l.push(s),a.add(s))}let c=null;for(let e=0,t=r.length;e<t;++e){const t=r[e];a.has(t)||("auto-group"===t.colKind?(c??(c=[]),c.push(t)):l.push(t))}null!==c&&function(e,t){let s=0;for(let t=0,i=e.length;t<i;++t)"auto-group"===e[t].colKind&&(s=t+1);const i=t.length;for(let t=e.length-1;t>=s;--t)e[t+i]=e[t];for(let o=0;o<i;++o)e[s+o]=t[o]}(l,c);const d=Me(l,e.gos);(0,i.MpY)(d,r)||(!s.hasMarryChildren||Ne(d,s.colsTree)?(s.colsList=d,s.markColsListIndexDirty()):e.log.warn(39))}(e,t),e.visibleCols.refresh(s,!1),e.eventSvc.dispatchEvent({type:"columnEverythingChanged",source:s}),Ke(e,s,o)}function Ye(e){const{rowGroupColsSvc:t,pivotColsSvc:s,colModel:i}=e,o=t?.columns,n=s?.columns,r=i.getColsInStateOrder(),a=new Map;for(let e=0,t=r.length;e<t;++e){const t=r[e],s=t.sortDef,i=s.direction;a.set(t.colId,{width:t.actualWidth,hide:!t.visible,pinned:t.pinned,sort:i,sortType:i?s.type:void 0,sortIndex:t.sortIndex??null,aggFunc:t.aggregationActive?t.aggFunc:null,pivotSort:t.pivotSort})}return{rowGroupColumns:o?.length?o.slice():void 0,pivotColumns:n?.length?n.slice():void 0,before:a,colsList:i.colsList}}function Ke(e,t,s){const i=e.rowGroupColsSvc?.columns,o=e.pivotColsSvc?.columns;qe(e,t,"columnRowGroupChanged",s.rowGroupColumns,i),qe(e,t,"columnPivotChanged",s.pivotColumns,o),function(e,t,s){const{eventSvc:i,sortSvc:o}=e,n=e.colModel.getAllCols();let r=null,a=null,l=null,c=null,d=null,u=null;for(let e=0,t=n.length;e<t;++e){const t=n[e],i=s.get(t.colId);i&&(i.width!=t.actualWidth&&(a??(a=[]),a.push(t)),i.pinned!=t.pinned&&(l??(l=[]),l.push(t)),i.hide==t.visible&&(c??(c=[]),c.push(t)),et(t,i)&&(r??(r=[]),r.push(t)),o&&tt(t,i)&&(d??(d=[]),d.push(t)),i.pivotSort!==t.pivotSort&&(u??(u=[]),u.push(t)))}r&&Oe(i,"columnValueChanged",r,t),a&&Be(i,a,!0,t),l&&Ve(i,l,t),c&&_e(i,c,t),d&&o?.dispatchSortChangedEvents(t,d),u&&Oe(i,"columnPivotChanged",u,t)}(e,t,s.before),function(e,t,s){const i=e.colModel,o=i.colsList;if(o===s.colsList)return;const n=s.before,r=i.colsById;let a;for(const e of n.keys()){const t=r[e];t?.inColsList&&(a??(a=[]),a.push(t))}if(!a)return;let l,c=0;const d=a.length;for(let e=0,t=o.length;e<t&&c<d;++e){const t=o[e];if(n.has(t.colId)){const e=a[c++];e!==t&&(l??(l=[]),l.push(e))}}l&&e.eventSvc.dispatchEvent({type:"columnMoved",columns:l,column:1===l.length?l[0]:null,finished:!0,source:t})}(e,t,s)}function qe(e,t,s,o,n){st(o,n)||Oe(e.eventSvc,s,(0,i.sC6)(o,n),t)}var Ze=e=>{const t=e.colModel;if(!t.isAlive())return[];const s=t.getColsInStateOrder(),i=gt(e),o=new Array(s.length);for(let t=0,n=s.length;t<n;++t){const n=s[t],r=n.rowGroupActive,a=n.pivotActive,l=n.sortDef,c=l.direction;o[t]={colId:n.colId,width:n.actualWidth,hide:!n.visible,pinned:n.pinned,sort:c,sortType:c?l.type??null:null,sortIndex:n.sortIndex??null,aggFunc:n.aggregationActive?n.aggFunc:null,valueIndex:n.aggregationActive?n.aggregationActiveIndex:null,rowGroup:r,rowGroupIndex:r?n.rowGroupActiveIndex:null,pivot:a,pivotIndex:a?n.pivotActiveIndex:null,pivotSort:void 0===n.pivotSort?i:n.pivotSort,flex:n.flex??null,showValuesAs:e.showValuesAsSvc?.toColState(n)??null,headerName:n.headerNameOverride}}return o};function Qe(e,t){const s=t.colDef,i=ct(s.sort??s.initialSort??null),o=s.rowGroupIndex??s.initialRowGroupIndex??null;let n=s.rowGroup??s.initialRowGroup??null;null==o&&!1===n&&(n=null);const r=s.pivotIndex??s.initialPivotIndex??null;let a=s.pivot??s.initialPivot??null;return null==r&&!1===a&&(a=null),{colId:t.colId,sort:i.direction,sortType:i.type,sortIndex:s.sortIndex??s.initialSortIndex??null,hide:s.hide??s.initialHide??null,pinned:s.pinned??s.initialPinned??null,width:s.width??s.initialWidth??null,flex:s.flex??s.initialFlex??null,rowGroup:n,rowGroupIndex:o,pivot:a,pivotIndex:r,pivotSort:pt(s),aggFunc:s.aggFunc??s.initialAggFunc??null,showValuesAs:e.showValuesAsSvc?.colDefSelection(s)??null,headerName:null}}var Je=(e,t)=>void 0!==e?e:t,Xe=(e,t)=>{for(let s=0,i=e.length;s<i;++s){const i=e[s],o=i.children;o?Xe(o,t):t(i)}},et=(e,t)=>{const s=t.aggFunc,i=null!=s;return i!==e.aggregationActive||i&&s!=e.aggFunc},tt=(e,t)=>{if(t.sortIndex!=e.sortIndex)return!0;const s=e.getSortDef(),i=t.sortType??"default";return s?s.direction!==t.sort||s.type!==i:null!==t.sort},st=(e,t)=>{if(e===t)return!0;const s=e?.length??0;if(s!==(t?.length??0))return!1;for(let i=0;i<s;++i){const s=e[i],o=t[i];if(s!==o&&s.colId!==o.colId)return!1}return!0},it=0;function ot(){return it++}var nt=(e,t)=>{if(!t.group&&!t.rowPinned){const t=e.pivotValueColumn;if(t)return t}return e},rt=["asc","desc",null],at=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],lt=class extends ke{constructor(e,t,s,o,n){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=o,this.colKind=n,this.isColumn=!0,this.instanceId=ot(),this.aggFunc=void 0,this.isCalculatedCol=!1,this.field=void 0,this.fieldPath=null,this.valueGetter=void 0,this.allowFormula=!1,this.showRowGroup=void 0,this.pivotValueColumn=void 0,this.valueFormatter=void 0,this.refData=void 0,this.enableCellChangeFlash=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.calculatedExpression=void 0,this.actualWidth=0,this.minWidth=0,this.maxWidth=0,this.userSized=!1,this.flex=null,this.pinned=null,this.left=null,this.oldLeft=null,this.visible=!1,this.displayed=!1,this.filterActive=!1,this.sortDef=ct(),this.sortIndex=void 0,this.pivotSort=void 0,this.autoHeaderHeight=null,this.tooltipEnabled=!1,this.tooltipFieldContainsDots=!1,this.sortCycleIndex=void 0,this.frameworkEventListenerService=void 0,this.colEventSvc=null,this.buildToken=0,this.allColsIndex=-1,this.inColsList=!1,this.ariaColIndex=0,this.colsListIndex=-1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.highlighted=null,this.formulaRef=null,this.showValuesAsDef=void 0,this.showValuesAs=null,this.anchoredToColId=void 0,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.rowGroupActive=!1,this.rowGroupActiveIndex=-1,this.pivotActive=!1,this.pivotActiveIndex=-1,this.aggregationActive=!1,this.aggregationActiveIndex=-1,this.showRowGroupCol=null,this.parent=null,this.originalParent=null,this.cachedSortTypes=null,this.headerNameOverride=null,this.colIdSanitised=(0,i.YR0)(s)}destroy(){super.destroy(),this.allColsIndex=-1,this.displayed=!1,this.colsListIndex=-1,this.inColsList=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{beans:e,colDef:t}=this,{sortSvc:s,pinnedCols:i,colFlex:o}=e;s?.initCol(this);const n=t.hide;this.visible=void 0!==n?!n:!t.initialHide,this.pivotSort=pt(t),i?.initCol(this),o?.initCol(this)}setColDef(e,t,s){const i=this.colDef;return this.userProvidedColDef=t,this.colDef=e,T(e,i)?(this.initCalculatedColumnState(e),!1):(++this.beans.colModel.colDefsVersion,this.cachedSortTypes=null,this.sortCycleIndex=void 0,this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!1),this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),e.spanRows!==i.spanRows&&this.beans.rowSpanSvc?.columnRowSpanChanged(this),this.dispatchColEvent("colDefChanged",s),this.beans.pivotResultCols?.recreateColDefsForSource(this,s),!0)}reapplyColDef(e,t,s){const i=Ee(this.beans,e,this.colId);if(this.setColDef(i,e,t),s){He(this.beans,this,i.hide,i.sort,i.sortIndex,i.pinned,i.flex,t);const e=i.pivotSort;void 0!==e&&(this.pivotSort=ft(e));const s=this.flex;(null==s||s<=0)&&this.setActualWidth(i.width??this.actualWidth,t)}}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!0),this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const{field:e,tooltipField:t}=this.colDef;this.field=e,this.gos.get("suppressFieldDotNotation")?(this.fieldPath=null,this.tooltipFieldContainsDots=!1):(this.fieldPath="string"==typeof e&&e.includes(".")?e.split("."):null,this.tooltipFieldContainsDots="string"==typeof t&&t.includes("."))}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}resetWidthOwnership(){this.userSized=!1}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){return _(e.width??e.initialWidth??200,this.minWidth,this.maxWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return null!==this.fieldPath}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}getColEventSvc(){let e=this.colEventSvc;return e||(e=new i.$UK,this.colEventSvc=e),e}__addEventListener(e,t){this.getColEventSvc().addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc?.removeEventListener(e,t)}addEventListener(e,t){const s=this.getColEventSvc();this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,s);const i=this.frameworkEventListenerService?.wrap(e,t)??t;s.addEventListener(e,i)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc?.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return xe(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isCalculatedCol||this.isColumnFunc(e,this.colDef.suppressPaste??null)}initColDefHotFields(){const e=this.colDef;this.valueGetter=e.valueGetter,this.allowFormula=!0===e.allowFormula,this.showRowGroup=e.showRowGroup,this.pivotValueColumn=e.pivotValueColumn,this.valueFormatter=e.valueFormatter,this.refData=e.refData,this.enableCellChangeFlash=e.enableCellChangeFlash,this.colSpan=e.colSpan,this.rowSpan=e.rowSpan,this.initCalculatedColumnState(e)}initCalculatedColumnState(e){this.calculatedExpression=e.calculatedExpression,this.isCalculatedCol=void 0!==this.calculatedExpression&&!0===this.beans.calculatedColsSvc?.isEnabled()}isResizable(){return this.colDef.resizable??!0}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){const e=this.sortDef;return e.direction?e:null}setSortDef(e){this.sortDef=e}isSortable(){return this.colDef.sortable??!0}isSortAscending(){return"asc"===this.getSort()}isSortDescending(){return"desc"===this.getSort()}isSortNone(){return!this.getSort()}isSorting(){return null!=this.getSort()}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getShowValuesAs(){return this.showValuesAs}getShowValuesAsDef(){return this.showValuesAsDef??null}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){const s=this.left;this.oldLeft=s,s!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return this.warn(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const s=!0===e;if(this.visible!==s){this.visible=s;let e=this.originalParent;for(;e&&e.setExpandable();)e=e.originalParent;this.dispatchColEvent("visibleChanged",t)}this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.originalParent;for(;e?.padding;)e=e.originalParent;return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.providedColumnGroup.padding)return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let s=!0;for(;e;){if(!e.providedColumnGroup.padding){s=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:s}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumn(this,e)||this.colDef.headerName||this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}isUserSized(){return this.userSized}setUserSized(e){this.userSized=e}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return this.autoHeaderHeight!==e&&(this.autoHeaderHeight=e,!0)}getColSpan(e){const t=this.colSpan;if(null==t)return 1;const s=t(this.createColumnFunctionCallbackParams(e));return s<1?1:s}getRowSpan(e){const t=this.rowSpan;if(null==t)return 1;const s=t(this.createColumnFunctionCallbackParams(e));return s<1?1:s}setActualWidth(e,t,s=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),"uiColumnResized"===t&&(this.userSized=!0),this.actualWidth!==e&&(this.actualWidth=e,null!=this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),s||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.pivotActive||this.rowGroupActive||this.aggregationActive}isAnyFunctionAllowed(){const e=this.colDef;return!0===e.enablePivot||!0===e.enableRowGroup||!0===e.enableValue}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}isAllowFormula(){return this.allowFormula}setHeaderNameOverride(e,t="api"){this.headerNameOverride!==e&&(this.headerNameOverride=e,this.dispatchColEvent("headerNameChanged",t),this.beans.eventSvc.dispatchEvent({type:"columnHeaderNameChanged",column:this,columns:null,columnGroup:null,source:t}))}dispatchColEvent(e,t,s){this.colEventSvc?.dispatchEvent(xe(this.gos,{type:e,column:this,columns:[this],source:t,...s}))}dispatchStateUpdatedEvent(e){this.colEventSvc?.dispatchEvent({type:"columnStateUpdated",key:e})}},ct=e=>ht(e)?{direction:e.direction,type:e.type}:{direction:ft(e),type:mt(e)},dt=e=>"asc"===e||"desc"===e||null===e,ut=e=>"default"===e||"absolute"===e,ht=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return ut(t.type)&&dt(t.direction)},pt=e=>{const t=void 0!==e.pivotSort?e.pivotSort:e.initialPivotSort;return void 0===t?void 0:ft(t)},gt=e=>null!=e.pivotResultCols?.suppliedColDefs?null:"asc",ft=e=>dt(e)?e:null,mt=e=>ut(e)?e:"default",vt="ag-Grid-AutoColumn",wt="ag-Grid-SelectionColumn";function Ct(e){let t=0;for(let s=0,i=e.length;s<i;++s)t+=e[s].actualWidth;return t}function yt(e){return"auto-group"===e.colKind}function bt(e){return"selection"===e.colKind}function St(e){return"row-number"===e.colKind}function xt(e){const t=e.colKind;return"selection"===t||"row-number"===t}function Rt(e){return Array.isArray(e)?e:"string"==typeof e?e.split(","):[]}function Pt(e){return"optionsUpdated"===e?"gridOptionsChanged":e}function Et(e,t,s){const i=It(t),o=e.showValuesAsSvc?.colDefSelection(t)??void 0;return i?{...t,colId:s,sort:i.direction,sortType:i.type,showValuesAs:o}:{...t,colId:s,sort:void 0,showValuesAs:o}}function It(e){const{sort:t,initialSort:s}=e,i=ht(t)||dt(t),o=ht(s)||dt(s);return i?ct(t):o?ct(s):null}function kt(e,t){for(let s=0,i=e.length;s<i;++s){const i=e[s];"children"in i?kt(i.children,t):t(i)}}var Ft=e=>e instanceof Dt,Dt=class extends ke{constructor(e,t,s,o){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=s,this.pinned=o,this.isColumn=!1,this.children=null,this.displayedChildren=[],this.autoHeaderHeight=null,this.left=null,this.oldLeft=null,this.parent=null,this.buildToken=0,this.uniqueId=`${t}_${s}`,this.colIdSanitised=(0,i.YR0)(this.uniqueId)}getParent(){return this.parent}getUniqueId(){return this.uniqueId}isEmptyGroup(){return!this.displayedChildren?.length}isMoving(){return!0===At(this.providedColumnGroup)}checkLeft(){const e=this.displayedChildren;let t=null;if(e)for(let s=0,i=e.length;s<i;++s){const i=e[s];Ft(i)&&i.checkLeft();const o=i.left;null!=o&&(null==t||o<t)&&(t=o)}this.setLeft(t)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumnGroup(this,e)||this.getColGroupDef()?.headerName||this.getGroupId()}getPartId(){return this.partId}getActualWidth(){let e=0;const t=this.displayedChildren;if(t)for(let s=0,i=t.length;s<i;++s)e+=t[s].getActualWidth();return e}isResizable(){const e=this.displayedChildren;if(e)for(let t=0,s=e.length;t<s;++t)if(e[t].isResizable())return!0;return!1}getMinWidth(){const e=this.displayedChildren;if(!e)return 0;let t=0;for(let s=0,i=e.length;s<i;++s)t+=e[s].getMinWidth();return t}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}get ariaColIndex(){return Tt(this,!1,!1)?.ariaColIndex??0}getDefinition(){return this.providedColumnGroup.colGroupDef}getColGroupDef(){return this.providedColumnGroup.colGroupDef}isPadding(){return this.providedColumnGroup.padding}isExpandable(){return this.providedColumnGroup.expandable}isExpanded(){return!!this.providedColumnGroup.expanded}isAutoHeaderHeight(){return!!this.providedColumnGroup.colGroupDef?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return e!==this.autoHeaderHeight&&(this.autoHeaderHeight=e,!0)}addDisplayedLeafColumns(e){const t=this.displayedChildren;if(t)for(let s=0,i=t.length;s<i;++s){const i=t[s];i.isColumn?e.push(i):Ft(i)&&i.addDisplayedLeafColumns(e)}}addLeafColumns(e){const t=this.children;if(t)for(let s=0,i=t.length;s<i;++s){const i=t[s];i.isColumn?e.push(i):Ft(i)&&i.addLeafColumns(e)}}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let e=0,t=this;for(;t?.providedColumnGroup.padding&&t.parent?.providedColumnGroup.padding;)++e,t=t.parent;return e}},Tt=(e,t,s)=>{const i=t?e.displayedChildren:e.children;if(i)for(let e=0,o=i.length;e<o;++e){const n=i[s?o-1-e:e];if(n.isColumn)return n;const r=Tt(n,t,s);if(r)return r}return null},At=e=>{let t=!1;const s=e.children;for(let e=0,i=s.length;e<i;++e){const i=s[e];if(i.isColumn){if(t=!0,!i.moving)return!1;continue}const o=At(i);if(!1===o)return!1;!0===o&&(t=!0)}return t||null},Mt=(e,t)=>{let s=e.parent;if(s){let e=s.getPaddingLevel();for(;s&&s.providedColumnGroup.level+e>t;)s=s.parent,e=e>0?e-1:0}return s},Nt="ROOT_NODE_ID",Lt="rowGroupFooter_",Vt=Lt+Nt;function _t(e){return"object"==typeof e&&!!e.component}function Ot(e,t,s,i){const{name:o}=s;let n,r,a,l,c,d;if(t){const s=t,u=s[o+"Selector"],h=u?u(i):null,p=t=>{"string"==typeof t?n=t:null!=t&&!0!==t&&(e.isFrameworkComponent(t)?a=t:r=t)};h?(p(h.component),l=h.params,c=h.popup,d=h.popupPosition):p(s[o])}return{compName:n,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:d}}var Bt={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},Ht={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"],requiresBlockWrapper:!0},Gt={name:"headerComponent",optionalMethods:["refresh"]},zt={name:"innerHeaderComponent"},Wt={name:"innerHeaderGroupComponent"},jt={name:"headerGroupComponent"},Ut={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],supportsJsFunction:!0},$t={name:"loadingCellRenderer",supportsJsFunction:!0},Yt={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh","getValidationErrors","getValidationElement"]},Kt={name:"tooltipComponent",requiresBlockWrapper:!0},qt={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Zt={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},Qt={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],supportsJsFunction:!0},Jt={name:"loadingCellRenderer",supportsJsFunction:!0},Xt={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],supportsJsFunction:!0},es={name:"detailCellRenderer",optionalMethods:["refresh"],supportsJsFunction:!0};function ts(e,t,s){return e.getCompDetails(t,Ut,void 0,s)}function ss(e,t,s){return e.getCompDetails(t,$t,"agSkeletonCellRenderer",s,!0)}function is(e,t,s){return e.getCompDetails(t,Yt,"agCellEditor",s,!0)}function os(e,t){return Ot(e,t,qt)}function ns(e,t,s){return e.mergeParams(t,qt,s)}function rs(e){return!!e.operator}var as=class extends a{},ls=class extends l{},cs="__ag_Grid_Stop_Propagation";function ds(e){e[cs]=!0}function us(e){return!0===e[cs]}var hs={isStopPropagation:us,stopPropagation:ds},ps=class extends c{constructor(e,t){super(e,hs,t)}},gs={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,minDateInclusiveValidation:e=>`Date must be on or after ${e[0]}`,maxDateInclusiveValidation:e=>`Date must be on or before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`,minValueValidation:e=>`Must be greater than or equal to ${e[0]}`,maxValueValidation:e=>`Must be less than or equal to ${e[0]}`};function fs(e){return(0,i.Oxm)(gs,e)}function ms(e,t){return null==t?"":fs(t)?vs(e,t):e.getLocaleTextFunc()(t,t)}function vs(e,t,s){return(0,i.O65)(e,gs,t,s)}function ws(e,t,s){const{debounceMs:i}=t;return Cs(t)?(null!=i&&e.warn(71),0):i??s}function Cs(e){return(e.buttons?.indexOf("apply")??-1)>=0}function ys(e,t,s){const i=t.getCustomOption(s);return i?e.getLocaleTextFunc()(i.displayKey,i.displayName):ms(e,s)}function bs(e,t,s,i,o){let n=vs(e,s);return"function"==typeof t?n=t({filterOptionKey:i,filterOption:ys(e,o,i),placeholder:n}):"string"==typeof t&&(n=t),n}var Ss=class extends ls{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new ps(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new as(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then((()=>this.updateUiVisibility()))}areStatesEqual(e,t){return e===t}refresh(e){const t=e,s=this.params;this.params=t;const{source:i,state:o,additionalEventAttributes:n}=t;"colDef"===i&&this.updateParams(t,s);const r=this.state;this.state=o;const a=n?.fromAction;return(a&&"apply"!==a||o.model!==r.model||!this.areStatesEqual(o.state,r.state))&&this.setModelIntoUi(o.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=Cs(e),this.setupApplyDebounced()}doesFilterPass(e){this.beans.log.warn(283);const{getHandler:t,model:s,column:i}=this.params;return t().doesFilterPass({...e,model:s,handlerParams:this.beans.colFilter.getHandlerParams(i)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return this.beans.log.warn(284),null!=this.params.model}setupApplyDebounced(){const e=ws(this.beans.log,this.params,this.defaultDebounceMs),t=(0,i.pkA)(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return this.beans.log.warn(285),this.params.model}setModel(e,t){t||this.beans.log.warn(286);const{beans:s,params:i}=this;return s.colFilter.setModelForColumnLegacy(i.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:s=!0,model:i}}=this;if(!s)return!1;const o=!this.areModelsEqual(t.model,i);return o&&t.onAction("apply",e),o}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const s=this.getModelFromUi(),i={model:s,state:this.getState(),valid:this.canApply(s)};this.state=i;const{params:o,gos:n,eventSvc:r,applyActive:a}=this;o.onStateChange(i),o.onUiChange(this.getUiChangeEventParams()),n.get("enableFilterHandlers")||r.dispatchEvent({type:"filterModified",column:o.column,filterInstance:this}),i.valid&&(e??(e=a?void 0:"debounce"),"immediately"===e?(this.debouncePending=!1,this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1})):"debounce"===e&&this.applyDebounced())}onUiCleared(){this.onUiChanged(this.applyActive?"prevent":"immediately")}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:s}=this;if(!t)return;const i="floatingFilter"===e||"columnFilter"===e;i?(t.restoreLastSize(),t.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(i)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return vs(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&this.areNonNullModelsEqual(e,t)}},xs=class extends d{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange((()=>e.validate()))}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function Rs(e){const t=e.rowModel;return"clientSide"===t.getType()?t:void 0}function Ps(e){const t=e.rowModel;return"infinite"===t.getType()?t:void 0}var Es="row-group-",Is="t-",ks="b-",Fs=0,Ds=class{constructor(e){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=Fs++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return void 0!==e?e:this.footer?this.sibling?.groupData??null:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling||this;if(e.rowPinned){const t=e.pinnedSibling;t&&(e=t,e.footer&&(e=e.sibling??e))}return e}get allLeafChildren(){const e=this._leafs;return void 0===e?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):-1===this.level||!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,"set")}updateData(e){this.setDataCommon(e,"update")}_updateDataNoSibling(e){this.setDataCommon(e,"updateNoSibling")}setDataCommon(e,t){const{valueCache:s,eventSvc:i}=this.beans,o=this.data,n="set"!==t;this.data=e,s?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const r=this.createDataChangedEvent(e,o,n);if(this.__localEventService?.dispatchEvent(r),"updateNoSibling"!==t){const t=this.sibling;if(t){t.data=e;const s=t.createDataChangedEvent(e,o,n);t.__localEventService?.dispatchEvent(s)}}i.dispatchEvent({type:"rowNodeDataChanged",node:this});const a=this.pinnedSibling;a&&(a.data=e,a.__localEventService?.dispatchEvent(a.createDataChangedEvent(e,o,n)),i.dispatchEvent({type:"rowNodeDataChanged",node:a}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,s){return{type:"dataChanged",node:this,oldData:t,newData:e,update:s}}getRowIndexString(){return null==this.rowIndex?(this.beans.log.error(13),null):"top"===this.rowPinned?Is+this.rowIndex:"bottom"===this.rowPinned?ks+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const s=this.beans.selectionSvc,i=s?.createDaemonNode?.(this),o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),s?.syncInRowNode(this,i);const n=this.__localEventService;if(n){const t=this.createDataChangedEvent(e,o,!1);n.dispatchEvent(t)}}setId(e){const t=this.beans,s=ne(t);if(!s)return void(this.id=e);const i=this.data;if(null==i)return void(this.id=void 0);const o=this.parent?.getRoute()??[],n=s({data:i,parentKeys:o.length>0?o:void 0,level:this.level,rowPinned:this.rowPinned});this.id=n,n.startsWith(Es)?t.log.error(14,{groupPrefix:Es}):n===Nt&&t.log.error(331,{rowId:n})}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=null!==e;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,s){this.beans.expansionSvc?.setExpanded(this,e,t,s)}setDataValue(e,t,s){const{colModel:i,valueSvc:o,gos:n,editSvc:r}=this.beans;if(null==e)return!1;let a=i.getCol(e);if(!a)return!1;a=nt(a,this);const l=o.getDisplayValue(a,this,"data",!1);if(n.get("readOnlyEdit")){const{beans:{eventSvc:e},data:i,rowIndex:o,rowPinned:n}=this;return e.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:o,rowPinned:n,column:a,colDef:a.colDef,data:i,node:this,oldValue:l,newValue:t,value:t,source:s}),!1}if("data"!==s&&r&&!r.committing){const e=r.setDataValue({rowNode:this,column:a},t,s);if(null!=e)return e}const c=o.setValue(this,a,t,s);return this.dispatchCellChangedEvent(a,t,l),c&&this.pinnedSibling?.dispatchCellChangedEvent(a,t,l),c}getDataValue(e,t){const s=this.beans,i=s.colModel.getCol(e);if(!i)return;let o;if("data"!==t&&t){if("transformed"===t)return s.valueSvc.getTransformedValue(nt(i,this),this);const e="data-raw"===t,n=e||"value"===t?"data":t;if(o=s.valueSvc.getValue(nt(i,this),this,n,e),e||null==o)return o;if("object"==typeof o&&i.aggFunc){if("function"==typeof o.toNumber)return o.toNumber();if("value"in o)return o.value}if("value"!==t)return o}else if(o=s.valueSvc.getValueFromData(nt(i,this),this,!1),null==o)return o;if(i.allowFormula){const e=s.formula;e?.isFormula(o)&&(o=e.resolveValue(i,this))}return o}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,s){const i={type:"cellChanged",node:this,column:e,newValue:t,oldValue:s};this.__localEventService?.dispatchEvent(i)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer){const e=this.sibling;return!!e&&e.isSelected()}const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let s=0,i=t.length;s<i;++s)t[s].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){const s=this.beans;return s.aggChildrenSvc?.getAggregatedChildren(this,s.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,s="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:s})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new i.$UK)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);const s=this.__localEventService??(this.__localEventService=new i.$UK);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,s);const o=this.frameworkEventListenerService?.wrap(e,t)??t;s.addEventListener(e,o)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,s)}removeLocalListener(e,t){const s=this.__localEventService;s&&(s.removeEventListener(e,t),s.noRegisteredListenersExist()&&(this.__localEventService=null))}isFullWidthCell(){if(this.beans.log.warn(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(-1===this.level)return[];if(null==this.key)return;const e=[];let t=this;for(;null!=t?.key;)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}getFirstChild(){const e=this.childStore;return e?e.getFirstNode():this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;const t=this.beans;t.editSvc?.releaseRowEdits(this);const s=this.pinnedSibling;if(s?.rowPinned&&t.pinnedRowModel?.pinRow(s,null),!0===e?this.clearRowTopAndRowIndex():!1===e?(this.setRowTop(null),this.setRowIndex(null)):(this.oldRowTop=null,this.rowTop=null,this.rowIndex=null,this.displayed=!1),!this.footer){const t=this.detailNode;t&&t._destroy(e);const s=this.sibling;s&&s._destroy(e)}return!0}};function Ts(e,t,s){return xe(t,{type:s,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var As=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","destroyed","groupValue","oldRowTop","pinnedSibling","rowPinned","sticky","treeNodeFlags","treeParent"]),Ms=(e,t,s)=>{if(!s)return;let i=s.rowIndex;if(null==i)return;i+=t;const o=e.getRowCount();for(;i>=0&&i<o;){const s=e.getRow(i);if(!s||!s.footer&&!s.detail)return s;i+=t}},Ns=e=>{let t=e;for(;t;)if(t.footer)t=t.sibling??t.parent;else{if(null!=t.rowIndex&&!t.detail&&t.parent)return t;t=t.parent}return null},Ls=class{constructor(e,t){this.beans=e,this.floating=t,this.all=new Set,this.visible=new Set,this.order=[],this.queued=new Set}size(){return this.visible.size}add(e){const{all:t,visible:s,order:i}=this;t.has(e)||(t.add(e),s.add(e),i.push(e),this.sort())}delete(e){this.beans.editSvc?.releaseRowEdits(e),this.all.delete(e),this.visible.delete(e),this.queued.delete(e.id),(0,i.$ii)(this.order,e)}has(e){return this.visible.has(e)}forEach(e){this.order.forEach(e)}getByIndex(e){return this.order[e]}getById(e){for(const t of this.visible)if(t.id==e)return t}clear(){const{all:e,visible:t,order:s,queued:i}=this;e.clear(),i.clear(),t.clear(),s.length=0}sort(){const{sortSvc:e,rowNodeSorter:t,gos:s}=this.beans,i=e?.getSortOptions()??[],o=this.order,n=function(e){const t=e.findIndex(Os);if(t>-1)return e.splice(t,1)?.[0]}(o);if(o.sort(((e,s)=>t?.compareRowNodes(i,e,s)||(e.pinnedSibling?.rowIndex??0)-(s.pinnedSibling?.rowIndex??0))),!n)return;const r=se(s);"bottom"===r||"pinnedBottom"===r?this.order.push(n):this.order.unshift(n)}hide(e){const{all:t,visible:s}=this,i=s.size;return t.forEach((t=>e(t)?s.delete(t):s.add(t))),this.order=Array.from(s),this.sort(),i!=s.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function Vs(e){if(-1===e.level)return!0;const t=e.parent;return!!t?.childrenAfterSort?.some((t=>t==e))&&Vs(t)}function _s(e,t){const{gos:s,rowModel:i,filterManager:o}=e;return z(s)?!i.getRowNode(t.id):o?.isAnyFilterPresent()?!Vs(t):!!s.get("pivotMode")&&!t.group}function Os(e){return!!e.pinnedSibling&&function(e){return!!e.footer&&-1===e.level}(e.pinnedSibling)}var Bs=class extends ke{constructor(){super(...arguments),this.csrm=null,this.ssrm=!1}postConstruct(){const{gos:e,beans:t}=this;this.top=new Ls(t,"top"),this.bottom=new Ls(t,"bottom"),this.csrm=Rs(t)??null,this.ssrm="serverSide"===t.rowModel.getType();const s=e=>_s(t,e.pinnedSibling),i=()=>{const s=e.get("isRowPinned");s&&e.get("enableRowPinning")&&t.rowModel.forEachNode((e=>this.pinRow(e,s(e))),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};K(this,(()=>this.estimateRowHeights())),this.addManagedEventListeners({modelUpdated:({keepRenderedRows:e})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let t=!1;this.forContainers((e=>{t||(t=e.hide(s))}));const i=this.refreshRowPositions();(!e||i||t)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(zs),this.refreshRowPositions()},rowNodeDataChanged:({node:t})=>{const s=e.get("isRowPinnable");(s?.(t)??1)||this.pinRow(t,null)},firstDataRendered:i}),this.addManagedPropertyListener("pivotMode",(()=>{this.forContainers((e=>e.hide(s))),this.dispatchRowPinnedEvents()})),this.addManagedPropertyListener("grandTotalRow",(({currentValue:e})=>{this._grandTotalPinned=function(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}(e)})),this.addManagedPropertyListener("isRowPinned",i)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers((t=>{const s=[];let i;t.forEach((t=>{e&&Os(t)?i=t:s.push(t)})),s.forEach((e=>this.pinRow(e,null))),t.clear(),i&&t.add(i)})),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,s){if(null!=t&&e.destroyed)return;if(e.footer){const s=e.level;if(s>-1)return;const i=null==t&&null!=e.rowPinned;if(-1===s&&!i){this._grandTotalPinned=t;const e=this.csrm;return void(e?e.reMapRows():this.ssrm&&this.pinGrandTotalRow())}}const i=e.rowPinned??e.pinnedSibling?.rowPinned;if(null!=i&&null!=t&&t!=i){const i=e.rowPinned?e:e.pinnedSibling,o=e.rowPinned?e.pinnedSibling:e;return this.pinRow(i,null,s),void this.pinRow(o,t,s)}const o=s&&function(e,t,s){const{rowSpanSvc:i}=e,o=(s&&i?.isCellSpanning(s,t))??!1;if(s&&o)return i?.getCellSpan(s,t)?.spannedNodes}(this.beans,e,s);if(o)o.forEach((e=>this.pinRow(e,t)));else if(null==t){const s=e.rowPinned?e:e.pinnedSibling,i=this.findPinnedRowNode(s);if(!i)return;i.delete(s);const o=s.pinnedSibling;Gs(s),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(o)}else{const s=Hs(this.beans,e,t),i=this.getContainer(t);i.add(s),_s(this.beans,e)&&i.hide((e=>_s(this.beans,e.pinnedSibling))),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return 0===this.getContainer(e).size()}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const s=s=>{if(s.rowHeightEstimated){const i=Y(this.beans,s);s.setRowTop(t),s.setRowHeight(i.height),t+=i.height,e=!0}};return this.bottom.forEach(s),t=0,this.top.forEach(s),e&&this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return Ws(this.top)}getPinnedBottomTotalHeight(){return Ws(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=e=>{const t=[];return this.forEachPinnedRow(e,(e=>{if(Os(e))return;const s=e.pinnedSibling?.id;null!=s&&t.push(s)})),t};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers(((t,s)=>{for(const i of e[s]){const e=this.beans.rowModel.getRowNode(i);e?this.pinRow(e,s):t.queue(i)}}))}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers(((e,t)=>{const s=new Set;e.forEachQueued((e=>{const t=this.beans.rowModel.getRowNode(e);t&&s.add(t)}));for(const i of s)e.unqueue(i.id),this.pinRow(i,t)}))}pinGrandTotalRow(){const{beans:e,_grandTotalPinned:t}=this,s=this.csrm||this.ssrm?e.rowModel.rootNode?.sibling:void 0;if(!s)return;const i=s.pinnedSibling,o=i&&this.findPinnedRowNode(i);if(t){if(o&&o.floating!==t&&(Gs(i),o.delete(i)),o?.floating!==t){const i=Hs(e,s,t);this.getContainer(t).add(i)}}else{if(!o)return;Gs(i),o.delete(i)}}estimateRowHeights(){this.forContainers((e=>e.forEach((e=>e.setRowHeight(e.rowHeight,!0)))))}getContainer(e){return"top"===e?this.top:this.bottom}findPinnedRowNode(e){return this.top.has(e)?this.top:this.bottom.has(e)?this.bottom:void 0}refreshRowPositions(e){const t=e=>function(e,t){let s=0,i=!1;return t.forEach(((t,o)=>{if(i||(i=t.rowTop!==s),t.setRowTop(s),t.rowHeightEstimated||null==t.rowHeight){const s=Y(e,t).height;i||(i=t.rowHeight!==s),t.setRowHeight(s)}t.setRowIndex(o),s+=t.rowHeight})),i}(this.beans,e);if(e)return t(this.getContainer(e));let s=!1;return this.forContainers((e=>{const i=t(e);s||(s=i)})),s}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function Hs(e,t,s){if(t.pinnedSibling)return t.pinnedSibling;const i=((e,t)=>{const s=new Ds(t);for(const t of Object.keys(e))As.has(t)||(s[t]=e[t]);return s.oldRowTop=null,s})(t,e);i.setRowTop(null),i.setRowIndex(null),i.rowPinned=s;const o="top"===s?Is:ks;return i.id=`${o}${s}-${t.id}`,i.pinnedSibling=t,t.pinnedSibling=i,i}function Gs(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function zs(e){const t=new Set;e.forEach((e=>{e.group&&t.add(e)})),t.forEach((t=>e.delete(t)))}function Ws(e){const t=e.size();if(0===t)return 0;const s=e.getByIndex(t-1);return void 0===s?0:s.rowTop+s.rowHeight}var js=class extends ke{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",(e=>this.setPinnedRowData(e.currentValue,"top"))),this.addManagedPropertyListener("pinnedBottomRowData",(e=>this.setPinnedRowData(e.currentValue,"bottom"))),K(this,(()=>this.estimateRowHeights()))}reset(){}isEmpty(e){return 0===this.getCache(e).order.length}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}estimateRowHeights(){const e=e=>{e.setRowHeight(e.rowHeight,!0)};Ks(this.pinnedBottomRows,e),Ks(this.pinnedTopRows,e)}ensureRowHeightsValid(){let e=!1,t=0;const s=s=>{s.rowHeightEstimated&&(s.setRowHeight(Y(this.beans,s).height),e=!0),s.rowTop!==t&&(s.setRowTop(t),e=!0),t+=s.rowHeight};return Ks(this.pinnedBottomRows,s),t=0,Ks(this.pinnedTopRows,s),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const s=this.getCache(t);if(void 0===e)return s.order.length=0,void(s.cache={});const i=ne(this.beans),o="top"===t?Is:ks,n=new Set(s.order),r=[],a=new Set;let l=0,c=-1;for(const d of e){const e=i?.({data:d,level:0,rowPinned:t})??o+this.nextId++;if(a.has(e)){this.warn(96,{id:e,data:d});continue}c++,a.add(e),r.push(e);const u=$s(s,e);if(void 0!==u)u.data!==d&&u.updateData(d),l+=this.setRowTopAndRowIndex(u,l,c),n.delete(e);else{const i=new Ds(this.beans);i.id=e,i.data=d,i.rowPinned=t,l+=this.setRowTopAndRowIndex(i,l,c),s.cache[e]=i,s.order.push(e)}}for(const e of n)$s(s,e)?.clearRowTopAndRowIndex(),delete s.cache[e];s.order=r}setRowTopAndRowIndex(e,t,s){return e.setRowTop(t),e.setRowHeight(Y(this.beans,e).height),e.setRowIndex(s),e.rowHeight}getPinnedTopTotalHeight(){return Us(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return Us(this.pinnedBottomRows)}getPinnedTopRowCount(){return qs(this.pinnedTopRows)}getPinnedBottomRowCount(){return qs(this.pinnedBottomRows)}getPinnedTopRow(e){return Ys(this.pinnedTopRows,e)}getPinnedBottomRow(e){return Ys(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return $s(this.getCache(t),e)}forEachPinnedRow(e,t){return Ks(this.getCache(e),t)}getCache(e){return"top"===e?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function Us(e){const t=qs(e);if(0===t)return 0;const s=Ys(e,t-1);return void 0===s?0:s.rowTop+s.rowHeight}function $s(e,t){return e.cache[t]}function Ys(e,t){return $s(e,e.order[t])}function Ks(e,t){e.order.forEach(((s,i)=>{const o=$s(e,s);o&&t(o,i)}))}function qs(e){return e.order.length}var Zs=i.WOR?0:550,Qs="__ag_Grid_Touch_Listener_State",Js=e=>{const t=e;return t[Qs]??(t[Qs]={})},Xs=(e,t)=>{const s=Js(e);let i=s.handledEvents;if(i){if(i.has(t))return!1}else i=new Set,s.handledEvents=i;return i.add(t),!0},ei=class{constructor(e,t){this.eElement=e,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1,this.longTapFired=!1,this.longTapTargetResolved=!1,this.touchStartEvent=null,this.listenerCounts={tap:0,doubleTap:0,longTap:0};const s="boolean"==typeof t?{preventClick:t}:t;this.preventClick=s?.preventClick??!1,this.capture=s?.capture??!1,this.yieldsLongTap=s?.yieldsLongTap??!1,this.shouldHandleLongTap=s?.shouldHandleLongTap,this.onLongTapDetected=s?.onLongTapDetected,this.shouldTrackTouch=s?.shouldTrackTouch,this.getLongTapTarget=s?.getLongTapTarget}addEventListener(e,t){let s=this.eventSvc;if(!s){if(null===s)return;this.eventSvc=s=new i.$UK;const e=this.onTouchStart.bind(this);this.startListener=e,this.eElement.addEventListener("touchstart",e,{passive:!0,capture:this.capture})}s.addEventListener(e,t),this.listenerCounts[e]++}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t),this.listenerCounts[e]--}onTouchStart(e){if(this.touchStart||!1===this.shouldTrackTouch?.(e)||!this.capture&&!(e=>{const t=Js(e);return!t.touchStartClaimed&&(t.touchStartClaimed=!0,!0)})(e))return;const t=e.touches[0];this.touchStart=t,this.touchStartEvent=e,this.registerLongTapCandidate(e);const s=this.handlers;if(!s.length){const e=this.eElement,t=e.ownerDocument??e,o=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this),r=this.onTouchCancel.bind(this),a=this.onContextMenu.bind(this),l={passive:!0},c={passive:!1};(0,i.v4T)(s,[e,"touchmove",o,l],[t,"touchcancel",r,l],[t,"touchend",n,c],[t,"contextmenu",a,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout((()=>{if(this.longPressTimer=0,this.touchStart===t&&!this.moved){const s=this.isLongTapOwner(e,t)&&Xs(e,"longTap");this.moved=!0,this.longTapFired=s||!!this.onLongTapDetected;const i={type:"longTap",touchStart:t,touchEvent:e};this.onLongTapDetected?.(i),s&&this.eventSvc?.dispatchEvent(i)}}),Zs)}onTouchMove(e){const{moved:t,touchStart:s}=this;if(!t&&s){const t=(0,i.ZoY)(s,e.touches);t&&!(0,i.dPS)(t,s,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;if(!t||!(0,i.ZoY)(t,e.changedTouches))return;const s=!!this.touchStartEvent&&Js(this.touchStartEvent).handledEvents?.has("longTap");this.moved||s||(this.listenerCounts.tap>0&&Xs(e,"tap")&&this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t,e)),(this.preventClick||this.longTapFired)&&(0,i._oU)(e),this.cancel()}onTouchCancel(e){const t=this.touchStart;t&&(0,i.ZoY)(t,e.changedTouches)&&(this.lastTapTime=null,this.cancel())}onContextMenu(e){this.resolveLongTapTarget()&&this.canHandleLongTap()&&(0,i._oU)(e)}canHandleLongTap(){return this.longTapEligible??(this.longTapEligible=this.shouldHandleLongTap?.()??!0)}registerLongTapCandidate(e){if(0===this.listenerCounts.longTap)return;const t=Js(e),s=t.longTapCandidates;s?s.push(this):t.longTapCandidates=[this]}isLongTapOwner(e,t){const s=Js(e).longTapCandidates;let i;for(const e of s??[])if(e.canOwnLongTap(t))if(i)if(i.yieldsLongTap!==e.yieldsLongTap)i.yieldsLongTap&&(i=e);else{const t=i.resolveLongTapTarget(),s=e.resolveLongTapTarget();t!==s&&t.contains(s)&&(i=e)}else i=e;return i===this}canOwnLongTap(e){return this.touchStart?.identifier===e.identifier&&!this.moved&&this.listenerCounts.longTap>0&&!!this.resolveLongTapTarget()&&this.canHandleLongTap()}resolveLongTapTarget(){if(!this.longTapTargetResolved){this.longTapTargetResolved=!0;const e=this.touchStart,t=this.touchStartEvent;this.longTapTarget=e&&t&&this.getLongTapTarget?this.getLongTapTarget(t,e):this.eElement instanceof Element?this.eElement:void 0}return this.longTapTarget}checkDoubleTap(e,t){let s=Date.now();const i=this.lastTapTime;i&&s-i<=500&&this.listenerCounts.doubleTap>0&&Xs(t,"doubleTap")&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),s=null),this.lastTapTime=s}cancel(){this.clearLongPress(),(0,i.Pfo)(this.handlers),this.touchStart=null,this.touchStartEvent=null}clearLongPress(){0!==this.longPressTimer&&(window.clearTimeout(this.longPressTimer),this.longPressTimer=0),this.moved=!1,this.longTapFired=!1,this.longTapEligible=void 0,this.longTapTarget=void 0,this.longTapTargetResolved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e,this.capture)),this.cancel(),this.eElement=null,this.eventSvc=null}};function ti(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var si=Object.fromEntries(["log","licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","pageBoundsListener","rowSpanSvc","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"].map(((e,t)=>[e,t])));function ii(e,t){return((e.beanName?si[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?si[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function oi(e,t){return"gridDestroySvc"===e?.beanName?-1:"gridDestroySvc"===t?.beanName?1:0}function ni(e){return(0,i.Agl)(e)}function ri(e,t){const s=e.column===t.column,i=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return s&&i&&o}function ai(e){let t,s=0;const{pinnedRowModel:i,rowModel:o,pageBounds:n}=e;return i?.getPinnedTopRowCount()?t="top":o.getRowCount()?(t=null,s=n.getFirstRow()):i?.getPinnedBottomRowCount()&&(t="bottom"),void 0===t?null:{rowIndex:s,rowPinned:t}}function li(e){let t,s=null;const{pinnedRowModel:i,pageBounds:o}=e,n=i?.getPinnedBottomRowCount(),r=i?.getPinnedTopRowCount();return n?(s="bottom",t=n-1):e.rowModel.getRowCount()?t=o.getLastRow():r&&(s="top",t=r-1),void 0===t?null:{rowIndex:t,rowPinned:s}}function ci(e,t){switch(t.rowPinned){case"top":return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex);case"bottom":return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex);default:return e.rowModel.getRow(t.rowIndex)}}function di(e,t){const s=e.spannedRowRenderer?.getCellByPosition(t);if(s)return s;const i=e.rowRenderer.getRowByPosition(t);return i?i.getCellCtrl(t.column):null}function ui(e,t,s=!1){const{rowIndex:i,rowPinned:o}=t,{pageBounds:n,pinnedRowModel:r,rowModel:a}=e;return 0===i?"top"===o?null:"bottom"===o&&a.isRowsToRender()?{rowIndex:n.getLastRow(),rowPinned:null}:r?.isRowsToRender("top")?{rowIndex:r.getPinnedTopRowCount()-1,rowPinned:"top"}:null:s?gi(e,o?void 0:a.getRow(i),!0)??{rowIndex:i-1,rowPinned:o}:{rowIndex:i-1,rowPinned:o}}function hi(e,t){const{pinnedRowModel:s,rowModel:i}=e,o=s?.getPinnedTopRowCount()??0,n=i.getRowCount(),{rowPinned:r,rowIndex:a}=t;return"top"===r?a:"bottom"===r?o+n+a:o+a}function pi(e,t,s=!1){const{rowIndex:i,rowPinned:o}=t,{pageBounds:n,pinnedRowModel:r,rowModel:a}=e;return function(e,t){const{rowPinned:s,rowIndex:i}=t,{pinnedRowModel:o,pageBounds:n}=e;if("top"===s)return(o?.getPinnedTopRowCount()??0)-1<=i;if("bottom"===s)return(o?.getPinnedBottomRowCount()??0)-1<=i;return n.getLastRow()<=i}(e,t)?"bottom"===o?null:"top"===o&&a.isRowsToRender()?{rowIndex:n.getFirstRow(),rowPinned:null}:r?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null:s?gi(e,o?void 0:a.getRow(i))??{rowIndex:i+1,rowPinned:o}:{rowIndex:i+1,rowPinned:o}}function gi(e,t,s=!1){const{gos:i,rowRenderer:o}=e;if(!t?.sticky||!X(i))return;const n=o.getStickyTopRowCtrls(),r=o.getStickyBottomRowCtrls(),a=!r.some((e=>e.rowNode.rowIndex===t.rowIndex)),l=a?n:r,c=(s?-1:1)*(a?-1:1);let d;for(let e=0;e<l.length;e++)if(l[e].rowNode.rowIndex===t.rowIndex){d=l[e+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function fi(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function mi(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function vi(e,t,s="auto"){const i=e.ctrlsSvc.get("gridCtrl"),o=i.focusNextInnerContainer(t);return!0===o||(!1===o?o:"direct"===s?i.focusNextElementOutsideContainer(t):(("force"===s||!t&&!i.isDetailGrid()&&i.isFocusInsideGridBody())&&i.forceFocusOutOfContainer(t),!1))}function wi(e,t){const s=e.getFocusableContainerName();return"gridBody"===s?t():Ci(e,(()=>(0,i.YE1)(e.getGui(),".ag-tab-guard").length>0))?s:null}function Ci(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var yi="__ag_Grid_Skip_Focusable_Container";function bi(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Si(e){const{ctrlsSvc:t,colModel:s,filterManager:i}=e,o=t.getHeaderRowContainerCtrl()?.getRowCount(),n=Math.max(function(e){return e.ready?e.colsTreeDepth+1:-1}(s),0)+(i?.hasFloatingFilters()?1:0);return(o??n)+(i?.getHeaderRowCount()??0)}function xi(e){const t=[],s=e.ctrlsSvc.getHeaderRowContainerCtrl();if(!s)return t;const i=s.getGroupRowCount()||0;for(let o=0;o<i;o++){const i=s.getGroupRowCtrlAtIndex(o),n=t[o];if(i){const s=Ri(e,i);(null==n||s>n)&&(t[o]=s)}}return t}function Ri(e,t){const s=e.colModel.pivotMode?function(e){return e.gos.get("pivotGroupHeaderHeight")??ki(e)}(e):ki(e);let i=s;const o=t.getHeaderCellCtrls();for(const e of o){const{column:t}=e,s=t.autoHeaderHeight;null!=s&&s>i&&t.isAutoHeaderHeight()&&(i=s)}return i}function Pi(e){const t=e.colModel.pivotMode?function(e){return e.gos.get("pivotHeaderHeight")??Ei(e)}(e):Ei(e);let s=t;const i=e.colModel.getAllCols();for(let e=0,t=i.length;e<t;++e){const t=i[e],o=t.autoHeaderHeight;null!=o&&o>s&&t.isAutoHeaderHeight()&&(s=o)}return s}function Ei(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Ii(e){return e.gos.get("floatingFiltersHeight")??Ei(e)}function ki(e){return e.gos.get("groupHeaderHeight")??Ei(e)}function Fi(e,t){const s=e.getLeftStickyColumnContainerWidth(),i=e.bodyWidth,o=e.getRightStickyColumnContainerWidth();return t?{leftWidth:0,centerWidth:i+s+o,rightWidth:0}:{leftWidth:s,centerWidth:i,rightWidth:o}}function Di(e,t,s,i){const{ePinnedLeft:o,eScrolling:n,ePinnedRight:r}=s,{leftWidth:a,centerWidth:l,rightWidth:c}=Fi(e,t);i.pinnedLeftWidth!==a&&(o.style.width=a+"px",o.style.display=a>0||t?"":"none",i.pinnedLeftWidth=a),i.centerWidth!==l&&(n.style.width=l+"px",i.centerWidth=l),i.pinnedRightWidth!==c&&(r.style.width=c+"px",r.style.display=c>0||t?"":"none",i.pinnedRightWidth=c)}function Ti(e,t){return(e.column.getLeft()??0)-(t.column.getLeft()??0)}function Ai(e,t){const s=[],i=[],o=[];for(const n of e){const e=t(n);"left"===e?s.push(n):"right"===e?o.push(n):i.push(n)}return{left:s,center:i,right:o}}var Mi=class extends ke{constructor(){super(...arguments),this.headerRowFocusFeatures=[]}setComp(e,t,s){this.comp=e,this.eGui=t,this.eGridViewport=s;const{beans:i}=this,{touchSvc:o,ctrlsSvc:n}=i;this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,i),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,i)}),this.onPivotModeChanged(i),this.setupHeaderHeight();const r=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:r}),o?.mockHeaderContextMenu(this,r),n.register("gridHeaderCtrl",this)}setHeaderRowFocusableElements(e){if(this.headerRowFocusFeatures=this.destroyBeans(this.headerRowFocusFeatures),this.beans.headerNavigation)for(const t of e)this.headerRowFocusFeatures.push(this.createManagedBean(new ps(t,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})))}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>(0,i.Arb)(this.beans,(()=>e())),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const s=xi(e).reduce(((e,t)=>e+t),0),i=Pi(e);if(e.filterManager?.hasFloatingFilters()&&(t+=Ii(e)),t+=s,t+=i,this.headerHeightWithBorder!==t){this.headerHeightWithBorder=t;const s=t+e.environment.getHeaderRowBorderWidth();this.eGridViewport.style.setProperty("--ag-internal-header-rows-height",`${s}px`),this.eGui.style.height=`${s}px`}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.pivotMode;this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const t=e.visibleCols.allCols.some((e=>e.isSpanHeaderHeight()));this.comp.toggleCss("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),s=e.shiftKey,i=s!==t?"LEFT":"RIGHT",{beans:o}=this,{headerNavigation:n,focusSvc:r}=o;(n.navigateHorizontally(i,!0,e)||!s&&r.focusOverlay(!1)||vi(o,s,"force"))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:s}=this.beans;switch(e.key){case i.DDm.LEFT:t="LEFT";case i.DDm.RIGHT:(0,i.Qmv)(t)||(t="RIGHT"),s.navigateHorizontally(t,!1,e)&&e.preventDefault();break;case i.DDm.UP:t="UP";case i.DDm.DOWN:(0,i.Qmv)(t)||(t="DOWN"),s.navigateVertically(t,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:s,beans:o}=this;!t&&s.contains((0,i.UlD)(o))||t instanceof HTMLElement&&s.contains(t.closest(".ag-header-row"))||(o.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,s){const{menuSvc:i}=this.beans;if(!e&&!s||!i?.isHeaderContextMenuEnabled())return;const{target:o}=e??t;o instanceof Element&&!o.closest(".ag-header-cell, .ag-header-group-cell")&&i.showHeaderContextMenu(void 0,e,s)}},Ni=e=>{const t=e.colModel.colsAllGroups,s=t.length,i=e.colModel.groupHeaderNameOverrides,o=new Array(s);for(let e=0;e<s;++e){const s=t[e];o[e]={groupId:s.groupId,open:s.expanded,headerName:i.get(s.groupId)??null}}return o},Li=(e,t,s,i)=>{const o=Fe(t)?t.groupId:t||"";_i(e,[{groupId:o,open:s}],i)},Vi=(e,t)=>{const{groupId:s}=t,i=t.headerName??null;return(e.get(s)??null)!==i&&(null==i?e.delete(s):e.set(s,i),!0)},_i=(e,t,s)=>{const{colAnimation:i,visibleCols:o,eventSvc:n,colModel:r}=e,a=r.colsGroupsById,l=t.length;if(a.size&&l){i?.start();try{const e=r.groupHeaderNameOverrides;let i=null,c=null;for(let s=0;s<l;++s){const o=t[s],n=a.get(o.groupId);n&&(n.setExpanded(o.open)&&(i??(i=[]),i.push(n)),"headerName"in o&&Vi(e,o)&&(c??(c=[]),c.push(n)))}c&&n.dispatchEvent({type:"columnHeaderNameChanged",column:null,columns:null,columnGroup:1===c.length?c[0]:null,source:s}),i&&(o.refresh(s,!0),n.dispatchEvent({type:"columnGroupOpened",columnGroup:1===i.length?i[0]:void 0,columnGroups:i}))}finally{i?.finish()}}},Oi=class extends ke{};function Bi(e,t,s){return s&&e.addDestroyFunc((()=>t.destroyBean(s))),s??e}var Hi=class{constructor(){this.nextId=0,this.invalidatedUpTo=0}claim(){return this.invalidatedUpTo=this.nextId,this.provisionalClaim()}provisionalClaim(){const e=++this.nextId;return{isCurrent:()=>e>this.invalidatedUpTo}}supersede(){this.invalidatedUpTo=Math.max(this.invalidatedUpTo,this.nextId-1)}invalidate(){this.invalidatedUpTo=this.nextId}};function Gi(e){const{left:t,pinned:s,width:i,isPrintLayout:o,isRtl:n,visibleCols:r}=e;if(null==t||!o)return t;let a=t;if(n){let e;e="left"===s?r.getLeftStickyColumnContainerWidth():"right"===s?r.getRightStickyColumnContainerWidth():r.bodyWidth,a=e-t-i}if("left"===s)return a;const l=r.getLeftStickyColumnContainerWidth();return"right"===s?l+r.bodyWidth+a:l+a}function zi(e,t){const{offset:s,pinned:i,width:o,isPrintLayout:n,isRtl:r,visibleCols:a}=t;if(n||(r?"left"===i:"right"!==i))e.style.left=`${s}px`,e.style.right="";else{if(r)e.style.right=`${s}px`;else{const t=a.getRightStickyColumnContainerWidth();e.style.right=t-s-o+"px"}e.style.left=""}}var Wi=class extends ke{constructor(e,t,s){super(),this.columnOrGroup=e,this.eCell=t,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=s}getColumnOrGroup(){return this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),Ft(this.columnOrGroup)&&this.addManagedListeners(this.columnOrGroup,{displayedChildrenChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,s=e.get("suppressColumnMoveAnimation"),o=(0,i.Qmv)(this.columnOrGroup.getOldLeft());t?.isActive()&&o&&!s?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),{gos:t,visibleCols:s}=this.beans,i=t.get("enableRtl"),o=W(t,"print"),n=e.getActualWidth(),r=Gi({left:e.getOldLeft(),pinned:e.getPinned(),width:n,isPrintLayout:o,isRtl:i,visibleCols:s}),a=Gi({left:e.getLeft(),pinned:e.getPinned(),width:n,isPrintLayout:o,isRtl:i,visibleCols:s});this.setLeft(r),this.actualLeft=a,this.beans.colAnimation.executeNextVMTurn((()=>{this.actualLeft===a&&this.setLeft(a)}))}onLeftChanged(){const e=this.getColumnOrGroup(),{gos:t,visibleCols:s}=this.beans,i=e.getLeft();this.actualLeft=Gi({left:i,pinned:e.getPinned(),width:e.getActualWidth(),isPrintLayout:W(t,"print"),isRtl:t.get("enableRtl"),visibleCols:s}),this.setLeft(this.actualLeft)}setLeft(e){if((0,i.Qmv)(e)){const t=this.getColumnOrGroup();this.setHorizontalPosition(t,e)}if(Ft(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&(0,i.pp6)(this.ariaEl,e.length)}}setHorizontalPosition(e,t){const{gos:s,visibleCols:i}=this.beans;zi(this.eCell,{offset:t,pinned:e.getPinned(),width:e.getActualWidth(),isPrintLayout:W(s,"print"),isRtl:s.get("enableRtl"),visibleCols:i})}},ji="ag-column-header-edit-highlighted",Ui="ag-calculated-column",$i="ag-calculated-column-highlighted",Yi=[],Ki=[Ui],qi=[Ui,$i];function Zi(e,t){return null!=t&&e?.isCalculatedCol?t.isHighlightedColumn(e)?qi:Ki:Yi}function Qi(e,t,s,o){const n=Zi(s,t.calculatedColsSvc);return(0,i.MWY)(e)?n.length?[...n]:[]:[...n,...eo(e.headerClass,e,t.gos,s,o)]}function Ji(e,t,s){e.toggleCss("ag-column-first",s.isColAtEdge(t,"first")),e.toggleCss("ag-column-last",s.isColAtEdge(t,"last"))}function Xi(e,t,s){if(!s.length){if(t)for(const s of t)e.toggleCss(s,!1);return}if(!t){for(const t of s)e.toggleCss(t,!0);return new Set(s)}const i=t;for(const t of s)i.has(t)?i.delete(t):e.toggleCss(t,!0);for(const t of i)e.toggleCss(t,!1);return new Set(s)}function eo(e,t,s,o,n){if((0,i.MWY)(e))return[];let r;if("function"==typeof e){const i=function(e,t,s,i){return xe(t,{colDef:e,column:s,columnGroup:i})}(t,s,o,n);r=e(i)}else r=e;return"string"==typeof r?[r]:Array.isArray(r)?[...r]:[]}var to=0,so="headerCtrl",io=class extends ke{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+to++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,s,i,o){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,s,i,o),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:s}=this.beans.focusSvc.focusedHeader??{headerRowIndex:this.rowCtrl.rowIndex,column:this.column},o=s.getDefinition(),n=o?.suppressHeaderKeyboardEvent;return!!(0,i.Qmv)(n)&&!!n(xe(this.gos,{colDef:o,column:s,headerRowIndex:t,event:e}))}getWrapperHasFocus(){return(0,i.UlD)(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let s;s="function"==typeof t?t(this.getHeaderClassParams()):t,s&&this.comp.setUserStyles(s)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:s,compBean:o}=e,{beans:n}=this,r=e=>{if(!this.isAlive()||!o.isAlive())return;const{paddingTop:s,paddingBottom:a,borderBottomWidth:l,borderTopWidth:c}=(0,i.rqk)(this.eGui),d=s+a+l+c,u=t.offsetHeight+d;if(e<5){const s=(0,i.BxM)(n);if(!s?.contains(t)||0==u)return void(0,i.sK4)((()=>r(e+1)),"raf",n)}this.setColHeaderHeight(this.column,u)};let a,l=!1;const c=()=>{const e=this.column.isAutoHeaderHeight();e&&!l&&d(),!e&&l&&u()},d=()=>{l=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),r(0),a=(0,i.QSI)(this.beans,t,(()=>r(0)))},u=()=>{l=!1,a&&a(),this.comp.toggleCss("ag-header-cell-auto-height",!1),a=void 0,this.column.isAutoHeaderHeight()||this.setColHeaderHeight(this.column,null)};c(),o.addDestroyFunc((()=>u())),o.addManagedListeners(this.column,{widthChanged:()=>l&&r(0)}),o.addManagedEventListeners({sortChanged:()=>{l&&window.setTimeout((()=>r(0)))}}),s&&s(c)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:s,eGui:o}=this;e&&t&&o&&(Ji(e,t,s.visibleCols),(0,i.T$n)(o,t.ariaColIndex))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=fi(this.beans);this.eGui&&(0,i.GUt)(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=(0,i.UlD)(this.beans),s=e.key===i.DDm.LEFT||e.key===i.DDm.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&(0,i.ZL7)(e)===i.DDm.C)return this.beans.clipboardSvc?.copyToClipboard();if(!s)return;const o=e.key===i.DDm.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.column.getPinned(),this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:s}=this.beans;return s?s.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:s}=this;let o=e.key===i.DDm.LEFT!==t.get("enableRtl");const n=s.getPinned(),r=t.get("enableRtl");return n&&r!==("right"===n)&&(o=!o),(o?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout((()=>{this.resizeFeature?.toggleColumnResizing(!1)}),150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case i.DDm.SPACE:case i.DDm.PAGE_DOWN:case i.DDm.PAGE_UP:case i.DDm.PAGE_HOME:case i.DDm.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=so,{eGui:s,gos:i}=this;Q(i,s,t,this),e.addDestroyFunc((()=>Q(i,s,t,null)))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,s){const i=e??t,{menuSvc:o,gos:n}=this.beans;n.get("preventDefaultOnContextMenu")&&i.preventDefault(),o?.isHeaderContextMenuEnabled(s)&&o.showHeaderContextMenu(s,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:s}=this;e.isColumn?s.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):s.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},oo=class extends ke{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push((()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)}))}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",0===e)}};function no(e,t){t?e.style.setProperty("display","none"):e.style.removeProperty("display")}function ro(e,t){null==t?e.style.removeProperty("max-height"):e.style.setProperty("max-height",`${t}px`),e.classList.toggle("ag-header-cell-comp-wrapper-limited-height",null!=t)}var ao=class extends io{constructor(){super(...arguments),this.refreshFunctions={},this.ariaDescriptionProperties=new Map,this.componentTooltip={},this.headerCompGuard=new Hi}wireComp(e,t,s,o,n){this.comp=e;const{column:r,beans:a}=this,{colResize:l,context:c,colHover:d,rangeSvc:u}=a,h=Bi(this,c,n);this.setGui(t,h),this.updateState(),this.setupWidth(h),this.setupMovingCss(h),this.setupPinnedCss(h),this.setupMenuClass(h),this.setupSortableClass(h),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:o,checkMeasuringCallback:e=>this.setRefreshFunction("measuring",e),compBean:h}),this.addColumnHoverListener(h),this.setupFilterClass(h),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(h),this.setupSelectAll(h),this.setupUserComp(),this.refreshAria(),l?this.resizeFeature=h.createManagedBean(l.createResizeFeature(r,s,e,this)):(0,i.nl0)(s,!1),d?.createHoverFeature(h,[r],t),u?.createRangeHighlightFeature(h,r,e),h.createManagedBean(new Wi(r,t,a)),h.createManagedBean(new ps(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(h),h.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],(()=>this.refresh())),h.addManagedPropertyListener("cellSelection",(()=>this.refreshAria())),h.addManagedListeners(r,{colDefChanged:()=>this.refresh(),headerNameChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const p=()=>this.checkDisplayName(),g=r.getColId();if(h.addManagedEventListeners({columnValueChanged:p,columnRowGroupChanged:p,columnPivotChanged:p,headerHeightChanged:this.onHeaderHeightChanged.bind(this),columnHeaderEditHighlightChanged:e=>{e.colId&&e.colId!==g||this.refreshEditHighlight()}}),this.refreshEditHighlight(),a.showValuesAsSvc){const e=()=>this.refreshAriaShowValuesAs();h.addManagedListeners(r,{columnStateUpdated:e}),h.addManagedEventListeners({columnRowGroupChanged:e,columnPivotChanged:e,columnPivotModeChanged:e})}h.addDestroyFunc((()=>{this.headerCompGuard.invalidate(),this.clearComponentTooltip(),this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses?.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()}))}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return xe(t.gos,{colDef:s,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.headerCompGuard.supersede(),this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.headerCompGuard.provisionalClaim(),t=this.createParams(e),s=this.column.getColDef();return function(e,t,s){return e.getCompDetails(t,Gt,"agColumnHeader",s)}(this.beans.userCompFactory,s,t)}createParams(e){const{menuSvc:t,sortSvc:s,colFilter:i,gos:o}=this.beans;return xe(o,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!t?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!i&&(!this.openFilterEnabled||ye(this.gos)),showColumnMenu:(e,s)=>{t?.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button",onClosedCallback:s})},showColumnMenuAfterMouseClick:(e,s)=>{t?.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse",onClosedCallback:s})},showFilter:e=>{t?.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{s?.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{s?.setSortForColumn(this.column,ct(e),!!t,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(t,s)=>{o.assertModuleRegistered("Tooltip",3),e.isCurrent()&&this.setComponentTooltip(t,s)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",(()=>{const s=t.createSelectAllFeature(this.column);s&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(s),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!s&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))})))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===i.DDm.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===i.DDm.ENTER?this.onEnterKeyDown(e):e.key===i.DDm.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:s,sortable:i,beans:o}=this;let n=!1;(e.ctrlKey||e.metaKey)&&(n=this.showMenuOnKeyPress(e,!0)),n||(!e.altKey&&ue(s)?o.rangeSvc?.handleColumnSelection(t,e):i&&o.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const s=this.comp.getUserCompInstance();return!!lo(s)&&!!s.onMenuKeyboardShortcut(t)&&(e.preventDefault(),!0)}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),(0,i.g3$)()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(){const e=this.beans.tooltipSvc?.setupHeaderTooltip(this,this.tooltipFeature,(()=>this.componentTooltip));this.tooltipFeature=e,e&&this.setRefreshFunction("tooltip",(()=>e.refreshTooltip()))}setComponentTooltip(e,t){this.componentTooltip={value:e,shouldDisplay:t},this.tooltipFeature?.refreshTooltip()}clearComponentTooltip(){this.componentTooltip={}}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const e=Qi(this.column.colDef,this.beans,this.column,null);this.userHeaderClasses=Xi(this.comp,this.userHeaderClasses,e)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),e&&this.draggable&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshEditHighlight(){this.comp.toggleCss(ji,!!this.beans.colHeaderEditSvc?.isHighlightedColumn(this.column))}refreshHeaderComp(){const e=this.lookupUserCompDetails();e&&(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):(this.clearComponentTooltip(),this.setCompDetails(e)))}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.colDef;return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupPinnedCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-last-left-pinned",this.column.isLastLeftPinned()),this.comp.toggleCss("ag-header-cell-first-right-pinned",this.column.isFirstRightPinned())};e.addManagedListeners(this.column,{lastLeftPinnedChanged:t,firstRightPinnedChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const e=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",e),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",e)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=0===e,s=1===e;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",s)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:s,beans:i}=this,o=xi(this.beans),n=0===o.reduce(((e,t)=>e+t),0);if(s.toggleCss("ag-header-parent-hidden",n),!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),s.toggleCss("ag-header-span-height",!1),void s.toggleCss("ag-header-span-total",!1);const{numberOfParents:r,isSpanningTotal:a}=this.column.getColumnGroupPaddingInfo();s.toggleCss("ag-header-span-height",r>0);const l=Pi(i);if(0===r)return s.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${l}px`);s.toggleCss("ag-header-span-total",a);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=o.length-c;let u=0;for(let e=0;e<d;e++)u+=o[o.length-1-e];e.style.setProperty("top",-u+"px"),e.style.setProperty("height",`${l+u}px`)}refreshAriaSort(){let e=null;const{beans:t,column:s,comp:i,sortable:o,gos:n}=this;if(o){const o=this.getLocaleTextFunc(),r=t.sortSvc?.getDisplaySort(s)??null;i.setAriaSort(function(e){const t=e?.direction;return"asc"===t?"ascending":"desc"===t?"descending":"mixed"===t?"other":"none"}(r)),e=ue(n)?o("ariaSortableColumnWithCellSelection","Press ALT ENTER to sort"):o("ariaSortableColumn","Press ENTER to sort")}else i.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;this.menuEnabled&&(e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu")),this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null;const{openFilterEnabled:t,gos:s}=this;t&&!ye(s)&&(e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter")),this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;this.column.isFilterActive()&&(e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered")),this.setAriaDescriptionProperty("filter",e)}refreshAriaShowValuesAs(){const e=this.getLocaleTextFunc(),t=this.beans.showValuesAsSvc?.getActiveModeLabel(this.column);this.setAriaDescriptionProperty("showValuesAs",t?`${e("ariaColumnShowValuesAs","Showing Values As")} ${t}`:null)}refreshAriaCellSelection(){let e=null;const{gos:t,column:s}=this;ue(t)&&!St(s)&&(e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column")),this.setAriaDescriptionProperty("cellSelection",e)}refreshAriaCalculatedColumn(){let e=null;this.column.isCalculatedCol&&(e=this.getLocaleTextFunc()("ariaCalculatedColumn","Calculated column")),this.setAriaDescriptionProperty("calculatedColumn",e)}setAriaDescriptionProperty(e,t){const s=this.ariaDescriptionProperties;null!=t?s.set(e,t):s.delete(e)}announceAriaDescription(){const{beans:e,eGui:t,ariaDescriptionProperties:s}=this;if(!t.contains((0,i.UlD)(e)))return;const o=Array.from(s.keys()).sort(((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0))).map((e=>s.get(e))).join(". ");e.ariaAnnounce?.announceValue(o,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaShowValuesAs(),this.refreshAriaCellSelection(),this.refreshAriaCalculatedColumn()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return lo(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function lo(e){return"function"==typeof e?.getAnchorElementForMenu&&"function"==typeof e.onMenuKeyboardShortcut}var co=0,uo=class extends ke{constructor(e,t){super(),this.rowIndex=e,this.type=t,this.instanceId=co++,this.comp=null,this.allCtrls=[];let s="ag-header-row-column";"group"===t?s="ag-header-row-group":"filter"===t&&(s="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${s}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=W(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return!!this.comp&&this.allCtrls.every((e=>null!=e.eGui))}setComp(e,t,s=!0){this.comp=e,t=Bi(this,this.beans.context,t),s&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t),this.refreshTabIndex()}refreshTabIndex(){const{beans:e,gos:t}=this;this.comp?.setTabIndex(fi(e)?void 0:t.get("tabIndex"))}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),s=this.onDisplayedColumnsChanged.bind(this),i=this.refreshTabIndex.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),leftPinnedWidthChanged:this.refreshPinnedCellGroupWidths.bind(this),rightPinnedWidthChanged:this.refreshPinnedCellGroupWidths.bind(this),displayedColumnsChanged:s,gridSizeChanged:this.setWidth.bind(this),gridViewportWidthChanged:this.setWidth.bind(this),virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t,overlayExclusiveChanged:i}),e.addManagedPropertyListeners(["suppressHeaderFocus"],i),e.addManagedPropertyListener("domLayout",s),e.addManagedPropertyListener("ensureDomOrder",(e=>this.isEnsureDomOrder=e.currentValue)),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=W(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`),this.refreshPinnedCellGroupWidths()}refreshPinnedCellGroupWidths(){this.comp?.refreshPinnedCellGroupWidths()}getWidthForRow(){const{visibleCols:e}=this.beans,t=this.beans.ctrlsSvc.getGridBodyCtrl(),s=t?.getHorizontalContentWidth()??e.totalWidth,i=t?.getHorizontalViewportWidth()??0;return Math.max(s,i)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(`${e}px`),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=xi(this.beans);for(let s=0;s<t.length;s++){if(s===this.rowIndex&&"group"===this.type)return{topOffset:e,rowHeight:t[s]};e+=t[s]}const s=Pi(this.beans);return"column"===this.type?{topOffset:e,rowHeight:s}:(e+=s,{topOffset:e,rowHeight:Ii(this.beans)})}onVirtualColumnsChanged(e=!1){if(!this.comp)return;const t=this.getUpdatedHeaderCtrls(),s=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,s,e)}getUpdatedHeaderCtrls(){const e=this.ctrlsById;this.ctrlsById=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,this.ctrlsById,e);const s=e=>e.column.displayed&&this.beans.focusSvc.isHeaderWrapperFocused(e);let i=!1;if(e)for(const[t,o]of e)s(o)?(this.ctrlsById.set(t,o),i=!0):this.destroyBean(o);return this.allCtrls=Array.from(this.ctrlsById.values()),i&&(this.allCtrls=function(e){const{left:t,center:s,right:i}=Ai(e,(e=>e.column.getPinned()));return t.sort(Ti),s.sort(Ti),i.sort(Ti),[...t,...s,...i]}(this.allCtrls)),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,s){if(e.isEmptyGroup())return;const i=e.getUniqueId();let o;if(s&&(o=s.get(i),s.delete(i)),o&&o.column!=e&&(this.destroyBean(o),o=void 0),null==o)switch(this.type){case"filter":o=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break;case"group":o=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:o=this.createBean(new ao(e,this))}t.set(i,o)}getColumnsInViewport(){const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e){return"group"===this.type?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const s=this.allCtrls.find((t=>t.column==e));return!!s&&s.focus(t)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},ho=class extends ke{constructor(){super(...arguments),this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t,s=t){this.comp=e,this.eViewport=s;const{ctrlsSvc:i,colModel:o,colMoves:n}=this.beans;this.setupDragAndDrop(n,t);const r=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:r,advancedFilterEnabledChanged:r}),i.register("headerRowContainerCtrl",this),o.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:s,visibleCols:i}=this.beans;let o=0;const n=t.getFocusHeaderToUseAfterRefresh(),r=this.getAllCtrls();(()=>{const t=i.headerGroupRowCount;o=t,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const s=this.groupsRowCtrls.length;if(s!==t)if(s>t){for(let e=t;e<s;e++)this.destroyBean(this.groupsRowCtrls[e]);this.groupsRowCtrls.length=t}else for(let e=s;e<t;e++){const t=this.createBean(new uo(e,"group"));this.groupsRowCtrls.push(t)}})(),(()=>{const t=o++;null!=this.columnsRowCtrl&&e?this.columnsRowCtrl.rowIndex!==t&&this.columnsRowCtrl.setRowIndex(t):(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new uo(t,"column")))})(),(()=>{this.includeFloatingFilter=!!s?.hasFloatingFilters();const t=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void t();e||t();const i=o++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==i&&this.filtersRowCtrl.setRowIndex(i):this.filtersRowCtrl=this.createBean(new uo(i,"filter"))})();const a=this.getAllCtrls();this.comp.setCtrls(a),this.restoreFocusOnHeader(t,n),r.length!==a.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=t=>t?.getHeaderCellCtrls().find((t=>t.column===e));if(e.isColumn)return t(this.columnsRowCtrl);if(0!==this.groupsRowCtrls.length)for(let e=0;e<this.groupsRowCtrls.length;e++){const s=t(this.groupsRowCtrls[e]);if(s)return s}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,s){const i=this.getAllCtrls()[e];return!!i&&i.focusHeader(t,s)}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}destroy(){this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl),this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls),super.destroy()}setupDragAndDrop(e,t){const s=e?.createBodyDropTarget(t);s&&this.createManagedBean(s)}restoreFocusOnHeader(e,t){t&&e.focusHeaderPosition({headerPosition:t,scroll:!1})}},po={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},go=class extends ke{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},s=t.autoHeight?po.AUTO_HEIGHT:t.print?po.PRINT:po.NORMAL;this.view.updateLayoutClasses(s,t)}},fo=class extends ls{constructor(e,t){super(),this.direction=t,this.eViewport=i.dRA,this.eContainer=i.dRA,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",(0,i.puL)()||(0,i.TvF)())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=(0,i.b5C)(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),s=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:s,touchend:s})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),(0,i.Arb)(this.beans,(()=>this.setScrollVisible()))}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.toggleCss("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout((()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0}),400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;(0,i.XfX)(this,(()=>(0,i.K05)(t)),(()=>this.setScrollPosition(e)),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},mo={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eEndSpacer",cls:"ag-body-horizontal-scroll-end-spacer"}]},vo=class extends fo{constructor(){super(mo,"horizontal"),this.eEndSpacer=i.dRA,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setContainerWidth.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,leftPinnedWidthChanged:e,rightPinnedWidthChanged:e,gridSizeChanged:e,scrollVisibilityChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.setContainerWidth(),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}setContainerWidth(){const e=this.beans.ctrlsSvc.getGridBodyCtrl(),t=e?e.getHorizontalContentWidth()-e.getVerticalScrollbarWidth():this.visibleCols.bodyWidth+this.visibleCols.getLeftStickyColumnContainerWidth()+this.visibleCols.getRightStickyColumnContainerWidth();this.eContainer.style.width=`${Math.max(t,1)}px`}setScrollVisible(){this.enableRtl=this.gos.get("enableRtl");const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,s=this.gos.get("suppressHorizontalScroll"),o=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,n=s?0:0===o&&t?16:o,r=()=>{if(!this.isAlive())return;this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),(0,i.dDw)(this.getGui(),n),(0,i.dDw)(this.eViewport,n),(0,i.dDw)(this.eContainer,n),(0,i.dDw)(this.eEndSpacer,n);const s=this.getVerticalSpacerWidth();(0,i.M9x)(this.eEndSpacer,s),this.eEndSpacer.style.display=s>0?"":"none",this.eViewport.style.width=s>0?`calc(100% - ${s}px)`:"100%",n||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(r,100):r()}getVerticalSpacerWidth(){const e=this.beans.ctrlsSvc.getGridBodyCtrl();if(e)return e.getVerticalScrollbarWidth();const t=this.scrollVisibleSvc;if(!t.verticalScrollShowing)return 0;const s=t.getScrollbarWidth()||0;return s>0?s:this.invisibleScrollbar?16:0}getScrollPosition(){return(0,i.IQD)(this.eViewport,this.enableRtl)}setScrollPosition(e){(0,i.K05)(this.eViewport)||this.attemptSettingScrollPosition(e),(0,i.WpO)(this.eViewport,e,this.enableRtl)}},wo={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eSpacer",cls:"ag-body-vertical-scroll-start-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},Co=class extends fo{constructor(){super(wo,"vertical"),this.eSpacer=i.dRA}postConstruct(){super.postConstruct(),this.enableRtl=this.gos.get("enableRtl");const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this);const t=this.queueContainerHeightSync.bind(this);this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e),headerHeightChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowsChanged:t,pinnedHeightChanged:t,pinnedRowDataChanged:t}),this.addManagedPropertyListeners(["suppressHorizontalScroll","enableRtl"],this.onScrollVisibilityChanged.bind(this))}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans;this.enableRtl=this.gos.get("enableRtl");const t=e.verticalScrollShowing,s=this.invisibleScrollbar,o=this.beans.ctrlsSvc.getGridBodyCtrl(),n=e.getScrollbarWidth()||0,r=t?o?.getVerticalScrollbarWidth()??n:0,a=0===r&&s?16:r,l=o?.getHorizontalScrollbarHeight()??0,c=o?.getHeaderRowsOffset()??0,d=this.getGui();d.style.bottom=`${l}px`,this.eSpacer.style.height=`${c}px`,this.toggleCss("ag-scrollbar-invisible",s),(0,i.M9x)(d,a),(0,i.M9x)(this.eViewport,a),(0,i.M9x)(this.eContainer,a),this.setDisplayed(t,{skipAriaHidden:!0}),this.queueContainerHeightSync()}onRowContainerHeightChanged(e){const t=e.getGridBodyCtrl();if(!t)return;const s=t.eGridViewport;this.syncContainerHeight();const i=this.getScrollPosition(),o=s.scrollTop;i!=o&&this.setScrollPosition(o,!0)}queueContainerHeightSync(){(0,i.Arb)(this.beans,(()=>this.syncContainerHeight()))}syncContainerHeight(){const e=this.beans.ctrlsSvc.getGridBodyCtrl();if(!e)return;const t=e.getScrollContentHeight(),s=e.eGridViewport.clientHeight-this.eViewport.clientHeight;this.eContainer.style.height=`${Math.max(1,t-s)}px`}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){t||(0,i.K05)(this.eViewport)||this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},yo="Viewport",bo="fakeVScrollComp",So=["fakeHScrollComp"],xo=class extends ke{constructor(e){super(),this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eGridViewport=e,this.resetLastHScrollDebounced=(0,i.pkA)(this,(()=>this.lastScrollSource[i.OP3.Horizontal]=null),150),this.resetLastVScrollDebounced=(0,i.pkA)(this,(()=>this.lastScrollSource[i.OP3.Vertical]=null),150)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eGridViewport,{scroll:()=>{e(),t()}}),this.ctrlsSvc.whenReady(this,(e=>{this.fakeVScrollComp=e.fakeVScrollComp,this.fakeHScrollComp=e.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()}))}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.eGridViewport,{scroll:this.onHScroll.bind(this,yo)});for(const e of So){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?(0,i.pkA)(this,this.onVScroll.bind(this,yo),100):this.onVScroll.bind(this,yo),s=e?(0,i.pkA)(this,this.onVScroll.bind(this,bo),100):this.onVScroll.bind(this,bo);this.addManagedElementListeners(this.eGridViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){null==this.fakeHScrollComp||(void 0===e&&(e=(0,i.IQD)(this.eGridViewport,this.enableRtl)),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...So,yo]){if(this.lastScrollSource[i.OP3.Horizontal]===t)continue;const s=this.getViewportForSource(t);(0,i.WpO)(s,e,this.enableRtl)}}getViewportForSource(e){return e===yo?this.eGridViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(t===i.OP3.Vertical?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,i.OP3.Horizontal))return;let t=(0,i.IQD)(this.getViewportForSource(e),this.enableRtl);const s=this.clampHorizontalScrollPosition(t);Math.abs(s-t)>.1&&((0,i.WpO)(this.getViewportForSource(e),Math.abs(s),this.enableRtl),t=s),this.shouldBlockScrollUpdate(i.OP3.Horizontal,t,!0)||(e!==yo&&((0,i.WpO)(this.eGridViewport,Math.abs(t),this.enableRtl),t=(0,i.IQD)(this.eGridViewport,this.enableRtl)),this.doHorizontalScroll(t),this.resetLastHScrollDebounced())}onVScroll(e){if(!this.isControllingScroll(e,i.OP3.Vertical))return;const t=e===yo?this.eGridViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let s=t;if(this.shouldBlockScrollUpdate(i.OP3.Vertical,s,!0))return;e===yo?this.fakeVScrollComp.setScrollPosition(s):(this.eGridViewport.scrollTop=t,s=this.eGridViewport.scrollTop,this.invalidateVerticalScroll(),s!==t&&this.fakeVScrollComp.setScrollPosition(s,!0));const{animationFrameSvc:o}=this;o?.setScrollTop(s),this.nextScrollTop=s,o?.active?o.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(i.OP3.Horizontal),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.ctrlsSvc.getGridBodyCtrl()?.updateColumnViewport(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===i.OP3.Horizontal?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout((()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})}),150)}shouldBlockScrollUpdate(e,t,s=!1){return!(s&&!(0,i.TvF)())&&(e===i.OP3.Vertical?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=(0,i.NUe)(this.eGridViewport),{scrollHeight:s}=this.eGridViewport;return!!(e<0||e+t>s)}shouldBlockHorizontalScroll(e){return Math.abs(this.clampHorizontalScrollPosition(e)-e)>.1}redrawRowsAfterScroll(){this.fireScrollEvent(i.OP3.Vertical)}checkScrollLeft(){const e=(0,i.IQD)(this.eGridViewport,this.enableRtl);let t=!1;for(const s of So){const o=this.getViewportForSource(s);if((0,i.IQD)(o,this.enableRtl)!==e){t=!0;break}}t&&this.onHScroll(yo)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){e=this.clampHorizontalScrollPosition(e),(0,i.WpO)(this.eGridViewport,Math.abs(e),this.enableRtl),e=(0,i.IQD)(this.eGridViewport,this.enableRtl),this.doHorizontalScroll(e)}getMaxHorizontalScrollLeft(){const e=(0,i.Wd2)(this.eGridViewport),t=this.ctrlsSvc.getGridBodyCtrl();if(!t){const t=this.eGridViewport.scrollWidth;return Math.max(0,t-e)}const s=Math.max(t.getHorizontalContentWidth(),e);return Math.max(0,s-e)}clampHorizontalScrollPosition(e){return _(e,0,this.getMaxHorizontalScrollLeft())}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eGridViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:e,lastScrollTop:t}=this;return{top:t,bottom:t+this.getBodyViewportHeight(e)}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eGridViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+this.getBodyViewportHeight(t)}}getApproximateVScollPosition(){if(this.lastScrollTop>=0&&this.lastOffsetHeight>=0){const e=this.getBodyViewportHeight(this.lastOffsetHeight);return{top:this.scrollTop,bottom:this.scrollTop+e}}return this.getVScrollPosition()}getBodyViewportHeight(e){const t=this.ctrlsSvc.getGridBodyCtrl();return t?t.getBodyViewportHeight(e):e}getHScrollPosition(){return this.ctrlsSvc.getGridBodyCtrl()?.getHorizontalScrollPosition()??{left:0,right:0}}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.beans.scrollVisibleSvc.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=(0,i.IQD)(this.eGridViewport,this.enableRtl);return this.setHorizontalScrollPosition(t+e),(0,i.IQD)(this.eGridViewport,this.enableRtl)-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:s}=this.beans,i=s.getRowCount();let o=-1;for(let t=0;t<i;t++){const i=s.getRow(t);if("function"==typeof e){if(i&&e(i)){o=t;break}}else if(e===i||e===i.data){o=t;break}}o>=0&&this.ensureIndexVisible(o,t)}ensureIndexVisible(e,t,s=0){if(W(this.gos,"print"))return;const{rowModel:i}=this.beans,o=i.getRowCount();if("number"!=typeof e||e<0||e>=o)return void this.warn(88,{index:e});this.clearRetryListeners();const{frameworkOverrides:n,pageBounds:r,rowContainerHeight:a,rowRenderer:l}=this.beans;n.wrapIncoming((()=>{const o=this.ctrlsSvc.getGridBodyCtrl(),n=i.getRow(e);let c,d,u=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:e,stickyBottomHeight:s}=o,i=n.rowTop,h=n.rowHeight,p=r.getPixelOffset(),g=n.rowTop-p,f=g+n.rowHeight,m=this.getVScrollPosition(),v=a.divStretchOffset,w=m.top+v,C=m.bottom+v,y=C-w,b=a.getScrollPositionForPixel(g),S=a.getScrollPositionForPixel(f-y),x=Math.min((b+S)/2,g);let R=null;"top"===t?R=b-e:"bottom"===t?R=S+s:"middle"===t?R=x:w+e>g?R=b-e:C-s<f&&(R=S-b>y?b-e:S+s),null!==R&&(this.setVerticalScrollPosition(R),l.redraw({afterScroll:!0})),c=i!==n.rowTop||h!==n.rowHeight,d=e!==o.stickyTopHeight||s!==o.stickyBottomHeight,u++}while((c||d)&&u<10);if(this.animationFrameSvc?.flushAllFrames(),s<10&&(n?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const o=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const e=this.getVScrollPosition().top;o!==e&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),e>=i.getRowCount()||this.ensureIndexVisible(e,t,s+1)}})}}))}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:s,frameworkOverrides:i}=this.beans,o=s.getCol(e);if(!o)return;if(o.isPinned())return;if(!o.displayed)return;const n=this.getPositionedHorizontalScroll(o,t);i.wrapIncoming((()=>{const e=this.ctrlsSvc.getGridBodyCtrl();null!==n&&e?.setHorizontalScrollLeft(n),e?.updateColumnViewport(),this.animationFrameSvc?.flushAllFrames()}))}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:s,columnAfterEnd:i}=this.isColumnOutsideViewport(e),o=this.ctrlsSvc.getGridBodyCtrl()?.getCenterWidth()??0,n=o<e.getActualWidth();let r=i||n,a=s;"auto"!==t&&(r="start"===t,a="end"===t);const l="middle"===t;if(r||a||l){const{colLeft:t,colMiddle:s,colRight:i}=this.getColumnBounds(e);return l?s-o/2:r?t:i-o}return null}isColumnOutsideViewport(e){const{start:t,end:s}=this.getViewportBounds(),{colLeft:i,colRight:o}=this.getColumnBounds(e);return{columnBeforeStart:s<o,columnAfterEnd:t>i}}getColumnBounds(e){const t=e.getLeft(),s=e.getActualWidth();return{colLeft:t,colMiddle:t+s/2,colRight:t+s}}getViewportBounds(){const e=this.ctrlsSvc.getGridBodyCtrl(),t=e?.getCenterWidth()??0,s=e?.getHorizontalScrollLeft()??0;return{start:s,end:t+s,width:t}}},Ro=class extends ke{constructor(){super(...arguments),this.topPinnedRowsHeight=0,this.bottomPinnedRowsHeight=0,this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,s,i,o,n,r){this.comp=e,this.eGridBody=t,this.eGridViewport=s,this.eScrollingRows=i,this.eTop=o,this.eTopExtraRows=n,this.eBottom=r,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(e=>this.setCellTextSelection(e.currentValue))),this.createManagedBean(new go(this.comp)),this.scrollFeature=this.createManagedBean(new xo(s)),this.beans.rowDragSvc?.setupRowDrag(i,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([o,s,r]),this.setGridRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.filterManager?.mountAdvFilterTopSectionComp({mountComp:e=>n.appendChild(e),unmountComp:e=>e.remove()}),this.setPinnedRowsHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updatePinnedColumnStickyOffsets(),this.updateScrollingClasses(),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setPinnedRowsHeights.bind(this),t=this.setGridRole.bind(this),s=this.toggleRowResizeStyles.bind(this),i=this.updatePinnedColumnStickyOffsets.bind(this),o=this.onGridSizeChanged.bind(this),n=()=>{this.updateScrollableAreaWidth(),this.updateScrollingClasses()};this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsWidthChanged:this.updateScrollableAreaWidth.bind(this),leftPinnedWidthChanged:n,rightPinnedWidthChanged:n,scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollbarWidthChanged:i,scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:e,gridSizeChanged:o,gridViewportWidthChanged:o,columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:s,rowResizeEnded:s}),this.addManagedPropertyListener("treeData",t),this.addManagedPropertyListener("enableRtl",i)}toggleRowResizeStyles(e){const t="rowResizeStarted"===e.type;this.comp.setPreventRowAnimationCssOnContainers(t)}onGridColumnsChanged(){const e=this.beans.colModel.colsList;this.comp.setColumnCount(e.length),this.updateScrollableAreaWidth(),this.setGridRole()}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setStickyWidth(t),this.updatePinnedColumnStickyOffsets(),this.updateScrollableAreaWidth(),this.updateScrollingClasses(),this.updateGridViewportWidth()}onGridSizeChanged(){this.updateScrollableAreaWidth(),this.updatePinnedColumnStickyOffsets(),this.updateGridViewportWidth()}updateScrollableAreaWidth(){const e=this.isPinnedWidthOverflowingViewport(),t=this.getHorizontalContentWidth(),s=this.getHorizontalViewportWidth();this.comp.setGridScrollableAreaWidth(`${Math.max(t,s,1)}px`),this.comp.setPinnedColumnsOverflowing(e),e&&0!==this.getHorizontalScrollLeft()&&this.setHorizontalScrollLeft(0)}getHorizontalContentWidth(e=this.scrollVisibleSvc.verticalScrollShowing){return this.isPinnedWidthOverflowingViewport(e)?0:this.getColumnsWidth()+this.getVerticalScrollbarWidth(e)}getColumnsWidth(){const{visibleCols:e}=this.beans;return e.bodyWidth+e.getLeftStickyColumnContainerWidth()+e.getRightStickyColumnContainerWidth()}isPinnedWidthOverflowingViewport(e=this.scrollVisibleSvc.verticalScrollShowing){if(W(this.gos,"print"))return!1;const t=this.getPinnedWidth();return t>0&&t>=this.getViewportWidthWithoutScrollbar(e)}getPinnedWidth(){const{visibleCols:e}=this.beans;return e.getLeftStickyColumnContainerWidth()+e.getRightStickyColumnContainerWidth()}getHorizontalViewportWidth(){return(0,i.Wd2)(this.eGridViewport)}getViewportWidthWithoutScrollbar(e=this.scrollVisibleSvc.verticalScrollShowing){return Math.max(0,(0,i.Wd2)(this.eGridViewport)-this.getVerticalScrollbarWidth(e))}getCenterWidth(e=this.scrollVisibleSvc.verticalScrollShowing){return Math.max(0,this.getViewportWidthWithoutScrollbar(e)-this.getPinnedWidth())}getHorizontalScrollLeft(){return(0,i.IQD)(this.eGridViewport,this.gos.get("enableRtl"))}setHorizontalScrollLeft(e){(0,i.WpO)(this.eGridViewport,e,this.gos.get("enableRtl"))}getHorizontalScrollPosition(){const e=this.getHorizontalScrollLeft();return{left:e,right:e+this.getCenterWidth()}}updateColumnViewport(e=!1){this.beans.colViewport.setScrollPosition(this.getCenterWidth(),this.getHorizontalScrollLeft(),e)}updateGridViewportWidth(){const e=this.getViewportWidthWithoutScrollbar();this.eGridViewport.style.setProperty("--ag-internal-grid-viewport-width",`${e}px`)}setGridRole(){const{rowGroupColsSvc:e,colModel:t,gos:s}=this;let i=s.get("treeData");if(!i){const s=t.pivotMode;i=(e?e.columns.length:0)>=(s?2:1)}this.comp.setGridRole(i?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:e=>{const{target:s}=e,o=(0,i.HW9)(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:e=>{const{target:s,relatedTarget:o}=e,n=t.contains(o),r=(0,i.HW9)(o,"ag-root",t);(0,i.HW9)(s,"ag-root",t)||n&&!r||t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t,beans:{visibleCols:s}}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap),e.toggle("ag-has-left-pinned-cols",s.getLeftStickyColumnContainerWidth()>0),e.toggle("ag-has-right-pinned-cols",s.getRightStickyColumnContainerWidth()>0)}updatePinnedColumnStickyOffsets(){const{scrollVisibleSvc:e,gos:t,eGridBody:s}=this,i=e.verticalScrollShowing?this.getVerticalScrollbarWidth():0,o=t.get("enableRtl"),n=o?i:0,r=o?0:i;s.style.setProperty("--ag-internal-pinned-left-sticky-offset",`${n}px`),s.style.setProperty("--ag-internal-pinned-right-sticky-offset",`${r}px`)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eGridViewport,this.eBottom,this.eTop])}updateRowCount(){const e=Si(this.beans),{rowModel:t,pinnedRowModel:s}=this.beans,i=s?.getPinnedTopRowCount()??0,o=s?.getPinnedBottomRowCount()??0,n=t.isLastRowIndexKnown()?t.getRowCount():-1,r=-1===n?-1:e+i+n+o;this.comp.setRowCount(r)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let s=t.sizesMeasured;const i=()=>{const t=s&&J(this.gos)&&!e.stretching;this.comp.setRowAnimationCssOnScrollableArea(t)};i(),this.addManagedEventListeners({heightScaleChanged:i}),this.addManagedPropertyListener("animateRows",i),this.addManagedEventListeners({stylesChanged:()=>{!s&&t.sizesMeasured&&(s=!0,i())}})}addBodyViewportListener(){const{eGridViewport:e,eTop:t,eBottom:s,beans:{popupSvc:i,touchSvc:o}}=this,n=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:n}),o?.mockBodyContextMenu(this,n),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,i)});const r=this.onStickyWheel.bind(this);for(const e of[t,s])this.addManagedElementListeners(e,{wheel:r})}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onBodyViewportContextMenu(e,t,s){if(!e&&!s)return;this.gos.get("preventDefaultOnContextMenu")&&(e||s).preventDefault();const i=(e||t)?.target,o=i instanceof Element?i:null,n=null!=o&&(o===this.eGridViewport||this.eGridViewport.contains(o)),r=!!o?.closest(".ag-row, .ag-header-row"),a=!!o?.closest(".ag-grid-pinned-top-rows");!n||r||a||this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:s,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eGridViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eGridViewport.scrollTop-t}setPinnedRowsHeights(){const{pinnedRowModel:e}=this,t=e?.getPinnedTopTotalHeight(),s=e?.getPinnedBottomTotalHeight(),{environment:i}=this.beans,o=i.getPinnedRowBorderWidth(),n=(t??0)+(t?o:0),r=(s??0)+(s?o:0);this.topPinnedRowsHeight=n,this.bottomPinnedRowsHeight=r,this.ctrlsSvc.get("pinnedTop")?.setContainerHeight(n),this.ctrlsSvc.get("pinnedBottom")?.setContainerHeight(r),this.refreshTopSection(),this.refreshBottomSection()}refreshTopSection(){const e=this.filterManager?.getHeaderHeight()??0,t=this.getHeaderRowsOffset();this.eTopExtraRows.style.top="var(--ag-internal-header-rows-height, 0px)";const s=t;this.ctrlsSvc.get("pinnedTop")?.setContainerTop(s);const i=s+this.topPinnedRowsHeight;this.ctrlsSvc.get("stickyTop")?.setContainerTop(i),this.comp.setPinnedSection("top",{height:this.topPinnedRowsHeight+e,invisible:this.topPinnedRowsHeight<=0})}refreshBottomSection(){this.ctrlsSvc.get("stickyBottom")?.setContainerTop(0),this.ctrlsSvc.get("pinnedBottom")?.setContainerTop(this.stickyBottomHeight),this.comp.setPinnedSection("bottom",{height:this.bottomPinnedRowsHeight,invisible:this.bottomPinnedRowsHeight<=0})}setStickyTopHeight(e=0){this.stickyTopHeight!==e&&(this.stickyTopHeight=e,this.ctrlsSvc.get("stickyTop")?.setContainerHeight(e),this.refreshTopSection())}setStickyBottomHeight(e=0){this.stickyBottomHeight!==e&&(this.stickyBottomHeight=e,this.ctrlsSvc.get("stickyBottom")?.setContainerHeight(e),this.comp.setStickyBottomHeight(`${e}px`),this.refreshBottomSection(),this.updateStickyRowsHeightAdjustment(),this.eventSvc.dispatchEvent({type:"stickyBottomOffsetChanged",offset:e}))}updateStickyRowsHeightAdjustment(){const{stickyBottomHeight:e,beans:{rowContainerHeight:t}}=this;t.stickyBottomRowsHeight!==e&&(t.stickyBottomRowsHeight=e,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"}))}setStickyWidth(e){this.comp.setStickyBottomWidth(e?`calc(100% - ${this.getVerticalScrollbarWidth()}px)`:"100%")}getHeaderRowsOffset(){const e=this.ctrlsSvc.get("gridHeaderCtrl"),t=e?.headerHeight??0;return(this.filterManager?.getHeaderHeight()??0)+t+this.beans.environment.getHeaderRowBorderWidth()}getTopPinnedRowsOffset(){return this.getHeaderRowsOffset()+this.topPinnedRowsHeight}getBottomPinnedRowsOffset(){return this.bottomPinnedRowsHeight}getBodyViewportHeight(e){const t=e-this.getTopPinnedRowsOffset()-this.bottomPinnedRowsHeight;return Math.max(0,t)}getScrollContentHeight(){const e=this.getTopPinnedRowsOffset()+(this.beans.rowContainerHeight.getAdjustedUiContainerHeight()??0)+(this.bottomPinnedRowsHeight+this.stickyBottomHeight);return Math.max(e,this.eGridViewport.clientHeight)}getVerticalScrollbarWidth(e=this.scrollVisibleSvc.verticalScrollShowing){const{scrollVisibleSvc:t}=this;if(!e)return 0;const s=t.getScrollbarWidth()||0;return 0===s?0:s}getHorizontalScrollbarHeight(){if(!this.scrollVisibleSvc.horizontalScrollShowing||this.gos.get("suppressHorizontalScroll"))return 0;const e=this.ctrlsSvc.get("fakeHScrollComp"),t=e?.getGui().offsetHeight??0;if(t>0)return t;const s=this.scrollVisibleSvc.getScrollbarWidth()||0;return 0===s&&(0,i.b5C)()?16:s}},Po=class extends ke{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=W(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:s}=this.beans,i=t.bodyWidth,o=t.getLeftStickyColumnContainerWidth(),n=t.getRightStickyColumnContainerWidth();let r;e?r=i+o+n:(r=i,this.addSpacer&&0===(this.gos.get("enableRtl")?o:n)&&s.verticalScrollShowing&&(r+=s.getScrollbarWidth())),this.callback(r)}},Eo=class extends ke{constructor(e){super(),this.centerContainerCtrl=e,this.centerViewportResizeQueued=!1,this.viewportGeometryRefreshQueued=!1,this.scrollVisibilityRefreshQueued=!1}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}));const e=this.scheduleViewportGeometryRefresh.bind(this);this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this),scrollVisibilityChanged:this.onViewportGeometryChanged.bind(this),pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:e}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],(()=>{this.checkViewportAndScrolls()}))}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:s}=this;if(!s)return;t.registerViewportResizeListener((()=>this.scheduleCenterViewportResize()));const o=(0,i.QSI)(e,t.eContainer,(()=>this.scheduleScrollVisibilityRefresh()));this.addDestroyFunc((()=>o()))}scheduleCenterViewportResize(){if(this.centerViewportResizeQueued)return;this.centerViewportResizeQueued=!0;const{beans:e}=this;(0,i.Arb)(e,(()=>{this.centerViewportResizeQueued=!1,this.onCenterViewportResized()}))}scheduleScrollVisibilityRefresh(){if(this.scrollVisibilityRefreshQueued)return;this.scrollVisibilityRefreshQueued=!0;const{beans:e}=this;(0,i.Arb)(e,(()=>{this.scrollVisibilityRefreshQueued=!1,this.scrollVisibleSvc.refresh()}))}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}scheduleViewportGeometryRefresh(){if(this.viewportGeometryRefreshQueued)return;this.viewportGeometryRefreshQueued=!0;const{beans:e}=this;(0,i.Arb)(e,(()=>{this.viewportGeometryRefreshQueued=!1,this.onViewportGeometryChanged()}))}onViewportGeometryChanged(){this.gridBodyCtrl&&this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.gridBodyCtrl)if(this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const s=this.gridBodyCtrl.getCenterWidth();s!==this.centerWidth&&(this.centerWidth=s,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){const e=this.gridBodyCtrl;e&&(this.scrollVisibleSvc.refresh(),this.checkBodyHeight(),this.checkViewportWidth(),this.onHorizontalViewportChanged(),e.scrollFeature.checkScrollLeft())}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl;if(!e)return;const t=e.eGridViewport,s=e.getBodyViewportHeight((0,i.NUe)(t));this.bodyHeight!==s&&(this.bodyHeight=s,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}checkViewportWidth(){const e=this.gridBodyCtrl;if(!e)return;const t=e.getHorizontalViewportWidth();this.viewportWidth!==t&&(this.viewportWidth=t,this.eventSvc.dispatchEvent({type:"gridViewportWidthChanged"}))}onHorizontalViewportChanged(){this.gridBodyCtrl?.updateColumnViewport()}};function Io(e,t,s,i){const o=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return ko(e,t,s,i,o)}function ko(e,t,s,i,o){return!!o&&o(xe(e,{column:t,node:s,event:i}))}function Fo(e,t,s){let i=t;for(;i;){const t=Z(e,i,s);if(t)return t;i=i.parentElement}return null}var Do="cellCtrl";function To(e,t){return Fo(e,t,Do)}var Ao="renderedRow";function Mo(e,t){return Fo(e,t,Ao)}function No(e,t,s,i,o){const n=i?i.colDef.suppressKeyboardEvent:void 0;if(!n)return!1;const r=xe(e,{event:t,editing:o,column:i,node:s,data:s.data,colDef:i.colDef});return!(!n||!n(r))}var Lo=class extends ke{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";(0,i.ELu)("pointerdown")?e="pointerdown":(0,i.ELu)("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const e of t){const t=this.processMouseEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}}processMouseEvent(e,t){if(!(0,i.NuO)(this.beans,t)||us(t))return;const{cellCtrl:s,rowCtrl:o}=this.getControlsForEventTarget(t.target);if("contextmenu"===e){if(!s&&!o)return;s?.column&&s.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,o,s)}else s&&s.onMouseEvent(e,t),o&&o.onMouseEvent(e,t)}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:To(t,e),rowCtrl:Mo(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(s?this.processCellKeyboardEvent(s,e,t):i?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(i,e,t))}processCellKeyboardEvent(e,t,s){const o=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;No(this.gos,s,e.rowNode,e.column,o)||"keydown"!==t||(!o&&this.beans.navigation?.handlePageScrollingKey(s)||e.onKeyDown(s),this.doGridOperations(s,o),(0,i.aC_)(s)&&e.processCharacter(s)),"keydown"===t&&this.eventSvc.dispatchEvent(e.createEvent(s,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,s){const{rowNode:i}=e,o=this.beans.focusSvc.getFocusedCell(),n=o?.column;!No(this.gos,s,i,n,!1)&&"keydown"===t&&this.processFullWidthRowKeyDown(e,s,n),"keydown"===t&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",s))}processFullWidthRowKeyDown(e,t,s){switch(t.key){case i.DDm.PAGE_HOME:case i.DDm.PAGE_END:case i.DDm.PAGE_UP:case i.DDm.PAGE_DOWN:return void this.beans.navigation?.handlePageScrollingKey(t,!0);case i.DDm.LEFT:case i.DDm.RIGHT:if(!this.gos.get("embedFullWidthRows"))return;case i.DDm.UP:case i.DDm.DOWN:return void e.onKeyboardNavigate(t);case i.DDm.F2:return void this.processFullWidthRowNoteShortcut(e,t,s,this.beans.notesSvc);case i.DDm.TAB:return void e.onTabKeyDown(t);case i.DDm.SPACE:if(t.target!==e.getCurrentRowElement())return;return U(this.gos)&&this.beans.selectionSvc?.handleSelectionEvent(t,e.rowNode,"spaceKey"),void t.preventDefault()}}processFullWidthRowNoteShortcut(e,t,s,i=this.beans.notesSvc){if(!t.shiftKey||!i?.hasDataSource())return;const o=e.rowNode,n=e.findInfoForEvent(t);let r;if(n){const{pinned:e}=n;r={rowNode:o,location:"fullWidthRow",pinned:"left"===e||"right"===e?e:void 0}}else s&&(r={rowNode:o,column:s});if(!r)return;const a=i.getNoteAccess(r);a&&(a.isSuppressed&&!a.canView||(i.showNote(a.params,!0),t.preventDefault()))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!(0,i.NuO)(this.beans,e))return;const s=(0,i.ZL7)(e),{clipboardSvc:o,undoRedo:n}=this.beans;return s===i.DDm.A?this.onCtrlAndA(e):s===i.DDm.C?this.onCtrlAndC(o,e):s===i.DDm.D?this.onCtrlAndD(o,e):s===i.DDm.V?this.onCtrlAndV(o,e):s===i.DDm.X?this.onCtrlAndX(o,e):s===i.DDm.Y?this.onCtrlAndY(n):s===i.DDm.Z?this.onCtrlAndZ(n,e):void 0}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:s,selectionSvc:i},gos:o}=this;s&&de(o)&&!function(e){const t=e.get("rowSelection");return"string"!=typeof t&&"multiRow"===t?.mode&&(t.ctrlASelectsRows??!1)}(o)&&t.isRowsToRender()?function(e){const{pinnedRowModel:t,rowModel:s,rangeSvc:i,visibleCols:o}=e;if(!i||0===o.allCols.length)return;const n=t?.isEmpty("top")??1?null:"top";let r,a;t?.isEmpty("bottom")??1?(r=null,a=s.getRowCount()-1):(r="bottom",a=t?.getPinnedBottomRowCount()??-1),i.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:r})}(this.beans):i&&i.selectAllRowNodes({source:"keyboardSelectAll",selectAll:ve(o)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:s}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(s,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){this.gos.get("undoRedoCellEditing")&&e&&(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Vo=class extends ke{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.getAdjustedUiContainerHeight(),s=null!=t?`${t}px`:"";this.eContainer.style.height=s,this.eViewport&&(this.eViewport.style.height=s)}},_o={scrolling:{type:"center",name:"grid-scrolling",getRowCtrls:e=>e.allRowCtrls,getSpannedRowCtrls:e=>e.getCtrls("center")},pinnedTop:{type:"center",name:"grid-pinned-top-rows",getRowCtrls:e=>e.topRowCtrls,getSpannedRowCtrls:e=>e.getCtrls("top")},pinnedBottom:{type:"center",name:"grid-pinned-bottom-rows",getRowCtrls:e=>e.bottomRowCtrls,getSpannedRowCtrls:e=>e.getCtrls("bottom")},stickyTop:{type:"center",name:"grid-sticky-top-rows",getRowCtrls:e=>e.getStickyTopRowCtrls()},stickyBottom:{type:"center",name:"grid-sticky-bottom-rows",getRowCtrls:e=>e.getStickyBottomRowCtrls()}};function Oo(e){return`ag-${Ho(e).name}-container`}function Bo(e){return`ag-${Ho(e).name}-spanned-cells-container`}function Ho(e){return _o[e]}var Go=["stickyTop","stickyBottom"],zo=class extends ke{constructor(e){super(),this.name=e,this.EMPTY_CTRLS=[],this.options=Ho(e)}postConstruct(){this.isScrollingCenterContainer()&&(this.viewportSizeFeature=this.createManagedBean(new Eo(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)}))}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.beans.ctrlsSvc.register(this.name,this)}isScrollingCenterContainer(){return"scrolling"===this.name}isContainer(e){return Array.isArray(e)?e.includes(this.name):this.name===e}setComp(e,t,s,i){this.comp=e,this.eContainer=t,this.eViewport=i;const{rangeSvc:o}=this.beans;this.isScrollingCenterContainer()&&(this.createManagedBean(new Lo(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),o&&this.createManagedBean(o.createDragListenerFeature(this.eViewport??this.eContainer))),this.listenOnDomOrder(),this.isContainer("scrolling")&&this.createManagedBean(new Vo(this.eContainer));const n=this.updateContainerWidth.bind(this);this.createManagedBean(new Po(n)),this.registerViewportResizeListener(n),this.addListeners(),this.registerWithCtrlsService()}updateContainerWidth(){const{visibleCols:e,ctrlsSvc:t}=this.beans,s=t.getGridBodyCtrl(),o=e.bodyWidth+e.getLeftStickyColumnContainerWidth()+e.getRightStickyColumnContainerWidth(),n=s?.getHorizontalContentWidth()??o,r=s?.getHorizontalViewportWidth()??(0,i.Wd2)(this.eViewport),a=Math.max(n,r,1);this.comp.setContainerWidth(`${a}px`),this.eContainer.style.setProperty("--ag-pinned-row-border-width",`${this.beans.environment.getPinnedRowBorderWidth()}px`)}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,s=this.onDisplayedColumnsChanged.bind(this),i=this.updateContainerWidth.bind(this);this.addManagedEventListeners({scrollVisibilityChanged:i,scrollbarWidthChanged:i,gridSizeChanged:i,displayedColumnsChanged:s,displayedColumnsWidthChanged:s,displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),s(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const t=this.options.getSpannedRowCtrls(e);t&&this.comp.setSpannedRowCtrls(t,!1)}})}listenOnDomOrder(){if(this.isContainer(Go))return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=W(this.gos,"print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}onDisplayedColumnsChanged(){this.isScrollingCenterContainer()&&this.beans.ctrlsSvc.getGridBodyCtrl()?.updateColumnViewport()}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=t=>{e.dragging&&t.cancelable&&t.preventDefault()},s=this.eViewport??this.eContainer;s.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc((()=>s.removeEventListener("touchmove",t)))}registerViewportResizeListener(e){const t=(0,i.QSI)(this.beans,this.eViewport,e);this.addDestroyFunc((()=>t()))}isViewportInTheDOMTree(){return(0,i.vMu)(this.eViewport)}setContainerHeight(e){this.eContainer.style.height=e>0?`${e}px`:""}setContainerTop(e){this.eContainer.style.top=`${e}px`}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer),s=0===t.length;this.comp.setRowCtrls({rowCtrls:s?this.EMPTY_CTRLS:t,useFlushSync:e}),this.comp.setHidden(s)}};function Wo(e,t,...s){e.get("debug")&&console.log("AG Grid: "+t,...s)}function jo(e,...t){(0,i.keA)((()=>$o(e,...t)),e+t?.join(""))}function Uo(e,...t){(0,i.keA)((()=>function(e,...t){console.error("AG Grid: "+e,...t)}(e,...t)),e+t?.join(""))}function $o(e,...t){console.warn("AG Grid: "+e,...t)}var Yo,Ko=class extends u{initialiseTabGuard(e){super.initialiseTabGuard(e,hs)}},qo=(e,t)=>Ci(e,(()=>(0,i.dHu)(e.getGui(),t,!0))),Zo=e=>e?.getFocusableContainerName()??"external",Qo=class extends ke{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,s){this.view=e,this.eGui=t,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:o,ctrlsSvc:n,ariaAnnounce:r}=this.beans;if(o?.registerGridDropTarget((()=>this.eGui),this),r.setDescriptionContainer(s),this.createManagedBean(new go(this.view)),this.gos.get("enableContentVisibilityAuto")??!1===this.gos.get("suppressContentVisibilityAuto")){const[e]=this.addManagedEventListeners({firstDataRendered:()=>{e();const s=setTimeout((()=>{const e=(0,i.DqG)(this.beans,t,(e=>{e.isIntersecting?t.style.removeProperty("content-visibility"):t.style.setProperty("content-visibility","auto")}),{rootMargin:"200px"});this.addDestroyFunc((()=>e()))}),this.gos.get("contentVisibilityAutoDelay"));this.addDestroyFunc((()=>clearTimeout(s)))}})}const a=(0,i.QSI)(this.beans,this.eGui,this.onGridSizeChanged.bind(this));this.addDestroyFunc((()=>a())),n.register("gridCtrl",this)}isDetailGrid(){const e=(0,i.I_I)(this.getGui());return e?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),toolbarSelector:e.registry?.getSelector("AG-TOOLBAR"),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGui.clientWidth,clientHeight:this.eGui.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e,t=!1){const{view:s}=this;!1===e?s.setCursor(null):t?s.setCursor(e===i.OP3.Horizontal?"col-resize":"row-resize"):s.setCursor(e===i.OP3.Horizontal?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(t,e),o=-1===s?e?t.length-1:0:i,{gos:n,beans:{focusSvc:r,navigation:a}}=this,l=n.getCallback("tabToNextGridContainer");if(l){const i=r.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:o}),n=Zo(t[o]),u=null==i&&"gridBody"===n?"gridBody":null==(d=i)?"external":"string"==typeof d?d:"gridBody",h=l({backwards:e,previousContainer:Zo(t[s]),nextContainer:u,defaultTarget:i});if(void 0!==h){if("boolean"==typeof h)return h;if("string"==typeof h){if("gridBody"===h)return this.focusGridBodyDefault(e)||void 0;const s=t.find((e=>e.getFocusableContainerName()===h));return s?!!qo(s,e)||void 0:void $o(`tabToNextGridContainer - ${h} container not found`)}return c=h,null!=c?.headerRowIndex?r.focusHeaderPosition({headerPosition:h})||void 0:(a?.ensureCellVisible(h),r.setFocusedCell({...h,forceBrowserFocus:!0}),r.isCellFocused(h)||void 0)}}var c,d;return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:s,nextIndex:o})||void 0}focusInnerElement(e){const{gos:t,beans:s,beans:{focusSvc:o,visibleCols:n}}=this,r=t.getCallback("focusGridInnerElement");if(r?.({fromBottom:!!e}))return!0;const a=this.getFocusableContainers();if(e)return!!this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:a,indexWithFocus:a.length,nextIndex:a.length-1})||o.focusGridView({column:(0,i.GXs)(n.allCols),backwards:!0});const l=n.allCols;if(0===t.get("headerHeight")||fi(s)){if(o.focusGridView({column:l[0],backwards:e}))return!0;for(let t=1;t<a.length;t++)if((0,i.YtT)(a[t].getGui(),e))return!0;return!1}return o.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}focusNextElementOutsideContainer(e=!1){const t=[...this.additionalFocusableContainers].map((e=>e.getGui()));return this.view.focusNextElementOutsideContainer(e,t)}isFocusInsideGridBody(){const e=this.getFocusableContainers(),{indexWithFocus:t}=this.getNextFocusableIndex(e);return"gridBody"===e[t]?.getFocusableContainerName()}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){const t=this.view.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(t,e);this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:s,nextIndex:i})||this.forceFocusOutOfContainer(e)}isFocusable(){const e=this.beans;return!mi(e)||!fi(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){const s=(0,i.UlD)(this.beans),o=e.findIndex((e=>e.getGui().contains(s)));return{indexWithFocus:o,nextIndex:o+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:s,beans:{focusSvc:o,visibleCols:{allCols:n}}}=this;return e?o.focusGridView({column:(0,i.GXs)(n),backwards:!0}):0===t.get("headerHeight")||fi(s)?o.focusGridView({column:n[0]}):o.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:s,indexWithFocus:i}=e,o=t?-1:1;for(let n=e.nextIndex;n>=0&&n<s.length;n+=o){const e=s[n];if("gridBody"!==e.getFocusableContainerName()||-1!==i&&!(t?i>n:i<n)){if(qo(e,t))return!0}else if(this.focusGridBodyDefault(t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},Jo="https://www.ag-grid.com",Xo=new Set,en={},tn={},sn=!1;function on(e,t){!function(e){Yo||(Yo=e.version);const t=e=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;e.version?function(e){const[t,s]=e.version.split(".")||[],[i,o]=Yo.split(".")||[];return t===i&&s===o}(e)||Uo(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Yo}.`)):Uo(t(`'${e.moduleName}' is incompatible.`));const s=e.validate?.();s&&!s.isValid&&Uo(`${s.message}`)}(e);const s=e.rowModels??["all"];let i;Xo.add(e),void 0!==t?(sn=!0,void 0===tn[t]&&(tn[t]={}),i=tn[t]):i=en;for(const t of s)void 0===i[t]&&(i[t]={}),i[t][e.moduleName]=e;if(e.dependsOn)for(const s of e.dependsOn)on(s,t);e.onRegister?.()}function nn(e,t,s){const i=s=>!!en[s]?.[e]||!!tn[t]?.[s]?.[e];return i(s)||i("all")}function rn(){return sn}function an(e,t){const s=tn[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function ln(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const e=ln(t.dependsOn);if(e)return e}}}var cn="36.2.0",dn="_version_",un=null,hn=`${Jo}/javascript-data-grid`;var pn=new Set;var gn=[],fn=100,mn=!1,vn=[],wn=new Set;function Cn(e,t,s,i,o){if(!mn||wn.has(e))return;const n={id:e,params:t,severity:s,gridId:o,defaultMessage:i};gn.length<fn&&gn.push(n);for(const e of pn)r=o,(void 0===(a=e.gridId)||void 0===r||r===a)&&e.listener(n);var r,a}function yn(e,t){return!wn.has(e)&&function(e,t){return t.includes(e)}(t,vn)}function bn(e,t,s,i){throw new Error(`${s} #${e} `+Dn(e,t,i).join(" "))}function Sn(e,t,s,i,o){Cn(e,t,s,i,o),yn(e,s)&&bn(e,t,s,i)}var xn,Rn=200,Pn=[],En=new Set;function In(e){const t=e.map((({reasonOrId:e,moduleName:t,additionalText:s})=>JSON.stringify({reasonOrId:e,moduleName:t,additionalText:s})));return{...e[0],reports:t}}function kn(){if(void 0!==xn&&(clearTimeout(xn),xn=void 0),0===Pn.length)return;const e=Pn.splice(0,Pn.length),t=new Map;for(let s=0,i=e.length;s<i;++s){const i=e[s],o=t.get(i.gridId);o?o.push(i):t.set(i.gridId,[i])}for(const[e,s]of t){const t=In(s);Tn(Uo,Rn,t,!1),Cn(Rn,t,"error",void 0,e)}}function Fn(e,t,s,i,o,n){Tn(e,t,s,o),Sn(t,s,i,void 0,n)}function Dn(e,t,s){return un?.(e,t)??[Ln(e,t,s)]}function Tn(e,t,s,i,o){e(`${i?"warning":"error"} #${t}`,...Dn(t,s,o))}function An(e){return"object"!=typeof e&&"function"!=typeof e}function Mn(e){let t=e;return e instanceof Error?t=e.toString():Array.isArray(e)?t=function(e){const t=[];for(let s=0,i=e.length;s<i;++s){const i=e[s];An(i)&&t.push(i)}return JSON.stringify(t)}(e):"object"==typeof e&&(t=function(e){if(!e)return String(e);const t={};for(const s of Object.keys(e))An(e[s])&&(t[s]=e[s]);return JSON.stringify(t)}(e)),t}function Nn(e,t){return`${e}?${t.toString()}`}var Ln=(e,t,s)=>{const i=`${s?s+" \n":""}Visit ${function(e,t){const s=new o;if(s.append(dn,cn),t)for(const e of Object.keys(t))s.append(e,Mn(t[e]));const i=`${hn}/errors/${e}`,n=Nn(i,s);return n.length<=2e3?n:function(e,t){const s=Array.from(t.entries()).sort(((e,t)=>t[1].length-e[1].length));let i=Nn(e,t);for(const[o,n]of s){if(o===dn)continue;const s=i.length-2e3;if(s<=0)break;const r="...",a=s+r.length,l=n.length-a>100?n.slice(0,n.length-a)+r:n.slice(0,100)+r;t.set(o,l),i=Nn(e,t)}return i}(i,s)}(e,t)}`;return`${i}${s?"":" \n Alternatively register the ValidationModule to see the full message in the console."}`};function Vn(...e){Fn(jo,e[0],e[1],"warning",!0)}function _n(e,t,s){Fn(jo,t,s,"warning",!0,e)}function On(e,t,s){Tn(Uo,e,t,!1,s),Sn(e,t,"error",s)}function Bn(...e){return function(e,t){const s=t[0];return`error #${s} `+Dn(s,t[1],e).join(" ")}(void 0,e)}var Hn=(e,t)=>{for(const s of Object.keys(t))t[s]=e;return t},Gn={dispatchEvent:"CommunityCore",...Hn("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0,getGridElement:0}),...Hn("GridState",{getState:0,setState:0}),...Hn("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...Hn("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...Hn("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...Hn("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...Hn("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...Hn("ValueCache",{expireValueCache:0}),...Hn("CellApi",{getCellValue:0}),...Hn("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...Hn("Sort",{onSortChanged:0}),...Hn("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...Hn("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...Hn("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...Hn("HighlightChanges",{flashCells:0}),...Hn("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...Hn("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...Hn("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...Hn("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...Hn("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...Hn("ColumnResize",{setColumnWidths:0}),...Hn("ColumnHover",{isColumnHovered:0}),...Hn("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0,getEditValidationErrors:0}),...Hn("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...Hn("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...Hn("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...Hn("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...Hn("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...Hn("Notes",{getNote:0,setNote:0,refreshNotes:0}),...Hn("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...Hn("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...Hn("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...Hn("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...Hn("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...Hn("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...Hn("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...Hn("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...Hn("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...Hn("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...Hn("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...Hn("PdfExport",{getDataAsPdf:0,exportDataAsPdf:0}),...Hn("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...Hn("Formula",{refreshFormulas:0}),...Hn("ContextMenu",{showContextMenu:0}),...Hn("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...Hn("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...Hn("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...Hn("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...Hn("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...Hn("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...Hn("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...Hn("Toolbar",{getToolbarItemInstance:0}),...Hn("StatusBar",{getStatusPanel:0}),...Hn("AiToolkit",{getStructuredSchema:0})},zn={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},Wn=(e,t)=>e.eventSvc.dispatchEvent(t),jn=class{};function Un(e,t){e.gos.updateGridOptions({options:t})}function $n(e){e.rowModel?.onRowHeightChanged()}function Yn(e){e.rowAutoHeight?.active?e.log.warn(3):e.rowModel?.resetRowHeights()}Reflect.defineProperty(jn,"name",{value:"GridApi"});var Kn={moduleName:"CsrmSsrmSharedApi",version:cn,apiFunctions:{expandAll:function(e){e.expansionSvc?.expandAll(!0)},collapseAll:function(e){e.expansionSvc?.expandAll(!1)},resetRowGroupExpansion:function(e){e.expansionSvc?.resetExpansion()}}},qn={moduleName:"RowModelSharedApi",version:cn,apiFunctions:{onRowHeightChanged:$n,resetRowHeights:Yn}},Zn={moduleName:"SsrmInfiniteSharedApi",version:cn,apiFunctions:{setRowCount:function(e,t,s){const i=function(e){const t=e.rowModel;return"serverSide"===t.getType()?t:void 0}(e);if(i)return 0===e.rowGroupColsSvc?.columns.length?t<0?void e.log.error(238):void i.setRowCount(t,s):void e.log.error(28);Ps(e)?.setRowCount(t,s)},getCacheBlockState:function(e){return z(e.gos)?e.rowModel.getBlockStates():e.rowNodeBlockLoader?.getBlockState()??{}},isLastRowIndexKnown:function(e){return e.rowModel.isLastRowIndexKnown()}}},Qn=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.sourceRowIndex>=0)return e;t=e.childrenAfterGroup}},Jn=e=>{if(e.data)return e;let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.data)return e;t=e.childrenAfterGroup}},Xn=e=>{if(!e)return e;if("bigint"==typeof e)return e<0n?-e:e;const t=Number(e);return isNaN(t)?e:Math.abs(t)};function er(e,t,s){let o=null;"smallDown"===e?t.log.warn(262):"smallLeft"===e?t.log.warn(263):"smallRight"===e&&t.log.warn(264);const n=s?.colDef.icons;if(n&&(o=n[e]),t.gos&&!o){const s=t.gos.get("icons");s&&(o=s[e])}if(o){let s;if("function"==typeof o)s=o();else{if("string"!=typeof o)return void t.log.warn(38,{iconName:e});s=o}return"string"==typeof s?(0,i.cvw)(s):(0,i.X17)(s)?s:void t.log.warn(133,{iconName:e})}{const s=t.registry.getIcon(e);return s||t.validation?.validateIcon(e),ni({tag:"span",cls:`ag-icon ag-icon-${s??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var tr=(e,t)=>({tag:"span",ref:`eSort${e}`,cls:`ag-sort-indicator-icon ag-sort-${t} ag-hidden`,attrs:{"aria-hidden":"true"}}),sr={tag:"span",cls:"ag-sort-indicator-container",children:[tr("Order","order"),tr("Asc","ascending-icon"),tr("Desc","descending-icon"),tr("Mixed","mixed-icon"),tr("AbsoluteAsc","absolute-ascending-icon"),tr("AbsoluteDesc","absolute-descending-icon"),tr("None","none-icon")]},ir=class extends ls{constructor(e){super(),this.eSortOrder=i.dRA,this.eSortAsc=i.dRA,this.eSortDesc=i.dRA,this.eSortMixed=i.dRA,this.eSortNone=i.dRA,this.eSortAbsoluteAsc=i.dRA,this.eSortAbsoluteDesc=i.dRA,e||this.setTemplate(sr)}attachCustomElements(e,t,s,i,o,n,r){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=s,this.eSortMixed=i,this.eSortNone=o,this.eSortAbsoluteAsc=n,this.eSortAbsoluteDesc=r}setupSort(e,t=!1,s){if(this.column=e,this.suppressOrder=t,this.getSortDefOverride=s,this.setupMultiSortIndicator(),!e.isSortable()&&!e.showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,e),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,e);const i=this.updateIcons.bind(this),o=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:o,columnRowGroupChanged:o}),this.onSortChanged()}addInIcon(e,t,s){if(null==t)return;const i=er(e,this.beans,s);i&&t.appendChild(i)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const{eSortAsc:e,eSortDesc:t,eSortAbsoluteAsc:s,eSortAbsoluteDesc:o,eSortNone:n,column:r,gos:a,beans:l}=this,{isAbsoluteSort:c,isDefaultSort:d,isAscending:u,isDescending:h,direction:p}=((e,t,s)=>{const i=s?.(),o=void 0!==i?i:t.sortSvc?.getDisplaySort(e),n=mt(o?.type),r=ft(o?.direction);return{isAbsoluteSort:"absolute"===n,isDefaultSort:"default"===n,isAscending:"asc"===r,isDescending:"desc"===r,direction:r}})(r,l,this.getSortDefOverride);if(e&&(0,i.nl0)(e,u&&d,{skipAriaHidden:!0}),t&&(0,i.nl0)(t,h&&d,{skipAriaHidden:!0}),n){const e=!r.colDef.unSortIcon&&!a.get("unSortIcon");(0,i.nl0)(n,!e&&!p,{skipAriaHidden:!0})}s&&(0,i.nl0)(s,u&&c,{skipAriaHidden:!0}),o&&(0,i.nl0)(o,h&&c,{skipAriaHidden:!0})}setupMultiSortIndicator(){const{eSortMixed:e,column:t,gos:s}=this;this.addInIcon("sortUnSort",e,t);const i=t.showRowGroup;ee(s)&&i&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){const{eSortMixed:e,beans:t,column:s}=this;if(e){const o="mixed"===t.sortSvc.getDisplaySort(s)?.direction;(0,i.nl0)(e,o,{skipAriaHidden:!0})}}updateSortOrder(){const{eSortOrder:e,column:t,beans:{sortSvc:s}}=this;if(!e)return;const o=s.getDisplaySortIndex(t)??-1,n=o>=0&&s.isMultiSort();(0,i.nl0)(e,n,{skipAriaHidden:!0}),o>=0?e.textContent=(o+1).toString():(0,i.fDi)(e)}refresh(){this.onSortChanged()}},or={selector:"AG-SORT-INDICATOR",component:ir},nr=(e,t)=>{if(null!=e)return"object"==typeof e?e[mt(t)]:e},rr=(e,t)=>(e.sortIndex??2147483647)-(t.sortIndex??2147483647),ar=(e,t)=>e?t?e.type===t.type&&e.direction===t.direction:null===e.direction:!t||null===t.direction;function lr(e){const t=e?.getSortOptions();if(!t)return[];const s=t.length,i=new Array(s);for(let e=0;e<s;++e){const s=t[e];i[e]={sort:s.sort,type:s.type,colId:s.column.colId}}return i}var cr={moduleName:"Sort",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="sortSvc",this.SortIndicatorSelector=or,this.SortIndicatorComp=ir,this.cols=null,this.map=null,this.opts=null,this.multi=!1}destroy(){super.destroy(),this.invalidate()}invalidate(){this.cols=null,this.map=null,this.opts=null}progressSort(e,t,s){const{sortDef:i,index:o}=this.getNextSortDefAndIndex(e,e.getSortDef(),e.sortCycleIndex);this.setSortForColumn(e,i,t,s,o)}progressSortFromEvent(e,t){const s="ctrl"===this.gos.get("multiSortKey")?t.ctrlKey||t.metaKey:t.shiftKey;this.progressSort(e,s,"uiColumnSorted")}setSortForColumn(e,t,s,i,o){const{gos:n,showRowGroupCols:r}=this.beans,a=ee(n),l=[e];if(e.showRowGroup&&a){const t=r?.getSourceColumnsForGroupColumn?.(e);for(let e=0,s=t?.length??0;e<s;++e){const s=t[e];s.isSortable()&&l.push(s)}}for(let e=0,s=l.length;e<s;++e)this.setColSort(l[e],t,i,0===e?o:void 0);const c=a?e.showRowGroupCol:null;c&&l.push(c);const d=!s&&!n.get("alwaysMultiSort")||n.get("suppressMultiSort")?this.clearSortBarTheseColumns(l,i):[];c&&this.setColSort(c,this.getCoupledGroupSortDef(c),i),this.updateSortIndex(e);for(let e=0,t=l.length;e<t;++e)d.push(l[e]);this.dispatchSortChangedEvents(i,d)}getCoupledGroupSortDef(e){const t=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);for(let e=0,s=t?.length??0;e<s;++e){const s=t[e].getSortDef();if(s)return s}return ct()}updateSortIndex(e){const{gos:t,colModel:s}=this.beans,i=ee(t),o=i&&e.showRowGroupCol||e,n=this.getSortedCols(),r=new Map;let a=0;for(let e=0,t=n.length;e<t;++e){const t=n[e];i&&t.showRowGroup||t===o||r.set(t,a++)}o.getSortDef()&&r.set(o,a);const l=s.getAllCols();for(let e=0,t=l.length;e<t;++e){const t=l[e],s=r.get(t)??null;(t.sortIndex??null)!==s&&this.setColSortIndex(t,s)}}onSortChanged(e,t){this.invalidate(),this.dispatchSortChangedEvents(e,t)}dispatchSortChangedEvents(e,t){const s={type:"sortChanged",source:e,columns:t};this.eventSvc.dispatchEvent(s)}clearSortBarTheseColumns(e,t){const s=[],i=new Set(e),o=this.beans.colModel.getAllCols();for(let e=0,n=o.length;e<n;++e){const n=o[e];i.has(n)||(n.getSortDef()&&s.push(n),this.setColSort(n,ct(),t))}return s}getNextSortDirection(e,t){const s=void 0===t,i=s?e.getSortDef():ct(t);return this.getNextSortDefAndIndex(e,i,s?e.sortCycleIndex:0).sortDef}getNextSortDefAndIndex(e,t,s=0){const i=((e,t)=>{const s=((e,t,s)=>t.colDef.sortingOrder??e.get("sortingOrder")??(s.includes("absolute")?at:rt))(e,t,(e=>{const t=[],{sort:s,initialSort:i}=e.colDef;return null!==s&&t.push(mt(s?.type)),null!==i&&t.push(mt(i?.type)),t})(t)),i=new Array(s.length);for(let e=0,t=s.length;e<t;++e)i[e]=ct(s[e]);return i})(this.gos,e),o=i.length;if(0===o)return{sortDef:ct(),index:0};let n=-1;for(let e=s<o?s:0;e<o;++e)if(ar(i[e],t)){n=e;break}const r=-1===n||n+1>=o?0:n+1;return{sortDef:ct(i[r]),index:r}}getSortedCols(){return this.cols??this.loadSortedCols()}getIndexMap(){return this.map??this.loadIndexMap(this.getSortedCols())}loadSortedCols(){const{colModel:e,showRowGroupCols:t}=this.beans,s=ee(this.gos),i=e.pivotMode,o=e.getAllCols(),n=[];for(let e=0,t=o.length;e<t;++e){const t=o[e];if(t.getSortDef()){if(i){const e=s?t.showRowGroupCol:t.showRowGroup;if(!t.aggFunc&&t.primary&&!e)continue}n.push(t)}}n.length>1&&n.sort(rr);const r=s&&t?t.interleaveSortedColumns(n):n;return this.cols=r,r}loadIndexMap(e){const t=new Map,s=e.length,i=this.beans.showRowGroupCols;let o;if(ee(this.gos)&&i)o=i.fillCoupledSortIndexMap(e,t);else{for(let i=0;i<s;++i)t.set(e[i],i);o=s-1}return this.multi=o>=1,this.map=t,t}getSortOptions(){let e=this.opts;if(null===e){e=[];const t=this.getSortedCols();for(let s=0,i=t.length;s<i;++s){const i=t[s],o=i.getSortDef(),n=o?.direction;n&&e.push({sort:n,type:mt(o.type),column:i,colComparator:void 0,leafComparator:void 0,descending:!1,absolute:!1})}((e,t)=>{for(let s=0,i=e.length;s<i;++s){const i=e[s],o=i.column,n=i.type,r=nr(o.colDef.comparator,n);let a;if(!r&&o.showRowGroup){const e=o.field,s=e?t.getNonPivotCol(e):null;s&&(a=nr(s.colDef.comparator,n))}i.colComparator=r,i.leafComparator=a,i.descending="desc"===i.sort,i.absolute="absolute"===n}})(e,this.beans.colModel),this.opts=e}return e}getDisplaySort(e){const t=e.getSortDef();if(!e.showRowGroup||!ee(this.gos))return t;const s=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);if(!s?.length)return t;const i=null!=e.field||e.valueGetter?t:s[0].getSortDef();let o=!0;for(let e=0,t=s.length;o&&e<t;++e)o=ar(s[e].getSortDef(),i);return o?i:{type:mt(t?.type),direction:"mixed"}}getDisplaySortIndex(e){return this.getIndexMap().get(e)}isMultiSort(){return this.getIndexMap(),this.multi}setupHeader(e,t){const s=()=>{const{type:s,direction:i}=ct(t.getSortDef());if(e.toggleCss("ag-header-cell-sorted-asc","asc"===i),e.toggleCss("ag-header-cell-sorted-desc","desc"===i),e.toggleCss("ag-header-cell-sorted-abs-asc","absolute"===s&&"asc"===i),e.toggleCss("ag-header-cell-sorted-abs-desc","absolute"===s&&"desc"===i),e.toggleCss("ag-header-cell-sorted-none",!i),t.showRowGroup){const s=this.beans.showRowGroupCols?.isGroupSortMixed(t,i)??!0;e.toggleCss("ag-header-cell-sorted-mixed",s)}};e.addManagedEventListeners({sortChanged:s,columnPinned:s,columnRowGroupChanged:s,displayedColumnsChanged:s}),s()}initCol(e){const{sortIndex:t,initialSortIndex:s}=e.colDef,i=It(e.colDef);i&&e.setSortDef(i);const o=void 0!==t?t:s;null!=o&&(e.sortIndex=o)}updateColSort(e,t,s){void 0!==t&&this.setColSort(e,ct(t),s)}setColSort(e,t,s,i){const o=e.getSortDef();e.sortCycleIndex=i,ar(o,t)||(!!o?.direction!=!!t.direction?this.invalidate():this.opts=null,e.setSortDef(t),e.dispatchColEvent("sortChanged",s)),e.dispatchStateUpdatedEvent("sort")}setColSortIndex(e,t){e.sortIndex=t,this.invalidate(),e.dispatchStateUpdatedEvent("sortIndex")}},class extends ke{constructor(){super(...arguments),this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=B(this.gos)?Qn:Jn;const e=()=>{this.pivotActive=this.colModel.isPivotActive()},t=()=>{const e=this.gos;this.accentedSort=!!e.get("accentedSort"),this.primaryColumnsSortGroups=ee(e)};this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],t),this.addManagedEventListeners({columnPivotModeChanged:e,columnPivotChanged:e}),t(),e()}wireBeans(e){this.colModel=e.colModel,this.formula=e.formula,this.valueSvc=e.valueSvc}doFullSortInPlace(e,t){return e.sort(((e,s)=>this.compareRowNodes(t,e,s)))}compareRowNodes(e,t,s){const o=this.accentedSort;for(let n=0,r=e.length;n<r;++n){const r=e[n],a=r.column,l=r.descending,c=this.getValue(t,a),d=this.getValue(s,a),u=r.colComparator??(t.group?void 0:r.leafComparator);let h;if(h=u?u(c,d,t,s,l):r.absolute?(0,i.j0N)(Xn(c),Xn(d),o):(0,i.j0N)(c,d,o),h)return l?-h:h}return 0}getValue(e,t){if(this.primaryColumnsSortGroups){if(e.rowGroupColumn===t)return this.getGroupDataValue(e,t);if(e.group&&t.showRowGroup)return}const s=this.valueSvc.getValueFromData(t,e);if(t.allowFormula){const i=this.formula;if(i?.isFormula(s))return i.resolveValue(t,e)}return s}getGroupDataValue(e,t){if(ie(this.gos,this.pivotActive)){const s=this.firstLeaf(e);return s&&this.valueSvc.getValueFromData(t,s)}const s=t.showRowGroupCol;return s?e.groupData?.[s.colId]:void 0}}],apiFunctions:{onSortChanged:function(e){e.sortSvc?.onSortChanged("api")}},userComponents:{agSortIndicator:ir},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},dr=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},ur=class extends ke{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},pr(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){this.dispatchRowDataUpdateStarted(e),this.destroyAllNodes();const t=pr(this.rootNode),s=new Array(e.length);t._leafs=s;let i=0;const o=this.beans.groupStage?.getNestedDataGetter(),n=o?new Set:null,r=(e,t)=>{const a=e.level+1;for(let l=0,c=t.length;l<c;++l){const c=t[l];if(!c)continue;const d=this.createRowNode(c,a,i);if(s[i++]=d,n&&!n.has(c)){n.add(c),d.treeParent=e;const t=o(c);t&&r(d,t)}}};r(t,e),s.length=i}destroyAllNodes(){const{selectionSvc:e,pinnedRowModel:t,groupStage:s}=this.beans;e?.reset("rowDataChanged"),t?.isManual()&&t.reset(),s?.clearNonLeafs();const i=this.rootNode._leafs;if(i)for(let e=0,t=i.length;e<t;++e)i[e]._destroy(null);this.allNodesMap=Object.create(null),this.nextId=0}setImmutableRowData(e,t){const{rootNode:s,gos:i}=this;this.dispatchRowDataUpdateStarted(t);const o=ne(this.beans),n=e.changedRowNodes,{adds:r,updates:a}=n,l=new Set,c=this.beans.groupStage?.getNestedDataGetter();let d=!!i.get("suppressMaintainUnsortedOrder")&&void 0,u=-1,h=!1;const p=(e,t)=>{if(!d&&void 0!==d){const t=e.sourceRowIndex;d=t<=u,u=t}e.data!==t&&(e.updateData(t),r.has(e)||a.add(e))},g=(e,t,s)=>{for(let i=0,n=t.length;i<n;++i){const n=t[i];if(!n)continue;let a=this.getRowNode(o({data:n,level:s}));if(a?(p(a,n),h||(h=!!c&&a.treeParent!==e)):(a=this.createRowNode(n,s),r.add(a)),!c||l.has(a)){l.add(a);continue}l.add(a),a.treeParent=e;const d=c(n);d&&g(a,d,s+1)}};g(s,t,0);const f=this.deleteUnusedNodes(l,n,!!e.animate)||d||r.size>0;if(f){const e=s._leafs??(s._leafs=[]);void 0===d?vr(e,l,n):mr(e,l)&&(n.reordered=!0)}(f||h||a.size)&&(e.rowDataUpdated=!0)}deleteUnusedNodes(e,{removals:t},s){const i=this.rootNode._leafs,o=this.beans.selectionSvc;for(let n=0,r=i.length;n<r;n++){const r=i[n];e.has(r)||this.destroyNode(r,s)&&(t.push(r),r.isSelected()&&o?.removeFromSelection?.(r,"rowDataChanged"))}return t.length>0}updateRowData(e,t,s){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return this.warn(268),{remove:[],update:[],add:[]};const i=ne(this.beans);return{remove:this.executeRemove(i,e,t,s),update:this.executeUpdate(i,e,t),add:this.executeAdd(e,t)}}executeRemove(e,{remove:t},{adds:s,updates:i,removals:o},n){const r=this.rootNode._leafs,a=r?.length,l=t?.length;if(!l||!a)return[];const c=this.beans.selectionSvc;let d=0,u=a,h=0;const p=new Array(l);for(let r=0;r<l;++r){const a=this.lookupNode(e,t[r]);if(!a)continue;const l=a.sourceRowIndex;l<u&&(u=l),l>h&&(h=l),p[d++]=a,this.destroyNode(a,n)&&(a.isSelected()&&c?.removeFromSelection?.(a,"rowDataChanged"),s.delete(a)||(i.delete(a),o.push(a)))}return p.length=d,d&&fr(r,u,h),p}executeUpdate(e,{update:t},{adds:s,updates:i}){const o=t?.length;if(!o)return[];const n=new Array(o);let r=0;for(let a=0;a<o;a++){const o=t[a],l=this.lookupNode(e,o);l&&(l.updateData(o),n[r++]=l,s.has(l)||i.add(l))}return n.length=r,n}executeAdd(e,t){var s;const i=(s=this.rootNode)._leafs??(s._leafs=[]),o=i.length,n=e.add,r=n?.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(i,e.addIndex);if(l<o){for(let e=o-1,t=a-1;e>=l;--e){const s=i[e];s.sourceRowIndex=t,i[t--]=s}t.reordered=!0}i.length=a;const c=new Array(r),d=t.adds;for(let e=0;e<r;e++){const t=this.createRowNode(n[e],0,l);d.add(t),i[l]=t,c[e]=t,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null})}createRowNode(e,t,s){const i=new Ds(this.beans);i.parent=this.rootNode,i.level=t,i.group=!1,null!=s&&(i.sourceRowIndex=s),i.setDataAndId(e,String(this.nextId++));const o=i.id,n=this.allNodesMap;return n[o]&&this.warn(2,{nodeId:o}),n[o]=i,i}destroyNode(e,t){if(!e._destroy(t))return!1;const s=e.id,i=this.allNodesMap;return i[s]===e&&delete i[s],!0}lookupNode(e,t){if(!e)return gr(this.beans.log,this.rootNode._leafs,t);const s=e({data:t,level:0});return this.allNodesMap[s]||(this.error(4,{id:s}),null)}sanitizeAddIndex(e,t){const s=e.length;if("number"!=typeof t)return s;if(t<0||t>=s||Number.isNaN(t))return s;t=Math.ceil(t);const i=this.gos;return t>0&&i.get("treeData")&&i.get("getDataPath")&&(t=hr(e,t)),t}},hr=(e,t)=>{for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i?.rowIndex==t-1)return s+1}return t},pr=e=>{e.group=!0,e.level=-1,e._expanded=!0,e.id=Nt,0!==e._leafs?.length&&(e._leafs=[]);const t=[],s=[],i=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=i,e.childrenAfterFilter=o;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=s,n.childrenAfterAggFilter=i,n.childrenAfterFilter=o,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},gr=(e,t,s)=>{if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.data===s)return i}return e.error(5,{data:s}),null},fr=(e,t,s)=>{for(let i=t=Math.max(0,t),o=e.length;i<o;++i){const o=e[i];i<=s&&o.destroyed||(o.sourceRowIndex=t,e[t++]=o)}e.length=t},mr=(e,t)=>{const s=t.size;e.length=s;let i=0,o=!1,n=!1;for(const s of t){const t=s.sourceRowIndex;t===i?n||(n=o):(t>=0?n=!0:o=!0,s.sourceRowIndex=i,e[i]=s),++i}return n},vr=(e,t,{adds:s})=>{const i=e.length,o=t.size;o>i&&(e.length=o);let n=0;for(let t=0;t<i;++t){const s=e[t];s.destroyed||(n!==t&&(s.sourceRowIndex=n,e[n]=s),++n)}for(const t of s)t.sourceRowIndex<0&&(t.sourceRowIndex=n,e[n++]=t);e.length=n},wr=(e,t,s)=>{const i=e.slice(0,t);for(let o=t+1;o<s;++o){const t=e[o];t.softFiltered||(t.setUiLevel(0),i.push(t))}return i},Cr=(e,t)=>{const s=t.childrenAfterGroup;if(s)for(let t=0,i=s.length;t<i;++t){const i=s[t];i.data&&e.push(i),i.group&&Cr(e,i)}},yr=(e,t,s,i,o,n)=>{const r=i>0?o.slice(0,i):[];for(;s<t;){const t=e[s++];n.doesRowPassFilter(t)&&r.push(t)}return r},br={moduleName:"ClientSideRowModel",version:cn,rowModels:["clientSide"],beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.hierarchical=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowsToRender=this.rowsToDisplay,this.loadingRows=null,this.formulaRows=[],this.positionedRows=[],this.positionedRowsNext=[],this.positioningRows=0,this.stages=null,this.asyncTransactions=null,this.started=!1,this.refreshingData=!1,this.rowDataUpdatedPending=!1,this.refreshingModel=!1,this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1,this.rowNodesCountReady=!1,this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=(0,i.pkA)(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new Ds(e);this.rootNode=t,this.nodeManager=this.createBean(new ur(t));const s=()=>{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:s,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.onPivotChanged.bind(this),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,s=[e.groupStage,e.filterStage,e.groupFilterStage,e.pivotStage,e.aggStage,e.sortStage,e.groupSortStage,e.filterAggStage,e.flattenStage].filter((e=>!!e));this.stages=s;for(let e=s.length-1;e>=0;--e){const i=s[e].refreshProps;if(i)for(const s of i)t.set(s,e)}this.addManagedPropertyListeners([...t.keys(),"rowData"],(e=>{const t=e.changeSet?.properties;t&&this.onPropChange(t)})),this.addManagedPropertyListener("rowHeight",(()=>this.resetRowHeights())),K(this,(()=>{this.beans.rowAutoHeight?.active||this.resetRowHeights()})),this.addManagedPropertyListeners(["loading","loadingRows"],(()=>this.onLoadingRowsChanged()))}start(){this.updateLoadingRows(),this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):(this.setInitialData(),this.loadingRows&&!this.rowNodesCountReady&&this.refreshModel({step:"nothing"}))}onLoadingRowsChanged(){this.updateLoadingRows()&&this.started&&this.refreshModel({step:"nothing",keepRenderedRows:!1,animate:!1})}updateLoadingRows(){if(!H(this.gos)){const e=this.loadingRows;if(this.loadingRows=null,this.rowsToRender=this.rowsToDisplay,!e)return!1;for(const t of e)t._destroy(null);return!0}const e=function(e){const t=e.get("loadingRows");return t&&"object"==typeof t&&null!=t.rowCount&&Number.isInteger(t.rowCount)&&t.rowCount>0?t.rowCount:10}(this.gos),t=null==this.loadingRows,s=this.loadingRows??(this.loadingRows=[]);this.rowsToRender=s;let i=t;const o=q(this.beans);for(;s.length<e;){const e=new Ds(this.beans);e.parent=this.rootNode,e.level=0,e.uiLevel=0,e.group=!1,e.stub=!0,e.selectable=!1,e.setRowHeight(o),s.push(e),i=!0}for(;s.length>e;)s.pop()._destroy(null),i=!0;return i}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,s,i){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,s),c=Math.min(a,i);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=Y(this.beans,t);t.setRowHeight(e.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}onPropChange(e){const{nodeManager:t,gos:s,beans:i}=this,o=i.groupStage;if(!t)return;const n=new Set(e),r=o?.onPropChange(n);let a;n.has("rowData")?a=s.get("rowData"):r&&(a=o?.extractData()),a&&!Array.isArray(a)&&(a=null,this.warn(1));const l={step:"nothing",changedProps:n};if(a){const e=!r&&!!this.rootNode?._leafs?.length&&a.length>0&&s.exists("getRowId")&&!s.get("resetRowDataOnUpdate");this.refreshingData=!0,e?(l.keepRenderedRows=!0,l.animate=!s.get("suppressAnimationFrame"),l.changedRowNodes=new dr,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:s}=this;if(!t)return null;const i=t.length;let o=i;for(let t=0,i=e.length;t<i&&o;++t)o=Math.min(o,s.get(e[t])??o);return o<i?t[o].step:null}setRowTopAndRowIndex(){if(this.positioningRows)++this.positioningRows;else{this.positioningRows=1;try{this.positionAndClearRows(),this.positioningRows>1&&this.positionAndClearRows()}finally{this.positioningRows=0}}}positionAndClearRows(){const e=this.positionedRows,t=this.positionedRowsNext;this.positionedRows=t,this.positionedRowsNext=e,t.length=0;try{this.positionRows(t),this.updateFormulaRowIndexes(),this.clearStaleRowTops(e)}catch(t){throw this.retainStaleRows(e),t}}updateFormulaRowIndexes(){if(this.beans.formula?.isEvaluationActive()){const e=this.formulaRows;for(let t=0,s=e.length;t<s;++t)e[t].formulaRowIndex=t}}positionRows(e){const t=this.beans,s=this.rowsToRender,i=t.environment.getDefaultRowHeight();let o=0;const n=j(t)||!t.environment.sizesMeasured;for(let r=0,a=s.length;r<a;++r){const a=s[r];if(e[r]=a,null==a.rowHeight){const e=Y(t,a,n,i);a.setRowHeight(e.height,e.estimated)}a.setRowTop(o),a.setRowIndex(r),o+=a.rowHeight}}clearStaleRowTops(e){const t=this.rowsToRender;for(const s of e){const e=s.rowIndex;null!=e&&t[e]===s||s.destroyed||s.clearRowTopAndRowIndex()}e.length=0}retainStaleRows(e){const t=this.positionedRows,s=this.rowsToRender,i=t.length;for(const o of e){const e=o.rowIndex;(null==e||e>=i||s[e]!==o)&&t.push(o)}e.length=0}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToRender.length}getTopLevelRowCount(){if(this.loadingRows)return this.loadingRows.length;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=e.sibling?.displayed?1:0;return(e.childrenAfterSort?.length??0)+s}getTopLevelRowDisplayedIndex(e){if(this.loadingRows)return e;const{beans:t,rootNode:s,rowsToDisplay:i}=this;if(!s||!i.length||i[0]===s)return e;const o=s.childrenAfterSort,n=e=>{let t=o[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r=t.footerSvc;return r?r?.getTopDisplayIndex(i,e,o,n):n(e)}getTopLevelIndexFromDisplayedIndex(e){if(this.loadingRows)return e;const{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let i=this.getRow(e).primaryRow,o=i.parent;for(;o&&o!==t;)i=o,o=i.parent;const n=t.childrenAfterSort?.indexOf(i)??-1;return n>=0?n:e}getRowBounds(e){const t=this.rowsToRender[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:J(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const e=0===t.length||t.some((e=>e.isPrimary()))?"filter":"filter_aggregates";this.refreshModel({step:e,keepRenderedRows:!0,animate:J(this.gos)})}}onPivotChanged(){this.beans.filterManager?.isAnyFilterPresent()||this.refreshModel({step:"pivot"})}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:J(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:s,rowDataUpdated:i}=e;return!(!t||s||!i||t.removals.length||t.adds.size)}reMapRows(){if(this.refreshingModel||this.refreshingData)return this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,void(this.noAnimate=!0);this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(e){const{nodeManager:t,eventSvc:s,started:i}=this;if(!t)return;const o=!!e.rowDataUpdated;i&&o&&s.dispatchEvent({type:"rowDataUpdated"});const n=this.isSuppressModelUpdateAfterUpdateTransaction(e);if(this.deferRefresh(n)){this.setPendingRefreshFlags(e),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=o);const t=this.beans.selectionSvc;return void(o&&i&&!this.refreshingModel&&t&&(n?t.updateSelectableAfterGrouping(void 0,e.changedRowNodes):t.flushPendingSelectionChanged?.()))}this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.updateRefreshParams(e);let r=!1;this.refreshingModel=!0;try{this.executeRefresh(e,o),r=!0}finally{this.refreshingData=!1,this.refreshingModel=!1,r||this.setPendingRefreshFlags(e)}this.clearPendingRefreshFlags(),this.beans.formula?.onRowsChanged(e.changedRowNodes,e.newData),s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}executeRefresh(e,t){const{beans:s,rootNode:i}=this;s.masterDetailSvc?.refreshModel(e),t&&"group"!==e.step&&s.colFilter?.refreshModel();let o=e.changedPath;switch(o?.addRow(i),"group"===e.step&&(this.doGrouping(i,e),o??(o=e.changedPath),s.selectionSvc?.updateSelectableAfterGrouping(o,e.changedRowNodes)),o??(o=s.changedPathFactory?.ensureRowsPath(e,i)),e.step){case"group":case"filter":this.doFilter(o);case"pivot":this.doPivot(o,e.changedProps)&&(o=void 0,e.changedPath=void 0);case"aggregate":this.doAggregate(o);case"filter_aggregates":this.doFilterAggregates(o);case"sort":this.doSort(o,e.changedRowNodes);case"map":this.doRowsToDisplay()}this.setRowTopAndRowIndex(),this.updateRefreshParams(e)}deferRefresh(e){return!(!this.refreshingModel&&!this.beans.colModel.changeEventsDispatching&&(e?(this.started&&(this.refreshingData=!1),0):this.started))}setPendingRefreshFlags(e){this.pendingNewData||(this.pendingNewData=!!e.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!e.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!e.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!e.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(e){e.newData=this.pendingNewData||!!e.newData,e.keepRenderedRows=!this.noKeepRenderedRows&&!!e.keepRenderedRows,e.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!e.keepUndoRedoStack,e.animate=!this.noAnimate&&!!e.animate}isEmpty(){return!(this.loadingRows||this.rootNode?._leafs?.length&&this.beans.colModel?.ready)}isRowsToRender(){return this.rowsToRender.length>0}getOverlayType(){const{beans:e,gos:t}=this;if(this.loadingRows)return null;if(this.rootNode?._leafs?.length){if(e.filterManager?.isAnyFilterPresent()&&0===this.getRowCount())return"noMatchingRows"}else if(this.rowCountReady||0==(t.get("rowData")?.length??0))return"noRows";return null}getNodesInRangeForSelection(e,t){const s=we(this.gos),i=s?e:Ns(e),o=s?t:Ns(t);if(!i||!o)return null;let n=!1,r=!1;const a=[],l=e=>(r=!0,!(!s||!e.group||(Cr(a,e),0)));return this.forEachNodeAfterFilterAndSort((e=>{if(!r&&(!n||e!==o&&e!==i||!l(e))){if(!n){if(e!==o&&e!==i)return;if(n=!0,o===i&&l(e))return}(!e.group||!s)&&(s||null!=e.rowIndex)&&a.push(e)}})),a}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToRender[e]}getFormulaRow(e){return this.formulaRows[e]}isRowPresent(e){return this.rowsToRender.includes(e)}getRowIndexAtPixel(e){const t=this.rowsToRender,s=t.length;if(this.isEmpty()||0===s)return-1;let i=0,o=s-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let n=-1,r=-1;for(;;){const s=Math.floor((i+o)/2),a=t[s];if(this.isRowInPixel(a,e))return s;if(a.rowTop<e?i=s+1:a.rowTop>e&&(o=s-1),n===i&&r===o)return s;n=i,r=o}}isRowInPixel(e,t){const s=e.rowTop,i=s+e.rowHeight;return s<=t&&i>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let s=0,i=t.length;s<i;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToRender;for(let s=0,i=t.length;s<i;++s)e(t[s],s)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,(e=>e.childrenAfterAggFilter))}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,(e=>e.childrenAfterSort))}forEachPivotNode(e,t,s){const{colModel:i,rowGroupColsSvc:o}=this.beans;if(!i.pivotMode)return;if(!o?.columns.length)return void e(this.rootNode,0);const n=s?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,(e=>e.leafGroup?null:e[n]))}depthFirstSearchRowNodes(e,t=!1,s=e=>e.childrenAfterGroup,i=this.rootNode,o=0){let n=o;if(!i)return n;const r=i===this.rootNode;if(r||e(i,n++),i.hasChildren()&&!i.footer){const o=r||this.hierarchical?s(i):null;if(o){const a=this.beans.footerSvc;n=a?.addTotalRows(n,i,e,t,r,"top")??n;for(const i of o)n=this.depthFirstSearchRowNodes(e,t,s,i,n);return a?.addTotalRows(n,i,e,t,r,"bottom")??n}}return n}doAggregate(e){this.rootNode&&this.beans.aggStage?.execute(e)}doFilterAggregates(e){if(this.hierarchical){const t=this.beans.filterAggStage;if(t)return void t.execute(e)}const t=this.rootNode;t.childrenAfterAggFilter=t.childrenAfterFilter;const s=t.sibling;s&&(s.childrenAfterAggFilter=t.childrenAfterFilter)}doSort(e,t){const s=this.beans;(this.hierarchical&&s.groupSortStage||s.sortStage).execute(e,t)}doGrouping(e,t){const s=this.beans.groupStage,i=s?.execute(t);if(void 0===i){const t=e._leafs;e.childrenAfterGroup=t,e.updateHasChildren();const s=e.sibling;s&&(s.childrenAfterGroup=t)}(i||t.rowDataUpdated)&&this.beans.colFilter?.refreshModel(),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans;(this.hierarchical&&t.groupFilterStage||t.filterStage).execute(e);const s=this.rootNode,i=s.sibling;i&&(i.childrenAfterFilter=s.childrenAfterFilter)}doPivot(e,t){return this.beans.pivotStage?.execute(e,t)??!1}getRowNode(e){"string"!=typeof e&&(e=String(e));const t=this.nodeManager?.getRowNode(e);if("object"==typeof t)return t;const s=this.beans.groupStage?.getNonLeaf(e);return s||this.getSpecialRowNode(e)}getSpecialRowNode(e){if(e===Nt)return this.rootNode??void 0;if(e===Vt){const e=this.rootNode?.sibling;return e?.footer?e:void 0}if(e.startsWith(Lt)){const t=e.slice(15),s=this.getRowNode(t);return s?.sibling?.footer?s.sibling:void 0}if(e.startsWith("detail_")){const t=e.slice(7),s=this.nodeManager?.getRowNode(t);if("object"==typeof s&&s.detailNode?.id===e)return s.detailNode}}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout((()=>this.executeBatchUpdateRowData()),e)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:s,asyncTransactions:i}=this;if(!e)return;t.valueCache?.onDataChanged();const o=[],n=[],r=new dr,a=!this.gos.get("suppressAnimationFrame");for(const{rowDataTransaction:t,callback:s}of i??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;const i=e.updateRowData(t,r,a);o.push(i),s&&n.push(s.bind(null,i))}this.commitTransactions(r,a),n.length>0&&setTimeout((()=>{for(let e=0,t=n.length;e<t;e++)n[e]()}),0),o.length>0&&s.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=void 0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const s=new dr,i=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;const o=t.updateRowData(e,s,i);return this.commitTransactions(s,i),o}commitTransactions(e,t){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:t,changedRowNodes:e})}doRowsToDisplay(){const{rootNode:e,beans:t}=this,{formula:s,flattenStage:i}=t;let o;if(s?.active){const t=e?.childrenAfterSort??[];this.formulaRows=t,o=(e=>{for(let t=0,s=e.length;t<s;++t){const i=e[t];if(i.softFiltered)return wr(e,t,s);i.setUiLevel(0)}return e})(t)}else if(i)o=i.execute();else{o=e?.childrenAfterSort??[];for(let e=0,t=o.length;e<t;++e)o[e].setUiLevel(0)}this.rowsToDisplay=o,s?.active||(this.formulaRows=s?.isEvaluationActive()?o:[]),this.loadingRows||(this.rowsToRender=o)}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes(),s=q(this.beans),i=this.loadingRows;if(i)for(const e of i)e.setRowHeight(s);e.setRowHeight(e.rowHeight,!0);const o=e.sibling;o?.setRowHeight(o.rowHeight,!0),(t||i)&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t=>{t.setRowHeight(t.rowHeight,!0);const s=t.detailNode;s?.setRowHeight(s.rowHeight,!0);const i=t.sibling;i?.setRowHeight(i.rowHeight,!0),e=!0})),e}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy();const e=this.loadingRows;if(e)for(const t of e)t._destroy(null);this.loadingRows=null,this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.rowsToRender=[],this.positionedRows.length=0,this.positionedRowsNext.length=0,this.asyncTransactions=null,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},class extends ke{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=null}wireBeans(e){this.filterManager=e.filterManager}execute(){const e=this.beans,t=e.rowModel.rootNode,s=t.childrenAfterGroup,i=s.length,o=this.filterManager,n=!!o?.isChildFilterPresent();if(e.formula?.active)if(t.childrenAfterFilter=s,n)for(let e=0;e<i;++e){const t=s[e];t.softFiltered=!o.doesRowPassFilter(t)}else for(let e=0;e<i;++e)s[e].softFiltered=!1;else t.childrenAfterFilter=n?((e,t,s,i)=>{const o=s.length;let n=0;for(let r=0;r<t;++r){const a=e[r];if(i.doesRowPassFilter(a)){if(n>=o||s[n]!==a)return yr(e,t,r,n,s,i);++n}else if(n<o)return yr(e,t,r,n,s,i)}return n===o?s:e})(s,i,t.childrenAfterFilter??s,o):s}},class extends ke{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","accentedSort"]}execute(e,t){const{rowModel:s,sortSvc:o,rowNodeSorter:n}=this.beans,r=s.rootNode,a=o.getSortOptions(),l=a.length>0,c=this.gos.getCallback("postSortRows"),d=l&&!c&&this.gos.get("deltaSort")&&t,u=r.childrenAfterSort,h=r.childrenAfterAggFilter;let p;p=l?d?((e,t,s,i,o)=>{const n=t.childrenAfterSort,r=t.childrenAfterAggFilter;if(!r)return n&&n.length>0?n:[];const a=r.length;if(a<=1)return n?.length!==a||0!==a&&n[0]!==r[0]?r.slice():n;if(!n||a<=4)return e.doFullSortInPlace(r.slice(),o);const l=new Map,{updates:c,adds:d}=s,u=[];for(let e=0;e<a;++e){const t=r[e];c.has(t)||d.has(t)||i?.hasRow(t)?(l.set(t,~e),u.push(t)):l.set(t,e)}const h=u.length;return 0===h?a===n.length?n:((e,t,s)=>{let i=0;s.length=t.size;for(let o=0,n=e.length;o<n;++o){const n=e[o];t.has(n)&&(s[i++]=n)}return s.length=i,s})(n,l,u):(u.sort(((t,s)=>e.compareRowNodes(o,t,s)||~l.get(t)-~l.get(s))),h===a?u:((e,t,s,i,o,n)=>{const r=new Array(n);let a,l=0,c=s[l],d=-1,u=0,h=0;const p=s.length,g=i.length;for(;;){if(d<0){if(u>=g)break;if(a=i[u++],d=o.get(a)??-1,d<0)continue}if((e.compareRowNodes(t,c,a)||~o.get(c)-d)<0){if(r[h++]=c,++l>=p)break;c=s[l]}else r[h++]=a,d=-1}for(;l<p;)r[h++]=s[l++];if(d<0)return r;for(r[h++]=a;u<g;){const e=i[u++];o.get(e)>=0&&(r[h++]=e)}return r})(e,o,u,n,l,a))})(n,r,d,e,a):n.doFullSortInPlace(h?.slice()??[],a):(0,i.qiO)(u,h),r.childrenAfterSort=p,(e=>{const t=e.childrenAfterSort,s=e.sibling;if(s&&(s.childrenAfterSort=t),t)for(let e=0,s=t.length-1;e<=s;e++){const i=t[e],o=0===e,n=e===s;i.firstChild!==o&&(i.firstChild=o,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==n&&(i.lastChild=n,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==e&&(i.childIndex=e,i.dispatchRowEvent("childIndexChanged"))}})(r),c?.({nodes:p})}}],dependsOn:[cr]},Sr={moduleName:"ClientSideRowModelApi",version:cn,apiFunctions:{onGroupExpandedOrCollapsed:function(e){e.expansionSvc?.onGroupExpandedOrCollapsed()},refreshClientSideRowModel:function(e,t){const s=Rs(e);s&&(t&&"everything"!==t||(t="group"),s.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))},isRowDataEmpty:function(e){return Rs(e)?.isEmpty()??!0},forEachLeafNode:function(e,t){Rs(e)?.forEachLeafNode(t)},forEachNodeAfterFilter:function(e,t){Rs(e)?.forEachNodeAfterFilter(t)},forEachNodeAfterFilterAndSort:function(e,t){Rs(e)?.forEachNodeAfterFilterAndSort(t)},applyTransaction:function(e,t){return e.frameworkOverrides.wrapIncoming((()=>Rs(e)?.updateRowData(t)))},applyTransactionAsync:function(e,t,s){e.frameworkOverrides.wrapIncoming((()=>Rs(e)?.batchUpdateRowData(t,s)))},flushAsyncTransactions:function(e){e.frameworkOverrides.wrapIncoming((()=>Rs(e)?.flushAsyncTransactions()))},getBestCostNodeSelection:function(e){return e.selectionSvc?.getBestCostNodeSelection()},resetRowHeights:Yn,onRowHeightChanged:$n},dependsOn:[Kn,qn]},xr={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},Rr={tag:"div",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]};function Pr(e,t){const s=j(e),i=t;let o,n;null!=i.clientX||null!=i.clientY?(o=i.clientX,n=i.clientY):(o=i.x,n=i.y,n-=function(e,t){const{eGridViewport:s,eScrollingRows:i}=e.ctrlsSvc.getGridBodyCtrl(),o=t.dropZoneTarget??s;if(!i)return 0;const n=i.getBoundingClientRect().top-o.getBoundingClientRect().top+s.scrollTop;return n>0?n:0}(e,t));const{pageFirstPixel:r}=e.pageBounds.getCurrentPagePixelRange();if(n+=r,s){const t=e.ctrlsSvc.getScrollFeature(),s=t.getVScrollPosition();o+=t.getHScrollPosition().left,n+=s.top}return{x:o,y:n}}var Er=class extends ke{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,(t=>{const s=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,o=new i.MSA({scrollContainer:t.gridBodyCtrl.eGridViewport,scrollAxis:"y",getVerticalPosition:s,setVerticalPosition:e=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(e),getTopOffset:()=>t.gridBodyCtrl.getTopPinnedRowsOffset(),onScrollCallback:()=>{const t=s();if(this.autoScrollOldV!==t)return this.autoScrollOldV=t,void(this.autoScrollChanging=!0);const i=this.autoScrollChanging;this.autoScrollChanged=i,this.autoScrollChanging=!1,i&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=o,this.clearAutoScroll()}))}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(e){return!1===e?.dropTarget?.allowed||"visible"!==this.beans.rowDragSvc.visibility?"notAllowed":"move"}getRowNodes(e){const t=e.dragItem.rowNodes||[];return!this.isFromThisGrid(e)||t.length<=1?t:t.slice().sort(kr)}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:s,beans:i}=this;if(t){const t=this.getRowNodes(e);e.dragItem.rowNodes=t,Fr(t,!0)}this.lastDraggingEvent=e;const o=e.fromNudge,n=this.makeRowsDrop(s,e,o,!1);i.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const r=this.autoScroll;n?.rowDragManaged&&n.moved&&n.allowed&&n.sameGrid&&!n.suppressMoveWhenRowDragging&&(!o&&!r?.scrolling||this.autoScrollChanged)&&this.dropRows(n),r?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,s,i){const{beans:o,gos:n}=this,r=this.newRowsDrop(t,i),a=o.rowModel;if(t.dropTarget=r,t.changed=!1,!r)return null;const{sameGrid:l,rootNode:c,source:d}=r;let{target:u}=r;u??(u=a.getRow(a.getRowCount()-1)??null);const h=this.beans.groupEditSvc,p=!!h?.canSetParent(r);let g=null;if(u?.footer){const e=Ms(a,-1,u)??Ms(a,1,u);p&&(g=u.sibling??c),u=e??null}u?.detail&&(u=u.parent),r.moved&&(r.moved=d!==u);let f=.5;if(u&&(f=l&&r.moved&&(g||!p)?d.rowIndex>u.rowIndex?-.5:.5:(r.y-u.rowTop-u.rowHeight/2)/u.rowHeight||0),!p&&l&&u&&r.moved&&B(n)){const e=Dr(a,r);e&&(f=d.rowIndex>e.rowIndex?-.5:.5,u=e,r.moved&&(r.moved=d!==u))}return r.target=u,r.newParent=g,r.pointerPos=Tr(u,r.y),r.yDelta=f,h?.fixRowsDrop(r,p,s,f),this.validateRowsDrop(r,p,i),t.changed||(t.changed=Ir(e?.dropTarget,r)),r}newRowsDrop(e,t){const{beans:s,gos:i}=this,o=s.rowModel.rootNode,n=!!B(i)&&i.get("rowDragManaged"),r=i.get("suppressMoveWhenRowDragging"),a=this.isFromThisGrid(e);let{rowNode:l,rowNodes:c}=e.dragItem;if(c||(c=l?[l]:[]),l||(l=c[0]),!l||!o)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let u=!0;!n||c.length&&"visible"===s.rowDragSvc.visibility&&(!r&&a||d)||(u=!1);const h=Pr(s,e).y,p=this.getOverNode(h);return{api:s.gridApi,context:s.gridOptions.context,draggingEvent:e,rowDragManaged:n,suppressMoveWhenRowDragging:r,sameGrid:a,withinGrid:d,treeData:!1,rootNode:o,moved:l!==p,y:h,overNode:p,overIndex:p?.rowIndex??-1,pointerPos:"none",position:"none",source:l,target:p??null,newParent:null,rows:c,allowed:u,highlight:!t&&n&&r&&(d||!a),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,s){const{source:i,target:o,yDelta:n,inside:r,moved:a,rowDragManaged:l,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=i!==o);const{position:d,fallbackPosition:u}=this.computeDropPosition(a,r,n);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const h=(!l||e.allowed)&&this.gos.get("isRowValidDropPosition");h&&this.applyDropValidator(e,t,s,l,h),l&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),"inside"!==e.position||e.allowed&&e.newParent||(e.position=u)}computeDropPosition(e,t,s){const i=s<0?"above":"below";return e?{position:t?"inside":i,fallbackPosition:i}:{position:"none",fallbackPosition:i}}enforceSuppressMoveWhenRowDragging(e,t,s){t&&("initial"!==s?e.rows.length&&"none"!==e.position||(e.allowed=!1):e.moved||(e.allowed=!1))}applyDropValidator(e,t,s,i,o){this.beans.groupEditSvc?.clearNewSameParent(e,t);const n=o(e);if(!n)return void(e.allowed=!1);if("object"!=typeof n)return;void 0!==n.rows&&(e.rows=n.rows??[]),t&&void 0!==n.newParent&&(e.newParent=n.newParent),void 0!==n.target&&(e.target=n.target),n.position&&(e.position=n.position),void 0!==n.allowed?e.allowed=n.allowed:i||(e.allowed=!0);const r=e.draggingEvent;n.changed&&r&&(r.changed=!0),s||void 0===n.highlight||(e.highlight=n.highlight)}addRowDropZone(e){if(!e.getContainer())return void this.warn(55);const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer()))return void this.warn(56);const s={isInterestedIn:e=>2===e,getIconName:()=>"move",external:!0,...e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(t=>e.onDragEnter(this.rowDragEvent("rowDragEnter",t))),onDragLeave:e.onDragLeave&&(t=>e.onDragLeave(this.rowDragEvent("rowDragLeave",t))),onDragging:e.onDragging&&(t=>e.onDragging(this.rowDragEvent("rowDragMove",t))),onDragStop:e.onDragStop&&(t=>e.onDragStop(this.rowDragEvent("rowDragEnd",t))),onDragCancel:e.onDragCancel&&(t=>e.onDragCancel(this.rowDragEvent("rowDragCancel",t)))}};t.addDropTarget(s),this.addDestroyFunc((()=>t.removeDropTarget(s)))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:t=>{this.onDragEnter(t),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",t))},onDragLeave:t=>{this.onDragLeave(t),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",t))},onDragging:t=>{this.onDragging(t),e?.onDragging?.(this.rowDragEvent("rowDragMove",t))},onDragStop:t=>{this.onDragStop(t),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",t))},onDragCancel:t=>{this.onDragCancel(t),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",t))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:s}=this.beans,i=e>t.getCurrentPagePixelRange().pageLastPixel?-1:s.getRowIndexAtPixel(e);return i>=0?s.getRow(i):void 0}rowDragEvent(e,t){const s=this.beans,{dragItem:i,dropTarget:o,event:n,vDirection:r}=t,a=o?.rootNode===s.rowModel.rootNode,l=a?o.y:Pr(s,t).y,c=a?o.overNode:this.getOverNode(l),d=a?o.overIndex:c?.rowIndex??-1;return{api:s.gridApi,context:s.gridOptions.context,type:e,event:n,node:i.rowNode,nodes:i.rowNodes,overIndex:d,overNode:c,y:l,vDirection:r,rowsDrop:o}}dispatchGridEvent(e,t){const s=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(s)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,s=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),s?.allowed&&s.rowDragManaged&&(!t?.droppedManaged||Ir(t,s))&&this.dropRows(s),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),Fr(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:s}){const i=ne(this.beans),o=this.beans.rowModel,n=s.filter((({data:e,rowPinned:t})=>!o.getRowNode(i?.({data:e,level:0,rowPinned:t})??e.id))).map((({data:e})=>e));if(0===n.length)return!1;let r;if(t){const s=t.sourceRowIndex>=0?t:Qn(t);s&&(r=s.sourceRowIndex+("above"===e?0:1))}return o.updateRowData({add:n,addIndex:r}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:s,sameGrid:i}=e;let o;for(let n=0,r=s.length;n<r;++n){let r=!0;const a=s[n];(!a||a.footer||i&&a.destroyed&&!a.group||!this.csrmGetLeaf(a))&&(r=!1),r&&t&&!t.canDropRow(a,e)&&(r=!1),r?o?.push(a):o??(o=s.slice(0,n))}return o??s}csrmMoveRows(e){const t=this.beans.groupEditSvc;return t?.isGroupingDrop(e)?t.dropGroupEdit(e):this.csrmMoveRowsReorder(e)}csrmMoveRowsReorder({position:e,target:t,rows:s,newParent:i,rootNode:o}){let n=!1;const r=new Set;for(const e of s){i&&e.parent!==i&&(e.treeParent=i,n=!0);const t=this.csrmGetLeaf(e);t&&r.add(t)}if(!n&&0===r.size)return!1;const a=this.beans.focusSvc,l=a.getFocusedCell(),c=l&&di(this.beans,l);if(r.size&&((e,t,s,i)=>{if(!t.size||!e)return!1;let o=!1;const n=e.length??0;let r=-1;s&&(r=s.sourceRowIndex,(s=r<0?Qn(s):null)&&(r=s.sourceRowIndex)),r<0||r>=n?r=n:i||++r;let a=r,l=Math.min(r,n-1);for(const e of t){const t=e.sourceRowIndex;t<a&&(a=t),t>l&&(l=t)}let c=a;for(let s=a;s<r;++s){const i=e[s];t.has(i)||(i.sourceRowIndex!==c&&(i.sourceRowIndex=c,e[c]=i,o=!0),++c)}let d=l;for(let s=l;s>=r;--s){const i=e[s];t.has(i)||(i.sourceRowIndex!==d&&(i.sourceRowIndex=d,e[d]=i,o=!0),--d)}for(const s of t)s.sourceRowIndex!==c&&(s.sourceRowIndex=c,e[c]=s,o=!0),++c;return o})(o._leafs,r,t,"above"===e)&&(n=!0),!n)return!1;const d=this.beans.rowModel,u=new dr;return u.reordered=!0,d.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:u}),c?c.focusCell({forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0}):a.clearFocusedCell(),!0}csrmGetLeaf(e){if(e.sourceRowIndex>=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):Qn(e)}},Ir=(e,t)=>e!==t&&(e?.sameGrid!==t.sameGrid||e?.allowed!==t.allowed||e?.position!==t.position||e?.target!==t.target||e?.source!==t.source||e?.newParent!==t.newParent||!(0,i.MpY)(e?.rows,t.rows)),kr=(e,t)=>(e.rowIndex??2147483647)-(t.rowIndex??2147483647)||e.sourceRowIndex-t.sourceRowIndex,Fr=(e,t)=>{for(let s=0,i=e?.length||0;s<i;++s){const i=e[s];i.dragging!==t&&(i.dragging=t,i.dispatchRowEvent("draggingChanged"))}},Dr=(e,t)=>{let s=null,i=t.target;if(i&&t.rows.indexOf(i)<0)return null;const o=t.source;if(!i||!o)return null;let n=i.rowIndex-o.rowIndex;const r=n<0?-1:1;n=t.suppressMoveWhenRowDragging?Math.abs(n):1;const a=new Set(t.rows);do{const t=Ms(e,r,i);if(!t)break;a.has(t)||(s=t,--n),i=t}while(n>0);return s},Tr=(e,t)=>{const s=e?.rowTop,i=e?.rowHeight??0;if(null==s||!i||i<=0)return"none";const o=t-s,n=.25*i;return o<=n?"above":o>=i-n?"below":"inside"},Ar={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},Mr={skipAriaHidden:!0},Nr=class extends ls{constructor(e,t,s,i,o,n=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=s,this.customGui=i,this.dragStartPixels=o,this.alwaysVisible=n,this.dragSource=null,this.disabled=!1}isCustomGui(){return null!=this.customGui}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(Ar),this.getGui().appendChild(er("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,s=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:s}),this.addManagedListeners(t,{dataChanged:s,cellChanged:s}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:s}=this,{gos:i,dragAndDrop:o,rowDragSvc:n}=e,r=n?.visibility;let a=!("suppress"===r||"hidden"===r&&!o?.hasExternalDropZones()),l=a;if(a&&!this.isCustomGui()&&t){const e=t.getColDef().rowDrag;if(!1===e)a=!1;else{const i="function"==typeof e;l=t.isRowDrag(s),a=i||l}}a&&l&&s.footer&&i.get("rowDragManaged")&&(l=!1,a=!0),l&&(l=a),a||this.setDisplayed(a,Mr),l||this.setVisible(l,Mr),this.setDisabled(!l||"disabled"===r&&!o?.hasExternalDropZones()),a&&this.setDisplayed(a,Mr),l&&this.setVisible(l,Mr)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){return((e,t,s)=>{if(!t.get("rowDragMultiRow")||!s||!e.isSelected())return[e];if(t.get("treeData")&&B(t)){const e=s.getBestCostNodeSelection();if(e?.length)return e}const i=s.getSelectedNodes();return i.length?i:[e]})(this.rowNode,this.gos,this.beans.selectionSvc)}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const e=(0,i.ELu)("pointerdown")?{pointerdown:i._oU}:{mousedown:i._oU};this.mouseDownListener=this.addManagedElementListeners(t,e)[0]}const s=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:e=>this.getDragItemName(e,s),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const s=e?.dragItem||this.getDragItem(),i=(e?.dropTarget?.rows.length??s.rowNodes?.length)||1,o=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(o)return o(s,i);if(1!==i)return`${i} ${t("rowDragRows","rows")}`;return this.cellValueFn()||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},Lr={moduleName:"Drag",version:cn,beans:[class extends h{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}}]},Vr={moduleName:"DragAndDrop",version:cn,dynamicBeans:{dndSourceComp:class extends ls{constructor(e,t,s){super(xr),this.rowNode=e,this.column=t,this.eCell=s}postConstruct(){this.getGui().appendChild(er("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",(e=>{e.stopPropagation()})),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:s,eCell:i,gos:o}=this,n=s.colDef.dndSourceOnRowDrag,r=e.dataTransfer;if(r.setDragImage(i,0,0),n)n(xe(o,{rowNode:t,dragEvent:e}));else try{const e=JSON.stringify(t.data);r.setData("application/json",e),r.setData("text/plain",e)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}}},icons:{rowDrag:"grip"}},_r={moduleName:"SharedDragAndDrop",version:cn,beans:[class extends r{createEvent(e){return xe(this.gos,e)}createDragImageComp(e){const{gos:t,beans:s}=this,i=(o=s.userCompFactory,n=xe(t,{dragSource:e}),o.getCompDetailsFromGridOptions(Ht,"agDragAndDropImage",n,!0));var o,n;return i?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){this.beans.log.warn(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const s={getContainer:e,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"};this.addDropTarget(s),t.addDestroyFunc((()=>this.removeDropTarget(s)))}}],dependsOn:[Lr],userComponents:{agDragAndDropImage:class extends ls{constructor(){super(),this.dragSource=null,this.eIcon=i.dRA,this.eLabel=i.dRA,this.registerCSS(".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}")}postConstruct(){const e=e=>function(e,t){const s=er(e,t,null);if(s){const{className:e}=s;if("string"==typeof e&&e.includes("ag-icon")||"object"==typeof e&&e["ag-icon"])return s}const i=ni({tag:"span"});return i.appendChild(s),i}(e,this.beans);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(Rr)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eIcon:s,dragSource:o,dropIconMap:n,gos:r}=this,a=this.getGui();(0,i.fDi)(s),e||(e=o?.getDefaultIconName?o.getDefaultIconName():"notAllowed");const l=n[e];a.classList.toggle("ag-dnd-ghost-not-allowed","notAllowed"===e),s.classList.toggle("ag-shake-left-to-right",t),l===n.hide&&r.get("suppressDragLeaveHidesColumns")||l&&s.appendChild(l)}setLabel(e){this.eLabel.textContent=e}}},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},Or={moduleName:"RowDrag",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;e&&null!==e?.rowIndex&&"none"!==this.position?this.set(e,this.position):this.clear(),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const s=e!==this.row,i=e.uiLevel,o=t!==this.position,n=i!==this.uiLevel;this.dragging=!1,(s||o||n)&&(s&&this.clear(),this.uiLevel=i,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:e,target:s,position:i}=t;if(e&&s&&"none"!==i)return this.set(s,i),void(this.dragging=!0)}this.dragging&&this.clear()}},class extends ke{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const s=t.createManagedBean(new Er(e)),i=this.beans.dragAndDrop;i.addDropTarget(s),t.addDestroyFunc((()=>i.removeDropTarget(s))),this.rowDragFeature=s;const o=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],o),this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:o,columnPivotModeChanged:o,sortChanged:o,filterChanged:o}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,s,i,o,n){return new Nr(e,t,s,i,o,n)}createRowDragCompForRow(e,t){if(de(this.gos))return;const s=this.getLocaleTextFunc();return this.createRowDragComp((()=>`1 ${s("rowDragRow","row")}`),e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,s,i,o,n){const r=this.gos;if(!r.get("rowDragManaged")||B(r)&&!r.get("pagination"))return this.createRowDragComp(s,e,t,i,o,n)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const s=e.colModel.pivotMode;return!s&&!e.rowGroupColsSvc?.columns?.length||t.get("refreshAfterGroupEdit")?s||e.filterManager?.isAnyFilterPresent()||(e=>{for(let t=0,s=e.length;t<s;++t)if(e[t].getSortDef())return!0;return!1})(e.colModel.getAllCols())?"disabled":"visible":"hidden"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}}],apiFunctions:{addRowDropZone:function(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)},removeRowDropZone:function(e,t){const s=e.dragAndDrop?.findExternalZone(t.getContainer());s&&e.dragAndDrop?.removeDropTarget(s)},getRowDropZoneParams:function(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)},getRowDropPositionIndicator:function(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}},setRowDropPositionIndicator:function(e,t){const s=e.rowDropHighlightSvc;if(!s)return;const i=t?.row;let o=t?.dropIndicatorPosition;"above"!==o&&"below"!==o&&"inside"!==o&&(o="none");const n=i?.rowIndex;null==n||"none"===o?s.clear():s.set(i,o)}},dependsOn:[_r]},Br={moduleName:"HorizontalResize",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:s}=this.beans;return s.addDragSource(t),()=>s.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons(!!e.isColumn);const s=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(s)}setResizeIcons(e){const t=this.beans.ctrlsSvc.get("gridCtrl");t.setResizeCursor(i.OP3.Horizontal,e),t.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}}],dependsOn:[Lr]},Hr=e=>{for(;e.length;){const t=e.pop();t&&t()}},Gr=class extends ke{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const e of t)e.primary&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{colModel:t,valueColsSvc:s,rowGroupColsSvc:i,pivotColsSvc:o}=this.beans;t.beginColBatch();try{this.columnsToAggregate.length>0&&s?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&i?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&o?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}finally{t.endColBatch("toolPanelDragAndDrop")}}onDragCancel(){this.clearColumnsList()}};function zr(e){const{isFromHeader:t,fromLeft:s,xPosition:o,fromEnter:n,fakeEvent:r,pinned:a,gos:l,colModel:c,colMoves:d,visibleCols:u}=e;let{allMovingColumns:h}=e;t&&(h=function(e){const t=[...e],s=new Set(t);for(const i of e){let e=null,o=i.parent;for(;1===o?.getDisplayedLeafColumns().length;)e=o,o=o.parent;if(null!=e){const i=e.getColGroupDef()?.marryChildren?e.getProvidedColumnGroup().getLeafColumns():e.getLeafColumns();for(let e=0,o=i.length;e<o;++e){const o=i[e];s.has(o)||(s.add(o),t.push(o))}}}return t}(h));const p=h.slice();!function(e,t){!t||t.length<=1||t.some((e=>!e.inColsList))||(e.ensureColsListIndex(),t.sort(((e,t)=>e.colsListIndex-t.colsListIndex)))}(c,p);const g=function(e){const{movingCols:t,draggingRight:s,xPosition:i,pinned:o,gos:n,colModel:r,visibleCols:a}=e;if(n.get("suppressMovableColumns")||t.some((e=>e.colDef.suppressMovable)))return[];const l=function(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}(a,o),c=r.colsList,d=new Set(t),u=l.filter((e=>d.has(e))),h=l.filter((e=>!d.has(e))),p=c.filter((e=>!d.has(e)));let g,f=0,m=i;if(s){let e=0;for(const t of u)e+=t.getActualWidth();m-=e}if(m>0){for(let e=0;e<h.length&&(m-=h[e].getActualWidth(),!(m<0));e++)f++;s&&f++}if(f>0){const e=h[f-1];g=p.indexOf(e)+1}else g=p.indexOf(h[0]),-1===g&&(g=0);const v=[g],w=(e,t)=>e-t;if(s){let e=g+1;const t=c.length-1;for(;e<=t;)v.push(e),e++;v.sort(w)}else{let e=g;const t=c.length-1;let s=c[e];for(;e<=t&&Ur(s,o);)e++,v.push(e),s=c[e];e=g-1;const i=0;for(;e>=i;)v.push(e),e--;v.sort(w).reverse()}return v}({movingCols:p,draggingRight:s,xPosition:o,pinned:a,gos:l,colModel:c,visibleCols:u}),f=function(e,t){const s=e.length;if(0===s)return null;t.ensureColsListIndex();const i=e[0];let o=i.inColsList?i.colsListIndex:-1,n=o;for(let t=1;t<s;++t){const s=e[t],i=s.inColsList?s.colsListIndex:-1;i<o?o=i:i>n&&(n=i)}return n-o==s-1?o:null}(p,c);if(0===g.length)return;const m=g[0];if(null!==f&&(t||!n)&&!r){if(!s&&m>=f)return;if(s&&m<=f)return}const v=function(e,t,s){let o=null,n=null;for(let r=0;r<e.length;r++){const a=e[r],l=s.getProposedColumnOrder(t,a);if(!s.doesOrderPassRules(l))continue;const c=l.filter((e=>e.displayed));if(null===n)n=c;else if(!(0,i.MpY)(c,n))break;const d=jr(l);(null===o||d<o.fragCount)&&(o={move:a,fragCount:d})}return o}(g,p,d);if(!v)return;const w=v.move;return w>c.colsList.length-p.length?void 0:{columns:p,toIndex:w}}function Wr(e){const{columns:t,toIndex:s}=zr(e)||{},{finished:i,colMoves:o}=e;return t&&null!=s?(o.moveColumns(t,s,"uiColumnMoved",i),i?null:{columns:t,toIndex:s}):null}function jr(e){function t(e){const t=[];let s=e.getOriginalParent();for(;null!=s;)t.push(s),s=s.getOriginalParent();return t}let s=0;for(let i=0;i<e.length-1;i++){let o=t(e[i]),n=t(e[i+1]);[o,n]=o.length>n.length?[o,n]:[n,o];for(const e of o)-1===n.indexOf(e)&&s++}return s}function Ur(e,t){if(!e?.displayed)return!0;const s=e.pinned;return"left"===t||"right"===t?s!==t:null!=s}function $r(e,t){let s;return s="left"===e?"ag-grid-pinned-left-cells":"right"===e?"ag-grid-pinned-right-cells":"ag-grid-scrolling-cells",t.getHeaderRowContainerCtrl()?.eViewport?.querySelector(`.ag-header-row .${s}`)}function Yr(e,t,s){const i=$r(t,s);return i?e-i.getBoundingClientRect().left:e}function Kr(e){const{isRtl:t,ctrlsSvc:s,pinned:i}=e;let{x:o}=e;if(t&&"left"!==i){const e=$r(i??null,s);if(!e)return 0;o=e.getBoundingClientRect().width-o}return o}function qr(e,t){for(const s of e)s.moving=t,s.dispatchColEvent("movingChanged","uiColumnMoved")}var Zr=i.WOR?20:100,Qr=class extends ke{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!(0,i.Qmv)(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCon=e.gridBodyCtrl}))}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:s}=t||{},i=s?.columns??[];for(const t of i){const i=t.getPinned();if(t.getColDef().lockPinned){if(i==e)return"move";continue}const o=s?.containerType;if(o===e||!e)return"move";if(e&&(!i||o!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,s=t.columns;if(0===e.dragSource.type)this.setColumnsVisible(s,!0,"uiColumnDragged");else{const e=t.visibleState,i=(s||[]).filter((t=>e[t.getId()]&&!t.isVisible()));this.setColumnsVisible(i,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(s,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,s=!1,o=!1){const{gos:n,ctrlsSvc:r}=this.beans,a=n.get("suppressMoveWhenColumnDragging");if(o&&!a)return void this.finishColumnMoving();if(this.lastDraggingEvent=e,!e||!o&&(0,i.MWY)(e.hDirection))return;const l=Kr({x:Yr(e.event.clientX,this.pinned,r),pinned:this.pinned,isRtl:n.get("enableRtl"),ctrlsSvc:r});t||this.checkCenterForScrolling(e),a?this.handleColumnDragWhileSuppressingMovement(e,t,s,l,o):this.handleColumnDragWhileAllowingMovement(e,t,s,l,o)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,s){e?.length&&Ge(this.beans,e,t,s,!0)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;e&&this.beans.colMoves.moveColumns(e.columns,e.toIndex,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,s,i,o){const n=this.getAllMovingColumns(e,!0);if(o){const e=this.isAttemptingToPin(n);e&&this.attemptToPinColumns(n,void 0,!0);const{fromLeft:i,xPosition:o}=this.getNormalisedXPositionInfo(n,e)||{};if(null==i||null==o)return void this.finishColumnMoving();this.moveColumnsAfterHighlight({allMovingColumns:n,xPosition:o,fromEnter:t,fakeEvent:s,fromLeft:i})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(n,i)}}handleColumnDragWhileAllowingMovement(e,t,s,i,o){const n=this.getAllMovingColumns(e),r="right"===((e,t,s)=>{if(t&&"left"!==s)switch(e){case"left":return"right";case"right":return"left"}return e})(e.hDirection,this.gos.get("enableRtl"),this.pinned),a=1===e.dragSource.type,l=Wr({...this.getMoveColumnParams({allMovingColumns:n,isFromHeader:a,xPosition:i,fromLeft:r,fromEnter:t,fakeEvent:s}),finished:o});l&&(this.lastMovedInfo=l)}getAllMovingColumns(e,t=!1){const s=e.dragSource.getDragItem();let i;return t?(i=s.columnsInSplit,i||(i=s.columns)):i=s.columns,i?i.filter((e=>!e.colDef.lockPinned||e.getPinned()==this.pinned)):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:s,xPosition:i,fromLeft:o,fromEnter:n,fakeEvent:r}=e,{gos:a,colModel:l,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:s,fromLeft:o,xPosition:i,pinned:this.pinned,fromEnter:n,fakeEvent:r,gos:a,colModel:l,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{colModel:s}=this.beans,o=s.getCols().filter((e=>e.isVisible()&&e.getPinned()===this.pinned));let n,r=null,a=null,l=null;for(const e of o){if(a=e.getActualWidth(),r=this.getNormalisedColumnLeft(e,0),null!=r&&r<=t&&r+a>=t){l=e;break}r=null,a=null}if(l)-1!==e.indexOf(l)&&(l=null);else{for(let e=o.length-1;e>=0;e--){const t=o[e],s=o[e].parent;if(!s){l=t;break}const n=s?.getDisplayedLeafColumns();if(n.length){l=(0,i.GXs)(n);break}}if(!l)return;r=this.getNormalisedColumnLeft(l,0),a=l.getActualWidth()}if(null!=l&&null!=r&&null!=a){if(t-r<a/2){const e=o.indexOf(l);0===e?n=0:(n=1,l=o[e-1])}else n=1;this.lastHighlightedColumn?.column===l&&this.lastHighlightedColumn?.position===n||this.clearHighlighted(),Jr(l,n),this.lastHighlightedColumn={column:l,position:n}}else this.lastHighlightedColumn?.column!==l&&this.clearHighlighted()}getNormalisedXPositionInfo(e,t){const{gos:s,visibleCols:i}=this.beans,o=s.get("enableRtl"),{firstMovingCol:n,column:r,position:a}=this.getColumnMoveAndTargetInfo(e,t,o);if(!n||!r||null==a)return;const l=i.allCols,c=n.allColsIndex,d=r.allColsIndex,u=0===a,h=c<d||c===d&&!u;let p=0;if(u?h&&(p-=1):h||(p+=1),d+p===c)return;const g=l[d+p];return g?{fromLeft:h,xPosition:this.getNormalisedColumnLeft(g,20)}:void 0}getColumnMoveAndTargetInfo(e,t,s){const i=this.lastHighlightedColumn||{},{firstMovingCol:o,lastMovingCol:n}=function(e){const t=e.length;let s,i;for(let o=0;o<t;o++){if(!s){const t=e[o];null!=t.getLeft()&&(s=t)}if(!i){const s=e[t-1-o];null!=s.getLeft()&&(i=s)}if(s&&i)break}return{firstMovingCol:s,lastMovingCol:i}}(e);if(!o||!n||i.column||!t)return{firstMovingCol:o,...i};const r="left"===this.getPinDirection();return{firstMovingCol:o,position:r?1:0,column:r!==s?o:n}}getNormalisedColumnLeft(e,t){const{gos:s}=this.beans,i=e.getLeft();if(null==i)return null;let o=t;return s.get("enableRtl")&&"left"===e.getPinned()&&(o=e.getActualWidth()-t),i+o}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,s=this.failedMoveAttempts>7;return t&&s||e.some((e=>e.getPinned()!==this.pinned))}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:s,fromEnter:i,fakeEvent:o,fromLeft:n}=e,r=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:s,fromLeft:n,fromEnter:i,fakeEvent:o}),{columns:a,toIndex:l}=zr(r)||{};a&&null!=l&&(this.lastMovedInfo={columns:a,toIndex:l}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(Jr(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const{visibleCols:t}=this.beans,s=this.gridBodyCon.eGridViewport.getBoundingClientRect(),i=e.event.clientX-s.left,o=t.getLeftStickyColumnContainerWidth(),n=t.getRightStickyColumnContainerWidth(),r=i<o+50,a=i>s.width-n-50;this.needToMoveLeft=r,this.needToMoveRight=a,this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),Zr),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const s=this.gridBodyCon.scrollFeature,i=this.gos.get("enableRtl")?-1:1;if(this.needToMoveLeft?t=s.scrollHorizontally(-e*i):this.needToMoveRight&&(t=s.scrollHorizontally(e*i)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{dragAndDrop:e,gos:t}=this.beans;if(this.failedMoveAttempts<=8)return;const s=this.lastDraggingEvent?.dragItem.columns,i=(s??[]).some((e=>!e.colDef.lockPinned));e.setDragImageCompIcon(i?"pinned":this.getIconName()),i&&!t.get("suppressMoveWhenColumnDragging")&&this.attemptToPinColumns(s,void 0,!0)}}getPinDirection(){return this.needToMoveLeft||"left"===this.pinned?"left":this.needToMoveRight||"right"===this.pinned?"right":void 0}attemptToPinColumns(e,t,s=!1){const i=(e||[]).filter((e=>!e.colDef.lockPinned));if(!i.length)return 0;s&&(t=this.getPinDirection());const{pinnedCols:o,dragAndDrop:n}=this.beans;return o?.setColsPinned(i,t,"uiColumnDragged"),s&&n.nudge(),i.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function Jr(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}var Xr=class extends ke{constructor(e){super(),this.eContainer=e,this.currentDropListener=null,this.lastDetectedSection=null}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans;e.whenReady(this,(e=>{const t=e.gridBodyCtrl.eGridViewport,s=e.pinnedTop.eViewport,i=e.pinnedBottom.eViewport;this.eGridViewport=t;const o=[];t&&o.push([t]),s&&s!==t&&o.push([s]),i&&i!==t&&i!==s&&o.push([i]),this.eSecondaryContainers=o}));const s=e=>this.createManagedBean(new Qr(e));this.moveColumnFeatures={left:s("left"),center:s(null),right:s("right")};const i=e=>this.createManagedBean(new Gr(e));this.bodyDropPivotTargets={left:i("left"),center:i(null),right:i("right")},t.addDropTarget(this),this.addDestroyFunc((()=>t.removeDropTarget(this)))}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener?.getIconName()??null}isDropColumnInPivotMode(e){return this.beans.colModel.pivotMode&&0===e.dragSource.type}onDragEnter(e){const t=this.getDropListener(e);this.lastDetectedSection=null,this.currentDropListener=t,t.onDragEnter(e)}onDragLeave(e){const t=this.currentDropListener;t&&(t.onDragLeave(e),this.currentDropListener=null),this.lastDetectedSection=null}onDragging(e){let t=this.currentDropListener;if(!t)return;const s=this.getDropListener(e);t!==s&&(t.onDragLeave(e),t=s,this.currentDropListener=s,t.onDragEnter(e),e.changed=!0),t.onDragging(e)}onDragStop(e){const t=this.currentDropListener;t&&(t.onDragStop(e),this.currentDropListener=null)}onDragCancel(){const e=this.currentDropListener;e&&(e.onDragCancel(),this.currentDropListener=null)}getSection(e){const t=this.getPinnedSection(e);switch(t){case"left":case"right":return t;default:return"center"}}getDropListener(e){const t=this.getSection(e);return this.isDropColumnInPivotMode(e)?this.bodyDropPivotTargets[t]:this.moveColumnFeatures[t]}getPinnedSection(e){const t=this.eGridViewport.getBoundingClientRect(),s=e.event.clientX-t.left,{visibleCols:i}=this.beans,o=i.getLeftStickyColumnContainerWidth(),n=i.getRightStickyColumnContainerWidth();let r=null;s<o?r="left":s>t.width-n&&(r="right");const a=this.lastDetectedSection;return e.fromNudge&&r!==a&&null!==a?a:(this.lastDetectedSection=r,r)}},ea={moduleName:"ColumnMove",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,s){const i=this.beans.colModel.colsList[e];this.moveColumns([i],t,s)}moveColumns(e,t,s,o=!0){const{colModel:n,visibleCols:r}=this.beans,a=this.beans.colAnimation;if(t>n.colsList.length-e.length)this.warn(30,{toIndex:t});else{a?.start();try{const a=[];for(let t=0,s=e.length;t<s;++t){const s=n.getCol(e[t]);s&&a.push(s)}this.doesMovePassRules(a,t)&&((0,i.pWr)(n.colsList,a,t),n.markColsListIndexDirty(),r.refresh(s,!1),this.eventSvc.dispatchEvent({type:"columnMoved",columns:a,column:1===a.length?a[0]:null,toIndex:t,finished:o,source:s}))}finally{a?.finish()}}}doesMovePassRules(e,t){const s=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(s)}doesOrderPassRules(e){const{colModel:t,gos:s}=this.beans;return!(t.hasMarryChildren&&!Ne(e,t.colsTree))&&!!(e=>{const t=s.get("enableRtl");let i=t?1:-1,o=!0;for(const s of e){const e=(n=s.colDef.lockPosition)?"left"===n||!0===n?-1:1:0;t?e>i&&(o=!1):e<i&&(o=!1),i=e}var n;return o})(e)}getProposedColumnOrder(e,t){const s=this.beans.colModel.colsList.slice();return(0,i.pWr)(s,e,t),s}createBodyDropTarget(e){return new Xr(e)}moveHeader(e,t,s,o,n){const{ctrlsSvc:r,gos:a,colModel:l,visibleCols:c,focusSvc:d}=this.beans,u=t.getBoundingClientRect(),h=u.left,p=Ft(s),g=p?u.width:s.getActualWidth(),f=a.get("enableRtl"),m="left"===e!==f,v=Kr({x:Yr(m?h-20:h+g+20,o,r),pinned:o,isRtl:f,ctrlsSvc:r}),w=d.focusedHeader;let C;if(Wr({allMovingColumns:p?s.getLeafColumns():[s],isFromHeader:!0,fromLeft:"right"===e,xPosition:v,pinned:o,fromEnter:!1,fakeEvent:!1,gos:a,colModel:l,colMoves:this,visibleCols:c,finished:!0}),p){const e=s.getDisplayedLeafColumns();C=m?e[0]:(0,i.GXs)(e)}else C=s;if(r.getScrollFeature().ensureColumnVisible(C,"auto"),(!n.isAlive()||a.get("ensureDomOrder"))&&w){let e;if(p){const t=s.getGroupId(),i=s.getLeafColumns();if(!i.length)return;const o=i[0].parent;if(!o)return;e=function(e,t){for(;e;){if(e.groupId===t)return e;e=e.parent}}(o,t)}else e=s;e&&d.focusHeaderPosition({headerPosition:{...w,column:e}})}}setDragSourceForHeader(e,t,s){const o=this.beans,{gos:n,dragAndDrop:r,visibleCols:a}=o;let l=!n.get("suppressDragLeaveHidesColumns");const c=Ft(t),d=c?t.getProvidedColumnGroup().getLeafColumns():[t],u=c?()=>function(e,t){const s=e.getProvidedColumnGroup().getLeafColumns(),o=Object.create(null);for(const e of s)o[e.getId()]=e.isVisible();const n=[];for(const e of t)s.indexOf(e)>=0&&(n.push(e),(0,i.$ii)(s,e));for(const e of s)n.push(e);const r=[],a=e.getLeafColumns();for(const e of n)-1!==a.indexOf(e)&&r.push(e);return{columns:n,columnsInSplit:r,visibleState:o,containerType:r[0]?.pinned}}(t,a.allCols):()=>function(e){const t=Object.create(null);return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}(t),h={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:u,dragItemName:s,onDragStarted:()=>{l=!n.get("suppressDragLeaveHidesColumns"),qr(d,!0)},onDragStopped:()=>qr(d,!1),onDragCancelled:()=>qr(d,!1),onGridEnter:e=>{if(l){const{columns:t=[],visibleState:s}=e??{},i=c?t.filter((e=>!s||s[e.colId])):t;Ge(o,i,!0,"uiColumnMoved",!0)}},onGridExit:e=>{l&&Ge(o,e?.columns??[],!1,"uiColumnMoved",!0)}};return r.addDragSource(h,!0),h}},class extends ke{constructor(){super(...arguments),this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0,this.startDepth=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>this.gridBodyCtrl=e.gridBodyCtrl))}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.startDepth++,this.active)return;const{gos:e,gridBodyCtrl:t}=this;t&&!e.get("suppressColumnMoveAnimation")&&(this.ensureAnimationCssClassPresent(t),this.active=!0,this.activeNext=!0)}finish(){const e=Math.max(0,this.startDepth-1);this.startDepth=e,e>0||!this.active||this.flush()}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(e){this.animationThreadCount++;const t=this.animationThreadCount;e.setColumnMovingCss(!0),this.executeLaterFuncs.push((()=>{this.animationThreadCount===t&&e.setColumnMovingCss(!1)}))}flush(){const{executeNextFuncs:e,executeLaterFuncs:t}=this;if(0===e.length&&0===t.length)return this.activeNext=!1,void(this.active=!1);this.beans.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{this.activeNext=!1,Hr(e)}),0),window.setTimeout((()=>{this.active=!1,Hr(t)}),200)}))}}],apiFunctions:{moveColumnByIndex:function(e,t,s){e.colMoves?.moveColumnByIndex(t,s,"api")},moveColumns:function(e,t,s){e.colMoves?.moveColumns(t,s,"api")}},dependsOn:[_r],css:[":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s,right .2s}.ag-header-group-cell{transition:left .2s,right .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s,left .2s}.ag-header-group-cell{transition:right .2s,left .2s,width .2s}}"]},ta={moduleName:"AutoWidth",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.scrollingRowContainerCtrl=e.scrolling}))}getPreferredWidthForColumn(e,t){const s=this.getHeaderCellForColumn(e);if(!s)return-1;const i=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||i.push(s),this.getPreferredWidthForElements(i)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const s=ni({tag:"form"});s.style.position="fixed";const i=this.scrollingRowContainerCtrl.eViewport;for(const t of e)this.cloneItemIntoDummy(t,s);i.appendChild(s);const o=s.offsetWidth;return s.remove(),o+(t??this.gos.get("autoSizePadding"))}getHeaderCellForColumn(e){return this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getHtmlElementForColumnHeader(e)??null}cloneItemIntoDummy(e,t){const s=e.cloneNode(!0);s.style.width="",s.style.position="static",s.style.left="",s.style.right="";const i=ni({tag:"div"}),o=i.classList;["ag-header-cell","ag-header-group-cell"].some((e=>s.classList.contains(e)))?(o.add("ag-header","ag-header-row"),i.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some((e=>n.classList.contains(e)))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}n=n.parentElement}i.appendChild(s),t.appendChild(i)}}]},sa=class extends ke{constructor(e,t,s){super(),this.comp=e,this.eResize=t,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const{horizontalResizeSvc:e,gos:t,colAutosize:s}=this.beans,i=e.addResizeBar({eResizeBar:this.eResize,isColumn:!0,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(i),!t.get("suppressAutoSize")&&s&&this.addDestroyFunc(s.addColumnGroupResize(this.eResize,this.columnGroup,(()=>this.resizeLeafColumnsToFit("uiColumnResized"))))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:s,resizeRatios:i,groupAfterColumns:o,groupAfterStartWidth:n,groupAfterRatios:r}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=s,this.resizeRatios=i,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r,this.toggleColumnResizing(!0)}onResizing(e,t,s="uiColumnResized"){const i=this.normaliseDragChange(t),o=this.resizeStartWidth+i;this.resizeColumnsFromLocalValues(o,s,e)}getInitialValues(e){const t=e=>e.reduce(((e,t)=>e+t.getActualWidth()),0),s=(e,t)=>e.map((e=>e.getActualWidth()/t)),i=this.getColumnsToResize(),o=t(i),n={columnsToResize:i,resizeStartWidth:o,resizeRatios:s(i,o)};let r=null;if(e&&(r=ia(this.beans.visibleCols,this.columnGroup)),r){const e=r.getDisplayedLeafColumns(),i=n.groupAfterColumns=e.filter((e=>e.isResizable())),o=n.groupAfterStartWidth=t(i);n.groupAfterRatios=s(i,o)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),s=this.getInitialValues();t>s.resizeStartWidth&&this.resizeColumns(s,t,e,!0)}resizeColumnsFromLocalValues(e,t,s=!0){if(!this.resizeCols||!this.resizeRatios)return;const i={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(i,e,t,s)}resizeColumns(e,t,s,i=!0){const{columnsToResize:o,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,d=[];if(d.push({columns:o,ratios:r,width:t}),a){const e=t-n;d.push({columns:a,ratios:c,width:l-e})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:i,source:s}),i&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((e=>e.isResizable()))}normaliseDragChange(e){let t=e;const{columnGroup:s}=this,i=Tt(s,!0,!1),o=i?.getPinned()??s.getPinned();return this.gos.get("enableRtl")?"left"!==o&&(t*=-1):"right"===o&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},ia=(e,t)=>{const s=t.providedColumnGroup.level+t.getPaddingLevel();let i=Tt(t,!0,!0);for(;i;){const o=e.getColAfter(i);if(!o)return null;const n=Mt(o,s);if(n!==t)return n;i=o}return null},oa=class extends ke{constructor(e,t,s,i){super(),this.column=e,this.eResize=t,this.comp=s,this.ctrl=i}postConstruct(){const e=[];let t,s;const o=()=>{if((0,i.nl0)(this.eResize,t),!t)return;const{horizontalResizeSvc:o,colAutosize:n}=this.beans,r=o.addResizeBar({eResizeBar:this.eResize,isColumn:!0,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(r),s&&n&&e.push(n.addColumnAutosizeListeners(this.eResize,this.column))},n=()=>{for(const t of e)t();e.length=0},r=()=>{const e=this.column.isResizable(),i=!this.gos.get("suppressAutoSize")&&!this.column.colDef.suppressAutoSize;(e!==t||i!==s)&&(t=e,s=i,n(),o())};r(),this.addDestroyFunc(n),this.ctrl.setRefreshFunction("resize",r)}onResizing(e,t){const{column:s,lastResizeAmount:i,resizeStartWidth:o,beans:n}=this,r=this.normaliseResizeAmount(t),a=[{key:s,newWidth:o+r}],{pinnedCols:l,ctrlsSvc:c,colResize:d}=n;this.column.getPinned()&&(l?.leftWidth??0)+(l?.rightWidth??0)+(r-i)>c.getGridBodyCtrl().getViewportWidthWithoutScrollbar()-50||(this.lastResizeAmount=r,d?.setColumnWidths(a,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const s=this.column.getPinned(),i="left"!==s,o="right"===s;return this.gos.get("enableRtl")?i&&(t*=-1):o&&(t*=-1),t}},na={moduleName:"ColumnResize",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,s,i){const o=[],{colModel:n,gos:r,visibleCols:a}=this.beans;for(const s of e){const e=n.getCol(s.key);if(e&&(o.push({width:s.newWidth,ratios:[1],columns:[e]}),"shift"===r.get("colResizeDefault")&&(t=!t),t)){const t=a.getColAfter(e);if(!t)continue;const i=e.getActualWidth()-s.newWidth,n=t.getActualWidth()+i;o.push({width:n,ratios:[1],columns:[t]})}}0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:s,source:i})}resizeColumnSets(e){const{resizeSets:t,finished:s,source:i}=e;if(t&&!t.every((e=>function(e){const{columns:t,width:s}=e;let i=0,o=0,n=!0;for(const e of t){i+=e.getMinWidth()||0;const t=e.getMaxWidth();t>0?o+=t:n=!1}return s>=i&&(!n||s<=o)}(e)))){if(s){const e=t&&t.length>0?t[0].columns:null;Be(this.eventSvc,e,s,i)}return}const o=[],n=[];for(const e of t){const{width:t,columns:s,ratios:r}=e,a=Object.create(null),l=Object.create(null);for(const e of s)n.push(e);let c=!0,d=0;for(;c;){if(d++,d>1e3){this.error(31);break}c=!1;const e=[];let i=0,o=t;s.forEach(((t,s)=>{if(l[t.getId()])o-=a[t.getId()];else{e.push(t);const o=r[s];i+=o}}));const n=1/i;e.forEach(((s,i)=>{let d;i===e.length-1?d=o:(d=Math.round(r[i]*t*n),o-=d);const u=s.getMinWidth(),h=s.getMaxWidth();d<u?(d=u,l[s.getId()]=!0,c=!0):h>0&&d>h&&(d=h,l[s.getId()]=!0,c=!0),a[s.getId()]=d}))}for(const e of s){const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,i),o.push(e))}}const r=o.length>0;let a=[];if(r){const{colFlex:e,visibleCols:t,colViewport:s}=this.beans;a=e?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],t.updateBodyWidths(t.setLeftValues(i)),s.checkViewportColumns()}const l=n.concat(a);(r||s)&&Be(this.eventSvc,l,s,i,a)}resizeHeader(e,t,s){if(!e.isResizable())return;const i=_(e.getActualWidth()+t,e.getMinWidth(),e.getMaxWidth());this.setColumnWidths([{key:e,newWidth:i}],s,!0,"uiColumnResized")}createResizeFeature(e,t,s,i){return new oa(e,t,s,i)}createGroupResizeFeature(e,t,s){return new sa(e,t,s)}}],apiFunctions:{setColumnWidths:function(e,t,s=!0,i="api"){e.colResize?.setColumnWidths(t,!1,s,i)}},dependsOn:[Br,ta]},ra=class{constructor(e){this.entries=new Map,this.context=e.context}wrap(e,t,s){const i=this.entries,o=i.get(e);if(o?.depth===t)return o.buildToken=s,e.originalParent=o.parent,o.wrapper;if(void 0!==o&&la(o.wrapper),0===t)return void 0!==o&&i.delete(e),e.originalParent=null,e;const n=e.colId,r=this.context;let a=e;for(let e=t-1;e>=0;--e){const t=new De(null,"FAKE_PATH_"+n+"_"+e,!0,e);r.createBean(t),t.children=[a],a.originalParent=t,a=t}return a.originalParent=null,i.set(e,{wrapper:a,parent:e.originalParent,depth:t,buildToken:s}),a}evict(e){const t=this.entries;0!==t.size&&t.forEach(((s,i)=>{s.buildToken!==e&&(la(s.wrapper),t.delete(i))}))}destroy(){const e=this.entries;e.forEach(aa),e.clear()}},aa=e=>la(e.wrapper),la=e=>{let t=e;for(;t&&!t.isColumn;){const e=t.children[0];t.isAlive()&&t.destroy(),t=e??null}},ca=e=>(e.isColumn?e:e.providedColumnGroup).originalParent,da={moduleName:"ColumnGroup",version:cn,dynamicBeans:{headerGroupCellCtrl:class extends io{constructor(){super(...arguments),this.componentTooltip={},this.headerCompGuard=new Hi,this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,s,i,o){const{column:n,beans:r}=this,{context:a,colNames:l,colHover:c,rangeSvc:d,colResize:u}=r;this.comp=e,o=Bi(this,a,o),this.setGui(t,o),this.displayName=l.getDisplayNameForColumnGroup(n,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(o),this.setupExpandable(o),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:i,compBean:o}),this.setupUserComp(),this.addHeaderMouseListeners(o,i),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const h=n.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(o,h,t),d?.createRangeHighlightFeature(o,n,e),o.createManagedBean(new Wi(n,t,r)),o.createManagedBean(new oo(e,n)),u?this.resizeFeature=o.createManagedBean(u.createGroupResizeFeature(e,s,n)):e.setResizableDisplayed(!1),o.createManagedBean(new ps(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(o,h),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),o.addManagedPropertyListener("cellSelection",(()=>this.refreshAnnouncement())),o.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(o),o.addDestroyFunc((()=>{this.headerCompGuard.invalidate(),this.clearComponentTooltip(),this.clearComponent()}))}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.getDefinition();return xe(t.gos,{colDef:s,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,s=e.get("groupHeaderHeight");null!=s?0===s?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(s):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const s of t)e.addManagedListeners(s,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,s)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),s=t[0]===e,o=(0,i.GXs)(t)===e;if(!s&&!o)return;const n=e.getHighlighted();let r=!1,a=!1;if(this.rowCtrl.getHeaderCellCtrls().find((e=>e.column.isMoving()))){const e=this.beans.gos.get("enableRtl"),t=1===n,i=0===n;s&&(e?a=t:r=i),o&&(e?r=i:a=t)}this.comp.toggleCss("ag-header-highlight-before",r),this.comp.toggleCss("ag-header-highlight-after",a)}resizeHeader(e,t){const{resizeFeature:s}=this;if(!s)return;const i=s.getInitialValues(t);s.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}createUserCompParams(){const{gos:e,enterpriseMenuFactory:t}=this.beans,s=this.column,i=s.getProvidedColumnGroup(),o=this.headerCompGuard.provisionalClaim();return xe(e,{displayName:this.displayName,columnGroup:s,setExpanded:e=>{Li(this.beans,i,e,"gridInitializing")},setTooltip:(t,s)=>{e.assertModuleRegistered("Tooltip",3),o.isCurrent()&&this.setComponentTooltip(t,s)},showColumnMenu:(e,s)=>t?.showMenuAfterButtonClick(i,e,"columnMenu",s),showColumnMenuAfterMouseClick:(e,s)=>t?.showMenuAfterMouseEvent(i,e,"columnMenu",s),eGridHeader:this.eGui})}setupUserComp(){const e=function(e,t){const s=t.columnGroup.getColGroupDef();return e.getCompDetails(s,jt,"agColumnGroupHeader",t)}(this.beans.userCompFactory,this.createUserCompParams());e&&(this.headerCompGuard.supersede(),this.comp.setUserCompDetails(e))}attemptUserCompRefresh(){const e=this.comp.getUserCompInstance();return!!e?.refresh&&e.refresh(this.createUserCompParams())}addHeaderMouseListeners(e,t){const{column:s,comp:i,beans:{rangeSvc:o},gos:n}=this,r=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:r,mouseleave:r,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",s.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,s.getProvidedColumnGroup())}),i.toggleCss("ag-header-group-cell-selectable",ue(n));const a=o?.createHeaderGroupCellMouseListenerFeature(this.column,t);a&&this.createManagedBean(a)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this,this.tooltipFeature,(()=>this.componentTooltip))}setComponentTooltip(e,t){this.componentTooltip={value:e,shouldDisplay:t},this.tooltipFeature?.refreshTooltip()}clearComponentTooltip(){this.componentTooltip={}}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const s=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:s,expandableChanged:s});const i=t.groupId;e.addManagedEventListeners({columnHeaderNameChanged:e=>{e.columnGroup&&e.columnGroup.getGroupId()!==i||this.refreshDisplayName()},columnHeaderEditHighlightChanged:e=>{e.groupId&&e.groupId!==i||this.refreshEditHighlight()}}),this.refreshEditHighlight()}refreshEditHighlight(){this.comp.toggleCss(ji,!!this.beans.colHeaderEditSvc?.isHighlightedGroup(this.column.getProvidedColumnGroup()))}refreshDisplayName(){this.displayName=this.beans.colNames.getDisplayNameForColumnGroup(this.column,"header"),this.attemptUserCompRefresh()||(this.clearComponentTooltip(),this.setupUserComp()),this.tooltipFeature?.refreshTooltip(),this.refreshAnnouncement()}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles(),this.refreshAnnouncement()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),s=Qi(t,this.beans,null,e);e.isPadding()?(s.push("ag-header-group-cell-no-group"),e.getLeafColumns().every((e=>e.isSpanHeaderHeight()))&&s.push("ag-header-span-height")):(s.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&s.push("ag-header-cell-wrap-text"));for(const e of s)this.comp.toggleCss(e,!0)}setupMovingCss(e){const{column:t}=this,s=t.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const t of s)e.addManagedListeners(t,{movingChanged:i});i()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:t,expandable:s,gos:o,beans:n}=this,r=ue(o);if(e.key==i.DDm.ENTER)if(r&&!e.altKey)n.rangeSvc?.handleColumnSelection(t,e);else if(s){const e=!t.isExpanded();Li(n,t.getProvidedColumnGroup(),e,"uiColumnExpanded")}}refreshAnnouncement(){let e;const{gos:t,expandable:s}=this,i=ue(t),o=this.getLocaleTextFunc();i&&s?e=o("ariaColumnGroupCellSelectionAndExpansion","Press Enter to toggle selection for all visible cells in this column group. Press ALT ENTER to expand or collapse this column group"):i?e=o("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group"):s&&(e=o("ariaColumnGroupExpansion","Press ENTER to expand or collapse this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:s}=this;s&&t.contains((0,i.UlD)(e))&&e.ariaAnnounce?.announceValue(s,"columnHeader")}setDragSource(e){this.isAlive()&&!this.isSuppressMoving()&&(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some((e=>e.colDef.suppressMovable||e.colDef.lockPosition))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}}},beans:[class extends ke{constructor(){super(...arguments),this.beanName="colGroupSvc"}wireBeans(e){this.colModel=e.colModel,this.colViewport=e.colViewport,this.wrapperCache=new ra(e)}destroy(){this.wrapperCache.destroy(),super.destroy()}createGroups(e,t,s,i=1,o=!1){const n=!o,r=this.colViewport;if(0===e.length||null===e[0].originalParent){if(n)for(let t=0,s=e.length;t<s;++t){const s=e[t];s.parent&&(s.parent=null,r.colsWithinViewportHash="")}return e}const a=[];let l=e;for(;l.length;){const e=l.length,o=[];let c=0,d=ca(l[0]);for(let u=1;u<=e;++u){const h=u===e?void 0:ca(l[u]);if(!(u<e&&h===d)){if(null==d)for(let e=c;e<u;++e){const t=l[e];a.push(t),n&&null!==t.parent&&(t.parent=null,r.colsWithinViewportHash="")}else{let e;const a=d.groupId,h=t.getInstanceIdForKey(a),p=n?d.displayInstances?.[h]:void 0;if(p&&p.buildToken!==i)p.buildToken=i,p.pinned=s,p.parent=null,p.children=null,p.displayedChildren=[],e=p;else if(e=new Dt(d,a,h,s),e.buildToken=i,n){this.createBean(e);let t=d.displayInstances;null===t&&(t=[],d.displayInstances=t),t[h]=e}let g=e.children;null===g&&(g=[],e.children=g);for(let t=c;t<u;++t){const s=l[t];g.push(s),n&&s.parent!==e&&(s.parent=e,r.colsWithinViewportHash="")}o.push(e)}c=u,u<e&&(d=h)}}l=o}return a}prune(e){const t=this.colModel.colsAllGroups;for(let s=0,i=t.length;s<i;++s){const i=t[s].displayInstances;if(!i)continue;let o=0;for(let t=0,s=i.length;t<s;++t){const s=i[t];s.buildToken===e&&(i[o++]=s)}i.length=o}}}],apiFunctions:{getAllDisplayedColumnGroups:function(e){const{treeLeft:t,treeCenter:s,treeRight:i}=e.visibleCols;return t.concat(s,i)},getCenterDisplayedColumnGroups:function(e){return e.visibleCols.treeCenter},getColumnGroup:function(e,t,s){const i=null!=t?e.colModel.colsGroupsById.get(t)?.displayInstances:void 0;return i&&("number"==typeof s?i[s]:i[0])||null},getColumnGroupState:function(e){return Ni(e)},getDisplayNameForColumnGroup:function(e,t,s){return e.colNames.getDisplayNameForColumnGroup(t,s)||""},getLeftDisplayedColumnGroups:function(e){return e.visibleCols.treeLeft},getProvidedColumnGroup:function(e,t){return e.colModel.getColGroup(t)??null},getRightDisplayedColumnGroups:function(e){return e.visibleCols.treeRight},resetColumnGroupState:function(e){(e=>{const t=[];e.colModel.colDefGroupsById.forEach((e=>{t.push({groupId:e.groupId,open:!!e.colGroupDef?.openByDefault,headerName:null})})),_i(e,t,"api")})(e)},setColumnGroupOpened:function(e,t,s){Li(e,t,s,"api")},setColumnGroupState:function(e,t){_i(e,t,"api")}}};var ua=(e,t)=>{const s=e.originalParent;return null!=s&&s.padding&&s.level===t-1?s:null},ha=(e,t,s)=>{let i=e.originalParent,o=null;for(;null!=i;){let n=-1,r=null;const a=i.children;for(let i=0,l=a.length;i<l;++i){const l=a[i];if(l===o||l===e)continue;let c;if(c=l.isColumn?l:s.get(l),void 0!==c){const e=t.get(c);void 0!==e&&e>n&&(n=e,r=c)}}if(null!=r)return r;o=i,i=i.originalParent}return null},pa=(e,t)=>{const s=e.length;t??(t=[]),t.length=s;for(let i=0;i<s;++i)t[i]=e[i].colId;return t},ga=(e,t)=>{for(let s=0,i=t.length;s<i;++s){const i=t[s],o=i.colDef;e.set(o,i);const n=i.userProvidedColDef;null!=n&&e.set(n,i);const r=o.field;r&&r!==i.colId&&!e.has(r)&&e.set(r,i)}},fa=class extends p{constructor(e,t,s){super(t,s),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}")}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:s,labelAlignment:i,disabled:o,labelEllipsis:n}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=s&&this.setLabelWidth(s),null!=n&&this.setLabelEllipsis(n),this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;(0,i.fDi)(t),"string"==typeof e?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),""===e?((0,i.nl0)(t,!1),(0,i.lXX)(t,"presentation")):((0,i.nl0)(t,!0),(0,i.lXX)(t,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||(0,i.oGr)(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return(0,i.qpX)(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},ma=class extends fa{constructor(e,t,s,i){super(e,t,s),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:s,ariaLabel:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=s&&this.onValueChange(s),null!=i&&this.setAriaLabel(i),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),s=this.getLabel();null==s||""==s||null!==(0,i.rGl)(e)?(0,i.F4t)(e,""):(0,i.F4t)(e,t??"")}setAriaLabel(e){return(0,i.PIC)(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return(0,i.M9x)(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}},va=new Set(["button","checkbox","file","hidden","radio","range","reset","submit"]),wa=class extends ma{constructor(e,t,s="text",o="input"){super(e,e?.template??function(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}(o),[],t),this.inputType=s,this.displayFieldTag=o,this.eLabel=i.dRA,this.eWrapper=i.dRA,this.eInput=i.dRA}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:s,className:i}=this;e.classList.add(`${i}-label`),t.classList.add(`${i}-input-wrapper`),s.classList.add(`${i}-input`),this.addCss("ag-input-field"),s.id=s.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:n,inputPlaceholder:r,autoComplete:a,tabIndex:l}=this.config;null!=o&&this.setInputName(o),null!=n&&this.setInputWidth(n),null!=r&&this.setInputPlaceholder(r),null!=a?this.setAutoComplete(a):this.refreshAutoComplete(),this.addManagedPropertyListener("enableInputAutoComplete",(()=>this.refreshAutoComplete())),this.addInputListeners(),this.activateTabIndex([s],l)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){"input"===this.displayFieldTag&&(this.inputType=e,(0,i.GUt)(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return(0,i.oGr)(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return(0,i.GUt)(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return(0,i.PIC)(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return(0,i.qpX)(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){return this.autoCompleteOverride=e,null==e?this.refreshAutoComplete():this.applyAutoComplete(e),this}refreshAutoComplete(){null==this.autoCompleteOverride&&this.isAutoCompleteCapableField()&&this.applyAutoComplete(!0===this.gos.get("enableInputAutoComplete"))}isAutoCompleteCapableField(){const{eInput:e}=this;if("TEXTAREA"===e.tagName)return!0;if("INPUT"!==e.tagName)return!1;const{type:t}=e;return!va.has(t)}applyAutoComplete(e){if(!0===e)(0,i.GUt)(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";(0,i.GUt)(this.eInput,"autocomplete",t)}}},Ca=class extends wa{constructor(e,t="ag-checkbox",s="checkbox"){super(e,t,s),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:s}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t),null!=s&&this.setName(s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0;const s=this.eInput;s.checked=e,s.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,s){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:s});const i=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:i.id,name:i.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),s=this.selected=e.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",!0===e),t.toggle("ag-indeterminate",null==e)}},ya={selector:"AG-CHECKBOX",component:Ca},ba={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},Sa={tag:"div",cls:"ag-skeleton-container"},xa={moduleName:"CheckboxCellRenderer",version:cn,userComponents:{agCheckboxCellRenderer:class extends ls{constructor(){super(ba,[ya]),this.eCheckbox=i.dRA,this.registerCSS(".ag-checkbox-cell{height:100%}")}init(e){this.refresh(e);const{eCheckbox:t,beans:s}=this,o=t.getInputElement();o.setAttribute("tabindex","-1"),(0,i.nJR)(o,"polite"),this.addManagedListeners(o,{click:e=>{if(ds(e),t.isDisabled())return;const s=t.getValue();this.onCheckboxChanged(s)},dblclick:e=>{ds(e)}}),this.addManagedElementListeners(e.eGridCell,{keydown:o=>{if(o.key===i.DDm.SPACE&&!t.isDisabled()){e.eGridCell===(0,i.UlD)(s)&&t.toggle();const n=t.getValue();this.onCheckboxChanged(n),o.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,s=!0;const{value:o,column:n,node:r}=e;if(r.group&&n)if("boolean"==typeof o)t=o;else{const e=n.getColId();e.startsWith(vt)?t=null==o||""===o?void 0:"true"===o:void 0!==r.aggData?.[e]||r.sourceRowIndex>=0?t=o??void 0:s=!1}else t=o??void 0;const{eCheckbox:a}=this;if(!s)return void a.setDisplayed(!1);a.setValue(t);const l=e.disabled??!n?.isCellEditable(r);a.setDisabled(l);const c=this.getLocaleTextFunc(),d=(0,i.MbN)(c,t),u=l?d:`${c("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;a.setInputAriaLabel(u)}onCheckboxChanged(e){const{params:t}=this,{column:s,node:i,value:o}=t,{editSvc:n}=this.beans;if(!s)return;const r={rowNode:i,column:s};n?.dispatchCellEvent(r,null,"cellEditingStarted",{value:o});const a=i.setDataValue(s,e,"ui");n?.dispatchCellEvent(r,null,"cellEditingStopped",{oldValue:o,newValue:e,valueChanged:a}),a||this.updateCheckbox(t)}}}},Ra={moduleName:"SkeletonCellRenderer",version:cn,userComponents:{agSkeletonCellRenderer:class extends ls{constructor(){super(Sa)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc((()=>(0,i.F4t)(e.eParentOfValue))),(0,i.F4t)(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");(0,i.PIC)(this.getGui(),t)}setupLoading(e){const t=ni({tag:"div",cls:"ag-skeleton-effect"}),s=e.node.rowIndex;if(null!=s){const e=75+25*(s%2==0?Math.sin(s):Math.cos(s));t.style.width=`${e}%`}this.getGui().appendChild(t);const o=this.getLocaleTextFunc(),n=e.deferRender?o("ariaDeferSkeletonCellLoading","Cell is loading"):o("ariaSkeletonCellLoading","Row data is loading");(0,i.PIC)(this.getGui(),n)}refresh(e){return!1}}}},Pa=Ze;function Ea(e,t){if(!e)return;const s=e,i={};for(const e of Object.keys(s)){if(e===t||P(e))continue;const o=s[e];I(o)?i[e]=Ea(o):i[e]=o}return i}var Ia=e=>{const{colId:t,colDef:s,actualWidth:i,aggregationActive:o,rowGroupActive:n,visible:r,pivotActive:a,pinned:l}=e,c=Ea(s);return c.colId=t,c.width=i,c.rowGroup=n,c.rowGroupIndex=n?e.rowGroupActiveIndex:null,c.pivot=a,c.pivotIndex=a?e.pivotActiveIndex:null,c.aggFunc=o?e.aggFunc:null,c.hide=!r||void 0,c.pinned="left"===l||"right"===l?l:null,c.sort=e.getSortDef(),c.sortIndex=e.sortIndex??null,c},ka=(e,t)=>e.colsListIndex-t.colsListIndex,Fa=["dateTimeString","dateString","text","number","bigint","boolean","date"];function Da(e,t){const s={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(s.columnTypes=[...Rt(e.columnTypes),...Rt(t.columnTypes)]),s}function Ta(e,t,s,i){return s?s.baseDataType===t.baseDataType||(e.warn(46),!1):(e.warn(45,{parentCellDataType:i}),!1)}function Aa(e,t){if(e.valueFormatter)return s=>{const{node:i,column:o,value:n}=s;if(i?.group){const t=o,i=(t.pivotValueColumn??t).aggFunc;if(i){if("first"===i||"last"===i)return e.valueFormatter(s);const{baseDataType:t}=e;if(!(r=t,"number"!==r&&"bigint"!==r||"count"===i)){if((e=>"bigint"==typeof e||"number"==typeof e)(n))return e.valueFormatter(s);if(null==n)return;if("object"==typeof n){if("function"==typeof n.toNumber)return e.valueFormatter({...s,value:n.toNumber()});if("value"in n)return e.valueFormatter({...s,value:n.value})}}return}}else if(t.get("groupHideOpenParents")&&s.column.isRowGroupActive()&&"string"==typeof s.value&&!e.dataTypeMatcher?.(s.value))return;var r;return e.valueFormatter(s)}}function Ma(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const s=(0,i.yN4)(e),o=(0,i.yN4)(t);return null!=s&&null!=o?s===o?0:s>o?1:-1:0}function Na(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const s=La(e),i=La(t);return null!=s&&null!=i?s===i?0:s>i?1:-1:0}function La(e){const t=(0,i.yN4)(e);return null==t?null:t<0n?-t:t}function Va(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some((([s,i])=>function(e,t,s,i){if(!t[s])return!1;const o=e[s];return null===o?(t[s]=!1,!1):void 0===i?!!o:o===i}(e,t,s,i)))}function _a(e,t,s){const i=Qe(e,t);for(const e of s)delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex;return i}var Oa={moduleName:"DataType",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference=Object.create(null),this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number:()=>({cellEditor:"agNumberCellEditor"}),bigint:({filterModuleBean:e})=>e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:Ma,absolute:Na}},boolean:()=>({cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:s})=>t.key===i.DDm.SPACE&&s.isCellEditable(e)}),date:({formatValue:e})=>({cellEditor:"agDateCellEditor",keyCreator:e}),dateString:({formatValue:e})=>({cellEditor:"agDateStringCellEditor",keyCreator:e}),dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object:({formatValue:e,colModel:t,colId:s})=>({cellEditorParams:{useFormatter:!0},comparator:(i,o)=>{const n=t.getNonPivotColById(s),r=n?.colDef;if(!n||!r)return 0;const a=null==i?"":e({column:n,node:null,value:i}),l=null==o?"":e({column:n,node:null,value:o});return a===l?0:a>l?1:-1},keyCreator:e}),text:()=>({})}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)}))}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},s={},i=e=>t=>{const{column:s,node:i,value:o}=t;let n=s.getColDef().valueFormatter;return n===e.groupSafeValueFormatter&&(n=e.valueFormatter),this.beans.valueSvc.formatValue(s,i,o,n)};for(const o of Object.keys(e)){const n=e[o],r={...n,groupSafeValueFormatter:Aa(n,this.gos)};t[o]=r,s[o]=i(r)}const o=this.gos.get("dataTypeDefinitions")??{},n={};for(const r of Object.keys(o)){const a=o[r],l=this.processDataTypeDefinition(a,o,[r],e);l&&(t[r]=l,a.dataTypeMatcher&&(n[r]=a.dataTypeMatcher),s[r]=i(l))}const{valueParser:r,valueFormatter:a}=e.object,{valueParser:l,valueFormatter:c}=t.object;this.hasObjectValueParser=l!==r,this.hasObjectValueFormatter=c!==a,this.formatValueFuncs=s,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(n,e)}sortKeysInMatchers(e,t){const s={...e};for(const i of Fa)delete s[i],s[i]=e[i]??t[i].dataTypeMatcher;return s}processDataTypeDefinition(e,t,s,i){let o;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let s=i[n];const r=t[n];if(s&&r&&(s=r),!Ta(this.beans.log,e,s,n))return;o=Da(s,e)}else{if(s.includes(n))return void this.warn(44);const r=t[n];if(!Ta(this.beans.log,e,r,n))return;const a=this.processDataTypeDefinition(r,t,[...s,n],i);if(!a)return;o=Da(a,e)}return{...o,groupSafeValueFormatter:Aa(o,this.gos)}}updateColDefAndGetColumnType(e,t,s){let{cellDataType:i}=t;void 0===i&&(i=e.cellDataType);const{field:o}=t;if(null!=i&&!0!==i||(i=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,s)),this.addFormulaCellEditorToColDef(e,t),!i)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[i];if(n)return e.cellDataType=i,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,i,n,s),n.columnTypes;this.warn(47,{cellDataType:i})}addFormulaCellEditorToColDef(e,t){(t.allowFormula??e.allowFormula)&&!t.cellEditor&&(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.colId];if(!t)return;const s=e=>{t.add(e.key)};e.__addEventListener("columnStateUpdated",s),this.columnStateUpdateListenerDestroyFuncs.push((()=>e.__removeEventListener("columnStateUpdated",s)))}canInferCellDataType(e,t){const{gos:s}=this;if(!B(s))return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(Va(t,i))return!1;const o=null===t.type?e.type:t.type;if(o){const e=s.get("columnTypes")??{};if(Rt(o).some((t=>{const s=e[t.trim()];return s&&Va(s,i)})))return!1}return!Va(e,i)}inferCellDataType(e,t){if(!e)return;let s;const o=this.getInitialData();if(o){const t=e.includes(".")&&!this.gos.get("suppressFieldDotNotation");s=t?(0,i.Ejd)(o,e):o[e]}else this.initWaitForRowData(t);return null!=s?Object.keys(this.dataTypeMatchers).find((e=>this.dataTypeMatchers[e](s)))??"object":void 0}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.beans.rowModel.rootNode?._leafs;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:s,eventSvc:i}=this.beans;t&&s&&(s.shouldQueueResizeOperations=!0);const[o]=this.addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:n}=e;n&&(o?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference=Object.create(null),t&&s?.processResizeOperations(),i.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){const s=this.beans;this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const o=Object.create(null),n=Object.create(null);for(const e of Object.keys(this.columnStateUpdatesPendingInference)){const s=this.columnStateUpdatesPendingInference[e],r=this.colModel.colsById[e];if(!r)continue;const a=r.colDef;if(!this.resetColDefIntoCol(r,"cellDataTypeInferred"))continue;const l=r.colDef;if(t&&l.type&&l.type!==a.type){const t=_a(this.beans,r,s);t.rowGroup&&null==t.rowGroupIndex&&(o[e]=t),t.pivot&&null==t.pivotIndex&&(n[e]=t),i.push(t)}}if(t){const e=Object.create(null);s.rowGroupColsSvc?.restoreColumnOrder(o,e),s.pivotColsSvc?.restoreColumnOrder(n,e);const t=Object.keys(e);for(let s=0,o=t.length;s<o;++s)i.push(e[t[s]])}i.length&&ze(s,{state:i},"cellDataTypeInferred"),this.initialData=null}resetColDefIntoCol(e,t){const s=e.getUserProvidedColDef();if(!s)return!1;const i=Ee(this.beans,s,e.colId);return e.setColDef(i,s,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return"dateTime"===e||"dateTimeString"===e}getDataTypeDefinition(e){const t=e.colDef;if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(null==t)return!0;const s=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!s||!(!e.allowFormula||!this.beans.formula?.isFormula(t))||s(t)}validateColDef(e,t,s,i){if("object"===e.cellDataType){const o=e=>null==e?.cellDataType||!0===e?.cellDataType,n=o(t)&&o(s),r=e=>this.warn(48,{property:e,inferred:n,colId:i}),{object:a}=this.dataTypeDefinitions;e.valueFormatter!==a.groupSafeValueFormatter||this.hasObjectValueFormatter||r("Formatter"),e.editable&&e.valueParser===a.valueParser&&!this.hasObjectValueParser&&r("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||"string"!=typeof t)return;const{dataTypeDefinitions:s,beans:i,formatValueFuncs:o}=this,n=s[t];n&&i.colFilter?.setColDefPropsForDataType(e,n,o[t])}getFormatValue(e){return this.formatValueFuncs[e]}isDataTypeRegistered(e){return null!=this.dataTypeDefinitions[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,s,i){const o=this.formatValueFuncs[t],n=this.columnDefinitionPropsPerDataType[s.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:s,colId:i,formatValue:o,filterModuleBean:this.beans.filterManager});"agFormulaCellEditor"===e.cellEditor&&n.cellEditor!==e.cellEditor&&(n.cellEditor=e.cellEditor),Object.assign(e,n)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),s=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:e=>(0,i.xmb)(e.newValue&&String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?(0,i.tAb)(e.value,s)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:e=>(0,i.xmb)(e)??void 0,dateFormatter:e=>(0,i.tAb)(e??null,t)??void 0,valueParser:e=>(0,i.u6m)(String(e.newValue))?e.newValue:null,valueFormatter:e=>(0,i.u6m)(String(e.value))?String(e.value):"",dataTypeMatcher:e=>"string"==typeof e&&(0,i.u6m)(e)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:t=>null==t.value?"":"number"!=typeof t.value||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:e=>"number"==typeof e},bigint:{baseDataType:"bigint",valueParser:e=>{const{newValue:t}=e;return null==t||"string"==typeof t&&""===t.trim()?null:(0,i.yN4)(t)},valueFormatter:t=>null==t.value?"":"bigint"!=typeof t.value?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:e=>"bigint"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:(0,i.qph)(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:e=>"string"==typeof e&&(0,i.Rq4)(e)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>(0,i.qph)(e.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference=Object.create(null),this.destroyColumnStateUpdateListeners(),super.destroy()}}],dependsOn:[xa]},Ba={moduleName:"ColumnFlex",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth);const s=this.flexViewportWidth,{visibleCols:i,colDelayRenderSvc:o}=this.beans,n=i.centerCols;let r=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=n.length-1;e>=0;e--)if(t.has(n[e])){r=e;break}}let a=!1;const l=n.map(((e,t)=>{const s=e.getFlex(),i=null!=s&&s>0&&t>r;return a||(a=i),{col:e,isFlex:i,flex:Math.max(0,s??0),initialSize:e.getActualWidth(),min:e.getMinWidth(),max:e.getMaxWidth(),targetSize:0}}));if(a&&s?(o?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(o),!s||!a)return[];let c=l.length,d=l.reduce(((e,t)=>e+t.flex),0),u=s;const h=(e,s)=>{e.frozenSize=s,e.col.setActualWidth(s,t),u-=s,d-=e.flex,c-=1},p=e=>null!=e.frozenSize;for(const e of l)e.isFlex||h(e,e.initialSize);for(;c>0;){const e=Math.round(d<1?u*d:u);let t,s=0,i=0;for(const o of l){if(p(o))continue;t=o,i+=e*(o.flex/d);const n=i-s,r=Math.round(n);o.targetSize=r,s+=r}t&&(t.targetSize+=e-s);let o=0;for(const e of l){if(p(e))continue;const t=e.targetSize,s=Math.min(Math.max(t,e.min),e.max);o+=s-t,e.violationType=s===t?void 0:s<t?"max":"min",e.targetSize=s}const n=0===o?"all":o>0?"min":"max";for(const e of l)p(e)||"all"!==n&&e.violationType!==n||h(e,e.targetSize)}const g=e.skipSetLeft?void 0:i.setLeftValues(t);e.updateBodyWidths&&i.updateBodyWidths(g);const f=l.filter((e=>e.isFlex&&!e.violationType)).map((e=>e.col));if(e.fireResizedEvent){const e=l.filter((e=>e.initialSize!==e.frozenSize)).map((e=>e.col)),s=l.filter((e=>e.flex)).map((e=>e.col));Be(this.eventSvc,e,!0,t,s)}return this.revealColumns(o),f}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:s}=e.colDef;void 0!==t?e.flex=t:void 0!==s&&(e.flex=s)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}}]},Ha={moduleName:"ColumnApi",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.colModel=e.colModel}getColumnDefs(){const e=this.colModel;if(!e.ready)return;const t=e.colDefList;e.ensureColsListIndex();const s=t.slice().sort(ka),i=[],o=Object.create(null),n=e.colDefTreeDepth+1;for(let e=0,t=s.length;e<t;++e){const t=s[e];if("hierarchy"===t.colKind)continue;let r=!0,a=Ia(t),l=t.originalParent,c=0;for(;l&&!(++c>n);){if(l.padding){l=l.originalParent;continue}const e=o[l.groupId];if(e){e.children.push(a),r=!1;break}const t=Ea(l.colGroupDef,"children");if(!t){r=!1;break}t.groupId=l.groupId,t.children=[a],o[t.groupId]=t,a=t,l=l.originalParent}r&&i.push(a)}return i}}],apiFunctions:{getColumnDef:function(e,t){const s=e.colModel.getCol(t);return s?s.colDef:null},getDisplayNameForColumn:function(e,t,s){return e.colNames.getDisplayNameForColumn(t,s)||""},getColumn:function(e,t){return e.colModel.getCol(t)??null},getColumns:function(e){const t=e.colModel;return t.ready?t.colDefList:null},applyColumnState:function(e,t){return ze(e,t,"api")},getColumnState:Pa,resetColumnState:function(e){!function(e,t){const{colModel:s,autoColSvc:i,selectionColSvc:o,eventSvc:n,gos:r,colAnimation:a,calculatedColsSvc:l}=e,c=e.userColumnSvc?.clear()??!1;if(l?(l.resetDynamicColumnDefs(!0)||c)&&l.refreshDynamicColumns(t):c&&s.rebuildCols(t),!s.colDefList.length)return;const d=o?.column??null,u=i?.columns,h=u?.length??0,p=new Array(h+(d?1:0)+s.colDefList.length);let g=0,f=-1,m=-1;const v=t=>{const s=Qe(e,t),{rowGroupIndex:i,pivotIndex:o}=s;null!=i&&i>f&&(f=i),null!=o&&o>m&&(m=o),p[g++]=s};if(u)for(let e=0;e<h;++e)v(u[e]);d&&v(d),Xe(s.colDefTree,v);for(let e=0,t=p.length;e<t;++e){const t=p[e];t.rowGroup&&null==t.rowGroupIndex&&(t.rowGroupIndex=++f),t.pivot&&null==t.pivotIndex&&(t.pivotIndex=++m)}a?.start();try{const o=Ye(e);We(e,p,s.colDefList,{},t,!0);const r=s.colDefList;for(let e=0,t=r.length;e<t;++e){const t=r[e];t.pivotSort=pt(t.colDef),t.resetWidthOwnership()}const a=i?.columns,l=a?.length??0,c=new Array((d?1:0)+l+s.colDefList.length);let u=0;d&&(c[u++]={colId:d.colId});for(let e=0;e<l;++e)c[u++]={colId:a[e].colId};Xe(s.colDefTree,(e=>{c[u++]={colId:e.colId}}));const h=s.groupHeaderNameOverrides;h.size&&(h.clear(),n.dispatchEvent({type:"columnHeaderNameChanged",column:null,columns:null,columnGroup:null,source:t})),$e(e,{state:c,applyOrder:!0},t,o)}finally{a?.finish()}n.dispatchEvent(xe(r,{type:"columnsReset",source:t}))}(e,"api")},isPinning:function(e){return e.visibleCols.leftCols.length>0||e.visibleCols.rightCols.length>0},isPinningLeft:function(e){return e.visibleCols.leftCols.length>0},isPinningRight:function(e){return e.visibleCols.rightCols.length>0},getDisplayedColAfter:function(e,t){return e.visibleCols.getColAfter(t)},getDisplayedColBefore:function(e,t){return e.visibleCols.getColBefore(t)},setColumnsVisible:function(e,t,s){Ge(e,t,s,"api")},setColumnsPinned:function(e,t,s){e.pinnedCols?.setColsPinned(t,s,"api")},getAllGridColumns:function(e){return e.colModel.colsList},getDisplayedLeftColumns:function(e){return e.visibleCols.leftCols},getDisplayedCenterColumns:function(e){return e.visibleCols.centerCols},getDisplayedRightColumns:function(e){return e.visibleCols.rightCols},getAllDisplayedColumns:function(e){return e.visibleCols.allCols},getAllDisplayedVirtualColumns:function(e){return e.colViewport.getViewportColumns()},getColumnDefs:function(e){return e.colDefFactory?.getColumnDefs()}}},Ga=class{constructor(){this.existingIds=Object.create(null)}getInstanceIdForKey(e){const t=(this.existingIds[e]??-1)+1;return this.existingIds[e]=t,t}},za=(e,t,s)=>{if(e.isColumn)return s.push(e),!1;const i=e.isPadding()?t:e,o=i?.providedColumnGroup??null,n=o?.expandable,r=e.displayedChildren,a=r?.length??0;let l=null,c=0,d=!1;const u=e.children;if(null!==u){const e=n&&o.expanded;for(let t=0,o=u.length;t<o;++t){const o=u[t];if(n){const t=o.getColumnGroupShow();if("open"===t&&!e||"closed"===t&&e)continue;const n=s.length;if(za(o,i,s)&&(d=!0),s.length===n)continue}else za(o,i,s)&&(d=!0);null!==l?l.push(o):(c>=a||r[c]!==o)&&(null===r?l=[o]:(l=r.slice(0,c),l.push(o))),++c}}const h=null!==l||c!==a;return h&&(e.displayedChildren=l??r.slice(0,c)),(h||d)&&e.dispatchLocalEvent({type:"displayedChildrenChanged"}),h||d},Wa=e=>{let t=e;for(;t;){const e=t.providedColumnGroup;if(!e.padding)return e.level+1;t=t.parent}return 0},ja=e=>{for(let t=0,s=e.length;t<s;++t){const s=e[t];Ft(s)&&s.checkLeft()}},Ua=(e,t)=>{let s=0;for(let i=0,o=e.length;i<o;++i){const o=e[i];o.setLeft(s,t),s+=o.actualWidth}return s},$a={moduleName:"CellRendererFunction",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){return e.supportsJsFunction?class{refresh(){return!1}getGui(){return this.eGui}init(e){const s=t(e),o=typeof s;this.eGui="string"!==o&&"number"!==o&&"boolean"!==o?null!=s?s:ni({tag:"span"}):(0,i.cvw)("<span>"+s+"</span>")}}:null}}]},Ya=["gridCtrl","gridBodyCtrl","scrolling","pinnedTop","pinnedBottom","stickyTop","stickyBottom","fakeHScrollComp","fakeVScrollComp","gridHeaderCtrl","headerRowContainerCtrl"],Ka={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:i.oRP,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:i.WB3,rangeSelectionBackgroundColor:(0,i.jcS)(.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:(0,i.jcS)(.5),rangeHeaderHighlightColor:(0,i.nf2)(.08),calculatedColumnHighlightColor:(0,i.jcS)(.12),columnHeaderEditHighlightColor:(0,i.jcS)(.12),calculatedColumnParentSuggestionColor:(0,i.ql4)(.75),calculatedColumnSuggestionListWidth:200,rowNumbersSelectedColor:(0,i.jcS)(.5),columnHoverColor:(0,i.jcS)(.05),selectedRowBackgroundColor:(0,i.jcS)(.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:.66},dataBackgroundColor:i.oRP,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBackgroundColor:i.oRP,wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,autoHeightMinBodyHeight:150,autoHeightMaxBodyHeight:"none",rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{calc:"pickerFieldHeight + spacing * 1.25"},dragHandleColor:(0,i.ql4)(.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:(0,i.ql4)(.1),iconButtonActiveColor:i.WB3,iconButtonActiveBackgroundColor:(0,i.jcS)(.28),iconButtonActiveIndicatorColor:i.WB3,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:(0,i.ql4)(.8),cellEditingBorder:{color:i.WB3},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.25},cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"},columnSelectIndentSize:{ref:"iconSize"},toolbarBackgroundColor:{ref:"headerBackgroundColor"},toolbarTextColor:{ref:"headerTextColor"},toolbarSeparatorBorder:!0,toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:(0,i.ql4)(.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:(0,i.ql4)(.13)},selectCellBackgroundColor:(0,i.ql4)(.07),selectCellBorder:{color:(0,i.ql4)(.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:i.oRP,filterPanelApplyButtonBackgroundColor:i.WB3,columnPanelApplyButtonColor:i.oRP,columnPanelApplyButtonBackgroundColor:i.WB3,filterPanelCardSubtleColor:{ref:"textColor",mix:.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:i.LW4,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:i.LW4,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:(0,i.ql4)(.15),statusBarLabelColor:i.LW4,statusBarLabelFontWeight:500,statusBarValueColor:i.LW4,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2,formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}},noteIndicatorColor:{ref:"accentColor"},noteIndicatorSize:"8px",notePopupBackgroundColor:{ref:"menuBackgroundColor"},notePopupTextColor:{ref:"menuTextColor",mix:.75},notePopupInputTextColor:{ref:"inputTextColor"},notePopupInputBackgroundColor:{ref:"inputBackgroundColor"},notePopupBorder:{ref:"dialogBorder"},notePopupPadding:{calc:"spacing * 0.5"}},qa={warn:(...e)=>{Vn(e[0],e[1])},error:(...e)=>{!function(...e){Fn(Uo,e[0],e[1],"error",!1)}(e[0],e[1])},preInitErr:(...e)=>{On(e[0],e[2],e[1])}},Za={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}},Qa=(()=>(0,i.ykk)({feature:"buttonStyle",params:{...Za,buttonBackgroundColor:i.oRP,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:i.WB3}},css:":where(.ag-button){background:none;border:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}:where(.ag-button:not(:disabled)){cursor:pointer}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding)}.ag-standard-button:hover:where(:not(:disabled)){background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}.ag-standard-button:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}.ag-standard-button:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}"}))(),Ja=(()=>(0,i.ykk)({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:i.oRP,checkboxUncheckedBorderColor:(0,i.Ikv)(.3),checkboxCheckedBackgroundColor:i.WB3,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="7" fill="none"><path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M1 3.5 3.5 6l5-5"/></svg>'},checkboxCheckedShapeColor:i.oRP,checkboxIndeterminateBackgroundColor:(0,i.Ikv)(.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2" fill="none"><rect width="10" height="2" fill="#000" rx="1"/></svg>'},checkboxIndeterminateShapeColor:i.oRP,radioCheckedShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" fill="none"><circle cx="3" cy="3" r="3" fill="#000"/></svg>'}},css:'.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;-webkit-print-color-adjust:exact;print-color-adjust:exact;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input:where(:not(:disabled)),.ag-radio-button-input:where(:not(:disabled)){cursor:pointer}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}'}))(),Xa=()=>({...i.WyG,cellBatchEditTextColor:"#f3d0b3",backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:(0,i.Ikv)(.05),rowHoverColor:(0,i.jcS)(.15),selectedRowBackgroundColor:(0,i.jcS)(.2),menuBackgroundColor:(0,i.Ikv)(.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:i.LW4,columnPanelApplyButtonColor:i.LW4,findMatchColor:i.oRP,findActiveMatchColor:i.oRP,checkboxUncheckedBorderColor:(0,i.Ikv)(.4),toggleButtonOffBackgroundColor:(0,i.Ikv)(.4),rowBatchEditBackgroundColor:(0,i.Ikv)(.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"}),el=(()=>(0,i.ykk)({feature:"colorScheme",params:i.WyG,modeParams:{light:i.WyG,dark:Xa(),"dark-blue":{...Xa(),backgroundColor:"#1f2836"}}}))(),tl=(()=>(0,i.ykk)({feature:"columnDropStyle",css:".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}"}))(),sl={aggregation:'<path d="M18 7V4H6l6 8-6 8h12v-3"/>',arrows:'<polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="22"/>',asc:'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',cancel:'<path d="m18 6-12 12"/><path d="m6 6 12 12"/>',chart:'<line x1="18" x2="18" y1="20" y2="10"/><line x1="12" x2="12" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="14"/>',"color-picker":'<path d="m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"/><path d="m5 2 5 5"/><path d="M2 13h15"/><path d="M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"/>',columns:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"/>',contracted:'<path d="m9 18 6-6-6-6"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',cross:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',csv:'<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',cut:'<circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/>',desc:'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',down:'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',excel:'<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',pdf:'<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M7 17V12h2.2a1.4 1.4 0 0 1 0 2.8H7"/><path d="M12 17v-5h1.4a2.5 2.5 0 0 1 0 5H12z"/><path d="M17 17v-5h3"/><path d="M17 14h2.5"/>',expanded:'<path d="m15 18-6-6 6-6"/>',eye:'<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',"eye-slash":'<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/>',filter:'<path d="M3 6h18"/><path d="M7 12h10"/><path d="M10 18h4"/>',first:'<path d="m17 18-6-6 6-6"/><path d="M7 6v12"/>',grip:'<circle cx="5" cy="8" r="0.5"/><circle cx="12" cy="8" r="0.5"/><circle cx="19" cy="8" r="0.5"/><circle cx="5" cy="16" r="0.5"/><circle cx="12" cy="16" r="0.5"/><circle cx="19" cy="16" r="0.5"/><g stroke="none" fill="currentColor"><circle cx="5" cy="8" r="1"/><circle cx="12" cy="8" r="1"/><circle cx="19" cy="8" r="1"/><circle cx="5" cy="16" r="1"/><circle cx="12" cy="16" r="1"/><circle cx="19" cy="16" r="1"/></g>',group:'<path d="M16 12H3"/><path d="M16 18H3"/><path d="M10 6H3"/><path d="M21 18V8a2 2 0 0 0-2-2h-5"/><path d="m16 8-2-2 2-2"/>',last:'<path d="m7 18 6-6-6-6"/><path d="M17 6v12"/>',left:'<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',linked:'<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>',loading:'<line x1="12" x2="12" y1="2" y2="6"/><line x1="12" x2="12" y1="18" y2="22"/><line x1="4.93" x2="7.76" y1="4.93" y2="7.76"/><line x1="16.24" x2="19.07" y1="16.24" y2="19.07"/><line x1="2" x2="6" y1="12" y2="12"/><line x1="18" x2="22" y1="12" y2="12"/><line x1="4.93" x2="7.76" y1="19.07" y2="16.24"/><line x1="16.24" x2="19.07" y1="7.76" y2="4.93"/>',maximize:'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>',menu:'<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>',"menu-alt":'<circle cx="12" cy="5" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="12" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="19" r="0.75" fill="#D9D9D9"/>',minimize:'<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" x2="21" y1="10" y2="3"/><line x1="3" x2="10" y1="21" y2="14"/>',minus:'<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/>',next:'<path d="m9 18 6-6-6-6"/>',none:'<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',"not-allowed":'<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>',paste:'<path d="M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"/><path d="m17 10 4 4-4 4"/>',pin:'<line x1="12" x2="12" y1="17" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>',pivot:'<path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/>',plus:'<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/><path d="M12 8v8"/>',previous:'<path d="m15 18-6-6 6-6"/>',right:'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',save:'<path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/>',search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',settings:'<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>',"small-left":'<path d="m15 18-6-6 6-6"/>',"small-right":'<path d="m9 18 6-6-6-6"/>',tick:'<path d="M20 6 9 17l-5-5"/>',"tree-closed":'<path d="m9 18 6-6-6-6"/>',"tree-indeterminate":'<path d="M5 12h14"/>',"tree-open":'<path d="m6 9 6 6 6-6"/>',unlinked:'<path d="M9 17H7A5 5 0 0 1 7 7"/><path d="M15 7h2a5 5 0 0 1 4 8"/><line x1="8" x2="12" y1="12" y2="12"/><line x1="2" x2="22" y1="2" y2="22"/>',up:'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>'},il={aasc:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.2012 8.07928C13.6346 8.0793 14.0128 8.15365 14.3359 8.30193C14.6609 8.45018 14.9141 8.65595 15.0947 8.9201C15.2754 9.18439 15.3683 9.49109 15.374 9.83904H14.1904C14.1676 9.60898 14.0695 9.4303 13.8965 9.30291C13.7235 9.1756 13.4889 9.1115 13.1924 9.1115C12.9909 9.1115 12.8204 9.1404 12.6816 9.19744C12.543 9.25255 12.4364 9.32917 12.3623 9.42791C12.2901 9.52678 12.2539 9.63933 12.2539 9.76482C12.2501 9.8692 12.272 9.9604 12.3193 10.0383C12.3688 10.1162 12.4369 10.1843 12.5225 10.2414C12.6079 10.2964 12.7064 10.3451 12.8184 10.3869C12.9304 10.4268 13.0505 10.4609 13.1777 10.4894L13.7031 10.6144C13.9578 10.6715 14.1914 10.7479 14.4043 10.8429C14.6173 10.938 14.8021 11.0547 14.958 11.1935C15.1138 11.3323 15.2348 11.4957 15.3203 11.6838C15.4077 11.8719 15.4522 12.088 15.4541 12.3312C15.4522 12.6885 15.3611 12.9986 15.1807 13.2609C15.0019 13.5214 14.7427 13.7248 14.4043 13.8693C14.0678 14.0118 13.6617 14.0832 13.1865 14.0832C12.7153 14.0832 12.3048 14.0107 11.9551 13.8664C11.6071 13.7219 11.3345 13.5071 11.1387 13.2238C10.9449 12.9387 10.8435 12.5862 10.834 12.1662H12.0283C12.0416 12.362 12.0984 12.5252 12.1973 12.6564C12.298 12.7857 12.4323 12.8838 12.5996 12.9504C12.7688 13.0149 12.96 13.047 13.1729 13.047C13.3817 13.047 13.563 13.0169 13.7168 12.9562C13.8727 12.8954 13.9935 12.8106 14.0791 12.7023C14.1647 12.5939 14.208 12.469 14.208 12.3283C14.2079 12.1974 14.1686 12.0875 14.0908 11.9982C14.0148 11.9089 13.9022 11.8324 13.7539 11.7697C13.6076 11.707 13.4276 11.6501 13.2148 11.5988L12.5791 11.4387C12.0869 11.3189 11.6982 11.1318 11.4131 10.8771C11.128 10.6224 10.9855 10.2793 10.9873 9.84783C10.9854 9.49418 11.0804 9.18439 11.2705 8.9201C11.4625 8.65603 11.7261 8.45015 12.0605 8.30193C12.3951 8.15369 12.7754 8.07928 13.2012 8.07928Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.8125 14.0002H4.48926L4.05664 12.6681H1.94824L1.51465 14.0002H0.19043L2.20703 8.15935H3.79883L5.8125 14.0002ZM2.26172 11.7043H3.74316L3.02539 9.49334H2.98047L2.26172 11.7043Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.45215 8.15935C8.88165 8.15935 9.24031 8.22251 9.52734 8.34978C9.81445 8.47717 10.0303 8.65477 10.1748 8.88103C10.3192 9.10536 10.3916 9.36368 10.3916 9.65642C10.3916 9.88452 10.3461 10.085 10.2549 10.258C10.1637 10.4289 10.0384 10.5696 9.87891 10.6799C9.72117 10.7882 9.54024 10.8657 9.33691 10.9113V10.9679C9.55917 10.9775 9.76716 11.0406 9.96094 11.1564C10.1568 11.2724 10.3158 11.4356 10.4375 11.6447C10.5591 11.8519 10.6201 12.099 10.6201 12.3859C10.6201 12.6958 10.5427 12.9727 10.3887 13.216C10.2366 13.4573 10.0113 13.6486 9.71289 13.7892C9.41443 13.9299 9.04655 14.0002 8.60938 14.0002H6.11426V8.15935H8.45215ZM7.34863 12.9904H8.35547C8.69943 12.9904 8.95057 12.9252 9.1084 12.7941C9.26621 12.661 9.34473 12.4834 9.34473 12.2629C9.34468 12.1014 9.30643 11.9587 9.22852 11.8351C9.15056 11.7116 9.03903 11.6145 8.89453 11.5441C8.75195 11.4738 8.58148 11.4387 8.38379 11.4387H7.34863V12.9904ZM7.34863 10.6037H8.26465C8.43369 10.6036 8.58376 10.5737 8.71484 10.5148C8.84793 10.454 8.95227 10.3683 9.02832 10.258C9.10628 10.1477 9.14551 10.0155 9.14551 9.8615C9.14546 9.65055 9.07008 9.48001 8.91992 9.35076C8.77165 9.22169 8.56064 9.15741 8.28711 9.1574H7.34863V10.6037Z" fill="black"/><path d="M7.16602 0.377127C7.44584 0.189493 7.82551 0.20905 8.08496 0.442557L11.418 3.44256C11.7257 3.71966 11.7507 4.19428 11.4736 4.50213C11.1966 4.80961 10.7228 4.83441 10.415 4.55779L7.60938 2.03338L5.11328 4.53045C4.82042 4.82326 4.34562 4.82322 4.05273 4.53045C3.75986 4.23757 3.75989 3.7628 4.05273 3.4699L7.05273 0.4699L7.16602 0.377127Z" fill="black"/></svg>',adesc:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.3867 11.4697C10.6796 11.1771 11.1544 11.1769 11.4473 11.4697C11.7399 11.7626 11.7399 12.2374 11.4473 12.5303L8.44727 15.5303L8.33398 15.623C8.05425 15.8106 7.67449 15.7909 7.41504 15.5576L4.08203 12.5576C3.77415 12.2805 3.74927 11.8059 4.02637 11.498C4.30342 11.1907 4.77722 11.1657 5.08496 11.4424L7.89062 13.9668L10.3867 11.4697Z" fill="black"/><path d="M13.2012 3.0791C13.6346 3.07912 14.0128 3.1535 14.3359 3.30176C14.6611 3.45006 14.9141 3.65661 15.0947 3.9209C15.2752 4.18513 15.3683 4.49104 15.374 4.83887H14.1904C14.1676 4.60882 14.0695 4.43012 13.8965 4.30273C13.7235 4.17546 13.4889 4.11133 13.1924 4.11133C12.9909 4.11133 12.8204 4.14023 12.6816 4.19727C12.5431 4.25236 12.4364 4.32902 12.3623 4.42773C12.2901 4.52659 12.2539 4.63919 12.2539 4.76465C12.2501 4.86901 12.272 4.96023 12.3193 5.03809C12.3688 5.11604 12.4369 5.18417 12.5225 5.24121C12.6079 5.29623 12.7064 5.34496 12.8184 5.38672C12.9304 5.42661 13.0505 5.46075 13.1777 5.48926L13.7031 5.61426C13.9578 5.67128 14.1914 5.74776 14.4043 5.84277C14.6172 5.93784 14.8021 6.05457 14.958 6.19336C15.1139 6.33216 15.2348 6.49633 15.3203 6.68457C15.4076 6.8727 15.4522 7.08885 15.4541 7.33203C15.4521 7.68929 15.3612 7.99944 15.1807 8.26172C15.0019 8.52216 14.7427 8.72465 14.4043 8.86914C14.0678 9.01165 13.6617 9.08301 13.1865 9.08301C12.7153 9.08299 12.3048 9.01057 11.9551 8.86621C11.6072 8.72173 11.3345 8.50786 11.1387 8.22461C10.9447 7.9394 10.8435 7.58622 10.834 7.16602H12.0283C12.0416 7.36176 12.0985 7.52509 12.1973 7.65625C12.298 7.78554 12.4323 7.88365 12.5996 7.9502C12.7688 8.01477 12.96 8.04785 13.1729 8.04785C13.3817 8.04781 13.5629 8.01678 13.7168 7.95605C13.8727 7.89522 13.9935 7.81051 14.0791 7.70215C14.1646 7.59387 14.2079 7.46965 14.208 7.3291C14.208 7.19796 14.1687 7.08739 14.0908 6.99805C14.0148 6.90868 13.9022 6.83228 13.7539 6.76953C13.6076 6.70685 13.4276 6.64993 13.2148 6.59863L12.5791 6.43848C12.0868 6.31871 11.6982 6.13163 11.4131 5.87695C11.1279 5.62221 10.9855 5.27916 10.9873 4.84766C10.9854 4.49404 11.0804 4.18517 11.2705 3.9209C11.4625 3.65661 11.7259 3.45006 12.0605 3.30176C12.3951 3.15353 12.7754 3.0791 13.2012 3.0791Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.8125 9H4.48926L4.05664 7.66797H1.94824L1.51465 9H0.19043L2.20703 3.15918H3.79883L5.8125 9ZM2.26172 6.7041H3.74316L3.02539 4.49414H2.98047L2.26172 6.7041Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.45215 3.15918C8.88181 3.15918 9.24025 3.22322 9.52734 3.35059C9.81445 3.47798 10.0303 3.6546 10.1748 3.88086C10.3193 4.10518 10.3916 4.36351 10.3916 4.65625C10.3916 4.88432 10.3461 5.08484 10.2549 5.25781C10.1636 5.4289 10.0386 5.57039 9.87891 5.68066C9.72118 5.78898 9.54022 5.86549 9.33691 5.91113V5.96875C9.55913 5.9783 9.76719 6.04044 9.96094 6.15625C10.1568 6.27223 10.3158 6.43538 10.4375 6.64453C10.5591 6.85173 10.6201 7.09875 10.6201 7.38574C10.6201 7.69567 10.5427 7.97245 10.3887 8.21582C10.2366 8.45719 10.0113 8.64841 9.71289 8.78906C9.41442 8.9297 9.04658 8.99999 8.60938 9H6.11426V3.15918H8.45215ZM7.34863 7.99023H8.35547C8.69948 7.99023 8.95057 7.92504 9.1084 7.79395C9.26621 7.66085 9.34473 7.48325 9.34473 7.2627C9.34466 7.10125 9.3064 6.95844 9.22852 6.83496C9.15056 6.71143 9.03899 6.61427 8.89453 6.54395C8.75196 6.47365 8.58145 6.43848 8.38379 6.43848H7.34863V7.99023ZM7.34863 5.60352H8.26465C8.43369 5.60347 8.58376 5.57354 8.71484 5.51465C8.84791 5.45381 8.95228 5.36807 9.02832 5.25781C9.10623 5.14755 9.14551 5.01529 9.14551 4.86133C9.14542 4.65046 9.07002 4.48078 8.91992 4.35156C8.77163 4.22228 8.56087 4.15724 8.28711 4.15723H7.34863V5.60352Z" fill="black"/></svg>',"chevron-down":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 6L8 10L4 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-left":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 12L6 8L10 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-right":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L10 8L6 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-up":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 10L8 6L12 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"column-arrow":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 26C0 28.2092 1.79086 30 4 30H14C16.2091 30 18 28.2092 18 26V15H25.8786L24.4394 16.4393C23.8536 17.0251 23.8536 17.9749 24.4394 18.5607C25.0252 19.1464 25.9748 19.1464 26.5606 18.5607L30.5606 14.5607C31.1464 13.9749 31.1464 13.0251 30.5606 12.4393L26.5606 8.43934C25.9748 7.85356 25.0252 7.85356 24.4394 8.43934C23.8536 9.02512 23.8536 9.97488 24.4394 10.5607L25.8786 12H18V6C18 3.79086 16.2091 2 14 2H4C1.79086 2 0 3.79086 0 6V26ZM14 5H10.5V12H15V6C15 5.44772 14.5523 5 14 5ZM4 5H7.5V12H3V6C3 5.44772 3.44772 5 4 5ZM10.5 15H15V26C15 26.5522 14.5523 27 14 27H10.5V15ZM4 27H7.5V15H3V26C3 26.5522 3.44772 27 4 27Z" fill="currentColor"/></svg>',document:'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.66663 14.3333V1.66667C2.66663 1.29848 2.9651 1 3.33329 1H9.33329L13.3333 5V14.3333C13.3333 14.7015 13.0348 15 12.6666 15H3.33329C2.9651 15 2.66663 14.7015 2.66663 14.3333Z" stroke="currentColor" stroke-width="1.33333"/><path d="M12.6667 6H8V1" stroke="currentColor" stroke-width="1.33333"/></svg>',edit:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 10.6262V12.5012H5.375L10.905 6.97122L9.03 5.09622L3.5 10.6262ZM12.355 5.52122C12.4014 5.47497 12.4381 5.42002 12.4632 5.35953C12.4883 5.29905 12.5012 5.23421 12.5012 5.16872C12.5012 5.10324 12.4883 5.0384 12.4632 4.97791C12.4381 4.91742 12.4014 4.86248 12.355 4.81622L11.185 3.64622C11.1387 3.59987 11.0838 3.5631 11.0233 3.53801C10.9628 3.51291 10.898 3.5 10.8325 3.5C10.767 3.5 10.7022 3.51291 10.6417 3.53801C10.5812 3.5631 10.5263 3.59987 10.48 3.64622L9.565 4.56122L11.44 6.43622L12.355 5.52122Z" fill="currentColor"/></svg>',"filter-add":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.12126 7.75L10.8517 7.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M6.65934 11.748L9.32778 11.748" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M12.2943 1.04872V6.19184M14.9886 3.74341H9.68478" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M8.25488 3C8.04799 3.18323 7.91706 3.45099 7.91699 3.74902C7.91713 4.04868 8.04988 4.31681 8.25879 4.5H2C1.58579 4.5 1.25 4.16421 1.25 3.75C1.25 3.33579 1.58579 3 2 3H8.25488Z" fill="currentColor"/></svg>',"pinned-bottom":'<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22ZM12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536Z"/></svg>',"pinned-top":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22ZM3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536Z"/></svg>',"small-down":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 10.667 16 21.334l8.667-10.667H7.334Z"/></svg>',"small-up":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 21.333 16 10.666l8.667 10.667H7.334Z"/></svg>',"un-pin":'<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11Z"/><path fill="currentColor" d="M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904l.589-.825Zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28l2.887-4.044ZM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972L9.277 1Z"/></svg>',fx:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49158 3.12305H7.50623C6.93834 3.12323 6.44152 3.5064 6.29724 4.05566L5.87439 5.66797H7.48083V7.16797H5.48083L4.06775 12.5527C3.77958 13.6508 2.787 14.417 1.65173 14.417V12.917C2.10521 12.917 2.50147 12.6105 2.61658 12.1719L3.93005 7.16797H2.42419V5.66797H4.32361L4.84607 3.6748C5.16341 2.46608 6.25655 1.62323 7.50623 1.62305H8.49158V3.12305ZM10.6781 7.5293L12.4115 5.91211H14.6097L14.5648 5.9541L11.4808 8.83203L13.4301 12H11.6683L10.3617 9.87598L8.08728 12H5.88904L9.55994 8.57324L7.92224 5.91211H9.68396L10.6781 7.5293Z" fill="currentColor"/></svg>',"values-as":'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.7631 2.75003C14.3937 4.26881 14.9593 8.21416 13.0263 11.5622C11.0933 14.9103 7.39373 16.3932 4.76312 14.8744C2.13251 13.3556 1.56698 9.41025 3.49998 6.0622C5.43297 2.71416 9.13251 1.23124 11.7631 2.75003ZM11.2631 3.61605C10.0674 2.9257 7.75491 4.69245 6.09805 7.5622C4.4412 10.432 4.06739 13.318 5.26312 14.0084C6.45885 14.6987 8.77133 12.932 10.4282 10.0622C12.085 7.19245 12.4588 4.30641 11.2631 3.61605Z" fill="currentColor"/><path d="M27.1631 17.05C29.7938 18.5688 30.3593 22.5142 28.4263 25.8622C26.4933 29.2103 22.7938 30.6932 20.1631 29.1744C17.5325 27.6556 16.967 23.7103 18.9 20.3622C20.833 17.0142 24.5325 15.5312 27.1631 17.05ZM26.6631 17.9161C25.4674 17.2257 23.1549 18.9924 21.4981 21.8622C19.8412 24.732 19.4674 27.618 20.6631 28.3084C21.8589 28.9987 24.1714 27.232 25.8282 24.3622C27.4851 21.4924 27.8589 18.6064 26.6631 17.9161Z" fill="currentColor"/><path d="M22.7042 2.38759L24.4363 3.38759L9.29419 29.6145L7.56214 28.6145L22.7042 2.38759Z" fill="currentColor"/></svg>'},ol=(e,t=1.5)=>{const s=il[e];if(s)return s;const i=sl[e];if(!i)throw new Error(`Missing icon data for ${e}`);return`<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="black" stroke-width="${t}" viewBox="0 0 24 24"><style>* { vector-effect: non-scaling-stroke; }</style>`+i+"</svg>"},nl=((e={})=>(0,i.ykk)({feature:"iconSet",css:()=>((e={})=>{let t="";for(const s of[...Object.keys(sl),...Object.keys(il)]){const i=ol(s,e.strokeWidth);t+=`.ag-icon-${s}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(i)}'); }\n`}return t})(e)}))(),rl={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonBorderRadius:{ref:"borderRadius"},pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4},al=(()=>(0,i.ykk)({feature:"inputStyle",params:{...rl,inputBackgroundColor:i.oRP,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:i.WB3},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:(0,i.Ikv)(.06),inputDisabledTextColor:{ref:"textColor",mix:.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-clear-button{align-items:center;background:transparent;border:0;border-radius:var(--ag-border-radius);color:inherit;cursor:pointer;display:flex;height:var(--ag-icon-size);inset-inline-end:var(--ag-spacing);justify-content:center;padding:0;position:absolute;width:var(--ag-icon-size)}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);min-height:var(--ag-input-height);padding-inline:var(--ag-input-padding-start);&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}.ag-input-field-search-icon{align-items:center;display:inline-flex;inset-inline-start:var(--ag-spacing);opacity:.5;pointer-events:none;position:absolute;--ag-icon-color:var(--ag-input-icon-color)}:where(.ag-input-field-search){.ag-number-field-input,.ag-text-field-input{padding-inline-start:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}}.ag-input-field-input-with-clear-button{padding-inline-end:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-input-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}"}))(),ll={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1},cl=(()=>(0,i.ykk)({feature:"tabStyle",params:{...ll,tabBarBorder:!0,tabBarBackgroundColor:(0,i.ql4)(.05),tabTextColor:{ref:"textColor",mix:.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:i.oRP},css:'.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}'}))(),dl=(()=>(0,i.ykk)({feature:"styleQuartz",css:":where(.ag-number-field.ag-paging-number) .ag-input-field-input{padding-bottom:1px}"}))(),ul=(()=>(0,i.J82)(qa).withParams(Ka).withPart(Qa).withPart(Ja).withPart(el).withPart(nl).withPart(cl).withPart(al).withPart(tl).withPart(dl).withParams({fontFamily:[{googleFont:"IBM Plex Sans"},...(0,i.Vbm)()]}))(),hl=(e,t,s)=>({changeKey:e,type:t,defaultValue:s}),pl=hl("autoHeightMaxBodyHeight","length",1/0),gl=hl("cellHorizontalPadding","length",16),fl=hl("cellWidgetSpacing","length",12),ml=hl("iconSize","length",16),vl=hl("rowHeight","length",42),wl=hl("headerHeight","length",48),Cl=hl("rowBorderWidth","border",1),yl=hl("pinnedRowBorderWidth","border",1),bl=hl("headerRowBorderWidth","border",1);function Sl(e,t,s){const i=e.visibleCols.headerGroupRowCount;if(s>=i)return{column:t,headerRowIndex:s};let o=t.parent;for(;o&&o.getProvidedColumnGroup().getLevel()>s;)o=o.parent;const n=t.isSpanHeaderHeight();return!o||n&&o.isPadding()?{column:t,headerRowIndex:i}:{column:o,headerRowIndex:o.getProvidedColumnGroup().getLevel()}}var xl=new Set(["gridPreDestroyed","fillStart","pasteStart","issueRaised"]),Rl=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnHeaderNameChanged","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","calculatedColumnCreated","calculatedColumnExpressionChanged","calculatedColumnRemoved","calculatedColumnValidationStateChanged","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterUiChanged","filterOpened","floatingFilterUiChanged","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped","issueRaised"].reduce(((e,t)=>{var s;return e[t]=!(s=t)||s.length<2?s:"on"+s[0].toUpperCase()+s.substring(1),e}),{}),Pl={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agFileInputOverlay:"FileInputOverlay",agErrorOverlay:"Validation",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find",agButtonToolbarItem:"Toolbar",agFindToolbarItem:"Toolbar",agMenuToolbarItem:"Toolbar",agPivotPanelToolbarItem:"Toolbar",agQuickFilterToolbarItem:"Toolbar",agRowGroupPanelToolbarItem:"Toolbar"},El={allowFormula:"Formula",calculatedExpression:"CalculatedColumns",aggFunc:"SharedAggregation",showValuesAs:"ShowValuesAs",initialShowValuesAs:"ShowValuesAs",showValuesAsDef:"ShowValuesAs",enableShowValuesAs:"ShowValuesAs",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:e,editable:t,groupRowEditable:s})=>t||s?"string"==typeof e?Pl[e]??"CustomEditor":"CustomEditor":null,cellRenderer:({cellRenderer:e})=>"string"!=typeof e?null:Pl[e],cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:e,cellEditor:t})=>e&&!t?"TextEditor":null,groupRowEditable:({groupRowEditable:e,cellEditor:t})=>e?t?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]:null,groupRowValueSetter:({groupRowValueSetter:e})=>e?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:e})=>e&&"string"!=typeof e&&"boolean"!=typeof e?"CustomFilter":"string"==typeof e?Pl[e]??"ColumnFilter":"ColumnFilter",floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",columnMenuItems:["ColumnMenu","ColumnsToolPanel"],menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some((e=>t.includes(e)))?"ColumnMenu":null},pivot:"SharedPivot",pivotIndex:"SharedPivot",pivotSort:"SharedPivot",initialPivotSort:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltip:"Tooltip",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},Il={autoGenerateColumnDefs:"AutoGenerateColumns",processFileInput:"FileInputOverlay",alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",calculatedColumns:"CalculatedColumns",columnHeaderEdit:"ColumnHeaderEdit",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getColumnMenuItems:["ColumnMenu","ColumnsToolPanel"],getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:(e,t)=>"serverSide"===t.rowModelType?"ServerSideRowModel":"RowGrouping",grandTotalRow:["CsrmHierarchy","ServerSideRowModel"],initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isMasterOpenByDefault:"MasterDetail",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDefaultExpanded:"MasterDetail",masterDetail:(e,t)=>"serverSide"===t.rowModelType?"ServerSideRowModel":"MasterDetail",notesDataSource:"Notes",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:(e,t)=>"serverSide"===t.rowModelType?"ServerSideRowModel":"Pivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:(e,t)=>"serverSide"===t.rowModelType?"ServerSideRowModel":"RowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:(e,t)=>"serverSide"===t.rowModelType?"ServerSideRowModel":"TreeData",toolbar:"Toolbar",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},kl=0,Fl=0,Dl="__ag_grid_instance";function Tl(e,t,s){e.addManagedElementListeners(t,{mousedown:e=>{0===e.button&&"opened"===s()&&e.preventDefault()},click:e=>{0===e.detail&&s()}});const i=new ei(t,!0);i.addEventListener("tap",s),e.addDestroyFunc((()=>i.destroy()))}var Al=class extends ke{constructor(e,t){super(),this.column=e,this.eGui=t,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(e){const{sortSvc:t,rangeSvc:s,gos:i}=this.beans;if(!ue(i)||e.altKey){if(this.column.isSortable()){const s=this.column.isMoving(),i=Date.now()-this.lastMovingChanged<50;s||i||t?.progressSortFromEvent(this.column,e)}}else s?.handleColumnSelection(this.column,e)}},Ml=class extends ke{constructor(e,t){super(),this.eLabel=e,this.columnGroup=t,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){const{columnGroup:e,beans:t}=this,{ctrlsSvc:s}=t;s.whenReady(this,(()=>{const t=this.refreshPosition.bind(this),s=this.refreshStickyOffset.bind(this);null==e.getPinned()&&this.addManagedEventListeners({bodyScroll:e=>{"horizontal"===e.direction&&this.updateSticky(e.left)},leftPinnedWidthChanged:s}),this.addManagedListeners(e,{leftChanged:t,displayedChildrenChanged:t}),this.addManagedEventListeners({columnResized:t}),this.addManagedPropertyListener("enableRtl",s),this.refreshStickyOffset(),this.refreshPosition()}))}refreshPosition(){const{columnGroup:e,beans:t}=this,s=e.getLeft(),i=e.getActualWidth();if(null==s||0===i)return this.left=null,this.right=null,void this.setSticky(!1);this.left=s,this.right=s+i;const o=t.colViewport.getScrollPosition();null!=o&&this.updateSticky(o)}updateSticky(e){const{left:t,right:s}=this;null!=t&&null!=s?this.setSticky(t<e&&s>e):this.setSticky(!1)}setSticky(e){const{isSticky:t,eLabel:s}=this;t!==e&&(this.isSticky=e,s.classList.toggle("ag-sticky-label",e))}refreshStickyOffset(){if(null!=this.columnGroup.getPinned())return this.eLabel.style.removeProperty("left"),void this.eLabel.style.removeProperty("right");const{beans:{gos:e,visibleCols:t},eLabel:s}=this,i=e.get("enableRtl"),o=`calc(var(--ag-cell-horizontal-padding) + ${i?t.getRightStickyColumnContainerWidth():t.getLeftStickyColumnContainerWidth()}px)`;i?(s.style.removeProperty("left"),s.style.setProperty("right",o)):(s.style.removeProperty("right"),s.style.setProperty("left",o))}},Nl={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},Ll={moduleName:"ColumnHeaderComp",version:cn,userComponents:{agColumnHeader:class extends ls{constructor(){super(...arguments),this.eFilter=i.dRA,this.eShowValuesAs=i.dRA,this.eFilterButton=i.dRA,this.eSortIndicator=i.dRA,this.eMenu=i.dRA,this.eLabel=i.dRA,this.eText=i.dRA,this.eColRef=i.dRA,this.eCalculatedColumn=i.dRA,this.eSortOrder=i.dRA,this.eSortAsc=i.dRA,this.eSortDesc=i.dRA,this.eSortMixed=i.dRA,this.eSortNone=i.dRA,this.eSortAbsoluteAsc=i.dRA,this.eSortAbsoluteDesc=i.dRA,this.isLoadingInnerComponent=!1}refresh(e){const t=this.params;if(this.params=e,this.workOutTemplate(e,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||e.enableSorting!=this.currentSort||e.column.formulaRef!=this.currentRef||null!=this.currentSuppressMenuHide&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon)return!1;if(this.innerHeaderComponent){const t={...e};F(t,e.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(t)}else this.setDisplayName(e);return!0}workOutTemplate(e,t){const{formula:s,showValuesAsSvc:i}=this.beans,o=e.template;return o?o?.trim?o.trim():o:function(e,t,s,i){const o={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:o},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:o},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[e?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,t?{tag:"span",ref:"eCalculatedColumn",cls:"ag-header-icon ag-calculated-column-icon",attrs:o}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:o},i?{tag:"span",ref:"eShowValuesAs",cls:"ag-header-icon ag-header-label-icon ag-show-values-as-icon",attrs:o}:null,s?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}(!!s?.active,e.column.isCalculatedCol,t,!!i)}init(e){this.params=e;const{sortSvc:t,touchSvc:s,rowNumbersSvc:i,userCompFactory:o}=this.beans,n=t?.SortIndicatorSelector;this.currentTemplate=this.workOutTemplate(e,!!n),this.setTemplate(this.currentTemplate,n?[n]:void 0),this.eLabel&&(this.mouseListener??(this.mouseListener=this.createManagedBean(new Al(e.column,this.eLabel)))),s?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),this.setupCalculatedColumnIcon(),i?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.setupShowValuesAsIcon(),this.workOutInnerHeaderComponent(o,e),this.setDisplayName(e)}workOutInnerHeaderComponent(e,t){const s=function(e,t,s){return e.getCompDetails(t,zt,void 0,s)}(e,t,t);s&&(this.isLoadingInnerComponent=!0,s.newAgStackInstance().then((e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderComponent=e,this.eText&&this.eText.appendChild(e.getGui())):this.destroyBean(e))})))}setDisplayName(e){const{displayName:t}=e,s=this.currentDisplayName;this.currentDisplayName=t,!this.eText||s===t||this.innerHeaderComponent||this.isLoadingInnerComponent||(this.eText.textContent=(0,i.SjP)(t))}addInIcon(e,t,s){const i=er(e,this.beans,s);i&&t.appendChild(i)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return(0,i.MwW)(this.eMenu),void(this.eMenu=void 0);const{gos:e,eMenu:t,params:s}=this,o=ye(e);this.addInIcon(o?"menu":"menuAlt",t,s.column),t.classList.toggle("ag-header-menu-icon",!o);const n=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=n,Tl(this,t,(()=>this.toggleColumnMenu(t))),this.toggleMenuAlwaysShow(n)}toggleMenuAlwaysShow(e){this.eMenu?.classList.toggle("ag-header-menu-always-show",e)}showColumnMenu(e){const{currentSuppressMenuHide:t,params:s}=this;t||this.toggleMenuAlwaysShow(!0),s.showColumnMenu(e,(()=>{t||this.toggleMenuAlwaysShow(!1)}))}toggleColumnMenu(e){const{currentSuppressMenuHide:t,params:s}=this,i=this.beans.menuSvc?.toggleColumnMenu({column:s.column,buttonElement:e,positionBy:"button",onClosedCallback:()=>{t||this.toggleMenuAlwaysShow(!1)}})??"declined";return"opened"!==i||t||this.toggleMenuAlwaysShow(!0),i}onMenuKeyboardShortcut(e){const{params:t,gos:s,beans:i,eMenu:o,eFilterButton:n}=this,r=t.column,a=ye(s);if(e&&!a){if(i.menuSvc?.isFilterMenuInHeaderEnabled(r))return t.showFilter(n??o??this.getGui()),!0}else if(t.enableMenu)return this.showColumnMenu(o??n??this.getGui()),!0;return!1}setupSort(){const{sortSvc:e}=this.beans;if(!e)return;const{enableSorting:t,column:s}=this.params;if(this.currentSort=t,!this.eSortIndicator){this.eSortIndicator=this.createBean(new e.SortIndicatorComp(!0));const{eSortIndicator:t,eSortOrder:s,eSortAsc:i,eSortDesc:o,eSortMixed:n,eSortNone:r,eSortAbsoluteAsc:a,eSortAbsoluteDesc:l}=this;t.attachCustomElements(s,i,o,n,r,a,l)}this.eSortIndicator.setupSort(s),this.currentSort&&e.setupHeader(this,s)}setupColumnRefIndicator(){const{eColRef:e,beans:{editModelSvc:t},params:s}=this;e&&(this.currentRef=s.column.formulaRef,e.textContent=this.currentRef,(0,i.nl0)(e,!1),this.addManagedEventListeners({cellEditingStarted:()=>{const s=t?.getEditPositions(),o=!!this.currentRef&&!!s?.some((e=>e.column.allowFormula));(0,i.nl0)(e,o)},cellEditingStopped:()=>{(0,i.nl0)(e,!1)}}))}setupCalculatedColumnIcon(){const{eCalculatedColumn:e,params:t}=this;e&&this.addInIcon("calculatedColumnsHeader",e,t.column)}setupFilterIcon(){const{eFilter:e,params:t}=this;e&&this.configureFilter(t.enableFilterIcon,e,(()=>{const s=t.column.isFilterActive();(0,i.nl0)(e,s,{skipAriaHidden:!0})}),"filterActive")}setupShowValuesAsIcon(){const{eShowValuesAs:e,params:t}=this,{showValuesAsSvc:s}=this.beans;if(!e||!s)return;const o=t.column;this.addInIcon("showValuesAs",e,o);const n=()=>{const t=null!=o.showValuesAs&&!o.showValuesAsDef?.suppressHeaderIndicator;(0,i.nl0)(e,t,{skipAriaHidden:!0}),t&&(e.classList.toggle("ag-show-values-as-dormant",!s.isApplying(o)),e.title=s.getActiveModeTooltip(o)??"")};this.addManagedListeners(o,{columnStateUpdated:n}),this.addManagedEventListeners({columnRowGroupChanged:n,columnPivotChanged:n,columnPivotModeChanged:n}),n()}setupFilterButton(){const{eFilterButton:e,params:t}=this;e&&(this.configureFilter(t.enableFilterButton,e,this.onFilterChangedButton.bind(this),"filter")?Tl(this,e,(()=>this.beans.menuSvc?.toggleFilterMenu({column:t.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})??"declined")):this.eFilterButton=void 0)}configureFilter(e,t,s,o){if(!e)return(0,i.MwW)(t),!1;const n=this.params.column;return this.addInIcon(o,t,n),this.addManagedListeners(n,{filterChanged:s}),s(),!0}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){const{eFilterButton:t,eMenu:s}=this;return e?t??s??this.getGui():s??t??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}}},icons:{menu:"menu",menuAlt:"menu-alt"}},Vl={moduleName:"ColumnGroupHeaderComp",version:cn,userComponents:{agColumnGroupHeader:class extends ls{constructor(){super(Nl),this.agOpened=i.dRA,this.agClosed=i.dRA,this.agLabel=i.dRA,this.isLoadingInnerComponent=!1}init(e){const{userCompFactory:t,touchSvc:s}=this.beans;this.params=e,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(t,e),this.setupLabel(e),this.addGroupExpandIcon(e),this.setupExpandIcons(),s?.setupForHeaderGroup(this)}refresh(e){const{innerHeaderGroupComponent:t,isLoadingInnerComponent:s}=this;if(s)return!1;if(t){if(!t.refresh)return!1;const s=t.refresh(e);return s&&(this.params=e),s}this.params=e;const{displayName:o}=e;return this.agLabel.textContent=(0,i.Qmv)(o)?(0,i.SjP)(o):"",!0}checkWarnings(){this.params.template&&this.beans.log.warn(89)}workOutInnerHeaderGroupComponent(e,t){const s=function(e,t,s){return e.getCompDetails(t,Wt,void 0,s)}(e,t,t);s&&(this.isLoadingInnerComponent=!0,s.newAgStackInstance().then((e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderGroupComponent=e,this.agLabel.appendChild(e.getGui())):this.destroyBean(e))})))}setupExpandIcons(){const{agOpened:e,agClosed:t,params:{columnGroup:s}}=this;this.addInIcon("columnGroupOpened",e),this.addInIcon("columnGroupClosed",t);const i=e=>{if(us(e))return;const t=!s.isExpanded();Li(this.beans,s.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(t,i),this.addTouchAndClickListeners(e,i);const o=e=>{ds(e)};this.addManagedElementListeners(t,{dblclick:o}),this.addManagedElementListeners(e,{dblclick:o}),this.addManagedElementListeners(this.getGui(),{dblclick:i}),this.updateIconVisibility();const n=s.getProvidedColumnGroup(),r=this.updateIconVisibility.bind(this);this.addManagedListeners(n,{expandedChanged:r,expandableChanged:r})}addTouchAndClickListeners(e,t){this.beans.touchSvc?.setupForHeaderGroupElement(this,e,t),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){const{agOpened:e,agClosed:t,params:{columnGroup:s}}=this;if(s.isExpandable()){const o=s.isExpanded();(0,i.nl0)(e,o),(0,i.nl0)(t,!o)}else(0,i.nl0)(e,!1),(0,i.nl0)(t,!1)}addInIcon(e,t){const s=er(e,this.beans,null);s&&t.appendChild(s)}addGroupExpandIcon(e){if(!e.columnGroup.isExpandable()){const{agOpened:e,agClosed:t}=this;(0,i.nl0)(e,!1),(0,i.nl0)(t,!1)}}setupLabel(e){const{displayName:t,columnGroup:s}=e,{innerHeaderGroupComponent:o,isLoadingInnerComponent:n}=this,r=o||n;(0,i.Qmv)(t)&&!r&&(this.agLabel.textContent=(0,i.SjP)(t)),s.getColGroupDef()?.suppressStickyLabel||this.createManagedBean(new Ml(this.getGui(),s))}destroy(){super.destroy(),this.innerHeaderGroupComponent&&(this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0)}}},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},_l={moduleName:"AnimationFrame",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(e){this.scrollGoingDown=e>=this.lastScrollTop,0===e&&(this.scrollGoingDown=!0),this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){!1===this.active&&this.warn(92)}createTask(e,t,s,i,o=!1){this.verify();let n=s;i&&this.batchFrameworkComps&&(n="f1");const r={task:e,index:t,createOrder:++this.taskCount,deferred:o};this.addTaskToList(this[n],r),this.schedule()}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort(((e,s)=>e.deferred!==s.deferred?e.deferred?-1:1:e.index!==s.index?t*(s.index-e.index):s.createOrder-e.createOrder)),e.sorted=!0}addDestroyTask(e){this.verify(),this.destroyTasks.push(e),this.schedule()}executeFrame(e){const{p1:t,p2:s,f1:i,destroyTasks:o,beans:n}=this,{ctrlsSvc:r,frameworkOverrides:a}=n,l=t.list,c=s.list,d=i.list,u=Date.now();let h=0;const p=e<=0,g=r.getScrollFeature();for(;p||h<e;){if(!g.scrollGridIfNeeded()){let n;if(l.length)this.sortTaskList(t),n=l.pop().task;else if(c.length)this.sortTaskList(s),n=c.pop().task;else if(d.length)a.wrapOutgoing((()=>{for(;(p||h<e)&&!g.scrollGridIfNeeded()&&d.length;)this.sortTaskList(i),n=d.pop().task,n(),h=Date.now()-u})),n=()=>{};else{if(!o.length)break;n=o.pop()}n()}h=Date.now()-u}l.length||c.length||d.length||o.length?this.requestFrame():this.ticking=!1}flushAllFrames(){this.active&&this.executeFrame(-1)}schedule(){this.active&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);(0,i.Arb)(this.beans,e)}isQueueEmpty(){return!this.ticking}}]};function Ol(e,t,s){const{eventSvc:i,frameworkOverrides:o,editSvc:n,editModelSvc:r,gos:a}=e,{column:l}=t,c=Io(a,t.column,t.rowNode,s),d=l.colDef,u=t.createEvent(s,"cellDoubleClicked");if(u.isEventHandlingSuppressed=c,i.dispatchEvent(u),"function"==typeof d.onCellDoubleClicked&&window.setTimeout((()=>{o.wrapOutgoing((()=>{d.onCellDoubleClicked(u)}))}),0),!c&&n?.shouldStartEditing(t,s)&&"editing"!==r?.getState(t)){const e=n?.isEditing(),i=n?.isRangeSelectionEnabledWhileEditing(),o=r?.getCellValidationModel().getCellValidationMap().size??0,a=r?.getRowValidationModel().getRowValidationMap().size??0;if(e&&(i||o>0||a>0))return;n?.startEditing(t,{event:s})}}function Bl(e,t){if(!t.target||!t.relatedTarget)return!1;const s=e.eGui,i=s.contains(t.target),o=s.contains(t.relatedTarget);return i&&o}var Hl={moduleName:"Touch",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="touchSvc"}mockBodyContextMenu(e,t){this.mockContextMenu(e,e.eGridViewport,t,{shouldHandleLongTap:()=>this.isBodyContextMenuEnabled()})}mockHeaderContextMenu(e,t){this.mockContextMenu(e,e.eGui,t,{shouldHandleLongTap:()=>!!this.beans.menuSvc?.isHeaderContextMenuEnabled()})}mockRowContextMenu(e){(0,i.TvF)()&&this.mockContextMenu(e,e.element,((t,s,i)=>{const{rowCtrl:o,cellCtrl:n}=e.getControlsForEventTarget(i?.target??null);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,i,o,n)}),{shouldHandleLongTap:()=>this.isBodyContextMenuEnabled(),onLongTapDetected:({touchEvent:t})=>{if(!(0,i.NuO)(this.beans,t))return;const{cellCtrl:s}=e.getControlsForEventTarget(t.target);s?.column&&s.dispatchCellContextMenuEvent(t)}})}handleCellDoubleClick(e,t){return!!(()=>{if(!(0,i.TvF)()||(0,i.ELu)("dblclick"))return!1;const t=Date.now(),s=t-e.lastIPadMouseClickEvent<200;return e.lastIPadMouseClickEvent=t,s})()&&(Ol(this.beans,e,t),t.preventDefault(),!0)}setupForHeader(e){const{gos:t,sortSvc:s,menuSvc:i}=this.beans;if(t.get("suppressTouch"))return;const{params:o,eMenu:n,eFilterButton:r}=e,a=new ei(e.getGui(),!0);e.addDestroyFunc((()=>a.destroy()));const l=e.shouldSuppressMenuHide(),c=!!i?.isHeaderContextMenuEnabled(o.column),d=((e,t,s)=>t||e&&s)(o.enableMenu,c,ye(t));if(d&&e.addManagedListeners(a,{longTap:e=>o.showColumnMenuAfterMouseClick(e.touchStart)}),o.enableSorting){const t=e=>{const t=e.touchStart.target;l&&(n?.contains(t)||r?.contains(t))||s?.progressSort(o.column,!1,"uiColumnSorted")};e.addManagedListeners(a,{tap:t})}}setupForHeaderGroup(e){const t=e.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(t.columnGroup.getProvidedColumnGroup())){const s=new ei(t.eGridHeader,!0),i=e=>t.showColumnMenuAfterMouseClick(e.touchStart);e.addManagedListeners(s,{longTap:i}),e.addDestroyFunc((()=>s.destroy()))}}setupForHeaderGroupElement(e,t,s){const i=new ei(t,!0);e.addManagedListeners(i,{tap:s}),e.addDestroyFunc((()=>i.destroy()))}isBodyContextMenuEnabled(){return!!this.beans.contextMenuSvc&&!this.gos.get("suppressContextMenu")}mockContextMenu(e,t,s,o){if(!(0,i.TvF)())return;const n=new ei(t,o);e.addManagedListeners(n,{longTap:e=>{(0,i.NuO)(this.beans,e.touchEvent)&&s(void 0,e.touchStart,e.touchEvent)}}),e.addDestroyFunc((()=>n.destroy()))}}]};function Gl(e){return!(!e.rowPinned||!e.pinnedSibling)}function zl(e,t,s,i){const o="top"===t;if(!s)return zl(e,t,o?e.getPinnedTopRow(0):e.getPinnedBottomRow(0),i);if(!i){const i=o?e.getPinnedTopRowCount():e.getPinnedBottomRowCount();return zl(e,t,s,o?e.getPinnedTopRow(i-1):e.getPinnedBottomRow(i-1))}let n=!1,r=!1;const a=[];return e.forEachPinnedRow(t,(e=>e!==s||n?n&&e===i?(r=!0,void a.push(e)):void(n&&!r&&a.push(e)):(n=!0,void a.push(e)))),a}function Wl(e,t,s,{rowNode:i,column:o},n){return xe(e.gos,{type:s,node:i,data:i.data,value:n,column:o,colDef:o.getColDef(),rowPinned:i.rowPinned,event:t,rowIndex:i.rowIndex})}function jl(e){const t=e.getCellSpan()?.getCellHeight(),s=e.eGui;null!=t&&s&&(s.style.height=`${t}px`)}function Ul(e){const t=e.eGui;t&&(t.style.width=`${$l(e)}px`)}function $l(e){const{colsSpanning:t,column:s}=e;if(!t)return s.getActualWidth();let i=0;for(let e=0,s=t.length;e<s;++e)i+=t[e].actualWidth;return i}function Yl(e,t){const{column:s,rowNode:o}=t,n=s.getColSpan(o),r=[];if(1===n)r.push(s);else{let t=s;const o=s.getPinned();for(let s=0;t&&s<n&&(r.push(t),t=e.visibleCols.getColAfter(t),t&&!(0,i.MWY)(t))&&o===t.getPinned();s++);}return r}function Kl(e,t){const s=t.getRootElement();if(!s)return;const{gos:i,visibleCols:o}=e,n=Gi({left:ql(t),pinned:t.column.getPinned(),width:$l(t),isPrintLayout:t.printLayout,isRtl:i.get("enableRtl"),visibleCols:o});null!=n&&function(e,t,s,i){const{gos:o,visibleCols:n}=e;zi(s,{offset:i,pinned:t.column.getPinned(),width:$l(t),isPrintLayout:t.printLayout,isRtl:o.get("enableRtl"),visibleCols:n})}(e,t,s,n)}function ql(e){return e.column.getLeft()}function Zl(e,t,s){if(1===t.rowSpan&&!s)return;const i=t.eGui;if(!i)return;const o=q(e)*t.rowSpan;i.style.height=`${o}px`,i.style.zIndex="1"}var Ql=0,Jl=class extends ke{constructor(e,t,s,o){super(),this.column=e,this.rowNode=t,this.rowCtrl=o,this.lastIPadMouseClickEvent=0,this.rowSpan=1,this.rangeFeature=void 0,this.rowResizeFeature=void 0,this.notesFeature=void 0,this.calculatedColumnCssApplied=!1,this.calculatedColumnHighlightedCssApplied=!1,this.hasActiveRenderer=!1,this.suppressRefreshCell=!1,this.pendingEditStart=null,this.focusEventWhileNotReady=null,this.hasBeenFocused=!1,this.tooltipFeature=void 0,this.editorTooltipFeature=void 0,this.rendererTooltipValue=void 0,this.rendererTooltipShouldDisplay=void 0,this.beans=s,this.gos=s.gos,this.editSvc=s.editSvc;const{colId:n}=e;this.instanceId=n+"-"+Ql++,this.createCellPosition(),this.isClientSideLoadingCell()||this.updateAndFormatValue(!1),function(e,t){t.isCellSpanning()||(function(e,t){null!=t.column.colDef.colSpan&&(t.colsSpanning=Yl(e,t),t.addManagedListeners(e.eventSvc,{displayedColumnsChanged:()=>function(e,t){const s=Yl(e,t);(0,i.MpY)(t.colsSpanning,s)||(t.colsSpanning=s,Ul(t),Kl(e,t))}(e,t),displayedColumnsWidthChanged:()=>Ul(t)}))}(e,t),function(e,t){t.rowSpan=t.column.getRowSpan(t.rowNode),t.addManagedListeners(e.eventSvc,{newColumnsLoaded:()=>function(e,t){const s=t.column.getRowSpan(t.rowNode);t.rowSpan!==s&&(t.rowSpan=s,Zl(e,t,!0))}(e,t)})}(e,t))}(s,this)}isClientSideLoadingCell(){return G(this.gos,this.rowNode)}addFeatures(){const{beans:e}=this;this.enableTooltipFeature();const{rangeSvc:t}=e;t&&de(e.gos)&&(this.rangeFeature=t.createCellRangeFeature(this)),St(this.column)&&(this.rowResizeFeature=this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this)),this.notesFeature=this.beans.notesSvc?.createNotesFeature(this)}isCellSpanning(){return!1}getCellSpan(){}removeFeatures(){const e=this.beans.context;this.editorTooltipFeature=e.destroyBean(this.editorTooltipFeature),this.rangeFeature=e.destroyBean(this.rangeFeature),this.rowResizeFeature=e.destroyBean(this.rowResizeFeature),this.notesFeature=e.destroyBean(this.notesFeature),this.disableTooltipFeature()}enableTooltipFeature(){this.tooltipFeature=this.beans.tooltipSvc?.enableCellTooltipFeature(this)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature),this.rendererTooltipValue=void 0,this.rendererTooltipShouldDisplay=void 0}resetCellRendererTooltip(){null!=this.rendererTooltipValue&&this.isAlive()&&(this.rendererTooltipValue=void 0,this.rendererTooltipShouldDisplay=void 0,this.tooltipFeature?.refreshTooltip())}enableEditorTooltipFeature(e){this.editorTooltipFeature&&this.disableEditorTooltipFeature(),this.editorTooltipFeature=this.beans.tooltipSvc?.setupCellEditorTooltip(this,e),this.editSvc?.populateModelValidationErrors(this)}disableEditorTooltipFeature(){this.editorTooltipFeature=this.beans.context.destroyBean(this.editorTooltipFeature)}setComp(e,t,s,i,o,n,r){this.comp=e,this.eGui=t,this.printLayout=o,r??(r=this),this.addDomData(r);const a=this.isClientSideLoadingCell();var l,c;a||(this.addFeatures(),r.addDestroyFunc((()=>this.removeFeatures()))),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),a||this.setupControlComps(),this.setupAutoHeight(i,r),this.refreshFirstAndLastStyles(),a||this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),Kl(l=this.beans,c=this),Ul(c),c.getCellSpan()?jl(c):Zl(l,c),a||(this.beans.cellStyles?.setupCellCustomStyle(this),this.editSvc?.applyCellEditStyles(this)),this.tooltipFeature?.refreshTooltip(),this.rangeFeature?.setComp(e),this.rowResizeFeature?.refreshRowResizer(),this.editSvc?.onCompAttached(this,n)||this.showValue(!1,!0),this.pendingEditStart&&this.editSvc.replayPendingStart(this)}checkFormulaError(){const e=this.beans.formula;e&&(e.active||this.isCalculatedColumn())&&this.eGui.classList.toggle("formula-error",this.hasFormulaError())}hasFormulaError(){const e=this.beans.formula;return!(!e||!e.active&&!this.isCalculatedColumn()||!e.getFormulaError(this.column,this.rowNode))}hasCellValidationError(){const{editModelSvc:e}=this.beans;return!!e&&e.getCellValidationModel().hasCellValidation(this)}setupAutoHeight(e,t){this.isClientSideLoadingCell()?this.isAutoHeight=!1:this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,e,t)??!1}getCellAriaRole(){return this.column.colDef.cellAriaRole??"gridcell"}isCellRenderer(){const e=this.column.colDef;return null!=e.cellRenderer||null!=e.cellRendererSelector}hasActiveCellRenderer(){return this.hasActiveRenderer}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){const{beans:e,column:t}=this,{userCompFactory:s,ctrlsSvc:o,eventSvc:n}=e,r=t.colDef,a=this.createCellRendererParams();a.deferRender=!0;const l=ss(s,r,a);if(o.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let e;const t=new i.oY$((t=>{e=t})),[s]=this.addManagedListeners(n,{bodyScrollEnd:()=>{e(),s()}});return{loadingComp:l,onReady:t}}return{loadingComp:l,onReady:i.oY$.resolve()}}showValue(e,t){const{beans:s,column:i,rowNode:o,rangeFeature:n}=this,{userCompFactory:r}=s;let a,l=this.getValueToDisplay();const c=o.stub&&null==o.groupData?.[i.getId()],d=i.colDef;if(c||this.isCellRenderer()){const e=this.createCellRendererParams();a=!c||St(i)?ts(r,d,e):ss(r,d,e)}if(!a&&!c&&s.findSvc?.isMatch(o,i)){const e=this.createCellRendererParams();a=ts(r,{...i.colDef,cellRenderer:"agFindCellRenderer"},e)}const u=this.editSvc;if(u?.isBatchEditing()&&u.isRowEditing(o,{checkSiblings:!0})){const e=u.prepDetailsDuringBatch(this,{compDetails:a,valueToDisplay:l});e&&(e.compDetails?a=e.compDetails:e.valueToDisplay&&(l=e.valueToDisplay))}this.hasActiveRenderer=null!=a,this.comp.setRenderDetails(a,l,e),this.customRowDragComp?.refreshVisibility(),!t&&n&&n.scheduleRefreshRangeStyleAndHandle(),this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){const e=this.column.colDef;this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(e),!0),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let e="";return"agCheckboxCellRenderer"===this.column.colDef.cellRenderer&&(e=" ag-allow-overflow"),`ag-cell-value${e}`}isIncludeControl(e,t=!1){return(null==this.rowNode.rowPinned||t&&Gl(this.rowNode))&&!!e}isCheckboxSelection(e){const{rowSelection:t,groupDisplayType:s}=this.beans.gridOptions,i=le(t),o=bt(this.column);return("custom"!==s||"selectionColumn"===i||!o)&&(e.checkboxSelection||o&&"object"==typeof t&&re(t))}refreshShouldDestroy(){const e=this.column.colDef,t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e),!0),s=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),i=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||s||i||o}stopEditing(e=!1){const{editSvc:t}=this.beans;return t?.stopEditing(this,{cancel:e,source:t?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){const{value:e,valueFormatted:t,column:s,rowNode:i,comp:o,eGui:n,beans:{valueSvc:r,gos:a,editSvc:l}}=this;return xe(a,{value:e,valueFormatted:t,getValue:()=>r.getDisplayValue(s,i,"edit",this.shouldUseShowValuesAsValue()),setValue:e=>l?.setDataValue({rowNode:i,column:s},e)||i.setDataValue(s,e),formatValue:this.formatValue.bind(this),data:i.data,node:i,pinned:s.getPinned(),colDef:s.colDef,column:s,refreshCell:this.refreshCell.bind(this),eGridCell:n,eParentOfValue:o.getParentOfValue(),registerRowDragger:(e,t,s,i)=>this.registerRowDragger(e,t,i),setTooltip:(e,t)=>{a.assertModuleRegistered("Tooltip",3),this.rendererTooltipValue=e,this.rendererTooltipShouldDisplay=t,this.tooltipFeature?.refreshTooltip()}})}onCellChanged(e){e.column===this.column&&this.refreshCell()}refreshOrDestroyCell(e){if(this.isClientSideLoadingCell())return;this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e);const t=this.editSvc;if(t&&this.editCompDetails){const e=this.comp;!e?.getCellEditor()&&t.isEditing(this,{withOpenEditor:!0})&&t.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(e){if(this.isClientSideLoadingCell())return;const{beans:{cellFlashSvc:t,filterManager:s,cellStyles:i},column:o,comp:n,suppressRefreshCell:r}=this;if(r)return;const a=o.enableCellChangeFlash,l=null==o.field&&null==o.valueGetter&&null==o.showRowGroup&&!o.isCalculatedCol,c=e?.newData??!1,d=l||e&&(e.force||c),u=!!n,h=this.updateAndFormatValue(u);if(u){if(d||h){this.showValue(!!c,!1);const o=s?.isSuppressFlashingCellsBecauseFiltering();!e?.suppressFlash&&!o&&a&&t?.flashCell(this),this.editSvc?.applyCellEditStyles(this),i?.applyCellUserStyles(this),i?.applyCellClassesFromColDef(this),this.editSvc?.applyRowEditStyles(this.rowCtrl),this.checkFormulaError()}this.tooltipFeature?.refreshTooltip(),this.refreshNoteState(),i?.applyCellClassRules(this)}}showNote(e=!1){this.notesFeature?.show({focusEditor:e})}refreshNoteState(){this.notesFeature?.refresh()}isNoteHoverSuppressed(){return!!this.editSvc?.isEditing(this)||this.hasFormulaError()||this.hasCellValidationError()}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(e){const t=this.beans.valueSvc,s=this.column,i=this.rowNode;if(this.shouldUseShowValuesAsValue()){const o=t.formatTransformedValue(s,i,e);if(void 0!==o)return o??e}return t.formatValue(s,i,e)??e}updateAndFormatValue(e){const t=this.value,s=this.valueFormatted,{value:i,valueFormatted:o}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit",transformValues:this.shouldUseShowValuesAsValue()});return this.value=i,this.valueFormatted=o,!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=s}shouldUseShowValuesAsValue(){return null!=this.column.showValuesAs&&!this.editSvc?.isEditing(this,{withOpenEditor:!0})}valuesAreEqual(e,t){const s=this.column.colDef;return s.equals?s.equals(e,t):e===t}addDomData(e){const t=this.eGui;Q(this.beans.gos,t,Do,this),e.addDestroyFunc((()=>Q(this.beans.gos,t,Do,null)))}createEvent(e,t){const{rowNode:s,column:i,value:o,beans:n}=this;return Wl(n,e,t,{rowNode:s,column:i},o)}processCharacter(e){!function(e,t,s){const o=s.target!==t.eGui,{editSvc:n}=e;if(!o&&!n?.isEditing(t,{withOpenEditor:!0}))if(s.key===i.DDm.SPACE)!function(e,t,s){const{gos:i,editSvc:o}=e,{rowNode:n}=t;!o?.isEditing(t,{withOpenEditor:!0})&&U(i)&&e.selectionSvc?.handleSelectionEvent(s,n,"spaceKey"),s.preventDefault()}(e,t,s);else if(n?.isCellEditable(t,"ui")){if(n?.revalidateAndCheck()&&!n.checkValidated(t))return;n?.startEditing(t,{startedEdit:!0,event:s,source:"api",editable:!0});const e=t.editCompDetails;!e?.params?.suppressPreventDefault&&s.preventDefault()}}(this.beans,this,e)}onKeyDown(e){!function(e,t,s){const o=s.key;if(o!==i.DDm.ENTER||!St(t.column)||!e.rowNumbersSvc?.handleKeyDownOnCell(t.cellPosition,s))switch(o){case i.DDm.ENTER:!function(e,t,s){const{editSvc:o,navigation:n}=e,r=o?.isEditing(t,{withOpenEditor:!0}),a=t.rowNode,l=o?.isRowEditing(a,{withOpenEditor:!0}),c=e=>{const t=o?.startEditing(e,{startedEdit:!0,event:s,source:"edit"});t&&s.preventDefault()};if(r||l){if(((d=s).ctrlKey||d.metaKey)&&d.key===i.DDm.ENTER)return void o?.applyBulkEdit(t,e?.rangeSvc?.getCellRanges()||[]);const n=o?.checkNavWithValidationAndCache(void 0,s);if("block-stop"===n?.result)return void("fullRow"===e.gos.get("editType")&&o?.announceFullRowEditValidationErrors(a));o?.isEditing(t,{withOpenEditor:!0})?o?.stopEditing(t,{event:s,source:"edit"},n?.validationCache):l&&!t.isCellEditable()?o?.stopEditing({rowNode:a},{event:s,source:"edit"},n?.validationCache):c(t)}else if(e.gos.get("enterNavigatesVertically")){const e=s.shiftKey?i.DDm.UP:i.DDm.DOWN;n?.navigateToNextCell(null,e,t.cellPosition,!1)}else{if(o?.revalidateAndCheck())return;o?.checkValidated(t)&&o.revertSingleCellEdit(t,!0),c(t)}var d}(e,t,s);break;case i.DDm.F2:!function(e,t,s){const{editSvc:i,notesSvc:o}=e,n=i?.isEditing();if(s.shiftKey&&o?.hasDataSource()&&!n){const e=o.getNoteAccess({rowNode:t.rowNode,column:t.column});if(e&&(!e.isSuppressed||e.canView))return o.showNote(e.params,!0),void s.preventDefault()}n&&"block-stop"===i?.checkNavWithValidation(void 0,s)||i?.startEditing(t,{startedEdit:!0,event:s})}(e,t,s);break;case i.DDm.ESCAPE:!function(e,t,s){const{editSvc:i}=e;i?.isEditing()&&(s.preventDefault(),setTimeout((()=>{i?.stopEditing(t,{event:s,cancel:!0})})))}(e,t,s);break;case i.DDm.TAB:!function(e,t,s){e.navigation?.onTabKeyDown(t,s)}(e,t,s);break;case i.DDm.BACKSPACE:case i.DDm.DELETE:!function(e,t,s,o){const{rowNode:n}=t,{gos:r,rangeSvc:a,eventSvc:l,editSvc:c}=e;if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===i.DDm.DELETE||!t&&e===i.DDm.BACKSPACE&&(0,i.puL)()}(s,r.get("enableCellEditingOnBackspace"))&&!c?.isEditing(t,{withOpenEditor:!0})){if(a&&de(r))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(t.isCellEditable()){const s=e.valueSvc.getDeleteValue(t.column,n);n.setDataValue(t.column,s,"cellClear")}}else c?.isEditing(t,{withOpenEditor:!0})||e.editSvc?.startEditing(t,{startedEdit:!0,event:o});l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}(e,t,o,s);break;case i.DDm.DOWN:case i.DDm.UP:case i.DDm.RIGHT:case i.DDm.LEFT:!function(e,t,s,o){if(!e.editSvc?.isEditing(t,{withOpenEditor:!0})){if(s.shiftKey&&t.isRangeSelectionEnabled())!function(e,t){const{rangeSvc:s,navigation:o}=e;if(!s)return;const n=s.extendLatestRangeInDirection(t);n&&(t.key===i.DDm.LEFT||t.key===i.DDm.RIGHT?o?.ensureColumnVisible(n.column):o?.ensureRowVisible(n.rowIndex))}(e,s);else{const i=t.getFocusedCellPosition();e.navigation?.navigateToNextCell(s,o,i,!0)}s.preventDefault()}}(e,t,s,o)}}(this.beans,this,e)}onMouseEvent(e,t){!function(e,t,s,o){if(!us(o))switch(s){case"click":!function(e,t,s){if(e.touchSvc?.handleCellDoubleClick(t,s))return;const{eventSvc:i,rangeSvc:o,editSvc:n,editModelSvc:r,frameworkOverrides:a,gos:l}=e,c=s.ctrlKey||s.metaKey,{column:d,cellPosition:u,rowNode:h}=t,p=Io(l,d,h,s);o&&c&&!p&&o.getCellRangeCount(u)>1&&o.intersectLastRange(!0);const g=t.createEvent(s,"cellClicked");g.isEventHandlingSuppressed=p,i.dispatchEvent(g);const f=d.colDef;if(f.onCellClicked&&window.setTimeout((()=>{a.wrapOutgoing((()=>{f.onCellClicked(g)}))}),0),!p&&"editing"!==r?.getState(t)){const e=n?.isEditing(),i=n?.isRangeSelectionEnabledWhileEditing(),o=r?.getCellValidationModel().getCellValidationMap().size??0,a=r?.getRowValidationModel().getRowValidationMap().size??0;if(e&&(i||o>0||a>0))return;n?.shouldStartEditing(t,s)?n?.startEditing(t,{event:s}):n?.shouldStopEditing(t,s)&&("fullRow"===l.get("editType")?n?.stopEditing(t,{event:s,source:"edit"}):n?.stopEditing(void 0,{event:s,source:"edit"}))}}(e,t,o);break;case"pointerdown":case"mousedown":case"touchstart":!function(e,t,s){const{shiftKey:o}=s,n=s.target,{eventSvc:r,rangeSvc:a,rowNumbersSvc:l,focusSvc:c,gos:d,editSvc:u}=e,{column:h,rowNode:p,cellPosition:g}=t,f=Io(d,h,p,s),m=()=>{const e=t.createEvent(s,"cellMouseDown");e.isEventHandlingSuppressed=f,r.dispatchEvent(e)};if(f)return void m();if(function(e,t,s){const{rangeSvc:i}=e;if(i){const o=i.isCellInAnyRange(t.cellPosition),n=function({gos:e},t){return 2===t.button||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}(e,s);if(o&&n)return!0}return!1}(e,t,s))return;const v=a&&!a.isEmpty(),w=function(e){return(0,i.HW9)(e,"ag-selection-checkbox",3)||(0,i.HW9)(e,"ag-drag-handle",3)}(n),C=St(h);if(!l||!C||l.handleMouseDownOnCell(g,s)){if(!o||!v){const e=u?.isEditing(t),o=d.get("enableCellTextSelection")&&s.defaultPrevented,r=((0,i.e3J)()||o)&&!e&&!(0,i.aas)(n)&&!w;t.focusCell({forceBrowserFocus:r,sourceEvent:s})}if(o&&v&&!c.isCellFocused(g)){s.preventDefault();const e=c.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:o}=e,n=!!u?.isRangeSelectionEnabledWhileEditing?.();u?.isEditing(e)&&!n&&u?.stopEditing(e),n||c.setFocusedCell({column:t,rowIndex:i,rowPinned:o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:s})}}w||(a?.handleCellMouseDown(s,g),m())}}(e,t,o);break;case"dblclick":Ol(e,t,o);break;case"mouseout":!function(e,t,s){if(Bl(t,s))return;const{eventSvc:i,colHover:o}=e;i.dispatchEvent(t.createEvent(s,"cellMouseOut")),o?.clearMouseOver()}(e,t,o);break;case"mouseover":!function(e,t,s){if(Bl(t,s))return;const{eventSvc:i,colHover:o}=e;i.dispatchEvent(t.createEvent(s,"cellMouseOver")),o?.setMouseOver([t.column])}(e,t,o)}}(this.beans,this,e,t)}getColSpanningList(){return Yl(this.beans,this)}onLeftChanged(){this.comp&&Kl(this.beans,this)}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:s}=this;Ji(e,t,s.visibleCols)}refreshAriaColIndex(){(0,i.T$n)(this.eGui,this.column.ariaColIndex)}onWidthChanged(){Ul(this)}getRowPosition(){const{rowIndex:e,rowPinned:t}=this.cellPosition;return{rowIndex:e,rowPinned:t}}updateRangeBordersIfRangeCount(){this.comp&&this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.comp&&this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return null!=this.rangeFeature}focusCell(e){if(this.isClientSideLoadingCell())return;const{forceBrowserFocus:t=!1,preventScrollOnBrowserFocus:s=!1,sourceEvent:i}=e||{},o=this.editSvc?.allowedFocusTargetOnValidation(this);o&&o!==this||this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:t,preventScrollOnBrowserFocus:s,sourceEvent:i})}restoreFocus(e=!1){const{beans:{editSvc:t,focusSvc:s},comp:i}=this;if(!i||t?.isEditing(this)||!this.isCellFocused()||!s.shouldTakeFocus())return;const o=()=>{if(!this.isAlive())return;const e=i.getFocusableElement();this.isCellFocused()&&e.focus({preventScroll:!0})};e?setTimeout(o,0):o()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(e){const t=this.eGui;t&&(0,i.GUt)(t,"tabindex",e?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;const e=this.column.isFirstRightPinned();this.comp.toggleCss("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.comp)return;const e=this.column.isLastLeftPinned();this.comp.toggleCss("ag-cell-last-left-pinned",e)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){const e=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=e),e}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(e){const{beans:t}=this;if(mi(t))return;if(!this.comp)return void(e&&(this.focusEventWhileNotReady=e));const s=this.isCellFocused(),o=t.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss("ag-cell-focus",s),s&&(e?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let s=this.comp.getFocusableElement();if(o){const e=(0,i.YE1)(s,null,!0);e.length&&(s=e[0])}const n=!e||e.preventScrollOnBrowserFocus;s.focus({preventScroll:n}),(0,i.Moh)(t,s)}s&&this.focusEventWhileNotReady&&(this.focusEventWhileNotReady=null),s&&e&&this.rowCtrl.announceDescription(this)}createCellPosition(){const{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:(0,i.X7E)(t),column:this.column}}applyStaticCssClasses(){const{comp:e}=this;e.toggleCss("ag-cell",!0),e.toggleCss("ag-cell-not-inline-editing",!0);const t=1==this.column.isAutoHeight();e.toggleCss("ag-cell-auto-height",t),e.toggleCss("ag-cell-normal-height",!t),this.setCalculatedColumnCss()}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){this.comp&&(this.tooltipFeature?.refreshTooltip(),this.setWrapText(),this.setCalculatedColumnCss(),this.editSvc?.isEditing(this)?this.editSvc?.handleColDefChanged(this):this.refreshOrDestroyCell({force:!0,suppressFlash:!0}))}setWrapText(){const e=1==this.column.colDef.wrapText;this.comp.toggleCss("ag-cell-wrap-text",e)}setCalculatedColumnCss(){const e=this.beans.calculatedColsSvc,t=null!=e&&this.column.isCalculatedCol;(t||this.calculatedColumnCssApplied)&&(this.comp.toggleCss(Ui,t),this.calculatedColumnCssApplied=t);const s=null!=e&&t&&e.isHighlightedColumn(this.column);(s||this.calculatedColumnHighlightedCssApplied)&&(this.comp.toggleCss($i,s),this.calculatedColumnHighlightedCssApplied=s)}isCalculatedColumn(){return this.column.isCalculatedCol}refreshCalculatedColumnCss(){this.setCalculatedColumnCss()}dispatchCellContextMenuEvent(e){const t=this.column.colDef,s=this.createEvent(e,"cellContextMenu"),{beans:i}=this;i.eventSvc.dispatchEvent(s),t.onCellContextMenu&&window.setTimeout((()=>{i.frameworkOverrides.wrapOutgoing((()=>{t.onCellContextMenu(s)}))}),0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){this.editSvc?.onCellDestroyed(this),this.isCellFocused()&&this.hasBrowserFocus()&&this.beans.focusSvc.attemptToRecoverFocus(),super.destroy()}hasBrowserFocus(e){const t=(0,i.UlD)(this.beans),s=this.eGui;return e?s===t:s?.contains(t)??!1}createSelectionCheckbox(){const e=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(e)return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);return e&&this.beans.context.createBean(e),e}registerRowDragger(e,t,s){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const i=this.createRowDragComp(e,t,s);i&&(this.customRowDragComp=i,this.addDestroyFunc((()=>{this.beans.context.destroyBean(i),this.customRowDragComp=null})),i.refreshVisibility())}createRowDragComp(e,t,s){const i=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,(()=>this.value),e,t,s);if(i)return this.beans.context.createBean(i),i}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!St(this.column)||!this.eGui)return;const{ariaRowIndex:e}=this.rowCtrl;null!=e&&(0,i.vwK)(this.eGui,e)}getRootElement(){return this.eGui}};function Xl(e,t,s,i,o,n){if(null==s&&null==t)return;const r={},a={},l=(e,t)=>{for(const s of e.split(" "))""!=s.trim()&&t(s)};if(s){const t=Object.keys(s);for(let o=0;o<t.length;o++){const n=t[o],c=s[n];let d;"string"==typeof c?d=!e||e.evaluate(c,i):"function"==typeof c&&(d=c(i)),l(n,(e=>{d?r[e]=!0:a[e]=!0}))}}if(t&&n)for(const e of Object.keys(t))l(e,(e=>{r[e]||(a[e]=!0)}));n&&Object.keys(a).forEach(n),Object.keys(r).forEach(o)}function ec(e){if(e.group)return e.level;const t=e.parent;return t?t.level+1:0}var tc=class extends ke{constructor(e){super(),this.rowCtrl=e,this.focusEventWhileNotReady=null}initialiseComp(){const e=this.rowCtrl.getCurrentRowComp(),t=this.rowCtrl.getCurrentRowElement();if(e&&t){if(this.tooltips?.pruneStaleElements(),this.shouldCreateCellSections()&&e.showEmbeddedFullWidth)this.rowCtrl.isEmbeddedFullWidth=!0,this.rowCtrl.embeddedSectionHasContent={left:!0,center:!0,right:!0},e.showEmbeddedFullWidth({left:this.createFullWidthCompDetails(e.getPinnedLeftRowElement()??t,"left",!0),center:this.createFullWidthCompDetails(e.getScrollingRowElement()??t,null,!0),right:this.createFullWidthCompDetails(e.getPinnedRightRowElement()??t,"right",!0)}),this.rowCtrl.refreshPinnedCellGroupWidths();else{this.rowCtrl.isEmbeddedFullWidth=!1;const s=this.createFullWidthCompDetails(t,null,!0);e.showFullWidth(s),this.rowCtrl.refreshPinnedCellGroupWidths()}this.notesFeature?.destroy(),this.notesFeature=this.beans.notesSvc?.createFullWidthNotesFeature(this.rowCtrl)}}refreshRow(e){this.refreshFullWidthComp()?this.notesFeature?.refresh():this.rowCtrl.redrawThisRow()}refreshFullWidthComp(){const e=this.rowCtrl.getCurrentRowComp(),t=this.rowCtrl.getCurrentRowElement();return!e||!t||(this.tooltips?.pruneStaleElements(),this.shouldCreateCellSections()&&e.refreshEmbeddedFullWidth?e.refreshEmbeddedFullWidth((s=>{const i="left"===s?e.getPinnedLeftRowElement():"right"===s?e.getPinnedRightRowElement():e.getScrollingRowElement();return this.createFullWidthCompDetails(i??t,s).params})):e.refreshFullWidth((()=>this.createFullWidthCompDetails(t,null).params)))}shouldCreateCellSections(){return this.rowCtrl.printLayout||this.gos.get("embedFullWidthRows")}getModeCellRenderers(){return this.rowCtrl.getCurrentRowComp()?.getFullWidthCellRenderers()??[]}getAllCellCtrls(){return[]}recreateCell(e){}destroyCells(){}onDisplayedColumnsChanged(){this.notesFeature?.refresh()}onVirtualColumnsChanged(){}onColumnMoved(){this.notesFeature?.refresh()}onSpannedCellsUpdated(e){}createFullWidthCompDetails(e,t,s=!1){const{rowCtrl:i}=this,{gos:o}=this,{rowNode:n}=i,r=this.getTooltips(),a=r?.claimRenderer(e,s),l=xe(o,{fullWidth:!0,data:n.data,node:n,value:n.key,valueFormatted:n.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:i.addEventListener.bind(i),registerRowDragger:(e,t,s,i)=>this.addFullWidthRowDragging(e,t,s,i),setTooltip:(t,s)=>{o.assertModuleRegistered("Tooltip",3),a&&r.setRendererTooltip(e,n,t,s,a)}}),c=this.beans.userCompFactory;switch(i.getRowType()){case"FullWidthDetail":return function(e,t){return e.getCompDetailsFromGridOptions(es,"agDetailCellRenderer",t,!0)}(c,l);case"FullWidthGroup":{const{value:t,valueFormatted:s}=this.beans.valueSvc.getValueForDisplay({node:n,includeValueFormatted:!0,from:"edit"});return l.value=t,l.valueFormatted=s,r?.setupGroupRowsTooltip(n,e),function(e,t){return e.getCompDetailsFromGridOptions(Xt,"agGroupRowRenderer",t,!0)}(c,l)}case"FullWidthLoading":return function(e,t){return e.getCompDetailsFromGridOptions(Jt,"agLoadingCellRenderer",t,!0)}(c,l);default:return function(e,t){return e.getCompDetailsFromGridOptions(Qt,void 0,t,!0)}(c,l)}}setupDetailRowAutoHeight(e){"FullWidthDetail"===this.rowCtrl.getRowType()&&this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this.rowCtrl,e)}getTooltips(){return this.tooltips??(this.tooltips=this.beans.tooltipSvc?.createFullWidthRowTooltips(this.rowCtrl))}addFullWidthRowDragging(e,t,s="",i){const{rowDragSvc:o,context:n}=this.beans;if(!o)return;const r=o.createRowDragComp((()=>s),this.rowCtrl.rowNode,void 0,e,t,i);this.createBean(r,n),this.addDestroyFunc((()=>{this.destroyBean(r,n)}))}setupFocus(){this.restoreFullWidthFocus(!0),this.onRowFocused(this.focusEventWhileNotReady??void 0)}restoreFullWidthFocus(e=!1){const{focusSvc:t,editSvc:s}=this.beans,{rowCtrl:i}=this;if(s?.isEditing(i))return;if(!t.isRowFocused(i.rowNode.rowIndex,i.rowNode.rowPinned)||!t.shouldTakeFocus())return;const o=i.getCurrentRowElement();if(!o)return;const n=()=>{i.isAlive()&&t.isRowFocused(i.rowNode.rowIndex,i.rowNode.rowPinned)&&o.focus({preventScroll:!0})};e?setTimeout(n,0):n()}onRowFocused(e){const{focusSvc:t}=this.beans,{rowCtrl:s}=this,i=t.isRowFocused(s.rowNode.rowIndex,s.rowNode.rowPinned),o=s.getCurrentRowElement();i?o?(o.classList.add("ag-full-width-focus"),this.focusEventWhileNotReady=null,e?.forceBrowserFocus&&o.focus({preventScroll:!0})):e&&(this.focusEventWhileNotReady=e):o?.classList.remove("ag-full-width-focus")}onKeyboardNavigate(e){const{rowCtrl:t}=this,s=t.getCurrentRowElement();if(!s?.contains(e.target))return;if(s!==e.target)return;const i=t.rowNode,{focusSvc:o,navigation:n}=this.beans,r=o.getFocusedCell(),a={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:r?.column??this.getNavigationColumn()};n?.navigateToNextCell(e,e.key,a,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||us(e))return;const{rowCtrl:t,beans:s}=this,o=t.getCurrentRowElement(),n=o?.contains(e.target)?o:null,r=n===e.target,a=(0,i.UlD)(this.beans);let l=!1;n&&a&&(l=n.contains(a)&&a.classList.contains("ag-cell"));let c=null;r||l||(c=(0,i.ey2)({beans:s,rootNode:n,backwards:e.shiftKey})),!r&&c||this.beans.navigation?.onTabKeyDown(t,e)}getRowContentElement(){return this.rowCtrl.getCurrentRowElement()??null}getNavigationColumn(){return this.getDefaultTarget()?.column??this.getFirstDisplayedColumnForFullWidth()}onRowMouseDown(e){if(this.isSuppressMouseEvent(e))return;const{rangeSvc:t,focusSvc:s}=this.beans;t?.removeAllCellRanges();const{rowCtrl:o}=this,n=o.getCurrentRowElement();if(!n)return;const r=e.target;if(!n.contains(r))return;const a=this.getTarget(r)?.column;if(!a)return;const l=o.rowNode;let c=e.defaultPrevented||(0,i.e3J)();n.contains(r)&&(0,i.aas)(r)&&(c=!1),s.setFocusedCell({rowIndex:l.rowIndex,column:a,rowPinned:l.rowPinned,forceBrowserFocus:c})}isSuppressMouseEvent(e){const{rowCtrl:t}=this,{gos:s}=this,i=t.getCurrentRowComp(),o=t.getCurrentRowElement(),n=o?.contains(e.target)&&i?i:void 0,r=n&&e.target instanceof HTMLElement?n.getPinnedLeftRowElement()?.contains(e.target)?"left":n.getPinnedRightRowElement()?.contains(e.target)?"right":null:null;return function(e,t,s,i){const o=t?.suppressMouseEventHandling;return ko(e,void 0,s,i,o)}(s,n?.getFullWidthCellRendererParamsForPinned?.(r)??n?.getFullWidthCellRendererParams(),t.rowNode,e)}getTargets(){const{rowCtrl:e}=this,t=e.getGui(),s=t?.rowComp,i=t?.element,o=t?.compBean;if(!s||!i||!o)return[];const n=s.getPinnedLeftRowElement(),r=s.getScrollingRowElement(),a=s.getPinnedRightRowElement();if(!n&&!r&&!a){const e=this.getFirstDisplayedColumnForFullWidth();return e?[{compBean:o,element:i,column:e,pinned:null}]:[]}const l=new Map;return this.addFullWidthTarget(l,n,o,this.getFirstColumnForFullWidthSection("left"),"left"),this.addFullWidthTarget(l,r??i,o,this.getFirstColumnForFullWidthSection(null),null),this.addFullWidthTarget(l,a,o,this.getFirstColumnForFullWidthSection("right"),"right"),[...l.values()]}getTarget(e){const t=e instanceof Node?e:void 0,s=this.getTargets();if(s.length)return t?s.find((e=>e.element.contains(t)))??s[0]:s[0]}getDefaultTarget(){return this.getTargets()[0]}findInfoForEvent(e){const t=this.getTarget(e?.target);if(t)return{column:t.column,pinned:t.pinned}}addFullWidthTarget(e,t,s,i,o){t&&i&&!e.has(t)&&e.set(t,{compBean:s,element:t,column:i,pinned:o})}getFirstColumnForFullWidthSection(e){const{visibleCols:t}=this.beans;switch(e){case"left":return t.leftCols[0]??t.centerCols[0]??t.rightCols[0];case"right":return t.rightCols[0]??t.centerCols[0]??t.leftCols[0];default:return t.centerCols[0]??t.leftCols[0]??t.rightCols[0]}}getFirstDisplayedColumnForFullWidth(){return this.beans.visibleCols.allCols[0]}getNotesFeature(){return this.notesFeature}addInitialRowClasses(e){e.push("ag-full-width-row"),this.shouldCreateCellSections()&&e.push("ag-embedded-full-width-row")}destroy(){this.tooltips=this.destroyBean(this.tooltips,this.beans.context),this.notesFeature?.destroy(),this.notesFeature=void 0,super.destroy()}},sc=class extends ke{constructor(e){super(),this.rowCtrl=e,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.allCellCtrls=null,this.updateColumnListsPending=!1}postConstruct(){this.addListenersForCellCtrls()}initialiseComp(){this.updateColumnLists(!this.rowCtrl.useAnimationFrameForCreate)}refreshRow(e){for(const t of this.getAllCellCtrls())t.refreshCell(e);this.rowCtrl.onNormalRowRefreshed()}shouldCreateCellSections(){return!0}prepareInitialCellCtrls(){this.rowCtrl.useAnimationFrameForCreate||this.createAllCellCtrls()}getInitialCellCtrls(e){return this.rowCtrl.useAnimationFrameForCreate?null:this.getAllCellCtrls()}getAllCellCtrls(){let e=this.allCellCtrls;if(null===e){const t=this.centerCellCtrls.list,s=this.leftCellCtrls.list,i=this.rightCellCtrls.list;e=0===s.length&&0===i.length?t:t.concat(s,i),this.allCellCtrls=e}return e}recreateCell(e){this.allCellCtrls=null,this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}destroyCells(){this.allCellCtrls=null,this.centerCellCtrls=ic(this.centerCellCtrls),this.leftCellCtrls=ic(this.leftCellCtrls),this.rightCellCtrls=ic(this.rightCellCtrls)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}onColumnMoved(){this.updateColumnLists()}onSpannedCellsUpdated(e){e&&!this.rowCtrl.rowNode.rowPinned||this.updateColumnLists()}updateColumnLists(e=!1,t=!1){const{rowCtrl:s}=this,{animationFrameSvc:i}=this.beans;!i?.active||e||s.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(i.createTask((()=>{s.isAlive()&&this.updateColumnListsImpl(!0)}),s.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0)}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){const t=this.rowCtrl.getGui();t&&(t.rowComp.setCellCtrls(this.getAllCellCtrls(),e),this.rowCtrl.refreshPinnedCellGroupWidths())}createAllCellCtrls(){this.allCellCtrls=null;const{rowCtrl:e}=this,t=this.beans.colViewport,s=this.beans.visibleCols;if(e.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s.allCols),this.leftCellCtrls=ic(this.leftCellCtrls),this.rightCellCtrls=ic(this.rightCellCtrls);else{const i=t.getColsWithinViewport(e.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i);const o=s.getLeftColsForRow(e.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,o,"left");const n=s.getRightColsForRow(e.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,n,"right")}}createCellCtrls(e,t,s=null){const{rowCtrl:i}=this,o={list:[],map:{}},n=(e,t,s)=>{null==s?o.list.push(t):o.list.splice(s,0,t),o.map[e]=t},r=[];for(const s of t){const t=s.instanceId;let o=e.map[t];o&&!i.isCorrectCtrlForSpan(o)&&(o.destroy(),o=void 0),o??(o=i.getNewCellCtrl(s)),o&&n(t,o)}for(const t of e.list){const e=t.column.instanceId;null==o.map[e]&&(this.isCellEligibleToBeRemoved(t,s)?t.destroy():r.push([e,t]))}if(r.length)for(const[e,t]of r){const s=o.list.findIndex((e=>e.column.left>t.column.left)),i=-1===s?void 0:Math.max(s-1,0);n(e,t,i)}const{focusSvc:a}=this.beans,l=a.getFocusedCell(),c=l?.column;if(c&&c.pinned==s){const e=c.instanceId;if(!o.map[e]&&c.displayed){const t=this.createFocusedCellCtrl();if(t){const s=o.list.findIndex((e=>e.column.left>t.column.left)),i=-1===s?void 0:Math.max(s-1,0);n(e,t,i)}}}return o}createFocusedCellCtrl(){const{rowCtrl:e}=this,{focusSvc:t,rowSpanSvc:s}=this.beans,i=t.getFocusedCell();if(!i)return;const o=s?.getCellSpan(i.column,e.rowNode);if(o){if(o.firstNode!==e.rowNode||!o.doesSpanContain(i))return}else if(!t.isRowFocused(e.rowNode.rowIndex,e.rowNode.rowPinned))return;return e.getNewCellCtrl(i.column)}isCellEligibleToBeRemoved(e,t){const s=!0,{column:i}=e;if(i.pinned!=t)return s;if(!this.rowCtrl.isCorrectCtrlForSpan(e))return s;const{editSvc:o}=this.beans,n=o?.isEditing(e),r=e.isCellFocused();return n||r?!i.displayed&&s:s}removeCellCtrl(e,t){const s={list:[],map:{}};for(const i of e.list)i!==t&&(s.list.push(i),s.map[i.column.instanceId]=i);return s}isSuppressMouseEvent(e){const t=To(this.gos,e.target);return null!=t&&Io(this.gos,t.column,this.rowCtrl.rowNode,e)}addListenersForCellCtrls(){const{rowCtrl:e}=this;this.addManagedListeners(e.rowNode,{rowIndexChanged:()=>{for(const e of this.getAllCellCtrls())e.onRowIndexChanged()},cellChanged:e=>{for(const t of this.getAllCellCtrls())t.onCellChanged(e)}})}},ic=e=>{for(const t of e.list)t.destroy();return{list:[],map:{}}},oc=0,nc=class extends ke{constructor(e,t,s,o,n){super(),this.rowNode=e,this.useAnimationFrameForCreate=o,this.printLayout=n,this.active=!0,this.slideInAnimation=!1,this.fadeInAnimation=!1,this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.isEmbeddedFullWidth=!1,this.embeddedSectionHasContent={left:!0,center:!0,right:!0},this.beans=t,this.gos=t.gos,this.paginationPage=t.pagination?.getCurrentPage()??0,this.useTopPositioning=!(!this.gos.get("suppressRowTransform")&&!this.gos.get("enableCellSpan")),this.instanceId=e.id+"-"+oc++,this.rowId=(0,i.YR0)(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=ec(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.rowModeFeature=this.createRowModeFeature(),this.addListeners(),this.rowModeFeature.prepareInitialCellCtrls?.()}isClientSideLoadingRow(){return G(this.gos,this.rowNode)}createRowModeFeature(){const{context:e}=this.beans,t=this.isFullWidth()?new tc(this):new sc(this);return this.createBean(t,e),this.addDestroyFunc((()=>this.destroyBean(t,e))),t}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(this.isClientSideLoadingRow()||"function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=(0,i.YR0)(e)}setComp(e,t,s,i){const{context:o,rowRenderer:n}=this.beans,r={rowComp:e,element:t,containerType:s,compBean:Bi(this,o,i)};this.rowGui=r,this.initialiseRowComp();const a=this.rowNode,l="FullWidthLoading"===this.rowType||a.stub,c=!a.data&&"infinite"===this.beans.rowModel.getType();l||c||a.rowPinned||n.dispatchFirstDataRenderedEvent(),this.rowModeFeature.setupFocus?.()}unsetComp(e){this.rowGui?.containerType===e&&(this.rowGui=void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.rowGui?.element.style.setProperty("display",t)}initialiseRowComp(){const e=this.rowGui;if(!e)return;const t=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(e),this.onRowHeightChanged(),this.updateRowIndexes(),this.setFocusedClasses(),this.setStylesFromGridOptions(!1),U(t)&&this.rowNode.selectable&&this.onRowSelected(),this.rowModeFeature.initialiseComp();const{rowComp:s,element:o,compBean:n}=e,r=this.getInitialRowClasses();for(const e of r)s.toggleCss(e,!0);this.beans.editSvc?.applyRowEditStyles(this),this.executeSlideAndFadeAnimations(),this.rowNode.isExpandable()&&(0,i.oAJ)(o,!!this.rowNode.expanded),this.setRowCompRowId(),this.setRowCompRowBusinessKey(),Q(t,o,Ao,this),n.addDestroyFunc((()=>Q(t,o,Ao,null))),this.useAnimationFrameForCreate?this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,e),this.rowNode.rowIndex,"p2",!1):this.addHoverFunctionality(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(),this.useAnimationFrameForCreate&&this.beans.animationFrameSvc.addDestroyTask((()=>{this.isAlive()&&s.toggleCss("ag-after-created",!0)})),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(){null!=this.businessKey&&this.rowGui?.rowComp.setRowBusinessKey(this.businessKey)}setRowCompRowId(){const e=(0,i.YR0)(this.rowNode.id);this.rowId=e,null!=e&&this.rowGui?.rowComp.setRowId(e)}executeSlideAndFadeAnimations(){const e=this.rowGui;e&&(this.slideInAnimation&&((0,i.sK4)((()=>{this.onTopChanged()})),this.slideInAnimation=!1),this.fadeInAnimation&&((0,i.sK4)((()=>{e.rowComp.toggleCss("ag-opacity-zero",!1)})),this.fadeInAnimation=!1))}addRowDraggerToRow(){const e=this.rowGui;if(!e)return;const t=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,e.element);if(!t)return;const s=this.createBean(t,this.beans.context);this.rowDragComps.push(s),e.compBean.addDestroyFunc((()=>{this.rowDragComps=this.rowDragComps.filter((e=>e!==s)),this.destroyBean(s,this.beans.context)}))}getModeCellRenderers(){return this.rowModeFeature.getModeCellRenderers?.()??[]}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate"),t=this.rowGui;if(this.isClientSideLoadingRow()||!e||"center"!==t?.containerType)return;const{visibleCols:s}=this.beans,i=t.element;e({eRow:i,ePinnedLeftRow:s.leftCols.length?i:void 0,ePinnedRightRow:s.rightCols.length?i:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}isNodeFullWidthCell(){if(this.isClientSideLoadingRow())return!1;if(this.rowNode.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this.rowNode})}setRowType(){const{rowNode:e,gos:t,beans:{colModel:s}}=this,i=t.get("suppressServerSideFullWidthLoadingRow"),o=t.get("groupHideOpenParents"),n="serverSide"===this.beans.rowModel.getType()&&e.stub&&!i&&!o,r=this.isNodeFullWidthCell(),a=t.get("masterDetail")&&e.detail,l=oe(t,e,s.pivotMode),c=i&&e.stub&&l&&!o;this.rowType=n?"FullWidthLoading":a?"FullWidthDetail":r?"FullWidth":l&&!c?"FullWidthGroup":"Normal"}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.isCellSpanning(e,this.rowNode);if(!t)return new Jl(e,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(e){return!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}getCellLane(e){return this.printLayout?null:e.column.getPinned()}setEmbeddedSectionHasContent(e,t){this.embeddedSectionHasContent[e]=t}refreshPinnedCellGroupWidths(){const e=this.rowGui;e&&e.rowComp.refreshPinnedSections()}getMappedPinnedCellGroupWidths(){let{leftWidth:e,centerWidth:t,rightWidth:s}=this.getPinnedCellGroupWidths();if(this.isEmbeddedFullWidth){const i=this.embeddedSectionHasContent.left,o=this.embeddedSectionHasContent.right;t=t+(i?0:e)+(o?0:s),e=i?e:0,s=o?s:0}const i=this.isFullWidth();return{leftWidth:e,centerWidth:t,rightWidth:s,renderLeft:e>0||i,renderRight:s>0||i}}getPinnedCellGroupWidths(){return Fi(this.beans.visibleCols,this.printLayout)}getInitialCellCtrls(e){return this.rowModeFeature.getInitialCellCtrls?.(e)??null}getDomOrder(){return this.gos.get("ensureDomOrder")||W(this.gos,"print")}listenOnDomOrder(e){e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],(()=>{e.rowComp.setDomOrder(this.getDomOrder())}))}setAnimateFlags(e){!this.rowNode.sticky&&e&&((0,i.Qmv)(this.rowNode.oldRowTop)?this.slideInAnimation=!0:this.fadeInAnimation=!0)}isFullWidth(){return"Normal"!==this.rowType}onNormalRowRefreshed(){this.setRowCompRowId(),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(),this.onRowSelected(),this.postProcessCss()}getCurrentRowComp(){return this.rowGui?.rowComp}getCurrentRowElement(){return this.rowGui?.element}redrawThisRow(){this.beans.rowRenderer.redrawRow(this.rowNode)}getRowType(){return this.rowType}getFullWidthAnchorRole(){return"FullWidthLoading"===this.rowType?"gridcell":"presentation"}getContainerType(){return this.rowGui?.containerType}shouldCreateCellSections(){return this.rowModeFeature.shouldCreateCellSections()}getNotesFeature(){return this.rowModeFeature.getNotesFeature?.()}addListeners(){const{beans:e,gos:t,rowNode:s}=this,{expansionSvc:i,eventSvc:o,context:n,rowSpanSvc:r}=e;this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...i?.getRowExpandedListeners(this)??{}}),s.detail&&this.addManagedListeners(s.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(s,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(o,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),headerHeightChanged:this.onTopChanged.bind(this),headerRowsChanged:this.updateRowIndexes.bind(this),advancedFilterEnabledChanged:this.updateRowIndexes.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),pinnedRowDataChanged:this.onPinnedRowsChanged.bind(this),stickyBottomOffsetChanged:this.onStickyBottomOffsetChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.refreshPinnedCellGroupWidths.bind(this),leftPinnedWidthChanged:this.refreshPinnedCellGroupWidths.bind(this),rightPinnedWidthChanged:this.refreshPinnedCellGroupWidths.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:()=>{"bottom"===this.rowNode.rowPinned&&this.updateRowIndexes(),this.refreshFirstAndLastRowStyles()},columnMoved:()=>{this.rowModeFeature.onColumnMoved()}}),r?.active&&this.addManagedListeners(r,{spannedCellsUpdated:({pinned:e})=>{this.rowModeFeature.onSpannedCellsUpdated(e)}}),this.addDestroyFunc((()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,n)})),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",(()=>{t.get("rowDragEntireRow")?this.addRowDraggerToRow():this.rowDragComps=this.destroyBeans(this.rowDragComps,n)}))}onRowPinned(){this.rowGui?.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(e){this.refreshRow({suppressFlash:!e.update,newData:!e.update})}refreshRow(e){this.isFullWidth()!==!!this.isNodeFullWidthCell()?this.beans.rowRenderer.redrawRow(this.rowNode):this.rowModeFeature.refreshRow(e??{})}postProcessCss(){this.isClientSideLoadingRow()||(this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.beans.editSvc?.applyRowEditStyles(this),this.postProcessRowDragging())}onRowNodeHighlightChanged(){const{rowGui:e,beans:{rowDropHighlightSvc:t}}=this,s=t?.row===this.rowNode?t.position:"none",i="above"===s,o="inside"===s,n="below"===s,r="none"!==s,a=i||n,l=this.rowNode.uiLevel,c=a&&l>0,d=c?l.toString():"0";e?.rowComp.toggleCss("ag-row-highlight-above",i),e?.rowComp.toggleCss("ag-row-highlight-inside",o),e?.rowComp.toggleCss("ag-row-highlight-below",n),e?.rowComp.toggleCss("ag-row-highlight-indent",c),r?e?.element.style.setProperty("--ag-row-highlight-level",d):e?.element.style.removeProperty("--ag-row-highlight-level")}postProcessRowDragging(){const{rowNode:e,rowGui:t}=this,s=e.dragging;t?.rowComp.toggleCss("ag-row-dragging",s)}onDisplayedColumnsChanged(){this.rowModeFeature.onDisplayedColumnsChanged()}onVirtualColumnsChanged(){this.rowModeFeature.onVirtualColumnsChanged()}getRowPosition(){return{rowPinned:(0,i.X7E)(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){this.rowModeFeature.onKeyboardNavigate?.(e)}onTabKeyDown(e){this.rowModeFeature.onTabKeyDown?.(e)}getRowContentElement(){return this.rowModeFeature.getRowContentElement?.()??null}getNavigationColumn(){return this.rowModeFeature.getNavigationColumn()}getRowYPosition(){const e=this.rowGui?.element;return e&&(0,i.K05)(e)?e.getBoundingClientRect().top:0}onSuppressCellFocusChanged(e){const t=this.isFullWidth()&&e?void 0:this.gos.get("tabIndex");this.rowGui&&(0,i.GUt)(this.rowGui.element,"tabindex",t)}onRowFocused(e){this.rowModeFeature.onRowFocused?.(e)}recreateCell(e){this.rowModeFeature.recreateCell(e)}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){const{rowNode:s}=this;return xe(this.gos,{type:e,node:s,data:s.data,rowIndex:s.rowIndex,rowPinned:s.rowPinned,event:t})}createRowEventWithSource(e,t){const s=this.createRowEvent(e,t);return s.source=this,s}onRowDblClick(e){if(us(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);t.isEventHandlingSuppressed=this.isSuppressMouseEvent(e),this.beans.eventSvc.dispatchEvent(t)}findInfoForEvent(e){return this.rowModeFeature.findInfoForEvent?.(e)}getTargets(){return this.rowModeFeature.getTargets?.()??[]}getTarget(e){return this.rowModeFeature.getTarget?.(e)}onRowMouseDown(e){this.lastMouseDownOnDragger=(0,i.HW9)(e.target,"ag-row-drag",3),this.rowModeFeature.onRowMouseDown?.(e)}isSuppressMouseEvent(e){return this.rowModeFeature.isSuppressMouseEvent(e)}onRowClick(e){if(us(e)||this.lastMouseDownOnDragger)return;const t=this.isSuppressMouseEvent(e),{eventSvc:s,selectionSvc:i}=this.beans,o=this.createRowEventWithSource("rowClicked",e);o.isEventHandlingSuppressed=t,s.dispatchEvent(o),t||i?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){this.rowModeFeature.setupDetailRowAutoHeight?.(e)}onUiLevelChanged(){const e=ec(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,s="ag-row-level-"+this.rowLevel;this.rowGui?.rowComp.toggleCss(t,!0),this.rowGui?.rowComp.toggleCss(s,!1)}this.rowLevel=e}isFirstRowOnPage(){const{rowNode:{rowIndex:e,rowPinned:t},beans:{pageBounds:s}}=this;return t?0===e:e===s.getFirstRow()}isLastRowOnPage(){const{rowNode:{rowIndex:e,rowPinned:t},beans:{pageBounds:s,pinnedRowModel:i}}=this;if(t){const s="top"===t?i?.getPinnedTopRowCount():i?.getPinnedBottomRowCount();return null!=s&&e===s-1}return e===s.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.rowGui?.rowComp.toggleCss("ag-row-first",e)),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.rowGui?.rowComp.toggleCss("ag-row-last",t))}getAllCellCtrls(){return this.rowModeFeature.getAllCellCtrls()}postProcessClassesFromGridOptions(){if(this.isClientSideLoadingRow())return;const e=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(e,this.rowNode),e.length)for(const t of e)this.rowGui?.rowComp.toggleCss(t,!0)}postProcessRowClassRules(){this.isClientSideLoadingRow()||this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,(e=>this.rowGui?.rowComp.toggleCss(e,!0)),(e=>this.rowGui?.rowComp.toggleCss(e,!1)))}setStylesFromGridOptions(e){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.rowGui?.rowComp.setUserStyles(this.rowStyles)}getInitialRowClasses(){const{rowNode:e,beans:t}=this,s=[];s.push("ag-row"),s.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation&&s.push("ag-opacity-zero"),s.push(e.rowIndex%2==0?"ag-row-even":"ag-row-odd"),e.isRowPinned()&&(s.push("ag-row-pinned"),t.pinnedRowModel?.isManual()&&s.push("ag-row-pinned-manual")),!e.isRowPinned()&&e.pinnedSibling&&s.push("ag-row-pinned-source"),e.isSelected()&&s.push("ag-row-selected"),e.footer&&s.push("ag-row-footer"),s.push("ag-row-level-"+this.rowLevel),e.stub&&s.push("ag-row-loading"),this.rowModeFeature.addInitialRowClasses?.(s),t.expansionSvc?.addExpandedCss(s,e),e.dragging&&s.push("ag-row-dragging");const{rowStyleSvc:i}=t;return i&&!this.isClientSideLoadingRow()&&(i.processClassesFromGridOptions(s,e),i.preProcessRowClassRules(s,e)),s.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage()&&s.push("ag-row-first"),this.isLastRowOnPage()&&s.push("ag-row-last"),s}processStylesFromGridOptions(){return this.isClientSideLoadingRow()?this.emptyStyle:this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(){this.beans.selectionSvc?.onRowCtrlSelected(this,(()=>this.announceDescription()))}announceDescription(e){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode),this.announceNoteDescription(e)}announceNoteDescription(e){const{notesSvc:t,ariaAnnounce:s}=this.beans;if(!t||!s||!e&&!this.isFullWidth())return;const i={rowNode:this.rowNode,...e?{column:e.column}:{location:"fullWidthRow"}},o=t.getNoteAccess(i);if(o?.canView){const e=this.getLocaleTextFunc();s.announceValue(e("ariaHasNote","This cell has a note."),"note")}}addHoverFunctionality(e){if(!this.active)return;const{element:t,compBean:s}=e,{rowNode:i,beans:o,gos:n}=this;s.addManagedListeners(t,{pointerenter:e=>{"mouse"===e.pointerType&&i.dispatchRowEvent("mouseEnter")},pointerleave:e=>{"mouse"===e.pointerType&&i.dispatchRowEvent("mouseLeave")}}),s.addManagedListeners(i,{mouseEnter:()=>{o.dragSvc?.dragging||n.get("suppressRowHoverHighlight")||(t.classList.add("ag-row-hover"),i.setHovered(!0))},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){const t=e??this.rowGui?.element;t?.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}getGui(){return this.rowGui}roundRowTopToBounds(e){const t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition();return _(e,this.applyPaginationOffset(t.top,!0)-100,this.applyPaginationOffset(t.bottom,!0)+100)}isRowRendered(){return!!this.rowGui}onRowHeightChanged(){if(null==this.rowNode.rowHeight)return;const e=this.rowNode.rowHeight,t=this.beans.environment.getDefaultRowHeight(),s=$(this.gos)&&!this.isClientSideLoadingRow()?Y(this.beans,this.rowNode).height:void 0,i=s?Math.min(t,s)-2+"px":void 0;this.rowGui?.element.style.setProperty("height",`${e}px`),i&&this.rowGui?.element.style.setProperty("--ag-line-height",i)}destroyFirstPass(e=!1){this.active=!1;const{rowNode:t}=this;if(!e&&J(this.gos)&&!t.sticky)if(null!=t.rowTop){const e=this.roundRowTopToBounds(t.rowTop);this.setRowTop(e)}else this.rowGui?.rowComp.toggleCss("ag-opacity-zero",!0);this.isFullWidth()&&this.rowGui?.element.contains((0,i.UlD)(this.beans))&&this.beans.focusSvc.attemptToRecoverFocus(),t.setHovered(!1);const s=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(s),this.beans.eventSvc.dispatchEvent(s),super.destroy()}destroySecondPass(){this.rowGui=void 0,this.rowModeFeature.destroyCells()}setFocusedClasses(){const{rowGui:e}=this;e?.rowComp.toggleCss("ag-row-focus",this.rowFocused),e?.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)}onCellFocusChanged(){const{focusSvc:e}=this.beans,t=e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses())}onPinnedRowsChanged(){this.updateRowIndexes(),this.refreshFirstAndLastRowStyles()}onPaginationChanged(){const e=this.beans.pagination?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){const e=this.getCalculatedRowTop();(0,i.Qmv)(e)&&this.setRowTop(e)}onPaginationPixelOffsetChanged(){this.onTopChanged()}onStickyBottomOffsetChanged(){"bottom"===this.rowNode.rowPinned&&this.onTopChanged()}applyPaginationOffset(e,t=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.pageBounds.getPixelOffset()*(t?1:-1)}setRowTop(e){this.printLayout||(0,i.Qmv)(e)&&this.setRowTopStyle(`${this.calculateRowTopPx(e)}px`)}calculateRowTopPx(e){const{rowNode:t,beans:{rowContainerHeight:s}}=this,i=this.applyPaginationOffset(e);return t.isRowPinned()||t.sticky?i:s.getRealPixelPosition(i)}getInitialRowTop(){return this.useTopPositioning?this.getInitialRowTopShared():void 0}getInitialTransform(){return this.useTopPositioning?void 0:`translateY(${this.getInitialRowTopShared()})`}getInitialRowTopShared(){if(this.printLayout)return"";const{rowNode:e}=this;let t;if(e.sticky){const s=this.getCalculatedRowTop();t=(0,i.Qmv)(s)?s:e.stickyRowTop}else t=this.slideInAnimation?this.roundRowTopToBounds(e.oldRowTop):e.rowTop;return`${this.calculateRowTopPx(t)}px`}getCalculatedRowTop(){const{sticky:e,rowTop:t,stickyRowTop:s}=this.rowNode;return e?s:t}setRowTopStyle(e){const{rowGui:t,useTopPositioning:s}=this;t&&(s?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getCellCtrl(e,t=!1){let s=null;for(const t of this.getAllCellCtrls())t.column==e&&(s=t);if(null!=s||t)return s;for(const t of this.getAllCellCtrls())t?.getColSpanningList().indexOf(e)>=0&&(s=t);return s}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getAriaRowIndex(){const{rowNode:e,beans:t}=this,{rowIndex:s}=e;return null==s||null===e.getRowIndexString()?null:rc(t,e,s)}updateRowIndexes(){const{rowNode:e,rowGui:t,beans:s}=this,{rowIndex:o}=e;if(null==o)return;const n=e.getRowIndexString();if(null===n)return;const r=o%2==0,a=this.ariaRowIndex=rc(s,e,o);t&&(t.rowComp.setRowIndex(n),t.rowComp.toggleCss("ag-row-even",r),t.rowComp.toggleCss("ag-row-odd",!r),(0,i.vwK)(t.element,a))}};function rc(e,t,s){const i={rowIndex:s,rowPinned:t.rowPinned??null};return Si(e)+hi(e,i)+1}function ac(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}var lc={moduleName:"KeyboardNavigation",version:cn,beans:[class extends ke{constructor(){super(),this.beanName="navigation",this.currentColumnWithoutSpan=null,this.hasColumnWithoutSpanListener=!1,this.onPageDown=(0,i.sgi)(this.onPageDown,100),this.onPageUp=(0,i.sgi)(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCon=e.gridBodyCtrl}))}handlePageScrollingKey(e,t=!1){const s=e.key,o=e.altKey,n=e.ctrlKey||e.metaKey,r=!!this.beans.rangeSvc&&e.shiftKey,a=function(e,t){return To(e,t.target)?.getFocusedCellPosition()??null}(this.gos,e);let l=!1;switch(s){case i.DDm.PAGE_HOME:case i.DDm.PAGE_END:n||o||(this.onHomeOrEndKey(s),l=!0);break;case i.DDm.LEFT:case i.DDm.RIGHT:case i.DDm.UP:case i.DDm.DOWN:if(!a)return!1;!n||o||r||(this.onCtrlUpDownLeftRight(s,a),l=!0);break;case i.DDm.PAGE_DOWN:case i.DDm.PAGE_UP:n||o||(l=this.handlePageUpDown(s,a,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,s){return s&&(t=this.beans.focusSvc.getFocusedCell()),!!t&&(e===i.DDm.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo({scrollIndex:e,scrollType:t,scrollColumn:s,focusIndex:o,focusColumn:n,isAsync:r,rowPinned:a}){const{scrollFeature:l}=this.gridBodyCon;(0,i.Qmv)(s)&&!s.isPinned()&&l.ensureColumnVisible(s),(0,i.Qmv)(e)&&l.ensureIndexVisible(e,t),r||l.ensureIndexVisible(o);const{focusSvc:c}=this.beans;c.setFocusedCell({rowIndex:o,column:n,rowPinned:a,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:o,rowPinned:a,column:n})}onPageDown(e){const t=this.beans,s=ac(t),i=this.getViewportHeight(),{pageBounds:o,rowModel:n,rowAutoHeight:r}=t,a=o.getPixelOffset(),l=s.top+i,c=n.getRowIndexAtPixel(l+a);r?.active?this.navigateToNextPageWithAutoHeight(e,c):this.navigateToNextPage(e,c)}onPageUp(e){const t=this.beans,s=ac(t),{pageBounds:i,rowModel:o,rowAutoHeight:n}=t,r=i.getPixelOffset(),a=s.top,l=o.getRowIndexAtPixel(a+r);n?.active?this.navigateToNextPageWithAutoHeight(e,l,!0):this.navigateToNextPage(e,l,!0)}navigateToNextPage(e,t,s=!1){const{pageBounds:i,rowModel:o}=this.beans,n=this.getViewportHeight(),r=i.getFirstRow(),a=i.getLastRow(),l=i.getPixelOffset(),c=o.getRow(e.rowIndex),d=s?c?.rowHeight-n-l:n-l,u=c?.rowTop+d;let h,p=o.getRowIndexAtPixel(u+l);if(p===e.rowIndex){const i=s?-1:1;t=p=e.rowIndex+i}s?(h="bottom",p<r&&(p=r),t<r&&(t=r)):(h="top",p>a&&(p=a),t>a&&(t=a)),this.isRowTallerThanView(o.getRow(p))&&(t=p,h="top");const g={rowIndex:p,column:e.column,rowPinned:null},f=this.getNormalisedPosition(g),{rowIndex:m,column:v}=f??g;this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:m,focusColumn:v})}navigateToNextPageWithAutoHeight(e,t,s=!1){this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout((()=>{const i=this.getNextFocusIndexForAutoHeight(e,s);this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:i,focusColumn:e.column,isAsync:!0})}),50)}getNextFocusIndexForAutoHeight(e,t=!1){const s=t?-1:1,i=this.getViewportHeight(),{pageBounds:o,rowModel:n}=this.beans,r=o.getLastRow();let a=0,l=e.rowIndex;for(;l>=0&&l<=r;){const e=n.getRow(l);if(e){const t=e.rowHeight??0;if(a+t>i)break;a+=t}l+=s}return _(l,0,r)}getViewportHeight(){const e=this.beans,t=ac(e),s=this.beans.scrollVisibleSvc.getScrollbarWidth();let i=t.bottom-t.top;return e.scrollVisibleSvc.isHorizontalScrollShowing()&&(i-=s),i}isRowTallerThanView(e){if(!e)return!1;const t=e.rowHeight;return"number"==typeof t&&t>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const s=this.beans.cellNavigation.getNextCellToFocus(e,t,!0);if(!s)return;const i=this.getNormalisedPosition(s),{rowIndex:o,rowPinned:n,column:r}=i??s,a=r;this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:a,focusIndex:o,focusColumn:a,rowPinned:n})}onHomeOrEndKey(e){const t=e===i.DDm.PAGE_HOME,{visibleCols:s,pageBounds:o,rowModel:n}=this.beans,r=s.allCols,a=t?o.getFirstRow():o.getLastRow(),l=n.getRow(a);if(!l)return;const c=(t?r:[...r].reverse()).find((e=>!e.isSuppressNavigable(l)&&!St(e)));c&&this.navigateTo({scrollIndex:a,scrollType:null,scrollColumn:c,focusIndex:a,focusColumn:c})}onTabKeyDown(e,t){const s=t.shiftKey,i=this.tabToNextCellCommon(e,s,t),o=this.beans,{ctrlsSvc:n,pageBounds:r,focusSvc:a,gos:l}=o;if(!1===i)if(s){const{rowIndex:s,rowPinned:i}=e.getRowPosition();(i?0===s:s===r.getFirstRow())&&(0===l.get("headerHeight")||fi(o)?vi(o,!0,"force"):(t.preventDefault(),a.focusPreviousFromFirstCell(t)))}else e instanceof Jl&&!e.hasBrowserFocus(!0)&&e.focusCell({forceBrowserFocus:!0}),(a.focusOverlay(!1)||vi(o,s))&&t.preventDefault();else i?t.preventDefault():null===i&&n.get("gridCtrl").allowFocusForNextCoreContainer(s)}tabToNextCell(e,t){const s=this.beans,{focusSvc:i,rowRenderer:o}=s,n=i.getFocusedCell();if(!n)return!1;let r=di(s,n);return!(!r&&(r=o.getRowByPosition(n),!r?.isFullWidth())||!this.tabToNextCellCommon(r,e,t,"api"))}tabToNextCellCommon(e,t,s,i="ui"){const{editSvc:o,focusSvc:n}=this.beans;let r;const a=e instanceof Jl?e:e.getAllCellCtrls()?.[0],l=o?.isEditing();return l&&(r=o?.moveToNextCell(a,t,s,i)),l&&(!1!==r||o?.isEditing())||(r=this.moveToNextCellNotEditing(e,t)),null===r?r:r||!!n.focusedHeader}moveToNextCellNotEditing(e,t){const s=this.beans.visibleCols.allCols;let o;e instanceof nc?(o={...e.getRowPosition(),column:t?s[0]:(0,i.GXs)(s)},this.gos.get("embedFullWidthRows")&&(o.column=e.getNavigationColumn())):o=e.getFocusedCellPosition();const n=this.findNextCellToFocusOn(o,{backwards:t,startEditing:!1});if(!1===n)return null;if(n instanceof Jl)n.focusCell({forceBrowserFocus:!0});else if(n)return this.tryToFocusFullWidthRow(n,t);return(0,i.Qmv)(n)}findNextCellToFocusOn(e,{backwards:t,startEditing:s,skipToNextEditableCell:o}){let n=e;const r=this.beans,{cellNavigation:a,gos:l,focusSvc:c,rowRenderer:d}=r;for(;;){e!==n&&(e=n),t||(n=this.getLastCellOfColSpan(n)),n=a.getNextTabbedCell(n,t);const u=l.getCallback("tabToNextCell");if((0,i.Qmv)(u)){const i=u({backwards:t,editing:s,previousCellPosition:e,nextCellPosition:n||null});if(!0===i)n=e;else{if(!1===i)return!1;n={rowIndex:i.rowIndex,column:i.column,rowPinned:i.rowPinned}}}if(!n)return null;if(n.rowIndex<0){const e=bi(r);return c.focusHeaderPosition({headerPosition:{headerRowIndex:e+n.rowIndex,column:n.column},fromCell:!0}),null}const h="fullRow"===l.get("editType");if(s&&(!h||o)&&!this.isCellEditable(n))continue;this.ensureCellVisible(n);const p=di(r,n);if(!p){const e=d.getRowByPosition(n);if(!e||!e.isFullWidth()||s)continue;return{...e.getRowPosition(),column:n?.column}}if(!a.isSuppressNavigable(p.column,p.rowNode))return p.setFocusedCellPosition(n),this.setRangeToCellIfSupported(n),p}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}lookupRowNodeForCell({rowIndex:e,rowPinned:t}){const{pinnedRowModel:s,rowModel:i}=this.beans;return"top"===t?s?.getPinnedTopRow(e):"bottom"===t?s?.getPinnedBottomRow(e):i.getRow(e)}navigateToNextCell(e,t,s,o){const n=t!==i.DDm.UP&&t!==i.DDm.DOWN||!this.currentColumnWithoutSpan?s:{...s,column:this.currentColumnWithoutSpan};let r=n,a=!1;const l=this.beans,{cellNavigation:c,focusSvc:d,gos:u}=l;for(;r&&(r===n||!this.isValidNavigateCell(r));)u.get("enableRtl")?t===i.DDm.LEFT&&(r=this.getLastCellOfColSpan(r)):t===i.DDm.RIGHT&&(r=this.getLastCellOfColSpan(r)),r=c.getNextCellToFocus(t,r),a=(0,i.MWY)(r);if(a&&e?.key===i.DDm.UP&&(r={rowIndex:-1,rowPinned:null,column:n.column}),o){const o=u.getCallback("navigateToNextCell");if((0,i.Qmv)(o)){const n=o({key:t,previousCellPosition:s,nextCellPosition:r||null,event:e});r=(0,i.Qmv)(n)?{rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}:null}}if(!r)return;if(r.rowIndex<0){const t=bi(l);return void d.focusHeaderPosition({headerPosition:{headerRowIndex:t+r.rowIndex,column:r.column??s.column},event:e||void 0,fromCell:!0})}const h=this.getNormalisedPosition(r);h?(this.focusPosition(h),r.column!==h.column&&this.setCurrentColumnWithoutSpan(r.column)):this.tryToFocusFullWidthRow(r)}setCurrentColumnWithoutSpan(e){if(!this.hasColumnWithoutSpanListener){const e=()=>{this.currentColumnWithoutSpan=null};this.addManagedEventListeners({cellFocused:e,headerFocused:e}),this.hasColumnWithoutSpanListener=!0}this.currentColumnWithoutSpan=e}getNormalisedPosition(e){if(this.beans.spannedRowRenderer?.getCellByPosition(e))return e;this.ensureCellVisible(e);const t=di(this.beans,e);return t?(e=t.getFocusedCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t){const{visibleCols:s,rowRenderer:o,focusSvc:n,eventSvc:r}=this.beans,a=s.allCols,l=o.getRowByPosition(e);if(!l?.isFullWidth())return!1;const c=n.getFocusedCell(),d={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?(0,i.GXs)(a):a[0])};this.focusPosition(d);const u=null==t?null!=c&&function(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if((0,i.Qmv)(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}(d,c):t;return r.dispatchEvent({type:"fullWidthRowFocused",rowIndex:d.rowIndex,rowPinned:d.rowPinned,column:d.column,isFullWidthCell:!0,fromBelow:u}),!0}focusPosition(e){const{focusSvc:t}=this.beans;t.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(e)}setRangeToCellIfSupported(e){St(e.column)||this.beans.rangeSvc?.setRangeToCell(e)}isValidNavigateCell(e){return!!ci(this.beans,e)}getLastCellOfColSpan(e){const t=di(this.beans,e);if(!t)return e;const s=t.getColSpanningList();return 1===s.length?e:{rowIndex:e.rowIndex,column:(0,i.GXs)(s),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=X(this.gos),s=this.beans.rowModel.getRow(e.rowIndex),o=t&&s?.sticky,{scrollFeature:n}=this.gridBodyCon;!o&&(0,i.MWY)(e.rowPinned)&&n.ensureIndexVisible(e.rowIndex),e.column.isPinned()||n.ensureColumnVisible(e.column)}ensureColumnVisible(e){const t=this.gridBodyCon.scrollFeature;e.isPinned()||t.ensureColumnVisible(e)}ensureRowVisible(e){this.gridBodyCon.scrollFeature.ensureIndexVisible(e)}},class extends ke{constructor(){super(...arguments),this.beanName="cellNavigation"}getNextCellToFocus(e,t,s=!1){return s?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const s=e===i.DDm.UP,o=e===i.DDm.DOWN,n=e===i.DDm.LEFT;let r,a;const{pageBounds:l,gos:c,visibleCols:d,pinnedRowModel:u}=this.beans,{rowPinned:h}=t;if(s||o)a=h&&u?s?0:"top"===h?u.getPinnedTopRowCount()-1:u.getPinnedBottomRowCount()-1:s?l.getFirstRow():l.getLastRow(),r=t.column;else{const e=c.get("enableRtl");a=t.rowIndex,r=(n!==e?d.allCols:[...d.allCols].reverse()).find((e=>!St(e)&&this.isCellGoodToFocusOn({rowIndex:a,rowPinned:null,column:e})))}return r?{rowIndex:a,rowPinned:h,column:r}:null}getNextCellToFocusWithoutCtrlPressed(e,t){let s=t,o=!1;for(;!o;){switch(e){case i.DDm.UP:s=this.getCellAbove(s);break;case i.DDm.DOWN:s=this.getCellBelow(s);break;case i.DDm.RIGHT:s=this.gos.get("enableRtl")?this.getCellToLeft(s):this.getCellToRight(s);break;case i.DDm.LEFT:s=this.gos.get("enableRtl")?this.getCellToRight(s):this.getCellToLeft(s);break;default:s=null,this.warn(8,{key:e})}o=!s||this.isCellGoodToFocusOn(s)}return s}isCellGoodToFocusOn(e){const t=e.column;let s;const{pinnedRowModel:i,rowModel:o}=this.beans;switch(e.rowPinned){case"top":s=i?.getPinnedTopRow(e.rowIndex);break;case"bottom":s=i?.getPinnedBottomRow(e.rowIndex);break;default:s=o.getRow(e.rowIndex)}return!!s&&!this.isSuppressNavigable(t,s)}getCellToLeft(e){if(!e)return null;const t=this.beans.visibleCols.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.beans.visibleCols.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellBelow(e){if(!e)return null;const{beans:t}=this,s=t.rowSpanSvc?.getCellEnd(e)??e,i=pi(t,s,!0);return i?{rowIndex:i.rowIndex,column:e.column,rowPinned:i.rowPinned}:null}getCellAbove(e){if(!e)return null;const{beans:t}=this,s=t.rowSpanSvc?.getCellStart(e)??e,i=ui(t,{rowIndex:s.rowIndex,rowPinned:s.rowPinned},!0);return i?{rowIndex:i.rowIndex,column:e.column,rowPinned:i.rowPinned}:null}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const{visibleCols:t,pagination:s}=this.beans,o=t.allCols;let n=e.rowIndex,r=e.rowPinned,a=t.getColAfter(e.column);if(!a){a=o[0];const t=pi(this.beans,e,!0);if((0,i.MWY)(t))return null;if(!t.rowPinned&&!(s?.isRowInPage(t.rowIndex)??1))return null;n=t?t.rowIndex:null,r=t?t.rowPinned:null}return{rowIndex:n,column:a,rowPinned:r}}getNextTabbedCellBackwards(e){const{beans:t}=this,{visibleCols:s,pagination:o}=t,n=s.allCols;let r=e.rowIndex,a=e.rowPinned,l=s.getColBefore(e.column);if(!l){l=(0,i.GXs)(n);const s=ui(t,{rowIndex:e.rowIndex,rowPinned:e.rowPinned},!0);if((0,i.MWY)(s))return null;if(!s.rowPinned&&!(o?.isRowInPage(s.rowIndex)??1))return null;r=s?s.rowIndex:null,a=s?s.rowPinned:null}return{rowIndex:r,column:l,rowPinned:a}}isSuppressNavigable(e,t){if(G(this.gos,t))return!0;const{suppressNavigable:s}=e.colDef;return"boolean"==typeof s?s:"function"==typeof s&&s(e.createColumnFunctionCallbackParams(t))}},class extends ke{constructor(){super(...arguments),this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCon=e.gridBodyCtrl}));const t=(0,i.BxM)(e);this.addManagedElementListeners(t,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(e,t){let s;const{colModel:o,ctrlsSvc:n}=this.beans;if(s="string"==typeof e?o.getCol(e)??o.colsGroupsById.get(e)?.displayInstances?.[0]??null:e,!s)return null;const r=n.getHeaderRowContainerCtrl(),a=r?.getAllCtrls(),l="filter"===(0,i.GXs)(a||[]).type,c=bi(this.beans)-1;let d=-1,u=s;for(;u;)d++,u=u.parent;let h=d;return t&&l&&h===c-1&&h++,-1===h?null:{headerRowIndex:h,column:s}}navigateVertically(e,t){const{focusSvc:s,visibleCols:i}=this.beans,{focusedHeader:o}=s;if(!o)return!1;const{headerRowIndex:n}=o,r=o.column,a=bi(this.beans),l=this.getHeaderRowType(n),c=i.headerGroupRowCount;let{headerRowIndex:d,column:u,headerRowIndexWithoutSpan:h}="UP"===e?function(e,t,s){const i=s-1;if("filter"!==e){const e=t instanceof lt&&t.isSpanHeaderHeight();let s=t.parent;for(;s&&(s.getProvidedColumnGroup().getLevel()>i||e&&s.isPadding());)s=s.parent;if(s)return e?{column:s,headerRowIndex:s.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:i}:{column:s,headerRowIndex:i,headerRowIndexWithoutSpan:i}}return{column:t,headerRowIndex:i,headerRowIndexWithoutSpan:i}}(l,r,n):function(e,t,s){const i=t+1,o={column:e,headerRowIndex:i,headerRowIndexWithoutSpan:i};if(e instanceof Dt){if(i>=s)return{column:Tt(e,!0,!1),headerRowIndex:s,headerRowIndexWithoutSpan:i};let t=e.displayedChildren[0];if(t instanceof Dt&&t.isPadding()){const e=Tt(t,!0,!1);e?.isSpanHeaderHeight()&&(t=e)}o.column=t,t instanceof lt&&t.isSpanHeaderHeight()&&(o.headerRowIndex=s,o.headerRowIndexWithoutSpan=i)}return o}(r,n,c),p=!1;return d<0&&(d=0,u=r,p=!0),d>=a?(d=-1,this.currentHeaderRowWithoutSpan=-1):void 0!==h&&(this.currentHeaderRowWithoutSpan=h),!(!p&&!u)&&s.focusHeaderPosition({headerPosition:{headerRowIndex:d,column:u},allowUserOverride:!0,event:t})}navigateHorizontally(e,t=!1,s){const{focusSvc:i,gos:o}=this.beans;if(!i.focusedHeader)return!1;const n={...i.focusedHeader};let r,a;-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,"LEFT"===e!==o.get("enableRtl")?(a="Before",r=this.findHeader(n,a)):(a="After",r=this.findHeader(n,a));const l=o.getCallback("tabToNextHeader");if(t&&l){const e=i.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:r,direction:a});if(e){const{headerRowIndex:e}=i.focusedHeader||{};null!=e&&e!=n.headerRowIndex&&(this.currentHeaderRowWithoutSpan=e)}return e}return r||!t?i.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:s}):this.focusNextHeaderRow(n,a,s)}focusNextHeaderRow(e,t,s){const o=this.beans,n=e.headerRowIndex;let r,a;const l=bi(o),c=this.beans.visibleCols.allCols;if("Before"===t){if(n<=0)return!1;r=(0,i.GXs)(c),a=n-1,this.currentHeaderRowWithoutSpan-=1}else r=c[0],a=n+1,this.currentHeaderRowWithoutSpan<l?this.currentHeaderRowWithoutSpan+=1:this.currentHeaderRowWithoutSpan=-1;let{column:d,headerRowIndex:u}=Sl(this.beans,r,a);return u>=l&&(u=-1),o.focusSvc.focusHeaderPosition({headerPosition:{column:d,headerRowIndex:u},direction:t,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(e,t="After"){if(e.getPinned())return;let s;if(Ft(e)){const o=e.getDisplayedLeafColumns();s="Before"===t?(0,i.GXs)(o):o[0]}else s=e;this.gridBodyCon.scrollFeature.ensureColumnVisible(s)}findHeader(e,t){const{visibleCols:s}=this.beans;let i=e.column;if(i instanceof Dt){const e=i.getDisplayedLeafColumns();i="Before"===t?e[0]:e[e.length-1]}const o="Before"===t?s.getColBefore(i):s.getColAfter(i);if(!o)return;const n=s.headerGroupRowCount;if(e.headerRowIndex>=n)return{headerRowIndex:e.headerRowIndex,column:o};const r=Mt(o,e.headerRowIndex);return r?r.isPadding()&&o.isSpanHeaderHeight()?{headerRowIndex:s.headerGroupRowCount,column:o}:{headerRowIndex:e.headerRowIndex,column:r??o}:{headerRowIndex:o instanceof lt&&o.isSpanHeaderHeight()?s.headerGroupRowCount:e.headerRowIndex,column:o}}getHeaderRowType(e){const t=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}}],apiFunctions:{getFocusedCell:function(e){return e.focusSvc.getFocusedCell()},clearFocusedCell:function(e){return e.focusSvc.clearFocusedCell()},setFocusedCell:function(e,t,s,i){e.focusSvc.setFocusedCell({rowIndex:t,column:s,rowPinned:i,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,s=!1){const i=e.headerNavigation?.getHeaderPositionForColumn(t,s);i&&e.focusSvc.focusHeaderPosition({headerPosition:i})},tabToNextCell:function(e,t){return e.navigation?.tabToNextCell(!1,t)??!1},tabToPreviousCell:function(e,t){return e.navigation?.tabToNextCell(!0,t)??!1}}},cc=class extends ke{constructor(e,t){super(),this.isLeft=e,this.elements=t,this.getWidth=e?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[(this.isLeft?"left":"right")+"PinnedWidthChanged"]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){const e=this.getWidth(),t=e>0;for(const s of this.elements)s&&((0,i.nl0)(s,t),(0,i.M9x)(s,e))}},dc={moduleName:"PinnedColumn",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCtrl=e.gridBodyCtrl}));const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,columnPinned:this.keepPinnedColumnsNarrowerThanViewport.bind(this)}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const{gos:e,visibleCols:t,eventSvc:s}=this.beans,i=W(e,"print"),o=i?0:t.getLeftStickyColumnContainerWidth(),n=i?0:t.getRightStickyColumnContainerWidth();o!=this.leftWidth&&(this.leftWidth=o,s.dispatchEvent({type:"leftPinnedWidthChanged"})),n!=this.rightWidth&&(this.rightWidth=n,s.dispatchEvent({type:"rightPinnedWidthChanged"}))}keepPinnedColumnsNarrowerThanViewport(){if(!this.gridBodyCtrl)return;const e=this.getAvailableViewportWidth();if(e<=50)return;const t=this.getPinnedColumnsOverflowingViewport(e-50),s=this.gos.getCallback("processUnpinnedColumns"),{columns:i,hasLockedPinned:o}=t;let n=i;(n.length||o)&&(s&&(n=s({columns:n,viewportWidth:e})),n?.length&&(n=n.filter((e=>!St(e))),this.setColsPinned(n,null,"viewportSizeFeature")))}createPinnedWidthFeature(e,...t){return new cc(e,t)}setColsPinned(e,t,s){const{colModel:i,visibleCols:o,gos:n,colAnimation:r}=this.beans;if(!i.ready)return;if(!e?.length)return;if(W(n,"print"))return void this.warn(37);let a;a=!0===t||"left"===t?"left":"right"===t?"right":null;const l=[];for(const t of e){if(!t)continue;const e=i.getCol(t);e&&e.getPinned()!==a&&(this.setColPinned(e,a),l.push(e))}if(l.length){r?.start();try{o.refresh(s,!1),Ve(this.eventSvc,l,s)}finally{r?.finish()}}}initCol(e){const{pinned:t,initialPinned:s}=e.colDef;void 0!==t?this.setColPinned(e,t):this.setColPinned(e,s)}setColPinned(e,t){e.pinned=!0===t||"left"===t?"left":"right"===t?"right":null,e.dispatchStateUpdatedEvent("pinned")}getHeaderResizeDiff(e,t){if(t.getPinned()){const{leftWidth:t,rightWidth:s}=this,i=this.getAvailableViewportWidth()-50;if(t+s+e>i){if(!(i>t+s))return 0;e=i-t-s}}return e}getAvailableViewportWidth(){return this.gridBodyCtrl?.getViewportWidthWithoutScrollbar()??0}getPinnedColumnsOverflowingViewport(e){const t=(this.rightWidth??0)+(this.leftWidth??0);let s=!1;if(t<e)return{columns:[],hasLockedPinned:s};const{visibleCols:i}=this.beans,o=[...i.leftCols],n=[...i.rightCols];let r=0,a=0;const l=[];let c=t-0-e;for(;(a<o.length||r<n.length)&&c>0;){if(r<n.length){const e=n[r++];if(e.colDef.lockPinned){s=!0;continue}c-=e.getActualWidth(),l.push(e)}if(a<o.length&&c>0){const e=o[a++];if(e.colDef.lockPinned){s=!0;continue}c-=e.getActualWidth(),l.push(e)}}return{columns:l,hasLockedPinned:s}}}],css:[".ag-header-row .ag-grid-pinned-right-cells .ag-grid-container-wrapper{border-left:var(--ag-pinned-column-border)}.ag-header-row .ag-grid-pinned-left-cells .ag-grid-container-wrapper{border-right:var(--ag-pinned-column-border)}.ag-layout-print .ag-header-row .ag-grid-pinned-left-cells,.ag-layout-print .ag-header-row .ag-grid-pinned-right-cells{display:none}.ag-layout-print .ag-header-cell-last-left-pinned{border-right:var(--ag-pinned-column-border)}.ag-layout-print .ag-header-cell-first-right-pinned{border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-grid-pinned-left-cells .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-grid-pinned-right-cells .ag-header-cell-resize:after{left:50%}.ag-grid-pinned-left-cells .ag-header-cell-resize{right:-3px}.ag-grid-pinned-right-cells .ag-header-cell-resize{left:-3px}"]},uc={moduleName:"Aria",version:cn,beans:[class extends v{}]},hc="ag-delay-render",pc={moduleName:"ColumnDelayRender",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(e){this.alreadyRevealed||this.requesters.has(e)||(this.requesters.add(e),this.hideRequested||(this.beans.ctrlsSvc.whenReady(this,(e=>{e.gridBodyCtrl.eGridBody.classList.add(hc)})),this.hideRequested=!0))}revealColumns(e){!this.alreadyRevealed&&this.isAlive()&&this.requesters.has(e)&&(this.requesters.delete(e),this.revealWhenRendered())}revealWhenRendered(){if(this.alreadyRevealed||!this.isAlive()||this.requesters.size>0)return;const{renderStatus:e,ctrlsSvc:t}=this.beans;if(e){if(!e.areHeaderCellsRendered()&&this.timesRetried<5)return this.timesRetried++,void setTimeout((()=>this.revealWhenRendered()));this.timesRetried=0}t.getGridBodyCtrl().eGridBody.classList.remove(hc),this.alreadyRevealed=!0}}],css:[":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}"]},gc=class extends ls{constructor(){super()}},fc={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},mc={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},vc={tag:"span",cls:"ag-overlay-no-matching-rows-center"},wc={tag:"span",cls:"ag-overlay-no-rows-center"},Cc={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},yc=class extends ls{constructor(){super(Cc),this.eOverlayWrapper=i.dRA,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-no-matching-rows-wrapper,.ag-overlay-no-rows-wrapper{align-items:safe center}.ag-overlay-exporting-wrapper,.ag-overlay-file-input-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{padding:var(--ag-spacing)}.ag-overlay-exporting-center,.ag-overlay-file-input-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex}.ag-overlay-file-input-center{align-items:center;flex-direction:column;gap:calc(var(--ag-spacing)*2);max-width:420px;padding:calc(var(--ag-spacing)*2)}.ag-file-input-error-banner{background:color-mix(in srgb,var(--ag-invalid-color) 10%,var(--ag-background-color));border-radius:var(--ag-border-radius);color:var(--ag-invalid-color);font-size:.9em;padding:calc(var(--ag-spacing)*.75) calc(var(--ag-spacing)*2);text-align:center;width:100%}.ag-file-input-drop-zone{align-items:center;border:dashed calc(var(--ag-border-width)*2) var(--ag-border-color);border-radius:var(--ag-border-radius);display:flex;flex-direction:column;gap:var(--ag-spacing);padding:calc(var(--ag-spacing)*4);width:100%}.ag-file-input-drop-zone-active{background:var(--ag-row-hover-color);border-color:var(--ag-accent-color)}.ag-file-input-processing{padding:calc(var(--ag-spacing)*4)}.ag-file-input-processing,.ag-file-input-text-row{align-items:center;display:flex;gap:calc(var(--ag-spacing)*.75)}.ag-file-input-text{font-weight:600}.ag-file-input-browse{background:transparent;border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);color:var(--ag-text-color);cursor:pointer;font:inherit;padding:calc(var(--ag-spacing)*.5) calc(var(--ag-spacing)*2)}")}handleKeyDown(e){if(e.key!==i.DDm.TAB||e.defaultPrevented||us(e))return;const{beans:t,eOverlayWrapper:s}=this;if(s&&(0,i.ey2)({beans:t,rootNode:s,backwards:e.shiftKey}))return;let o;o=e.shiftKey?t.focusSvc.focusGridView({column:(0,i.GXs)(t.visibleCols.allCols),backwards:!0,canFocusOverlay:!1}):vi(t,!1),o&&e.preventDefault()}updateLayoutClasses(e,t){const s=this.eOverlayWrapper;if(!s)return;const i=s.classList,{AUTO_HEIGHT:o,NORMAL:n,PRINT:r}=po;i.toggle(o,t.autoHeight),i.toggle(n,t.normal),i.toggle(r,t.print)}postConstruct(){this.createManagedBean(new go(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper?.classList;t?(this.activeCssClass&&t.toggle(this.activeCssClass,!1),this.activeCssClass=e,t.toggle(e,!0)):this.activeCssClass=null}showOverlay(e,t,s){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,this.overlayExclusive=s,!e)return this.refreshWrapperPadding(),i.oY$.resolve();if(this.setWrapperTypeClass(t),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),s&&this.isGridFocused()){const e=(0,i.UlD)(this.beans);e&&!(0,i.sNX)(this.beans)&&(this.elToFocusAfter=e)}return e.then((t=>{const o=this.eOverlayWrapper;o?this.activePromise===e?(this.activePromise=null,t&&(this.activeOverlay!==t&&(o.appendChild(t.getGui()),this.activeOverlay=t),s&&this.isGridFocused()&&(0,i.YtT)(o))):this.activeOverlay!==t&&this.destroyBean(t):this.destroyBean(t)})),e}refreshWrapperPadding(){if(!this.eOverlayWrapper)return void(this.oldWrapperPadding=null);let e=0;(!!this.activeOverlay||!!this.activePromise)&&!this.overlayExclusive&&(e=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0),e!==this.oldWrapperPadding&&(this.oldWrapperPadding=e,this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`))}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return this.overlayExclusive=!1,this.elToFocusAfter=null,void this.refreshWrapperPadding();let t=this.elToFocusAfter;this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,t&&!this.isGridFocused()&&(t=null),this.destroyBean(e);const s=this.eOverlayWrapper;s&&(0,i.fDi)(s),t?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){const e=(0,i.UlD)(this.beans);return!!e&&this.beans.eGridDiv.contains(e)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},bc={selector:"AG-OVERLAY-WRAPPER",component:yc},Sc=i.WOR?150:300,xc=["refresh"],Rc=e=>({name:e,optionalMethods:xc}),Pc={id:"agLoadingOverlay",overlayType:"loading",comp:Rc("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:e=>{const t=e.get("loading");return!1===t||!0===e.get("suppressLoadingOverlay")&&!t}},Ec={id:"agNoRowsOverlay",overlayType:"noRows",comp:Rc("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:e=>e.get("suppressNoRowsOverlay")},Ic={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:Rc("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},kc={id:"agExportingOverlay",overlayType:"exporting",comp:Rc("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},Fc={id:"agFileInputOverlay",overlayType:"fileInput",comp:Rc("fileInputOverlayComponent"),wrapperCls:"ag-overlay-file-input-wrapper",exclusive:!0},Dc={id:"activeOverlay",comp:Rc("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},Tc={id:"agErrorOverlay",comp:Rc("agErrorOverlay"),wrapperCls:"ag-overlay-error-wrapper",exclusive:!1,noUserOverride:!0},Ac={moduleName:"Overlay",version:cn,userComponents:{agLoadingOverlay:class extends gc{constructor(){super(...arguments),this.eLoadingIcon=i.dRA,this.eLoadingText=i.dRA}init(e){const{beans:t,gos:s}=this,o=(0,i.X7E)(s.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(o??mc),!o){const s=er("overlayLoading",t,null);s&&this.eLoadingIcon.appendChild(s);const i=e.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=i,t.ariaAnnounce.announceValue(i,"overlay")}}},agNoRowsOverlay:class extends gc{init(e){const{beans:t,gos:s}=this,o=(0,i.X7E)(s.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(o??wc),!o){const s=e.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}}},agNoMatchingRowsOverlay:class extends gc{init(e){const{beans:t}=this;this.setTemplate(vc);const s=e.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}},agExportingOverlay:class extends gc{constructor(){super(...arguments),this.eExportingIcon=i.dRA,this.eExportingText=i.dRA}init(e){const{beans:t}=this;this.setTemplate(fc);const s=er("overlayExporting",t,null);s&&this.eExportingIcon.appendChild(s);const i=e.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=i,t.ariaAnnounce.announceValue(i,"overlay")}}},apiFunctions:{showLoadingOverlay:function(e){e.overlays?.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlays?.showNoRowsOverlay()},hideOverlay:function(e){e.overlays?.hideOverlay()}},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[class extends ke{constructor(){super(...arguments),this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.devErrorOverlayActive=!1,this.newColumnsLoadedCleanup=null}postConstruct(){const e=this.gos;this.showInitialOverlay=B(e);const t=()=>{this.userForcedNoRows||this.updateOverlay(!1)},[s,i,o,n]=this.addManagedEventListeners({newColumnsLoaded:t,rowCountReady:()=>{this.disableInitialOverlay(),t(),i()},rowDataUpdated:t,modelUpdated:t});this.newColumnsLoadedCleanup=s,this.addManagedPropertyListeners(["loading","loadingRows","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","autoGenerateColumnDefs","processFileInput"],(e=>this.onPropChange(new Set(e.changeSet?.properties))))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(e,t){this.isAlive()&&(t?this.eWrapper===e&&(this.eWrapper=void 0):this.eWrapper=e,this.updateOverlay(!1))}isVisible(){return!!this.currentDef}setDevErrorOverlay(e){this.devErrorOverlayActive!==e&&(this.devErrorOverlayActive=e,this.updateOverlay(!1))}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos;if(!this.eWrapper||e.get("activeOverlay")||this.devErrorOverlayActive||H(e))return;if(this.isDisabled(Pc))return;const t=e.get("loading");(t||void 0===t)&&this.doShowOverlay(Pc)}showNoRowsOverlay(){this.showInitialOverlay=!1;const e=this.gos;!this.eWrapper||e.get("activeOverlay")||e.get("loading")||this.isDisabled(Ec)||this.devErrorOverlayActive||(this.userForcedNoRows=!0,this.doShowOverlay(Ec))}async showExportOverlay(e){const{gos:t,beans:s}=this;if(!this.eWrapper||t.get("activeOverlay")||t.get("loading")||this.isDisabled(kc)||this.devErrorOverlayActive||this.userForcedNoRows&&this.currentDef===Ec)return void e();const o=this.getDesiredDefWithOverride(kc);if(!o)return void e();this.exportsInProgress++,this.focusedCell=s.focusSvc.getFocusedCell(),await this.doShowOverlay(o),await new Promise((e=>setTimeout((()=>e()))));const n=Date.now();try{e()}finally{const e=Date.now()-n,t=Math.max(0,Sc-e),o=()=>{this.exportsInProgress--,0===this.exportsInProgress&&(this.updateOverlay(!1),function(e,t){const s=e.focusSvc,o=s.getFocusedCell();if(o&&t&&ri(o,t)){const{rowIndex:o,rowPinned:n,column:r}=t;(0,i.sNX)(e)&&s.setFocusedCell({rowIndex:o,column:r,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!(0,i.g3$)()})}}(s,this.focusedCell),this.focusedCell=null)};t>0?setTimeout((()=>o()),t):o()}}hideOverlay(){const e=this.gos;this.showInitialOverlay=!1;const t=this.userForcedNoRows;this.userForcedNoRows=!1,e.get("loading")?this.warn(99):e.get("activeOverlay")?this.warn(296):this.currentDef!==Ic?(this.doHideOverlay(),t&&this.getOverlayDef()!==Ec&&this.updateOverlay(!1)):this.warn(297)}getOverlayWrapperSelector(){return bc}getOverlayWrapperCompClass(){return yc}onPropChange(e){const t=e.has("activeOverlay");if((t||e.has("loading")||e.has("loadingRows"))&&this.updateOverlay(t))return;const s=this.currentDef,i=this.eWrapper?.activeOverlay;if(i&&s){const t=e.has("activeOverlayParams");if(s===Dc)t&&i.refresh?.(this.makeCompParams(!0));else{const t=s.paramsKey;(e.has("overlayComponentParams")||t&&e.has(t))&&i.refresh?.(this.makeCompParams(!1,t,s.overlayType))}}}updateOverlay(e){const t=this.eWrapper;if(!t)return this.currentDef=null,!1;const s=this.getDesiredDefWithOverride(),i=this.currentDef,o=s===Dc&&e;return s!==i?s?(this.doShowOverlay(s),!0):(this.disableInitialOverlay(),this.doHideOverlay()):o&&s?(t.hideOverlay(),this.doShowOverlay(s),!0):(s||this.disableInitialOverlay(),!1)}getDesiredDefWithOverride(e){const{gos:t}=this;let s=(i=t.get("activeOverlay"))?{agLoadingOverlay:Pc,agNoRowsOverlay:Ec,agNoMatchingRowsOverlay:Ic,agExportingOverlay:kc,agFileInputOverlay:Fc}[i]??Dc:null;var i;return s||(s=e??this.getOverlayDef(),s&&this.isDisabled(s)&&(s=null)),s}getOverlayDef(){const{gos:e,beans:t}=this,{rowModel:s}=t;if(this.devErrorOverlayActive&&this.eWrapper)return Tc;const i=e.get("loading");if(void 0!==i){if(this.disableInitialOverlay(),i)return H(e)?null:Pc}else if(this.showInitialOverlay){const t=!e.get("columnDefs")&&!e.get("autoGenerateColumnDefs"),s=!e.get("rowData");if(t||s){if(s&&e.get("processFileInput")&&!this.isDisabled(Fc))return Fc;if(!this.isDisabled(Pc))return Pc}this.disableInitialOverlay()}else this.disableInitialOverlay();return(o=s.getOverlayType())?{loading:Pc,noRows:Ec,noMatchingRows:Ic,exporting:kc,fileInput:Fc}[o]:null;var o}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(e){const{gos:t,beans:s}=this,{userCompFactory:o}=s;this.currentDef=e;const n=e!==Dc,r=!!e.exclusive;let a,l;this.exclusive=r,(e.paramsKey&&t.get(e.paramsKey)||e.compKey&&t.get(e.compKey))&&(a=e.paramsKey),n&&!e.noUserOverride&&(t.get("overlayComponent")||t.get("overlayComponentSelector"))&&(l=o.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,e.paramsKey,e.overlayType))),l??(l=o.getCompDetailsFromGridOptions(e.comp,n?e.id:void 0,this.makeCompParams(!n,a,e.overlayType),!1));const c=l?.newAgStackInstance()??null,d=this.eWrapper?this.eWrapper.showOverlay(c,e.wrapperCls,r):i.oY$.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(r),d}makeCompParams(e,t,s){const{gos:i}=this,o=e?i.get("activeOverlayParams"):{...i.get("overlayComponentParams"),...t&&i.get(t)||null,overlayType:s};return xe(i,o??{})}doHideOverlay(){let e=!1;this.currentDef&&(this.currentDef=null,e=!0),this.exclusive=!1;const t=this.eWrapper;return t&&(t.hideOverlay(),t.refreshWrapperPadding(),this.setExclusive(!1)),e}setExclusive(e){this.oldExclusive!==e&&(this.oldExclusive=e,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"}))}isDisabled(e){const{gos:t}=this;return e.overlayType&&t.get("suppressOverlays")?.includes(e.overlayType)||!0===e.isSuppressed?.(t)}}]},Mc=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.rowNode.id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e?.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.rowNode!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,s=this.entriesMap[t];delete this.entriesMap[t],(0,i.$ii)(this.entriesList,s)}removeFromCache(e){const t=e.rowNode.id;delete this.entriesMap[t],(0,i.$ii)(this.entriesList,e)}getEntries(){return this.entriesList}};function Nc(e){if(!e)return;const t={top:{},bottom:{},normal:{}};for(const s of e){const e=s.id;switch(s.rowPinned){case"top":t.top[e]=s;break;case"bottom":t.bottom[e]=s;break;default:t.normal[e]=s}}return t}function Lc(e,t){const s=e.id;switch(e.rowPinned){case"top":return null!=t.top[s];case"bottom":return null!=t.bottom[s];default:return null!=t.normal[s]}}var Vc=(e,t,s,i)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];n.rowNode===t&&n!==s&&n!==i&&n.refreshRow()}},_c=(e,t)=>{const{sibling:s,pinnedSibling:i}=t;e.refreshRowByNode(t),e.refreshRowByNode(s),e.refreshRowByNode(i),e.refreshRowByNode(s?.pinnedSibling),e.refreshRowByNode(i?.sibling)},Oc={moduleName:"ValueCache",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0,this.neverExpires=!1}postConstruct(){this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,s){const i=this.cacheVersion;e.__cacheVersion!==i&&(e.__cacheVersion=i,e.__cacheData={}),e.__cacheData[t]=s}getValue(e,t){if(e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}}],apiFunctions:{expireValueCache:function(e){e.valueCache?.expire()}}},Bc={moduleName:"Expression",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="expressionSvc",this.cache={}}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);this.error(15,{expression:e})}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(s){return this.error(16,{expression:e,params:t,e:s}),null}}createExpressionFunction(e){const t=this.cache;if(t[e])return t[e];const s=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",s);return t[e]=i,i}createFunctionBody(e){return e.includes("return")?e:"return "+e+";"}}]},Hc={moduleName:"ChangeDetection",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=Rs(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(0===this.deferredDepth)return;if(--this.deferredDepth>0)return;const e=this.batchedPath,t=this.batchedNodes;this.batchedPath=null,this.batchedNodes=null,e&&this.csrm?.doAggregate(e);const{rowRenderer:s}=this.beans;if(t)for(const e of t)_c(s,e);if(e){const t=e.getSortedRows();for(let e=0,i=t.length;e<i;++e)_c(s,t[e])}this.beans.aggStage?.refreshAggregateDependentCells(t,e),(this.batchedPath||this.batchedNodes)&&(this.deferredDepth=1,this.endDeferred())}onCellValueChanged(e){const{gos:t,rowModel:s,changedPathFactory:i}=this.beans;if("paste"===e.source||t.get("suppressChangeDetection"))return;if(!s.rootNode)return;const o=e.node.primaryRow;if(this.csrm){let s=this.batchedPath;s||(s=i?.newPath(t.get("aggregateOnlyChangedColumns"))??null,this.batchedPath=s);let n=o;o.group||((this.batchedNodes??(this.batchedNodes=new Set)).add(o),n=o.parent),s?.addCell(n,e.column.colId)}else(this.batchedNodes??(this.batchedNodes=new Set)).add(o);0===this.deferredDepth&&(this.deferredDepth=1,this.endDeferred())}}]},Gc={moduleName:"CellApi",version:cn,apiFunctions:{getCellValue:function(e,t){const{colKey:s,rowNode:o,useFormatter:n,from:r="edit",transformValues:a}=t,l=e.colModel.getCol(s);if(!l)return null;const c=e.valueSvc.getValueForDisplay({column:nt(l,o),node:o,includeValueFormatted:n,from:r,transformValues:a});return n?c.valueFormatted??(0,i.SjP)(c.value):c.value}}};function zc(e,t){let s=e;for(let e=0,i=t.length;e<i;e++){if(null==s)return;s=s[t[e]]}return s}var Wc=(e,t,s)=>{const i=e.colsById[t];return i?.rowGroupActive&&i.rowGroupActiveIndex>s?null:void 0},jc={moduleName:"CommunityCore",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="log"}wireBeans(e){this.gridId=e.context.getId()}warn(...e){_n(this.gridId,e[0],e[1])}deprecated(...e){var t;t=this.gridId,Fn(jo,e[0],e[1],"deprecation",!0,t)}error(...e){var t;t=this.gridId,Fn(Uo,e[0],e[1],"error",!1,t)}},class extends ke{constructor(){super(...arguments),this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;const{stateSvc:e,ctrlsSvc:t,context:s}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:e?.getState()??{}}),this.destroyCalled=!0,t.get("gridCtrl")?.destroyGridUi(),s.destroy(),super.destroy()}},class extends ke{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new jn,this.fns={...zn,dispatchEvent:Wn},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(Gn))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:s,beans:i}=this;s!==zn&&(s[e]=i?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:s,fns:{[e]:i}}=this;return i?i(s,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:s,preDestroyLink:i}=this;if(!t)return void Vn(26,{fnName:e,preDestroyLink:i});const o=Gn[e];s.assertModuleRegistered(o,`\`api.${e}\``)&&t.log.warn(27,{fnName:e,module:o})}destroy(){super.destroy(),this.fns=zn,this.beans=null}},class extends g{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(null!=e)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:s,dynamicBeans:i,selectors:o}=e;if(s){const e=(e,t,s,i)=>{this.agGridDefaults[e]=t,(s||i)&&(this.agGridDefaultOverrides[e]={params:s,processParams:i})};for(const t of Object.keys(s)){let i=s[t];if("object"==typeof(n=i)&&n.getComp&&(i=i.getComp(this.beans)),"object"==typeof i){const{classImp:s,params:o,processParams:n}=i;e(t,s,o,n)}else e(t,i)}}var n;this.registerDynamicBeans(i);for(const e of o??[])this.selectors[e.selector]=e;if(t)for(const e of Object.keys(t))this.icons[e]=t[e]}getUserComponent(e,t){const s=(e,t,s,i)=>({componentFromFramework:t,component:e,params:s,processParams:i}),{frameworkOverrides:i}=this.beans,o=i.frameworkComponent(t,this.gos.get("components"));if(null!=o)return s(o,!0);const n=this.jsComps[t];if(n)return s(n,i.isFrameworkComponent(n));const r=this.agGridDefaults[t];if(r){const e=this.agGridDefaultOverrides[t];return s(r,!1,e?.params,e?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Bn(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Bn(256)}},class extends ke{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.frameworkCompWrapper?.setGridId?.(e.context.getId()),this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,s,i=!1){return this.getCompDetails(this.gridOptions,e,t,s,i)}getCompDetails(e,t,s,i,o=!1){const{name:n,supportsJsFunction:r}=t;let a,l,{compName:c,jsComp:d,fwComp:u,paramsFromSelector:h,popupFromSelector:p,popupPositionFromSelector:g}=Ot(this.beans.frameworkOverrides,e,t,i);const f=e=>{const t=this.registry.getUserComponent(n,e);t&&(d=t.componentFromFramework?void 0:t.component,u=t.componentFromFramework?t.component:void 0,a=t.params,l=t.processParams)};var m;if(null!=c&&f(c),null==d&&null==u&&null!=s&&f(s),!d||!r||(m=d)&&m.prototype&&"getGui"in m.prototype||(d=this.agCompUtils?.adaptFunction(t,d)),!d&&!u){const{validation:e}=this.beans;return void(!o||c===s&&s?s&&!e&&this.error(146,{comp:s}):c?e?.isProvidedUserComp(c)||this.error(50,{compName:c}):s?e||this.error(260,{...this.gos.getModuleErrorParams(),propName:n,compName:s}):this.error(216,{name:n}))}const v=this.mergeParams(e,t,i,h,a,l),w=null==d,C=d??u;return{componentFromFramework:w,componentClass:C,params:v,type:t,popupFromSelector:p,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(C,w,v,t)}}newAgStackInstance(e,t,s,o){let n;n=t?this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o):new e,this.createBean(n);const r=n.init?.(s);return null==r?i.oY$.resolve(n):r.then((()=>n))}mergeParams(e,t,s,i=null,o,n){const r={...s,...o},a=e,l=a?.[t.name+"Params"];if("function"==typeof l){const e=l(s);F(r,e)}else"object"==typeof l&&F(r,l);return F(r,i),n?n(r,this.beans):r}},class extends ke{constructor(){super(...arguments),this.beanName="rowContainerHeight",this.stickyBottomRowsHeight=0,this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=(0,i.uI6)(),Wo(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;Wo(this.gos,`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventSvc.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getRealPixelPosition(e){return e-this.divStretchOffset}getAdjustedUiContainerHeight(){return null==this.uiContainerHeight?null:this.uiContainerHeight-this.stickyBottomRowsHeight}getUiBodyHeight(){const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}},class extends ke{constructor(){super(...arguments),this.beanName="visibleCols",this.flexActive=!1,this.treeLeft=[],this.treeRight=[],this.treeCenter=[],this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.autoHeightCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.totalWidth=0,this.isBodyWidthDirty=!0,this.prevLastLeftPinned=null,this.prevFirstRightPinned=null}wireBeans(e){this.colModel=e.colModel,this.colGroupSvc=e.colGroupSvc,this.colViewport=e.colViewport,this.ctrlsSvc=e.ctrlsSvc,this.colFlex=e.colFlex}refresh(e,t){const{colFlex:s,colModel:i,colViewport:o,ctrlsSvc:n}=this;t||this.buildTrees();const r=this.treeLeft,a=this.treeCenter,l=this.treeRight;let c,d,u;if(0===i.colsTreeDepth)c=r,d=a,u=l;else{c=[],d=[],u=[];for(let e=0,t=r.length;e<t;++e)za(r[e],null,c);for(let e=0,t=a.length;e<t;++e)za(a[e],null,d);for(let e=0,t=l.length;e<t;++e)za(l[e],null,u)}this.leftCols=c,this.centerCols=d,this.rightCols=u;const h=this.joinCols(e);this.setLeftValuesOfGroups(e);const p=this.flexActive||s?.columnsHidden;if(p){const e=n?.getGridBodyCtrl()?.getViewportWidthWithoutScrollbar();let t;if(null!=e){const s=e-h.left-h.right;t={viewportWidth:s>0?s:0}}s?.refreshFlexedColumns(t)}this.updateBodyWidths(p?void 0:h),this.setFirstRightAndLastLeftPinned(c,u,e),o.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}updateBodyWidths(e){const t=e?e.center:Ct(this.centerCols),s=e?e.left:Ct(this.leftCols),i=e?e.right:Ct(this.rightCols),o=this.bodyWidth!==t;if(this.isBodyWidthDirty=o,!o&&this.leftWidth===s&&this.rightWidth===i)return;this.bodyWidth=t,this.leftWidth=s,this.rightWidth=i,this.totalWidth=t+s+i;const n=this.eventSvc;n.dispatchEvent({type:"columnContainerWidthChanged"}),n.dispatchEvent({type:"displayedColumnsWidthChanged"})}setLeftValues(e){const t=Ua(this.leftCols,e),s=Ua(this.rightCols,e),i=Ua(this.centerCols,e);return this.setLeftValuesOfGroups(e),{left:t,center:i,right:s}}setLeftValuesOfGroups(e){const t=this.colModel.colsList;for(let s=0,i=t.length;s<i;++s){const i=t[s];i.displayed||i.setLeft(null,e)}ja(this.treeLeft),ja(this.treeRight),ja(this.treeCenter)}setFirstRightAndLastLeftPinned(e,t,s){const i=e.length,o=i?e[i-1]:null;let n=null;const r=t.length;r&&(n=this.gos.get("enableRtl")?t[r-1]:t[0]);const a=this.prevLastLeftPinned;a!==o&&(a?.setLastLeftPinned(!1,s),o?.setLastLeftPinned(!0,s),this.prevLastLeftPinned=o);const l=this.prevFirstRightPinned;l!==n&&(l?.setFirstRightPinned(!1,s),n?.setFirstRightPinned(!0,s),this.prevFirstRightPinned=n)}buildTrees(){const{colModel:e,colGroupSvc:t}=this,{leftCols:s,rightCols:i,centerCols:o,leftCount:n,centerCount:r}=this.partitionVisibleCols();this.stampAriaColIndexes(n,r);const a=new Ga;if(t){const n=e.nextBuildToken();this.treeLeft=t.createGroups(s,a,"left",n),this.treeRight=t.createGroups(i,a,"right",n),this.treeCenter=t.createGroups(o,a,null,n),t.prune(n)}else this.treeLeft=s,this.treeRight=i,this.treeCenter=o}partitionVisibleCols(){const e=this.colModel,t=[],s=[],i=[];let o=0,n=0;if(!e.ready)return{leftCols:t,rightCols:s,centerCols:i,leftCount:o,centerCount:n};const r=this.beans,a=e.pivotMode&&!e.showingPivotResult,l=r.selectionColSvc?.isEnabled()??!1,c=function({gos:e,formula:t}){const s=e.get("rowNumbers");return s||!!t?.active&&!1!==s}(r),d=function(e){return!!e.get("groupHideOpenParents")||"multipleColumns"===e.get("groupDisplayType")}(u=this.gos)&&u.get("groupHideColumnsUntilExpanded")&&B(u);var u;const h=e.colsList;let p=null,g=!1;for(let e=0,r=h.length;e<r;++e){const r=h[e],u=r.colKind,f=r.pinned;"right"!==f&&(f?++o:++n);const m="auto-group"===u;let v;if(v=a?r.aggregationActive||m&&(!d||r.visible)||l&&"selection"===u||c&&"row-number"===u:m&&!d||r.visible,v)if("selection"!==u||!r.visible||g){if("selection"!==u&&"row-number"!==u&&(g=!0),null!==p&&"row-number"!==u){const e=p.pinned;"right"===e?s.push(p):e?t.push(p):i.push(p),p=null}"right"===f?s.push(r):f?t.push(r):i.push(r)}else p=r}return{leftCols:t,rightCols:s,centerCols:i,leftCount:o,centerCount:n}}clear(){const e=this.allCols;for(let t=0,s=e.length;t<s;++t)e[t].allColsIndex=-1,e[t].displayed=!1;this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[]}stampAriaColIndexes(e,t){const s=this.colModel.colsList;let i=1,o=e+1,n=e+t+1;for(let e=0,t=s.length;e<t;++e){const t=s[e],r=t.pinned;t.ariaColIndex="right"===r?n++:r?i++:o++}}joinCols(e){const{leftCols:t,centerCols:s,rightCols:i}=this,o=this.allCols;for(let e=0,t=o.length;e<t;++e)o[e].allColsIndex=-1,o[e].displayed=!1;const n=[];this.autoHeightCols.length=0,this.flexActive=!1;const r=!!this.gos.get("hidePaddedHeaderRows");let a,l,c;return this.headerGroupRowCount=r?0:this.colModel.colsTreeDepth,this.gos.get("enableRtl")?(c=this.layoutSection(i,n,r,e),l=this.layoutSection(s,n,r,e),a=this.layoutSection(t,n,r,e)):(a=this.layoutSection(t,n,r,e),l=this.layoutSection(s,n,r,e),c=this.layoutSection(i,n,r,e)),this.allCols=n,{left:a,center:l,right:c}}layoutSection(e,t,s,i){const o=this.autoHeightCols;let n=0,r=null;for(let a=0,l=e.length;a<l;++a){const l=e[a];if(l.allColsIndex=t.length,l.displayed=!0,l.setLeft(n,i),t.push(l),l.colDef.autoHeight&&o.push(l),!this.flexActive&&null==l.pinned){const e=l.flex;null!=e&&e>0&&(this.flexActive=!0)}if(s){const e=l.parent;if(null!==e&&e!==r){r=e;const t=Wa(e);t>this.headerGroupRowCount&&(this.headerGroupRowCount=t)}}n+=l.actualWidth}return n}getLeftColsForRow(e){return this.colModel.colSpanActive?this.getColsForRow(e,this.leftCols):this.leftCols}getRightColsForRow(e){return this.colModel.colSpanActive?this.getColsForRow(e,this.rightCols):this.rightCols}getColsForRow(e,t,s,i){const o=[];let n=null;const r=t.length;for(let a=0;a<r;++a){const l=t[a],c=Math.min(l.getColSpan(e),r-a);let d;if(s){d=s(l);for(let e=1;!d&&e<c;++e)s(t[a+e])&&(d=!0)}else d=!0;c>1&&(a+=c-1),d&&(0===o.length&&n&&i?.(l)&&o.push(n),o.push(l)),n=l}return o}getColBefore(e){const t=e.allColsIndex;return t>0?this.allCols[t-1]:null}getColAfter(e){const t=this.allCols,s=e.allColsIndex;return s<t.length-1?t[s+1]:null}getLeftStickyColumnContainerWidth(){return this.leftCols.length?Ct(this.leftCols):this.leftWidth}getRightStickyColumnContainerWidth(){return this.rightCols.length?Ct(this.rightCols):this.rightWidth}isColAtEdge(e,t){const s=this.allCols,i=s.length;if(!i)return!1;const o="first"===t,n=Ft(e)?Tt(e,!0,!o):e;return!!n&&(o?s[0]:s[i-1])===n}},class extends m{postConstruct(){const{globalListener:e,globalSyncListener:t}=this.beans;e&&this.addGlobalListener(e,!0),t&&this.addGlobalListener(t,!1)}},class extends ke{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=Fl++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new i.$UK,this.globalEventHandlerFactory=e=>(t,s)=>{if(!this.isAlive())return;const i=xl.has(t);if(i&&!e||!i&&e)return;if(!function(e){return!!Rl[e]}(t))return;const o=(e,t)=>{const s=Rl[e],i=this.gridOptions[s];"function"==typeof i&&this.beans.frameworkOverrides.wrapOutgoing((()=>i(t)))};if(this.gridReadyFired||"issueRaised"===t)o(t,s);else if("gridReady"===t){o(t,s),this.gridReadyFired=!0;for(const e of this.queueEvents)o(e.eventName,e.event);this.queueEvents=[]}else this.queueEvents.push({eventName:t,event:s})}}wireBeans(e){this.gridOptions=e.gridOptions,this.validation=e.validation,this.api=e.gridApi,this.gridId=e.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(e){return this.gridOptions[e]??L[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return(0,i.Qmv)(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>e(this.addCommon(t)):e}updateGridOptions({options:e,force:t,source:s="api"}){const i={id:kl++,properties:[]},o=[],{gridOptions:n,validation:r}=this;for(const a of Object.keys(e)){const l=M.applyGlobalGridOption(a,e[a]);r?.warnOnInitialPropertyUpdate(s,a);const c=t||"object"==typeof l&&"api"===s,d=n[a];if(c||d!==l){n[a]=l;const e={type:a,currentValue:l,previousValue:d,changeSet:i,source:s};o.push(e)}}this.validateGridOptions(this.gridOptions),i.properties=o.map((e=>e.type));for(const e of o)Wo(this,`Updated property ${e.type} from`,e.previousValue," to ",e.currentValue),this.propEventSvc.dispatchEvent(e)}addPropertyEventListener(e,t){this.propEventSvc.addEventListener(e,t)}removePropertyEventListener(e,t){this.propEventSvc.removeEventListener(e,t)}getDomDataKey(){return this.domDataKey}addCommon(e){return e.api=this.api,e.context=this.gridOptionsContext,e}validateOptions(e,t,s=""){for(const i of Object.keys(e)){const o=e[i];if(null==o||!1===o)continue;let n=t[i];"function"==typeof n&&(n=n(e,this.gridOptions,this.beans)),n&&this.assertModuleRegistered(n,`\`${s}${i}\``)}}validateGridOptions(e){this.validateOptions(e,Il),this.validation?.processGridOptions(e)}validateColDef(e,t,s){!s&&this.beans.dataTypeSvc?.isColPendingInference(t)||(this.validateOptions(e,El,"colDef."),this.validation?.validateColDef(e))}assertModuleRegistered(e,t){const s=Array.isArray(e)?e.some((e=>this.isModuleRegistered(e))):this.isModuleRegistered(e);return s||function(e){const t=function(e){const t=Array.isArray(e.moduleName)?[...e.moduleName].sort():[e.moduleName];return`${e.gridId}::${t.join("|")}::${e.rowModelType}::${String(e.reasonOrId)}`}(e);En.has(t)||(En.add(t),yn(Rn,"error")&&bn(Rn,e,"error"),Pn.push(e),void 0===xn&&(xn=setTimeout(kn,50)))}({...this.getModuleErrorParams(),moduleName:e,reasonOrId:t}),s}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:rn(),rowModelType:this.get("rowModelType"),isUmd:!1,usesAgGridProvider:this.beans.frameworkOverrides.usesAgGridProvider??!1}}isModuleRegistered(e){return nn(e,this.gridId,this.get("rowModelType"))}setInstanceDomData(e){e[Dl]=this.instanceId}isElementInThisInstance(e){let t=e;for(;t;){const e=t[Dl];if((0,i.Qmv)(e))return e===this.instanceId;t=t.parentElement}return!1}},class extends ke{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.colSpanActive=!1,this.ready=!1,this.changeEventsDispatching=!1,this.showingPivotResult=!1,this.colBatchDepth=0,this.pendingRefresh=!1,this.everythingChangedInBatch=!1,this.pendingRaiseEverything=!1,this.colsList=[],this.colsTree=[],this.colsTreeDepth=0,this.colDefList=[],this.colDefsVersion=0,this.colDefTree=[],this.colDefTreeDepth=0,this.colDefHasMarryChildren=!1,this.hasMarryChildren=!1,this.colsById=Object.create(null),this.colDefGroupsById=new Map,this.colDefColsByKey=new Map,this.colDefAllGroups=[],this.colsGroupsById=new Map,this.colsAllGroups=[],this.groupHeaderNameOverrides=new Map,this.cachedColsByDef=null,this.cachedAllCols=null,this.cachedColsInStateOrder=null,this.lastOrder=null,this.lastPivotOrder=null,this.prevPivotStrict=!1,this.colsListIndexDirty=!0,this.colDefs=void 0,this.buildTokenCounter=0}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.hierarchyWrapperCache=new ra(this.beans),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","hidePaddedHeaderRows"],(e=>this.refreshAll(Pt(e.source)))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",(e=>this.setPivotMode(this.gos.get("pivotMode"),Pt(e.source))))}destroy(){((e,t)=>{if(e)for(let t=0,s=e.length;t<s;++t){const s=e[t];s.isAlive()&&s.destroy()}if(t)for(let e=0,s=t.length;e<s;++e){const s=t[e];s.isAlive()&&s.destroy()}})(this.colDefList,this.colDefAllGroups),this.hierarchyWrapperCache.destroy(),super.destroy()}nextBuildToken(){return++this.buildTokenCounter}isPivotActive(){return this.pivotMode&&!!this.beans.pivotColsSvc?.columns?.length}getCols(){return this.colsList}getAllCols(){let e=this.cachedAllCols;return e||(e=(this.showingPivotResult?this.beans.pivotResultCols?.buildAllCols():void 0)??this.colsList,this.cachedAllCols=e),e}getColGroup(e){return this.colsGroupsById.get(e)??(this.showingPivotResult?this.colDefGroupsById.get(e):void 0)}getColsInStateOrder(){if(!this.showingPivotResult)return this.colsList;let e=this.cachedColsInStateOrder;return e||(e=this.beans.pivotResultCols?.buildColsInStateOrder()??this.colsList,this.cachedColsInStateOrder=e,e)}buildFromColDefs(e,t){const s=this.beans,{valueCache:i,colAutosize:o,rowGroupColsSvc:n,pivotColsSvc:r,valueColsSvc:a,visibleCols:l,eventSvc:c,groupHierarchyColSvc:d,calculatedColsSvc:u}=s,h=this.colDefs,p=this.ready?Ye(s):void 0;i?.expire();const g=this.colDefList,f=this.colDefTree,m=this.colDefAllGroups,v=function(e,t,s,i,o,n,r,a,l,c){const{context:d,dataTypeSvc:u,gos:h,userColumnSvc:p}=e,g=h.get("defaultColGroupDef"),f=g??null,m=new Set,v=new Set,w=e=>m.has(e)||e in n;let C=0,y=0;if(t){const e=(t,s)=>{s>C&&(C=s);for(let i=0,o=t.length;i<o;++i){const o=t[i],n=o.children;if(n)null==o.groupId&&++y,e(n,s+1);else{const e=o.colId??o.field;null==e?++y:v.add(e)}}};if(e(t,0),C>0){const e=t=>{for(let s=0,i=t.length;s<i;++s){const i=t[s],n=i.children;if(n){e(n);continue}const r=i,a=o.get(r.colId??r.field??i);let l=a?ua(a,C):null;for(;l?.padding;)m.add(l.groupId),l=l.originalParent}};e(t)}}let b=0;const S=t=>{let s;if(null==t){do{s=""+b++}while(w(s)||v.has(s));return m.add(s),s}if(!w(t))return m.add(t),t;let i=1;do{s=`${t}_${i++}`}while(w(s));return e.log.warn(273,{providedId:t,usedId:s}),m.add(s),s},x=[],R=[];let P=!1;const E=new Map,I=e=>"user"===e.colKind&&e.primary===s&&e.buildToken!==l,k=t=>{const i=p?.overrideFor(t);if(null===i)return;void 0!==i&&(t=i);const c=t.colId;let d;if(null!=c){const e=o.get(c);d=e?.colId===c&&I(e)?e:void 0}else{const e=o.get(t);d=void 0!==e&&I(e)?e:void 0}if(void 0!==d)d.buildToken=l,d.reapplyColDef(t,r,a);else{const i=t.field;d=null==c&&null==i?(t=>{for(;;){const i=""+b++;if(m.has(i)||v.has(i))continue;const o=n[i];if(void 0===o)return m.add(i),Pe(e,t,i,s,l);{const e=o.userProvidedColDef;if(I(o)&&e&&null==e.colId&&null==e.field)return m.add(i),o.buildToken=l,o.reapplyColDef(t,r,a),o}}})(t):((t,i,c)=>{const d=i??c,u=o.get(d);if(u?.colId===d&&I(u))return u.buildToken=l,u.reapplyColDef(t,r,a),u;let h=0;for(;;){const o=0===h?d:`${d}_${h}`;if(h++,m.has(o))continue;const c=n[o];if(void 0!==c){const e=c.userProvidedColDef;if((e?e.colId??e.field:null)!==d||!I(c))continue}return m.add(o),null!=i&&o!==i&&e.log.warn(273,{providedId:i,usedId:o}),void 0!==c?(c.buildToken=l,c.reapplyColDef(t,r,a),c):Pe(e,t,o,s,l)}})(t,c,i)}const h=d.userProvidedColDef;if(h){E.set(d.colId,d),E.has(h)||E.set(h,d);const e=h.field;e&&!E.has(e)&&E.set(e,d)}return u?.addColumnListeners(d),d},F=new Map;if(0===C){const e=[],s=t?.length??0;for(let i=0;i<s;++i){const s=k(t[i]);void 0!==s&&(s.originalParent=null,e.push(s))}return{columnTree:e,treeDepth:0,columns:e,allGroups:R,marryChildren:!1,groupsById:F,colsByKey:E,source:r,newColDefs:a,buildToken:l,wrapperCache:c}}const D=(e,t,s)=>{let i=ua(e,C);if(null===i||i.buildToken===l)return null;for(;i.level>t;)i.buildToken=l,R.push(i),i=i.originalParent;return i.buildToken=l,R.push(i),i.originalParent=s,i};f&&h.validateColDef(f,"");const A=(e,t,s)=>{let i,o;for(let s=e;s<C;++s){let e;do{e=""+y++}while(w(e)||v.has(e));m.add(e);const n=new De(f,e,!0,s);n.buildToken=l,d.createBean(n),R.push(n),o?(o.children=[n],o.setExpandable(),n.originalParent=o):(n.originalParent=t,i=n),o=n}const n=o;n.children=s,n.setExpandable();for(let e=0,t=s.length;e<t;++e)s[e].originalParent=n;return i},M=(e,t)=>{if(null==e)return null;const s=i.get(e);return!s||s.buildToken===l||s.padding?null:m.has(s.groupId)||!T(t,s.colGroupDef,"children")?{reused:null,existing:s}:(s.buildToken=l,s.colGroupDef=t,m.add(s.groupId),{reused:s,existing:s})},N=(e,t,s)=>{const o=e.length;if(0===o)return[];const n=t<C;if(n){let i=!0;for(let t=0;t<o;++t)if(void 0!==e[t].children){i=!1;break}if(i){const i=[];for(let t=0;t<o;++t){const s=k(e[t]);void 0!==s&&(x.push(s),i.push(s))}if(0===i.length)return i;const n=i[0].originalParent;let r=null!==n;if(r)for(let e=1,t=i.length;e<t;++e)if(i[e].originalParent!==n){r=!1;break}if(r){const e=D(i[0],t,s);if(null!==e){n.children=i;for(let e=0,t=i.length;e<t;++e)i[e].originalParent=n;return[e]}}return[A(t,s,i)]}}const r=[];for(let a=0;a<o;++a){const o=e[a],c=o.children;if(c){const e=o,n=e.groupId,a={...g,...e},u=M(n,a),p=u?.reused;let f;if(p)p.level=t,f=p;else{const e=S(n);h.validateColDef(a,e),f=new De(a,e,!1,t),f.buildToken=l,d.createBean(f);const s=u?.existing??i.get(e);s&&f.setExpanded(s.expanded)}f.children=N(c,t+1,f),f.originalParent=s,f.setExpandable(),P||(P=!!a.marryChildren),F.set(f.groupId,f),R.push(f),r.push(f)}else{const e=k(o);if(void 0===e)continue;x.push(e),n?r.push(D(e,t,s)??A(t,s,[e])):(e.originalParent=s,r.push(e))}}return r};return{columnTree:N(t,0,null),treeDepth:C,columns:x,allGroups:R,marryChildren:P,groupsById:F,colsByKey:E,source:r,newColDefs:a,buildToken:l,wrapperCache:c}}(s,h,!0,this.colDefGroupsById,this.colDefColsByKey,this.colsById,e,t,this.nextBuildToken(),this.hierarchyWrapperCache);var w;d?.contributeTo(v),u?.contributeTo(v),w=v,w.edit?.commit(w),w.wrapperCache?.evict(w.buildToken);const C=v.columnTree,y=v.columns;this.colDefTree=C,this.colDefTreeDepth=v.treeDepth,this.colDefList=y,++this.colDefsVersion,this.colDefHasMarryChildren=v.marryChildren,this.colDefGroupsById=v.groupsById,this.colDefColsByKey=v.colsByKey,this.colDefAllGroups=v.allGroups;const b=Object.create(null);for(let e=0,t=y.length;e<t;++e)b[y[e].colId]=y[e];this.colsById=b,f!==C&&((e,t,s)=>{for(let t=0,i=e.length;t<i;++t){const i=e[t];i.buildToken!==s&&i.isAlive()&&i.destroy()}for(let e=0,i=t.length;e<i;++e){const i=t[e];i.buildToken!==s&&i.isAlive()&&i.destroy()}})(g,m,v.buildToken),this.invalidateColsDerivedState();const S=g.length>0?new Set(g):null;for(let e=0,t=y.length;e<t;++e){const t=y[e],s=!S?.has(t);n?.extractCol(t,s),r?.extractCol(t,s),a?.extractCol(t,s)}n?.commitExtract(e),r?.commitExtract(e),a?.commitExtract(e),this.ready=!0,this.changeEventsDispatching=!0;try{this.refreshCols(t,e)}finally{this.changeEventsDispatching=!1}if(l.refresh(e,!1),c.dispatchEvent({type:"columnEverythingChanged",source:e}),this.colBatchDepth>0&&(this.everythingChangedInBatch=!0),p){this.changeEventsDispatching=!0;try{Ke(s,e,p)}finally{this.changeEventsDispatching=!1}}c.dispatchEvent({type:"newColumnsLoaded",source:e}),"gridInitializing"===e&&o?.applyAutosizeStrategy()}beginColBatch(){this.colBatchDepth++}endColBatch(e){this.colBatchDepth=Math.max(0,this.colBatchDepth-1),this.flushColChanges(e,"dispatch")}flushColChanges(e,t){const s="dispatch"!==t;if(s&&(this.pendingRefresh=!0),s&&"reorder"!==t&&(this.pendingRaiseEverything=!0),this.colBatchDepth>0)return;const{rowGroupColsSvc:i,pivotColsSvc:o,valueColsSvc:n}=this.beans,r=this.pendingRefresh,a=this.pendingRaiseEverything,l=this.everythingChangedInBatch;if(this.everythingChangedInBatch=!1,this.pendingRaiseEverything=!1,!(i?.pendingChanged||o?.pendingChanged||n?.pendingChanged||r))return;const c=r?this.beans.colAnimation:void 0;c?.start();try{i?.flushReindex(),o?.flushReindex(),n?.flushReindex(),r&&(this.performRefresh(e),a&&!l&&this.eventSvc.dispatchEvent({type:"columnEverythingChanged",source:e})),i?.dispatchColChange(e),o?.dispatchColChange(e),n?.dispatchColChange(e)}finally{c?.finish()}}refreshCols(e,t){if(!this.ready)return;const s=this.beans,o=this.gos,n=this.isPivotSortReorder();n&&s.colAnimation?.start();try{const n=this.colDefList,r=this.colsTree,a=this.showingPivotResult,l=this.pivotMode?s.pivotResultCols:null,c=l?.pivotCols??null,d=null!=c?l:null,u=!!d;this.showingPivotResult=u;const h=c??n,p=d?d.pivotTree:this.colDefTree,g=d?d.pivotTreeDepth:this.colDefTreeDepth;this.colsTreeDepth=g,this.hasMarryChildren=d?d.pivotHasMarryChildren:this.colDefHasMarryChildren,this.colsGroupsById=d?d.pivotGroupsById:this.colDefGroupsById,this.colsAllGroups=d?d.pivotAllGroups:this.colDefAllGroups,s.formula?.setFormulasActive(n);const f=s.autoColSvc?.refreshCols(t),m=s.selectionColSvc?.refreshCols(),v=s.rowNumbersSvc?.refreshCols(),w=this.colsList;w.length>0&&(a?this.prevPivotStrict||(this.lastPivotOrder=pa(w,this.lastPivotOrder)):this.lastOrder=pa(w,this.lastOrder)),this.prevPivotStrict=u&&(s.pivotColsSvc?.isStrictColumnOrder()??!1);const C=f?.length??0,y=h.length,b=p.length,S=(v?1:0)+(m?1:0)+C,x=new Array(S+y),R=new Array(S+b),P=Object.create(null);let E=0;v&&(x[E++]=v),m&&(x[E++]=m);for(let e=0;e<C;++e)x[E++]=f[e];const I=s.colGroupSvc.wrapperCache;if(g>0){const e=this.nextBuildToken();for(let t=0;t<S;++t){const s=x[t];P[s.colId]=s,s.inColsList=!0,R[t]=I.wrap(s,g,e)}I.evict(e)}else{I.destroy();for(let e=0;e<S;++e){const t=x[e];P[t.colId]=t,t.inColsList=!0,t.originalParent=null,R[e]=t}}if(d){a||this.ensureColsListIndex();let e=-1;for(let t=0,s=n.length;t<s;++t){const s=n[t];P[s.colId]=s,s.inColsList=!1,s.colsListIndex<0?s.colsListIndex=e:e=s.colsListIndex}}for(let e=0;e<y;++e){const t=h[e];x[E++]=t,P[t.colId]=t,t.inColsList=!0}for(let e=0;e<b;++e)R[S+e]=p[e];const k=!e||function(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}(o,u),F=u?this.lastPivotOrder:this.lastOrder;let D=k?F:null;const T=s.pivotColsSvc;null!=D&&u&&T?.hasInteractivePivotSort()&&(D=T.reRankByPivotGroupOrder(x,D,P));const A=null==D?x:((e,t,s)=>{const o=e.length,n=s.length;if(o===n){let t=!0;for(let i=0;i<n;++i)if(e[i].colId!==s[i]){t=!1;break}if(t)return e}const r=[],a=new Map,l=new Map;let c=!1;for(let e=0;e<n;++e){const i=t[s[e]];if(null!=i){a.set(i,r.length),r.push(i),c||(c="auto-group"===i.colKind);let e=i.originalParent;for(;null!=e;)l.set(e,i),e=e.originalParent}}if(c&&((e,t,s)=>{let i=0;const o=t.length;for(let n=0,r=e.length;n<r;++n)if("auto-group"===e[n].colKind)for(;i<o;){const o=t[i++];if("auto-group"===o.colKind&&s.has(o)){e[n]=o,s.set(o,n);break}}})(r,e,a),r.length===o)return r;if(0===r.length)return e;const d=[],u=[],h=[],p=[];let g=null,f=null,m=null;for(let s=0;s<o;++s){const o=e[s];if(a.has(o)){m=o;continue}const n=o.colKind;if("auto-group"===n||"selection"===n||"row-number"===n)null===m?d.push(o):(g??(g=new Map),(0,i.OSi)(g,m,o));else if(o.isCalculatedCol){const e=o.anchoredToColId,s=null!=e?t[e]:void 0;void 0!==s&&a.has(s)?(f??(f=new Map),(0,i.OSi)(f,s,o)):null==e?p.push(o):null===m?h.push(o):(f??(f=new Map),(0,i.OSi)(f,m,o))}else u.push(o)}let v=null,w=u;if(u.length>0&&(e=>{for(let t=0,s=e.length;t<s;++t){let s=e[t].originalParent;for(;null!=s;){if(s.children.length>1)return!0;s=s.originalParent}}return!1})(r)){const e=((e,t,s)=>{const o=new Map,n=[];for(let r=0,a=e.length;r<a;++r){const a=e[r],l=ha(a,t,s);null!=l?(0,i.OSi)(o,l,a):n.push(a)}return{followers:o,orphans:n}})(u,a,l);v=e.followers,w=e.orphans}const C=new Array(o);let y=0;for(let e=0,t=d.length;e<t;++e)C[y++]=d[e];for(let e=0,t=h.length;e<t;++e)C[y++]=h[e];for(let e=0,t=r.length;e<t;++e){const t=r[e];C[y++]=t;const s=g?.get(t);if(void 0!==s)for(let e=0,t=s.length;e<t;++e)C[y++]=s[e];const i=f?.get(t);if(void 0!==i)for(let e=0,t=i.length;e<t;++e)C[y++]=i[e];const o=v?.get(t);if(void 0!==o)for(let e=0,t=o.length;e<t;++e)C[y++]=o[e]}for(let e=0,t=w.length;e<t;++e)C[y++]=w[e];for(let e=0,t=p.length;e<t;++e)C[y++]=p[e];return C})(x,P,D),M=Me(A,o),N=!(0,i.MpY)(M,w);N&&(this.colsListIndexDirty=!0),this.colsList=N?M:w,this.colsTree=(0,i.MpY)(R,r)?r:R,this.colsById=P,this.invalidateColsDerivedState(),this.refreshColsDerivedState(),N&&(s.rowSpanSvc?.refreshCols(),s.editSvc?.releaseColumnsLeaving(M)),(this.colsTree!==r||N)&&this.eventSvc.dispatchEvent({type:"gridColumnsChanged"})}finally{n&&s.colAnimation?.finish()}}isPivotSortReorder(){return!!this.beans.pivotColsSvc?.hasInteractivePivotSort()||this.prevPivotStrict}refreshColsDerivedState(){const e=this.beans;e.showRowGroupCols?.refresh(),e.quickFilter?.refreshCols(),this.computeColSpanAndAutoHeight(),e.visibleCols.clear(),e.colViewport.clear()}computeColSpanAndAutoHeight(){const e=this.colsList,t=this.beans.rowAutoHeight;let s=!1,i=!1;for(let o=0,n=e.length;o<n;++o){const n=e[o],r=n.colDef;if(s||(s=null!=r.colSpan),i||(i=!!t&&!!r.autoHeight&&n.visible),s&&(i||!t))break}this.colSpanActive=s,t?.setAutoHeightActive(i)}refreshAll(e){this.ready&&(this.colBatchDepth>0?this.pendingRefresh=!0:this.performRefresh(e))}performRefresh(e){this.pendingRefresh=!1,this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e,!1))}replaceColDefList(e){this.ready&&(this.colDefList=e)}setPivotMode(e,t){e!==this.pivotMode&&(this.pivotMode=e,this.ready&&(this.refreshCols(!1,t),this.beans.visibleCols.refresh(t,!1),this.eventSvc.dispatchEvent({type:"columnPivotModeChanged"})))}recreateColumnDefs(e){this.ready&&(this.beans.autoColSvc?.updateColumns(e),this.buildFromColDefs(Pt(e.source),!0))}setColumnDefs(e,t){const s=this.beans;s.userColumnSvc?.clear(),s.calculatedColsSvc?.resetDynamicColumnDefs(),this.colDefs=e,this.buildFromColDefs(t,!0)}rebuildCols(e){this.ready&&this.buildFromColDefs(e,!1)}markColsListIndexDirty(){this.colsListIndexDirty=!0,this.cachedColsInStateOrder=null,this.cachedAllCols=null}invalidateColsDerivedState(){this.cachedColsByDef=null,this.cachedAllCols=null,this.cachedColsInStateOrder=null,this.beans.sortSvc?.invalidate()}ensureColsListIndex(){if(this.colsListIndexDirty){const e=this.colsList;for(let t=0,s=e.length;t<s;++t)e[t].colsListIndex=t;this.colsListIndexDirty=!1}}getCol(e){if("string"==typeof e)return this.colsById[e]??this.getColFallback(e);const t=e?.colId;if("string"==typeof t){const e=this.colsById[t];if(void 0!==e)return e}return null==e?void 0:this.getColFallback(e)}getColFallback(e){const t=this.cachedColsByDef??this.loadColsByDef(),s=t.get(e);if(void 0!==s)return s;if("object"!=typeof e)return;const i=e.field;return"string"==typeof i?t.get(i):void 0}getNonPivotCol(e){const t=this.getCol(e);return void 0!==t&&null==t.colDef.pivotKeys?t:void 0}getNonPivotColById(e){const t=this.colsById[e];return void 0!==t&&null==t.colDef.pivotKeys?t:void 0}loadColsByDef(){const e=new Map;return ga(e,this.colsList),this.showingPivotResult&&ga(e,this.colDefList),this.cachedColsByDef=e,e}},class extends ke{constructor(){super(...arguments),this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){const{topRowBounds:e,bottomRowBounds:t}=this;return e&&t?Math.max(t.rowTop+t.rowHeight-e.rowTop,0):0}getCurrentPagePixelRange(){const{topRowBounds:e,bottomRowBounds:t}=this;return{pageFirstPixel:e?.rowTop??0,pageLastPixel:t?t.rowTop+t.rowHeight:0}}calculateBounds(e,t){const{rowModel:s}=this.beans,i=s.getRowBounds(e);i&&(i.rowIndex=e),this.topRowBounds=i;const o=s.getRowBounds(t);o&&(o.rowIndex=t),this.bottomRowBounds=o,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=this.topRowBounds?.rowTop??0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},class extends ke{constructor(){super(...arguments),this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:e?.animate??!1,newData:e?.newData??!1,newPage:e?.newPage??!1,newPageSize:e?.newPageSize??!1,keepRenderedRows:e?.keepRenderedRows??!1})}calculatePages(){const{pageBounds:e,pagination:t,rowModel:s}=this.beans;t?t.calculatePages():e.calculateBounds(0,s.getRowCount()-1)}},class extends ke{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{for(const e of this.getAllCellCtrls())e.onCellSelectionChanged()},t=()=>{for(const e of this.getAllCellCtrls())e.updateRangeBordersIfRangeCount()},s=()=>{this.eventSvc.addListener("cellSelectionChanged",e),this.eventSvc.addListener("columnMoved",t),this.eventSvc.addListener("columnPinned",t),this.eventSvc.addListener("columnVisible",t)},i=()=>{this.eventSvc.removeListener("cellSelectionChanged",e),this.eventSvc.removeListener("columnMoved",t),this.eventSvc.removeListener("columnPinned",t),this.eventSvc.removeListener("columnVisible",t)};this.addDestroyFunc((()=>i())),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],(()=>{de(this.gos)?s():i()})),de(this.gos)&&s()}}wireBeans(e){this.pageBounds=e.pageBounds,this.colModel=e.colModel,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusSvc=e.focusSvc,this.rowContainerHeight=e.rowContainerHeight,this.ctrlsSvc=e.ctrlsSvc,this.editSvc=e.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()}))}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],(()=>this.onDomLayoutChanged())),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer","stickyRowsMaxViewportRatio"],(()=>this.redraw())),this.addManagedPropertyListener("suppressCellFocus",(e=>this.onSuppressCellFocusChanged(e.currentValue))),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],(()=>this.redrawRows())),this.addManagedPropertyListener("cellSelection",(({currentValue:e,previousValue:t})=>{(!t&&e||t&&!e)&&this.redrawRows()}));const{stickyRowSvc:e,gos:t,showRowGroupCols:s}=this.beans;if(s&&this.addManagedPropertyListener("showOpenedGroup",(()=>{const e=s.columns;e.length&&this.refreshCells({columns:e,force:!0})})),e)this.stickyRowFeature=e.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{const e=this.gridBodyCtrl;e.setStickyTopHeight(0),e.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=W(t,"print"),this.embedFullWidthRows=this.printLayout||t.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Mc(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){const e=Object.values(this.rowCtrlsByRowIndex),t=Object.values(this.zombieRowCtrls),s=this.cachedRowCtrls?.getEntries()??[];t.length>0||s.length>0?this.allRowCtrls=[...e,...t,...s]:this.allRowCtrls=e}isCellBeingRendered(e,t){const s=this.getRowByPosition({rowIndex:e,rowPinned:null});if(!t||!s)return!!s;if(s.isFullWidth())return!0;const i=this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:e,column:t,rowPinned:null});return!!i||!!s.getCellCtrl(t)||!s.isRowRendered()}updateCellFocus(e){for(const t of this.getAllCellCtrls())t.onCellFocused(e);for(const t of this.getFullWidthRowCtrls())t.onRowFocused(e)}onCellFocusChanged(e){if(null!=e?.rowIndex&&!e.rowPinned){const t=this.beans.colModel.getCol(e.column)??void 0;this.isCellBeingRendered(e.rowIndex,t)||this.redraw()}this.updateCellFocus(e)}onSuppressCellFocusChanged(e){for(const t of this.getAllCellCtrls())t.onSuppressCellFocusChanged(e);for(const t of this.getFullWidthRowCtrls())t.onSuppressCellFocusChanged(e)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>this.onCellFocusChanged(e),cellFocusCleared:()=>this.updateCellFocus(),flashCells:e=>{const{cellFlashSvc:t}=this.beans;if(t)for(const s of this.getAllCellCtrls())t.onFlashCells(s,e)},columnHoverChanged:()=>{for(const e of this.getAllCellCtrls())e.onColumnHover()},displayedColumnsChanged:()=>{for(const e of this.getAllCellCtrls())e.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(const e of this.getAllCellCtrls())e.onLeftChanged()},rightPinnedWidthChanged:()=>{for(const e of this.getAllCellCtrls())"right"===e.column.getPinned()&&e.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(const e of this.destroyFuncsForColumnListeners)e();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();const e=this.colModel.colsList;for(const t of e){const e=e=>{for(const s of this.getAllCellCtrls())s.column===t&&e(s)},s=()=>{e((e=>e.onLeftChanged()))},i=()=>{e((e=>e.onWidthChanged()))},o=()=>{e((e=>e.onFirstRightPinnedChanged()))},n=()=>{e((e=>e.onLastLeftPinnedChanged()))},r=()=>{e((e=>e.onColDefChanged()))};t.__addEventListener("leftChanged",s),t.__addEventListener("widthChanged",i),t.__addEventListener("firstRightPinnedChanged",o),t.__addEventListener("lastLeftPinnedChanged",n),t.__addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push((()=>{t.__removeEventListener("leftChanged",s),t.__removeEventListener("widthChanged",i),t.__removeEventListener("firstRightPinnedChanged",o),t.__removeEventListener("lastLeftPinnedChanged",n),t.__removeEventListener("colDefChanged",r)}))}}onDomLayoutChanged(){const e=W(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),s=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,s&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsNotSpanningForColumn(e){const t=[];for(const s of this.getAllRowCtrls()){const i=s.getCellCtrl(e,!0)?.eGui;i&&t.push(i)}return t}refreshPinnedRowComps(e=!0){this.topRowCtrls=this.refreshPinnedRows(this.topRowCtrls,"top",e),this.bottomRowCtrls=this.refreshPinnedRows(this.bottomRowCtrls,"bottom",e)}refreshPinnedRows(e,t,s){const{pinnedRowModel:i,beans:o,printLayout:n}=this,r=Object.fromEntries(e.map((e=>[e.rowNode.id,e]))),a=[];i?.forEachPinnedRow(t,((l,c)=>{const d=e[c];d&&void 0===i.getPinnedRowById(d.rowNode.id,t)&&(d.destroyFirstPass(),d.destroySecondPass()),l.id in r&&s?(a[c]=r[l.id],delete r[l.id]):a[c]=new nc(l,o,!1,!1,n)}));const l=("top"===t?i?.getPinnedTopRowCount():i?.getPinnedBottomRowCount())??0;return a.length=l,a}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature?.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const s=t[e.rowIndex];s&&s.rowNode===e&&(s.destroyFirstPass(),s.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){const{editSvc:t}=this.beans;if(t?.isEditing()&&(t.isBatchEditing()?t.cleanupEditors():t.stopEditing(void 0,{source:"api"})),null!=e){for(const t of e??[])this.redrawRow(t,!0);this.dispatchDisplayedRowsChanged(!1)}else this.redrawAfterModelUpdate()}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(e);const s=!e.domLayoutChanged&&!!e.recycleRows,i=e.animate&&J(this.gos),o=s?this.getRowsToRecycle():null;s||this.removeAllRowComps(!i),this.workOutFirstAndLastRowsToRender();const{stickyRowFeature:n,gos:r}=this;if(n){n.checkStickyRows();const e=n.extraTopHeight+n.extraBottomHeight;e&&this.updateContainerHeights(e)}this.recycleRows(o,i),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshPinnedRowComps(r.get("enableRowPinning")?s:void 0),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh(),this.beans.aggStage?.refreshAggregateDependentCells()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,s=this.gos.get("suppressScrollOnNewData");t&&!s&&(this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){const{rowContainerHeight:t}=this;if(this.printLayout)return void t.setModelHeight(null);const s=this.pageBounds.getCurrentPageHeight();t.setModelHeight(s+e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error(Bn(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){if(!e)return;const t=this.beans.focusSvc,s=this.findPositionToFocus(e);s?e.rowIndex===s.rowIndex&&e.rowPinned==s.rowPinned?t.doesRowOrCellHaveBrowserFocus()||this.updateCellFocus(xe(this.gos,{...s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"})):t.setFocusedCell({...s,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0}):t.focusHeaderPosition({headerPosition:{headerRowIndex:bi(this.beans)-1,column:e.column}})}findPositionToFocus(e){const{pagination:t,pageBounds:s}=this.beans;let i=e;for(null==i.rowPinned&&t&&s&&!t.isRowInPage(i.rowIndex)&&(i={rowPinned:null,rowIndex:s.getFirstRow()});i;){if(null==i.rowPinned&&s)if(i.rowIndex<s.getFirstRow()){if(i=ui(this.beans,{rowPinned:null,rowIndex:0}),!i)return null}else i.rowIndex>s.getLastRow()&&(i={rowPinned:null,rowIndex:s.getLastRow()});const t=this.getRowByPosition(i);if(t?.isAlive())return{...t.getRowPosition(),column:e.column};i=ui(this.beans,i)}return null}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),s=t.length;for(let i=0;i<s;i++){const s=t[i].getAllCellCtrls(),o=s.length;for(let t=0;t<o;t++)e.push(s[t])}return e}getAllRowCtrls(){const{spannedRowRenderer:e}=this.beans,t=this.getStickyTopRowCtrls(),s=this.getStickyBottomRowCtrls();return[...this.topRowCtrls,...this.bottomRowCtrls,...t,...s,...e?.getCtrls("top")??[],...e?.getCtrls("bottom")??[],...e?.getCtrls("center")??[],...Object.values(this.rowCtrlsByRowIndex)]}addRenderedRowListener(e,t,s){const i=this.getRowByPosition({rowIndex:t,rowPinned:null});i&&i.addEventListener(e,s)}refreshCells({rowNodes:e,columns:t,force:s,suppressFlash:i}={}){const o={force:s,newData:!1,suppressFlash:i};for(const s of this.getCellCtrls(e,t))s.refreshOrDestroyCell(o);if(e?.length)for(const t of this.getRowCtrls(e))t.isFullWidth()&&t.refreshRow(o)}refreshRows(e={}){for(const t of this.getRowCtrls(e.rowNodes))t.refreshRow(e)}getRowCtrlByNode(e){const t=this.getIndexedRowCtrlByNode(e);return t||e.rowPinned?t:this.getStickyRowCtrlByNode(e)}getIndexedRowCtrlByNode(e){const t=e.rowIndex;if(null==t)return;const s=e.rowPinned;if("top"===s){const s=this.topRowCtrls[t];return s?.rowNode===e?s:void 0}if("bottom"===s){const s=this.bottomRowCtrls[t];return s?.rowNode===e?s:void 0}const i=this.rowCtrlsByRowIndex[t];return i?.rowNode===e?i:void 0}getStickyRowCtrlByNode(e){const t=this.stickyRowFeature;if(t){for(const s of t.stickyTopRowCtrls)if(s.rowNode===e)return s;for(const s of t.stickyBottomRowCtrls)if(s.rowNode===e)return s}}refreshRowByNode(e){if(!e)return;const t=this.getIndexedRowCtrlByNode(e);t?.refreshRow();const s=e.rowPinned?void 0:this.getStickyRowCtrlByNode(e);s&&s!==t&&s.refreshRow();const i=this.beans.spannedRowRenderer;i&&(Vc(i.getCtrls("top"),e,t,s),Vc(i.getCtrls("bottom"),e,t,s),Vc(i.getCtrls("center"),e,t,s))}getRowCtrls(e){const t=Nc(e),s=this.getAllRowCtrls();return e&&t?s.filter((e=>Lc(e.rowNode,t))):s}getCellCtrls(e,t){let s;(0,i.Qmv)(t)&&(s={},t.forEach((e=>{const t=this.colModel.getCol(e);(0,i.Qmv)(t)&&(s[t.getId()]=!0)})));const o=[];for(const t of this.getRowCtrls(e))for(const e of t.getAllCellCtrls()){const t=e.column.getId();s&&!s[t]||o.push(e)}return o}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){const e=[];for(const t of Object.keys(this.rowCtrlsByRowIndex))null==this.rowCtrlsByRowIndex[t].rowNode.id&&e.push(t);this.removeRowCtrls(e);const t={};for(const e of Object.values(this.rowCtrlsByRowIndex))t[e.rowNode.id]=e;return this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){for(const s of e){const e=this.rowCtrlsByRowIndex[s];e&&(e.destroyFirstPass(t),e.destroySecondPass()),delete this.rowCtrlsByRowIndex[s]}}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{focusSvc:t,animationFrameSvc:s}=this.beans,{afterScroll:i,force:o}=e;let n;const r=this.stickyRowFeature;r&&(n=t?.getFocusCellToUseAfterRefresh()||void 0);const a=this.firstRenderedRow,l=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let c=!1;if(r){c=r.checkStickyRows();const e=r.extraTopHeight+r.extraBottomHeight;e&&this.updateContainerHeights(e)}const d=this.firstRenderedRow!==a||this.lastRenderedRow!==l;if((!i||c||d||o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,i),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(i&&!c),null!=n)){const e=t?.getFocusCellToUseAfterRefresh();null!=n&&null==e&&(s?.flushAllFrames(),this.restoreFocusedCell(n))}}removeRowCompsNotToDraw(e,t){const s={};for(const t of e)s[t]=!0;const i=Object.keys(this.rowCtrlsByRowIndex).filter((e=>!s[e]));this.removeRowCtrls(i,t)}calculateIndexesToDraw(e){const t=[];for(let e=this.firstRenderedRow;e<=this.lastRenderedRow;e++)t.push(e);const s=this.beans.pagination,i=this.beans.focusSvc?.getFocusedCell()?.rowIndex;null!=i&&(i<this.firstRenderedRow||i>this.lastRenderedRow)&&(!s||s.isRowInPage(i))&&i<this.rowModel.getRowCount()&&t.push(i);const o=e=>{const s=e.rowNode.rowIndex;null!=s&&s!==i&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(e)&&t.push(s)};for(const e of Object.values(this.rowCtrlsByRowIndex))o(e);if(e)for(const t of Object.values(e))o(t);t.sort(((e,t)=>e-t));const n=[];for(let e=0;e<t.length;e++){const s=t[e],i=this.rowModel.getRow(s);i&&!i.sticky&&n.push(s)}return n}recycleRows(e,t=!1,s=!1){const i=this.calculateIndexesToDraw(e);(this.printLayout||s)&&(t=!1),this.removeRowCompsNotToDraw(i,!t);for(const o of i)this.createOrUpdateRowCtrl(o,e,t,s);if(e){const{animationFrameSvc:i}=this.beans;i?.active&&s&&!this.printLayout?i.addDestroyTask((()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const{visibleCols:e}=this.beans,t=e.leftCols.length>0,s=e.rightCols.length>0;(this.pinningLeft!==t||s!==this.pinningRight)&&(this.pinningLeft=t,this.pinningRight=s,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];for(const t of this.getFullWidthRowCtrls()){const s=t.rowNode.rowIndex;e.push(s.toString())}this.refreshPinnedRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0,force:!0})}getFullWidthRowCtrls(e){const t=Nc(e);return this.getAllRowCtrls().filter((e=>{if(!e.isFullWidth())return!1;const s=e.rowNode;return!(null!=t&&!Lc(s,t))}))}createOrUpdateRowCtrl(e,t,s,o){let n,r=this.rowCtrlsByRowIndex[e];if(r||(n=this.rowModel.getRow(e),(0,i.Qmv)(n)&&(0,i.Qmv)(t)&&t[n.id]&&n.alreadyRendered&&(r=t[n.id],t[n.id]=null)),!r){if(n||(n=this.rowModel.getRow(e)),!(0,i.Qmv)(n))return;r=this.createRowCon(n,s,o)}n&&(n.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r}destroyRowCtrls(e,t){const s=[];if(e)for(const i of Object.values(e))if(i)if(this.cachedRowCtrls&&i.isCacheable())this.cachedRowCtrls.addRow(i);else if(i.destroyFirstPass(!t),t){const e=i.instanceId;this.zombieRowCtrls[e]=i,s.push((()=>{i.destroySecondPass(),delete this.zombieRowCtrls[e]}))}else i.destroySecondPass();t&&(s.push((()=>{this.isAlive()&&(this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged())})),window.setTimeout((()=>{for(const e of s)e()}),400))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*q(this.beans)}workOutFirstAndLastRowsToRender(){const{rowContainerHeight:e,pageBounds:t,rowModel:s}=this;let i,o;if(e.updateOffset(),s.isRowsToRender())if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),i=t.getFirstRow(),o=t.getLastRow();else{const n=this.getRowBufferInPixels(),r=this.ctrlsSvc.getScrollFeature(),a=this.gos.get("suppressRowVirtualisation");let l,c,d;do{const s=t.getPixelOffset(),{pageFirstPixel:i,pageLastPixel:o}=t.getCurrentPagePixelRange(),u=e.divStretchOffset,h=r.getVScrollPosition(),p=h.top,g=h.bottom;a?(c=i+u,d=o+u):(c=Math.max(p+s-n,i)+u,d=Math.min(g+s+n,o)+u),this.firstVisibleVPixel=Math.max(p+s,i)+u,this.lastVisibleVPixel=Math.min(g+s,o)+u,l=this.ensureAllRowsInRangeHaveHeightsCalculated(c,d)}while(l);let u=s.getRowIndexAtPixel(c),h=s.getRowIndexAtPixel(d);const p=t.getFirstRow(),g=t.getLastRow();u<p&&(u=p),h>g&&(h=g),i=u,o=h}else i=0,o=-1;const n=W(this.gos,"normal"),r=this.gos.get("suppressMaxRenderedRowRestriction"),a=Math.max(this.getRowBuffer(),500);n&&!r&&o-i>a&&(o=i+a);const l=i!==this.firstRenderedRow,c=o!==this.lastRenderedRow;(l||c)&&(this.firstRenderedRow=i,this.lastRenderedRow=o,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:i,lastRow:o}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,(0,i.Arb)(this.beans,(()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})})))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const s=this.pinnedRowModel?.ensureRowHeightsValid(),i=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:o,rowModel:n}=this,r=n.ensureRowHeightsValid(e,t,o.getFirstRow(),o.getLastRow());return(r||i)&&this.eventSvc.dispatchEvent({type:"recalculateRowBounds"}),!!(i||r||s)&&(this.updateContainerHeights(),!0)}doNotUnVirtualiseRow(e){const t=!1,s=e.rowNode,i=this.focusSvc.isRowFocused(s.rowIndex,s.rowPinned),o=this.editSvc?.isEditing(e),n=s.detail;return(i||o||n)&&!!this.isRowPresent(s)||t}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(this.beans.pagination?.isRowInPage(e.rowIndex)??!0)}createRowCon(e,t,s){const i=this.cachedRowCtrls?.getRow(e)??null;if(i)return i;const o=s&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new nc(e,this.beans,t,o,this.printLayout)}getRenderedNodes(){const e=Object.values(this.rowCtrlsByRowIndex).map((e=>e.rowNode));return[...this.getStickyTopRowCtrls().map((e=>e.rowNode)),...e,...this.getStickyBottomRowCtrls().map((e=>e.rowNode))]}getRowByPosition(e){let t;const{rowIndex:s}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[s];break;case"bottom":t=this.bottomRowCtrls[s];break;default:t=this.rowCtrlsByRowIndex[s],t||(t=this.getStickyTopRowCtrls().find((e=>e.rowNode.rowIndex===s))||null,t||(t=this.getStickyBottomRowCtrls().find((e=>e.rowNode.rowIndex===s))||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||s)}},class extends ke{constructor(){super(...arguments),this.beanName="valueSvc",this.isTreeData=!1,this.isSsrm=!1,this.cellExpressions=!1,this.groupSuppressBlankHeader=!1,this.editSvc=void 0,this.valueCache=void 0,this.expressionSvc=void 0,this.dataTypeSvc=void 0,this.formula=void 0,this.showValuesAsSvc=void 0,this.formulaDataSvc=void 0,this.changeDetectionSvc=void 0,this.showRowGroupColValueSvc=void 0,this.rowGroupingEditValueSvc=void 0,this.frameworkOverrides=void 0,this.gridApi=void 0,this.gridOptions=void 0}wireBeans(e){this.expressionSvc=e.expressionSvc,this.colModel=e.colModel,this.valueCache=e.valueCache,this.dataTypeSvc=e.dataTypeSvc,this.editSvc=e.editSvc,this.formulaDataSvc=e.formulaDataSvc,this.formula=e.formula,this.showValuesAsSvc=e.showValuesAsSvc,this.changeDetectionSvc=e.changeDetectionSvc,this.showRowGroupColValueSvc=e.showRowGroupColValueSvc,this.rowGroupingEditValueSvc=e.rowGroupingEditValueSvc,this.frameworkOverrides=e.frameworkOverrides,this.gridApi=e.gridApi,this.gridOptions=e.gridOptions,this.init()}init(){const e=this.gos;this.isSsrm=z(e),this.cellExpressions=e.get("enableCellExpressions"),this.isTreeData=e.get("treeData"),this.groupSuppressBlankHeader=e.get("groupSuppressBlankHeader"),e.get("valueCache")||(this.valueCache=void 0)}postConstruct(){this.init();const e=e=>this.callColumnCellValueChangedHandler(e);this.eventSvc.addListener("cellValueChanged",e,!0),this.addDestroyFunc((()=>this.eventSvc.removeListener("cellValueChanged",e,!0))),this.addManagedPropertyListener("treeData",(e=>this.isTreeData=e.currentValue)),this.addManagedPropertyListener("groupSuppressBlankHeader",(e=>this.groupSuppressBlankHeader=e.currentValue))}getValueForDisplay(e){const t=e.column,s=e.node,i=s.group,o=this.showRowGroupColValueSvc;if(o&&(!t&&i||t?.showRowGroup)&&(!this.isTreeData||s.footer)){const n=o.getGroupValue(s,t,!!i&&this.displayIgnoresAggData(s));return null==n?{value:null,valueFormatted:null}:{value:n.value,valueFormatted:e.includeValueFormatted?o.formatAndPrefixGroupColValue(n,t,e.exporting):null}}if(!t)return{value:s.key,valueFormatted:null};const n=!!i&&this.displayIgnoresAggData(s);let r=this.getValue(t,s,e.from,n),a=r;if(t.allowFormula){const i=this.formula;i?.isFormula(r)&&(e.useRawFormula?(r=i.normaliseFormula(r,!0),a=i.resolveValue(t,s)):(r=i.resolveValue(t,s),a=r))}const l=e.includeValueFormatted&&!(e.exporting&&!1===t.colDef.useValueFormatterForExport);if(e.transformValues){const e=this.showValuesAsSvc;if(e&&!n&&null!=t.showValuesAs){const i=e.isApplying(t),o=i?e.transform(t,s,a):a;return{value:o,valueFormatted:l?e.formatValue(t,s,o,a,!i):null}}}return{value:r,valueFormatted:l?this.formatValue(t,s,a):null}}getTransformedValue(e,t){const s=!!t.group&&this.displayIgnoresAggData(t),i=this.getValue(e,t,"edit",s);return this.resolveTransformed(e,t,i,s)}resolveTransformed(e,t,s,i){if(e.allowFormula){const i=this.formula;i?.isFormula(s)&&(s=i.resolveValue(e,t))}const o=this.transformingSvc(e,i);return o?o.transform(e,t,s):s}getDisplayValue(e,t,s,i){const o=t.group,n=this.showRowGroupColValueSvc;if(n&&(!e&&o||e?.showRowGroup)&&(!this.isTreeData||t.footer)){const s=n.getGroupValue(t,e,!!o&&this.displayIgnoresAggData(t));return null==s?null:s.value}if(!e)return t.key;const r=!!o&&this.displayIgnoresAggData(t),a=this.getValue(e,t,s,r);if(i)return this.resolveTransformed(e,t,a,r);if(e.allowFormula){const s=this.formula;if(s?.isFormula(a))return s.resolveValue(e,t)}return a}getValueFromData(e,t,s=!1){let o=!e.isCalculatedCol||e.aggregationActive&&t.group?this.resolveCoreValue(e,t,s):this.formula?.resolveValue(e,t);if(this.cellExpressions&&(0,i.PZy)(o)){const s=o.substring(1);o=this.executeValueGetter(s,t.data,e,t)}return o}getValue(e,t,s,i=!1){if(t){if("data"!==s){const i=this.editSvc?.getPendingEditValue(t,e,s);if(void 0!==i)return i}return this.getValueFromData(e,t,i)}}displayIgnoresAggData(e){return!(e.footer||-1===e.level||!e.sibling||this.groupSuppressBlankHeader||e.leafGroup&&this.colModel.pivotMode||!e.expanded)}transformingSvc(e,t){const s=this.showValuesAsSvc;return s&&!t&&e.showValuesAs&&s.isApplying(e)?s:void 0}resolveCoreValue(e,t,s){const i=t.group;if(!i&&e.allowFormula){const s=this.formula?.getDataSourceFormula(t,e);if(void 0!==s)return s}const o=t.data,n=this.isTreeData;if(i||n){const r=i&&!s?t.aggData:void 0,a=e.colId,l=r?.[a];if(n){if(void 0!==l)return l;const s=e.valueGetter;let i;if(s)i=this.executeValueGetter(s,o,e,t);else if(o){const t=e.field;if(t){const s=e.fieldPath;i=s?zc(o,s):o[t]}}if(void 0!==i)return i}const c=t.groupData;if(c&&a in c)return c[a];if(void 0!==l)return l}const r=e.valueGetter,a=s&&this.isSsrm&&!!e.aggFunc;if(i){const s=e.showRowGroup;if(r&&!a)return"string"==typeof s?Wc(this.colModel,s,t.level):this.executeValueGetter(r,o,e,t);if(this.isSsrm&&o){const e=((e,t,s)=>{if(!e.footer)return;const i=e.field;return!i||!0!==s&&s!==i?void 0:i.includes(".")?zc(t,i.split(".")):t[i]})(t,o,s);if(void 0!==e)return e}if("string"==typeof s)return Wc(this.colModel,s,t.level)}if(r)return a?void 0:this.executeValueGetter(r,o,e,t);const l=e.field;if(!l||!o||a)return;const c=e.fieldPath;return c?zc(o,c):o[l]}parseValue(e,t,s,i){const o=e.colDef;if(e.allowFormula&&this.formula?.isFormula(s))return s;const n=o.valueParser;if(null!=n&&""!==n){const r={api:this.gridApi,context:this.gridOptions.context,node:t,data:t?.data,oldValue:i,newValue:s,colDef:o,column:e};return"function"==typeof n?n(r):this.expressionSvc?.evaluate(n,r)}return s}getDeleteValue(e,t){const s=e.colDef.valueParser;return null!=s&&""!==s?this.parseValue(e,t,"",this.getDisplayValue(e,t,"edit",!1))??null:null}formatValue(e,t,s,i,o=!0){let n=null;const r=i??(o?e.valueFormatter:void 0);if(r){const i={api:this.gridApi,context:this.gridOptions.context,value:s,node:t,data:t?t.data:null,colDef:e.colDef,column:e};if("function"==typeof r)n=r(i);else{const e=this.expressionSvc;n=e?e.evaluate(r,i):null}}else{const t=e.refData;if(t)return t[s]||""}return null==n&&Array.isArray(s)&&(n=s.join(", ")),n}formatTransformedValue(e,t,s){if(!t)return;const i=this.showValuesAsSvc,o=!!t.group&&this.displayIgnoresAggData(t);if(!i||o||null==e.showValuesAs)return;const n=this.getValue(e,t,"edit",o);return i.formatValue(e,t,s,n,!i.isApplying(e))}setValue(e,t,s,i){const o=t.colDef;if(!e.data&&((e,t)=>!e.group||null==t.groupRowValueSetter&&null==t.groupRowEditable&&!t.pivotValueColumn)(e,o)&&(e.data={}),!this.isSetValueSupported(t,e,s,o))return!1;const n=this.getValueFromData(t,e),r=e.data,a={api:this.gridApi,context:this.gridOptions.context,node:e,data:r,oldValue:n,newValue:s,colDef:o,column:t};let l=!1;if(r){const n=this.handleExternalFormulaChange({column:t,eventSource:i,newValue:s,setterParams:a,rowNode:e});if(null!==n)return n;l=this.computeValueChange({column:t,rowNode:e,newValue:s,params:a,rowData:r,valueSetter:o.valueSetter,field:o.field})??!0}const c=this.changeDetectionSvc;c?.beginDeferred();try{if(e.group){const o=this.rowGroupingEditValueSvc?.setGroupDataValue(e,t,s,n,i,l||s!==n);if(void 0!==o)return!(!l&&!o)&&this.finishValueChange(e,t,a,i,s)}return!!l&&this.finishValueChange(e,t,a,i)}finally{c?.endDeferred()}}finishValueChange(e,t,s,i,o){e.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();const n=void 0===o?this.getValueFromData(t,e):o;this.dispatchCellValueChangedEvent(e,s,n,i);const r=e.pinnedSibling;return r&&this.dispatchCellValueChangedEvent(r,s,n,i),!0}isSetValueSupported(e,t,s,i){const{field:o,valueSetter:n}=i;if(e.isCalculatedCol)return!1;const r=this.formula,a=e.allowFormula&&r?.isFormula(s),l=!!this.formulaDataSvc?.hasDataSource();return null!=o&&""!==o||null!=n&&""!==n||l&&a?!(this.dataTypeSvc&&!this.dataTypeSvc.checkType(e,s)&&(this.warn(135),1)):!(!t.group||!i.groupRowValueSetter&&!i.groupRowEditable)||(this.warn(17),!1)}handleExternalFormulaChange(e){const{column:t,rowNode:s,newValue:i,eventSource:o,setterParams:n}=e,r=this.formula,a=this.formulaDataSvc;if(!t.allowFormula||!a?.hasDataSource())return null;const l=r?.isFormula(i),c=a.getFormula({column:t,rowNode:s});if(l){if(c===i)return!1;a.setFormula({column:t,rowNode:s,formula:i});const e=r?.resolveValue(t,s),{valueSetter:l,field:d}=t.colDef;return(null!=l&&""!==l||null!=d&&""!==d)&&this.computeValueChange({column:t,rowNode:s,newValue:e,params:{...n,newValue:e},rowData:s.data,valueSetter:l,field:d}),this.finishValueChange(s,t,n,o)}return void 0!==c&&a.setFormula({column:t,rowNode:s,formula:void 0}),null}computeValueChange(e){const{valueSetter:t,params:s,rowData:i,field:o,column:n,newValue:r}=e;if(null!=t&&""!==t)return"function"==typeof t?t(s):this.expressionSvc?.evaluate(t,s);if(!i||!o)return!1;const a=n.fieldPath;let l=!1;if(null===a)l=i[o]===r,l||(i[o]=r);else{let e=i;const t=a.length-1;for(let s=0;s<t&&e;++s)e=e[a[s]];if(e){const s=a[t];l=e[s]===r,l||(e[s]=r)}}return!l}dispatchCellValueChangedEvent(e,t,s,i){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:t.column,colDef:t.colDef,data:e.data,node:e,oldValue:t.oldValue,newValue:s,newRawValue:t.newValue,value:s,source:i})}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.frameworkOverrides.wrapOutgoing((()=>t(e)))}executeValueGetter(e,t,s,i){const o=this.valueCache;if(o){const e=o.getValue(i,s.colId);if(void 0!==e)return e}const n={api:this.gridApi,context:this.gridOptions.context,data:t,node:i,column:s,colDef:s.colDef,getValue:e=>this.getValueCallback(i,e)},r="function"==typeof e?e(n):this.expressionSvc?.evaluate(e,n);return o&&o.setValue(i,s.colId,r),r}getValueCallback(e,t){const s=this.colModel.getCol(t);return s?this.getValueFromData(nt(s,e),e):null}getKeyForNode(e,t){let s=this.getValueFromData(e,t);const i=e.colDef,o=i.keyCreator;return o&&(s=o({api:this.gridApi,context:this.gridOptions.context,value:s,colDef:i,column:e,node:t,data:t.data})),"string"==typeof s||null==s||(s=String(s),"[object Object]"===s&&this.warn(121)),s}},class extends ke{constructor(){super(...arguments),this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.rowRenderer=e.rowRenderer,this.navigation=e.navigation,this.filterManager=e.filterManager,this.overlays=e.overlays}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.addDestroyFunc((0,i.V1O)(this.beans))}attemptToRecoverFocus(){this.needsFocusRestored=!0,null!=this.focusFallbackTimeout&&clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){this.needsFocusRestored=!1,null!=this.focusFallbackTimeout&&(clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null)}shouldTakeFocus(){return this.gos.get("suppressFocusAfterRefresh")?(this.setFocusRecovered(),!1):this.needsFocusRestored?(this.setFocusRecovered(),!0):this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;const e=this.focusedCell.column,t=this.colModel.getCol(e.getId());e!==t&&this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){const{gos:e,focusedCell:t}=this;return e.get("suppressFocusAfterRefresh")||e.get("suppressCellFocus")||!t?null:this.doesRowOrCellHaveBrowserFocus()?t:null}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader?null:this.isDomDataPresentInHierarchy((0,i.UlD)(this.beans),so)?this.focusedHeader:null}doesRowOrCellHaveBrowserFocus(){const e=(0,i.UlD)(this.beans);return!!this.isDomDataPresentInHierarchy(e,Do,!0)||this.isDomDataPresentInHierarchy(e,Ao,!0)}isDomDataPresentInHierarchy(e,t,s){let i=e;for(;i;){const e=Z(this.gos,i,t);if(e)return!e.destroyed||!s||(this.attemptToRecoverFocus(),!1);i=i.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(e){const{rowIndex:t,rowPinned:s,column:i}=e,o={rowIndex:t,rowPinned:s,column:i,isFullWidthCell:!1},n=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s});return n&&(o.isFullWidthCell=n.isFullWidth()),o}clearFocusedCell(){if(null==this.focusedCell)return;const e=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...e})}setFocusedCell(e){this.setFocusRecovered();const{column:t,rowIndex:s,rowPinned:o,forceBrowserFocus:n=!1,preventScrollOnBrowserFocus:r=!1,sourceEvent:a}=e,l=this.colModel.getCol(t);if(!l)return void(this.focusedCell=null);this.focusedCell={rowIndex:s,rowPinned:(0,i.X7E)(o),column:l};const c=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...c,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:n,preventScrollOnBrowserFocus:r,sourceEvent:a}),this.previousCellFocusParams=c}isCellFocused(e){return null!=this.focusedCell&&ri(e,this.focusedCell)}isHeaderWrapperFocused(e){if(null==this.focusedHeader)return!1;const{column:t,rowCtrl:{rowIndex:s}}=e,{column:i,headerRowIndex:o}=this.focusedHeader;return t===i&&s===o}focusHeaderPosition(e){if(this.setFocusRecovered(),fi(this.beans))return!1;const{direction:t,fromTab:s,allowUserOverride:i,event:o,fromCell:n,rowWithoutSpanValue:r,scroll:a=!0}=e;let{headerPosition:l}=e;if(n&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(l);if(i){const e=this.focusedHeader,i=bi(this.beans);if(s){const s=this.gos.getCallback("tabToNextHeader");s&&(l=this.getHeaderPositionFromUserFunc({userFunc:s,direction:t,currentPosition:e,headerPosition:l,headerRowCount:i}))}else{const t=this.gos.getCallback("navigateToNextHeader");if(t&&o){const s=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:l,headerRowCount:i,event:o});l=null===s?e:s}}}return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:o,fromCell:n,rowWithoutSpanValue:r,scroll:a})}focusHeaderPositionFromUserFunc(e){if(fi(this.beans))return!1;const{userFunc:t,headerPosition:s,direction:i,event:o}=e,n=this.focusedHeader,r=bi(this.beans),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:i,currentPosition:n,headerPosition:s,headerRowCount:r});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:o})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:s,currentPosition:i,headerPosition:o,headerRowCount:n}=e,r=t({backwards:"Before"===s,previousHeaderPosition:i,nextHeaderPosition:o,headerRowCount:n});return!0===r?i:!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:s,fromCell:o,rowWithoutSpanValue:n,event:r,scroll:a=!0}=e,{column:l,headerRowIndex:c}=t,{filterManager:d,ctrlsSvc:u,headerNavigation:h}=this.beans;if(this.isDomDataPresentInHierarchy((0,i.UlD)(this.beans),so)&&this.focusedHeader&&(p=e.headerPosition,g=this.focusedHeader,p.headerRowIndex===g.headerRowIndex&&p.column===g.column))return!1;var p,g;if(-1===c)return d?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView({column:l,event:r});a&&h?.scrollToColumn(l,s);const f=u.getHeaderRowContainerCtrl(),m=f?.focusHeader(t.headerRowIndex,l,r)||!1;return h&&m&&(null!=n||o)&&(h.currentHeaderRowWithoutSpan=n??-1),m}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;const e=this.visibleCols.allCols[0];if(!e)return!1;const t=Sl(this.beans,e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;const t=bi(this.beans)-1,s=(0,i.GXs)(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:s},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(e,t){return null!=this.focusedCell&&this.focusedCell.rowIndex===e&&this.focusedCell.rowPinned===(0,i.X7E)(t)}focusOverlay(e){const t=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!t&&(0,i.YtT)(t,e)}getDefaultTabToNextGridContainerTarget(e){const{backwards:t,focusableContainers:s}=e,i=t?-1:1;let o;const n=()=>(void 0===o&&(o=this.getGridBodyTabTarget(t)),o);for(let t=e.nextIndex;t>=0&&t<s.length;t+=i){const e=wi(s[t],n);if(e)return e}return null}getGridBodyTabTarget(e){if(e)return this.getGridViewTabTarget({column:(0,i.GXs)(this.visibleCols.allCols),backwards:!0});const t=this.visibleCols.allCols[0];return 0===this.gos.get("headerHeight")||fi(this.beans)?this.getGridViewTabTarget({column:t}):t?Sl(this.beans,t,0):null}getGridViewTabTarget(e){const{backwards:t=!1}=e,s=e.column??this.focusedHeader?.column;if(!s)return null;if(this.overlays?.exclusive)return null;if(mi(this.beans))return t&&!fi(this.beans)?{headerRowIndex:bi(this.beans)-1,column:s}:null;const o=t?li(this.beans):ai(this.beans);if(null==o?.rowIndex){if(this.overlays?.isVisible())return null;if(t&&!fi(this.beans)){const e=(0,i.GXs)(this.visibleCols.allCols);if(e)return{headerRowIndex:bi(this.beans)-1,column:e}}return null}const n=ci(this.beans,o);if(!n||s.isSuppressNavigable(n))return null;if(t){const e=this.rowRenderer.getRowByPosition(o);if(e?.isFullWidth())return null}return{rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:s}}focusGridView(e){const{backwards:t=!1,canFocusOverlay:s=!0,event:o}=e;if(this.overlays?.exclusive)return s&&this.focusOverlay(t);if(mi(this.beans))return t&&!fi(this.beans)?this.focusLastHeader():!(!s||!this.focusOverlay(t))||!t&&vi(this.beans,t);const n=t?li(this.beans):ai(this.beans);if(n){const r=e.column??this.focusedHeader?.column,{rowIndex:a,rowPinned:l}=n,c=ci(this.beans,n);if(!r||!c||null==a)return!1;if(r.isSuppressNavigable(c)){if(G(this.gos,c))return t&&!fi(this.beans)?this.focusLastHeader():s&&this.focusOverlay(t);const e=this.gos.get("enableRtl");let n;return n=o&&o.key!==i.DDm.TAB?o.key:e?i.DDm.LEFT:i.DDm.RIGHT,this.beans.navigation?.navigateToNextCell(null,n,{rowIndex:a,column:r,rowPinned:l||null},!0),!0}if(this.navigation?.ensureCellVisible({rowIndex:a,column:r,rowPinned:l}),t){const e=this.rowRenderer.getRowByPosition(n);if(e?.isFullWidth()&&this.navigation?.tryToFocusFullWidthRow(n,t))return!0}return this.setFocusedCell({rowIndex:a,column:r,rowPinned:(0,i.X7E)(l),forceBrowserFocus:!0}),St(r)||this.beans.rangeSvc?.setRangeToCell({rowIndex:a,rowPinned:l,column:r}),!0}return!(!s||!this.focusOverlay(t))||!(!t||!this.focusLastHeader())}focusAdvancedFilter(e){return this.advFilterFocusColumn=e?.column,this.beans.advancedFilter?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){const s=(t?void 0:this.advFilterFocusColumn)??this.visibleCols.allCols?.[0];return e?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:bi(this.beans)-1}}):this.focusGridView({column:s})}clearAdvancedFilterColumn(){this.advFilterFocusColumn=void 0}},class extends f{initVariables(){this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeightVariable())),this.getSizeEl(vl),this.getSizeEl(wl),this.getSizeEl(Cl),this.getSizeEl(yl),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(yl)}getRowBorderWidth(){return this.getCSSVariablePixelValue(Cl)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(bl)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(vl)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(wl)}getAutoHeightMaxBodyHeight(){const e=this.getCSSVariablePixelValue(pl);return e<1/0?e:null}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(gl)}getDefaultCellWidgetSpacing(){return this.getCSSVariablePixelValue(fl)}getDefaultIconSize(){return this.getCSSVariablePixelValue(ml)}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){const{eRootDiv:e}=this,t=e.style.getPropertyValue("--ag-line-height").trim(),s=this.gos.get("rowHeight");if(null==s||isNaN(s)||!isFinite(s))return null!==t&&e.style.setProperty("--ag-line-height",null),-1;const i=`${s}px`;return t!=i?(e.style.setProperty("--ag-line-height",i),s):""!=t?Number.parseFloat(t):-1}fireStylesChangedEvent(e){"rowBorderWidth"===e&&this.refreshRowBorderWidthVariable(),"theme"!==e&&this.checkLegacyThemeVariables(),super.fireStylesChangedEvent(e)}refreshRowBorderWidthVariable(){const e=this.getCSSVariablePixelValue(Cl);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${e}px`)}postProcessThemeChange(e,t){e&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")?t?this.beans.log.error(106):this.beans.log.error(239):e&&this.checkLegacyThemeVariables()}checkLegacyThemeVariables(){this.beans.validation?.checkLegacyThemeVariables(this.eRootDiv)}getAdditionalCss(){const e=new Map;return e.set("core",['.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport{background-color:var(--ag-data-background-color);flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-grid-viewport{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;position:relative;-webkit-overflow-scrolling:touch;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-grid-viewport:where(.ag-pinned-columns-overflow){overflow-x:hidden}.ag-grid-viewport::-webkit-scrollbar{display:none!important}.ag-grid-scrollable-area{display:flex;flex-direction:column;min-height:100%;min-width:100%;position:relative}.ag-spanning-container{height:100%;pointer-events:none;position:absolute;top:0}.ag-grid-scrolling-container{display:block;isolation:isolate;min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll;pointer-events:all}.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-grid-scrolling-container{position:relative}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-full-width-anchor{height:100%;position:sticky;width:var(--ag-internal-grid-viewport-width,100%)}:where(.ag-ltr) .ag-full-width-anchor{left:0}:where(.ag-rtl) .ag-full-width-anchor{right:0}.ag-grid-scrolling-rows{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;z-index:2;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{flex:none;width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-horizontal-scroll-end-spacer{flex:0 0 auto;min-width:0;overflow:scroll}.ag-body-vertical-scroll{flex-direction:column;pointer-events:none;position:absolute;top:0;z-index:2}:where(.ag-ltr) .ag-body-vertical-scroll{right:0}:where(.ag-rtl) .ag-body-vertical-scroll{left:0}.ag-body-vertical-scroll-start-spacer{border-bottom:var(--ag-header-row-border);flex:none;opacity:0}:where(.ag-ltr .ag-has-right-pinned-cols),:where(.ag-rtl .ag-has-left-pinned-cols){.ag-body-vertical-scroll-start-spacer{background-color:var(--ag-background-color);background-image:linear-gradient(0deg,var(--ag-header-background-color),var(--ag-header-background-color));opacity:1;pointer-events:all}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-header-row,.ag-row:where(:not(.ag-full-width-row)),.ag-spanned-row,:where(.ag-row.ag-embedded-full-width-row){display:flex;width:100%}:where(.ag-header-row):after,:where(.ag-row.ag-embedded-full-width-row:after),:where(.ag-row:not(.ag-full-width-row)):after,:where(.ag-spanned-row):after{align-self:stretch;content:"";flex:1 0 0px}:where(.ag-row.ag-embedded-full-width-row:after),:where(.ag-row:not(.ag-header-row,.ag-full-width-row)):after{background-color:var(--ag-data-background-color)}:where(.ag-header-row):after{background-color:var(--ag-header-background-color)}.ag-header{border-bottom:var(--ag-header-row-border);left:0;position:absolute;right:0;top:0;z-index:1}.ag-grid-pinned-left-cells,.ag-grid-pinned-right-cells,.ag-grid-scrolling-cells{height:100%;position:relative;white-space:nowrap}.ag-grid-scrolling-cells{flex:0 0 auto;z-index:0}:where(.ag-row.ag-embedded-full-width-row)>.ag-grid-scrolling-cells{flex:1 0 auto;margin-right:var(--ag-internal-pinned-right-sticky-offset,0)}.ag-grid-pinned-left-cells,.ag-grid-pinned-right-cells{flex:0 0 auto;overflow:hidden;position:sticky;z-index:2}.ag-grid-pinned-left-cells{left:var(--ag-internal-pinned-left-sticky-offset,0)}.ag-grid-pinned-right-cells{right:var(--ag-internal-pinned-right-sticky-offset,0)}:where(.ag-header-row),:where(.ag-row.ag-embedded-full-width-row),:where(.ag-row:not(.ag-full-width-row)),:where(.ag-spanned-row){>.ag-grid-pinned-right-cells{order:1}}.ag-rtl{:where(.ag-header-row),:where(.ag-row.ag-embedded-full-width-row),:where(.ag-row:not(.ag-full-width-row)),:where(.ag-spanned-row){>:where(.ag-grid-scrolling-cells){order:1}}:where(.ag-row .ag-grid-scrolling-cells),:where(.ag-spanned-row .ag-grid-scrolling-cells){margin-left:var(--ag-internal-pinned-left-sticky-offset,0)}}.ag-spanning-container .ag-grid-scrolling-cells{z-index:1}.ag-spanning-container .ag-grid-pinned-left-cells,.ag-spanning-container .ag-grid-pinned-right-cells{overflow:visible;z-index:3}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:4}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-spanning-container .ag-cell{pointer-events:auto}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{overflow-wrap:break-word;white-space:normal}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-grid-pinned-bottom-rows,.ag-grid-pinned-top-rows{background-color:var(--ag-data-background-color);position:sticky;width:100%;z-index:2}.ag-grid-pinned-top-rows{top:0;white-space:nowrap}.ag-grid-pinned-bottom-rows{border-bottom:none;bottom:0;box-sizing:content-box!important;white-space:nowrap}.ag-grid-pinned-bottom-rows-container,.ag-grid-pinned-top-rows-container,.ag-grid-sticky-bottom-rows-container,.ag-grid-sticky-top-rows-container{background-color:var(--ag-data-background-color);overflow:visible;position:absolute;white-space:nowrap;width:100%}.ag-grid-pinned-top-rows-container{border-bottom:var(--ag-pinned-row-border);display:flex;z-index:1}.ag-grid-pinned-bottom-rows-container{border-top:var(--ag-pinned-row-border);display:flex}.ag-extra-rows-container{position:absolute;width:100%}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-grid-pinned-bottom-rows,.ag-grid-pinned-bottom-rows-container,.ag-grid-pinned-top-rows,.ag-grid-pinned-top-rows-container,.ag-grid-scrolling-rows,.ag-grid-sticky-bottom-rows-container,.ag-grid-sticky-top-rows-container{flex-direction:row}.ag-header-row,.ag-row:where(.ag-embedded-full-width-row),.ag-row:where(:not(.ag-full-width-row)),.ag-spanned-row{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-grid-pinned-bottom-rows,.ag-grid-pinned-bottom-rows-container,.ag-grid-pinned-top-rows,.ag-grid-pinned-top-rows-container,.ag-grid-scrolling-rows,.ag-grid-sticky-bottom-rows-container,.ag-grid-sticky-top-rows-container{flex-direction:row-reverse}.ag-header-row,.ag-row:where(.ag-embedded-full-width-row),.ag-row:where(:not(.ag-full-width-row)),.ag-spanned-row{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}.ag-show-values-as-inapplicable{opacity:.5}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}.ag-row.ag-full-width-row:not(.ag-embedded-full-width-row){border-bottom:var(--ag-row-border)}.ag-row:where(.ag-embedded-full-width-row),.ag-row:where(:not(.ag-header-row,.ag-full-width-row)){>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom:var(--ag-row-border)}}:where(.ag-grid-pinned-bottom-rows-container){.ag-row-last:where(.ag-embedded-full-width-row),.ag-row-last:where(:not(.ag-header-row,.ag-full-width-row)){>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom:none}}}:where(.ag-grid-sticky-bottom-rows-container){.ag-row:where(.ag-embedded-full-width-row),.ag-row:where(:not(.ag-header-row,.ag-full-width-row)){>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom:none;border-top:var(--ag-row-border)}}}:where(.ag-row:not(.ag-header-row)){background-color:var(--ag-data-background-color);--ag-internal-row-overlay-color:transparent;--ag-internal-row-overlay-image:none}.ag-grid-container-wrapper{height:100%;width:100%}.ag-row:not(.ag-header-row){>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells{background-color:inherit;background-image:linear-gradient(var(--ag-data-background-color),var(--ag-data-background-color))}>.ag-grid-pinned-left-cells>.ag-grid-container-wrapper,>.ag-grid-pinned-right-cells>.ag-grid-container-wrapper{background-color:inherit}}.ag-body-vertical-content-no-gap .ag-has-bottom-pinned-rows{.ag-grid-pinned-bottom-rows .ag-grid-sticky-bottom-rows-container .ag-row-last,.ag-grid-scrolling-container .ag-row-last{>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom:none}}}.ag-grid-scrollable-area.ag-has-top-pinned-rows .ag-grid-pinned-top-rows>.ag-grid-pinned-top-rows-container>.ag-row.ag-row-last{>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom:none}}.ag-body-vertical-content-no-gap>.ag-grid-viewport>.ag-grid-scrollable-area>.ag-grid-scrolling-rows>.ag-grid-scrolling-container>.ag-row-last.ag-full-width-row{border-bottom-color:transparent}.ag-body-vertical-content-no-gap>.ag-grid-viewport>.ag-grid-scrollable-area>.ag-grid-scrolling-rows>.ag-grid-scrolling-container>.ag-row-last:not(.ag-full-width-row){>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells,>.ag-grid-scrolling-cells{border-bottom-color:transparent}}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-full-width-row:not(.ag-embedded-full-width-row):after,.ag-grid-pinned-left-cells:after,.ag-grid-pinned-right-cells:after,.ag-grid-scrolling-cells:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:var(--ag-internal-row-highlight-content,none);height:var(--ag-row-drag-indicator-width);inset:var(--ag-internal-row-highlight-inset,auto);pointer-events:none;position:absolute}.ag-root-wrapper{--ag-internal-row-highlight-content:initial}.ag-row-highlight-above{--ag-internal-row-highlight-content:"";--ag-internal-row-highlight-inset:0 0 auto}.ag-row-highlight-below{--ag-internal-row-highlight-content:"";--ag-internal-row-highlight-inset:auto 0 0}:where(.ag-ltr) .ag-row-highlight-indent.ag-full-width-row:not(.ag-embedded-full-width-row):after,:where(.ag-ltr) .ag-row-highlight-indent>.ag-grid-scrolling-cells:after{margin-left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-row-highlight-indent.ag-full-width-row:not(.ag-embedded-full-width-row):after,:where(.ag-rtl) .ag-row-highlight-indent>.ag-grid-scrolling-cells:after{margin-right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside{&.ag-full-width-row:not(.ag-embedded-full-width-row):after,>.ag-grid-pinned-left-cells:after,>.ag-grid-pinned-right-cells:after,>.ag-grid-scrolling-cells:after{--ag-internal-row-highlight-content:"";background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);border-radius:0;height:auto;inset:0}}.ag-grid-pinned-bottom-rows-container,.ag-grid-scrolling-rows{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-hover:not(.ag-full-width-row),.ag-row-selected{.ag-grid-pinned-left-cells:before,.ag-grid-pinned-right-cells:before,.ag-grid-scrolling-cells:before{background-color:var(--ag-internal-row-overlay-color);background-image:var(--ag-internal-row-overlay-image);content:"";display:block;inset:0;pointer-events:none;position:absolute}}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-selected.ag-full-width-row:before{background-color:var(--ag-internal-row-overlay-color);background-image:var(--ag-internal-row-overlay-image);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row.ag-row-selected{--ag-internal-row-overlay-color:var(--ag-selected-row-background-color)}.ag-row-hover.ag-full-width-row.ag-row-group,.ag-row-hover:not(.ag-full-width-row){--ag-internal-row-overlay-color:var(--ag-row-hover-color)}.ag-row-hover.ag-row-selected{--ag-internal-row-overlay-color:var(--ag-row-hover-color);--ag-internal-row-overlay-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-grid-scrolling-rows{min-height:var(--ag-auto-height-min-body-height)}}.ag-grid-viewport{--ag-internal-header-rows-height:0px;--ag-internal-top-rows-height:0px;--ag-internal-bottom-rows-height:0px}.ag-grid-viewport.ag-layout-auto-height{max-height:calc(var(--ag-auto-height-max-body-height) + var(--ag-internal-header-rows-height) + var(--ag-internal-top-rows-height) + var(--ag-internal-bottom-rows-height))}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight)}.ag-header-row{border-bottom:none;height:var(--ag-header-height);position:absolute;.ag-grid-scrolling-cells{background-color:var(--ag-header-background-color)}>.ag-grid-pinned-left-cells,>.ag-grid-pinned-right-cells{background-image:linear-gradient(var(--ag-background-color),var(--ag-background-color))}.ag-grid-container-wrapper{background-color:var(--ag-header-background-color);height:100%;width:100%}.ag-grid-pinned-left-cells,.ag-grid-pinned-right-cells{overflow:visible}}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}:where(.ag-header-row.ag-header-row-not-first){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:visible}:where(.ag-grid-pinned-top-rows-container.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"<color>";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"<color>";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{overflow-wrap:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-calculated-column-icon,.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-calculated-column-icon,.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-show-values-as-dormant{opacity:.35}.ag-header-cell:after,.ag-header-group-cell:after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:after{border-left:var(--ag-header-column-border);left:0}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap){.ag-header-cell:where(.ag-column-last):after,.ag-header-group-cell:where(.ag-column-last):after{border-right-color:transparent}}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap){.ag-header-cell:where(.ag-column-last):after,.ag-header-group-cell:where(.ag-column-last):after{border-left-color:transparent}}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:"";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-grid-pinned-left-cells) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-grid-pinned-left-cells) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:col-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-grid-scrolling-rows{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}.ag-full-width-anchor,.ag-grid-scrollable-area,.ag-grid-scrolling-container,.ag-header-row{width:auto!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-grid-scrolling-container,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{background-color:var(--ag-wrapper-background-color);border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-has-menu-open,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");color:var(--ag-icon-button-active-color)}}']),function(e,t){for(const s of t.sort(((e,t)=>e.moduleName.localeCompare(t.moduleName)))){const t=s.css;t&&e.set(`module-${s.moduleName}`,t)}}(e,Array.from(new Set(Xo))),e}getDefaultTheme(){return ul}varError(e,t){this.beans.log.warn(9,{variable:{cssName:e,defaultValue:t}})}themeError(e){this.beans.log.error(240,{theme:e})}shadowRootError(){this.beans.log.error(293)}},class extends ke{constructor(){super(...arguments),this.beanName="scrollVisibleSvc",this.refreshTimer=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colAnimation=e.colAnimation}destroy(){window.clearTimeout(this.refreshTimer),super.destroy()}postConstruct(){const{gos:e}=this;this.horizontalScrollShowing=!0===e.get("alwaysShowHorizontalScroll"),this.verticalScrollShowing=!0===e.get("alwaysShowVerticalScroll"),this.getScrollbarWidth();const t=this.refresh.bind(this);this.addManagedEventListeners({displayedColumnsChanged:t,displayedColumnsWidthChanged:t,newColumnsLoaded:t})}refresh(){this.refreshImpl(),window.clearTimeout(this.refreshTimer),this.refreshTimer=window.setTimeout((()=>this.refreshImpl()),500)}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}refreshImpl(){const{colAnimation:e}=this;e?.isActive()?e.executeLaterVMTurn((()=>{e.executeLaterVMTurn((()=>this.refreshScrollState()))})):this.refreshScrollState()}refreshScrollState(){const e=this.ctrlsSvc.getGridBodyCtrl();if(!this.isAlive()||!e||this.colAnimation?.isActive())return;const t=this.calculateScrollVisibilityState(e);this.applyScrollVisibility(t),this.applyScrollGap(this.calculateScrollGapState(e,t.verticalScrollShowing))}calculateScrollVisibilityState(e){const t=this.calculateVerticalScrollShowing(e,!1),s=this.calculateHorizontalScrollShowing(e,t);return{horizontalScrollShowing:s,verticalScrollShowing:t||s&&this.calculateVerticalScrollShowing(e,!0)}}calculateVerticalScrollShowing(e,t){if(this.gos.get("alwaysShowVerticalScroll"))return!0;if(!j(this.beans))return!1;const s=e.eGridViewport.clientHeight+this.getAppliedHorizontalScrollbarLayoutHeight()-this.getHorizontalScrollbarLayoutHeight(t),i=e.getBodyViewportHeight(s);return(this.beans.rowContainerHeight.uiContainerHeight??0)-i>.5}getHorizontalScrollbarLayoutHeight(e){return!e||this.gos.get("suppressHorizontalScroll")||(0,i.b5C)()?0:this.getScrollbarWidth()||0}getAppliedHorizontalScrollbarLayoutHeight(){if(this.gos.get("suppressHorizontalScroll")||(0,i.b5C)())return 0;const e=Number.parseFloat(this.ctrlsSvc.get("fakeHScrollComp")?.getGui().style.height??"");return Number.isFinite(e)?e:0}calculateHorizontalScrollShowing(e,t){return!!this.gos.get("alwaysShowHorizontalScroll")||e.getHorizontalContentWidth(t)-e.getHorizontalViewportWidth()>.5}calculateScrollGapState(e,t){const{rowContainerHeight:s}=this.beans;return{horizontalScrollGap:e.getColumnsWidth()<e.getViewportWidthWithoutScrollbar(t)-.5,verticalScrollGap:(s.getAdjustedUiContainerHeight()??0)<e.getBodyViewportHeight(e.eGridViewport.clientHeight)-.5}}applyScrollGap({horizontalScrollGap:e,verticalScrollGap:t}){(this.horizontalScrollGap!==e||this.verticalScrollGap!==t)&&(this.horizontalScrollGap=e,this.verticalScrollGap=t,this.eventSvc.dispatchEvent({type:"scrollGapChanged"}))}applyScrollVisibility(e){(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)&&(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"}))}getScrollbarWidth(){if(null==this.scrollbarWidth){const e=this.gos.get("scrollbarWidth"),t="number"==typeof e&&e>=0?e:(0,i.q8f)();null!=t&&(this.scrollbarWidth=t,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},class extends ke{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",(()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}}),this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){this.ready=Ya.every((e=>{const t=this.params[e];return t?.isAlive()??!1}))}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc((()=>{const e=this.readyCallbacks.indexOf(t);e>=0&&this.readyCallbacks.splice(e,1)}))}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc((()=>{this.updateReady()}))}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrl(){return this.params.headerRowContainerCtrl}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},class extends ke{constructor(){super(...arguments),this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(e=>this.setColumnDefs(e)))}start(){this.beans.ctrlsSvc.whenReady(this,(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()}))}setColumnsAndData(e){const{colModel:t,rowModel:s}=this.beans;t.setColumnDefs(e??[],"gridInitializing"),s.start()}gridReady(){const{eventSvc:e,gos:t}=this;e.dispatchEvent({type:"gridReady"}),Wo(t,`initialised successfully, enterprise = ${t.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.beans.colModel.setColumnDefs(t,Pt(e.source))}},class extends ke{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,s=!1){if(!e)return null;const i=this.getHeaderName(e.colDef,e,null,null,t),o=this.beans.aggColNameSvc;return s&&o?o.getHeaderName(e,i):i}getDisplayNameForProvidedColumnGroup(e,t,s){const i=t?.colGroupDef;return i?this.getHeaderName(i,null,e,t,s):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.providedColumnGroup,t)}getHeaderName(e,t,s,o,n){const r=o?this.beans.colModel.groupHeaderNameOverrides.get(o.groupId)??null:null,a=t?.headerNameOverride??r;if(null!=a)return a;const l=e.headerValueGetter;if(l){const i=xe(this.gos,{colDef:e,column:t,columnGroup:s,providedColumnGroup:o,location:n});return"function"==typeof l?l(i):"string"==typeof l?this.beans.expressionSvc?.evaluate(l,i)??null:""}return null!=e.headerName?e.headerName:e.field?(0,i.jv)(e.field):""}},class extends ke{constructor(){super(...arguments),this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,s=!1){const{visibleCols:i}=this,o=i.isBodyWidthDirty;e===this.scrollWidth&&t===this.scrollPosition&&!o||(this.scrollWidth=e,this.scrollPosition=t,i.isBodyWidthDirty=!0,this.viewportLeft=t,this.viewportRight=e+t,this.colModel.ready&&this.checkViewportColumns(s))}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let s;switch(e){case"left":s=this.rowsOfHeadersToRenderLeft[t];break;case"right":s=this.rowsOfHeadersToRenderRight[t];break;default:s=this.rowsOfHeadersToRenderCenter[t]}return s??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[],this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!(!e.isAutoHeaderHeight()&&!function(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.parent}return!1}(e))||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,s=t+e.getActualWidth(),i=this.viewportLeft-200,o=this.viewportRight+200;return!(t<i&&s<i||t>o&&s>o)}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:s}=this,o=s.centerCols;return s.getColsForRow(e,o,t,(e=>{const t=e.getLeft();return(0,i.Qmv)(t)&&t>this.viewportLeft}))}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const s=e=>{const t=new Set,s={};for(const i of e){let e=i.parent;const o=i.isSpanHeaderHeight();for(;e&&!t.has(e);){if(o&&e.isPadding()){e=e.parent;continue}const i=e.getProvidedColumnGroup().getLevel();s[i]??(s[i]=[]),s[i].push(e),t.add(e),e=e.parent}}return s};this.rowsOfHeadersToRenderLeft=s(e),this.rowsOfHeadersToRenderRight=s(t),this.rowsOfHeadersToRenderCenter=s(this.headerColsWithinViewport)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map((e=>`${e.getId()}-${e.getPinned()||"normal"}`)).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},class extends ke{constructor(){super(...arguments),this.beanName="iconSvc"}createIconNoSpan(e,t){return er(e,this.beans,t?.column)}}],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:function(e){return e.context.getId()},getGridElement:function(e){return t=e.gridApi,Yc.get(t);var t},destroy:function(e){e.gridDestroySvc.destroy()},isDestroyed:function(e){return e.gridDestroySvc.destroyCalled},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,s){Un(e,{[t]:s})},updateGridOptions:Un,isModuleRegistered:function(e,t){const s=t.replace(/Module$/,"");return e.gos.isModuleRegistered(s)}},dependsOn:[br,Oa,ea,na,cr,Ll,da,Vl,Ac,Hc,_l,lc,dc,uc,Hl,$a,Ba,Bc,Ra,pc]},Uc=class{constructor(e="javascript"){var t;this.frameworkName=e,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.usesAgGridProvider=void 0,this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e(),this.baseDocLink=`${Jo}/${this.frameworkName}-data-grid`,t=this.baseDocLink,hn=t}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return this.baseDocLink+(e?"/"+e:"")}},$c=new WeakMap,Yc=new WeakMap,Kc=1,qc=class{create(e,t,s,o,n,r,a){const l=M.applyGlobalGridOptions(s),c=l.gridId??String(Kc++),d=this.getRegisteredModules(r,c,l.rowModelType),u=this.createBeansList(l.rowModelType,d,c),h=this.createProvidedBeans(t,l,r);if(!u)return;const p={providedBeanInstances:h,beanClasses:u,id:c,beanInitComparator:ii,beanDestroyComparator:oi,derivedBeans:[ti],destroyCallback:()=>{Yc.delete(f),$c.delete(e),function(e){delete tn[e]}(c),a?.()}},g=new i.Gei(p);this.registerModuleFeatures(g,d),o(g),g.getBean("syncSvc").start(),n?.(g);const f=g.getBean("gridApi");return $c.set(e,f),Yc.set(f,e),f}getRegisteredModules(e,t,s){return on(jc,void 0),e?.modules?.forEach((e=>on(e,t))),function(e,t){const s=tn[e]??{};return[...Object.values(en.all??{}),...Object.values(s.all??{}),...Object.values(en[t]??{}),...Object.values(s[t]??{})]}(t,Zc(s))}registerModuleFeatures(e,t){const s=e.getBean("registry"),i=e.getBean("apiFunctionSvc");for(const e of t){s.registerModule(e);const t=e.apiFunctions;if(t){const e=Object.keys(t);for(const s of e)i?.addFunction(s,t[s])}}}createProvidedBeans(e,t,s){let o=s?s.frameworkOverrides:null;(0,i.MWY)(o)&&(o=new Uc);const n={gridOptions:t,eGridDiv:e,eRootDiv:e,globalListener:s?s.globalListener:null,globalSyncListener:s?s.globalSyncListener:null,frameworkOverrides:o,hasAncestorStyledRoot:s?.hasAncestorStyledRoot};return s?.providedBeanInstances&&Object.assign(n,s.providedBeanInstances),n}createBeansList(e,t,s){const i=Zc(e),o={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"}[i];if(!o)return void On(201,{rowModelType:i},`Unknown rowModelType ${i}.`);if(!nn(o,s,i)){const e=!1,t=`rowModelType = '${i}'`,n=e?`Unable to use ${t} as that requires the ag-grid-enterprise script to be included.\n`:`Missing module ${o}Module for rowModelType ${i}.`;return void On(200,{reasonOrId:t,moduleName:o,gridScoped:rn(),gridId:s,rowModelType:i,isUmd:e},n)}const n=new Set;for(const e of t)for(const t of e.beans??[])n.add(t);return Array.from(n)}};function Zc(e){return e??"clientSide"}function Qc(e){return e.filter((e=>null!=e))}function Jc(e){return e.sort(((e,t)=>(e.valueIndex??1/0)-(t.valueIndex??1/0))).map((e=>({colId:e.colId,aggFunc:e.aggFunc})))}var Xc={moduleName:"AlignedGrids",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t="function"==typeof e;return"function"==typeof e&&(e=e()),e.map((e=>{if(!e)return this.error(18),void(t||this.error(20));if(this.isGridApi(e))return e;const s=e;return"current"in s?s.current?.api:(s.api||this.error(19),s.api)})).filter((e=>!!e&&!e.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:e})=>this.onColumnEvent(e),alignedGridScroll:({event:e})=>this.onScrollEvent(e)})}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){"horizontal"===e.direction&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent((()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)}))}extractDataFromEvent(e,t){const s=[];return e.columns?e.columns.forEach((e=>{s.push(t(e))})):e.column&&s.push(t(e.column)),s}getMasterColumns(e){return this.extractDataFromEvent(e,(e=>e))}getColumnIds(e){return this.extractDataFromEvent(e,(e=>e.colId))}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":this.warn(21)}}))}processGroupOpenedEvent(e){const t=this.beans,s=t.colModel.colsGroupsById;for(const i of e.columnGroups){let e;i&&(e=s.get(i.getGroupId())),i&&!e||Li(t,e,i.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let s;const i=this.beans,{colResize:o,colModel:n,scrollVisibleSvc:r}=i;if(t&&(s=n.getNonPivotCol(t.getColId())),t&&!s)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":ze(i,{state:e.api.getColumnState().map((e=>({colId:e.colId}))),applyOrder:!0},"alignedGridChanged");break;case"columnVisible":ze(i,{state:e.api.getColumnState().map((e=>({colId:e.colId,hide:e.hide})))},"alignedGridChanged");break;case"columnPinned":ze(i,{state:e.api.getColumnState().map((e=>({colId:e.colId,pinned:e.pinned})))},"alignedGridChanged");break;case"columnResized":{const t=e,s=new Set((t.flexColumns??[]).map((e=>e.getColId()))),i=[];for(const e of a){const t=e.getColId();s.has(t)||i.push({key:t,newWidth:e.getActualWidth(),userSized:e.isUserSized()})}o?.setColumnWidths(i,!1,t.finished,"alignedGridChanged");for(const{key:e,newWidth:t,userSized:s}of i){const i=n.getNonPivotCol(e);i?.getActualWidth()===t&&i.setUserSized(s)}break}}const l=r.isVerticalScrollShowing();for(const e of this.getAlignedGridApis())e.setGridOption("alwaysShowVerticalScroll",l)}}],dependsOn:[Ha]};function ed(e,t,s="auto"){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s)),"ensureVisible")}function td(e,t,s){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s)),"ensureVisible")}var sd={moduleName:"RowApi",version:cn,apiFunctions:{redrawRows:function(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.redrawRows(s)))},setRowNodeExpanded:function e(t,s,i,o,n){s&&(o&&s.parent&&-1!==s.parent.level&&e(t,s.parent,i,o,n),s.setExpanded(i,void 0,n))},getRowNode:function(e,t){return e.rowModel.getRowNode(t)},addRenderedRowListener:function(e,t,s,i){e.rowRenderer.addRenderedRowListener(t,s,i)},getRenderedNodes:function(e){return e.rowRenderer.getRenderedNodes()},forEachNode:function(e,t,s){e.rowModel.forEachNode(t,s)},getFirstDisplayedRowIndex:function(e){return e.rowRenderer.firstRenderedRow},getLastDisplayedRowIndex:function(e){return e.rowRenderer.lastRenderedRow},getDisplayedRowAtIndex:function(e,t){return e.rowModel.getRow(t)},getDisplayedRowCount:function(e){return e.rowModel.getRowCount()}}},id={moduleName:"ScrollApi",version:cn,apiFunctions:{getVerticalPixelRange:function(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()},getHorizontalPixelRange:function(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()},ensureColumnVisible:ed,ensureIndexVisible:td,ensureNodeVisible:function(e,t,s=null){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,s)),"ensureVisible")}}},od={tag:"div",cls:"ag-overlay-file-input-center",children:[{tag:"div",ref:"eErrorBanner",cls:"ag-file-input-error-banner"},{tag:"div",ref:"eDropZone",cls:"ag-file-input-drop-zone"},{tag:"div",ref:"eProcessingState",cls:"ag-file-input-processing"}]},nd={moduleName:"FileInputOverlay",version:cn,userComponents:{agFileInputOverlay:class extends gc{constructor(){super(...arguments),this.eErrorBanner=i.dRA,this.eDropZone=i.dRA,this.eProcessingState=i.dRA,this.state="ready",this.dragCounter=0,this.processingToken=0}init(e){this.setTemplate(od),this.buildDropZone(e),this.showState("ready"),this.setupDragListeners(),this.gos.get("processFileInput")||(this.beans.log.warn(305),this.showError("gridOptions.processFileInput is missing"))}buildDropZone(e){const{beans:t}=this,s=this.getLocaleTextFunc(),i=e.fileInput?.overlayText??s("fileInputOverlay","Drag & Drop file to import data"),o=er("document",t,null),n={tag:"span",cls:"ag-file-input-text",children:i},r=ni({tag:"div",cls:"ag-file-input-text-row",children:o?[()=>o,n]:[n]});this.eDropZone.appendChild(r),this.appendBrowseButton(this.eDropZone),t.ariaAnnounce.announceValue(i,"overlay")}updateProcessingState(e){const{beans:t}=this,s=this.getLocaleTextFunc();(0,i.fDi)(this.eProcessingState);const o=er("overlayLoading",t,null);o&&(o.classList.add("ag-loading-icon"),this.eProcessingState.appendChild(o));const n=s("fileInputProcessing",`Processing ${e}`,[e]),r=ni({tag:"span",cls:"ag-file-input-text",children:n});this.eProcessingState.appendChild(r),t.ariaAnnounce.announceValue(n,"overlay")}showError(e){this.eErrorBanner.textContent=e,this.showState("error"),this.beans.ariaAnnounce.announceValue(e,"overlay")}appendBrowseButton(e){const t=this.getLocaleTextFunc(),s=ni({tag:"input",cls:"ag-file-input-input",attrs:{type:"file",style:"display:none"}});this.addManagedElementListeners(s,{change:()=>this.onFileInputChange(s)}),e.appendChild(s);const i=ni({tag:"button",cls:"ag-file-input-browse",attrs:{type:"button"},children:t("fileInputOverlayBrowse","Browse files")});this.addManagedElementListeners(i,{click:()=>s.click()}),e.appendChild(i)}showState(e){this.state=e;const t=this.getGui();switch((0,i.fDi)(t),e){case"error":t.appendChild(this.eErrorBanner),t.appendChild(this.eDropZone);break;case"processing":t.appendChild(this.eProcessingState);break;default:t.appendChild(this.eDropZone)}}setupDragListeners(){const e=this.getGui();this.addManagedElementListeners(e,{dragenter:e=>{this.isFileDrag(e)&&(e.preventDefault(),this.dragCounter++,1===this.dragCounter&&this.eDropZone.classList.add("ag-file-input-drop-zone-active"))},dragover:e=>{this.isFileDrag(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))},dragleave:e=>{this.isFileDrag(e)&&(e.preventDefault(),this.dragCounter--,this.dragCounter<=0&&(this.dragCounter=0,this.eDropZone.classList.remove("ag-file-input-drop-zone-active")))},drop:e=>{this.isFileDrag(e)&&(e.preventDefault(),this.dragCounter=0,this.eDropZone.classList.remove("ag-file-input-drop-zone-active"),this.handleFileList(e.dataTransfer?.files))}})}isFileDrag(e){return e.dataTransfer?.types?.includes("Files")??!1}onFileInputChange(e){this.handleFileList(e.files),e.value=""}handleFileList(e){e&&e.length>0&&this.handleFiles(Array.from(e))}handleFiles(e){if("processing"===this.state)return;const{gos:t}=this,s=t.get("processFileInput"),i=e[0].name;this.updateProcessingState(i),this.showState("processing");const o=++this.processingToken,n=e=>{if(!this.isAlive()||o!==this.processingToken)return;const s={rowData:e};"agFileInputOverlay"===t.get("activeOverlay")&&(s.activeOverlay=void 0),t.updateGridOptions({options:s,source:"api"})},r=e=>{if(!this.isAlive()||o!==this.processingToken)return;const t=this.getLocaleTextFunc(),s=e??t("fileInputProcessingFailed",`Error processing ${i}`,[i]);this.showError(s)};if(s)try{s(xe(t,{files:e,success:n,fail:r}))}catch(e){r(e instanceof Error?e.message:void 0)}else r()}}},icons:{document:"document"},dependsOn:[Ac]};function rd(e,t,s,o=new Set){const{objectValues:n="group",arrayValues:r="primitives",nullishValues:a="include"}=s,l=Object.keys(e),c=[];for(let d=0,u=l.length;d<u;++d){const u=l[d],h=e[u],p=t?`${t}.${u}`:u;if(I(h)){if(o.has(h))continue;if(o.add(h),"group"===n){const e=rd(h,p,s,o);e.length>0&&c.push({headerName:(0,i.jv)(u)??u,children:e})}else if("flatten"===n){const e=rd(h,p,s,o);c.push(...e)}}else if(Array.isArray(h)){if("skip"===r||"primitives"===r&&!ld(h))continue;c.push(ad(p,u,t,!0))}else{if(null==h){if("include"!==a)continue}else if("function"==typeof h)continue;c.push(ad(p,u,t))}}return c}function ad(e,t,s,o){const n={field:e};return s&&(n.headerName=(0,i.jv)(t)??t),o&&(n.cellDataType=!1),n}function ld(e){if(0===e.length)return!1;const t=e[0];return null!=t&&!Array.isArray(t)&&!I(t)&&"function"!=typeof t}var cd={moduleName:"AutoGenerateColumns",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="autoGenColsSvc"}postConstruct(){this.generateColumns(!0),this.addManagedPropertyListener("rowData",(()=>this.generateColumns(!1))),this.addManagedPropertyListener("autoGenerateColumnDefs",(()=>this.generateColumns(!1)))}generateColumns(e){const t=this.gos,s=t.get("autoGenerateColumnDefs");if(!s)return;const i=t.get("rowData")??[],o="object"==typeof s?s:{};let n;for(let e=0,t=i.length;e<t;++e)if(I(i[e])){n=i[e];break}if(!n)return void(e||t.updateGridOptions({options:{columnDefs:[]},source:"optionsUpdated"}));let r=rd(n,void 0,o);const a=t.getCallback("processAutoGeneratedColumnDefs");if(a){const e=a({columnDefs:r,rowData:i});Array.isArray(e)&&(r=e)}t.updateGridOptions({options:{columnDefs:r},source:"optionsUpdated"})}}],dependsOn:[nd]};function dd({colAutosize:e,visibleCols:t},s,i){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:i,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}var ud=new Set(["autosizeColumns","sizeColumnsToFit"]),hd=new Set(["columnMenu","contextMenu"]),pd=[0,100,500],gd=["dataChanged","columnsChanged","gridSizeChanged","viewportChanged"];function fd(e,t,s={}){const i=s.minWidth??e.getMinWidth();t<i&&(t=i);const o=s.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function md({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),o=t.isVerticalScrollShowing()?t.getScrollbarWidth():0;return(0,i.Wd2)(s.eGridBody)-o}var vd="ag-animate-autosize";function wd({ctrlsSvc:e,gos:t},s){if(!t.get("animateColumnResizing")||t.get("enableRtl")||!e.isAlive())return;const i=e.getGridBodyCtrl().eGridBody.classList;s?i.add(vd):i.remove(vd)}function Cd(e,t){return e===t||e.colId==t||e.colDef===t}var yd={moduleName:"ColumnAutoSize",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[],this.continuousStrategy=null,this.continuousRunning=!1,this.continuousFrameScheduled=!1,this.pendingReasons=null,this.continuousRetries=0,this.continuousRetryScheduled=!1,this.continuousEchoing=!1,this.gridSizeSettling=!1,this.runDebouncedContinuousAutoSize=(0,i.pkA)(this,(()=>{this.gridSizeSettling=!1,this.scheduleContinuousAutoSize()}),150)}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const i=t.type;if("fitGridWidth"===i||"fitProvidedWidth"===i)s=!0;else if("fitCellContents"===i){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=null!=i&&i.length>0&&B(e),s&&this.revealOnEmptyModel()}t.continuous&&this.initContinuousAutoSize(t),s&&this.beans.colDelayRenderSvc?.hideColumns(i)}}withUiActionStrategyParams(e){const{source:t}=e;if(!t||!hd.has(t))return e;const s=this.gos.get("autoSizeStrategy");return"fitCellContents"===s?.type&&s.applyToUiActions?{...e,skipHeader:s.skipHeader??e.skipHeader,defaultMinWidth:s.defaultMinWidth??e.defaultMinWidth,defaultMaxWidth:s.defaultMaxWidth??e.defaultMaxWidth,columnLimits:s.columnLimits??e.columnLimits,scaleUpToFitGridWidth:s.scaleUpToFitGridWidth??e.scaleUpToFitGridWidth}:e}autoSizeCols(e){this.autoSizeColsAsync(this.withUiActionStrategyParams(e)).then((e=>this.dispatchAutoSized(e)))}dispatchAutoSized(e){Be(this.beans.eventSvc,Array.from(e),!0,"autosizeColumns")}autoSizeColsAsync(e){const{colModel:t}=this.beans;return wd(this.beans,!0),this.innerAutoSizeCols(e).then((s=>{if(!e.scaleUpToFitGridWidth)return wd(this.beans,!1),s;const i=md(this.beans),o=e.colKeys.filter((e=>{const s=t.getCol(e);if(!s||s.colDef.suppressAutoSize||"row-number"===s.colKind)return!1;const i=s.pinned;return!(s.displayed&&("left"===i||"right"===i))}));return this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map((e=>({...e,key:e.colId}))),colKeys:o,onlyScaleUp:!0,animate:!1}),wd(this.beans,!1),s}))}innerAutoSizeCols(e){return new Promise(((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation((()=>this.innerAutoSizeCols(e).then(t,s)));const{colKeys:i,skipHeader:o,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:g,visibleCols:f}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered()))return this.timesDelayed++,void setTimeout((()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)}));this.timesDelayed=0;const m=new Set;let v=-1;const w=Object.fromEntries(c.map((({colId:e,...t})=>[e,t]))),C=o??this.gos.get("skipHeaderOnAutoSize"),y=n??C;for(;0!==v;){v=0;let e=!1;const t=[];for(const s of i){if(!s)continue;const i=p.getCol(s);if(!i||m.has(i)||i.colDef.suppressAutoSize)continue;if(xt(i))continue;const o=g.getPreferredWidthForColumn(i,C);if(o>0){const t=w[i.colId]??{};t.minWidth??(t.minWidth=l),t.maxWidth??(t.maxWidth=a);const s=fd(i,o,t);e||(e=s!==i.getActualWidth()),i.setActualWidth(s,d),m.add(i),v++}t.push(i)}t.length&&e&&f.refresh(d,!0)}y||this.autoSizeColumnGroupsByColumns(i,d,r),t(m)}))}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:i,ctrlsSvc:o}=this.beans,n=new Set;for(let t=0,o=e.length;t<o;++t){const o=i.getCol(e[t]);let r=o?.parent;for(;r&&r!=s;)r.providedColumnGroup.padding||n.add(r),r=r.parent}const r=o.getHeaderRowContainerCtrl();if(r)for(const e of n){const s=r.getHeaderCtrlForColumn(e);s?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){this.shouldQueueResizeOperations?this.pushResizeOperation((()=>this.autoSizeAllColumns(e))):this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const s=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",i);const o=new ei(e);return o.addEventListener("doubleTap",i),()=>{e.removeEventListener("dblclick",i),o.destroy()}}addColumnGroupResize(e,t,s){const i=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const e=[],o=t.getDisplayedLeafColumns();for(const t of o)t.colDef.suppressAutoSize||e.push(t.colId);e.length>0&&this.autoSizeCols({colKeys:e,skipHeader:i,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;let s=md(this.beans);s>0&&0===this.beans.visibleCols.centerCols.length&&(s=Math.max(s-50,0)),s>0?this.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout((()=>{this.sizeColumnsToFitGridBody(e,100)}),0):100===t?window.setTimeout((()=>{this.sizeColumnsToFitGridBody(e,500)}),100):500===t?window.setTimeout((()=>{this.sizeColumnsToFitGridBody(e,-1)}),500):this.warn(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations)return void this.pushResizeOperation((()=>this.sizeColumnsToFit(e,t,s,o)));const{beans:n}=this,r=o?.animate??!0;r&&wd(n,!0);const a=Object.create(null);for(const{key:e,...t}of o?.columnLimits??[])a["string"==typeof e?e:e.getColId()]=t;const l=n.visibleCols.allCols;if(e<=0||!l.length)return;const c=Ct(l);if(o?.onlyScaleUp&&c>e)return;if(e===c&&l.every((e=>{if(e.colDef.suppressSizeToFit)return!0;const t=a?.[e.getId()],s=t?.minWidth??o?.defaultMinWidth,i=t?.maxWidth??o?.defaultMaxWidth,n=e.getActualWidth();return(null==s||n>=s)&&(null==i||n<=i)})))return;const d=[],u=[];for(const e of l){const t=o?.colKeys?.some((t=>Cd(e,t)))??!0;e.colDef.suppressSizeToFit||!t?u.push(e):d.push(e)}const h=d.slice(0);let p=!1;const g=e=>{(0,i.$ii)(d,e),u.push(e)},f=Object.create(null);for(const e of d){o?.onlyScaleUp&&(f[e.colId]=e.getActualWidth()),e.resetActualWidth(t);const s=a?.[e.getId()],i=s?.minWidth??o?.defaultMinWidth??-1/0,n=s?.maxWidth??o?.defaultMaxWidth??1/0,r=e.getActualWidth(),l=_(r,i,n);l!=r&&e.setActualWidth(l,t,!0)}for(;!p;){p=!0;const s=e-Ct(u);if(s<=0)for(const e of d){const s=a?.[e.getId()]?.minWidth??o?.defaultMinWidth??e.minWidth;e.setActualWidth(s,t,!0)}else{const e=s/Ct(d);let i=s;for(let s=d.length-1;s>=0;s--){const n=d[s],r=n.colId,l=f[r],c=a?.[r],u=c?.minWidth??o?.defaultMinWidth??l,h=c?.maxWidth??o?.defaultMaxWidth,m=Math.max(u??-1/0,n.getMinWidth()),v=Math.min(h??1/0,n.getMaxWidth());let w=Math.round(n.getActualWidth()*e);w<m?(w=m,g(n),p=!1):w>v?(w=v,g(n),p=!1):0===s&&(w=i),n.setActualWidth(w,t,!0),i-=w}}}for(const e of h)e.fireColumnWidthChangedEvent(t);const m=this.beans.visibleCols;m.updateBodyWidths(m.setLeftValues(t)),s||(Be(this.eventSvc,h,!0,t),r&&wd(n,!1))}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");"fitGridWidth"!==s?.type&&"fitProvidedWidth"!==s?.type||setTimeout((()=>{if(!this.isAlive())return;const e=s.type;if(this.continuousStrategy)this.runContinuousNow("dataChanged");else if("fitGridWidth"===e){const{columnLimits:e,defaultMinWidth:t,defaultMaxWidth:i}=s,o=e?.map((({colId:e,minWidth:t,maxWidth:s})=>({key:e,minWidth:t,maxWidth:s})));this.sizeColumnsToFitGridBody({defaultMinWidth:t,defaultMaxWidth:i,columnLimits:o})}else this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(e)}))}revealOnEmptyModel(){const[e]=this.addManagedEventListeners({modelUpdated:()=>{this.beans.rowModel.getRowCount()>0||(e?.(),this.beans.colDelayRenderSvc?.revealColumns("fitCellContents"))}})}onFirstDataRendered(e){const{colIds:t,...s}=e;setTimeout((()=>{if(!this.isAlive())return;const e="autosizeColumns";this.continuousStrategy?this.runContinuousNow("dataChanged"):t?this.autoSizeCols({...s,source:e,colKeys:t}):this.autoSizeAllColumns({...s,source:e}),this.beans.colDelayRenderSvc?.revealColumns(s.type)}))}initContinuousAutoSize(e){const t="fitCellContents"===e.type;t&&"viewport"===this.gos.get("rowModelType")?this.warn(328,{rowModel:this.gos.get("rowModelType")}):(this.continuousStrategy=e,this.addManagedEventListeners({modelUpdated:e=>{(t||e.newData)&&this.scheduleContinuousAutoSize("dataChanged")},paginationChanged:e=>{(e.newPage||e.newPageSize)&&this.scheduleContinuousAutoSize("dataChanged")},cellValueChanged:()=>this.scheduleContinuousAutoSize("dataChanged"),displayedColumnsChanged:e=>{ud.has(e.source)||this.scheduleContinuousAutoSize("columnsChanged")},newColumnsLoaded:()=>this.scheduleContinuousAutoSize("columnsChanged"),gridSizeChanged:()=>this.scheduleDebouncedContinuousAutoSize("gridSizeChanged"),scrollVisibilityChanged:()=>{this.isContinuousEcho()||(this.gridSizeSettling?this.scheduleDebouncedContinuousAutoSize("gridSizeChanged"):this.scheduleContinuousAutoSize("gridSizeChanged"))}}),this.addManagedEventListeners({rowNodeDataChanged:()=>this.scheduleContinuousAutoSize("dataChanged")}),t&&e.shouldAutoSizeColumns&&this.addManagedEventListeners({virtualColumnsChanged:()=>this.scheduleDebouncedContinuousAutoSize("viewportChanged"),viewportChanged:()=>this.scheduleDebouncedContinuousAutoSize("viewportChanged"),bodyScroll:e=>{"horizontal"===e.direction&&this.scheduleDebouncedContinuousAutoSize("viewportChanged")}}))}scheduleDebouncedContinuousAutoSize(e){this.isContinuousEcho()||("gridSizeChanged"===e&&(this.gridSizeSettling=!0),(this.pendingReasons??(this.pendingReasons=new Set)).add(e),this.runDebouncedContinuousAutoSize())}isContinuousEcho(){return this.continuousRunning||this.continuousEchoing}scheduleContinuousAutoSize(e){const t=this.pendingReasons??(this.pendingReasons=new Set);e&&t.add(e),this.continuousRunning||this.continuousFrameScheduled||(this.continuousFrameScheduled=!0,(0,i.Arb)(this.beans,(()=>{this.continuousFrameScheduled=!1,this.isAlive()&&this.runContinuousAutoSize()})))}runContinuousAutoSize(){if(!this.pendingReasons?.size)return;const e=this.pendingReasons;this.pendingReasons=null,this.runContinuousNow(gd.find((t=>e.has(t))))}runContinuousNow(e){const t=this.continuousStrategy;if(!t||this.continuousRunning)return;if("fitProvidedWidth"!==t.type&&md(this.beans)<=0)return void this.retryContinuousWhenSized(e);this.continuousRetries=0;const s=this.getAutoSizeCandidates(t);if(!s.length)return;const i=t.shouldAutoSizeColumns;if(i){let t;try{t=i(xe(this.gos,{reason:e,columns:s}))}catch(e){return void this.warn(329,{error:e})}if(!t)return}this.continuousRunning=!0,this.reapplyStrategy(t,s).then((()=>this.onContinuousAutoSizeComplete()),(()=>this.onContinuousAutoSizeComplete()))}reapplyStrategy(e,t){const s=e.type;if("fitCellContents"===s){const{skipHeader:s,defaultMinWidth:i,defaultMaxWidth:o,columnLimits:n,scaleUpToFitGridWidth:r}=e;return this.autoSizeColsAsync({colKeys:t,skipHeader:s,defaultMinWidth:i,defaultMaxWidth:o,columnLimits:n,scaleUpToFitGridWidth:r,source:"autosizeColumns"}).then((e=>this.dispatchAutoSized(e)))}if("fitProvidedWidth"===s)this.sizeColumnsToFit(e.width,"sizeColumnsToFit",!1,{colKeys:t});else{const{defaultMinWidth:s,defaultMaxWidth:i,columnLimits:o}=e;this.sizeColumnsToFitGridBody({defaultMinWidth:s,defaultMaxWidth:i,colKeys:t,columnLimits:o?.map((({colId:e,minWidth:t,maxWidth:s})=>({key:e,minWidth:t,maxWidth:s})))})}return Promise.resolve()}retryContinuousWhenSized(e){const t=pd[this.continuousRetries];void 0===t||this.continuousRetryScheduled||(this.continuousRetries++,this.continuousRetryScheduled=!0,window.setTimeout((()=>{this.continuousRetryScheduled=!1,this.isAlive()&&this.runContinuousNow(e)}),t))}onContinuousAutoSizeComplete(){if(this.continuousRunning=!1,this.continuousEchoing=!0,(0,i.Arb)(this.beans,(()=>{this.continuousEchoing=!1})),this.pendingReasons?.size&&this.isAlive()){const e=this.pendingReasons;this.pendingReasons=null;for(const t of e)this.scheduleContinuousAutoSize(t)}}getAutoSizeCandidates(e){const{colModel:t,visibleCols:s}=this.beans,i="fitCellContents"===e.type,o=i?e.colIds:void 0,n=o?o.map((e=>t.getCol(e))):s.allCols,r=[];for(let e=0,t=n.length;e<t;++e){const t=n[e];if(!t||t.isUserSized()||xt(t))continue;const s=t.colDef;if(i?s.suppressAutoSize:s.suppressSizeToFit)continue;const o=t.getFlex();null!=o&&o>0||r.push(t)}return r}processResizeOperations(){this.shouldQueueResizeOperations=!1;const e=this.resizeOperationQueue;this.resizeOperationQueue=[];for(let t=0,s=e.length;t<s;++t)e[t]()}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.continuousStrategy=null,this.pendingReasons=null,this.resizeOperationQueue.length=0,super.destroy()}}],apiFunctions:{sizeColumnsToFit:function(e,t){"number"==typeof t?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)},autoSizeColumns:dd,autoSizeAllColumns:function(e,t){t&&"object"==typeof t?dd(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}},dependsOn:[ta],css:[":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}"]},bd=class extends ke{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=e=>{const{beans:t,gos:s,element:i,columns:o}=this,n=t.colHover;if(e??s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:n.setMouseOver.bind(n,o),mouseout:n.clearMouseOver.bind(n)});else{for(const e of this.destroyManagedListeners)e();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",(({currentValue:e})=>{this.enableFeature(e)})),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},Sd={moduleName:"ColumnHover",version:cn,beans:[class extends ke{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,s){const i=()=>{const e=this.isHovered(s);t.toggleCss("ag-column-hover",e)};e.addManagedEventListeners({columnHoverChanged:i}),i()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss("ag-column-hover",s)}addHeaderFilterColumnHoverListener(e,t,s,i){this.createHoverFeature(e,[s],i);const o=()=>{const e=this.isHovered(s);t.toggleCss("ag-column-hover",e)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,s){e.createManagedBean(new bd(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}}],apiFunctions:{isColumnHovered:function(e,t){return!!e.colHover?.isHovered(t)}}};function xd(e,t,s,i,o){const n=[];Pd(e,n);const r=function(e,t){let s=0;for(const i of e){const e=i.getProvidedColumnGroup();t&&e.isPadding()||(s=Math.max(s,e.getLevel()+1))}return s}(n,s),a=function(e,t,s){const i=e+(t?1:0),o=[],n=[];for(let t=0;t<i;t++)o.push({cells:[],grouping:t<e}),n.push(new Array(s).fill(!1));return{rows:o,occupied:n}}(r,i,t.length);return function(e,t,s,i,o,n){const r=new Map;for(let e=0;e<s.length;e++)r.set(s[e],e);for(const s of t){const t=s.getProvidedColumnGroup(),a=t.getLevel();if(a>=i)continue;const l=[];for(const e of s.getLeafColumns()){const s=r.get(e);null!=s&&(t.isPadding()&&o&&n&&e.isSpanHeaderHeight()||l.push(s))}Ed(e.rows[a].cells,e.occupied[a],s,l)}}(a,n,t,r,i,o),i&&function(e,t,s,i){const{rows:o,occupied:n}=e;for(let e=0;e<t.length;e++){const r=t[e],a=i?Rd(r,s):s;o[a].cells.push({type:"column",column:r,columnIndex:e,columnSpan:1,rowSpan:s-a+1}),n[a][e]=!0;for(let t=a+1;t<=s;t++)n[t][e]||(o[t].cells.push({type:"covered",columnIndex:e,columnSpan:1,rowSpan:1}),n[t][e]=!0)}}(a,t,r,o),function(e,t){const{rows:s,occupied:i}=e;for(let e=0;e<s.length;e++){const o=s[e];for(let s=0;s<t;s++)i[e][s]||o.cells.push({type:"padding",columnIndex:s,columnSpan:1,rowSpan:1});o.cells.sort(((e,t)=>e.columnIndex-t.columnIndex))}}(a,t.length),a.rows}function Rd(e,t){if(!e.isSpanHeaderHeight())return t;let s=t,i=e.getOriginalParent();for(;i;){const e=i.getLevel();i.isPadding()&&e<s&&(s=e),i=i.getOriginalParent()}return s}function Pd(e,t){for(const s of e)Ft(s)&&(t.push(s),Pd(s.children??[],t))}function Ed(e,t,s,i){i.sort(((e,t)=>e-t));let o=0;for(;o<i.length;){let n=o;for(;n+1<i.length&&i[n+1]===i[n]+1;)n+=1;const r=i[o],a=i[n]-r+1;e.push({type:s.isPadding()?"padding":"group",column:s,columnIndex:r,columnSpan:a,rowSpan:1});for(let e=r;e<r+a;e++)t[e]=!0;o=n+1}}var Id={moduleName:"SharedExport",version:cn,beans:[class extends ke{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:s,columnKeys:i,skipRowGroups:o,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:s,skipRowGroups:o,columnKeys:i,exportRowNumbers:n});return[this.prepareSession(r),this.prependContent(t),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce(((e,t)=>t(e)),e).parse()}processRow(e,t,s,i){const o=t.shouldRowBeSkipped||(()=>!1),n=null!=t.rowPositions||!!t.onlySelected,r=this.gos.get("groupHideOpenParents")&&!n,a=this.colModel.pivotMode?i.leafGroup:!i.group,l=!!i.footer,c=function(e,t){return 1===t.allChildrenCount&&1===t.childrenAfterGroup?.length&&function(e,t){const s=e.get("groupHideParentOfSingleChild");return!0===s||!("leafGroupsOnly"!==s||!t.leafGroup)||!!e.get("groupRemoveSingleChildren")||!(!e.get("groupRemoveLowestSingleChildren")||!t.leafGroup)}(e,t)}(this.gos,i);if(!a&&!l&&(t.skipRowGroups||c||r)||t.onlySelected&&!i.isSelected()||t.skipPinnedTop&&"top"===i.rowPinned||t.skipPinnedBottom&&"bottom"===i.rowPinned||i.stub)return;if(-1===i.level&&!a&&!l)return;if(o(xe(this.gos,{node:i})))return;const d=e.onNewBodyRow(i);if(s.forEach(((e,t)=>{d.onColumn(e,t,i)})),t.getCustomContentBelowRow){const s=t.getCustomContentBelowRow(xe(this.gos,{node:i}));s&&e.addCustomContent(s)}}appendContent(e){return t=>{const s=e.appendContent;return s&&t.addCustomContent(s),t}}prependContent(e){return t=>{const s=e.prependContent;return s&&t.addCustomContent(s),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportHeaders(e,t){return s=>{if(e.skipColumnGroupHeaders&&e.skipColumnHeaders)return s;let i=[];e.skipColumnGroupHeaders||(i=this.beans.colGroupSvc.createGroups(t,new Ga,null,void 0,!0));const o=xd(i,t,s.useGridHeaderLayout&&!!this.gos.get("hidePaddedHeaderRows"),!e.skipColumnHeaders,s.isSpanColumnHeader());for(const e of o){const i=e.grouping?s.onNewHeaderGroupingRow():s.onNewHeaderRow();for(const s of e.cells)i.onCell(this.withCollapsibleGroupRanges(s,t))}return s}}processPinnedTopRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter((e=>"top"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel?.getPinnedTopRow(e.rowIndex))).forEach(i):this.pinnedRowModel?.forEachPinnedRow("top",i),s}}processRows(e,t){return s=>{const i=this.rowModel,o=B(this.gos),n=z(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,s,e,t),l=this.pinnedRowModel,c=t=>{if(!e.skipPinnedRowDuplicates)return void a(t);const s=t.pinnedSibling,i=s?.rowPinned;l?.isManual()&&null!=s?.id&&i&&l.getPinnedRowById(s.id,i)===s||a(t)},{exportedRows:d="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((e=>null==e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>i.getRow(e.rowIndex))).filter((e=>null!=e)).forEach(c);else if(this.colModel.pivotMode)o?i.forEachPivotNode(c,!0,"filteredAndSorted"===d):n?i.forEachNodeAfterFilterAndSort(c,!0):i.forEachNode(c);else if(e.onlySelectedAllPages||r){const e=(this.beans.selectionSvc?.getSelectedNodes()??[]).map((e=>-1===e.level&&e.sibling?.footer?e.sibling:e));this.replicateSortedOrder(e),e.forEach(c)}else"all"===d?i.forEachNode(c):o||n?i.forEachNodeAfterFilterAndSort(c,!0):i.forEachNode(c);return s}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;const i=t.getSortOptions(),o=(e,t)=>null!=e.rowIndex&&null!=t.rowIndex?e.rowIndex-t.rowIndex:e.level===t.level?e.parent?.id===t.parent?.id?s.compareRowNodes(i,e,t)||(e.rowIndex??-1)-(t.rowIndex??-1):o(e.parent,t.parent):e.level>t.level?o(e.parent,t):o(e,t.parent);e.sort(o)}processPinnedBottomRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter((e=>"bottom"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel?.getPinnedBottomRow(e.rowIndex))).forEach(i):this.pinnedRowModel?.forEachPinnedRow("bottom",i),s}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:i=!1,columnKeys:o}=e,{colModel:n,gos:r,visibleCols:a}=this,l=n.pivotMode,c=e=>!bt(e)&&(!St(e)||i);if(o?.length){const e=[];for(let t=0,s=o.length;t<s;++t){const s=n.getCol(o[t]);s&&c(s)&&e.push(s)}return e}const d=r.get("treeData");let u;return u=t&&!l?n.colsList:a.allCols,u=u.filter((e=>c(e)&&(!(s&&!d)||!yt(e)))),u}withCollapsibleGroupRanges(e,t){if("group"!==e.type)return e;if(!e.column?.isExpandable())return e;const s=[];let i=-1;for(let o=0;o<=e.columnSpan;o++){const n=o<e.columnSpan?t[e.columnIndex+o]:void 0,r="open"===n?.getColumnGroupShow();r&&i<0?i=o:!r&&i>=0&&(s.push([i,o-1]),i=-1)}return{...e,collapsibleGroupRanges:s}}}]},kd=class extends ke{getFileName(e){const t=this.getDefaultFileExtension();return e?.length||(e=this.getDefaultFileName()),e.includes(".")?e:`${e}.${t}`}resolveFileName(e){const{fileName:t}=e,s="function"==typeof t?t(xe(this.gos,{})):t;return this.getFileName(s)}runExport(e){const{overlays:t}=this.beans;t?t.showExportOverlay(e):e()}getData(e){return this.beans.gridSerializer.serialize(this.createSerializingSession(e),e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},Fd=class{constructor(e){this.useGridHeaderLayout=!1;const{colModel:t,rowGroupColsSvc:s,colNames:i,valueSvc:o,gos:n,log:r,processCellCallback:a,processHeaderCallback:l,processGroupHeaderCallback:c,processRowGroupCallback:d,valueFrom:u,transformValues:h}=e;this.colModel=t,this.rowGroupColsSvc=s,this.colNames=i,this.valueSvc=o,this.gos=n,this.log=r,this.processCellCallback=a,this.processHeaderCallback=l,this.processGroupHeaderCallback=c,this.processRowGroupCallback=d,this.valueFrom=u||"data",this.transformValues=h??!0}isSpanColumnHeader(){return this.useGridHeaderLayout}prepare(e){}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractGroupHeaderValue(e){return(this.processGroupHeaderCallback?this.processGroupHeaderCallback(xe(this.gos,{columnGroup:e})):this.colNames.getDisplayNameForColumnGroup(e,"header"))??""}extractRowCellValue(e){const{column:t,node:s,currentColumnIndex:i,accumulatedRowIndex:o,type:n,useRawFormula:r}=e,a=0===i&&oe(this.gos,s,this.colModel.pivotMode);if(this.processRowGroupCallback&&(this.gos.get("treeData")||s.group)&&(t.isRowGroupDisplayed(s.rowGroupColumn?.colId??"")||a))return{value:this.processRowGroupCallback(xe(this.gos,{column:t,node:s}))??""};const l=this.valueSvc;if(this.processCellCallback){const e=this.valueFrom;return{value:this.processCellCallback(xe(this.gos,{accumulatedRowIndex:o,column:t,node:s,value:l.getDisplayValue(t,s,e,this.transformValues),type:n,parseValue:i=>l.parseValue(t,s,i,l.getValue(t,s,e)),formatValue:e=>(this.transformValues?l.formatTransformedValue(t,s,e):void 0)??l.formatValue(t,s,e)??e}))??""}}const c=this.gos.get("treeData"),d=-1===s.level&&s.footer,u=!0===t.showRowGroup&&(s.group||c);if(!d&&(a||u)){let e="",i=s;for(;i&&-1!==i.level;){const{value:s,valueFormatted:o}=l.getValueForDisplay({column:a?void 0:t,node:i,includeValueFormatted:!0,exporting:!0,from:this.valueFrom,transformValues:this.transformValues});e=` -> ${o??s??""}${e}`,i=i.parent}return{value:e,valueFormatted:e}}const{value:h,valueFormatted:p}=l.getValueForDisplay({column:t,node:s,includeValueFormatted:!0,exporting:!0,useRawFormula:r,from:this.valueFrom,transformValues:this.transformValues});return{value:h??"",valueFormatted:p}}getHeaderName(e,t){return e?e(xe(this.gos,{column:t})):this.colNames.getDisplayNameForColumn(t,"csv",!0)}},Dd=class extends Fd{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((e=>{this.beginNewLine(),e.forEach(((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)}))})))}onNewHeaderRow(){return this.beginNewLine(),{onCell:this.onNewHeaderCell.bind(this)}}onNewHeaderGroupingRow(){return this.onNewHeaderRow()}onNewHeaderCell(e){0!=e.columnIndex&&(this.result+=this.columnSeparator);let t="";"column"===e.type?t=this.extractHeaderValue(e.column):"covered"!==e.type&&e.column&&(t=this.extractGroupHeaderValue(e.column)),this.result+=this.putInQuotes(t),this.appendEmptyCells(e.columnSpan-1)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,s){0!=t&&(this.result+=this.columnSeparator);const i=this.extractRowCellValue({column:e,node:s,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(i.valueFormatted??i.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(this.log.warn(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},Td={moduleName:"CsvExport",version:cn,beans:[class extends kd{constructor(){super(...arguments),this.beanName="csvCreator"}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){this.isExportSuppressed()?this.warn(51):this.runExport((()=>{const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\ufeff",s],{type:"text/plain"});(0,i.w$)(this.resolveFileName(t),o)}))}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:o,gos:n,log:r}=this.beans,{processCellCallback:a,processHeaderCallback:l,processGroupHeaderCallback:c,processRowGroupCallback:d,suppressQuotes:u,columnSeparator:h,valueFrom:p,transformValues:g}=e;return new Dd({colModel:t,colNames:s,valueSvc:o,gos:n,log:r,processCellCallback:a||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:c||void 0,processRowGroupCallback:d||void 0,suppressQuotes:u||!1,columnSeparator:h||",",rowGroupColsSvc:i,valueFrom:p,transformValues:g})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}}],apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependsOn:[Id]},Ad={moduleName:"Popup",version:cn,beans:[class extends w{getDefaultPopupParent(){return this.beans.ctrlsSvc.get("gridCtrl").getGui()}callPostProcessPopup(e,t,s,i,o){const n=this.gos.getCallback("postProcessPopup");if(n){const{column:r,rowNode:a,tooltipLocation:l}=e??{};n({column:r,rowNode:a,tooltipLocation:l,ePopup:s,type:t,eventSource:i,mouseEvent:o})}}getActivePopups(){return this.popupList.map((e=>e.element))}hasAnchoredPopup(){return this.popupList.some((e=>e.isAnchored))}isStopPropagation(e){return us(e)}}]},Md=/\p{Sentence_Terminal}(?:["']|\p{Pe}|\p{Pf})*$/u,Nd=(e,t,s)=>{const i=t("tooltipValidationErrorSeparator",". ");if("inline"===s)return e.join(i);const o=[];for(let t=0,s=e.length;t<s;++t){const s=e[t].trim();s.length>0&&o.push(s)}const n=i.trimEnd();if(!Md.test(n)){const e=o.join(i);return e.length>0&&!Md.test(e)?`${e}.`:e}const r=i.slice(n.length);for(let e=0,t=o.length;e<t;++e)Md.test(o[e])||(o[e]+=n);return o.join(r)};function Ld(e){return!1===e?.tooltip?void 0:e}function Vd(e){return"whenTruncated"===e.get("tooltipShowMode")}function _d(e,t){return!0===e?t.valueFormatted??t.value:!1!==e&&null!=e?"function"==typeof e?e(t):e:void 0}function Od(e,t,s){if(void 0!==e.tooltip)return _d(e.tooltip,t);if((0,i.Qmv)(e.tooltipField)){const e=s();if(e.resolved)return e.value}const o=e.tooltipValueGetter;return o?.(t)}function Bd(e){return void 0!==e.tooltip?!1!==e.tooltip:(0,i.Qmv)(e.tooltipField)||null!=e.tooltipValueGetter}function Hd(e,t,s){if(null!=e)return s?(0,i.Ejd)(e,t):e[t]}var Gd=(e,t)=>{const s=e;return s.getTranslatedMessage?.(t)??e.message},zd=(e,t,s)=>{const i=e.editModelSvc?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,o=e.editModelSvc?.getRowValidationModel().getRowValidation(t)?.errorMessages,n=i?.length?i:o;return n?.length?Nd(n,s,"inline"):void 0},Wd=e=>{const t=e.eGui;return 0===t.children.length?t:t.querySelector(".ag-cell-value")},jd=(e,t,s)=>{if(e.editSvc?.isEditing(t,{withOpenEditor:!0}))return!1;const o=((e,t)=>{if(!Vd(e.gos))return;if(!t.isCellRenderer())return(0,i.JHD)((()=>Wd(t)));const s=t.column.colDef;return s.showRowGroup||"agGroupCellRenderer"===s.cellRenderer?(0,i.JHD)((()=>{const e=t.eGui;return e.querySelector(".ag-group-value")||e.querySelector(".ag-cell-value")||e})):t.hasActiveCellRenderer()?void 0:(0,i.JHD)((()=>Wd(t)))})(e,t);return!o||(!s||t.column.isTooltipEnabled())&&o()},Ud=class extends ke{constructor(e){super(),this.rowCtrl=e,this.tooltipFeatures=new Map,this.rendererGuards=new Map}claimRenderer(e,t){const{rendererGuards:s}=this;let i=s.get(e);return i||(i=new Hi,s.set(e,i)),t?i.claim():i.provisionalClaim()}pruneStaleElements(){const{tooltipFeatures:e,rendererGuards:t,rowCtrl:s}=this;if(0===e.size&&0===t.size)return;const i=s.getCurrentRowComp(),o=new Set([s.getCurrentRowElement()??void 0,i?.getPinnedLeftRowElement(),i?.getScrollingRowElement(),i?.getPinnedRightRowElement()]);for(const[t,s]of e)o.has(t)||(this.destroyBean(s,this.beans.context),e.delete(t));for(const[e,s]of t)o.has(e)||(s.invalidate(),t.delete(e))}setRendererTooltip(e,t,s,i,o){if(!this.isAlive()||!o.isCurrent())return;const n="FullWidthGroup"===this.rowCtrl.getRowType();if(null==s)return this.clearTooltip(e),void(n&&this.setupGroupRowsTooltip(t,e));const r=n?t.rowGroupColumn:void 0,a=n?this.getGroupColDef(t):void 0;this.setupTooltip(e,(()=>s),i,(()=>({colDef:a,column:r,rowIndex:t.rowIndex??0,node:t,data:t.data})),(()=>a))}setupGroupRowsTooltip(e,t){const s=e.rowGroupColumn,{gos:o}=this,n=this.getGroupColDef(e);if(!n)return void this.clearTooltip(t);const r=Bd(n),a=!(!1===n.tooltip||r||!n.tooltipComponent&&!n.tooltipComponentSelector);if(!r&&!a)return void this.clearTooltip(t);const{valueSvc:l}=this.beans;let c;this.setupTooltip(t,(()=>{const{value:t,valueFormatted:a}=(()=>{const t=l.getValueForDisplay({node:e,includeValueFormatted:!0,from:"edit"});return c=t.valueFormatted,t})(),d=xe(o,{location:"fullWidthRow",colDef:n,column:s,rowIndex:e.rowIndex??0,node:e,data:e.data,value:t,valueFormatted:a??void 0});return r?function(e,t,s){if(void 0!==e.tooltip)return _d(e.tooltip,t);const o=e.tooltipValueGetter;if(o)return o(t);if((0,i.Qmv)(e.tooltipField)){const e=s();if(e.resolved)return e.value}}(n,d,(()=>{const i=n.tooltipField;if(!i)return{resolved:!1};const r=e.data;if(!r)return{resolved:!0,value:t};const a=s?s.tooltipFieldContainsDots:!o.get("suppressFieldDotNotation")&&i.includes(".");return{resolved:!0,value:Hd(r,i,a)}})):t}),void 0,(()=>({colDef:n,column:s,rowIndex:e.rowIndex??0,node:e,data:e.data,valueFormatted:c??void 0})),(()=>Ld(n)))}getGroupColDef(e){const t=e.rowGroupColumn;return t?.colDef??this.gos.get("autoGroupColumnDef")}setupTooltip(e,t,s,i,o=()=>{}){const{tooltipFeatures:n,rowCtrl:r,beans:a}=this;if(!r.getCurrentRowElement())return;const l={getGui:()=>e,getTooltipComponentDefinition:o,getTooltipValue:t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s,...i?{getAdditionalParams:i}:{}},c=a.tooltipSvc.registerTooltip(this,l,n.get(e));c?n.set(e,c):n.delete(e)}clearTooltip(e){const{tooltipFeatures:t}=this,s=t.get(e);s&&this.destroyBean(s,this.beans.context),t.delete(e)}destroy(){const{context:e}=this.beans,{tooltipFeatures:t,rendererGuards:s}=this;for(const s of t.values())this.destroyBean(s,e);t.clear();for(const e of s.values())e.invalidate();s.clear(),super.destroy()}};function $d(e){const{beans:t,eGui:s,location:o,column:n,getColDef:r,getComponentTooltip:a,getDisplayName:l}=e;let c;const d=(0,i.JHD)((()=>s.querySelector(e.overflowElementSelector)));return{getGui:()=>s,getTooltipComponentDefinition:()=>{const e=r()??void 0;return null!=a().value?e:function(e){return e&&!1!==e.headerTooltip?e:void 0}(e)},getLocation:()=>o,getTooltipValue:()=>{const{value:e}=a();return function(e,t,s){if(null!=s)return s;const i=e?.headerTooltip,o=e?.headerTooltipValueGetter;return!o||void 0!==i&&"string"!=typeof i?_d(i,t):o(t)??_d(i,t)}(r(),(()=>{const e=l(),s=r();return c=e,xe(t.gos,{location:o,colDef:s,column:n,value:e,valueFormatted:e})})(),e)},shouldDisplayTooltip:()=>{const s=a().shouldDisplay;return s?s():!Vd(t.gos)||e.hasCustomHeader()||d()},getAdditionalParams:()=>{const e=r();return{column:n,...e?{colDef:e}:{},valueFormatted:c}}}}var Yd={moduleName:"Tooltip",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="tooltipSvc"}createTooltip(e){const{beans:t}=this;return t.registry.createDynamicBean("tooltipFeature",!1,e,t)}createHighlightTooltip(e,t){const{beans:s}=this;return s.registry.createDynamicBean("highlightTooltipFeature",!1,e,t,s)}registerTooltip(e,t,s){const{beans:i}=this;e.destroyBean(s,i.context);const o=this.createTooltip(t);return o?e.createBean(o,i.context):void 0}initCol(e){!function(e){const{colDef:t}=e;e.tooltipEnabled=!1!==t.tooltip&&(Bd(t)||null!=t.tooltipComponent||null!=t.tooltipComponentSelector)}(e)}setupHeaderTooltip(e,t,s){return function(e,t,s,i){if(!t.isAlive())return s;const{column:o,eGui:n}=t,r=$d({beans:e,eGui:n,location:"header",column:o,getColDef:()=>o.colDef,getComponentTooltip:i,getDisplayName:()=>e.colNames.getDisplayNameForColumn(o,"header",!0),overflowElementSelector:".ag-header-cell-text",hasCustomHeader:()=>!!o.colDef.headerComponent});return e.tooltipSvc.registerTooltip(t,r,s)}(this.beans,e,t,s)}setupHeaderGroupTooltip(e,t,s){return function(e,t,s,i){if(!t.isAlive())return s;const{column:o,eGui:n}=t,r=$d({beans:e,eGui:n,location:"headerGroup",column:o,getColDef:()=>o.getColGroupDef(),getComponentTooltip:i,getDisplayName:()=>e.colNames.getDisplayNameForColumnGroup(o,"header"),overflowElementSelector:".ag-header-group-text",hasCustomHeader:()=>!!o.getColGroupDef()?.headerGroupComponent});return e.tooltipSvc.registerTooltip(t,r,s)}(this.beans,e,t,s)}enableCellTooltipFeature(e){return this.createTooltip(function(e,t){const s=(0,i.PFX)(e.localeSvc);let o=null;const n=()=>o=((e,t,s)=>{const{column:o,rowNode:n}=t,{editSvc:r,formula:a}=e;if(o.allowFormula&&a?.active||o.isCalculatedCol&&a){const e=a.getFormulaError(o,n);if(e)return{value:Gd(e,s),location:"cellFormula",componentDefinition:o.colDef,shouldDisplay:()=>!!a.getFormulaError(o,n)}}if(!r?.isEditing(t)){const i=zd(e,t,s);if(i)return{value:i,location:"cellEditor",componentDefinition:o.colDef,shouldDisplay:()=>!r?.isEditing(t)&&!!zd(e,t,s)}}if(null!=t.rendererTooltipValue)return{value:t.rendererTooltipValue,location:"cell",componentDefinition:o.colDef,shouldDisplay:t.rendererTooltipShouldDisplay??(()=>jd(e,t,!1))};const l=o.colDef;return Bd(l)?{value:Od(l,xe(e.gos,{location:"cell",colDef:l,column:o,rowIndex:t.cellPosition.rowIndex,node:n,data:n.data,value:t.value,valueFormatted:t.valueFormatted}),(()=>((e,t,s)=>{const o=t.colDef.tooltipField;if(!o)return{resolved:!1};if(s.group&&(!s.data||!e.valueSvc.displayIgnoresAggData(s)&&void 0!==s.aggData?.[t.colId]))return{resolved:!0,value:e.valueSvc.getValueForDisplay({column:t,node:s,from:"edit",transformValues:!1}).value};const n=s.data;if(!(0,i.Qmv)(n))return{resolved:!1};const r=e.colModel.getCol(o);if(r){const t=e.editSvc?.getPendingEditValue(s,r,"batch");if(void 0!==t)return{resolved:!0,value:t}}return{resolved:!0,value:Hd(n,o,t.tooltipFieldContainsDots)}})(e,o,n))),location:"cell",componentDefinition:Ld(l),shouldDisplay:()=>jd(e,t,!0)}:null})(e,t,s);return{getGui:()=>t.eGui,getTooltipComponentDefinition:()=>(o??n())?.componentDefinition,getTooltipValue:()=>n()?.value,getLocation:()=>o?.location??"cell",shouldDisplayTooltip:()=>{const e=o??n();return!!e&&(e.shouldDisplay?.()??!0)},getAdditionalParams:()=>({column:t.column,colDef:t.column.colDef,rowIndex:t.cellPosition.rowIndex,node:t.rowNode,data:t.rowNode.data,valueFormatted:t.valueFormatted})}}(this.beans,e))}setupCellEditorTooltip(e,t){const s=function(e,t,s){const o=s.getValidationElement?.(!0)||!s.isPopup?.()&&t.eGui;if(!o)return;const n=(0,i.PFX)(e.localeSvc);return{getGui:()=>o,getTooltipComponentDefinition:()=>t.column.colDef,getTooltipValue:()=>zd(e,t,n),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const t=e.editModelSvc?.getRowValidationModel()?.getRowValidationMap(),s=e.editModelSvc?.getCellValidationModel()?.getCellValidationMap();return!!t?.size||!!s?.size},getAdditionalParams:()=>({column:t.column,colDef:t.column.colDef,rowIndex:t.cellPosition.rowIndex,node:t.rowNode,data:t.rowNode.data})}}(this.beans,e,t);return s?this.registerTooltip(e,s):void 0}createFullWidthRowTooltips(e){return this.createBean(new Ud(e))}},class extends ke{constructor(){super(...arguments),this.beanName="tooltipTouchSvc",this.targets=new Map,this.lastTouchEventTime=0}postConstruct(){const e=this.beans.eRootDiv.ownerDocument,t=new ei(e,{capture:!0,yieldsLongTap:!0,shouldTrackTouch:e=>this.startTracking(e),getLongTapTarget:e=>this.resolveLongTapTarget(e)});t.addEventListener("longTap",(({touchStart:e})=>{const t=this.selectedTarget;this.selectedTarget=void 0,t?.active&&t.show(e)}));const s=e=>{!this.gos.get("suppressTouch")&&this.getCandidates(e).length&&this.recordTouchAt(e)},i={capture:!0,passive:!0};e.addEventListener("touchend",s,i),e.addEventListener("touchcancel",s,i),this.addDestroyFunc((()=>{t.destroy(),e.removeEventListener("touchend",s,!0),e.removeEventListener("touchcancel",s,!0)}))}registerSource(e,t,s){const i={element:e,canShow:t,show:s,active:!0},o=this.targets.get(e);return o?o.push(i):this.targets.set(e,[i]),()=>this.unregisterSource(i)}isCompatibilityMouseEvent(e){const t=this.lastTouchTarget;return!(!t||Date.now()-this.lastTouchEventTime>=800)&&(e.contains(t)||t.contains(e))}recordTouchAt(e){this.lastTouchEventTime=Date.now(),this.lastTouchTarget=e.target instanceof Node?e.target:void 0}startTracking(e){if(this.selectedTarget=void 0,this.gos.get("suppressTouch"))return!1;const t=this.getCandidates(e).length>0;return t&&this.recordTouchAt(e),t}resolveLongTapTarget(e){for(const t of this.getCandidates(e))if(t.canShow())return this.selectedTarget=t,t.element;this.selectedTarget=void 0}getCandidates(e){const t=[];for(const s of this.getEventPath(e)){const e=this.targets.get(s);if(e)for(let s=e.length-1;s>=0;s--)e[s].active&&t.push(e[s])}return t}getEventPath(e){const t=e.composedPath?.();if(t?.length)return t;const s=[];let i=e.target;for(;i;)s.push(i),i=i.parentNode;return s}unregisterSource(e){e.active=!1;const t=this.targets.get(e.element);if(!t)return;const s=t.indexOf(e);s>=0&&t.splice(s,1),0===t.length&&this.targets.delete(e.element)}destroy(){this.targets.clear(),this.selectedTarget=void 0,this.lastTouchTarget=void 0,super.destroy()}}],dynamicBeans:{tooltipFeature:i.oqb,highlightTooltipFeature:i.cdx,tooltipStateManager:class extends C{postConstruct(){super.postConstruct();const e=this.beans.tooltipTouchSvc?.registerSource(this.tooltipCtrl.getGui(),(()=>this.canShowTooltip()),(e=>this.prepareToShowTooltip(e,0)));e&&this.addDestroyFunc(e)}onMouseEnter(e){this.beans.tooltipTouchSvc?.isCompatibilityMouseEvent(this.tooltipCtrl.getGui())||super.onMouseEnter(e)}createTooltipComp(e,t){const s=this.tooltipCtrl,i=function(e,t,s){return e.getCompDetails(s??{},Kt,"agTooltipComponent",t,!0)}(this.beans.userCompFactory,e,s.getTooltipComponentDefinition?.());i?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}getPopupPositionParams(){const e=this.tooltipCtrl.getAdditionalParams?.(),t=e?.column;return{column:t&&(s=t,s instanceof lt)?t:void 0,rowNode:e?.node,tooltipLocation:this.tooltipCtrl.getLocation?.()??"UNKNOWN"};var s}}},userComponents:{agTooltipComponent:i.bOs},dependsOn:[Ad],css:[".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);overflow-wrap:break-word;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-calculated-column-expression-tooltip),&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-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}}"]},Kd=class{constructor(e){this.cellValueChanges=e}},qd=class extends Kd{constructor(e,t,s,i){super(e),this.initialRange=t,this.finalRange=s,this.ranges=i}},Zd=class{constructor(e){this.actionStack=[],this.maxStackSize=e||10,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}},Qd={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},Jd=new Set(["number","text"]),Xd=class extends wa{constructor(e,t="ag-text-field",s="text"){super(e,t,s),this.clearButtonEnabled=!1}postConstruct(){super.postConstruct();const{clearButton:e,onValueClear:t,searchIcon:s}=this.config;e&&this.setClearButtonEnabled(!0),t&&this.onValueClear(t),s&&this.setSearchIcon(!0),this.addManagedPropertyListener("suppressInputClearButton",(()=>this.refreshClearButton()))}setInputType(e){super.setInputType(e),this.refreshClearButton()}setValue(e,t){const s=this.eInput;return s.value!==e&&(s.value=(0,i.Qmv)(e)?e:""),this.refreshClearButton(),super.setValue(e,t)}setClearButtonEnabled(e){return this.clearButtonEnabled=e,e&&!this.eClearButton&&this.createClearButton(),this.refreshClearButton(),this}onValueClear(e){return this.addManagedListeners(this,{fieldValueCleared:e}),this}setSearchIcon(e){this.toggleCss("ag-input-field-search",e),e&&!this.eSearchIcon&&this.createSearchIcon();const{eSearchIcon:t}=this;return t&&(0,i.nl0)(t,e,{skipAriaHidden:!0}),this}setDisabled(e){return super.setDisabled(e),this.refreshClearButton(),this}setStartValue(e){this.setValue(e,!0)}setCustomValidity(e){const t=this.eInput,s=e.length>0;t.setCustomValidity(e),s&&t.reportValidity(),(0,i.gs1)(t,s)}clearInput(){const{eInput:e}=this;e.focus(),e.value&&(this.setValue("",!0),this.dispatchLocalEvent({type:"fieldValueCleared"}))}createClearButton(){const e=(0,i.Agl)({tag:"button",cls:"ag-input-field-clear-button",attrs:{type:"button"}}),t=this.beans.iconSvc.createIconNoSpan("cancel");t&&e.appendChild(t),(0,i.PIC)(e,this.getLocaleTextFunc()("ariaLabelInputClear","Clear")),this.addManagedElementListeners(e,{mousedown:e=>e.preventDefault(),click:()=>this.clearInput()}),this.eWrapper.appendChild(e),this.eClearButton=e}createSearchIcon(){const e=this.beans.iconSvc.createIconNoSpan("search");if(!e)return;const t=(0,i.Agl)({tag:"span",cls:"ag-input-field-search-icon",attrs:{"aria-hidden":"true"}});t.appendChild(e),this.eWrapper.insertBefore(t,this.eWrapper.firstChild),this.eSearchIcon=t}refreshClearButton(){const{eClearButton:e,eInput:t}=this;if(!e||!t)return;const s=this.clearButtonEnabled&&!this.gos.get("suppressInputClearButton")&&Jd.has(t.type)&&!this.isDisabled();t.classList.toggle("ag-input-field-input-with-clear-button",s),(0,i.nl0)(e,s&&!!t.value)}},eu={selector:"AG-INPUT-TEXT-FIELD",component:Xd},tu=e=>e.stopImmediatePropagation(),su={selector:"AG-INPUT-DATE-FIELD",component:class extends Xd{constructor(e){super(e,"ag-date-field","date"),this.includeTime=!1}postConstruct(){super.postConstruct();const e=(0,i.e3J)();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}});const{includeTime:t,min:s,max:o,step:n}=this.config;null!=t&&this.setIncludeTime(t),"string"==typeof s&&this.setMin(s),"string"==typeof o&&this.setMax(o),"number"==typeof n?this.setStep(n):this.eInput.step="any"}onWheel(e){(0,i.UlD)(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?(0,i.tAb)(e??null,!!this.includeTime)??void 0:e;return this.min===t||(this.min=t,(0,i.GUt)(this.eInput,"min",t)),this}setMax(e){const t=e instanceof Date?(0,i.tAb)(e??null,!!this.includeTime)??void 0:e;return this.max===t||(this.max=t,(0,i.GUt)(this.eInput,"max",t)),this}setStep(e){return this.step===e||(this.step=e,(0,i.GUt)(this.eInput,"step",e)),this}setIncludeTime(e){return this.includeTime===e||(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1)),this}flushPendingSegment(){(0,i.lju)()&&(0,i.UlD)(this.beans)===this.eInput&&(e=>{e.addEventListener("focusout",tu,!0),e.addEventListener("focusin",tu,!0);try{e.blur(),e.focus({preventScroll:!0})}finally{e.removeEventListener("focusout",tu,!0),e.removeEventListener("focusin",tu,!0)}})(this.eInput)}getDate(){if(this.eInput.validity.valid)return(0,i.xmb)(this.getValue())??void 0}setDate(e,t){this.setValue((0,i.tAb)(e??null,this.includeTime),t)}}},iu="ag-cell-editor-input-invalid";function ou(e,t){const s=e.getInputElement(),i=()=>nu(t,s);e.addManagedElementListeners(s,{input:i,change:i,keyup:i,focus:i,blur:i}),e.addDestroyFunc((()=>t.classList.remove(iu))),i()}function nu(e,t){e.classList.toggle(iu,!t.validity.valid)}var ru=class extends xs{constructor(e){super(),this.cellEditorInput=e,this.seededText=this,this.eEditor=i.dRA}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:s}=this,{cellStartedEdit:o,eventKey:n,suppressPreventDefault:r}=e;let a;s.getInputElement().setAttribute("title",""),t.init(s,e);let l=!0,c=!1;o?(this.focusAfterAttached=!0,n===i.DDm.BACKSPACE||n===i.DDm.DELETE?a="":1===n?.length?r?l=!1:a=n:(a=t.getStartValue(),c=!0,n!==i.DDm.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=t.getStartValue(),c=!0),l&&null!=a&&s.setStartValue(a),this.seededText=c?s.getInputElement().value:this,this.addGuiEventListener("keydown",(e=>{const{key:t}=e;t!==i.DDm.PAGE_UP&&t!==i.DDm.PAGE_DOWN||e.preventDefault()}))}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;(0,i.e3J)()||t.getFocusableElement().focus();const s=t.getInputElement();this.highlightAllOnFocus?s.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),s=e.getInputElement();t.focus(),s.select()}agFlushInput(){this.cellEditorInput.flushInput?.()}isUntouched(){return this.eEditor.getInputElement().value===this.seededText}getValue(){return this.isUntouched()?this.params.value:this.cellEditorInput.getValue()}agSetEditValue(e){this.params.value=e;const t=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(t??null),this.seededText=this.eEditor.getInputElement().value}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors(this.isUntouched())}},au={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},lu=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return au}getAgComponents(){return[su]}init(e,t){this.eEditor=e,this.params=t;const{browserAutoComplete:s,min:i,max:o,step:n,colDef:r}=t;e.setAutoComplete(s),null!=i&&e.setMin(i),null!=o&&e.setMax(o),null!=n&&e.setStep(n),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(r.cellDataType),null!=this.includeTime&&e.setIncludeTime(this.includeTime)}getValidationErrors(e){const t=this.eEditor.getInputElement(),s=(0,i.xmb)(t.value),{params:o}=this,{getValidationErrors:n}=o,r=this.getInternalValidationErrors(s);return n?n({value:e?o.value:s,cellEditorParams:o,internalErrors:r}):r}getInternalValidationErrors(e){if(!e)return null;const{min:t,max:s}=this.params,o=this.getLocaleTextFunc(),n=[];if(t){const s=t instanceof Date?t:(0,i.xmb)(t);if(s&&e<s){const e=s.toLocaleDateString();n.push(o("minDateValidation",`Date must be after ${e}`,[e]))}}if(s){const t=s instanceof Date?s:(0,i.xmb)(s);if(t&&e>t){const e=t.toLocaleDateString();n.push(o("maxDateValidation",`Date must be before ${e}`,[e]))}}return n.length?n:null}flushInput(){this.eEditor.flushPendingSegment()}getValue(){const{eEditor:e,params:t}=this,s=e.getDate();return(0,i.Qmv)(s)||(0,i.Qmv)(t.value)?s??null:t.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return(0,i.tAb)(e,this.includeTime??!1)}},cu={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},du=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t,this.cachedRaw=this}getTemplate(){return cu}getAgComponents(){return[su]}init(e,t){this.eEditor=e,this.params=t;const{browserAutoComplete:s,min:i,max:o,step:n,colDef:r}=t;e.setAutoComplete(s),null!=i&&e.setMin(i),null!=o&&e.setMax(o),null!=n&&e.setStep(n),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(r.cellDataType),null!=this.includeTime&&e.setIncludeTime(this.includeTime)}getValidationErrors(e){const{eEditor:t,params:s}=this,o=(0,i.xmb)(t.getInputElement().value)??void 0,n=this.formatDate(o),r=this.getInternalValidationErrors(o);return s.getValidationErrors?s.getValidationErrors({value:e?s.value:this.parseEditorValue(n),cellEditorParams:s,internalErrors:r}):r}flushInput(){this.eEditor.flushPendingSegment()}getValue(){const e=this.formatDate(this.eEditor.getDate());return this.parseEditorValue(e)}parseEditorValue(e){const{params:t}=this;if(Object.is(this.cachedRaw,e))return this.cachedParsed;let s;return s=(0,i.Qmv)(e)||(0,i.Qmv)(t.value)?t.parseValue(e??""):t.value,this.cachedRaw=e,this.cachedParsed=s,s}getStartValue(){return(0,i.tAb)(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}getInternalValidationErrors(e){if(!e)return null;const{min:t,max:s}=this.params,o=this.getLocaleTextFunc(),n=[];if(t){const s=t instanceof Date?t:(0,i.xmb)(t);if(s&&e<s){const e=s.toLocaleDateString();n.push(o("minDateValidation",`Date must be after ${e}`,[e]))}}if(s){const t=s instanceof Date?s:(0,i.xmb)(s);if(t&&e>t){const e=t.toLocaleDateString();n.push(o("maxDateValidation",`Date must be before ${e}`,[e]))}}return n.length?n:null}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):(0,i.xmb)(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):(0,i.tAb)(e??null,this.includeTime??!1)??void 0}},uu={selector:"AG-INPUT-TEXT-AREA",component:class extends wa{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const s=super.setValue(e,t);return this.eInput.value=e,s}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}}},hu={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},pu=class extends Xd{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const t=Number.parseFloat(e.value),s=isNaN(t)?"":this.normalizeValue(t.toString());this.value!==s&&this.setValue(s)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:s,max:i,step:o}=this.config;"number"==typeof t&&this.setPrecision(t),"number"==typeof s&&this.setMin(s),"number"==typeof i&&this.setMax(i),"number"==typeof o&&this.setStep(o)}onWheel(e){(0,i.UlD)(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return""===e?"":(null!=this.precision&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const s=this.precision;if(null==s)return e;if(t){const t=Number.parseFloat(e).toFixed(s);return Number.parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=s)return e;if(s>0)return`${i[0]}.${i[1].slice(0,s)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,(0,i.GUt)(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,(0,i.GUt)(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,(0,i.GUt)(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue((e=>super.setValue(e,t)),(()=>this),e)}setStartValue(e){return this.setValueOrInputValue((e=>super.setValue(e,!0)),(e=>{this.eInput.value=e}),e)}setValueOrInputValue(e,t,s){if((0,i.Qmv)(s)){let i=this.isScientificNotation(s);if(i&&this.eInput.validity.valid)return e(s);if(i||(i=(s=this.adjustPrecision(s))!=this.normalizeValue(s)),i)return t(s)}return e(s)}getValue(e=!1){const t=this.eInput;if(!t.validity.valid&&!e)return;const s=t.value;return this.isScientificNotation(s)?this.adjustPrecision(s,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},gu={selector:"AG-INPUT-NUMBER-FIELD",component:pu},fu={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},mu=class{constructor(e){this.getLocaleTextFunc=e,this.cachedRaw=this}getTemplate(){return fu}getAgComponents(){return[gu]}init(e,t){this.eEditor=e,this.params=t;const{browserAutoComplete:s,max:i,min:o,precision:n,step:r}=t;e.setAutoComplete(s),null!=i&&e.setMax(i),null!=o&&e.setMin(o),null!=n&&e.setPrecision(n),null!=r&&e.setStep(r);const a=e.getInputElement();t.preventStepping?e.addManagedElementListeners(a,{keydown:this.preventStepping}):t.showStepperButtons&&a.classList.add("ag-number-field-input-stepper")}getValidationErrors(e){const{params:t}=this,{min:s,max:i,getValidationErrors:o}=t,n=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return"number"==typeof n&&(null!=s&&n<s&&a.push(r("minValueValidation",`Must be greater than or equal to ${s}.`,[String(s)])),null!=i&&n>i&&a.push(r("maxValueValidation",`Must be less than or equal to ${i}.`,[String(i)]))),a.length||(a=null),o?o({value:e?t.value:this.parseRaw(this.eEditor.getValue(!0)),cellEditorParams:t,internalErrors:a}):a}preventStepping(e){e.key!==i.DDm.UP&&e.key!==i.DDm.DOWN||e.preventDefault()}getValue(){return this.parseRaw(this.eEditor.getValue(!0))}parseRaw(e){const{params:t}=this;if(!(0,i.Qmv)(e)&&!(0,i.Qmv)(t.value))return t.value;if(Object.is(this.cachedRaw,e))return this.cachedParsed;const s=t.parseValue(e);let o;if(null==s)o=s;else if("string"==typeof s)if(""===s)o=null;else{const e=Number(s);o=Number.isNaN(e)?null:e}else o=Number.isNaN(s)?null:s;return this.cachedRaw=e,this.cachedParsed=o,o}getStartValue(){return this.params.value}setCaret(){(0,i.e3J)()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},vu=class extends y{constructor(e,t,s){super(((e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",cls:`ag-list-item-text ag-${e}-list-item-text`,ref:"eText",children:t}]}))(e,t)),this.label=t,this.value=s,this.eText=i.dRA}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle("ag-active-item",e),(0,i.QyW)(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const s=this.getGui();(0,i.c7o)(s,e),(0,i.awo)(s,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getTooltipComponentDefinition:()=>{},getLocation:()=>"listItem",shouldDisplayTooltip:()=>(0,i.Wh2)(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",(()=>{e.highlightItem(this)})),this.addGuiEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)})))}},wu=class extends b{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}")}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case i.DDm.ENTER:if(this.highlightedItem){const e=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case i.DDm.DOWN:case i.DDm.UP:e.preventDefault(),this.navigate(t);break;case i.DDm.PAGE_DOWN:case i.DDm.PAGE_UP:case i.DDm.PAGE_HOME:case i.DDm.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:s}=e,i=s??t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();(0,i.fDi)(this.getGui()),this.listItems=[],this.refreshAriaRole()}updateOptions(e){const t=this.options!==e;return t&&(this.clearOptions(),this.addOptions(e)),t}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const s=this.options.findIndex((t=>t.value===e));if(-1!==s){const e=this.options[s];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.listItems[s]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex((e=>e.value===this.value));-1!==e&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!(0,i.K05)(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const s=this.getGui(),{scrollTop:o,clientHeight:n}=s,{offsetTop:r,offsetHeight:a}=t;(r+a>o+n||r<o)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){this.highlightedItem?.tooltipFeature?.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){this.highlightedItem?.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const s=new vu(this.cssIdentifier,t,e);s.setParentComponent(this);const i=this.createManagedBean(s);this.listItems.push(i),this.getGui().appendChild(i.getGui())}navigate(e){const t=e===i.DDm.DOWN;let s;const{listItems:o,highlightedItem:n}=this;if(n){let e=o.indexOf(n)+(t?1:-1);e=Math.max(0,Math.min(e,o.length-1)),s=o[e]}else s=t?o[0]:(0,i.GXs)(o);this.highlightItem(s)}navigateToPage(e){const{listItems:t,highlightedItem:s}=this;if(!s||0===t.length)return;const o=t.indexOf(s),n=this.options.length-1,r=t[0].getHeight(),a=Math.floor(this.getGui().clientHeight/r);let l=-1;e===i.DDm.PAGE_HOME?l=0:e===i.DDm.PAGE_END?l=n:e===i.DDm.PAGE_DOWN?l=Math.min(o+a,n):e===i.DDm.PAGE_UP&&(l=Math.max(o-a,0)),-1!==l&&this.highlightItem(t[l])}refreshAriaRole(){(0,i.lXX)(this.getGui(),0===this.options.length?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach(((e,s)=>{e.setIndex(s+1,t)}))}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Cu={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},yu=class extends ma{constructor(e){if(super(e,e?.template||Cu,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=i.dRA,this.eWrapper=i.dRA,this.eDisplayField=i.dRA,this.eIcon=i.dRA,this.registerCSS(".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:var(--ag-picker-button-border-radius);min-height:var(--ag-picker-field-height);overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}"),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:s,variableWidth:o,minPickerWidth:n,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!o,null!=s&&this.setPickerMaxHeight(s),null!=n&&this.setPickerMinWidth(n),null!=r&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:s,inputWidth:i}=this.config;if(s){const e=this.beans.iconSvc.createIconNoSpan(s);e&&this.eIcon.appendChild(e)}null!=i&&this.setInputWidth(i)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),(0,i.oAJ)(e,!1),this.ariaRole&&(0,i.lXX)(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case i.DDm.UP:case i.DDm.DOWN:case i.DDm.ENTER:case i.DDm.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case i.DDm.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:n=!0},maxPickerHeight:r,minPickerWidth:a,maxPickerWidth:l,variableWidth:c,beans:d,eWrapper:u}=this,h={modal:n,eChild:e,closeOnEsc:!0,closedCallback:()=>{const e=(0,i.sNX)(d);this.beforeHidePicker(),e&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(s,o),anchorToElement:u};e.style.position="absolute";const p=d.popupSvc,g=p.addPopup(h);c?(a&&(e.style.minWidth=a),e.style.width=(0,i.KCH)((0,i.jPA)(u)),l&&(e.style.maxWidth=l)):(0,i.oGr)(e,l??(0,i.jPA)(u));const f=r??`${(0,i.NUe)(p.getPopupParent())}px`;return e.style.setProperty("max-height",f),this.alignPickerToComponent(),g.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:s,gos:i},eWrapper:o,pickerComponent:n}=this,r=i.get("enableRtl")?"right":"left";s.positionPopupByComponent({type:t,eventSource:o,ePopup:n.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();(0,i.oAJ)(t,e),null!=this.ariaControlsId&&(0,i.xo4)(t,e?this.ariaControlsId:null);const s=this.eWrapper.classList;s.toggle("ag-picker-expanded",e),s.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return(0,i.oGr)(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setAriaControlsId(e){this.ariaControlsId=e}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}},bu=class extends yu{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}")}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:(0,i.JHD)((()=>this.eDisplayField)),getGui:()=>this.getGui(),getTooltipComponentDefinition:()=>{},getLocation:()=>"select"})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:s}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),s&&null==t&&(this.eDisplayField.textContent=s),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new wu("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),s=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",s),(0,i.F4t)(t,this.getAriaElement().id),this.setAriaControlsId(s),e.addManagedElementListeners(e.getGui(),{mousedown:e=>{e?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem",keyboardEvent:this.commitKeyboardEvent})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){this.listComponent?.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){const{key:t}=e;switch(t===i.DDm.TAB&&this.hidePicker(),t){case i.DDm.ENTER:case i.DDm.UP:case i.DDm.DOWN:case i.DDm.PAGE_UP:case i.DDm.PAGE_DOWN:case i.DDm.PAGE_HOME:case i.DDm.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(this.commitKeyboardEvent=t===i.DDm.ENTER?e:void 0,this.listComponent?.handleKeyDown(e),this.commitKeyboardEvent=void 0):super.onKeyDown(e);break;case i.DDm.ESCAPE:super.onKeyDown(e);break;case i.DDm.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e)}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this.setValue(void 0,!0),this}updateOptions(e){return this.listComponent?.updateOptions(e)&&this.setValue(void 0,!0),this}setValue(e,t,s){const{listComponent:i,config:{placeholder:o},eDisplayField:n,tooltipFeature:r}=this;if(this.value===e||!i)return this;if(s||i.setValue(e,!0),i.getValue()===this.getValue())return this;let a=i.getDisplayValue();return null==a&&o&&(a=o),n.textContent=a,r?.setTooltipAndRefresh(a??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},Su={selector:"AG-SELECT",component:bu},xu={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Ru={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Pu=class{constructor(e){this.getLocaleTextFunc=e,this.cachedRaw=this}getTemplate(){return Ru}getAgComponents(){return[eu]}init(e,t){this.eEditor=e,this.params=t;const{maxLength:s,browserAutoComplete:i}=t;e.setAutoComplete(i),null!=s&&e.setMaxLength(s)}getValidationErrors(e){const{params:t}=this,{maxLength:s,getValidationErrors:o}=t,n=e?t.value:this.getValue(),r=this.getLocaleTextFunc();let a=[];return null!=s&&(0,i.hfN)(n,s)&&a.push(r("maxLengthValidation",`Must be ${s} characters or fewer.`,[String(s)])),a.length||(a=null),o?o({value:n,cellEditorParams:t,internalErrors:a}):a}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();if(!(0,i.Qmv)(s)&&!(0,i.Qmv)(t.value))return t.value;if(Object.is(this.cachedRaw,s))return this.cachedParsed;const o=t.parseValue(s);return this.cachedRaw=s,this.cachedParsed=o,o}getStartValue(){const e=this.params;return e.useFormatter?e.formatValue(e.value):e.value}setCaret(){(0,i.e3J)()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),s=(0,i.Qmv)(t)&&t.length||0;s&&e.getInputElement().setSelectionRange(s,s)}},Eu=class extends ru{constructor(){super(new Pu((()=>this.getLocaleTextFunc())))}};function Iu(e){const t=e;return null!=t?.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var ku=class{constructor(){this.cellValidations=new Map}getCellValidation(e){const{rowNode:t,column:s}=e||{};return this.cellValidations?.get(t)?.get(s)}hasCellValidation(e){const t=e?.rowNode;return t?e.column?!!this.getCellValidation(e):this.cellValidations.has(t):this.cellValidations.size>0}setCellValidation(e,t){const{rowNode:s,column:i}=e;this.cellValidations.has(s)||this.cellValidations.set(s,new Map),this.cellValidations.get(s).set(i,{errorMessages:[...t.errorMessages]})}clearCellValidation(e){const{rowNode:t,column:s}=e,i=this.cellValidations,o=i.get(t);o&&(o.delete(s),0===o.size&&i.delete(t))}setCellValidationMap(e){this.cellValidations=e}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},Fu=class{constructor(){this.rowValidations=new Map}getRowValidation(e){const{rowNode:t}=e||{};return this.rowValidations.get(t)}hasRowValidation(e){return e?.rowNode?!!this.getRowValidation(e):this.rowValidations.size>0}setRowValidation({rowNode:e},t){this.rowValidations.set(e,{errorMessages:[...t.errorMessages]})}clearRowValidation({rowNode:e}){this.rowValidations.delete(e)}setRowValidationMap(e){this.rowValidations=e}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}},Du=(e,t)=>{e.forEach((({editorValue:e,pendingValue:s},i)=>{const o=void 0===e?s:e;o!==Uu&&(t[i.getColId()]=o)}))};function Tu(e,t={}){const{rowIndex:s,rowId:i,rowCtrl:o,rowPinned:n}=t;if(o)return o;const{rowModel:r,rowRenderer:a}=e;let{rowNode:l}=t;return l||(i?l=function(e,t,s){const{rowModel:i,pinnedRowModel:o}=e;let n;return n??(n=i?.getRowNode(t)),s?n??(n=o?.getPinnedRowById(t,s)):(n??(n=o?.getPinnedRowById(t,"top")),n??(n=o?.getPinnedRowById(t,"bottom"))),n}(e,i,n):null!=s&&(l=r.getRow(s))),l?a.getRowCtrlByNode(l):void 0}function Au(e,t={}){const{cellCtrl:s,colId:i,columnId:o,column:n}=t;if(s)return s;const r=e.colModel.getCol(i??o??Nu(n)),a=t.rowCtrl??Tu(e,t),l=a?.getCellCtrl(r)??void 0;if(l)return l;const c=t.rowNode??a?.rowNode;return c?e.rowRenderer.getCellCtrls([c],[r])?.[0]:void 0}function Mu(e){const{editSvc:t}=e;t?.isBatchEditing()?t.stopBatchEditors(!1):t?.stopEditing(void 0,{source:"api"})}function Nu(e){if(e)return"string"==typeof e?e:e.getColId()}var Lu=(e,t,{previous:s}={})=>{const i=[];for(const[o,n]of t.cell.getCellValidationMap())for(const[t,{errorMessages:r}]of n){const n=Nd(r,e,"announcement"),a=s?.cell.getCellValidation({rowNode:o,column:t})?.errorMessages;n.length>0&&(!a||n!==Nd(a,e,"announcement"))&&i.push({rowNode:o,column:t,message:n})}const o=[];for(const[i,{errorMessages:n}]of t.row.getRowValidationMap()){const t=Nd(n,e,"announcement"),r=s?.row.getRowValidation({rowNode:i})?.errorMessages;t.length>0&&(!r||t!==Nd(r,e,"announcement"))&&o.push({rowNode:i,message:t})}return{cells:i,rows:o}},Vu=(e,t)=>e.colNames.getDisplayNameForColumn(t,"header",!0)||t.getColId(),_u=(e,t)=>{const{rowIndex:s,rowPinned:i}=t;if(null==s)return;const o={rowIndex:s,rowPinned:i??null};return Si(e)+hi(e,o)+1},Ou=(e,t)=>e("ariaRowIndex",`Row ${t}`,[String(t)]),Bu=(e,t,{cells:s,rows:i},o,n)=>{const r=new Map,a=e.visibleCols.allCols;for(let e=0,t=a.length;e<t;++e)r.set(a[e],e);const l=[];for(let i=0,n=s.length;i<n;++i){const{rowNode:n,column:a,message:c}=s[i],d=o?.get(n),u=null==d?"":`${Ou(t,d)}, `;l.push({rowNode:n,columnOrder:r.get(a)??Number.MAX_SAFE_INTEGER,rowError:!1,message:`${u}${Vu(e,a)}: ${c}`})}for(let e=0,s=i.length;e<s;++e)l.push({rowNode:i[e].rowNode,columnOrder:Number.MAX_SAFE_INTEGER,rowError:!0,message:Hu(t,i[e],o)});if(l.sort(((e,t)=>{const s=(o?.get(e.rowNode)??Number.MAX_SAFE_INTEGER)-(o?.get(t.rowNode)??Number.MAX_SAFE_INTEGER);return 0!==s?s:e.rowError!==t.rowError?e.rowError?1:-1:e.columnOrder-t.columnOrder})),n){const e=l.find((({rowError:e})=>!e));e&&(e.message=`${n} ${e.message}`)}return l.map((({message:e})=>e)).join(" ")},Hu=(e,{rowNode:t,message:s},i)=>{const o=e("ariaFullRowValidationError",`Full Row Validation: ${s}`,[s]),n=i?.get(t);return null==n?o:`${Ou(e,n)}, ${o}`},Gu=(e,{cells:t,rows:s},i,o=!1)=>{const n=new Set;for(let e=0,s=t.length;e<s;++e)n.add(t[e].rowNode);for(let e=0,t=s.length;e<t;++e)n.add(s[e].rowNode);if(0===n.size||!o&&1===n.size&&(!i||n.has(i)))return;const r=new Map;for(const t of n){const s=_u(e,t);null!=s&&r.set(t,s)}return r},zu=(e,t,{cells:s,rows:i})=>{const o=Gu(e,{cells:s,rows:i}),n=s.length>0?t("ariaValidationErrorPrefix","Cell Editor Validation"):void 0;return Bu(e,t,{cells:s,rows:i},o,n)},Wu=(e,t,s)=>{const o=(0,i.PFX)(e.localeSvc),n=Lu(o,s,{previous:t}),r=zu(e,o,n);if(r.length>0)e.ariaAnnounce.announceValue(r,"editorValidation");else if(((e,t,s)=>{for(const[i,o]of t.cell.getCellValidationMap())for(const[t,{errorMessages:n}]of o){const o=Nd(n,e,"announcement"),r=s.cell.getCellValidation({rowNode:i,column:t})?.errorMessages??[];if(o.length>0&&0===Nd(r,e,"announcement").length)return!0}for(const[i,{errorMessages:o}]of t.row.getRowValidationMap()){const t=Nd(o,e,"announcement"),n=s.row.getRowValidation({rowNode:i})?.errorMessages??[];if(t.length>0&&0===Nd(n,e,"announcement").length)return!0}return!1})(o,t,s)){const t=Lu(o,s);e.ariaAnnounce.announceValue(zu(e,o,t),"editorValidation")}},ju=(e,t)=>{const{editModelSvc:s,ariaAnnounce:o,localeSvc:n}=e;if(!s)return;const r=(0,i.PFX)(n),{cells:a,rows:l}=Lu(r,{cell:s.getCellValidationModel(),row:s.getRowValidationModel()}),c=Gu(e,{cells:a,rows:l},t,!t&&(e.editSvc?.isBatchEditing()??!1)),d=Bu(e,r,{cells:a,rows:l},c);if(0===d.length)return;const u=r("ariaFullRowEditValidationFailed",`Cannot complete row edit. ${d}`,[d]);o.announceValue(u,"editorValidation")},Uu=Symbol("unedited");function $u({pendingValue:e,sourceValue:t}){return e===Uu&&(e=t),e!==t}function Yu(e,t,s){const{key:i,event:o,cellStartedEdit:n,silent:r}=s??{},{editModelSvc:a,gos:l,userCompFactory:c}=e,d=Au(e,t),u=d?.comp?.getCellEditor(),h=qu(e,t,i,n&&!r),p=a?.getEdit(t),g=h.value??p?.sourceValue;if(u)return a?.setEdit(t,{editorValue:ah(e,g,!0,t.column),state:"editing"}),void u.refresh?.(h);const f=t.column.getColDef(),m=is(c,f,h);if(!m)return;const{popupFromSelector:v,popupPositionFromSelector:w}=m,C=v??!!f.cellEditorPopup,y=w??f.cellEditorPopupPosition;if(Xu(m.params,o),!d)return;const{rowCtrl:b,comp:S}=d,{cellStartedEditing:x,cellStoppedEditing:R}=(r?p?.editorState:void 0)??{};a?.setEdit(t,{editorValue:ah(e,g,!0,t.column),state:"editing",editorState:{cellStartedEditing:x,cellStoppedEditing:R}}),d.editCompDetails=m,e.editSvc?.invalidateEditorsValidation(),S?.setEditDetails(m,C,y,l.get("reactiveCustomComponents")),b?.refreshRow({suppressFlash:!0}),d.refreshNoteState(),function(e,t,s,i,o){const{editSvc:n,editModelSvc:r}=e,a=r?.getEdit(t);o||"editing"!==a?.state||a?.editorState?.cellStartedEditing||(n?.dispatchCellEvent(t,s,"cellEditingStarted",{value:i}),r?.setEdit(t,{editorState:{cellStartedEditing:!0}}))}(e,t,o,g,r)}function Ku(e,t,s,i){const o={editorValueExists:!1};if(s?.isCancelling)return o;if(void 0===i&&e.editSvc.hasValidationRules()){const e=t.getValidationErrors?.();i=(e?.length??0)>0}if(i)return o;if(s?.isStopping){const e=t.isCancelAfterEnd?.();if(e)return{...o,isCancelAfterEnd:e}}return{editorValue:t.getValue(),editorValueExists:!0}}function qu(e,t,s,i){const{valueSvc:o,gos:n,editSvc:r}=e,a=e.gos.get("enableGroupEdit"),l=Au(e,t),c=t.rowNode?.rowIndex??void 0,d=r?.isBatchEditing(),u=e.colModel.getCol(t.column),{rowNode:h,column:p}=t,g=l.comp?.getCellEditor(),f=r?.getCellDataValue(t),m=void 0===f?g?Ku(e,g)?.editorValue:void 0:f,v=m===Uu?o.getDisplayValue(u,h,"edit",!1):m;let w=a?m:v;return u.allowFormula&&e.formula?.isFormula(w)&&(w=e.formula?.normaliseFormula(w,!0)??w),xe(n,{value:w,eventKey:s??null,column:p,colDef:p.getColDef(),rowIndex:c,node:h,data:h.data,cellStartedEdit:!!i,onKeyDown:l?.onKeyDown.bind(l),stopEditing:(s,i)=>{r.stopEditing(t,{source:d?"ui":"api",suppressNavigateAfterEdit:s,event:i}),r.cellEditingInvalidCommitBlocks()&&e.editModelSvc?.hasValidationErrors({rowNode:h})||ch(e,t,{})},eGridCell:l?.eGui,parseValue:e=>o.parseValue(u,h,e,l?.value),formatValue:l?.formatValue.bind(l),validate:()=>{gh(e)}})}function Zu(e,t,s,i,o){(o||"editing"!==i.state&&i.pendingValue!==Uu)&&($u(i)||e.removeEdits({rowNode:t,column:s}))}function Qu(e,t){const{editModelSvc:s}=e;s?.getEditMap()?.forEach(((e,i)=>{e.forEach(((e,o)=>Zu(s,i,o,e,t)))}))}function Ju(e,t,s){const{editModelSvc:i}=e;if(!i)return;const o=i.getEdit(t);o&&Zu(i,t.rowNode,t.column,o,s)}function Xu(e,t){return t instanceof KeyboardEvent&&"agNumberCellEditor"===e.column.getColDef().cellEditor?e.suppressPreventDefault=["-","+",".","e"].includes(t?.key??"")||e.suppressPreventDefault:t?.preventDefault?.(),e}function eh(e){const t=e.editModelSvc;if(!t?.hasOpenEditors())return;const s={};t.getEditMap()?.forEach(((t,i)=>{s.rowNode=i;for(const i of t.keys()){s.column=i;const t=Au(e,s)?.comp?.getCellEditor();t&&Iu(t).agFlushInput?.()}}))}var th=(e,t,s)=>{let i=e.get(t);return void 0===i&&(i=[...s.getValidationErrors?.()??[]],e.set(t,i)),i},sh=(e,t,s=new Map)=>{for(const i of e.rowRenderer.getCellCtrls()){const e=i.comp?.getCellEditor();if(!e)continue;const o=Iu(e),n=th(s,e,o);t?.(i,o,n)}return s},ih=(e,t,s)=>{const i={};e.editModelSvc?.getEditMap()?.forEach(((o,n)=>{i.rowNode=n;for(const n of o.keys())i.column=n,oh(e,i,t,s)}))},oh=(e,t,s,i)=>{const o=Au(e,t)?.comp?.getCellEditor();if(!o)return;const n=i?.get(o),r=void 0===n?void 0:n.length>0,{editorValue:a,editorValueExists:l,isCancelAfterEnd:c}=Ku(e,o,s,r);if(c){const{cellStartedEditing:s,cellStoppedEditing:i}=e.editModelSvc?.getEdit(t)?.editorState||{};e.editModelSvc?.setEdit(t,{editorState:{isCancelAfterEnd:c,cellStartedEditing:s,cellStoppedEditing:i}})}rh(e,t,a,!l,s)};function nh(e,t,s,i){rh(e,t,s,!1,i)}function rh(e,t,s,i,o){const{editModelSvc:n,valueSvc:r}=e;if(!n)return;const{rowNode:a,column:l}=t;let c=n.getEdit(t);if(void 0===c?.sourceValue){const s=c?ah(e,c.editorValue,!1,l):Uu,i={sourceValue:r.getValueFromData(l,a),pendingValue:s};o?.persist&&(i.state="changed"),c=n.setEdit(t,i)}n.setEdit(t,{editorValue:i?ah(e,c.sourceValue,!0,l):s}),o?.persist&&function(e,t){const{editModelSvc:s}=e,i=s?.getEdit(t),o={pendingValue:ah(e,i?.editorValue,!1,t.column)};i?.editorState?.cellStoppedEditing||"editing"===i?.state||(o.state="changed"),s?.setEdit(t,o)}(e,t)}function ah(e,t,s,i){const{formula:o}=e;return i.allowFormula&&o?.isFormula(t)?o?.normaliseFormula(t,s)??t:t}function lh(e,t,s={},i){for(let o=0,n=t.length;o<n;++o)ch(e,t[o],s,void 0,i)}function ch(e,t,s,i=Au(e,t),o){const n=e.editModelSvc;i&&e.editSvc?.clearPendingEditorAttachValidation(i);const r=n?.getEdit(t);let a;if(a=r&&"editing"!==r.state&&r.editorState?.cellStoppedEditing?r.state:"changed",!i){if(r){n?.getCellValidationModel().clearCellValidation(t),n?.setEdit(t,{state:a}),dh(e,t,r,s);const i=Tu(e,{rowNode:t.rowNode});i&&e.editSvc?.applyRowEditStyles(i)}return}const l=i.comp,c=l?.getCellEditor();if(l&&!c)return i?.refreshCell(),void(r&&(n?.setEdit(t,{state:a}),dh(e,t,r,s)));if(!s.cancel&&e.editSvc.hasValidationRules()){const e=c?o?.get(c):void 0,s=r&&(e??c?.getValidationErrors?.()),i=n?.getCellValidationModel();s?.length?i?.setCellValidation(t,{errorMessages:s}):i?.clearCellValidation(t)}r&&n?.setEdit(t,{state:a}),l?.setEditDetails(),l?.refreshEditStyles(!1,!1),i?.refreshCell({force:!0,suppressFlash:!0}),dh(e,t,r,s)}var dh=(e,t,s,i)=>{const o=e.editModelSvc?.getEdit(t);if(!o||"editing"===o.state)return;const n=i?.cancel,r=e.gos.get("enableGroupEdit")?function(e,t){const{sourceValue:s,pendingValue:i}=e;let o;return t||i===Uu||(o=i),{valueChanged:!t&&$u(e),newValue:o,oldValue:s,value:s}}(o,n):function(e,t,s){if(s||e.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:e.sourceValue};let i=e.editorValue;return null!=i&&i!==Uu||(i=t?.pendingValue),i===Uu&&(i=void 0),{valueChanged:$u(e),newValue:i,oldValue:e.sourceValue}}(o,s,n);!function(e,t,s,{silent:i,event:o}={}){const{editSvc:n,editModelSvc:r}=e,a=r?.getEdit(t),{editorState:l}=a||{},{isCancelBeforeStart:c,cellStartedEditing:d,cellStoppedEditing:u}=l||{};i||c||!d||u||(n?.dispatchCellEvent(t,o,"cellEditingStopped",s),r?.setEdit(t,{editorState:{cellStoppedEditing:!0}}))}(e,t,r,i)};function uh(e,t,s){const o=e.editSvc;if(!(t||o?.hasValidationRules()||e.editModelSvc?.hasValidationErrors()))return new Map;const n=new ku,{editModelSvc:r}=e,a=r?.getCellValidationModel(),l=r?.getRowValidationModel(),c=(0,i.PFX)(e.localeSvc),d=new Set;s=sh(e,((e,t,s)=>{const{rowNode:o,column:r}=e,a=s.length>0,l=t.getValidationElement?.(!1)||!t.isPopup?.()&&e.eGui;if(l){const t=a?Nd(s,c,"inline"):"";if((0,i.gs1)(l,a),l instanceof HTMLInputElement){l.setCustomValidity(t);const s=e.eGui;s.classList.contains(iu)&&nu(s,l)}else l.classList.toggle("invalid",a)}a&&n.setCellValidation({rowNode:o,column:r},{errorMessages:s}),d.add(e.rowCtrl)}),s),ih(e,{persist:!1},s),r?.setCellValidationModel(n),hh(e),r&&a&&l&&Wu(e,{cell:a,row:l},{cell:n,row:r.getRowValidationModel()});for(const e of d.values()){o?.applyRowEditStyles(e);for(const t of e.getAllCellCtrls())t.tooltipFeature?.refreshTooltip(!0),t.editorTooltipFeature?.refreshTooltip(!0),o?.applyCellEditStyles(t)}return s}var hh=e=>{"fullRow"===e.gos.get("editType")&&e.editModelSvc?.setRowValidationModel(ph(e))},ph=e=>{const t=new Fu,s=e.gos.get("getFullRowEditValidationErrors"),i=e.editModelSvc?.getEditMap();if(!s||!i)return t;for(const[e,o]of i){const i=[],{rowIndex:n,rowPinned:r}=e;for(const[e,t]of o){const{editorValue:s,pendingValue:o,sourceValue:a}=t,l=s??(o===Uu?void 0:o)??a;i.push({column:e,colId:e.getColId(),rowIndex:n,rowPinned:r,oldValue:a,newValue:l})}const a=s({editorsState:i})??[];a.length>0&&t.setRowValidation({rowNode:e},{errorMessages:a})}return t};function gh(e){return uh(e,!0),fh(e)}function fh(e){const t=e.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!t)return null;const s=[];return t.forEach(((e,t)=>{e.forEach((({errorMessages:e},i)=>{s.push({column:i,rowIndex:t.rowIndex,rowPinned:t.rowPinned,messages:e??null})}))})),s}var mh=fh,vh={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},wh=class extends S{constructor(e){super(vh),this.params=e}postConstruct(){Q(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{No(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}};function Ch(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function yh(e,t){const s=t.column,i=t.rowNode,o=s.getColDef();if(s.isCalculatedCol)return!1;if(!i)return Ch(e,t);if(G(e.gos,i))return!1;const n=o.editable;return i.group&&null!=o.groupRowEditable?!!e.rowGroupingEditValueSvc?.isGroupCellEditable(i,s)||Ch(e,t):!!s.isColumnFunc(i,n)||Ch(e,t)}var bh=(e,t=!1)=>{if(void 0!==e)return $u(e)||t&&"editing"===e.state};function Sh(e,t,s=!1){return bh(e.editModelSvc?.getEdit(t),s)}var xh=(e,t,s)=>{if(e)for(let i=0,o=e.length;i<o;++i){const o=e[i];if(o.data&&(bh(t?.getCellEdit(o,s))||bh(t?.getCellEdit(o.pinnedSibling,s))))return!0;if(xh(o.childrenAfterGroup,t,s))return!0}};function Rh(e,t){const{column:s,rowNode:i}=t;return!(e.gos.get("groupTotalRow")&&!i?.footer)&&xh(i?.childrenAfterGroup,e.editModelSvc,s)}function Ph(e,{rowNode:t,column:s}){if(t=t.pinnedSibling)return bh(e.editModelSvc?.getCellEdit(t,s))}function Eh(e,t){if(!t.comp)return;const{editSvc:s,editModelSvc:i}=e;s?.isBatchEditing()&&s.isEditing()?Ih(e,t,Sh(e,t)||Rh(e,t)||Ph(e,t)):Ih(e,t,!1);const o=!!i?.getCellValidationModel().hasCellValidation(t);t.comp.toggleCss("ag-cell-editing-error",o)}function Ih(e,t,s){t.comp.toggleCss("ag-cell-editing",s??!1),t.comp.toggleCss("ag-cell-batch-edit",(s&&e.editSvc?.isBatchEditing())??!1)}function kh(e,t,s=!1,i=!1){const o=!!e.editSvc?.isBatchEditing(),n="fullRow"===e.gos.get("editType"),r=t.getGui()?.rowComp;r&&(r.toggleCss("ag-row-editing",n&&i),r.toggleCss("ag-row-batch-edit",n&&i&&o),r.toggleCss("ag-row-inline-editing",i),r.toggleCss("ag-row-not-inline-editing",!i),r.toggleCss("ag-row-editing-invalid",n&&i&&s))}var Fh=(e,t)=>{const s=e.editModelSvc,i=e.editSvc,o={cancel:!0},n=s.getCellValidationModel(),r=new Set;for(let i=0,a=t.length;i<a;++i){const a=t[i];ch(e,a,o),n.clearCellValidation(a),s.removeEdits(a),r.add(a.rowNode)}const a=new Set,l=s.getRowValidationModel();let c=!1;for(const e of r)s.getEditRow(e)?.size?c=!0:(a.add(e),l.clearRowValidation({rowNode:e}));c&&uh(e);for(const t of r){const s=Tu(e,{rowNode:t});s&&i.applyRowEditStyles(s)}a.size&&i.releasePurgedRows(a)},Dh=new Set(["undo","redo","paste","bulk","rangeSvc"]),Th=new Set(["ui","api"]),Ah={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Mh=new Set(Object.keys(Ah)),Nh=new Set(["paste","rangeSvc","cellClear","redo","undo"]),Lh={cancel:!0,source:"api"},Vh={cancel:!1,source:"api"},_h={checkSiblings:!0},Oh={force:!0,suppressFlash:!0},Bh={force:!0};function Hh(e,t){return t??e.get("editType")??"singleCell"}var Gh=(e,t,s)=>{let i=e.get(t);return i||(i=new Set,e.set(t,i)),!i.has(s)&&(i.add(s),!0)},zh=(e,t,s,i,o,n)=>{if(n&&!Gh(n,t,s))return;const r=Au(e,{rowNode:t,column:s});r&&(r.refreshCell(i),!i.force&&o&&Eh(e,r))},Wh=class extends ke{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const s=e.previousParams,{editSvc:i,beans:o}=this,n="cellFocused"===e.type?e.sourceEvent:null;s&&(t=Au(o,s));const{gos:r,editModelSvc:a}=o,l="cellFocusCleared"===e.type;if(i.isEditing(void 0,{withOpenEditor:!0})){const{column:t,rowIndex:c,rowPinned:d}=e,u={column:t,rowNode:ci(o,{rowIndex:c,rowPinned:d})},h="block"===r.get("invalidEditValueMode");if(h)return;const p=!h,g=!!a?.getCellValidationModel().hasCellValidation(u),f=p&&g;!s&&!l||i.stopEditing(void 0,{cancel:f,source:l&&p?"api":void 0,event:n})||(i.isBatchEditing()?i.cleanupEditors():i.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e,t){const s=this.editSvc.isBatchEditing()&&!e;for(const e of this.model.getEditPositions())ch(this.beans,e,{cancel:!0},Au(this.beans,e),t),this.model.stop(e,s,!0);return!0}stopCommitted(e,t,s){const i=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const e of i)o.all.push(e),(this.model.getCellValidationModel().getCellValidation(e)?.errorMessages?.length??0)>0?o.fail.push(e):o.pass.push(e);const n=this.processValidationResults(o),r=this.editSvc.isBatchEditing()&&!t;for(const t of n.destroy)ch(this.beans,t,{event:e},Au(this.beans,t),s),this.model.stop(t,r,!1);for(const e of n.keep){const t=Au(this.beans,e);!this.editSvc.cellEditingInvalidCommitBlocks()&&t&&this.editSvc.revertSingleCellEdit(t)}return!0}cleanupEditors({rowNode:e}={},t,s){ih(this.beans,{persist:!1},s);const i=this.model.getEditPositions(),o=[];if(e)for(const t of i)t.rowNode!==e&&o.push(t);else for(const e of i)o.push(e);lh(this.beans,o,{},s),Qu(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}focusFirstInvalidCell(e,t){const s=jh(this.beans,this.model,e.rowNode)??e;s.focusCell({forceBrowserFocus:!0,sourceEvent:t}),s.isCellEditable()&&this.setFocusInOnEditor(s)}setFocusInOnEditor(e){const t=e.comp,s=t?.getCellEditor();if(s?.focusIn)s.focusIn();else{const t="fullRow"===this.beans.gos.get("editType");e.focusCell({forceBrowserFocus:t}),this.editSvc.focusEditorOnAttach(e,!1)}}setupEditors(e){const{event:t,ignoreEventKey:s=!1,startedEdit:i,position:o,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!s&&t.key||void 0;!function(e,t,s,i,o,n){0===t.length&&s?.rowNode&&s?.column&&Yu(e,s,{key:i,event:o,cellStartedEdit:n});const{valueSvc:r,editSvc:a,editModelSvc:l}=e,{rowNode:c,column:d}=s??{},u=new Map;for(const h of t){const{rowNode:t,column:p}=h,g=Au(e,h);if(!g){if(t&&p){const o=r.getValueFromData(p,t),n=(s?.rowNode===t&&s?.column===p&&i||void 0)??a?.getCellDataValue(h)??r.getDisplayValue(p,t,"edit",!1)??o??Uu;l?.setEdit(h,{pendingValue:ah(e,n,!1,p),sourceValue:o,state:"editing"})}continue}const f=n&&c===g.rowNode&&g.column===d;a.withEditorAttachValidationCache(u,g,(()=>Yu(e,{rowNode:c,column:g.column},{key:f?i:null,event:f?o:null,cellStartedEdit:f&&n})))}}(this.beans,n,o,r,t,i)}dispatchCellEvent(e,t,s,i){const{beans:o}=this,n=Au(o,e),r=n?n.value:o.valueSvc.getDisplayValue(e.column,e.rowNode,"edit",!1);this.eventSvc.dispatchEvent({...Wl(o,t??null,s,e,r),...i})}dispatchRowEvent(e,t,s){if(s)return;const i=Tu(this.beans,e);this.eventSvc.dispatchEvent(i?i.createRowEvent(t):Ts(e.rowNode,this.gos,t))}shouldStop(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return!(!o||"api"!==s)||(!o||"ui"!==s&&"edit"!==s)&&("api"===s||(t instanceof KeyboardEvent&&!o?t.key===i.DDm.ENTER:null))}shouldCancel(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return t instanceof KeyboardEvent&&!o&&t.key===i.DDm.ESCAPE||(!(!o||"api"!==s)||"api"===s)}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const s=[];e.forEach(((e,t)=>{e.forEach(((e,i)=>{"editing"===e.state&&s.push({...e,rowNode:t,column:i})}))}));let i=e;if(t?.update){const t=new Map(e);this.model.getEditMap()?.forEach(((e,s)=>{t.has(s)||t.set(s,e)})),i=t}if(this.model?.setEditMap(i),s.length>0){const e=s.at(-1),t=e.pendingValue===Uu?void 0:e.pendingValue;this.start({position:e,event:new KeyboardEvent("keydown",{key:t}),source:"api"});const i=Au(this.beans,e);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},jh=(e,t,s)=>{const i=t.getCellValidationModel().getCellValidationMap().get(s);if(!i)return;const o=e.visibleCols.allCols;let n;for(let e=0,t=o.length;e<t;++e){const t=o[e];if(i.has(t)){n=t;break}}if(!n)return;return Au(e,{rowNode:s,column:n})||(e.navigation?.ensureColumnVisible(n),Au(e,{rowNode:s,column:n}))},Uh={moduleName:"EditCore",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="editModelSvc",this.edits=new Map,this.editingCount=0,this.cellValidations=new ku,this.rowValidations=new Fu,this.suspendEdits=!1}suspend(e){this.suspendEdits=e}hasOpenEditors(){return this.editingCount>0}removeEdits({rowNode:e,column:t}){if(!this.hasEdits({rowNode:e})||!e)return;const s=this.getEditRow(e);t?("editing"===s.get(t)?.state&&this.editingCount--,s.delete(t)):(s.forEach((e=>{"editing"===e.state&&this.editingCount--})),s.clear()),0===s.size&&this.edits.delete(e)}getEditRow(e,t){if(this.suspendEdits)return;if(0===this.edits.size)return;const s=e&&this.edits.get(e);if(s)return s;if(t){const t=e.pinnedSibling;if(t)return this.getEditRow(t)}}getEditRowDataValue(e){if(!e||0===this.edits.size)return;const t=this.getEditRow(e),s=e.pinnedSibling,i=s?this.getEditRow(s):void 0;if(!t&&!i)return;const o={...e.data};return t&&Du(t,o),i&&Du(i,o),o}getEdit(e={}){return this.getCellEdit(e.rowNode,e.column)}getCellEdit(e,t){const s=this.edits;if(0!==s.size&&!this.suspendEdits&&e&&t)return s.get(e)?.get(t)}getCellEditWithSibling(e,t){return this.getCellEdit(e,t)??this.getCellEdit(e?.pinnedSibling,t)}getEditMap(){return this.suspendEdits?null:this.edits}getEditMapCopy(){const e=new Map;return this.suspendEdits||this.edits.forEach(((t,s)=>{const i=new Map;t.forEach((({editorState:e,...t},s)=>i.set(s,{...t}))),e.set(s,i)})),e}setEditMap(e){const t=new Map;let s=0;e.forEach(((e,i)=>{const o=new Map;e.forEach(((e,t)=>{"editing"===e.state&&s++,o.set(t,{...e})})),t.set(i,o)}));const i=this.edits;i.clear(),t.forEach(((e,t)=>i.set(t,e))),this.editingCount=s}setEdit(e,t){const{rowNode:s,column:i}=e,o=this.edits;let n=o.get(s);n||(n=new Map,o.set(s,n));const r=n.get(i),a={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...this.suspendEdits?void 0:r,...t},l="editing"===r?.state,c="editing"===a.state;return l!==c&&(this.editingCount+=c?1:-1),n.set(i,a),a}clearEditValue(e){const{rowNode:t,column:s}=e;if(!t)return;const i=e=>{"editing"===e.state&&this.editingCount--,e.editorValue=void 0,e.pendingValue=e.sourceValue,e.state="changed"};if(!s)return void this.getEditRow(t)?.forEach(i);const o=this.getEdit(e);o&&i(o)}getState(e){if(!this.suspendEdits)return this.getEdit(e)?.state}getEditPositions(e){if(this.suspendEdits||0===(e??this.edits).size)return[];const t=[];return(e??this.edits).forEach(((e,s)=>{for(const i of e.keys()){const{editorState:o,...n}=e.get(i);t.push({rowNode:s,column:i,...n})}})),t}hasRowEdits(e,t){return!this.suspendEdits&&(0!==this.edits.size&&!!this.getEditRow(e,t))}hasEdits(e={},t={}){if(this.suspendEdits)return!1;if(0===this.edits.size)return!1;const{rowNode:s,column:i}=e,{withOpenEditor:o}=t;if(s){const n=this.getEditRow(s,t.checkSiblings);return!!n&&(i?o?"editing"===this.getEdit(e)?.state:n.has(i):0!==n.size&&(!o||Array.from(n.values()).some((({state:e})=>"editing"===e))))}return o?this.hasOpenEditors():this.edits.size>0}start(e){const{rowNode:t,column:s}=e;let i=this.edits.get(t);i||(i=new Map,this.edits.set(t,i)),s&&!i.has(s)&&(i.set(s,{editorValue:void 0,pendingValue:Uu,sourceValue:this.beans.valueSvc.getValueFromData(s,t),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}}),this.editingCount++)}stop(e,t,s){if(this.hasEdits(e))if(t){const t=this.getEditRow(e.rowNode)?.get(e.column);!t||t.pendingValue!==Uu&&t.pendingValue!==t.sourceValue?t&&s&&(t.editorValue=void 0):this.removeEdits(e)}else this.removeEdits(e)}clear(){for(const e of this.edits.values())e.clear();this.edits.clear(),this.editingCount=0}hasValidationErrors(e){return this.rowValidations.hasRowValidation(e)||this.cellValidations.hasCellValidation(e)}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(e){this.cellValidations=e}setRowValidationModel(e){this.rowValidations=e}destroy(){super.destroy(),this.clear()}},class extends ke{constructor(){super(...arguments),this.beanName="editSvc",this.committing=!1,this.csrm=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0,this.stopBlockRejected=!1,this.validationConfigVersion=-1,this.validationConfigResult=!1,this.pendingEditorAttachValidation=new WeakMap,this.pendingEditorFocus=null,this.pendingEditorFocusCell=!1,this.bulkWriteDepth=0,this.bulkWriteTouched=[]}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.csrm=B(this.gos,e.rowModel),this.addManagedPropertyListener("getFullRowEditValidationErrors",(()=>{this.validationConfigVersion=-1})),this.addManagedPropertyListener("editType",(({currentValue:e})=>{this.stopEditing(void 0,Lh),this.createStrategy(e)}));const t=(e=>()=>{const t=e.editModelSvc?.getEditMap();if(!t?.size)return;const s=e.pinnedRowModel;let i;t.forEach(((e,t)=>{const o=t.rowPinned,n=t.id;if(null!=o&&null!=n&&s?.getPinnedRowById(n,o)!==t)for(const s of e.keys())i??(i=[]),i.push({rowNode:t,column:s})})),i&&Fh(e,i)})(e),s=()=>{if(!this.isEditing())return;const t=this.revalidate();this.checkValidated()?this.stopEditing(void 0,Lh,t):this.batch?lh(e,this.model.getEditPositions(),{},t):this.stopEditing(void 0,Vh,t)};this.addManagedEventListeners({pinnedRowsChanged:t,pinnedRowDataChanged:t,sortChanged:s,filterChanged:s,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){this.batch||(this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,Lh))}stopBatchEditing(e){this.batch&&(e&&(this.stopEditing(void 0,e),e.commit&&this.stopBlockRejected)||(this.batchStartDispatched&&this.dispatchBatchStopped(new Map,!1),this.batch=!1,this.batchStartDispatched=!1))}stopBatchEditors(e){const{beans:t,model:s}=this;let i;if(e){const e=s.getEditPositions();this.strategy?.stopCancelled(!1);for(let t=0,s=e.length;t<s;++t)this.bulkRefreshCell(e[t],{force:!0,suppressFlash:!0});this.clearValidationIfNoOpenEditors()}else{if(this.cellEditingInvalidCommitBlocks()){if(i=this.revalidate(),this.checkValidated())return}else this.hasValidationRules()&&(i=(e=>sh(e))(t));ih(t,{persist:!0},i),lh(t,s.getEditPositions(),{cancel:e},i),this.clearValidationIfNoOpenEditors()}}ensureBatchStarted(){this.batch&&!this.batchStartDispatched&&(this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map))}createStrategy(e){const{beans:t,gos:s,strategy:i}=this,o=Hh(s,e);if(i){if(i.beanName===o)return i;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,s,o="ui"){const n=function(e,{column:t},s,o,n="ui"){if(s instanceof KeyboardEvent&&(s.key===i.DDm.TAB||s.key===i.DDm.ENTER||s.key===i.DDm.F2||s.key===i.DDm.BACKSPACE&&o))return!0;if(s?.shiftKey&&0!=e.rangeSvc?.getCellRanges().length)return!1;const r=t?.getColDef(),a=function(e,t){return!0===e.get("suppressClickEdit")?0:!0===e.get("singleClickEdit")||t?.singleClickEdit?1:2}(e.gos,r),l=s?.type;return"click"===l&&1===s?.detail&&1===a||"dblclick"===l&&2===s?.detail&&2===a||"api"===n&&!!o}(this.beans,e,t,s,o);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}shouldStopEditing(e,t,s="ui"){return this.strategy?.shouldStop(e,t,s)??null}shouldCancelEditing(e,t,s="ui"){return this.strategy?.shouldCancel(e,t,s)??null}isEditing(e,t){return this.model.hasEdits(e??void 0,t??_h)}isRowEditing(e,t){return!!e&&this.model.hasRowEdits(e,t?.checkSiblings)}enableRangeSelectionWhileEditing(){this.beans.rangeSvc&&this.gos.get("cellSelection")&&this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(e,t){const{startedEdit:s=!0,event:i=null,source:o="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;const a=Au(this.beans,e);if(a&&!a.comp)return t.editable=void 0,void(a.pendingEditStart=t);const l=this.shouldStartEditing(e,i,s,o);!1!==l||"api"===o?(this.batch||!this.shouldStopEditing(e,void 0,o)||t.continueEditing||this.stopEditing(void 0,{source:o}),l&&this.ensureBatchStarted(),this.strategy.start({position:e,event:i,source:o,ignoreEventKey:n,startedEdit:s,silent:r})):this.isEditing(e)&&this.stopEditing()}stopEditing(e,t,s){this.stopping||(this.stopBlockRejected=!1);const i=this.prepareStopContext(e,t);if(!i)return!1;this.stopping=!0;let o=!1;try{const n=this.processStopRequest(i,s);return o||(o=n.res),this.finishStopEditing({...i,edits:n.edits,params:t,position:e,res:o}),o}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){const{event:s=null,cancel:i=!1,source:o="ui",forceCancel:n=!1,forceStop:r=!1,commit:a=!1}=t||{};if(Mh.has(o)&&this.batch)return e?.rowNode&&e?.column&&this.bulkRefreshCell(e),null;const l=this.committing?Ah[o]:o;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,_h))||!this.strategy||this.stopping)return null;this.pendingEditorFocus=null;const c=Au(this.beans,e),d=!i&&(!!this.shouldStopEditing(e,s,l)||(this.committing||"paste"===o)&&!this.batch)||r,u=i&&!!this.shouldCancelEditing(e,s,l)||n;return{cancel:i,cellCtrl:c,edits:this.model.getEditMapCopy(),event:s??null,forceCancel:n,forceStop:r,commit:a,position:e,source:o,treatAsSource:l,willCancel:u,willStop:d}}processStopRequest(e,t){const{event:s,position:i,willCancel:o,willStop:n}=e;return n||o?this.handleStopOrCancel(e,t):this.shouldHandleMidBatchKey(s,i)?{res:!1,edits:this.handleMidBatchKey(s,i,e,t)}:(ih(this.beans,{persist:!0},t),this.batch&&this.strategy?.cleanupEditors(i,void 0,t),{res:!1,edits:this.model.getEditMapCopy()})}handleStopOrCancel(e,t){const{model:s}=this,{cancel:i,commit:o,edits:n,event:r,forceCancel:a,source:l,willCancel:c,willStop:d}=e,{blockRejected:u,skipAllCommits:h,validationCache:p}=this.resolveStopValidation(e,t),g=!(this.batch&&c||u);ih(this.beans,{persist:g,isCancelling:c||i,isStopping:d},p);const f=s.getEditMapCopy(),m=c||this.batch&&!o?[]:this.processEdits(f,l,h);return i?this.strategy?.stopCancelled(a,p):u||this.strategy?.stopCommitted(r,o,p),this.cleanupAfterStop(n,f,m),{res:d&&!u,edits:f}}resolveStopValidation(e,t){const{beans:s,model:i}=this,{cancel:o,willCancel:n}=e,r=!n&&!o;let a=t;return r&&(eh(s),a??(a=uh(s))),{...this.applyInvalidEditPolicy(e,r,i.hasValidationErrors()),validationCache:a}}applyInvalidEditPolicy(e,t,s){const{beans:i}=this,{commit:o,position:n,willStop:r}=e,a=this.cellEditingInvalidCommitBlocks(),l=s&&!a&&this.batch&&o;l&&this.revertInvalidEdits();const c=s&&a&&r&&t;return this.stopBlockRejected=c,c&&"fullRow"===this.gos.get("editType")&&ju(i,n?.rowNode??this.getOpenEditorRowNode()),{blockRejected:c,skipAllCommits:s&&!l}}cleanupAfterStop(e,t,s){const{beans:i,model:o}=this;this.clearValidationIfNoOpenEditors();for(const e of s)o.clearEditValue(e);this.bulkRefreshMap(e);for(const e of o.getEditPositions(t)){const t=Au(i,e),s=$u(e);t?.refreshCell({force:!0,suppressFlash:!s})}}getOpenEditorRowNode(){const e=this.beans.rowRenderer.getCellCtrls();for(let t=0,s=e.length;t<s;++t){const s=e[t];if(s.comp?.getCellEditor())return s.rowNode}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,s,o){const{beans:n,model:r}=this,{edits:a}=s,{key:l}=e,c=l===i.DDm.ENTER,d=l===i.DDm.ESCAPE,u=l===i.DDm.TAB;return c||u||d?(c||u?ih(n,{persist:!0},o):this.strategy?.stopCancelled(!1),!d&&this.batch?this.strategy?.cleanupEditors(void 0,void 0,o):this.batch||lh(n,r.getEditPositions(),{event:e,cancel:d},o),e.preventDefault(),this.bulkRefreshMap(a,{suppressFlash:!0}),r.getEditMapCopy()):a}finishStopEditing({cellCtrl:e,edits:t,params:s,position:i,res:o,commit:n,forceCancel:r,willCancel:a}){const l=this.beans;o&&i&&(this.batch&&!n||this.model.removeEdits(i)),this.stopBlockRejected||this.navigateAfterEdit(s,e?.cellPosition),Qu(l),this.clearValidationIfNoOpenEditors();const{rowRenderer:c,formula:d}=l;if(a&&c.refreshRows({rowNodes:Array.from(t.keys())}),this.batch){d?d.refreshFormulas(!0):c.refreshRows({suppressFlash:!0,force:!0});const e=o&&n;(e||a&&r)&&this.dispatchBatchStopped(t,e)}}dispatchBatchStopped(e,t){let s;t&&(s=function(e){const t=new Map;for(const[s,i]of e){const e=new Map;for(const[t,s]of i)$u(s)&&e.set(t,s);e.size>0&&t.set(s,e)}return t}(e),s.size>0&&this.ensureBatchStarted()),this.batchStartDispatched&&(this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",s??new Map))}clearValidationIfNoOpenEditors(){this.model.hasEdits(void 0,{withOpenEditor:!0})||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap())}navigateAfterEdit(e,t){if(!e||!t)return;const{event:s,suppressNavigateAfterEdit:o}=e;if(!(s instanceof KeyboardEvent)||o)return;const{key:n,shiftKey:r}=s,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(n!==i.DDm.ENTER||!a)return;const l=r?i.DDm.UP:i.DDm.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}revertInvalidEdits(){const e=this.model,t=e.getEditPositions(),s=[];for(let i=0,o=t.length;i<o;++i){const o=t[i];e.hasValidationErrors(o)&&s.push(o)}for(let e=0,t=s.length;e<t;++e)this.revertCellEdit(s[e])}closeCellEditor(e,t){const s=this.beans;oh(s,e,{persist:!0,isStopping:!0},t),ch(s,e,{},void 0,t)}revertCellEdit(e,t){const s=this.beans;ch(s,e,{cancel:!0},void 0,t);const i=this.model,o=i.getRowValidationModel();i.stop(e,!0,!0),i.getCellValidationModel().clearCellValidation(e),hh(s);const n=i.getCellValidationModel();Wu(s,{cell:n,row:o},{cell:n,row:i.getRowValidationModel()});const r=Tu(s,e);r&&this.applyRowEditStyles(r),Au(s,e)?.refreshCell(Oh)}processEdits(e,t,s){const i=Array.from(e.keys()),o=[],{changeDetectionSvc:n}=this.beans;n?.beginDeferred();try{for(const n of i){const i=e.get(n);for(const e of i.keys()){const r=i.get(e),a={rowNode:n,column:e};if($u(r)&&!s){const s=Au(this.beans,a);this.setNodeDataValue(n,e,r.pendingValue,s,t)||o.push(a)}}}}finally{n?.endDeferred()}return o}setNodeDataValue(e,t,s,i,o="edit"){const n=Th.has(o)?"edit":o;i&&(i.suppressRefreshCell=!0),this.committing=!0;try{return e.setDataValue(t,s,n)}finally{this.committing=!1,i&&(i.suppressRefreshCell=!1)}}syncEditAfterCommit(e,t){const s=this.model.getEdit(e);s&&"editing"!==s.state&&(t?this.model.setEdit(e,{sourceValue:s.pendingValue}):this.model.clearEditValue(e))}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefreshMap(e);let s=Oh;if(t?.forceRefreshOfEditCellsOnly){const t=[],i=new Set;e.forEach(((e,s)=>{t.push(s);for(const t of e.keys())i.add(t)})),s={rowNodes:t,columns:Array.from(i),...Oh}}this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged(e,t,s={}){const{pendingValue:i,sourceValue:o}=s,{rowIndex:n,rowPinned:r,data:a}=e;this.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:a,newValue:i,oldValue:o,value:i,colDef:t.getColDef()})}beginBulkWrite(){this.bulkWriteDepth++}endBulkWrite(){0==--this.bulkWriteDepth&&this.flushBulkWrite()}flushBulkWrite(){const e=this.bulkWriteTouched;if(this.bulkWriteTouched=[],!this.batch||0===e.length)return;if(this.model.hasOpenEditors()&&this.cleanupEditors(),!this.csrm)return;const t=new Map,s=new Map;for(let i=0,o=e.length;i<o;++i){const o=e[i],{rowNode:n,column:r}=o;Gh(t,n,r)&&this.refCell(n,r,this.model.getCellEdit(n,r),void 0,s)}}bulkRefreshCell(e,t){if(this.csrm){const{rowNode:s,column:i}=e;this.refCell(s,i,this.model.getCellEdit(s,i),t)}}bulkRefreshMap(e,t){this.csrm&&e.forEach(((e,s)=>{for(const i of e.keys())this.refCell(s,i,e.get(i),t)}))}refCell(e,t,s,i={},o){const{beans:n,gos:r}=this,a=e.pinnedSibling;this.dispatchEditValuesChanged(e,t,s),a&&this.dispatchEditValuesChanged(a,t,s),Au(n,{rowNode:e,column:t})?.refreshCell(i),a&&Au(n,{rowNode:a,column:t})?.refreshCell(i);const l=this.batch,c=e.sibling;c&&zh(n,c,t,i,l,o);let d=e.parent;if(!d)return;const u=r.get("groupTotalRow"),h=r.get("grandTotalRow");for(;d;){const e=d.sibling,s=e&&(e.footer&&u||!d.parent&&h)?e:d;zh(n,s,t,i,l,o),d=d.parent}}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{gos:s,beans:i}=this,o=e.rowNode;if(o.group&&null==e.column.getColDef().groupRowEditable)if(s.get("treeData")){if(!o.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1;const n="fullRow"===Hh(s)?function(e,t,s="ui"){const i=yh(e,t);if(i||"ui"===s)return i;const{rowNode:o,column:n}=t;for(const t of e.colModel.colsList)if(t!==n&&yh(e,{rowNode:o,column:t}))return!0;return!1}(i,e,t):yh(i,e);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}hasValidationRules(){return this.hasConfiguredValidation()||this.editorsRequireValidation()}hasConfiguredValidation(){const e=this.beans.colModel,t=e.colDefsVersion;if(this.validationConfigVersion===t)return this.validationConfigResult;this.validationConfigVersion=t;let s=!!this.gos.get("getFullRowEditValidationErrors");const i=e.colDefList;for(let e=0,t=i.length;!s&&e<t;++e){const t=i[e].colDef,o=t.cellEditorParams;o&&(t.editable||t.groupRowEditable)&&(s="function"==typeof o||void 0!==o.minLength||void 0!==o.maxLength||void 0!==o.getValidationErrors||void 0!==o.min||void 0!==o.max)}return this.validationConfigResult=s,s}editorsRequireValidation(){return!!this.model.hasOpenEditors()&&(this.editorsValidation??(this.editorsValidation=function(e){const t=e.rowRenderer.getCellCtrls();for(let e=0,s=t.length;e<s;++e){const s=t[e],i=s.comp?.getCellEditor();if(i){const e=Iu(i);if(e.getValidationElement||e.getValidationErrors)return!0}}return!1}(this.beans)),this.editorsValidation)}invalidateEditorsValidation(){this.editorsValidation=void 0}releasePurgedRows(e){this.strategy?.releaseRows(e)}releaseRowEdits(e){const t=this.model.getEditRow(e);if(!t?.size||this.beans.gridDestroySvc.destroyCalled)return;const s=[];for(const i of t.keys())s.push({rowNode:e,column:i});Fh(this.beans,s)}releaseColumnsLeaving(e){const t=this.model.getEditMap();if(!t?.size)return;const s=new Set;for(const e of t.values())for(const t of e.keys())s.add(t);for(let t=0,i=e.length;s.size>0&&t<i;++t)s.delete(e[t]);if(!s.size)return;const i=[];t.forEach(((e,t)=>{for(const o of e.keys())s.has(o)&&i.push({rowNode:t,column:o})})),Fh(this.beans,i)}cellEditingInvalidCommitBlocks(){return"block"===this.gos.get("invalidEditValueMode")}checkNavWithValidation(e,t,s=!0){return this.checkNavWithValidationAndCache(e,t,s).result}checkNavWithValidationAndCache(e,t,s=!0){const i=this.revalidate();if(this.checkValidated(e)){const o=Au(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),s&&(o&&!o.hasBrowserFocus()&&o.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()),{result:"block-stop",validationCache:i}):(o&&this.revertSingleCellEdit(o),{result:"revert-continue",validationCache:i})}return{result:"continue",validationCache:i}}withEditorAttachValidationCache(e,t,s){if(this.pendingEditorAttachValidation.delete(t),!e)return void s();const i=t.editCompDetails,o=this.editorAttachValidationCache,n=e;this.editorAttachValidationCache=n;try{s()}finally{this.editorAttachValidationCache=o}const r=t.editCompDetails;return r&&r!==i&&!t.comp?.getCellEditor()&&this.pendingEditorAttachValidation.set(t,{compDetails:r,validationCache:n}),n}populateModelValidationErrors(e){let t=this.editorAttachValidationCache;if(!t&&e){const s=this.pendingEditorAttachValidation.get(e);this.pendingEditorAttachValidation.delete(e),s&&s.compDetails===e.editCompDetails&&(t=s.validationCache)}uh(this.beans,!1,t)}clearPendingEditorAttachValidation(e){this.pendingEditorAttachValidation.delete(e)}hasPendingEditorAttachValidation(e){const t=this.pendingEditorAttachValidation.get(e);return!(!t||t.compDetails!==e.editCompDetails)||(this.pendingEditorAttachValidation.delete(e),!1)}announceFullRowEditValidationErrors(e){ju(this.beans,e)}onCompAttached(e,t){const s=t?e.isCellEditable():void 0,i=!!s||this.isEditing(e,{withOpenEditor:!0});return i&&this.startEditing(e,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:s}),i}replayPendingStart(e){const t=e.pendingEditStart;e.pendingEditStart=null,this.startEditing(e,t)}onCellDestroyed(e){this.pendingEditorAttachValidation.delete(e),this.pendingEditorFocus===e&&(this.pendingEditorFocus=null),e.comp?.getCellEditor()&&this.invalidateEditorsValidation()}focusEditorOnAttach(e,t){this.pendingEditorFocus=e,this.pendingEditorFocusCell=t}onEditorAttached(e){if(this.invalidateEditorsValidation(),e.rangeFeature?.unsetComp(),this.pendingEditorFocus!==e)return;const t=this.pendingEditorFocusCell;this.pendingEditorFocus=null,t&&e.focusCell({forceBrowserFocus:!0}),e.comp?.getCellEditor()?.focusIn?.()}onPopupEditorClosed(e,t){((e,t,s)=>{const o=e.editSvc;if(!o?.isEditing(t,{withOpenEditor:!0}))return;const n=s instanceof KeyboardEvent,r=s instanceof MouseEvent,a=n&&s.key===i.DDm.ESCAPE,l="fullRow"===e.gos.get("editType"),c=a?void 0:((e,t)=>{if(eh(e),!e.editSvc.cellEditingInvalidCommitBlocks()){const s=t.comp?.getCellEditor();let i;return s&&e.editSvc.hasValidationRules()&&(i=new Map,th(i,s,Iu(s))),{revertBlockedInvalid:!1,validationCache:i}}const s=uh(e);return{revertBlockedInvalid:!!e.editModelSvc?.getCellValidationModel().hasCellValidation(t),validationCache:s}})(e,t),d=c?.revertBlockedInvalid??!1,u=c?.validationCache,h=o.isBatchEditing(),{rowNode:p,column:g}=t;!a&&l&&o.isRowEditing(p,{checkSiblings:!0})?d?o.revertCellEdit({rowNode:p,column:g},u):o.closeCellEditor({rowNode:p,column:g},u):d&&h?o.revertCellEdit({rowNode:p,column:g},u):(o.stopEditing(t,{source:h?"ui":"api",cancel:a||d,event:n||r?s:void 0},u),a&&t.focusCell({forceBrowserFocus:!0,sourceEvent:s}))})(this.beans,e,t)}revertSingleCellEdit(e,t=!1){const s=Au(this.beans,e);s?.comp?.getCellEditor()&&(ch(this.beans,e,{silent:!0}),this.model.clearEditValue(e),Yu(this.beans,e,{silent:!0}),uh(this.beans),s?.refreshCell(Oh),t&&(s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()))}revalidateAndCheck(e){return this.revalidate(),this.checkValidated(e)}revalidate(){return eh(this.beans),uh(this.beans)}checkValidated(e){const t=Au(this.beans,e);return t&&(t.refreshCell(Oh),this.applyRowEditStyles(t.rowCtrl)),this.model.hasValidationErrors(e)}moveToNextCell(e,t,s,i="ui"){let o;const n=this.isEditing(),r=n?this.checkNavWithValidationAndCache(void 0,s):void 0,a="block-stop"===r?.result;return e instanceof Jl&&n&&(o=this.strategy?.moveToNextEditingCell(e,t,s,i,a,r?.validationCache)),null===o||(o=o||!!this.beans.focusSvc.focusedHeader,!1!==o||a||this.stopEditing(void 0,void 0,r?.validationCache)),o}getPendingEditValue(e,t,s){const i=this.batch;if("batch"===s&&!i)return;const o=this.model.getCellEditWithSibling(e,t);if(!o)return;if(this.stopping&&!i&&!o.editorState?.cellStartedEditing)return;if("edit"===s){const e=o.editorValue;if(null!=e&&e!==Uu)return e}const n=o.pendingValue;return n!==Uu?n:void 0}getCellDataValue(e){const t=this.model.getCellEditWithSibling(e.rowNode,e.column);if(t){const e=t.pendingValue;if(e!==Uu)return e;const s=t.sourceValue;if(null!=s)return s}return this.valueSvc.getValueFromData(e.column,e.rowNode)}addStopEditingWhenGridLosesFocus(e){!function(e,t,s){const{gos:o,popupSvc:n}=t;if(!o.get("stopEditingWhenCellsLoseFocus"))return;const r=e=>{const r=e.relatedTarget;if(null===(0,i.rsR)(r))return void Mu(t);let a=s.some((e=>e.contains(r)))&&o.isElementInThisInstance(r);a||(a=!!n&&(n.getActivePopups().some((e=>e.contains(r)))||n.isElementWithinCustomPopup(r))),a||Mu(t)};for(const t of s)e.addManagedElementListeners(t,{focusout:r})}(this,this.beans,e)}createPopupEditorWrapper(e){return new wh(e)}batchResetToSourceValue(e){if(!this.batch)return!1;const t=this.model.getEdit(e);if(!t)return!1;const{pendingValue:s,sourceValue:i,state:o}=t;return s!==i&&"editing"!==o&&(this.dispatchEditValuesChanged(e.rowNode,e.column,{...t,pendingValue:i}),this.model.removeEdits(e),Au(this.beans,e)?.refreshCell(Oh),!0)}setDataValue(e,t,s){try{const i=this.batch,o=this.isEditing(i?void 0:e);if((!o||this.committing)&&!i&&!Nh.has(s))return;if(!o&&!i&&"paste"===s)return;if("batch"===s&&!i)return;if("edit"===s){if(o&&this.applyEditorValue(e,t))return!0;if(!i)return}if(this.strategy??(this.strategy=this.createStrategy()),"batch"===s||"edit"===s)return this.applyDirectValue(e,t,s);const n=this.beans;let r;if(r=i?"ui":this.committing?s??"api":"api",!s||Dh.has(s))return this.applyDirectValue(e,t,s);const a=this.applyExistingEdit(e,t,s,r);return void 0!==a?a:(nh(n,e,t,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0)}finally{this.committing=!1}}applyExistingEdit(e,t,s,i){const o=this.model.getEdit(e);if(o)return o.pendingValue!==t&&(o.sourceValue!==t?(nh(this.beans,e,t,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0):(this.model.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e.rowNode,e.column,{...o,pendingValue:t}),!0))}applyEditorValue(e,t){const s=this.beans,i=Au(s,e),o=i?.comp?.getCellEditor();return!(!i||!o||(nh(s,e,t,{persist:!0}),Eh(s,i),"agSetEditValue"in o?(o.agSetEditValue(t),0):o.refresh&&i.editCompDetails?(o.refresh({...i.editCompDetails.params,value:t}),0):(i.hasBrowserFocus()&&this.focusEditorOnAttach(i,!0),ch(s,e,{silent:!0,cancel:!0}),Yu(s,e,{silent:!0}),uh(s),Au(s,e)?.refreshCell(Oh),0)))}applyDirectValue(e,t,s){const i=this.beans;if(this.batch){const o=this.bulkWriteDepth>0;if("batch"===s&&Au(i,e)?.comp?.getCellEditor()){const{editModelSvc:s,valueSvc:o}=i,{rowNode:n,column:r}=e,a=s?.getEdit(e);void 0===a?.sourceValue&&s?.setEdit(e,{sourceValue:o.getValueFromData(r,n)}),s?.setEdit(e,{pendingValue:t})}else nh(i,e,t,{persist:!0}),"batch"===s||o||this.cleanupEditors();return Ju(i,e),this.ensureBatchStarted(),o?this.bulkWriteTouched.push(e):this.bulkRefreshCell(e),!0}nh(i,e,t,{persist:!0});const o=Au(i,e),n=this.setNodeDataValue(e.rowNode,e.column,t,o,s);return this.syncEditAfterCommit(e,n),Ju(i,e),Au(i,e)?.refreshCell(n?Bh:Oh),n}handleColDefChanged(e){!function(e,t){const s=t.comp?.getCellEditor();if(!s?.refresh)return;const{eventKey:i,cellStartedEdit:o}=t.editCompDetails.params,{column:n}=t,r=qu(e,t,i,o),a=n.getColDef(),l=is(e.userCompFactory,a,r);s.refresh(Xu(l.params,i))}(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){const{model:s}=this;if(!this.batch)return;if(!s.hasRowEdits(e.rowNode,!0))return;const{rowNode:i}=e,{compDetails:o,valueToDisplay:n}=t;if(o){const{params:e}=o;return e.data=s.getEditRowDataValue(i),{compDetails:o}}return{valueToDisplay:n}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,i){this.strategy?.dispatchCellEvent(e,t,s,i)}dispatchBatchEvent(e,t){const s=xe(this.gos,{type:e,..."batchEditingStopped"===e?{changes:this.toEventChangeList(t)}:{}});this.eventSvc.dispatchEvent(s)}toEventChangeList(e){return this.model.getEditPositions(e).map((e=>({rowIndex:e.rowNode.rowIndex,rowPinned:e.rowNode.rowPinned,columnId:e.column.getColId(),newValue:e.pendingValue,oldValue:e.sourceValue})))}applyBulkEdit({rowNode:e,column:t},s){if(!s||0===s.length)return;const{beans:i}=this,{formula:o}=i;ih(i,{persist:!0});const n=this.model.getEditMapCopy(),r=n.get(e)?.get(t)?.pendingValue;let a=!1;this.batch||(this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),a=!0);const l=o?.isFormula(r)??!1;let c={value:r};for(let e=0,t=s.length;e<t;++e)c=this.applyBulkEditToRange(s[e],n,l,c);if(this.setEditMap(n),this.batch)this.cleanupEditors(),Qu(i),this.ensureBatchStarted();else{this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{this.committing=!1,a&&this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(n)})}}const d=Au(i,{rowNode:e,column:t});d&&d.focusCell({forceBrowserFocus:!0})}applyBulkEditToRange(e,t,s,i){const{beans:o,rangeSvc:n}=this,{formula:r}=o,a=e.columns,l=s&&a.some((e=>e?.allowFormula));let{value:c,lastRowNode:d}=i,u=!0;return n?.forEachRowInRange(e,(e=>{const i=ci(o,e);if(void 0===i)return;const n=d?.rowIndex;let h=d?1:0;l&&d&&(!u||null!=n&&i.rowPinned===d.rowPinned&&i.rowIndex===n+1)&&(h=function(e,t){const s=e.formulaRowIndex,i=t.formulaRowIndex;return null==s||null==i?1:i-s}(d,i));const p=0===h?c:r?.updateFormulaByOffset({value:c,rowDelta:h});this.applyBulkEditToRow(i,a,t,p,s),u=!1,l&&(c=p,d=i)})),{value:c,lastRowNode:d}}applyBulkEditToRow(e,t,s,i,o){const{beans:n,valueSvc:r}=this,{formula:a}=n,l=s.get(e)??new Map;let c=i;for(const s of t)if(s){if(this.isCellEditable({rowNode:e,column:s},"api")){const t=r.getValueFromData(s,e,!0);let i=r.parseValue(s,e,c,t);Number.isNaN(i)&&(i=null),l.set(s,{editorValue:void 0,pendingValue:i,sourceValue:t,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}o&&s.allowFormula&&(c=a?.updateFormulaByOffset({value:c,columnDelta:1}))}l.size>0&&s.set(e,l)}applyCellEditStyles(e){Eh(this.beans,e)}applyRowEditStyles(e){!function(e,t){const s=e.editModelSvc;let i=t.rowNode,o=s?.getEditRow(i);const n=s?.getRowValidationModel().hasRowValidation({rowNode:i});if(!o&&i.pinnedSibling&&(i=i.pinnedSibling,o=s?.getEditRow(i)),o){const s=Array.from(o.keys()).some((t=>{const s={rowNode:i,column:t};return Sh(e,s,!0)||Rh(e,s)||Ph(e,s)}));kh(e,t,n,s)}else kh(e,t,n)}(this.beans,e)}setEditingCells(e,t){const{beans:s}=this,{colModel:i,valueSvc:o}=s,n=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){const e=r?i.colsById[r]:l?i.getCol(l):a;if(!e)continue;const p=ci(s,{rowIndex:c,rowPinned:d});if(!p)continue;const g=o.getValueFromData(e,p,!0);if(!t?.forceRefreshOfEditCellsOnly&&!$u({pendingValue:u,sourceValue:g})&&"editing"!==h)continue;let f=n.get(p);f||(f=new Map,n.set(p,f)),void 0===u&&(u=Uu),f.set(e,{editorValue:void 0,pendingValue:u,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=Au(this.beans,e);if(!t||!this.isEditing(t,_h))return;const s=this.model.getEdit(t);if(!s||!$u(s))return;const i=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(i,"pendingChange")}allowedFocusTargetOnValidation(e){return Au(this.beans,e)}}],apiFunctions:{getEditingCells:function(e){const t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach(((e,t)=>{e.forEach(((e,i)=>{const o="editing"===e.state,n=!o&&$u(e);if(o||n){const o=i.colId;let n=e.editorValue??e.pendingValue;n===Uu&&(n=void 0),s.push({newValue:n,oldValue:e.sourceValue,state:e.state,column:i,colId:o,colKey:o,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}}))})),s},getEditRowValues:function(e,t){return e.editModelSvc?.getEditRowDataValue(t)},getCellEditorInstances:(e,t={})=>{const s=e.rowRenderer.getCellCtrls(t.rowNodes,t.columns),i=new Array(s.length);let o=0;for(let e=0,t=s.length;e<t;++e){const t=s[e],n=t.comp?.getCellEditor();n&&(i[o++]=Iu(n))}return i.length=o,i},startEditingCell:function(e,t){const{key:s,colKey:i,rowIndex:o,rowPinned:n}=t,{editSvc:r,colModel:a}=e,l=a.getCol(i);if(!l)return void e.log.warn(12,{colKey:i});const c=ci(e,{rowIndex:o,rowPinned:n||null,column:l});c?r?.isCellEditable({rowNode:c,column:l},"api")&&(null==n&&td(e,o),ed(e,i),r?.startEditing({rowNode:c,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api",editable:!0})):e.log.warn(290,{rowIndex:o,rowPinned:n})},stopEditing:function(e,t=!1){const{editSvc:s}=e;s?.isBatchEditing()?s.stopBatchEditors(t):s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})},isEditing:function(e,t){const s=ci(e,t);return!!s&&!!e.editSvc?.isEditing({rowNode:s,column:t.column})},validateEdit:function(e){return eh(e),gh(e)},getEditValidationErrors:mh},dynamicBeans:{singleCell:class extends Wh{constructor(){super(...arguments),this.beanName="singleCell"}releaseRows(e){this.rowNode&&e.has(this.rowNode)&&(this.rowNode=void 0,this.column=void 0)}shouldStop(e,t,s="ui"){const i=super.shouldStop(e,t,s);if(null!==i)return i;const o=e?.rowNode,n=e?.column,r=this.rowNode,a=this.column;return r&&a||!o||!n?r!==o||a!==n||!r&&!a&&this.model.hasEdits(void 0,{withOpenEditor:!0}):null}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:s,event:i,ignoreEventKey:o}=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:s,event:i,ignoreEventKey:o})}dispatchRowEvent(e,t,s){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e,t){return super.stopCancelled(e,t),this.clearPosition()}stopCommitted(e,t,s){return super.stopCommitted(e,t,s),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:s}=this.beans,{rowIndex:i,column:o,rowPinned:n}=e,r=ci(this.beans,{rowIndex:i,rowPinned:n}),a=Nu(o),l=t.getCol(a),c=e.previousParams;if(c){const e=Nu(c.column);if(c?.rowIndex===i&&e===a&&c?.rowPinned===n)return}"cellFocused"==e.type&&(s?.isRangeSelectionEnabledWhileEditing()||s?.isEditing({rowNode:r,column:l},{withOpenEditor:!0}))||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,i="ui",o=!1,n){const r=this.beans.focusSvc.getFocusedCell();r&&(e=di(this.beans,r)??e);const a=e.cellPosition;let l;const c="fullRow"===this.beans.gos.get("editType");c&&this.model.suspend(!0),o||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:s},n));try{l=this.beans.navigation?.findNextCellToFocusOn(a,{backwards:t,startEditing:!0})}finally{c&&this.model.suspend(!1)}if(!1===l)return null;if(null==l)return!1;const d=l.cellPosition,u=e.isCellEditable(),h=l.isCellEditable(),p=a.rowIndex===d?.rowIndex&&a.rowPinned===d.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const g=this.gos.get("suppressStartEditOnTab");let f=!1;if(p||o||(super.cleanupEditors(l,!0,n),g?l.focusCell({forceBrowserFocus:!0,sourceEvent:s}):(f=!0,this.editSvc.startEditing(l,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:h}))),h&&!o){if(l.focusCell({sourceEvent:s}),g)l.focusCell({forceBrowserFocus:!0,sourceEvent:s});else if(!l.comp?.getCellEditor()){if(!f){const e=this.editSvc?.isEditing(l,{withOpenEditor:!0});Yu(this.beans,l,{event:s,cellStartedEdit:!0,silent:e})}this.setFocusInOnEditor(l),this.cleanupEditors(l,void 0,n)}}else o?this.focusFirstInvalidCell(e,s):l.focusCell({forceBrowserFocus:!0,sourceEvent:s});return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},fullRow:class extends Wh{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=new Set}shouldStop(e,t,s="ui"){const{rowNode:i,beans:o}=this,{rowNode:n}=e||{};if(!Tu(o,{rowNode:i}))return!0;const r=super.shouldStop({rowNode:i},t,s);return null!==r?r:!!i&&n!==i}midBatchInputsAllowed({rowNode:e}){return!!e&&this.model.hasEdits({rowNode:e})}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:s,startedEdit:i,event:o,ignoreEventKey:n}=e,{rowNode:r}=t,{beans:a,model:l,startedRows:c}=this;this.rowNode!==r&&super.cleanupEditors(t);const d=a.visibleCols.allCols,u=[],h=[];for(const e of d)e.isCellEditable(r)&&h.push(e);if(0!=h.length){c.has(r)||(this.dispatchRowEvent({rowNode:r},"rowEditingStarted",s),c.add(r));for(const e of h){const t={rowNode:r,column:e};u.push(t),l.start(t)}this.rowNode=r,this.setupEditors({cells:u,position:t,startedEdit:i,event:o,ignoreEventKey:n})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e,t){const{rowNode:s,model:i}=this;return!(s&&!i.hasEdits()||(super.stopCancelled(e,t),this.cleanupEditors({rowNode:s},!0,t),this.rowNode=void 0,0))}stopCommitted(e,t,s){const{rowNode:i,model:o,editSvc:n}=this;if(i&&!o.hasEdits())return!1;const r=[];if(o.getEditMap()?.forEach(((e,t)=>{if(e&&0!==e.size)for(const s of e.values())if($u(s)){r.push(t);break}})),super.stopCommitted(e,t,s),t||!n.isBatchEditing())for(const e of r)this.dispatchRowEvent({rowNode:e},"rowValueChanged");return this.cleanupEditors({rowNode:i},!0,s),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,s=e.previousParams;if(s?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;const{beans:i,gos:o,model:n}=this;if(i.editSvc?.isRangeSelectionEnabledWhileEditing())return;const r=Au(i,s);"block"===o.get("invalidEditValueMode")&&r&&(n.getCellValidationModel().getCellValidation(r)||n.getRowValidationModel().getRowValidation(r))||super.onCellFocusChanged(e)}releaseRows(e){const{startedRows:t}=this;for(const s of e)t.delete(s)&&this.dispatchRowEvent({rowNode:s},"rowEditingStopped"),this.rowNode===s&&(this.rowNode=void 0)}cleanupEditors(e={},t,s){super.cleanupEditors(e,t,s);const{startedRows:i}=this;for(const e of i)this.dispatchRowEvent({rowNode:e},"rowEditingStopped"),this.destroyEditorsForRow(e,s);i.clear()}destroyEditorsForRow(e,t){const s=Tu(this.beans,{rowNode:e});if(!s)return;const i={};for(const e of s.getAllCellCtrls())e.comp?.getCellEditor()&&ch(this.beans,e,i,e,t)}moveToNextEditingCell(e,t,s,i="ui",o=!1,n){const{beans:r,model:a,gos:l,editSvc:c}=this,d=e.cellPosition;let u;a.suspend(!0);try{u=r.navigation?.findNextCellToFocusOn(d,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{a.suspend(!1)}if(!1===u)return null;if(null==u)return!!o&&(c.announceFullRowEditValidationErrors(e.rowNode),this.focusFirstInvalidCell(e,s),!0);const h=u.cellPosition,p=e.isCellEditable(),g=u.isCellEditable(),f=d.rowIndex===h?.rowIndex&&d.rowPinned===h.rowPinned;p&&this.setFocusOutOnEditor(e),n=this.restoreEditors(n);const m=l.get("suppressStartEditOnTab");return g&&!o?m?u.focusCell({forceBrowserFocus:!0,sourceEvent:s}):(u.comp?.getCellEditor()||f&&c.hasPendingEditorAttachValidation(u)||(n=c.withEditorAttachValidationCache(n,u,(()=>Yu(r,u,{event:s,cellStartedEdit:!0})))),this.setFocusInOnEditor(u),u.focusCell({sourceEvent:s})):o&&!f?(c.announceFullRowEditValidationErrors(e.rowNode),this.focusFirstInvalidCell(e,s)):(u.focusCell({forceBrowserFocus:!0,sourceEvent:s}),g&&this.setFocusInOnEditor(u)),f||o||(c.stopEditing({rowNode:e.rowNode},{event:s,forceStop:!0},n),c.isRowEditing(e.rowNode,{withOpenEditor:!0})&&this.cleanupEditors(u,!0,n),m?u.focusCell({forceBrowserFocus:!0,sourceEvent:s}):c.startEditing(u,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:g||void 0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(e){const{beans:t,editSvc:s,model:i}=this;return i.getEditMap()?.forEach(((i,o)=>i.forEach((({state:i},n)=>{if("editing"!==i)return;const r=Au(t,{rowNode:o,column:n});r&&!r.comp?.getCellEditor()&&(e=s.withEditorAttachValidationCache(e,r,(()=>Yu(t,r,{silent:!0}))))})))),e}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}}},dependsOn:[Ad,Yd],css:[".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,&.ag-cell-editor-input-invalid{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) .ag-text-area-input{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}"]},$h={moduleName:"UndoRedoEdit",version:cn,beans:[class extends ke{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},s=null!==this.activeCellEdit&&ri(this.activeCellEdit,t),i=null!==this.activeRowEdit&&(n=t,!(o=this.activeRowEdit)&&!n||!(!o||!n)&&o.rowIndex===n.rowIndex&&o.rowPinned==n.rowPinned);var o,n;if(!(s||i||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:a,column:l,oldValue:c,value:d}=e,u={rowPinned:r,rowIndex:a,columnId:l.getColId(),newValue:d,oldValue:c};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 s=e.get("undoRedoCellEditingLimit");if(s<=0)return;this.undoStack=new Zd(s),this.redoStack=new Zd(s),this.addListeners();const i=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:e=>{e.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:i,newColumnsLoaded:i,columnGroupOpened:i,columnRowGroupChanged:i,columnMoved:i,columnPinned:i,columnVisible:i,rowDragEnd:i}),t.whenReady(this,(e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(s,i,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(i,s,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,s,i,o){if(!e)return!1;const n=e.pop();return!!n?.cellValueChanges&&(this.processAction(n,(e=>e[i]),o),n instanceof qd?this.processRange(n.ranges||[n[s]]):this.processCell(n.cellValueChanges),t.push(n),!0)}processAction(e,t,s){const{changeDetectionSvc:i,editSvc:o}=this.beans;o?.beginBulkWrite();try{i?.beginDeferred();for(const i of e.cellValueChanges){const{rowIndex:e,rowPinned:o,columnId:n}=i,r={rowIndex:e,rowPinned:o},a=ci(this.beans,r);a?.displayed&&a.setDataValue(n,t(i),s)}}finally{i?.endDeferred(),o?.endBulkWrite()}}processRange(e){let t;const s=this.beans.rangeSvc;s.removeAllCellRanges(!0),e.forEach(((i,o)=>{if(!i)return;const n=i.startRow,r=i.endRow;o===e.length-1&&(t={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns};s.addCellRange(a)}))}processCell(e){const t=e[0],{rowIndex:s,rowPinned:i}=t,o={rowIndex:s,rowPinned:i},n=ci(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:s,rowPinned:i}=e,{colModel:o,focusSvc:n,rangeSvc:r}=this.beans,a=o.getCol(s);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:i};n.setFocusedCell({...c,forceBrowserFocus:!0}),r?.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Kd(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 e=new Kd(this.cellValueChanges);this.pushActionsToUndoStack(e)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Kd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new qd(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:s}=this.beans;e=t&&de(s)?new qd(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):new Kd(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){"bulkEditing"===e?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if("bulkEditing"===e&&!this.bulkEditing||"batchEditing"===e&&!this.batchEditing)return;if(this.updateBigChange(e,!1),0===t?.length)return;const s=new Kd(t??[]);this.pushActionsToUndoStack(s),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}}],apiFunctions:{undoCellEditing:function(e){e.undoRedo?.undo("api")},redoCellEditing:function(e){e.undoRedo?.redo("api")},getCurrentUndoSize:function(e){return e.undoRedo?.getCurrentUndoStackSize()??0},getCurrentRedoSize:function(e){return e.undoRedo?.getCurrentRedoStackSize()??0}},dependsOn:[Uh]},Yh={moduleName:"TextEditor",version:cn,userComponents:{agCellEditor:Eu,agTextCellEditor:Eu},dependsOn:[Uh]},Kh={moduleName:"NumberEditor",version:cn,userComponents:{agNumberCellEditor:{classImp:class extends ru{constructor(){super(new mu((()=>this.getLocaleTextFunc())))}}}},dependsOn:[Uh]},qh={moduleName:"DateEditor",version:cn,userComponents:{agDateCellEditor:class extends ru{constructor(){super(new lu((()=>this.beans.dataTypeSvc),(()=>this.getLocaleTextFunc())))}initialiseEditor(e){super.initialiseEditor(e),ou(this.eEditor,e.eGridCell)}agSetEditValue(e){super.agSetEditValue(e),nu(this.params.eGridCell,this.eEditor.getInputElement())}},agDateStringCellEditor:class extends ru{constructor(){super(new du((()=>this.beans.dataTypeSvc),(()=>this.getLocaleTextFunc())))}initialiseEditor(e){super.initialiseEditor(e),ou(this.eEditor,e.eGridCell)}agSetEditValue(e){super.agSetEditValue(e),nu(this.params.eGridCell,this.eEditor.getInputElement())}}},dependsOn:[Uh]},Zh={moduleName:"CheckboxEditor",version:cn,userComponents:{agCheckboxCellEditor:class extends xs{constructor(){super(Qd,[ya]),this.eEditor=i.dRA,this.seededValue=this}initialiseEditor(e){this.agSetEditValue(e.value),this.eEditor.getInputElement().setAttribute("tabindex","-1"),this.addManagedListeners(this.eEditor,{fieldValueChanged:e=>this.setAriaLabel(e.selected)})}agSetEditValue(e){this.params.value=e;const t=e??void 0;this.eEditor.setValue(t,!0),this.seededValue=this.eEditor.getValue(),this.setAriaLabel(t)}getValue(){const e=this.eEditor.getValue();return e===this.seededValue?this.params.value:e}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),s=(0,i.MbN)(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${s})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,s=this.getValue();return t?t({value:s,internalErrors:null,cellEditorParams:e}):null}}},dependsOn:[Uh]},Qh={moduleName:"SelectEditor",version:cn,userComponents:{agSelectCellEditor:class extends xs{constructor(){super(xu,[Su]),this.eEditor=i.dRA,this.startedByEnter=!1,this.seededValue=this,this.picked=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:s,gos:o}=this,{values:n,value:r,eventKey:a}=e;if((0,i.MWY)(n))return void this.beans.log.warn(58);this.startedByEnter=null!=a&&a===i.DDm.ENTER;let l=!1;n.forEach((i=>{const o={value:i},n=s.formatValue(e.column,null,i),a=null!=n;o.text=a?n:i,t.addOption(o),l=l||r===i})),l?t.setValue(e.value??void 0,!0):e.values.length&&t.setValue(e.values[0],!0),this.seededValue=t.getValue();const{valueListGap:c,valueListMaxWidth:d,valueListMaxHeight:u}=e;null!=c&&t.setPickerGap(c),null!=u&&t.setPickerMaxHeight(u),null!=d&&t.setPickerMaxWidth(d);const h="fullRow"!==o.get("editType");this.addManagedListeners(this.eEditor,{selectedItem:t=>{this.picked=!0,h&&e.stopEditing(null==t.keyboardEvent,t.keyboardEvent)}})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout((()=>{this.isAlive()&&this.eEditor.showPicker()}))}focusIn(){this.eEditor.getFocusableElement().focus()}agSetEditValue(e){this.params.value=e,this.eEditor.setValue(e??void 0,!0),this.seededValue=this.eEditor.getValue(),this.picked=!1}getValue(){const e=this.eEditor.getValue();return this.picked||e!==this.seededValue?e:this.params.value}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:s}=e,i=this.getValue();let o=[];if(t&&null!=i&&!t.includes(i)){const e=this.getLocaleTextFunc();o.push(e("invalidSelectionValidation","Invalid selection."))}else o=null;return s?s({value:i,internalErrors:o,cellEditorParams:e}):o}}},dependsOn:[Uh]},Jh={moduleName:"LargeTextEditor",version:cn,userComponents:{agLargeTextCellEditor:class extends xs{constructor(){super(hu,[uu]),this.eEditor=i.dRA,this.cachedRaw=this,this.seededText=this}initialiseEditor(e){const{eEditor:t}=this,{browserAutoComplete:s,cellStartedEdit:o,eventKey:n,maxLength:r,cols:a,rows:l}=e;let c;this.focusAfterAttached=o,t.getInputElement().setAttribute("title",""),t.setAutoComplete(s).setMaxLength(r||200).setCols(a||60).setRows(l||10);let d=!1;o?(this.focusAfterAttached=!0,n===i.DDm.BACKSPACE||n===i.DDm.DELETE?c="":1===n?.length?c=n:(c=this.getStartValue(e),d=!0,n!==i.DDm.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,c=this.getStartValue(e),d=!0),null!=c&&t.setValue(c,!0),this.seededText=d?t.getValue():this,this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return t?.toString()??t}agSetEditValue(e){this.params.value=e;const t=this.getStartValue(this.params);this.eEditor.setValue(t??"",!0),this.seededText=this.eEditor.getValue()}onKeyDown(e){const t=e.key;(t===i.DDm.LEFT||t===i.DDm.UP||t===i.DDm.RIGHT||t===i.DDm.DOWN||e.shiftKey&&t===i.DDm.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:s}=this,i=this.getLocaleTextFunc();e.setInputAriaLabel(i("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),s&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:s}=t,o=e.getValue();if(o===this.seededText)return s;if(!(0,i.Qmv)(o)&&!(0,i.Qmv)(s))return s;if(Object.is(this.cachedRaw,o))return this.cachedParsed;const n=t.parseValue(o);return this.cachedRaw=o,this.cachedParsed=n,n}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,o=this.getLocaleTextFunc(),n=this.getValue();let r=[];return null!=t&&(0,i.hfN)(n,t)&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),s?s({value:n,internalErrors:r,cellEditorParams:e}):r}}},dependsOn:[Uh]},Xh={moduleName:"CustomEditor",version:cn,dependsOn:[Uh]},ep={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},tp=new Set(Object.values(ep));function sp(e,t){const s=e.filterUi;if(!s)return null;if(s.created)return s.promise;if(t)return null;const i=s.create(s.refreshed),o=s;return o.created=!0,o.promise=i,i}function ip(e,t,s,i,o,n){e?.refresh?.({...t,model:s,state:i,source:o,additionalEventAttributes:n})}function op(e,t,s,i){const o=e();o?.created&&o.promise.then((e=>{const n=t();ip(e,o.filterParams,n,s()??{model:n},"ui",i)}))}function np(e){let t,s,i=!1;const{action:o,filterParams:n,getFilterUi:r,getModel:a,getState:l,updateState:c,updateModel:d,processModelToApply:u}=e;switch(o){case"apply":{const e=l();s=e?.model??null,u&&(s=u(s)),t={state:e?.state,model:s},i=!0;break}case"clear":t={model:null},n?.buttons?.includes("apply")||(i=!0,s=null);break;case"reset":t={model:null},i=!0,s=null;break;case"cancel":t={model:a()}}c(t),i?d(s):op(r,a,l,{fromAction:o})}function rp(e,t){return e[t]??null}var ap="ag-has-menu-open";function lp(e,t,s){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",s))}function cp(e){const{enterpriseMenuFactory:t,filterMenuFactory:s,gos:i}=e;return t&&ye(i)?t:s}var dp={moduleName:"SharedMenu",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="menuSvc"}postConstruct(){const{enterpriseMenuFactory:e,filterMenuFactory:t}=this.beans;this.activeMenuFactory=e??t}destroy(){this.setActiveButtonMenu(),super.destroy()}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){this.showColumnMenuCommon(cp(this.beans),e,e.containerType,!0)}toggleColumnMenu(e){return this.toggleMenu(this.activeMenuFactory,e,"columnMenu")}toggleFilterMenu(e){return this.toggleMenu(cp(this.beans),e,e.containerType,!0)}showHeaderContextMenu(e,t,s){this.setActiveButtonMenu(),this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,s)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){cp(this.beans)?.hideActiveMenu()}toggleMenu(e,t,s,i){if(!e)return"declined";const{activeButtonMenu:o}=this,{buttonElement:n}=t;return o?.menuFactory===e&&o.buttonElement===n?(this.setActiveButtonMenu(),e.hideActiveMenu(),"closed"):(this.setActiveButtonMenu(),this.hidePopupMenu(),this.hideFilterMenu(),this.showButtonMenu(e,t,s,{filtersOnly:i,suppressCloseOnEventSource:!0})?"opened":"declined")}showButtonMenu(e,t,s,i){if(!e)return!1;const{buttonElement:o}=t,n={};let r=!1;return!(!e.showMenuAfterButtonClick(t.column,o,s,(e=>{r=!0,this.activeButtonMenu?.token===n&&this.setActiveButtonMenu(),e instanceof KeyboardEvent&&o.isConnected&&o.focus({preventScroll:!0}),t.onClosedCallback?.()}),i)||r||(this.setActiveButtonMenu({buttonElement:o,menuFactory:e,token:n}),0))}setActiveButtonMenu(e){this.activeButtonMenu?.buttonElement.classList.remove(ap),this.activeButtonMenu=e,e?.buttonElement.classList.add(ap)}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.colDef;return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(ye(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.colDef.suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){const t=e?.isColumn?e.colDef:e?.getColGroupDef();return!!this.beans.enterpriseMenuFactory&&!t?.suppressHeaderContextMenu&&"new"===this.gos.get("columnMenu")}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!((0,i.TvF)()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!ye(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.beans.filterManager?.isFilterAllowed(e)||ye(this.gos)||this.isFilterMenuInHeaderEnabled(e)||this.isFloatingFilterButtonDisplayed(e))}isFloatingFilterButtonEnabled(e){return!e.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos,t=e.get("suppressMenuHide");return ye(e)?!!e.exists("suppressMenuHide")&&t:t}showColumnMenuCommon(e,t,s,o){const{positionBy:n,onClosedCallback:r}=t,a=t.column;if("button"===n)this.setActiveButtonMenu(),this.showButtonMenu(e,t,s,{filtersOnly:o,suppressCloseOnEventSource:!0});else if("mouse"===n){this.setActiveButtonMenu();const{mouseEvent:i}=t;e?.showMenuAfterMouseEvent(a,i,s,r,o)}else if(a){this.setActiveButtonMenu();const t=this.beans,n=t.ctrlsSvc;n.getScrollFeature().ensureColumnVisible(a,"auto"),(0,i.Arb)(t,(()=>{const t=n.getHeaderRowContainerCtrl()?.getHeaderCtrlForColumn(a);t&&this.showButtonMenu(e,{column:a,buttonElement:t.getAnchorElementForMenu(o),onClosedCallback:r},s,{filtersOnly:o,suppressCloseOnEventSource:!0})}))}}}],apiFunctions:{showColumnMenu:function(e,t){const s=e.colModel.getCol(t);s?e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"}):e.log.error(12,{colKey:t})},hidePopupMenu:function(e){e.menuSvc?.hidePopupMenu()}}},up=null,hp=e=>(e.setHours(0,0,0,0),e),pp=e=>{const t=(e.getDay()-(()=>{if(null!=up)return up;let e;const t="undefined"==typeof navigator?void 0:navigator.languages?.[0]??navigator.language;if(t&&"undefined"!=typeof Intl&&"function"==typeof Intl.Locale)try{const s=new Intl.Locale(t).getWeekInfo?.();e=s?.firstDay}catch{e=void 0}return up=null==e?1:e%7})()+7)%7;return e.setDate(e.getDate()-t),hp(e)},gp=(e,t=1)=>(e.setDate(e.getDate()-t),e),fp=e=>(e.setDate(e.getDate()+1),hp(e)),mp=e=>(e.setDate(1),hp(e)),vp=e=>(e.setDate(1),e.setMonth(e.getMonth()+1),hp(e)),wp=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(3*t),mp(e)},Cp=e=>{const t=Math.floor(e.getMonth()/3);return e.setMonth(3*t+2),vp(e)},yp=e=>(e.setMonth(0,1),hp(e)),bp=e=>gp(e),Sp=e=>bp(pp(e)),xp=e=>bp(mp(e)),Rp=e=>bp(wp(e)),Pp=(e,t)=>[hp(e),fp(t)],Ep=(e,t)=>{return[pp(e),(s=t,pp(s),s.setDate(s.getDate()+6),fp(s))];var s},Ip=(e,t)=>[mp(e),vp(t)],kp=(e,t)=>[wp(e),Cp(t)],Fp=(e,t)=>{return[yp(e),(s=t,s.setMonth(12,0),fp(s))];var s},Dp={today:Pp,yesterday:(e,t)=>Pp(bp(e),bp(t)),tomorrow:(e,t)=>(e.setDate(e.getDate()+1),t.setDate(t.getDate()+1),Pp(e,t)),thisWeek:Ep,lastWeek:(e,t)=>Ep(Sp(e),Sp(t)),nextWeek:(e,t)=>(e.setDate(e.getDate()+7),t.setDate(t.getDate()+7),Ep(e,t)),thisMonth:Ip,lastMonth:(e,t)=>Ip(xp(e),xp(t)),nextMonth:(e,t)=>(e.setMonth(e.getMonth()+1),t.setMonth(t.getMonth()+1),Ip(e,t)),thisQuarter:kp,lastQuarter:(e,t)=>kp(Rp(e),Rp(t)),nextQuarter:(e,t)=>(e.setMonth(e.getMonth()+3),t.setMonth(t.getMonth()+3),kp(e,t)),thisYear:Fp,lastYear:(e,t)=>(e.setFullYear(e.getFullYear()-1),t.setFullYear(t.getFullYear()-1),Fp(e,t)),nextYear:(e,t)=>(e.setFullYear(e.getFullYear()+1),t.setFullYear(t.getFullYear()+1),Fp(e,t)),yearToDate:(e,t)=>[yp(e),fp(t)],last7Days:(e,t)=>[hp(gp(e,7)),fp(t)],last30Days:(e,t)=>[hp(gp(e,30)),fp(t)],last90Days:(e,t)=>[hp(gp(e,90)),fp(t)],last6Months:(e,t)=>(e.setFullYear(e.getFullYear()-1),e.setMonth(e.getMonth()+6),[hp(e),fp(t)]),last12Months:(e,t)=>(e.setFullYear(e.getFullYear()-1),[hp(e),fp(t)]),last24Months:(e,t)=>(e.setFullYear(e.getFullYear()-2),[hp(e),fp(t)])},Tp=Object.keys(Dp),Ap=class{constructor(){this.ranges=new Map}getRange(e,t){const s=this.ranges,i=Date.now();let o=s.get(e);if(o&&o.expires<=i&&(o=void 0),!o){const[n,r]=t(new Date(i),new Date(i)),a=fp(new Date(i)).getTime();o={fromTime:n.getTime(),toTime:r.getTime(),expires:a},s.set(e,o)}return o}};function Mp(e,t,s){return xe(e,{column:t,colDef:t.getColDef(),source:s})}function Np(e,t,s,i){return e&&s?o=>e(o,Mp(t,s,i)):void 0}function Lp(e){return e<1||Number.isNaN(e)}function Vp(e,t,s){return null==s?e.splice(t):e.splice(t,s)}function _p(e){if("string"==typeof e){const t=e.codePointAt(0)??0;return!(t>32&&t<160||e.trim())}return null==e}var Op=new Set(["empty","notBlank","blank",...Tp]),Bp=["displayKey","displayName","predicate"],Hp={isAnyOf:!0,isNoneOf:!0,true:!0,false:!0};function Gp(e){const t=Math.trunc(e.numberOfInputs??1);return t>0?Math.min(t,2):0}function zp(e,t){const s=t.getCustomOption(e);return s?Gp(s):e&&Op.has(e)?0:"inRange"===e?2:1}function Wp(e,t,s,i){return function(e,t,s){return null!=e&&null!=t&&(s?e>t:e>=t)}(e,t,i)?e instanceof Date?i?s?"maxDateInclusiveValidation":"minDateInclusiveValidation":s?"maxDateValidation":"minDateValidation":i?s?"maxValueValidation":"minValueValidation":s?"strictMaxValueValidation":"strictMinValueValidation":null}var jp={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Up=["january","february","march","april","may","june","july","august","september","october","november","december"];function $p(e,t){return null==e?-1:null==t?1:Number.parseFloat(e)-Number.parseFloat(t)}function Yp(e,t){if(null==e)return-1;if(null==t)return 1;const s=(0,i.yN4)(e),o=(0,i.yN4)(t);return null!=s&&null!=o?s===o?0:s>o?1:-1:String(e).localeCompare(String(t))}function Kp(e){return e instanceof Date&&!isNaN(e.getTime())}var qp=new WeakSet;function Zp(e){return qp.add(e),e}var Qp=Zp(Kp),Jp=["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}],Xp={number:()=>{},bigint:()=>{},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:[...Jp]}),date:()=>({isValidDate:Qp}),dateString:({dataTypeDefinition:e})=>({comparator:Zp(((t,s)=>{const i=e.dateParser(s);return null==s||i<t?-1:i>t?1:0})),isValidDate:Zp((t=>"string"==typeof t&&Kp(e.dateParser(t))))}),dateTime:e=>Xp.date(e),dateTimeString:e=>Xp.dateString(e),object:()=>{},text:()=>{}};function eg(e,t){return e instanceof Date?(0,i.sZb)(e,t):null}var tg={number:()=>({comparator:$p}),bigint:()=>({comparator:Yp}),boolean:({t:e})=>({valueFormatter:t=>{const s=t.value;return _p(s)?e("blanks","(Blanks)"):e(String(s),s?"True":"False")}}),date:({formatValue:e,t})=>({valueFormatter:s=>e(s)||t("blanks","(Blanks)"),treeList:!0,treeListFormatter:(e,s)=>{if("NaN"===e)return t("invalidDate","Invalid Date");if(1===s&&null!=e){const s=Up[Number(e)-1];return t(s,jp[s])}return e??t("blanks","(Blanks)")},treeListPathGetter:e=>eg(e,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:s})=>({valueFormatter:t=>e(t)||s("blanks","(Blanks)"),treeList:!0,treeListPathGetter:e=>(0,i.sZb)(t.dateParser(e??void 0),!1),treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Up[Number(e)-1];return s(t,jp[t])}return e??s("blanks","(Blanks)")}}),dateTime:e=>{const t=tg.date(e);return t.treeListPathGetter=e=>eg(e),t},dateTimeString(e){const t=e.dataTypeDefinition.dateParser,s=tg.dateString(e);return s.treeListPathGetter=e=>(0,i.sZb)(t(e??void 0)),s},object:({formatValue:e,t})=>({valueFormatter:s=>e(s)||t("blanks","(Blanks)")}),text:()=>{}},sg={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},ig={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"},og={filterHandler:()=>({doesFilterPass:()=>!0})};function ng(e,t,s,i){if(!e.isPrimary())return!0;const o=!s;return!(!e.isValueActive()||!o)&&(!!t||i)}var rg=class extends ls{constructor(e){const{className:t="ag-filter-apply-panel"}=e??{};super(function(e){return{tag:"div",cls:e}}(t)),this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){const s=this.buttons;if(this.buttons=e,s===e)return;const o=this.getGui();let n;(0,i.fDi)(o),this.destroyListeners();const r=document.createDocumentFragment(),a=this.className,l=({type:e,label:s})=>{const o=t=>{this.dispatchLocalEvent({type:e,event:t})};["apply","clear","reset","cancel"].includes(e)||this.beans.log.warn(75);const l="apply"===e,c=ni({tag:"button",attrs:{type:l&&t?"submit":"button"},ref:`${e}FilterButton`,cls:`ag-button ag-standard-button ${a}-button${l?" "+a+"-apply-button":""}`,children:s});this.activateTabIndex([c]),l&&(n=c);const d=e=>{e.key===i.DDm.ENTER&&(e.preventDefault(),o(e))},u=this.listeners;c.addEventListener("click",o),u.push((()=>c.removeEventListener("click",o))),c.addEventListener("keydown",d),u.push((()=>c.removeEventListener("keydown",d))),r.append(c)};for(const t of e)l(t);this.eApply=n;const c=this.validationTooltipFeature;if(n&&!c){const e=n;this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.tooltipSvc?.createTooltip({getGui:()=>this.eApply??e,getTooltipComponentDefinition:()=>{},getLocation:()=>"filter",getTooltipShowDelayOverride:()=>1e3}))}else!n&&c&&(this.validationTooltipFeature=this.destroyBean(c));o.append(r)}getApplyButton(){return this.eApply}updateValidity(e,t=null){const s=this.eApply;s&&((0,i.qpX)(s,!e),this.validationMessage=t,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage))}destroyListeners(){for(const e of this.listeners)e();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}},ag=class extends ls{constructor(e,t,s,i,o,n){super(),this.column=e,this.wrapper=t,this.eventParent=s,this.updateModel=i,this.isGlobalButtons=o,this.enableGlobalButtonCheck=n,this.hidePopup=null,this.applyActive=!1}postConstruct(){const{comp:e,params:t}=this.wrapper,s=t,i=s.useForm,o=i?"form":"div";this.setTemplate({tag:o,cls:"ag-filter-wrapper"}),i&&this.addManagedElementListeners(this.getGui(),{submit:e=>{e?.preventDefault()},keydown:this.handleKeyDown.bind(this)}),this.appendChild(e.getGui()),this.params=s,this.resetButtonsPanel(s),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:e,params:t})=>{e===this.column&&this.resetButtonsPanel(t,this.params)},filterStateChanged:({column:e,state:t})=>{e===this.column&&this.eButtons?.updateValidity(!1!==t.valid)},filterAction:({column:e,action:t,event:s})=>{e===this.column&&this.afterAction(t,s)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:e})=>{if(e!==this.isGlobalButtons){this.isGlobalButtons=e;const t=this.params;this.resetButtonsPanel(t,t,!0)}}}:void 0})}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup)}resetButtonsPanel(e,t,s){const{buttons:o,readOnly:n}=t??{},{buttons:r,readOnly:a,useForm:l}=e;if(!s&&n===a&&(0,i.V67)(o,r))return;const c=r&&r.length>0&&!e.readOnly&&!this.isGlobalButtons;let d=this.eButtons;if(c){const e=r.map((e=>({type:e,label:vs(this,`${e}Filter`)})));if(this.applyActive=Cs(this.params),!d){d=this.createBean(new rg),this.appendChild(d.getGui());const e=this.column,t=t=>({event:s})=>{this.updateModel(e,t,{fromButtons:!0}),this.afterAction(t,s)};d?.addManagedListeners(d,{apply:t("apply"),clear:t("clear"),reset:t("reset"),cancel:t("cancel")}),this.eButtons=d}d.updateButtons(e,l)}else this.applyActive=!1,d&&((0,i.MwW)(d.getGui()),this.eButtons=this.destroyBean(d))}close(e){const t=this.hidePopup;if(!t)return;const s=e,o=s?.key;let n;o!==i.DDm.ENTER&&o!==i.DDm.SPACE||(n={keyboardEvent:s}),t(n),this.hidePopup=null}afterAction(e,t){const{params:s,applyActive:i}=this,o=s?.closeOnApply;switch(e){case"apply":t?.preventDefault(),o&&i&&this.close(t);break;case"reset":o&&i&&this.close();break;case"cancel":o&&this.close(t)}}handleKeyDown(e){!e.defaultPrevented&&e.key===i.DDm.ENTER&&this.applyActive&&(this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e))}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},lg={tag:"div",cls:"ag-filter"},cg=class extends ls{constructor(e,t,s){super(lg),this.column=e,this.source=t,this.enableGlobalButtonCheck=s,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return null!=this.wrapper}getFilter(){return this.wrapper?.then((e=>e.comp))??null}afterInit(){return this.wrapper?.then((()=>{}))??i.oY$.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.wrapper?.then((t=>{this.comp?.afterGuiAttached(e),t?.comp?.afterGuiAttached?.(e)}))}afterGuiDetached(){this.wrapper?.then((e=>{e?.comp?.afterGuiDetached?.()}))}createFilter(e){const{column:t,source:s,beans:{colFilter:o}}=this,n=o.getFilterUiForDisplay(t)??null;this.wrapper=n,n?.then((n=>{if(!n)return;const{isHandler:r,comp:a}=n;let l;if(r){const e=!!this.enableGlobalButtonCheck,s=this.createBean(new ag(t,n,o,o.updateModel.bind(o),e&&o.isGlobalButtons,e));this.comp=s,l=s.getGui()}else this.registerCSS(":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}"),l=a.getGui(),(0,i.Qmv)(l)||this.beans.log.warn(69,{guiFromFilter:l});this.appendChild(l),e?this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:s,eGui:this.getGui()}):a.afterGuiAttached?.(this.afterGuiAttachedParams)}))}onFilterDestroyed(e){const{source:t,column:s}=e;"api"!==t&&"paramsUpdated"!==t||s.getId()!==this.column.getId()||!this.beans.colModel.getNonPivotCol(this.column)||((0,i.fDi)(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter())}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},dg={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},ug=(e,t,s)=>{if(!t)return;const i=t.startsWith("[")&&t.endsWith("]");let o;try{o=new RegExp(i?t:`[${t}]`)}catch{return void s.log.warn(327,{pattern:t})}e.addManagedElementListeners(e.getInputElement(),{beforeinput:e=>{const t=e.inputType;if(!t?.startsWith("insert")||"insertCompositionText"===t)return;const s=e.data||e.dataTransfer?.getData("text/plain");if(s&&e.cancelable)for(const t of s)if(!o.test(t))return void e.preventDefault()}})},hg=class extends Ca{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},pg=class{init(e,t,s){this.configuredOptions=t.filterOptions??s,this.buildOptions(e,s),this.defaultOption=this.getDefaultItem(e,t.defaultOption)}refresh(e,t,s){const i=t.filterOptions??s;this.configuredOptions!==i&&(this.configuredOptions=i,this.buildOptions(e,s)),this.defaultOption=this.getDefaultItem(e,t.defaultOption)}buildOptions(e,t){this.collectUsableOptions(e,this.configuredOptions),this.filterOptions.length||(e.warn(74),this.collectUsableOptions(e,t))}collectUsableOptions(e,t){const{offered:s,customOptions:o}=function(t,s,o){const n=new Map,r=new Map;for(let s=0,l=t.length;s<l;++s){const l=t[s];if(null!=l)if("string"==typeof l){if(o&&(0,i.iDr)(o,l))continue;n.set(l,n.get(l)??l)}else{const t=Bp.filter((e=>null==l[e]));if(t.length){a=t,e.warn(72,{keys:a});continue}const s=l.displayKey;n.set(s,l),r.set(s,l)}}var a;return{offered:n,customOptions:r}}(t,0,Hp);this.offeredOptions=s,this.filterOptions=[...s.values()],this.customFilterOptions=o}getDefaultItem(e,t){const s=this.filterOptions[0];if(null!=s){if(null!=t){if(this.hasOption(t))return t;e.warn(326,{defaultOption:t})}return"string"==typeof s?s:s.displayKey}}hasOption(e){return null!=e&&this.offeredOptions.has(e)}getCustomOption(e){return null==e?void 0:this.customFilterOptions.get(e)}},gg=class extends Ss{constructor(e,t,s){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=s,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.typeListener=()=>{this.refreshInputValidation(),this.onUiChanged()},this.lastUiCompletePosition=null,this.joinOperatorId=0}refreshInputValidation(e){for(let t=0,s=this.getNumConditions();t<s;++t)this.refreshPositionValidation(t,!1,e)}refreshPositionValidation(e,t,s){}conditionNumberOfInputs(e){return zp(this.getConditionType(e),this.optionsFactory)}setParams(e){super.setParams(e);const t=new pg;this.optionsFactory=t,t.init(this.beans.log,e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(this.beans.log,e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e),this.refreshInputValidation(),this.updateUiVisibility()}commonUpdateSimpleParams(e){var t;this.setNumConditions(e),this.forEachInput((t=>{t instanceof wa&&t.setAutoComplete(e.browserAutoComplete)})),this.defaultJoinOperator="AND"===(t=e.defaultJoinOperator)||"OR"===t?t:"AND",this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions(),(0,i.GUt)(this.getGui(),"tabindex",this.isReadOnly()?"-1":null)}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.refreshInputValidation(),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach(((t,s)=>{const i=0===s?e:this.optionsFactory.defaultOption;t.setValue(i,!0)}))}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionType(e){return this.eTypes[e]?.getValue()??null}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return 0===e.length?t:!0===e[0].getValue()?"OR":"AND"}areNonNullModelsEqual(e,t){const s=!e.operator,o=!t.operator;if(!s&&o||s&&!o)return!1;let n;if(s){const s=e,i=t;n=this.areSimpleModelsEqual(s,i)}else{const s=e,o=t;n=s.operator===o.operator&&(0,i.MpY)(s.conditions,o.conditions,((e,t)=>this.areSimpleModelsEqual(e,t)))}return n}setModelIntoUi(e,t){if(null==e)return this.resetUiToDefaults(t),i.oY$.resolve();if(e.operator){const t=e;let s=t.conditions;null==s&&(s=[],this.beans.log.warn(77));const i=function(e,t,s){let i=t.length;return i>s&&(t.splice(s),e.warn(78),i=s),i}(this.beans.log,s,this.maxNumConditions),o=this.getNumConditions();i<o?this.removeConditionsForModel(i):i>o&&this.createConditionsUpTo(i);const n="OR"===t.operator;this.eJoinAnds.forEach((e=>e.setValue(!n,!0))),this.eJoinOrs.forEach((e=>e.setValue(n,!0))),s.forEach(((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)}))}else{const t=e;this.getNumConditions()>1&&this.removeConditionsForModel(1),this.createConditionsUpTo(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.refreshInputValidation(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),i.oY$.resolve()}setNumConditions(e){let t=Math.floor(e.maxNumConditions??2);Lp(t)&&(this.beans.log.warn(79),t=1),this.maxNumConditions=t;let s=Math.floor(e.numAlwaysVisibleConditions??1);Lp(s)&&(this.beans.log.warn(80),s=1),s>t&&(this.beans.log.warn(81),s=t),this.numAlwaysVisibleConditions=s}createOption(){const e=this.getGui(),t=this.createManagedBean(new bu);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const s=this.createEValue();this.eConditionBodies.push(s),e.appendChild(s),this.putOptionsIntoDropdown(t),this.resetType(t);const i=this.getNumConditions()-1;this.forEachPositionInput(i,(e=>this.resetInput(e))),this.addChangedListeners(t,i)}createJoinOperatorPanel(){const e=ni({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),s=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const i=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,i,o),this.resetJoinOperatorOr(s,i,o),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const i=this.createManagedBean(new hg);e.push(i);const o="ag-filter-condition-operator";return i.addCss(o),i.addCss(`${o}-${s}`),t.appendChild(i.getGui()),i}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map((e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e)))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const s of t)e.addOption(s);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:fs(e)?this.translate(e):this.getLocaleTextFunc()(e,e)}}createCustomListOption(e){const t=e.displayKey;return{value:t,text:ys(this,this.optionsFactory,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 s=0;s<this.getNumConditions();s++)this.isConditionUiComplete(s)?e=s:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createConditionsUpTo(this.getNumConditions()+1);else{const t=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<t){const s=this.removeConditionsAndOperators(t+1),i=e+1,o=t-i;o>0&&this.removeConditionsAndOperators(i,o),this.createMissingConditionsAndOperators(),s||(e=t)}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach(((t,s)=>{const o=this.isConditionDisabled(s,e);t.setDisabled(o||this.filterListOptions.length<=1),1===s&&((0,i.qpX)(this.eJoinPanels[0],o),this.eJoinAnds[0].setDisabled(o),this.eJoinOrs[0].setDisabled(o))})),this.eConditionBodies.forEach(((e,t)=>{(0,i.nl0)(e,this.isConditionBodyVisible(t))}));const s="OR"===(t??this.getJoinOperator());for(const e of this.eJoinAnds)e.setValue(!s,!0);for(const e of this.eJoinOrs)e.setValue(s,!0);this.forEachInput(((t,s,i,o)=>{this.setElementDisplayed(t,s<o),this.setElementDisabled(t,this.isConditionDisabled(i,e))})),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){return!this.hasInvalidInputs()&&(this.removeConditionsForModel(e,t),!0)}removeConditionsForModel(e,t){if(e>=this.getNumConditions())return;const{eTypes:s,eConditionBodies:i,eJoinPanels:o,eJoinAnds:n,eJoinOrs:r}=this;this.removeComponents(s,e,t),this.removeElements(i,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(n,a,t),this.removeComponents(r,a,t)}removeElements(e,t,s){const o=Vp(e,t,s);for(const e of o)(0,i.MwW)(e)}removeComponents(e,t,s){const o=Vp(e,t,s);for(const e of o)(0,i.MwW)(e.getGui()),this.destroyBean(e)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let e;if(!this.isReadOnly()){const t=this.getInputs(0)[0];e=t instanceof wa&&this.isConditionBodyVisible(0)?t.getInputElement():this.eTypes[0]?.getFocusableElement()}(e??this.getGui()).focus({preventScroll:!0})}this.onGuiAttached(e),this.refreshInputValidation(!0)}onGuiAttached(e){}shouldKeepInvalidInputState(){return!(0,i.lju)()&&this.hasInvalidInputs()}afterGuiDetached(){super.afterGuiDetached();const e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column)||this.shouldKeepInvalidInputState())return;e.onStateChange({model:e.model});let t=-1,s=-1,i=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,s=e);else{const o=e<t;if(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o){const t=this.removeConditionsAndOperators(e,1);i||(i=t),t&&o&&s--}}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(s===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(s,o),i&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=s}getModelAsString(e){return this.params.getHandler()?.getModelAsString?.(e)??""}resetPlaceholder(){const e=this.getLocaleTextFunc(),{filterPlaceholder:t,eTypes:s}=this;this.forEachInput(((i,o,n,r)=>{if(!(i instanceof wa))return;const a=0===o&&r>1?"inRangeStart":0===o?"filterOoo":"inRangeEnd",l=0===o&&r>1?e("ariaFilterFromValue","Filter from value"):0===o?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value"),c=s[n].getValue(),d=bs(this,t,a,c,this.optionsFactory);i.setInputPlaceholder(d),i.setInputAriaLabel(l)}))}setElementValue(e,t,s){e instanceof wa&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){(0,i.Zio)(e)&&(0,i.nl0)(e.getGui(),t)}setElementDisabled(e,t){(0,i.Zio)(e)&&(0,i.qpX)(e.getGui(),t)}attachElementOnChange(e,t){e instanceof wa&&e.onValueChange(t),e instanceof Xd&&e.onValueClear((()=>this.onUiCleared()))}forEachInput(e){for(let t=0,s=this.getNumConditions();t<s;++t)this.forEachPositionTypeInput(t,this.getConditionType(t),e)}forEachPositionInput(e,t){const s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){const i=zp(t,this.optionsFactory),o=this.getInputs(e);for(let t=0;t<o.length;t++){const n=o[t];null!=n&&s(n,t,e,i)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){return this.conditionNumberOfInputs(e)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;const t=this.getConditionType(e);return!(!t||"empty"===t||this.getValues(e).some((e=>null==e))||this.positionHasInvalidInputs(e))}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(){this.isReadOnly()||this.createConditionsUpTo(this.numAlwaysVisibleConditions)}createConditionsUpTo(e){for(let t=this.getNumConditions();t<e;t++)t>0&&this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsForModel(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((e=>this.resetType(e))),this.eJoinAnds.forEach(((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t))),this.eJoinOrs.forEach(((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t))),this.joinOperatorId++,this.forEachInput((e=>this.resetInput(e))),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.refreshInputValidation(),this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const t=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,"AND"===this.defaultJoinOperator,this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,"OR"===this.defaultJoinOperator,this.translate("orCondition"),s)}resetJoinOperator(e,t,s,i,o){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(i),t)}updateJoinOperatorsDisabled(){const e=(e,t)=>this.updateJoinOperatorDisabled(e,t);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 s=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput(((e,i,o)=>{o===t&&this.setElementValue(e,null!=s[i]?s[i]:null)}))}setValueFromFloatingFilter(e){this.forEachInput(((t,s,i)=>{this.setElementValue(t,0===s&&0===i?e:null,!0)}))}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.typeListener),this.attachInputsOnChange(t))}attachInputsOnChange(e){this.isReadOnly()||this.forEachPositionInput(e,(e=>{this.attachElementOnChange(e,this.listener)}))}isInputInvalid(e){return!1}isInputValueSettled(e){return!0}hasInvalidInputs(){for(let e=0,t=this.getNumConditions();e<t;++e)if(this.positionHasInvalidInputs(e,!0))return!0;return!1}positionHasInvalidInputs(e,t){let s=!1;return this.forEachPositionInput(e,((e,i,o,n)=>{s||(s=i<n&&(!t||this.isInputValueSettled(e))&&this.isInputInvalid(e))})),s}canApply(e){return!this.hasInvalidInputs()}isReadOnly(){return!!this.params.readOnly}},fg=class extends gg{constructor(){super(...arguments),this.eValuesFrom=[],this.eValuesTo=[],this.renderedValues=new WeakMap,this.defaultDebounceMs=500}isInputInvalid(e){return!e.getInputElement().validity.valid}refreshPositionValidation(e,t=!1){const[s,i]=this.getInputs(e);s&&i&&this.refreshInputPairValidation(s,i,t,this.conditionNumberOfInputs(e))}createTextInput(){return this.createBean(new Xd({clearButton:!0,searchIcon:!0,autoComplete:this.params.browserAutoComplete}))}buildInput(e){const t=this.createInputWidget();return ug(t,this.params.allowedCharPattern,this.beans),t.addCss(`ag-filter-${e}`),t.addCss("ag-filter-filter"),t}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=this.renderedWith;this.renderedWith=e;const s=this.getRenderChange(e,t);s&&this.refreshInputElements("rebuild"===s,t)}destroy(){this.destroyBeans(this.eValuesFrom),this.destroyBeans(this.eValuesTo),super.destroy()}createEValue(){const e=ni({tag:"div",cls:"ag-filter-body",role:"presentation"}),t=this.buildInput("from"),s=this.buildInput("to");return this.eValuesFrom.push(t),this.eValuesTo.push(s),e.appendChild(t.getGui()),e.appendChild(s.getGui()),this.attachInputPairListeners(t,s),e}removeEValues(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getInputs(e){const t=this.eValuesFrom;return e>=0&&e<t.length?[t[e],this.eValuesTo[e]]:[null,null]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,s,i,o)=>{s<o&&t.push(this.readValue(e))})),t}readValue(e,t){const s=this.getRenderedValue(e);return s?s.value:this.parseText(e.getValue(t),this.params)}setElementValue(e,t,s){const i=t,o=this.getValueFormatter(),n=!s&&o?o(i):t;super.setElementValue(e,n,s);const r=e.getInputElement().value;s||""===r&&null!==i?this.renderedValues.delete(e):this.renderedValues.set(e,{text:r,value:i}),null!==i&&null!==n||e.setCustomValidity("")}getRenderedValue(e){const t=this.renderedValues.get(e);return t?.text===e.getInputElement().value?t:void 0}attachInputPairListeners(e,t){this.attachInputListeners(e,!0),this.attachInputListeners(t,!1)}attachInputListeners(e,t){const s=t?this.eValuesFrom:this.eValuesTo,i=()=>this.refreshPositionValidation(s.indexOf(e),t);e.onValueChange((()=>{this.renderedValues.delete(e),i()})),e.addGuiEventListener("focusin",i)}refreshInputElements(e,t){const s=this.eValuesFrom,i=s.length;if(!i)return;const o=this.eValuesTo;for(let n=0;n<i;++n)this.refreshInputElement(n,"from",e,t),this.refreshInputElement(n,"to",e,t),e&&(this.attachInputPairListeners(s[n],o[n]),this.attachInputsOnChange(n))}refreshInputElement(e,t,s,i){const o="from"===t?this.eValuesFrom:this.eValuesTo,n=o[e],r=n.getValue(!0),a=this.getRenderedValue(n),l=a?a.value:this.parseText(r,i),c=!a&&null!=r&&""!==r;let d,u=n;s&&(d=this.takeCaret(n),u=this.buildInput(t),n.getGui().replaceWith(u.getGui()),this.destroyBean(n),o[e]=u),c&&(u.setValue(r,!0),u.getInputElement().value===r)||this.setElementValue(u,l),this.restoreCaret(u,d)}takeCaret(e){const t=e.getInputElement();if((0,i.UlD)(this.beans)===t)return{start:t.selectionStart,end:t.selectionEnd}}restoreCaret(e,t){if(!t)return;const s=e.getInputElement();s.focus(),null!=t.start&&null!=s.selectionStart&&s.setSelectionRange(t.start,t.end)}},mg=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function vg(e){return e?.allowedCharPattern??null}function wg(e,t,s,o){return null==t||""===t.trim()?null:e?e(t,Mp(s,o,"columnFilter")):(0,i.yN4)(t)}function Cg(e,t){const{filter:s,filterTo:o,type:n}=e||{};return[(0,i.yN4)(s),(0,i.yN4)(o)].slice(0,zp(n,t))}var yg=class extends ke{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t,this.warnedKeys=new Set}isNullValue(e){return null==e}warnUnexpectedFilterType(e){this.optionsFactory.getCustomOption(e)||this.warnedKeys.has(e)||(this.warnedKeys.add(e),this.warn(76,{filterModelType:e}))}init(e){const t=e.filterParams,s=new pg;this.optionsFactory=s,s.init(this.beans.log,t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(this.createModelFormatter(s,t,e.column)),this.updateParams(e),this.validateModel(e)}refresh(e){if("colDef"===e.source){const t=e.filterParams,s=this.optionsFactory;s.refresh(this.beans.log,t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:s,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(null==t)return!0;const{operator:s}=t,i=[];if(s){const e=t;i.push(...e.conditions??[])}else i.push(t);if(!i.length)return!0;const o=s&&"OR"===s?"some":"every",n=this.params.getValue(e.node);return i[o]((t=>this.individualConditionPasses(e,t,n)))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{maxNumConditions:s}}=e;if(null==t)return;const i=rs(t);let o=(i?t.conditions:[t])??[];if(!o.every((e=>this.optionsFactory.hasOption(e.type))))return this.params={...e,model:null},void e.onModelChange(null);let n=!1;const r=this.filterType;o.every((e=>e.filterType===r))&&t.filterType===r||(o=o.map((e=>({...e,filterType:r}))),n=!0);const a=function(e){return"number"!=typeof e?null:Lp(e)?1:Math.floor(e)}(s);if(null!==a&&o.length>a&&(o=o.slice(0,a),n=!0),n){let s;1===o.length?s={...o[0],filterType:r}:(s={...t,filterType:r},i&&t.conditions&&(s.conditions=o)),this.params={...e,model:s},e.onModelChange(s)}}individualConditionPasses(e,t,s){const i=this.optionsFactory,o=this.mapValuesFromModel(t,i),n=function(e,t,s,i,o){const n=e?.predicate;if(null!=n&&!t.some((e=>null==e)))return n(t,s,Mp(i,o,"columnFilter"))}(i.getCustomOption(t.type),o,s,this.beans.gos,this.params.column);return null!=n?n:this.isNullValue(s)?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,s,t,e)}},bg=class extends yg{isNullValue(e){return _p(e)}evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:i,includeBlanksInLessThan:o,includeBlanksInRange:n}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(s)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(i)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(n)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,s){const i=s.type;if(!this.isValid(t))return"notEqual"===i||"notBlank"===i;if("blank"===i)return!1;if("notBlank"===i)return!0;const o=this.comparator(),n=null!=e[0]?o(e[0],t):0;switch(i){case"equals":return 0===n;case"notEqual":return 0!==n;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const s=o(e[1],t);return this.params.filterParams.inRangeInclusive?n>=0&&s<=0:n>0&&s<0}default:return this.warnUnexpectedFilterType(i),!0}}},Sg={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},xg={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Rg=class extends ke{constructor(e,t,s){super(),this.optionsFactory=e,this.filterParams=t,this.column=s}getValueFormatter(){}getModelAsString(e,t){const s=this.getLocaleTextFunc(),i="filterToolPanel"===t;if(!e)return i?vs(this,"filterSummaryInactive"):null;if(null!=e.operator){const s=e,i=(s.conditions??[]).map((e=>this.getModelAsString(e,t))),o="AND"===s.operator?"andCondition":"orCondition";return i.join(` ${vs(this,o)} `)}if("blank"===e.type||"notBlank"===e.type)return i?vs(this,"blank"===e.type?"filterSummaryBlank":"filterSummaryNotBlank"):s(e.type,e.type);{const t=e,o=this.optionsFactory.getCustomOption(t.type),n=o?Gp(o):void 0;return o&&0===n?function(e,t){const s=String(e.displayKey);return t(s,e.displayName).trim()||s.trim()}(o,s):this.conditionToString(t,i,"inRange"===t.type||2===n,o?.displayKey,o?.displayName)}}updateParams(e){const{optionsFactory:t,filterParams:s}=e;this.optionsFactory=t,this.filterParams=s}conditionForToolPanel(e,t,s,i,o,n){let r;const a=this.getTypeKey(e);return a&&(r=vs(this,a)),o&&n&&(r=this.getLocaleTextFunc()(o,n)),null!=r?t?`${r} ${vs(this,"filterSummaryInRangeValues",[s(),i()])}`:`${r} ${s()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.getValueFormatter();return t?t(e??null)??"":String(e)}},Pg=class extends Rg{constructor(){super(...arguments),this.filterTypeKeys=Sg}getValueFormatter(){return Np(this.filterParams.bigintFormatter,this.gos,this.column,"columnFilter")}conditionToString(e,t,s,o,n){const{filter:r,filterTo:a,type:l}=e,c=this.formatValue.bind(this),d=(0,i.yN4)(r),u=(0,i.yN4)(a);if(t){const e=this.conditionForToolPanel(l,s,(()=>c(d)),(()=>c(u)),o,n);if(null!=e)return e}return s?`${c(d)}-${c(u)}`:null!=r?c(d):`${l}`}},Eg=class extends ke{constructor(e){super(),this.onInputCreated=e,this.eInput=i.dRA,this.onValueChanged=()=>{},this.onValueCleared=()=>{}}setupGui(e){const t=this.createManagedBean(new Xd({clearButton:!0,onValueClear:()=>this.onValueCleared()}));this.eInput=t,this.onInputCreated?.(t);const s=t.getGui();e.appendChild(s);const i=e=>this.onValueChanged(e);this.addManagedListeners(s,{input:i,keydown:i})}setEditable(e){this.eInput.setDisabled(!e)}isFocused(){return(0,i.UlD)(this.beans)===this.eInput.getInputElement()}getValue(){return this.eInput.getValue()}getInputText(){return this.eInput.getInputElement().value}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setValueClearedListener(e){this.onValueCleared=e}setParams({ariaLabel:e,autoComplete:t,placeholder:s}){const{eInput:i}=this;i.setInputAriaLabel(e),i.setAutoComplete(t),i.setSearchIcon(!!s),i.setInputPlaceholder(s)}},Ig=e=>null==e?null:e.toString().toLowerCase(),kg={contains:(e,t)=>e.includes(t),notContains:(e,t)=>!e.includes(t),equals:(e,t)=>e===t,notEqual:(e,t)=>e!=t,startsWith:(e,t)=>e.startsWith(t),endsWith:(e,t)=>e.endsWith(t)};function Fg(e){const t=e?.trim();return""===t?e:t}function Dg(e,t){const{filter:s,filterTo:i,type:o}=e||{};return[s||null,i||null].slice(0,zp(o,t))}var Tg=class extends ls{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.defaultOption);let t;if(e.operator){const s=e;t=s.conditions?.[0]}else t=e;this.lastType=t?t.type:this.optionsFactory.defaultOption}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const t=e;this.onModelUpdated(t.model)}}setParams(e){const t=new pg;this.optionsFactory=t,t.init(this.beans.log,e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(this.createModelFormatter(t,e.filterParams,e.column)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const s=this.optionsFactory.defaultOption;t||(this.lastType=s),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(s);this.setEditable(i)}refresh(e){this.params=e;const t=e,s=this.reactive;if(s&&"colDef"!==t.source||this.updateParams(e),s){const{source:e,model:s}=t;if("dataChanged"===e||"ui"===e)return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(this.beans.log,e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t?.afterFloatingFilter||t?.afterDataChange||this.onModelUpdated(e)}isTypeEditable(e){return!!e&&!this.readOnly&&1===zp(e,this.optionsFactory)}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Ag={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},Mg=class extends Tg{constructor(){super(...arguments),this.eFloatingFilterInputContainer=i.dRA,this.pendingEdit=!1,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Ag)}onModelUpdated(e){const{inputSvc:t}=this;this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),t.isFocused()&&this.pendingEdit||(t.setValue(this.filterModelFormatter.getModelAsString(e)),this.pendingEdit=!1)}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{inputSvc:t,defaultDebounceMs:s,readOnly:o}=this,{filterPlaceholder:n,column:r,browserAutoComplete:a,filterParams:l}=e,c=this.lastType??this.optionsFactory.defaultOption,d=e.filterParams.filterPlaceholder,u=!0===n?bs(this,d,"filterOoo",c,this.optionsFactory):n||void 0;if(t.setParams({ariaLabel:this.getAriaLabel(r),autoComplete:a??l.browserAutoComplete,placeholder:u}),this.applyActive=Cs(l),!o){const e=ws(this.beans.log,l,s),o=(0,i.pkA)(this,this.syncUpWithParentFilter.bind(this),e);let n;t.setValueChangedListener((e=>{this.pendingEdit=!0,n=o(e)})),t.setValueClearedListener((()=>{clearTimeout(n),this.syncUpWithParentFilter()}))}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.inputSvc,s=t.getInputText();(0,i.fDi)(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),this.inputSvc.setValue(s,!0)}syncUpWithParentFilter(e){const t=e?.key===i.DDm.ENTER,s=this.reactive;if(s&&this.params.onUiChange(),this.applyActive&&!t)return;this.pendingEdit=!1;const{inputSvc:o,params:n,lastType:r}=this;let a=o.getValue();if(n.filterParams.trimInput&&(a=Fg(a),o.setValue(a,!0)),s){const e=n,t=e.model,s=this.convertValue(a),i=null==s?null:{...t??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:s};e.onModelChange(i,{afterFloatingFilter:!0})}else n.parentFilterInstance((e=>{e?.onFloatingFilterChanged(r||null,a||null)}))}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Ng=".ag-input-field-input",Lg=i.WOR?0:500,Vg=class{constructor(e,t,s,o,n,r){this.context=e,this.eParent=n,this.alive=!0,this.debouncedReport=(0,i.pkA)({isAlive:()=>this.alive},_g,Lg),this.timeoutHandle=null,this.lastValidityMessage=null;const a=function(e,t,s){return e.getCompDetails(t,Bt,"agDateInput",s,!0)}(t,s,o);a?.newAgStackInstance().then((t=>{if(!this.alive)return void e.destroyBean(t);if(this.dateComp=t,!t)return;n.appendChild(t.getGui()),t?.afterGuiAttached?.();const{tempValue:s,disabled:i}=this;s&&t.setDate(s),null!=i&&t.setDisabled?.(i),r?.(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){const t=this.dateComp;t?t.setDisabled?.(e):this.disabled=e}setDisplayed(e){(0,i.nl0)(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}setCustomValidity(e,t="immediate"){const s=this.dateComp?.getGui().querySelector(Ng);if(s&&"setCustomValidity"in s){const o=e.length>0,n=e!==this.lastValidityMessage;this.lastValidityMessage=e,s.setCustomValidity(e),o?"immediate"===t?_g(s):("debounce"===t||n)&&(this.timeoutHandle=this.debouncedReport(s)):this.timeoutHandle&&window.clearTimeout(this.timeoutHandle),(0,i.gs1)(s,o)}}getValidity(){return this.dateComp?.getGui().querySelector(Ng)?.validity}};function _g(e){e.reportValidity()}var Og=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function Bg(e,t){const{dateFrom:s,dateTo:o,type:n}=e||{};return[s&&(0,i.xmb)(s,void 0,!0)||null,o&&(0,i.xmb)(o,void 0,!0)||null].slice(0,zp(n,t))}var Hg=1/0,Gg=class extends Rg{constructor(){super(...arguments),this.filterTypeKeys=Sg}formatValue(e=null){const{dataTypeSvc:t,valueSvc:s}=this.beans,i=this.filterParams.column,o=t?.getDateFormatterFunction(i),n=o?o(e??void 0):e;return s.formatValue(i,null,n)??""}conditionToString(e,t,s,o,n){const{type:r}=e,a=(0,i.xmb)(e.dateFrom),l=(0,i.xmb)(e.dateTo),c=this.filterParams.inRangeFloatingFilterDateFormat,d=t?this.formatValue.bind(this):e=>(0,i.o$6)(e,c),u=()=>null!==a?d(a):"null",h=()=>null!==l?d(l):"null";if(null==a&&null==l)return ms(this,r);if(t){const e=this.conditionForToolPanel(r,s,u,h,o,n);if(null!=e)return e}return s?`${u()}-${h()}`:null!=a?d(a):`${r}`}};function zg(e,t){return t<e?-1:t>e?1:0}var Wg={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"}]},jg={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]};function Ug(e,t,s,o){return t&&s&&e.warn(o?85:86),t instanceof Date?t:t?(0,i.xmb)(t):s?(0,i.xmb)(`${s}-${o?"01-01":"12-31"}`):null}var $g=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function Yg(e){return e?.allowedCharPattern??null}function Kg(e){const t=e?.filterInputType;return t?"text"===t:null!=e?.allowedCharPattern||null!=e?.numberFormatter}function qg(e,t,s,i){if("number"==typeof t)return t;const o=t?.trim()??"",n=""===o?null:t??null;return e?e(n,Mp(s,i,"columnFilter")):null==n||"-"===o?null:Number.parseFloat(n)}function Zg(e){return null==e||isNaN(e)?null:e}function Qg(e,t){const{filter:s,filterTo:i,type:o}=e||{};return[Zg(s),Zg(i)].slice(0,zp(o,t))}var Jg=class extends Rg{constructor(){super(...arguments),this.filterTypeKeys=Sg}getValueFormatter(){return Np(this.filterParams.numberFormatter,this.gos,this.column,"columnFilter")}conditionToString(e,t,s,i,o){const{filter:n,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const e=this.conditionForToolPanel(a,s,(()=>l(n)),(()=>l(r)),i,o);if(null!=e)return e}return s?`${l(n)}-${l(r)}`:null!=n?l(n):`${a}`}},Xg=class extends ke{constructor(e){super(),this.onInputCreated=e,this.onValueChanged=()=>{},this.onValueCleared=()=>{},this.numberInputActive=!0}setupGui(e){const t=this.createManagedBean(new pu({clearButton:!0,onValueClear:()=>this.onValueCleared()}));this.eNumberInput=t,this.onInputCreated?.(t);const s=this.createManagedBean(new Xd({clearButton:!0,onValueClear:()=>this.onValueCleared()}));this.eTextInput=s,s.setDisabled(!0);const i=t.getGui(),o=s.getGui();e.appendChild(i),e.appendChild(o),this.setupListeners(i,(e=>this.onValueChanged(e))),this.setupListeners(o,(e=>this.onValueChanged(e)))}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)}isFocused(){return(0,i.UlD)(this.beans)===this.getActiveInputElement().getInputElement()}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}getInputText(){return this.getActiveInputElement().getInputElement().value}setValueChangedListener(e){this.onValueChanged=e}setValueClearedListener(e){this.onValueCleared=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams({ariaLabel:e,autoComplete:t,placeholder:s}){this.setAriaLabel(e),this.setAutoComplete(t),this.setPlaceholder(this.eNumberInput,s),this.setPlaceholder(this.eTextInput,s)}setPlaceholder(e,t){e.setSearchIcon(!!t),e.setInputPlaceholder(t)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},ef=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],tf=class extends Rg{constructor(){super(...arguments),this.filterTypeKeys=xg}conditionToString(e,t,s,i,o){const{filter:n,filterTo:r,type:a}=e;if(t){const e=e=>()=>vs(this,"filterSummaryTextQuote",[e]),t=this.conditionForToolPanel(a,s,e(n),e(r),i,o);if(null!=t)return t}return s?`${n}-${r}`:null!=n?`${n}`:`${a}`}},sf=({filterOption:e,value:t,filterText:s})=>{if(null==s||null==t)return!1;const o=null==e?void 0:(0,i.iDr)(kg,e);return!!o&&o(t,s)},of=e=>e,nf={moduleName:"FilterCore",version:cn,beans:[class extends ke{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:this.onPivotColumnsChanged.bind(this),columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:e})=>this.onAdvFilterEnabledChanged(e),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:({source:e})=>this.onFilterChanged({source:e??"quickFilter"})});const{gos:s}=this;this.alwaysPassFilter=s.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",(()=>{this.alwaysPassFilter=s.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})}))}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterState(e,t,s="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,s)}setFilterModel(e,t="api",s){this.isAdvFilterEnabled()?s||this.warnAdvFilters():this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.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){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){te(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onPivotColumnsChanged(){this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:s,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):i.oY$.resolve()).then((()=>{const e={source:t,type:"filterChanged",columns:o};s&&F(e,s),this.eventSvc.dispatchEvent(e),this.colFilter?.updateAfterFilterChanged()}))}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!te(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.pivotMode)&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassAggregateFilters(e){const{rowNode:t}=e;return!(!this.alwaysPassFilter?.(t)&&(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0)))}doesRowPassFilter(e,t){return!(!this.alwaysPassFilter?.(e)&&(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(e)||this.externalFilterPresent&&!this.doesExternalFilterPass(e)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(e,t)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(e)))}isFilterAllowed(e){return!this.isAdvFilterEnabled()&&!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){this.isAdvFilterEnabled()&&(this.beans.dataTypeSvc?.isPendingInference?this.advFilterModelUpdateQueue.push(e):(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(){return!this.isAdvFilterEnabled()&&!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){this.warn(68)}mountAdvFilterTopSectionComp(e){this.advancedFilter?.getCtrl().mountTopSectionComp(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){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}}],apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},css:[".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;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){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{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%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){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(.ag-input-field-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:max(200px,100%)}.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;gap:var(--ag-widget-vertical-spacing);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:var(--ag-widget-container-vertical-padding);: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)}"]},rf={moduleName:"FilterValue",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,s){const i=e.colDef,o=this.beans,n=s??o.selectableFilter?.getFilterValueGetter(e.colId)??i.filterValueGetter,r=o.valueSvc;if(n){const s="function"==typeof n,a=o.expressionSvc;if(!s&&!a)return;const l=o.colModel,c={api:o.gridApi,context:o.gridOptions.context,data:t.data,node:t,column:e,colDef:i,getValue:e=>{const s=l.getCol(e);return s?r.getValueFromData(nt(s,t),t):null}};return s?n(c):a.evaluate(n,c)}const a=r.getValueFromData(e,t);if(e.allowFormula){const s=o.formula;if(s?.isFormula(a))return s.resolveValue(e,t)}return a}}]},af={moduleName:"ColumnFilter",version:cn,beans:[class extends ke{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={...ep},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",s){const{colModel:o,dataTypeSvc:n,filterManager:r}=this.beans;if(n?.isPendingInference)return void this.modelUpdates.push({model:e,source:t});const a=[],l=this.getModel(!0);if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach(((s,i)=>{const o=e[i];a.push(this.setModelOnFilterWrapper(s,o)),t.delete(i)})),t.forEach((t=>{const s=o.colsById[t];if(!s)return void this.warn(62,{colId:t});if(!s.isFilterAllowed())return void this.warn(63,{colId:t});const i=this.getOrCreateFilterWrapper(s,!0);i?a.push(this.setModelOnFilterWrapper(i,e[t],!0)):this.warn(64,{colId:t})}))}else this.model={},this.allColumnFilters.forEach((e=>{a.push(this.setModelOnFilterWrapper(e,null))}));i.oY$.all(a).then((()=>{const e=this.getModel(!0),o=[];this.allColumnFilters.forEach(((t,s)=>{const n=l?l[s]:null,r=e?e[s]:null;(0,i.V67)(n,r)||o.push(t.column)})),o.length>0?r?.onFilterChanged({columns:o,source:t}):s&&this.updateActive("filterChanged")}))}getModel(e){const t={},{allColumnFilters:s,initialModel:o,beans:{colModel:n}}=this;if(s.forEach(((e,s)=>{const o=this.getModelFromFilterWrapper(e);(0,i.Qmv)(o)&&(t[s]=o)})),!e)for(const e of Object.keys(o)){const r=o[e];(0,i.Qmv)(r)&&!s.has(e)&&n.colsById[e]?.colDef.filter&&(t[e]=r)}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(const e of Object.keys(t)){const s=t[e];this.state.set(e,{model:rp(this.model,e),state:s})}this.setModel(e,s,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let s=!1;return e.forEach(((e,i)=>{const o=e.state;null!=o&&(s=!0,t[i]=o)})),s?t:void 0}getModelFromFilterWrapper(e){const t=e.column.getColId();if(e.isHandler)return rp(this.model,t);const s=e.filter;return s?"function"!=typeof s.getModel?(this.warn(66),null):s.getModel():rp(this.initialModel,t)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return!!e.size&&(e.forEach((e=>this.disposeFilterWrapper(e,"advancedFilterEnabled"))),!0)}updateActiveFilters(){const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(this.warn(67),!1)),{colModel:t,gos:s}=this.beans,o=!!te(s),n=[],r=[],a=(e,s,i)=>{s&&(ng(e,t.pivotMode,t.isPivotActive(),o)?n.push(i):r.push(i))},l=[];return this.allColumnFilters.forEach((t=>{const s=t.column,o=s.getColId();if(t.isHandler)l.push(i.oY$.resolve().then((()=>{a(s,this.isHandlerActive(s),{colId:o,isHandler:!0,handler:t.handler,handlerParams:t.handlerParams})})));else{const i=sp(t);i&&l.push(i.then((t=>{a(s,e(t),{colId:o,isHandler:!1,comp:t})})))}})),i.oY$.all(l).then((()=>{this.activeAggregateFilters=n,this.activeColumnFilters=r}))}updateFilterFlagInColumns(e,t){const s=[];return this.allColumnFilters.forEach((o=>{const n=o.column;if(o.isHandler)s.push(i.oY$.resolve().then((()=>{this.setColFilterActive(n,this.isHandlerActive(n),e,t)})));else{const i=sp(o);i&&s.push(i.then((s=>{this.setColFilterActive(n,s.isFilterActive(),e,t)})))}})),this.beans.groupFilter?.updateFilterFlags(e,t),i.oY$.all(s)}doFiltersPass(e,t,s){const{data:i,aggData:o}=e,n=s?this.activeAggregateFilters:this.activeColumnFilters,r=s?o:i,a=this.model;for(let s=0;s<n.length;s++){const i=n[s],{colId:o,isHandler:l}=i;if(o!==t)if(l){const{handler:t,handlerParams:s}=i;if(!t.doesFilterPass({node:e,data:r,model:rp(a,o),handlerParams:s}))return!1}else{const t=i.comp;if("function"!=typeof t.doesFilterPass){this.error(91);continue}if(!t.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t?.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:s}=this.beans,i=()=>{this.isAlive()&&s?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(i,0):i()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:s}=e,i=t?.getColId();return this.updateActiveFilters().then((()=>this.updateFilterFlagInColumns("filterChanged",s).then((()=>{this.allColumnFilters.forEach((e=>{const{column:t,isHandler:s}=e;i!==t.getColId()&&(s&&e.handler.onAnyFilterChanged?.(),sp(e,s)?.then((e=>{"function"==typeof e?.onAnyFilterChanged&&e.onAnyFilterChanged()})))})),this.processingFilterChange=!0}))))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!this.gos.get("allowShowChangeAfterFilter")&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach((e=>{const s=e.isHandler;s&&e.handler.onNewRowsLoaded?.();const i=sp(e,s);i&&t.push(i.then((e=>{e.onNewRowsLoaded?.()})))})),i.oY$.all(t).then((()=>this.updateActive(e,{afterDataChange:!0})))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then((()=>this.updateActiveFilters()))}createGetValue(e,t){const{filterValueSvc:s,colModel:i}=this.beans;return(o,n)=>{const r=n?i.getCol(n):e;return r?s.getValue(r,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const s=t?.filter;return s?s.isFilterActive():null!=rp(this.initialModel,e.getColId())}isHandlerActive(e){const t=(0,i.Qmv)(rp(this.model,e.getColId()));if(t)return t;const s=this.beans.groupFilter;return!!s?.isGroupFilter(e)&&s.isFilterActive(e)}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?sp(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const s=sp(t);return s?s.then((e=>({comp:e,params:t.filterUi.filterParams,isHandler:t.isHandler}))):null}getHandler(e,t){const s=this.getOrCreateFilterWrapper(e,t);return s?.isHandler?s.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let s=this.cachedFilter(e);return!s&&t&&(s=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,s)),s}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType((()=>this.beans.dataTypeSvc?.getBaseDataType(e)),t)}getDefaultFilterFromDataType(e,t=!1){return(s=this.gos).isModuleRegistered("SetFilter")&&!s.get("suppressSetFilterByDefault")?t?"agSetColumnFloatingFilter":"agSetColumnFilter":function(e,t=!1){return(t?ig:sg)[e??"text"]}(e(),t);var s}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,i,o,n){const r=()=>{const r=this.createFilterCompParams(e,o,n),a=i(r,o);return function(e,t,s,i){const o=t.filter;return _t(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,qt,i,s,!0)}(this.beans.userCompFactory,t,a,s)},a=r();return a?{compDetails:a,createFilterUi:e=>(e?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,s,i){const o=this.beans.selectableFilter;o?.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,i,!!n,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:d}=l;return this.isGlobalButtons&&(c.params?.buttons?.length||this.warn(281,{colId:e.getColId()})),{compDetails:c,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:s,rowModel:i}=this.beans;return xe(this.gos,{column:e,colDef:e.colDef,getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:t=>s?.doesRowPassFilter(t,e.getColId())??!0,rowModel:i})}createFilterCompParams(e,t,s,i){const o=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,i);if(n.filterChangedCallback=o,n.filterModifiedCallback=i?()=>{}:t=>this.filterModified(e,t),t){const t=n,i=e.getColId(),r=rp(this.model,i);t.model=r,t.state=this.state.get(i)??{model:r},t.onModelChange=(t,s)=>{this.updateStoredModel(i,t),this.refreshHandlerAndUi(e,t,"ui",!1,s).then((()=>{o({...s,source:"columnFilter"})}))},t.onStateChange=t=>{this.updateState(e,t),this.updateOrRefreshFilterUi(e)},t.onAction=(t,s,i)=>{this.updateModel(e,t,s),this.dispatchLocalEvent({type:"filterAction",column:e,action:t,event:i})},t.getHandler=()=>this.getHandler(e,!0),t.onUiChange=t=>this.filterUiChanged(e,t),t.source=s}return n}createFilterUiForHandler(e,t,s){return t?{created:!1,refreshed:s,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,s){const i=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:i};return i.then(s),o}createFilterWrapper(e){const{compDetails:t,handler:s,handlerGenerator:i,handlerParams:o,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),(e=>e)),r=e.getColId();if(s)return delete this.initialModel[r],s.init?.({...o,source:"init",model:rp(this.model,r)}),{column:e,isHandler:!0,handler:s,handlerGenerator:i,handlerParams:o,filterUi:this.createFilterUiForHandler(t,n)};if(n){const s={column:e,filterUi:null,isHandler:!1};return s.filterUi=this.createFilterUiLegacy(t,n,(e=>{s.filter=e??void 0})),s}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,s){const{gos:i,frameworkOverrides:o,registry:n}=this.beans;let r;const a=i.get("enableFilterHandlers"),l=a?(e=>{const t=e.filter;if(_t(t)){return t.handler||(r=t.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return"string"==typeof t?t:void 0})(t):void 0,c=e=>()=>this.createBean(n.createDynamicBean(e,!0));let d,u;if("string"==typeof l){const e=i.get("filterHandlers")?.[l];null!=e?d=e:tp.has(l)&&(d=c(l),u=l)}else d=l;if(!d){let e;const{compName:i,jsComp:n,fwComp:r}=os(o,t);i?e=i:null==n&&null==r&&!0===t.filter&&(e=s),u=this.handlerMap[e],u&&(d=c(u))}if(!d){if(!a)return;return B(i)&&this.warn(277,{colId:e.getColId()}),og}return{filterHandler:d,handlerNameOrCallback:r??u}}createHandler(e,t,s){const i=this.createHandlerFunc(e,t,s);if(!i)return;const o=ns(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=i,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,s){const i=e.getColDef();return{handler:t(xe(this.gos,{column:e,colDef:i})),handlerParams:this.createHandlerParams(e,s)}}createHandlerParams(e,t){const s=e.getColDef(),i=e.getColId(),o=this.filterChangedCallbackFactory(e);return xe(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:e=>this.beans.filterManager?.doesRowPassFilter(e,i)??!0,onModelChange:(t,s)=>{this.updateStoredModel(i,t),this.refreshHandlerAndUi(e,t,"handler",!1,s).then((()=>{o({...s,source:"columnFilter"})}))},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:s,groupFilter:i}=this.beans;this.allColumnFilters.forEach(((s,i)=>{let o;o=s.column.primary?t.getNonPivotColById(i):t.colsById[i],o&&o===s.column||(e.push(s.column),this.disposeFilterWrapper(s,"columnChanged"),this.disposeColumnListener(i))}));const o=i&&e.every((e=>i.isGroupFilter(e)));e.length>0&&!o&&s?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const t=this.beans.groupFilter;return!t?.isGroupFilter(e)||t.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){const{userCompFactory:s,frameworkOverrides:i,selectableFilter:o,gos:n}=this.beans,r=e.getColDef(),a=o?.isSelectable(r)?o.getFilterDef(e,r):r,l=function(e,t,s){if(null==t)return null;let i=null;const{compName:o,jsComp:n,fwComp:r}=os(e,t);return o?i={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]:null==n&&null==r&&!0===t.filter&&(i=s()),i}(i,a,(()=>this.getDefaultFloatingFilter(e)))??"agReadOnlyFloatingFilter",c=n.get("enableFilterHandlers"),d=ns(s,a,this.createFilterCompParams(e,c,"init",!0)),u=xe(n,{column:e,filterParams:d,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:t=>{const s=this.getOrCreateFilterUi(e);s?.then((e=>{t(Iu(e))}))},showParentFilter:t});if(c){const t=u,s=e.getColId(),i=this.filterChangedCallbackFactory(e);t.onUiChange=t=>this.floatingFilterUiChanged(e,t),t.model=rp(this.model,s),t.onModelChange=(t,o)=>{this.updateStoredModel(s,t),this.refreshHandlerAndUi(e,t,"floating",!0,o).then((()=>{i({...o,source:"columnFilter"})}))},t.getHandler=()=>this.getHandler(e,!0),t.source="init"}return function(e,t,s,i){return e.getCompDetails(t,Zt,i,s)}(s,r,u,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,i){const o="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi,a=this.createFilterUiForHandler(s,i,!0);e.filterUi=a;const l=this.eventSvc;r?.created?r.promise.then((e=>{this.destroyBean(e),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})})):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const s=e.getColId(),i=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialModel[s],i&&this.disposeFilterWrapper(i,t).then((t=>{t&&this.isAlive()&&this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let s=!1;const{column:o,isHandler:n,filterUi:r}=e,a=o.getColId();n&&(s=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[a],this.state.delete(a));const l=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(a),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(r){if(r.created)return r.promise.then((e=>(s=n?s:!!e?.isFilterActive(),this.destroyBean(e),l(),s)));l()}return i.oY$.resolve(s)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}refreshOrRecreateHandler(e,t,s,i,o){const n=e.column,r=n.getColId(),a=t.handlerNameOrCallback??t.filterHandler,l=rp(this.model,r);let c=e.handlerGenerator!=a;if(!c){const t=this.createHandlerParams(n,s?.params);e.handlerParams=t,c=!1===e.handler.refresh?.({...t,source:"colDef",model:l})}if(!c)return!1;const d=e.handler,{handler:u,handlerParams:h}=this.createHandlerFromFunc(n,t.filterHandler,i);return e.handler=u,e.handlerParams=h,e.handlerGenerator=a,delete this.model[r],this.state.delete(r),u.init?.({...h,source:"init",model:null}),this.destroyBean(d),null!=l&&this.beans.filterManager?.onFilterChanged({columns:[n],source:o}),!0}filterParamsChanged(e,t="api"){const s=this.allColumnFilters.get(e);if(!s)return;const i=this.beans,o=s.column,n=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=i.selectableFilter,c=l?.isSelectable(n)?l.getFilterDef(o,n):n,d=r?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,u=!!d,h=s.isHandler;if(h!=u)return void this.destroyFilter(o,"paramsUpdated");const{compDetails:p,createFilterUi:g}=(r?this.createFilterComp(o,c,a,(e=>e),u,"colDef"):null)??{compDetails:null,createFilterUi:null},f=p?.params??ns(i.userCompFactory,c,this.createFilterCompParams(o,u,"colDef"));let m=!1;h&&(m=this.refreshOrRecreateHandler(s,d,p,f,t));const v=s.filterUi;h&&v&&p&&!v.created?s.filterUi=this.createFilterUiForHandler(p,g,m):!this.areFilterCompsDifferent(v?.compDetails??null,p)&&v&&p?(v.filterParams=f,sp(s,h)?.then((e=>{!1===(!e?.refresh||e.refresh(f))?this.destroyFilterUi(s,o,p,g):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:f})}))):this.destroyFilterUi(s,o,p,g)}refreshHandlerAndUi(e,t,s,o,n){const r=this.cachedFilter(e);if(!r)return o&&this.getOrCreateFilterWrapper(e,!0),i.oY$.resolve();if(!r.isHandler)return i.oY$.resolve();const{filterUi:a,handler:l,handlerParams:c}=r;return function(e,t,s,o,n,r,l){return t.refresh?.({...s,model:o,source:r,additionalEventAttributes:l}),(()=>{if(a){const{created:e,filterParams:t}=a;if(e)return a.promise.then((e=>e?{filter:e,filterParams:t}:void 0));a.refreshed=!0}return i.oY$.resolve(void 0)})().then((e=>{if(e){const{filter:t,filterParams:s}=e;ip(t,s,o,n,r,l)}}))}(0,l,c,t,this.state.get(e.getColId())??{model:t},s,n)}setColumnFilterWrapper(e,t){const s=e.getColId();this.allColumnFilters.set(s,t),this.allColumnListeners.set(s,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(s)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:s}=e,{componentClass:i}=t;return!(s===i||s?.render&&i?.render&&s.render===i.render)}hasFloatingFilters(){return this.beans.colModel.colsList.some((e=>e.getColDef().floatingFilter))}getFilterInstance(e){const t=this.beans.colModel.getCol(e);if(!t)return Promise.resolve(void 0);const s=this.getOrCreateFilterUi(t);return s?new Promise((e=>{s.then((t=>{e(Iu(t))}))})):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:s})=>{this.setModelForColumn(e,t).then((()=>s()))})),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:t,model:s}=this,i=e.getColId(),o=t.get(i);return o?o.model??null:rp(s,i)}const s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{};const i=new Promise((e=>{s=e}));return this.columnModelUpdates.push({key:e,model:t,resolve:s}),i}return new Promise((s=>{this.setModelForColumnLegacy(e,t).then((e=>s(e)))}))}getStateForColumn(e){return this.state.get(e)??{model:rp(this.model,e)}}setModelForColumnLegacy(e,t){const s=this.beans.colModel.getNonPivotCol(e),o=s?this.getOrCreateFilterWrapper(s,!0):null;return o?this.setModelOnFilterWrapper(o,t):i.oY$.resolve()}setColDefPropsForDataType(e,t,s){const i=e.filter,o=!0===i?this.getDefaultFilterFromDataType((()=>t.baseDataType)):i;if("string"!=typeof o)return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;({filterParams:n,filterValueGetter:r}="agMultiColumnFilter"===o?a.multiFilter?.getParamsForDataType(l,c,t,s)??{}:function(e,t,s,i,o,n,r){let a=s;const l="agSetColumnFilter"===e;a||"object"!==i.baseDataType||l||(a=({column:e,node:t})=>o({column:e,node:t,value:t?n.valueSvc.getValueFromData(e,t):void 0}));const c=(0,(l?tg:Xp)[i.baseDataType])({dataTypeDefinition:i,formatValue:o,t:r});return{filterParams:"object"==typeof t?{...c,...t}:c,filterValueGetter:a}}(o,l,c,t,s,a,this.getLocaleTextFunc())),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,s,i){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s)),e.dispatchColEvent("filterChanged",s,i)}setModelOnFilterWrapper(e,t,s){return new i.oY$((o=>{if(e.isHandler){const i=e.column,n=i.getColId(),r=this.model[n];return this.updateStoredModel(n,t),s&&t===r?void o():void this.refreshHandlerAndUi(i,t,"api").then((()=>o()))}const n=sp(e);n?n.then((e=>{if("function"!=typeof e?.setModel)return this.warn(65),void o();(e.setModel(t)||i.oY$.resolve()).then((()=>o()))})):o()}))}updateStoredModel(e,t){(0,i.Qmv)(t)?this.model[e]=t:delete this.model[e];const s=this.state.get(e),o={model:t,state:s?.state};this.state.set(e,o)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then((s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...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,s){const i=e.getColId(),o=this.cachedFilter(e),n=()=>o?.filterUi;np({action:t,filterParams:o?.filterUi?.filterParams,getFilterUi:n,getModel:()=>rp(this.model,i),getState:()=>this.state.get(i),updateState:t=>this.updateState(e,t),updateModel:e=>n()?.filterParams?.onModelChange(e,{...s,fromAction:t}),processModelToApply:o?.isHandler?o.handler.processModelToApply?.bind(o.handler):void 0})}updateAllModels(e,t){const s=[];this.allColumnFilters.forEach(((t,i)=>{const o=this.beans.colModel.getNonPivotColById(i);o&&np({action:e,filterParams:t.filterUi?.filterParams,getFilterUi:()=>t.filterUi,getModel:()=>rp(this.model,i),getState:()=>this.state.get(i),updateState:e=>this.updateState(o,e),updateModel:t=>{this.updateStoredModel(i,t),this.dispatchLocalEvent({type:"filterAction",column:o,action:e}),s.push(this.refreshHandlerAndUi(o,t,"ui"))},processModelToApply:t?.isHandler?t.handler.processModelToApply?.bind(t.handler):void 0})})),s.length&&i.oY$.all(s).then((()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})}))}updateOrRefreshFilterUi(e){const t=e.getColId();op((()=>this.cachedFilter(e)?.filterUi),(()=>rp(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:s}=this;for(const e of s)if("COLUMN_MENU"===e.source)return!1;let i=!1;for(const s of e.keys()){const o=e.get(s);if(!1===o.valid)return!1;(o.model??null)!==rp(t,s)&&(i=!0)}return i}hasUnappliedModel(e){const{model:t,state:s}=this;return(s.get(e)?.model??null)!==rp(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if("newFiltersToolPanel"===t)return!0;const s=this.beans.filterPanelSvc;return!!s?.isActive&&!!s.getState(e.getColId())}onPivotModeChanged(e){const{colModel:t,pivotColsSvc:s}=this.beans,o=!!te(this.gos),n=e.currentValue,r=n?this.activeColumnFilters:this.activeAggregateFilters,a=n?this.activeAggregateFilters:this.activeColumnFilters,l=[];for(const e of r){const i=t.colsById[e.colId],r=n&&!!s?.columns.length;i&&n===ng(i,n,r,o)&&(a.push(e),l.push(e))}(0,i.kA8)(r,l)}destroy(){super.destroy(),this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"gridDestroyed"))),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}},class extends ke{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,s,i){e&&!e.isColumn||this.showPopup(e,(i=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:s,mouseEvent:t,ePopup:i})}),s,t.target,ye(this.gos),i)}showMenuAfterButtonClick(e,t,s,i,o){if(e&&!e.isColumn)return!1;let n=-1,r="left";const a=ye(this.gos);!a&&this.gos.get("enableRtl")&&(n=1,r="right");const l=a?void 0:4*n,c=a?void 0:4;return this.showPopup(e,(i=>{this.popupSvc?.positionPopupByComponent({type:s,eventSource:t,ePopup:i,nudgeX:l,nudgeY:c,alignSide:r,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})}),s,t,a,i,o?.suppressCloseOnEventSource)}showPopup(e,t,s,o,n,r,a){const l=e?this.createBean(new cg(e,"COLUMN_MENU")):void 0;if(!l?.hasFilter()||!e)return this.destroyBean(l),this.error(57),!1;const c=ni({tag:"div",cls:"ag-menu"+(n?"":" ag-filter-menu"),role:"presentation"}),[d]=this.addManagedElementListeners(c,{keydown:e=>this.trapFocusWithin(e,c)});let u;c.appendChild(l?.getGui());const h=ye(this.gos)?void 0:o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,p=this.getLocaleTextFunc(),g=n&&"columnFilter"!==s?p("ariaLabelColumnMenu","Column Menu"):p("ariaLabelColumnFilter","Column Filter"),f=this.popupSvc?.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:t=>{lp(e,!1,"contextMenu");const n=t instanceof KeyboardEvent;if(d(),n&&o&&(0,i.K05)(o)){const e=(0,i.I_I)(o);e?.focus({preventScroll:!0})}l?.afterGuiDetached(),this.destroyBean(l),this.activeMenu===l&&(this.activeMenu=void 0,this.hidePopup=void 0),this.dispatchVisibleChangedEvent(!1,s,e),r?.(t)},positionCallback:()=>t(c),anchorToElement:h,eventSourceToIgnore:a?o:void 0,ariaLabel:g});return f?(this.activeMenu=l,this.hidePopup=u=f.hideFunc,l.afterInit().then((()=>{t(c),l.afterGuiAttached({container:s,hidePopup:u})})),lp(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e),!0):(d(),this.destroyBean(l),!1)}trapFocusWithin(e,t){e.key!==i.DDm.TAB||e.defaultPrevented||(0,i.ey2)({beans:this.beans,rootNode:t,onlyUnmanaged:!0,backwards:e.shiftKey})||(e.preventDefault(),(0,i.YtT)(t,e.shiftKey,!0))}dispatchVisibleChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:s??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.colDef.menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}}],dynamicBeans:{headerFilterCellCtrl:class extends io{wireComp(e,t,s,i,o){this.comp=e;const n=Bi(this,this.beans.context,o);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=i,this.setGui(t,n),this.setupActive(),this.refreshHeaderStyles(),this.setupCalculatedColumnCssClasses(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),Tl(n,this.eButtonShowMainFilter,(()=>this.toggleParentFilter())),this.setupFilterChangedListener(n);const r=()=>this.onColDefChanged(n);n.addManagedListeners(this.column,{colDefChanged:r}),n.addManagedEventListeners({filterSwitched:({column:e})=>{e===this.column&&r()}}),n.addDestroyFunc((()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.userHeaderClasses?.clear(),this.clearComponent()}))}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return xe(t.gos,{colDef:s,column:e,floatingFilter:!0})}setupActive(){const e=this.column.colDef,t=!!e.filter,s=!!e.floatingFilter;this.active=t&&s}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.eButtonShowMainFilter.firstElementChild)return;const e=er("filter",this.beans,this.column);e&&this.eButtonShowMainFilter.appendChild(e)}setupFocus(e){e.createManagedBean(new ps(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();(0,i.PIC)(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if((0,i.UlD)(t)===this.eGui)return;const s=(0,i.ey2)({beans:t,rootNode:this.eGui,backwards:e.shiftKey});if(s)return t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),void s.focus();const o=this.findNextColumnWithFloatingFilter(e.shiftKey);o&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:o},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let s=this.column;do{if(s=e?t.getColBefore(s):t.getColAfter(s),!s)break}while(!s.colDef.filter||!s.colDef.floatingFilter);return s}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case i.DDm.UP:case i.DDm.DOWN:case i.DDm.LEFT:case i.DDm.RIGHT:if(t)return;ds(e);case i.DDm.ENTER:t&&(0,i.YtT)(this.eGui)&&e.preventDefault();break;case i.DDm.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&(0,i.HW9)(e.relatedTarget,"ag-floating-filter");if(t&&s&&e.target===this.eGui){const e=this.lastFocusEvent,t=e?.key===i.DDm.TAB;if(e&&t){const t=e.shiftKey;(0,i.YtT)(this.eGui,t)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new Wi(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!ye(this.gos)}setupUserComp(){if(!this.active)return;const e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter()));e&&this.setCompDetails(e)}setupCalculatedColumnCssClasses(){this.refreshCalculatedColumnCssClasses()}refreshCalculatedColumnCssClasses(){const e=Zi(this.column,this.beans.calculatedColsSvc);this.userHeaderClasses=Xi(this.comp,this.userHeaderClasses,e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}toggleParentFilter(){return this.beans.menuSvc?.toggleFilterMenu({column:this.column,buttonElement:this.eButtonShowMainFilter,containerType:"floatingFilter",positionBy:"button"})??"declined"}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:s,gos:i}=this,o=e=>{if(!("filterDestroyed"!==e?.source||this.isAlive()&&t?.isAlive()))return;const o=this.comp.getFloatingFilterComp();o&&o.then((o=>{if(o){if(i.get("enableFilterHandlers")){const t=e;let s="filter";return t?.afterFloatingFilter?s="ui":t?.afterDataChange?s="dataChanged":"api"===e?.source&&(s="api"),void this.updateFloatingFilterParams(this.userCompDetails,s)}const n=t?.getCurrentFloatingFilterParentModel(s),r=e?{...e,columns:e.columns??[],source:"api"===e.source?"api":"columnFilter"}:null;o.onParentModelChanged(n,r)}}))};[this.destroySyncListener]=e.addManagedListeners(s,{filterChanged:o}),t?.isFilterActive(s)&&o(null)}setupWidth(e){const t=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};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(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive(),this.refreshCalculatedColumnCssClasses();const s=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.beans.colFilter,o=this.active?i?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter())):null,n=this.comp.getFloatingFilterComp();n&&o?n.then((t=>{!t||i?.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,s):this.updateFloatingFilterParams(o,"colDef")})):this.updateCompDetails(e,o,s)}updateCompDetails(e,t,s){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),s&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let s=e.params;this.comp.getFloatingFilterComp()?.then((e=>{"function"==typeof e?.refresh&&(this.gos.get("enableFilterHandlers")&&(s={...s,model:rp(this.beans.colFilter?.model??{},this.column.colId),source:t}),e.refresh(s))}))}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}}},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:function(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const s=e.colModel.getCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming((()=>e.filterManager?.setFilterModel(t)))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t,s){const{gos:i,colModel:o,colFilter:n}=e;s&&!i.get("enableFilterHandlers")&&(e.log.warn(288),s=!1);const r=o.getCol(t);return r?n?.getModelForColumn(r,s)??null:null},setColumnFilterModel:function(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()},showColumnFilter:function(e,t){const s=e.colModel.getCol(t);s?e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"}):e.log.error(12,{colKey:t})},hideColumnFilter:function(e){e.menuSvc?.hideFilterMenu()},getColumnFilterHandler:function(e,t){const s=e.colModel.getCol(t);if(s)return e.colFilter?.getHandler(s,!0);e.log.error(12,{colKey:t})},doFilterAction:function(e,t){const{colModel:s,colFilter:i,gos:o}=e;if(!o.get("enableFilterHandlers"))return void e.log.warn(287);const{colId:n,action:r}=t;if(n){const e=s.colsById[n];e&&i?.updateModel(e,r)}else i?.updateAllModels(r)}},dependsOn:[nf,Ad,rf,dp]},lf={moduleName:"CustomFilter",version:cn,userComponents:{agReadOnlyFloatingFilter:class extends ls{constructor(){super(dg,[eu]),this.eFloatingFilterText=i.dRA}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 t=e,s=t.getHandler();if(s.getModelAsString){const e=s.getModelAsString(t.model);this.eFloatingFilterText.setValue(e)}}}onParentModelChanged(e){null!=e?this.params.parentFilterInstance((t=>{if(t.getModelAsString){const s=t.getModelAsString(e);this.eFloatingFilterText.setValue(s)}})):this.eFloatingFilterText.setValue("")}refresh(e){this.init(e)}}},dependsOn:[af]},cf={moduleName:"TextFilter",version:cn,dependsOn:[af],userComponents:{agTextColumnFilter:{classImp:class extends gg{constructor(){super("textFilter",Dg,ef),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[1]),s}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,s,o,n)=>{s<n&&t.push((0,i.X7E)(e.getValue()))})),t}createEValue(){const e=ni({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:s}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,s,"to"),e}createFromToElement(e,t,s){const i=this.createManagedBean(new Xd({clearButton:!0,searchIcon:!0,autoComplete:this.params.browserAutoComplete}));i.addCss(`ag-filter-${s}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){const s=s=>this.removeComponents(s,e,t),{eValuesFrom:i,eValuesTo:o}=this;s(i),s(o)}},params:{useForm:!0}},agTextColumnFloatingFilter:class extends Mg{constructor(){super(...arguments),this.filterType="text",this.defaultOptions=ef}createModelFormatter(e,t,s){return new tf(e,t,s)}createFloatingFilterInputService(){return this.createManagedBean(new Eg)}}},dynamicBeans:{agTextColumnFilterHandler:class extends yg{constructor(){super(Dg,ef),this.filterType="text"}createModelFormatter(e,t,s){return new tf(e,t,s)}updateParams(e){super.updateParams(e);const t=e.filterParams,s=t.textFormatter;this.matcher=t.textMatcher??sf,this.textFormatter=s&&(t=>null==t?null:s(t,Mp(this.beans.gos,e.column,"columnFilter"))),this.formatter=this.textFormatter??(t.caseSensitive?of:Ig)}isUnmatchable(e){return this.matcher===sf&&(null==e||!(0,i.iDr)(kg,e))}evaluateNullValue(e){return"blank"!==e&&"notBlank"!==e&&this.isUnmatchable(e)?(this.warnUnexpectedFilterType(e),!1):"notEqual"===e||"notContains"===e||"blank"===e}evaluateNonNullValue(e,t,s,i){const o=e.map((e=>this.formatter(e)))||[],n=this.formatter(t),{api:r,colDef:a,column:l,context:c}=this.params,d=s.type;if("blank"===d)return _p(t);if("notBlank"===d)return function(e){return!_p(e)}(t);if(this.isUnmatchable(d))return this.warnUnexpectedFilterType(d),!1;const u=this.matcher,h={api:r,colDef:a,column:l,context:c,node:i.node,data:i.data,filterOption:d,value:n,textFormatter:this.textFormatter,source:"columnFilter"};return o.some((e=>u({...h,filterText:e})))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=e=>{const t={...e},{filter:s,filterTo:i}=e;return s&&(t.filter=Fg(s)??null),i&&(t.filterTo=Fg(i)??null),t};return rs(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}}}},df={moduleName:"NumberFilter",version:cn,dependsOn:[af],userComponents:{agNumberColumnFilter:{classImp:class extends fg{constructor(){super("numberFilter",Qg,$g),this.filterType="number"}getRenderChange(e,t){return Kg(e)!==Kg(t)||Yg(e)!==Yg(t)?"rebuild":e.numberParser!==t?.numberParser||e.numberFormatter!==t?.numberFormatter?"rerender":void 0}parseText(e,t){return Zg(qg(t?.numberParser,e,this.gos,this.params.column))}getValueFormatter(){return Np(this.params.numberFormatter,this.gos,this.params.column,"columnFilter")}createInputWidget(){const e=this.params;return Kg(e)?this.createTextInput():this.createBean(new pu({clearButton:!0,searchIcon:!0,autoComplete:e.browserAutoComplete}))}refreshInputPairValidation(e,t,s,i){let o="";if(i>=2){const i=this.readValue(e,!0),n=this.readValue(t,!0),r=Wp(i,n,s,this.params.inRangeInclusive);o=r?this.translate(r,[String(s?n:i)]):""}(s?e:t).setCustomValidity(o),(s?t:e).setCustomValidity(""),o.length>0&&this.beans.ariaAnnounce.announceValue(o,"filterValidation")}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[1]),s}},params:{useForm:!0}},agNumberColumnFloatingFilter:class extends Mg{constructor(){super(...arguments),this.filterType="number",this.defaultOptions=$g}createModelFormatter(e,t,s){return new Jg(e,t,s)}updateParams(e){const t=e.filterParams;Yg(t)===this.allowedCharPattern&&Kg(t)===this.isTextInput||this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){const t=e.filterParams,s=Yg(t);this.allowedCharPattern=s;const i=Kg(t);this.isTextInput=i;const o=e=>ug(e,s,this.beans);return this.createManagedBean(i?new Eg(o):new Xg(o))}convertValue(e){const{gos:t,params:s}=this,i=s.filterParams?.numberParser;return Zg(qg(i,e,t,s.column))}}},dynamicBeans:{agNumberColumnFilterHandler:class extends bg{constructor(){super(Qg,$g),this.filterType="number"}createModelFormatter(e,t,s){return new Jg(e,t,s)}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}}}},uf={moduleName:"BigIntFilter",version:cn,dependsOn:[af],userComponents:{agBigIntColumnFilter:{classImp:class extends fg{constructor(){super("bigintFilter",Cg,mg),this.filterType="bigint"}getRenderChange(e,t){return vg(e)!==vg(t)?"rebuild":e.bigintParser!==t?.bigintParser||e.bigintFormatter!==t?.bigintFormatter?"rerender":void 0}parseText(e,t){return wg(t?.bigintParser,e,this.gos,this.params.column)}getValueFormatter(){return Np(this.params.bigintFormatter,this.gos,this.params.column,"columnFilter")}createInputWidget(){return this.createTextInput()}refreshInputPairValidation(e,t,s,i){const o=i>=2,n=i>0?this.readValue(e,!0):null,r=o?this.readValue(t,!0):null,a=i>0&&this.isInvalidValue(e,n),l=o&&this.isInvalidValue(t,r),c=s||!o,d=c?e:t,u=c?t:e,h=c?l:a;let p="";if(c?a:l)p=this.getLocaleTextFunc()("invalidBigInt","Invalid BigInt");else if(o&&!h){const e=Wp(n,r,s,this.params.inRangeInclusive);e&&(p=this.translate(e,[String(u.getValue())]))}d.setCustomValidity(p),h||u.setCustomValidity(""),p.length>0&&this.beans.ariaAnnounce.announceValue(p,"filterValidation")}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(s.filter=String(i[0])),i.length>1&&(s.filterTo=String(i[1])),s}isInvalidValue(e,t){const s=e.getValue();return null!=s&&""!==String(s).trim()&&null===t}},params:{useForm:!0}},agBigIntColumnFloatingFilter:class extends Mg{constructor(){super(...arguments),this.filterType="bigint",this.defaultOptions=mg}createModelFormatter(e,t,s){return new Pg(e,t,s)}updateParams(e){const t=e.filterParams;vg(t)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),this.bigintParser=t?.bigintParser,super.updateParams(e)}createFloatingFilterInputService(e){const t=e.filterParams,s=vg(t);return this.allowedCharPattern=s,this.bigintParser=t?.bigintParser,this.createManagedBean(new Eg((e=>ug(e,s,this.beans))))}convertValue(e){const{gos:t,params:s}=this;return wg(this.bigintParser,e,t,s.column)}}},dynamicBeans:{agBigIntColumnFilterHandler:class extends bg{constructor(){super(Cg,mg),this.filterType="bigint"}createModelFormatter(e,t,s){return new Pg(e,t,s)}comparator(){return(e,t)=>{const s=(0,i.yN4)(t);return e===s?0:e<s?1:-1}}isValid(e){return null!==(0,i.yN4)(e)}}}},hf={moduleName:"DateFilter",version:cn,dependsOn:[af],userComponents:{agDateColumnFilter:{classImp:class extends gg{constructor(){super("dateFilter",Bg,Og),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Hg,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}onGuiAttached(e){this.dateConditionFromComps[0]?.afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(t,s)=>{const i=e[t];if(null!=i){if(!isNaN(i))return null==i?s:Number(i);this.beans.log.warn(82,{param:t})}return s},s=t("minValidYear",1e3),o=t("maxValidYear",Hg);this.minValidYear=s,this.maxValidYear=o,s>o&&this.beans.log.warn(83);const{minValidDate:n,maxValidDate:r}=e,a=n instanceof Date?n:(0,i.xmb)(n);this.minValidDate=a;const l=r instanceof Date?r:(0,i.xmb)(r);this.maxValidDate=l,a&&l&&a>l&&this.beans.log.warn(84)}refreshPositionValidation(e,t=!1,s){this.refreshInputPairValidation(e,t,s?"immediate":"debounceIfChanged")}refreshInputPairValidation(e,t,s){const[o,n]=this.getInputs(e);if(!o||!n)return;const r=o.getDate(),a=n.getDate(),l=this.conditionNumberOfInputs(e)>=2?Wp(r,a,t,this.params.inRangeInclusive):null,c=l?this.translate(l,[String(t?a:r)]):"",d=(0,i.lju)()?"immediate":s;(t?o:n).setCustomValidity(c,d),(t?n:o).setCustomValidity("",d),c.length>0&&this.beans.ariaAnnounce.announceValue(c,"filterValidation")}createDateCompWrapper(e,t){const{beans:{userCompFactory:s,context:i,gos:o},params:n}=this,r="from"===t,a=r?this.eConditionPanelsFrom:this.eConditionPanelsTo,l=t=>this.refreshInputPairValidation(a.indexOf(e),r,t);return new Vg(i,s,n.colDef,xe(o,{onDateChanged:()=>{l("debounce"),this.onUiChanged()},onDateCleared:()=>{l("immediate"),this.onUiCleared()},onFocusIn:()=>l("debounceIfChanged"),filterParams:n,location:"filter"}),e)}destroy(){this.removeDateComps(this.dateConditionFromComps,0),this.removeDateComps(this.dateConditionToComps,0),super.destroy()}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}setElementValue(e,t){e.setDate(t),t||e.setCustomValidity("")}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ni({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,s,i){const o=ni({tag:"div",cls:`ag-filter-${i} ag-filter-date-${i}`});t.push(o),e.appendChild(o),s.push(this.createDateCompWrapper(o,i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),Vp(this.eConditionPanelsFrom,e,t),Vp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){const i=Vp(e,t,s);for(const e of i)e.destroy()}isValidDateValue(e){if(null===e)return!1;const{minValidDate:t,maxValidDate:s,minValidYear:i,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<i)return!1;if(s){if(e>s)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isInputInvalid(e){return!(e.getValidity()?.valid??1)}isInputValueSettled(e){return null!=e.getDate()}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachPositionInput(e,((e,s,i,o)=>{!t||s>=o||t&&(t=this.isValidDateValue(e.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),s={},{params:o,filterType:n,beans:r}=this,a=r.dataTypeSvc,l=this.getValues(e),c=o.includeTime??a?.getDateIncludesTimeFlag(o.colDef.cellDataType)??!0,d=o.useIsoSeparator?"T":" ";return l.length>0&&(s.dateFrom=(0,i.tAb)(l[0],c,d)),l.length>1&&(s.dateTo=(0,i.tAb)(l[1],c,d)),{dateFrom:null,dateTo:null,filterType:n,type:t,...s}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput((e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(s)}))}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:s}=this;return e<0||e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,s,i,o)=>{s<o&&t.push(e.getDate())})),t}translate(e,t){let s=e;return"lessThan"===e?s="before":"greaterThan"===e&&(s="after"),super.translate(s,t)}},params:{useForm:!0}},agDateInput:class extends ls{constructor(){super(jg,[eu]),this.eDateInput=i.dRA,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.eDateInput.setClearButtonEnabled(!0).setSearchIcon(!0).onValueClear((()=>this.params.onDateCleared?.())),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),focusin:this.handleFocusIn.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled())return this.isApply?(this.applyOnFocusOut=!e,void(e&&this.params.onDateChanged())):void(e||this.params.onDateChanged())}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}handleFocusIn(){this.params.onFocusIn?.()}setParams(e){this.eDateInput.setAutoComplete(e.filterParams?.browserAutoComplete);const t=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=s&&(0,i.e3J)();const{minValidYear:o,maxValidYear:n,minValidDate:r,maxValidDate:a,buttons:l}=e.filterParams||{},c=this.includesTime(e);s?c?(this.eDateInput.setInputType("datetime-local"),t.step="1"):this.eDateInput.setInputType("date"):this.eDateInput.setInputType("text");const d=Ug(this.beans.log,r,o,!0),u=Ug(this.beans.log,a,n,!1);d&&u&&d.getTime()>u.getTime()&&this.beans.log.warn(87),d&&(t.min=(0,i.tAb)(d,c)),u&&(t.max=(0,i.tAb)(u,c)),this.isApply="floatingFilter"===e.location&&!!l?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return(0,i.xmb)(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue((0,i.tAb)(e,this.includesTime(this.params)))}includesTime(e){const{includeTime:t,colDef:s}=e.filterParams||{};return t??this.beans.dataTypeSvc?.getDateIncludesTimeFlag?.(s?.cellDataType)??!1}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e?.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}},agDateColumnFloatingFilter:class extends Tg{constructor(){super(Wg,[eu]),this.eReadOnlyText=i.dRA,this.eDateWrapper=i.dRA,this.filterType="date",this.defaultOptions=Og}createModelFormatter(e,t,s){return new Gg(e,t,s)}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 t=e?(0,i.xmb)(e.dateFrom):null;this.dateComp.setDate(t),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){(0,i.nl0)(this.eDateWrapper,e),(0,i.nl0)(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 s=t.model,o=(0,i.tAb)(e),n=null==o?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(n,{afterFloatingFilter:!0})}else this.params.parentFilterInstance((t=>{t?.onFloatingFilterChanged(this.lastType||null,e)}))}getDateComponentParams(){const{filterParams:e}=this.params,t=ws(this.beans.log,e,this.defaultDebounceMs),s=(0,i.pkA)(this,this.onDateChanged.bind(this),t);let o;return xe(this.gos,{onDateChanged:()=>{o=s()},onDateCleared:Cs(e)?void 0:()=>{clearTimeout(o),this.onDateChanged()},filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:{column:i}}=this;this.dateComp=new Vg(e,t,i.getColDef(),this.getDateComponentParams(),s,(e=>{e.setInputAriaLabel(this.getAriaLabel(i))})),this.addDestroyFunc((()=>this.dateComp.destroy()))}}},dynamicBeans:{agDateColumnFilterHandler:class extends bg{constructor(){super(Bg,Og),this.filterType="date",this.rangeCache=new Ap}createModelFormatter(e,t,s){return new Gg(e,t,s)}comparator(){return this.params.filterParams.comparator??zg}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}evaluateNonNullValue(e,t,s){const o=s.type;if(!this.isValid(t))return"notEqual"===o||"notBlank"===o;const n=null==o?void 0:(0,i.iDr)(Dp,o);if(n){const{fromTime:e,toTime:s}=this.rangeCache.getRange(o,n),i=this.params.filterParams.comparator;if(i)return i(new Date(e),t)>=0&&i(new Date(s),t)<0;const r=+t;return r>=e&&r<s}return super.evaluateNonNullValue(e,t,s)}}}},pf={moduleName:"QuickFilter",version:cn,apiFunctions:{isQuickFilterPresent:function(e){return!!e.quickFilter?.isFilterPresent()},getQuickFilter:function(e){return e.quickFilter?.getText()},resetQuickFilter:function(e){e.quickFilter?.resetCache()}},dependsOn:[{moduleName:"QuickFilterCore",version:cn,rowModels:["clientSide"],beans:[class extends ke{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",(e=>this.setFilter(e.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(){const{autoColSvc:e,colModel:t,gos:s,pivotResultCols:i}=this.beans,o=t.pivotMode,n=e?.columns,r=t.colDefList;let a=(o&&!s.get("applyQuickFilterBeforePivotOrAgg")?i?.pivotCols:r)??[];n?.length&&(a=a.concat(n)),this.colsToUse=s.get("includeHiddenColumnsInQuickFilter")?a:a.filter((e=>e.visible||e.rowGroupActive))}isFilterPresent(){return null!==this.quickFilter}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every((s=>t?this.doesRowPassCache(e,s):this.doesRowPassNoCache(e,s)))}resetCache(){this.beans.rowModel.forEachNode((e=>e.quickFilterAggregateText=null))}getText(){return this.gos.get("quickFilterText")}getState(){const e=this.getText()||void 0;return e?{text:e}:void 0}setState({text:e},t){if(void 0!==e){this.stateSource=t;try{this.gos.updateGridOptions({options:{quickFilterText:e}})}finally{this.stateSource=void 0}}}setFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseFilter(e){return(0,i.Qmv)(e)?e.toUpperCase():null}setFilter(e){if(null!=e&&"string"!=typeof e)return void this.warn(70,{newFilter:e});const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged",source:this.stateSource}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),s=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,s&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some((s=>{const o=this.getTextForColumn(s,e);return(0,i.Qmv)(o)&&o.includes(t)}))}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let s;e?(this.checkGenerateAggText(t),s=t.quickFilterAggregateText):s=this.getAggText(t);const{quickFilterParts:i,matcher:o}=this;return o(i,s)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t);const o=e.colDef;if(o.getQuickFilterText){const i=xe(this.gos,{value:s,node:t,data:t.data,column:e,colDef:o});s=o.getQuickFilterText(i)}return(0,i.Qmv)(s)?s.toString().toUpperCase():null}getAggText(e){const t=[];for(const s of this.colsToUse){const o=this.getTextForColumn(s,e);(0,i.Qmv)(o)&&t.push(o)}return t.join("\n")}}],dependsOn:[nf,rf]}]},gf={moduleName:"ExternalFilter",version:cn,dependsOn:[nf]},ff=class extends ke{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.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,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}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:s,beans:i,rowNodes:o}=this;for(let n=0;n<e;n++){const e=s+n,r=new Ds(i);r.setRowHeight(t),r.uiLevel=0,r.setRowIndex(e),r.setRowTop(t*e),o.push(r)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:i}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:i}}}setDataAndId(e,t,s){(0,i.Qmv)(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0),this.beans.selectionSvc?.updateRowSelectable(e)}loadFromDatasource(){const e=this.createLoadParams();(0,i.MWY)(this.params.datasource.getRows)?this.warn(90):window.setTimeout((()=>{this.params.datasource.getRows(e)}),0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:i,filterModel:o},gos:n}=this;return xe(n,{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:i,filterModel:o})}forEachNode(e,t,s){this.rowNodes.forEach(((i,o)=>{this.startRow+o<s&&e(i,t.value++)}))}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach(((i,o)=>{const n=e.rowData?e.rowData[o]:void 0;!i.id&&i.alreadyRendered&&n&&(t[o]=new Ds(s),t[o].setRowIndex(i.rowIndex),t[o].setRowTop(i.rowTop),t[o].setRowHeight(i.rowHeight),i._destroy(!0)),this.setDataAndId(t[o],n,this.startRow+o)}));const i=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,i)}destroy(){const e=this.rowNodes;for(let t=0,s=e.length;t<s;t++)e[t]._destroy(!1);e.length=0,super.destroy()}},mf=class extends ke{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let i=this.blocks[s];if(!i){if(t)return;i=this.createBlock(s)}return i.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new ff(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}refreshCache(){if(0==this.blockCount)this.purgeCache();else{for(const e of this.getBlocksInOrder())e.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()&&(Wo(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter((t=>t!=e));t.sort(((e,t)=>t.lastAccessed-e.lastAccessed));const s=this.params.maxBlocksInCache>0,i=s?this.params.maxBlocksInCache-1:null;t.forEach(((e,t)=>{if("needsLoading"===e.state&&t>=1||s&&t>=i){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}}))}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const{startRow:s,endRow:i}=e;return t.rowIndex>=s&&t.rowIndex<i}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:t,overflowSize:s}=this.params,i=(e.id+1)*t+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,(0,i.Qmv)(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){return Object.values(this.blocks).sort(((e,t)=>e.id-t.id))}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,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const s=[];let i=-1,o=!1;const n={value:0};let r=!1;for(const a of this.getBlocksInOrder())r||(o&&i+1!==a.id?r=!0:(i=a.id,a.forEachNode((i=>{const n=i===e||i===t;(o||n)&&s.push(i),n&&(o=!o)}),n,this.rowCount)));return r||o?[]:s}},vf={moduleName:"InfiniteRowModel",version:cn,apiFunctions:{refreshInfiniteCache:function(e){Ps(e)?.refreshCache()},purgeInfiniteCache:function(e){Ps(e)?.purgeCache()},getInfiniteRowCount:function(e){return Ps(e)?.getRowCount()}},dependsOn:[{moduleName:"InfiniteRowModelCore",version:cn,rowModels:["infinite"],beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.hierarchical=!1}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if("infinite"!==this.gos.get("rowModelType"))return;const e=this.beans,t=new Ds(e);this.rootNode=t,t.level=-1,this.rowHeight=q(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)}),K(this,(()=>this.refreshRowHeight())),this.addManagedPropertyListener("datasource",(()=>this.setDatasource(this.gos.get("datasource")))),this.addManagedPropertyListener("cacheBlockSize",(()=>this.resetCache())),this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeight()))}refreshRowHeight(){const e=q(this.beans);e!==this.rowHeight&&(this.rowHeight=e,this.cacheParams&&(this.cacheParams.rowHeight=e),this.updateRowHeights())}onColumnEverything(){let e;e=!this.cacheParams||!(0,i.V67)(this.cacheParams.sortModel,lr(this.beans.sortSvc)),e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getOverlayType(){const e=this.infiniteCache;return 0===e?.getRowCount()?this.beans.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows":null}getNodesInRangeForSelection(e,t){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){this.datasource&&(null!=ne(this.beans)||this.beans.selectionSvc?.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:s,rowNodeBlockLoader:i,eventSvc:o,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:lr(s),rowNodeBlockLoader:i,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:q(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mf(this.cacheParams)),o.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((s=>{s.id===e&&(t=s)})),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}},class extends ke{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=function(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=(0,i.pkA)(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){(0,i.$ii)(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(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void Wo(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");const e=null!=this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter((e=>"needsLoading"===e.state)).slice(0,e);this.activeBlockLoadsCount+=t.length;for(const e of t)e.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach((t=>{const{id:s,state:i}=t.getBlockStateJson();e[s]=i})),e}printCacheStatus(){Wo(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}}]},Zn]},wf={moduleName:"EventApi",version:cn,apiFunctions:{addEventListener:function(e,t,s){e.apiEventSvc?.addListener(t,s)},addGlobalListener:function(e,t){e.apiEventSvc?.addGlobalListener(t)},removeEventListener:function(e,t,s){e.apiEventSvc?.removeListener(t,s)},removeGlobalListener:function(e,t){e.apiEventSvc?.removeGlobalListener(t)}},beans:[class extends ke{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,i=!xl.has(e),o=i?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(s),this.eventSvc.addListener(e,s,i)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,i=this.asyncListeners.get(e),o=!!i?.delete(s);o||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,o)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(e,s)=>{xl.has(e)&&t(e,s)},i=(e,s)=>{xl.has(e)||t(e,s)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:i});const o=this.eventSvc;o.addGlobalListener(s,!1),o.addGlobalListener(i,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:i}=this,o=s?.unwrapGlobal(e)??e;if(i.has(o)){const{syncListener:s,asyncListener:n}=i.get(o);t.removeGlobalListener(s,!1),t.removeGlobalListener(n,!0),i.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach(((e,s)=>{e.forEach((e=>this.eventSvc.removeListener(s,e,t))),e.clear()})),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,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:e,asyncListener:s})=>{t.removeGlobalListener(e,!1),t.removeGlobalListener(s,!0)})),e.clear()}}]},Cf={moduleName:"Locale",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="localeSvc"}getLocaleTextFunc(){const e=this.gos,t=e.getCallback("getLocaleText");return t?(0,i.DlC)(t):(0,i.x1P)(e.get("localeText"))}}]},yf=e=>{if(!e)return[];const t=Object.keys(e),s=[];for(let i=0,o=t.length;i<o;++i){const o=t[i],n=e[o];"function"!=typeof n&&s.push({property:o,value:n})}return s},bf=(e,t)=>{e&&kt(e,(e=>{const s=e.colId??e.field;null==s||t.has(s)||t.set(s,e)}))};function Sf(e){return(e={...e}).version||(e.version="32.1.0"),"32.1.0"===e.version&&(e=function(e){return e.cellSelection=function(e){if(e&&"object"==typeof e)return e.rangeSelection}(e),e}(e)),e.version=cn,e}var xf={moduleName:"GridState",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=(0,i.pkA)(this,(()=>this.dispatchQueuedStateUpdateEvents()),0),this.onRowGroupOpenedDebounced=(0,i.pkA)(this,(()=>this.updateGroupExpansionState()),0),this.onRowSelectedDebounced=(0,i.pkA)(this,(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())}),0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=B(e);const i=Sf(e.get("initialState")??{}),o=i.partialColumnState;delete i.partialColumnState,this.cachedState=i;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,(()=>n((()=>this.setupStateOnGridReady(i))))),(i.columnOrder||i.columnVisibility||i.columnSizing||i.columnPinning||i.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:e})=>{"gridInitializing"===e&&(r(),n((()=>{this.setupStateOnColumnsInitialised(i,!!o),s?.revealColumns("columnState")})))},rowCountReady:()=>{a?.(),n((()=>this.setupStateOnRowCountReady(i)))},firstDataRendered:()=>{l?.(),n((()=>this.setupStateOnFirstDataRendered(i)))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=Sf(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const i="api",o=t?new Set(t):void 0;this.setGridReadyState(s,i,o),this.setColumnsInitialisedState(s,i,!!o,o),this.setRowCountState(s,i,o),setTimeout((()=>{this.isAlive()&&this.setFirstDataRenderedState(s,i,o),this.stopSuppressEvents(i)}))}setGridReadyState(e,t,s){"api"!==t||s?.has("sideBar")||this.beans.sideBar?.comp?.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","columnHeaderName","pivot","rowGroup","showValuesAs","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.updateCachedState("userColumns",this.beans.userColumnSvc.getState())}setColumnsInitialisedState(e,t,s,i){this.setUserColumnsState(e,t,i),this.applyColumnGridState(e,t,s,i),this.setColumnGroupState(e,t,i),this.updateColumnAndGroupState()}setUserColumnsState(e,t,s){if(s?.has("userColumns")||!e.userColumns&&"api"!==t)return;const{userColumnSvc:i,calculatedColsSvc:o,colModel:n}=this.beans,r=i.setState(e.userColumns),a=o?.adoptUserColumns()??!1;(r||a)&&(o?o.refreshDynamicColumns(t):n.rebuildCols(t))}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=e=>()=>this.updateColumnState([e]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),columnShowValuesAsChanged:s("showValuesAs"),sortChanged:s("sort"),newColumnsLoaded:({source:e})=>{this.updateColumnAndGroupState(),"gridInitializing"!==e&&this.isClientSideRowModel&&this.onRowGroupOpenedDebounced()},columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState()),columnHeaderNameChanged:()=>{this.updateColumnState(["columnHeaderName"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}})}setRowCountState(e,t,s){const{filter:i,quickFilter:o,rowGroupExpansion:n,ssrmRowGroupExpansion:r,rowSelection:a,pagination:l,rowPinning:c}=e,d=(e,i)=>!s?.has(e)&&(i||"api"===t);d("filter",i)&&this.setFilterStateDeferringPivot(i,t),d("quickFilter",o)&&this.setQuickFilterState(o,t),(d("rowGroupExpansion",n)||d("ssrmRowGroupExpansion",r))&&this.setRowGroupExpansionState(r,n,t),d("rowSelection",a)&&this.setRowSelectionState(a,t),d("pagination",l)&&this.setPaginationState(l,t),d("rowPinning",c)&&this.setRowPinningState(c);const u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),u("quickFilter",this.getQuickFilterState()),this.updateGroupExpansionState(),u("rowSelection",this.getRowSelectionState()),u("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>{this.updateRowGroupExpansionStateTimer=0,this.updateGroupExpansionState()},i=()=>t("filter",this.getFilterState());this.addManagedPropertyListener("quickFilterText",(()=>t("quickFilter",this.getQuickFilterState())));const{gos:o,colFilter:n,selectableFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:i,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(0!==o.get("groupDefaultExpanded")||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:e=>{(e.newPage||e.newPageSize)&&t("pagination",this.getPaginationState())},pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())}),n&&this.addManagedListeners(n,{filterStateChanged:i}),r&&this.addManagedListeners(r,{selectedFilterChanged:i})}setFirstDataRenderedState(e,t,s){const{scroll:i,cellSelection:o,find:n,focusedCell:r,columnOrder:a}=e,l=(e,i)=>!s?.has(e)&&(i||"api"===t);l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),this.setColumnPivotState(!!a?.orderedColIds,t);const c=this.deferredFilterState;c&&(this.deferredFilterState=void 0,this.setFilterState(c,t)),l("find",n)&&this.setFindState(n,t),l("scroll",i)&&this.setScrollState(i);const d=this.updateCachedState.bind(this);d("sideBar",this.getSideBarState()),d("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();d("rangeSelection",u),d("cellSelection",u),d("scroll",this.getScrollState()),d("find",this.getFindState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:e=>{if(e.finished){const e=this.getRangeSelectionState();t("rangeSelection",e),t("cellSelection",e)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),findChanged:()=>t("find",this.getFindState())})}getColumnGridState(){const e=this.beans;return function(e,t=!1){const s=[],i=[],o=[],n=[],r=[],a=[],l=[],c=[],d=[],u=[],h=[],p=[];let g=0;for(let t=0;t<e.length;t++){const{colId:f,sort:m,sortType:v,sortIndex:w,rowGroup:C,rowGroupIndex:y,aggFunc:b,valueIndex:S,showValuesAs:x,pivot:R,pivotIndex:P,pivotSort:E,pinned:I,hide:k,width:F,flex:T,headerName:A}=e[t];p.push(f),null!=A&&h.push({colId:f,headerName:A}),m&&(s[w??g++]={colId:f,sort:m,type:v??void 0}),C&&(i[y??0]=f),"string"==typeof b&&o.push({colId:f,aggFunc:b,valueIndex:S}),null!=x&&n.push({colId:f,showValuesAs:D(x)}),R&&(r[P??0]=f,void 0!==E&&a.push({colId:f,sort:E})),I&&("right"===I?c:l).push(f),k&&d.push(f),(null!=T||F)&&u.push({colId:f,flex:T??void 0,width:null===F?void 0:F})}return{sort:s.length?{sortModel:Qc(s)}:void 0,rowGroup:i.length?{groupColIds:Qc(i)}:void 0,aggregation:o.length?{aggregationModel:Jc(o)}:void 0,showValuesAs:n.length?{showValuesAsModel:n}:void 0,pivot:r.length||t?{pivotMode:t,pivotColIds:Qc(r),pivotSortModel:a.length?a:void 0}:void 0,columnPinning:l.length||c.length?{leftColIds:l,rightColIds:c}:void 0,columnVisibility:d.length?{hiddenColIds:d}:void 0,columnSizing:u.length?{columnSizingModel:u}:void 0,columnOrder:p.length?{orderedColIds:p}:void 0,columnHeaderName:h.length?{columnHeaderNames:h}:void 0}}(Ze(e),e.colModel.pivotMode)}applyColumnGridState(e,t,s,i){const{sort:o,rowGroup:n,aggregation:r,showValuesAs:a,pivot:l,columnPinning:c,columnVisibility:d,columnSizing:u,columnOrder:h,columnHeaderName:p}=e;let g=!1;const f=(e,s)=>{const o=!(i?.has(e)||!s&&"api"!==t);return g||(g=o),o},m=Object.create(null),v=e=>{let t=m[e];return t||(t={colId:e},m[e]=t,t)},w={},C=f("sort",o);if(C&&o){const e=o.sortModel;for(let t=0,s=e.length;t<s;++t){const{colId:s,sort:i,type:o}=e[t],n=v(s);n.sort=i,n.sortIndex=t,n.sortType=o}}!C&&s||(w.sort=null,w.sortIndex=null);const y=f("rowGroup",n);if(y&&n){const e=n.groupColIds;for(let t=0,s=e.length;t<s;++t){const s=v(e[t]);s.rowGroup=!0,s.rowGroupIndex=t}}!y&&s||(w.rowGroup=null,w.rowGroupIndex=null);const b=f("aggregation",r);if(b&&r){const e=r.aggregationModel;for(let t=0,s=e.length;t<s;++t){const{colId:s,aggFunc:i}=e[t],o=v(s);o.aggFunc=i,o.valueIndex=t}}!b&&s||(w.aggFunc=null,w.valueIndex=null);const S=f("showValuesAs",a);if(S&&a){const e=a.showValuesAsModel;for(let t=0,s=e.length;t<s;++t){const{colId:s,showValuesAs:i}=e[t];v(s).showValuesAs=D(i)}}!S&&s||(w.showValuesAs=null);const x=f("pivot",l);if(x&&l){const e=l.pivotColIds;for(let t=0,s=e.length;t<s;++t){const s=v(e[t]);s.pivot=!0,s.pivotIndex=t}for(const{colId:e,sort:t}of l.pivotSortModel??[])v(e).pivotSort=t;this.gos.updateGridOptions({options:{pivotMode:!!l.pivotMode},source:t})}!x&&s||(w.pivot=null,w.pivotIndex=null);const R=f("columnPinning",c);if(R){for(const e of c?.leftColIds??[])v(e).pinned="left";for(const e of c?.rightColIds??[])v(e).pinned="right"}!R&&s||(w.pinned=null);const P=f("columnVisibility",d);if(P)for(const e of d?.hiddenColIds??[])v(e).hide=!0;!P&&s||(w.hide=null);const E=f("columnSizing",u);if(E)for(const{colId:e,flex:t,width:s}of u?.columnSizingModel??[]){const i=v(e);i.flex=t??null,i.width=s}!E&&s||(w.flex=null);const I=f("columnHeaderName",p);if(I)for(const{colId:e,headerName:t}of p?.columnHeaderNames??[])v(e).headerName=t;!I&&s||(w.headerName=null);const k=h?.orderedColIds,F=!!k?.length&&!i?.has("columnOrder"),T=F?k.map((e=>v(e))):Object.values(m);(T.length||g)&&(this.columnStates=T,ze(this.beans,{state:T,applyOrder:F,defaultState:w},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:n,colModel:r}=o;if(n?.pivotCols){if(s){const i=[];for(const e of s)null!=r.colsById[e.colId]?.colDef.pivotKeys&&i.push(e);ze(o,{state:i,applyOrder:e},t)}i&&_i(o,i,t)}}getColumnGroupState(){return function(e){const t=[],s=[];for(const{groupId:i,open:o,headerName:n}of e)o&&t.push(i),null!=n&&s.push({groupId:i,headerName:n});if(t.length||s.length)return{openColumnGroupIds:t,headerNames:s.length?s:void 0}}(Ni(this.beans))}setColumnGroupState(e,t,s){if(s?.has("columnGroup")||"api"!==t&&!(0,i.Oxm)(e,"columnGroup"))return;const o=new Set(e.columnGroup?.openColumnGroupIds),n=new Map((e.columnGroup?.headerNames??[]).map((({groupId:e,headerName:t})=>[e,t]))),r=Ni(this.beans).map((({groupId:e})=>{const t=o.has(e);return t&&o.delete(e),{groupId:e,open:t,headerName:n.get(e)??null}}));for(const e of o)r.push({groupId:e,open:!0,headerName:n.get(e)??null});r.length&&(this.columnGroupStates=r),_i(this.beans,r,t)}getFilterState(){const{filterManager:e,selectableFilter:t}=this.beans;let s=e?.getFilterModel();s&&0===Object.keys(s).length&&(s=void 0);const i=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0,n=t?.getState();return s||o||i||n?{filterModel:s,columnFilterState:i,advancedFilterModel:o,selectableFilters:n}:void 0}setFilterState(e,t="api"){const{filterManager:s,selectableFilter:i}=this.beans,{filterModel:o,columnFilterState:n,advancedFilterModel:r,selectableFilters:a}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null,selectableFilters:null};void 0!==a&&i?.setState(a??void 0);const l="api"===t;if(void 0!==o||void 0!==n){const e=l?"api":"columnFilter";s?.setFilterState(o??null,n??null,e)}if(void 0!==r){const e=l?"api":"advancedFilter";s?.setAdvFilterModel(r??null,e)}}isToolbarStateManaged(e){return!!this.beans.toolbar?.hasItem(e)}getQuickFilterState(){return this.isToolbarStateManaged("agQuickFilterToolbarItem")?this.beans.quickFilter?.getState():void 0}setQuickFilterState(e,t="api"){if(!this.isToolbarStateManaged("agQuickFilterToolbarItem"))return;const{text:s}=e??{};this.beans.quickFilter?.setState({text:"api"===t?s??"":s},"api"===t?"api":void 0)}setFilterStateDeferringPivot(e,t){const{colModel:s,pivotResultCols:i}=this.beans,o=e?.filterModel;if(o&&"gridInitializing"===t&&s.pivotMode&&!i?.pivotCols){const t=s.colsById,i=Object.keys(o);for(let s=0,o=i.length;s<o;++s)if(null==t[i[s]])return void(this.deferredFilterState=e)}this.setFilterState(e,t)}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map((e=>{const{id:t,type:s,startRow:i,endRow:o,columns:n,startColumn:r}=e;return{id:t,type:s,startRow:i,endRow:o,colIds:n.map((e=>e.getColId())),startColId:r.getColId()}}));return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:i,visibleCols:o}=this.beans;if(!de(t)||!s)return;const n=[];for(const t of e?.cellRanges??[]){const e=[];for(const s of t.colIds){const t=i.colsById[s];t&&e.push(t)}if(!e.length)continue;let s=i.colsById[t.startColId];if(!s){const t=o.allCols,i=new Set(e);s=t.find((e=>i.has(e)))}n.push({...t,columns:e,startColumn:s})}s.setCellRanges(n)}getFindState(){return this.isToolbarStateManaged("agFindToolbarItem")?this.beans.findSvc?.getState():void 0}setFindState(e,t="api"){if(!this.isToolbarStateManaged("agFindToolbarItem"))return;const{searchValue:s,activeMatch:i}=e??{};this.beans.findSvc?.setState({searchValue:"api"===t?s??"":s,activeMatch:i})}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:i,rowRenderer:o,animationFrameSvc:n,ctrlsSvc:r}=this.beans;i.wrapIncoming((()=>{r.whenReady(this,(()=>{const e=r.getScrollFeature();e?.setHorizontalScrollPosition(s),e?.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),n?.flushAllFrames()}))}))}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:i}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:i}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e)return void t.clearFocusedCell();const{colId:i,rowIndex:o,rowPinned:n}=e;t.setFocusedCell({column:s.colsById[i]??null,rowIndex:o,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),i=t.get("paginationAutoPageSize")?void 0:e.getPageSize();return s||i?{page:s,pageSize:i}:void 0}setPaginationState(e,t){const{pagination:s,gos:i}=this.beans;if(!s)return;const{pageSize:o,page:n}=e??{page:0,pageSize:i.get("paginationPageSize")},r="gridInitializing"===t;o&&!i.get("paginationAutoPageSize")&&s.setPageSize(o,r?"initialState":"pageSizeSelector"),"number"==typeof n&&(r?s.setPage(n):s.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||t?.toggledNodes?.length)?t:void 0}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,"api"===t)}updateGroupExpansionState(){const{expansionSvc:e,gos:t}=this.beans,s=e?.getExpansionState(),i=t.get("ssrmExpandAllAffectsAllRows");this.updateCachedState("ssrmRowGroupExpansion",i?s:void 0),this.updateCachedState("rowGroupExpansion",i?void 0:s)}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const i=e??t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};this.beans.expansionSvc?.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnGridState();let s=!1;const o=this.cachedState;for(const e of Object.keys(t)){const n=t[e];(0,i.V67)(n,o[e])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),(0,i.V67)(t,s)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)"rowSelection"===t&&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(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout((()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))}))}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},class extends ke{constructor(){super(...arguments),this.beanName="userColumnSvc",this.entries=new Map,this.owners=[],this.ownedProperties=null,this.declaredDefs=new Map}registerOwner(e,t){this.owners.push(e);const s=this.ownedProperties??new Set;for(let e=0,i=t.length;e<i;++e)s.add(t[e]);this.ownedProperties=s}isActive(){const e=this.owners;for(let t=0,s=e.length;t<s;++t)if(e[t]())return!0;return!1}getDeclaredDef(e){const t=this.beans.colModel.colDefs??null;if(this.declaredDefsSource!==t){const e=new Map;bf(t,e),this.declaredDefs=e,this.declaredDefsSource=t}return this.declaredDefs.get(e)}isDeclared(e){return void 0!==this.getDeclaredDef(e)}getEntry(e){return this.entries.get(e)}forEachEntry(e){this.entries.forEach(e)}hasEntries(){return this.entries.size>0}setCreatedColumn(e,t,s){this.entries.set(e,{properties:t,parentGroupId:s,created:!0})}setOverride(e,t){this.entries.set(e,{properties:t})}removeColumn(e,t){t?this.entries.set(e,{removed:!0}):this.entries.delete(e)}clearColumn(e){this.entries.delete(e)}clear(){const{entries:e}=this;return this.declaredDefsSource=void 0,!!e.size&&(e.clear(),!0)}overrideFor(e){const t=e.colId??e.field;if(null==t)return;const s=this.entries.get(t);if(void 0!==s&&this.isActive()){if(s.removed)return null;if(!s.created)return s.properties?{...e,...s.properties}:void 0}}getState(){const e=this.entries;if(!e.size)return;const t=[];return e.forEach(((e,s)=>{if(e.removed)return void t.push({colId:s,removed:!0});const{parentGroupId:i,created:o}=e;t.push(o?{colId:s,created:o,parentGroupId:i??null,properties:yf(e.properties)}:{colId:s,properties:yf(e.properties)})})),t}setState(e){const t=this.entries,s=new Map;for(let t=0,i=e?.length??0;t<i;++t){const i=e[t],{colId:o}=i;null!=o&&(i.removed?s.set(o,{removed:!0}):i.created?s.set(o,{properties:this.acceptProperties(i.properties),parentGroupId:i.parentGroupId??null,created:!0}):this.isDeclared(o)&&s.set(o,{properties:this.acceptProperties(i.properties)}))}return!((e,t)=>{if(e.size!==t.size)return!1;for(const[s,i]of e){const e=t.get(s);if(void 0===e||!!i.removed!=!!e.removed||!!i.created!=!!e.created||i.parentGroupId!==e.parentGroupId||!T(i.properties??{},e.properties??{}))return!1}return!0})(t,s)&&(t.clear(),s.forEach(((e,s)=>t.set(s,e))),!0)}acceptProperties(e){const t=this.ownedProperties,s={};for(let i=0,o=e?.length??0;i<o;++i){const{property:o,value:n}=e[i];(t?t.has(o)&&"function"!=typeof n:null!=o)&&(s[o]=n)}return s}}],apiFunctions:{getState:function(e){return e.stateSvc?.getState()??{}},setState:function(e,t,s){return e.stateSvc?.setState(t,s)}}},Rf="paginationPageSizeSelector",Pf={tag:"span",cls:"ag-paging-page-size"},Ef=class extends ls{constructor(e){super(Pf),this.panelParams=e,this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=function(e){const t=Number(e);return Number.isFinite(t)?t:null}(e);null==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}getPageSizeSelectorOption(){return this.panelParams?.paginationPageSizeSelector??this.gos.get(Rf)}postConstruct(){this.addManagedPropertyListener(Rf,(()=>{this.onPageSizeSelectorValuesChange()})),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!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(){(0,i.fDi)(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return!this.gos.get("paginationAutoPageSize")&&!1!==this.getPageSizeSelectorOption()}updateVisibility(){const e=this.shouldShowPageSizeSelector();this.toggleSelectDisplay(e),this.setDisplayed(e)}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const s=null!=this.panelParams?.paginationPageSize||this.gos.exists("paginationPageSize"),i=!0!==this.getPageSizeSelectorOption();this.beans.log.warn(94,{pageSizeSet:s,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||this.beans.log.warn(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Rf}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?((0,i.MpY)(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map((e=>({value:String(e)})))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),i=s("pageSizeSelectorLabel","Page Size:"),o=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new bu).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(i).onValueChange((()=>this.handlePageSizeItemSelected())),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=this.getPageSizeSelectorOption();return Array.isArray(e)&&e?.length?[...e].sort(((e,t)=>e-t)):[20,50,100]}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};function If(e,t,s){const i=t.getCallback("paginationNumberFormatter");return i?i({value:e}):function(e,t){if("number"!=typeof e)return"";const s=t(),i=s("thousandSeparator",","),o=s("decimalSeparator","."),[n,r]=e.toString().split("."),a=n.replace(/(\d)(?=(\d{3})+(?!\d))/g,(e=>e+i));return void 0===r?a:`${a}${o}${r}`}(e,s)}var kf=class extends ls{constructor(e,t){super(),this.btFirst=i.dRA,this.btPrevious=i.dRA,this.btNext=i.dRA,this.btLast=i.dRA,this.lbCurrentInput=i.dRA,this.lbCurrentStatic=i.dRA,this.lbTotal=i.dRA,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.ariaStatus="",this.idPrefix=e,this.suppressPageInput=t??!1}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination}postConstruct(){const e=this.getLocaleTextFunc();var t,s,i,o,n,r;this.setTemplate(function(e,t,s){const i={cls:"ag-paging-number",attrs:{id:`${e}-start-page-number`},tag:t?"span":"ag-input-number-field",ref:t?"lbCurrentStatic":"lbCurrentInput"};return{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":s("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":s("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${e}-start-page`},children:s("page","Page")},i,{tag:"span",attrs:{id:`${e}-of-page`},children:s("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${e}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":s("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":s("lastPage","Last Page")}}]}}(this.idPrefix,this.suppressPageInput,e),this.suppressPageInput?[]:[gu]),t=this.gos.get("enableRtl"),s=this.beans,i=this.btFirst,o=this.btPrevious,n=this.btNext,r=this.btLast,i.insertAdjacentElement("afterbegin",er(t?"last":"first",s)),o.insertAdjacentElement("afterbegin",er(t?"next":"previous",s)),n.insertAdjacentElement("afterbegin",er(t?"previous":"next",s)),r.insertAdjacentElement("afterbegin",er(t?"first":"last",s)),this.initNavButtons(),this.suppressPageInput||this.initPageInput(),this.refresh()}initNavButtons(){const{btFirst:e,btPrevious:t,btNext:s,btLast:o}=this;this.activateTabIndex([e,t,s,o]);for(const{el:n,fn:r}of[{el:e,fn:this.onBtFirst.bind(this)},{el:t,fn:this.onBtPrevious.bind(this)},{el:s,fn:this.onBtNext.bind(this)},{el:o,fn:this.onBtLast.bind(this)}])this.addManagedListeners(n,{click:r,keydown:e=>{e.key!==i.DDm.ENTER&&e.key!==i.DDm.SPACE||(e.preventDefault(),r())}})}initPageInput(){const{lbCurrentInput:e,pagination:t}=this,s=e.getInputElement();(0,i.lXX)(s,"spinbutton"),this.addManagedListeners(s,{keydown:o=>{const{key:n}=o;if(n!==i.DDm.ENTER&&n!==i.DDm.ESCAPE&&n!==i.DDm.UP&&n!==i.DDm.DOWN)return;o.preventDefault();let r=null;const a=t.getCurrentPage(),l=t.getTotalPages();switch(n){case i.DDm.ENTER:this.commitPageInput();break;case i.DDm.ESCAPE:e.setValue(String(this.getDisplayPageNumber()),!0),s.blur();break;case i.DDm.UP:a+2<=l&&(r=a+2);break;case i.DDm.DOWN:0!==a&&(r=a)}null!==r&&(e.setValue(String(r),!0),this.commitPageInput())},blur:()=>this.commitPageInput()})}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}commitPageInput(){const{pagination:e,lbCurrentInput:t}=this,s=t.getValue(!0);if(!s?.trim())return void t.setValue(String(this.getDisplayPageNumber()),!0);const i=Number(s),o=e.getTotalPages();Number.isFinite(i)&&Number.isInteger(i)&&i>=1&&i<=o?e.goToPage(i-1):t.setValue(String(this.getDisplayPageNumber()),!0)}getDisplayPageNumber(){const{rowModel:e,pagination:t}=this;return t.getTotalPages()>0?t.getCurrentPage()+1:e.isLastRowIndexKnown()?0:1}refresh(){this.enableOrDisableButtons(),this.updateLabels()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const i=t&&0===s,o=e===s-1;this.nextButtonDisabled=o||i,this.lastButtonDisabled=!t||i||o,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){(0,i.TGw)(e,t),e.classList.toggle("ag-disabled",t)}updateLabels(){const{rowModel:e,pagination:t,lbCurrentInput:s,lbCurrentStatic:o,lbTotal:n}=this,r=e.isLastRowIndexKnown(),a=t.getTotalPages(),l=this.getLocaleTextFunc();let c;c=r?this.formatNumber(a):l("more","more"),n.textContent=c;const d=this.getDisplayPageNumber(),u=this.formatNumber(d);if(this.suppressPageInput)o.textContent=u;else{const e=Math.max(d,a);s.setMin(Math.min(1,d)),s.setMax(e),s.getInputElement().style.width=`${Math.floor(Math.log10(Math.max(1,e)))+3.5}ch`,s.setValue(d.toString());const t=s.getInputElement();(0,i.PIC)(t,`${l("page","Page")} ${l("number","number")}, ${d} ${l("of","of")} ${c}`),t.setAttribute("aria-valuenow",String(d)),t.setAttribute("aria-valuemin",String(Math.min(1,d))),t.setAttribute("aria-valuemax",String(e))}const h=l("page","Page"),p=l("of","of");this.ariaStatus=`${h} ${u} ${p} ${c}`}formatNumber(e){return If(e,this.gos,this.getLocaleTextFunc.bind(this))}},Ff=class extends ls{constructor(e){super(),this.lbFirstRowOnPage=i.dRA,this.lbLastRowOnPage=i.dRA,this.lbRecordCount=i.dRA,this.ariaStatus="",this.idPrefix=e}wireBeans(e){this.pagination=e.pagination}postConstruct(){const e=this.idPrefix,t=this.getLocaleTextFunc();this.setTemplate({tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",cls:"ag-paging-row-summary-content",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${e}-first-row`}},{tag:"span",attrs:{id:`${e}-to`},children:t("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${e}-last-row`}},{tag:"span",attrs:{id:`${e}-of`},children:t("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${e}-row-count`}}]}]}),this.refresh()}isZeroPages(){return this.beans.rowModel.isLastRowIndexKnown()&&0===this.pagination.getTotalPages()}refresh(){const{pagination:e,beans:{rowModel:t},gos:s}=this,i=t.isLastRowIndexKnown(),o=e.getMasterRowCount(),n=i?o:null,r=e.getCurrentPage(),a=e.getPageSize(),l=this.getLocaleTextFunc();let c,d;this.isZeroPages()?c=d=0:(c=a*r+1,d=c+a-1,i&&d>n&&(d=n));const u=!i&&o<c+a-1,h=e=>If(e,s,this.getLocaleTextFunc.bind(this)),p=h(c);let g,f;this.lbFirstRowOnPage.textContent=p,g=u?l("pageLastRowUnknown","?"):h(d),this.lbLastRowOnPage.textContent=g,f=i?h(n):l("more","more"),this.lbRecordCount.textContent=f;const m=l("to","to"),v=l("of","of");this.ariaStatus=`${p} ${m} ${g} ${v} ${f}`;const w=e=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\s+/g," ");this.getGui().style.setProperty("--ag-internal-pagination-width-string",`'${f} ${w(m)} ${f} ${w(v)} ${f}'`.replaceAll(/\d/g,"0"))}},Df=["pageSize","rowSummary","pageSummary"],Tf={selector:"AG-PAGINATION",component:class extends Ko{constructor(){super(),this.eContent=i.dRA,this.hasVisiblePanel=!1,this.allowFocusInnerElement=!1,this.lastAriaAnnounced={paginationRow:"",paginationPage:"",paginationPageNumbers:""},this.registerCSS(".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;height:var(--ag-pagination-panel-height);overflow:auto hidden;scrollbar-width:thin}.ag-paging-panel-content{align-items:center;display:flex;flex:0 0 auto;gap:calc(var(--ag-spacing)*4);justify-content:flex-end;min-width:100%;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}}:where(.ag-number-field).ag-paging-number{display:inline-block}:where(.ag-number-field.ag-paging-number) .ag-input-field-input{text-align:end}.ag-paging-number,.ag-paging-row-summary-panel-number{font-variant-numeric:tabular-nums;font-weight:500}.ag-paging-description{line-height:0}.ag-paging-row-summary-panel{display:inline-grid}.ag-paging-row-summary-panel:before{content:var(--ag-internal-pagination-width-string);font-variant-numeric:tabular-nums;font-weight:500;grid-area:1/1;visibility:hidden}.ag-paging-row-summary-content{grid-area:1/1;justify-self:center}")}postConstruct(){const e=`ag-${this.getCompId()}`;var t,s,o;this.setTemplate({tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:e},children:[{tag:"div",cls:"ag-paging-panel-content",ref:"eContent"}]}),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(e):function(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}(this.beans,e),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.buildComponents(e),this.addManagedPropertyListeners(["pagination","suppressPaginationPanel"],(()=>this.onPaginationChanged())),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],(()=>this.onPageSizeRelatedOptionsChange())),this.addManagedPropertyListener("paginationPanels",(()=>this.rebuildComponents(e))),this.addManagedEventListeners({paginationChanged:()=>this.onPaginationEvent()}),t=this.beans,s=this,o=this.getGui(),s.addManagedElementListeners(o,{keydown:e=>{if(!e.defaultPrevented&&!0!==e[yi]&&e.key===i.DDm.TAB){const s=e.shiftKey;(0,i.ey2)({beans:t,rootNode:o,backwards:s})||vi(t,s)&&e.preventDefault()}}}),this.addManagedElementListeners(this.getGui(),{focusin:e=>{const t=e.target;t&&(0,i.yu_)(t)}}),this.onPaginationChanged(),this.announceAriaStatus()}setAllowFocus(e){this.allowFocusInnerElement=e}getFocusableContainerName(){return"pagination"}buildComponents(e){const t=this.gos.get("paginationPanels")??Df,s=new Set;for(const i of t){const t="string"==typeof i?i:i.type;if(!s.has(t))if(s.add(t),"pageSize"===t){const e="object"==typeof i&&"pageSize"===i.type?i:void 0;this.pageSizeComp=this.createManagedBean(new Ef(e)),this.pageSizeComp.updateVisibility(),this.eContent.appendChild(this.pageSizeComp.getGui())}else if("rowSummary"===t)this.rowSummaryComp=this.createManagedBean(new Ff(e)),this.eContent.appendChild(this.rowSummaryComp.getGui());else if("pageSummary"===t){const t="object"==typeof i&&"pageSummary"===i.type?i.suppressPageInput:void 0;this.pageSummaryComp=this.createManagedBean(new kf(e,t)),this.eContent.appendChild(this.pageSummaryComp.getGui())}else if("pageNumbers"===t){const t=this.beans.registry.createDynamicBean("pageNumbers",!0,e);t&&(this.pageNumbersComp=this.createManagedBean(t),this.eContent.appendChild(this.pageNumbersComp.getGui()))}}this.updateHasVisiblePanel()}updateHasVisiblePanel(){this.hasVisiblePanel=null!=this.rowSummaryComp||null!=this.pageSummaryComp||null!=this.pageNumbersComp||!0===this.pageSizeComp?.shouldShowPageSizeSelector()}rebuildComponents(e){for(const e of[this.pageSizeComp,this.rowSummaryComp,this.pageSummaryComp,this.pageNumbersComp])e&&(0,i.MwW)(e.getGui());this.pageSizeComp=this.destroyBean(this.pageSizeComp),this.rowSummaryComp=this.destroyBean(this.rowSummaryComp),this.pageSummaryComp=this.destroyBean(this.pageSummaryComp),this.pageNumbersComp=this.destroyBean(this.pageNumbersComp),this.buildComponents(e),this.onPaginationChanged(),this.announceAriaStatus()}onPaginationChanged(){const e=this.hasVisiblePanel&&this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e)}onPageSizeRelatedOptionsChange(){this.pageSizeComp?.updateVisibility(),this.updateHasVisiblePanel(),this.onPaginationChanged()}onPaginationEvent(){this.rowSummaryComp?.refresh(),this.pageSummaryComp?.refresh(),this.pageNumbersComp?.refresh(),this.announceAriaStatus()}announceAriaStatus(){this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&(this.announceIfChanged(this.rowSummaryComp,"paginationRow"),this.announceIfChanged(this.pageSummaryComp,"paginationPage"),this.announceIfChanged(this.pageNumbersComp,"paginationPageNumbers"))}announceIfChanged(e,t){if(!e)return;const s=e.ariaStatus;s!==this.lastAriaAnnounced[t]&&(this.lastAriaAnnounced[t]=s,this.beans.ariaAnnounce?.announceValue(s,t))}}},Af={moduleName:"Pagination",version:cn,beans:[class extends ke{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.pageSizeFromPanel=this.getPanelPageSize(),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPanels",this.onPanelsChanged.bind(this))}getPaginationSelector(){return Tf}isPaginateChildRows(){const e=this.gos;return!!(e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren"))||e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}getPanelPageSize(){const e=this.gos.get("paginationPanels");if(e)for(let t=0,s=e.length;t<s;++t){const s=e[t];if("object"==typeof s&&"pageSize"===s.type)return s.paginationPageSize}}onPanelsChanged(){const e=this.getPanelPageSize();e!==this.pageSizeFromPanel&&this.setPageSize(e,"panel")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||"number"!=typeof t)return;const{editSvc:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(e)??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return!this.active||e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){this.goToPage(Math.max(0,this.totalPages-1))}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){const{pageSizeAutoCalculated:e,pageSizeFromInitialState:t,pageSizeFromPanel:s,pageSizeFromGridOptions:i,pageSizeFromPageSizeSelector:o,gos:n}=this;return(n.get("paginationAutoPageSize")?e:void 0)??o??t??s??i??100}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const s=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"panel":this.pageSizeFromPanel=e,this.applyExplicitPageSize(e);break;case"gridOptions":this.pageSizeFromGridOptions=e,this.applyExplicitPageSize(e)}s!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}applyExplicitPageSize(e){void 0!==e&&(this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage())}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)return void this.setZeroRows();const s=this.pageSize,i=t-1;this.totalPages=Math.floor(i/s)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,n=s*o;let r=s*(o+1)-1;if(r>i&&(r=i),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===i)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const t=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=t-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,0===e)return void this.setZeroRows();const t=this.pageSize,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid();const i=this.currentPage;this.topDisplayedRowIndex=t*i,this.bottomDisplayedRowIndex=t*(i+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}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:s=!1,newPageSize:i=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:i,keepRenderedRows:t})}},class extends ke{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e=>{this.scrollingRowsCtrl=e.scrolling;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")||null==this.scrollingRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.scrollingRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,s=()=>{const s=Math.max(q(t),1),i=Math.floor(e/s);t.pagination.setPageSize(i,"autoCalculated")};this.isBodyRendered?(0,i.pkA)(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}}],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:function(e){return e.rowModel.isLastRowIndexKnown()},paginationGetPageSize:function(e){return e.pagination?.getPageSize()??100},paginationGetCurrentPage:function(e){return e.pagination?.getCurrentPage()??0},paginationGetTotalPages:function(e){return e.pagination?.getTotalPages()??1},paginationGetRowCount:function(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()},paginationGoToNextPage:function(e){e.pagination?.goToNextPage()},paginationGoToPreviousPage:function(e){e.pagination?.goToPreviousPage()},paginationGoToFirstPage:function(e){e.pagination?.goToFirstPage()},paginationGoToLastPage:function(e){e.pagination?.goToLastPage()},paginationGoToPage:function(e,t){e.pagination?.goToPage(t)}},dependsOn:[Ad]};function Mf(e){const t=[];for(let s=0,i=e.length;s<i;++s){const i=e[s];if(s>0){const o=i-e[s-1];2===o?t.push(i-1):o>2&&t.push("ellipsis")}t.push(i)}return t}var Nf="data-page",Lf={moduleName:"PaginationPageNumbers",version:cn,dynamicBeans:{pageNumbers:class extends ls{constructor(e){super(),this.eNumbers=i.dRA,this.btFirst=i.dRA,this.btPrevious=i.dRA,this.btNext=i.dRA,this.btLast=i.dRA,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.ariaStatus="",this.idPrefix=e,this.registerCSS(".ag-paging-page-numbers-panel{align-items:center;display:flex;gap:calc(var(--ag-spacing)*1.5)}.ag-paging-page-numbers{align-items:center;display:flex;gap:calc(var(--ag-spacing)*.5)}.ag-paging-page-number{align-items:center;border-radius:var(--ag-border-radius);cursor:pointer;display:flex;font-variant-numeric:tabular-nums;justify-content:center;min-width:var(--ag-icon-size);padding:var(--ag-spacing)}.ag-paging-page-number:hover{background-color:var(--ag-row-hover-color)}.ag-paging-page-number:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}.ag-paging-page-number-current{background-color:color-mix(in srgb,var(--ag-background-color),var(--ag-foreground-color) 5%);cursor:default;font-weight:600}.ag-paging-page-number-ellipsis{align-items:center;display:flex;font-variant-numeric:tabular-nums;justify-content:center;min-width:var(--ag-icon-size);padding:var(--ag-spacing);pointer-events:none}")}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination}postConstruct(){const e=this.getLocaleTextFunc(),t=(t,s,i)=>({tag:"div",ref:t,cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e(s,i)}});this.setTemplate({tag:"div",cls:"ag-paging-page-numbers-panel",children:[t("btFirst","firstPage","First Page"),t("btPrevious","previousPage","Previous Page"),{tag:"div",ref:"eNumbers",cls:"ag-paging-page-numbers"},t("btNext","nextPage","Next Page"),t("btLast","lastPage","Last Page")]});const s=this.gos.get("enableRtl");this.btFirst.insertAdjacentElement("afterbegin",er(s?"last":"first",this.beans)),this.btPrevious.insertAdjacentElement("afterbegin",er(s?"next":"previous",this.beans)),this.btNext.insertAdjacentElement("afterbegin",er(s?"previous":"next",this.beans)),this.btLast.insertAdjacentElement("afterbegin",er(s?"first":"last",this.beans)),this.initNavButton(this.btFirst,(()=>this.onBtFirst())),this.initNavButton(this.btPrevious,(()=>this.onBtPrevious())),this.initNavButton(this.btNext,(()=>this.onBtNext())),this.initNavButton(this.btLast,(()=>this.onBtLast())),this.addManagedListeners(this.eNumbers,{click:e=>this.onPageActivated(e.target),keydown:e=>{e.key!==i.DDm.ENTER&&e.key!==i.DDm.SPACE||(e.preventDefault(),this.onPageActivated(e.target))}}),this.refresh()}initNavButton(e,t){this.activateTabIndex([e]),this.addManagedListeners(e,{click:t,keydown:e=>{e.key!==i.DDm.ENTER&&e.key!==i.DDm.SPACE||(e.preventDefault(),t())}})}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}onPageActivated(e){const t=e?.closest(`[${Nf}]`);if(!t)return;const s=Number(t.getAttribute(Nf));Number.isInteger(s)&&this.pagination.goToPage(s)}refresh(){const e=this.pagination,t=e.getCurrentPage(),s=e.getTotalPages(),o=this.getLocaleTextFunc(),n=function(e,t,s){const i=Math.max(t,1),o=Math.min(Math.max(e+1,1),i);if(!s){const e=new Set([1]),t=Math.max(o-Math.floor(1.5),1);for(let s=0;s<3;++s){const o=t+s;o<=i&&e.add(o)}const s=Mf([...e].sort(((e,t)=>e-t)));return s.push("ellipsis"),s}if(t<=1)return[1];if(t<=5){const e=[];for(let s=1;s<=t;++s)e.push(s);return e}let n,r;o<=4?(n=1,r=5):o>=t-3?(n=t-5+1,r=5):(n=o-Math.floor(1.5),r=3);const a=new Set([1,t]);for(let e=0;e<r;++e)a.add(n+e);return Mf([...a].sort(((e,t)=>e-t)))}(t,s,this.rowModel.isLastRowIndexKnown()),{eNumbers:r}=this,a=r.contains((0,i.UlD)(this.beans));r.replaceChildren();const l=o("page","Page");let c;for(let e=0,s=n.length;e<s;++e){const s=n[e];"ellipsis"===s?r.appendChild(this.createEllipsis(e)):s===t+1?(c=this.createCurrentPage(s,l),r.appendChild(c)):r.appendChild(this.createPageButton(s,l))}a&&c?.focus(),this.updateArrows(t,s);const d=o("of","of"),u=this.formatNumber(s>0?t+1:1),h=this.formatNumber(Math.max(s,1));this.ariaStatus=`${l} ${u} ${d} ${h}`}updateArrows(e,t){const s=this.rowModel.isLastRowIndexKnown(),i=s&&0===t,o=e===t-1;this.previousAndFirstButtonsDisabled=0===e||i,this.nextButtonDisabled=o||i,this.lastButtonDisabled=!s||i||o,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){(0,i.TGw)(e,t),e.classList.toggle("ag-disabled",t)}createPageButton(e,t){const s=ni({tag:"div",cls:"ag-paging-page-number",role:"button",attrs:{[Nf]:String(e-1),"aria-label":`${t} ${e}`}});return s.textContent=this.formatNumber(e),this.activateTabIndex([s]),s}createCurrentPage(e,t){const s=ni({tag:"div",cls:"ag-paging-page-number ag-paging-page-number-current",role:"button",attrs:{"aria-current":"page","aria-disabled":"true","aria-label":`${t} ${e}`}});return s.textContent=this.formatNumber(e),this.activateTabIndex([s]),s}createEllipsis(e){const t=ni({tag:"span",cls:"ag-paging-page-number-ellipsis",attrs:{id:`${this.idPrefix}-page-ellipsis-${e}`,"aria-hidden":"true"}});return t.textContent="…",t}formatNumber(e){return If(e,this.gos,this.getLocaleTextFunc.bind(this))}}},dependsOn:[Af]},Vf={moduleName:"PinnedRow",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const t=e.get("enableRowPinning"),s=se(e),i=!!t||"pinnedBottom"===s||"pinnedTop"===s,o=i?this.inner instanceof js:this.inner instanceof Bs;this.inner&&o&&this.destroyBean(this.inner),!o&&this.inner||(this.inner=this.createManagedBean(i?new Bs:new js))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,s){return this.inner.pinRow(e,t,s)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}}],css:[".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{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}"],apiFunctions:{getPinnedTopRowCount:function(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0},getPinnedBottomRowCount:function(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0},getPinnedTopRow:function(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)},getPinnedBottomRow:function(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)},forEachPinnedRow:function(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},_f={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Of={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Bf={moduleName:"HighlightChanges",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),i=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];if(o.delete(e),!e.comp)return;const n=Date.now(),r=n+s,a={phase:"flash",flashEndTime:r,fadeEndTime:n+s+i};o.set(e,a);const l=`ag-cell-${t}`,c=`${l}-animation`,{comp:d,eGui:{style:u}}=e;d.toggleCss(l,!0),d.toggleCss(c,!1),u.removeProperty("transition"),u.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),s)})),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const i=this.animations[s],o=`ag-cell-${s}`,n=`${o}-animation`;for(const[s,r]of i){if(!s.isAlive()||!s.comp){i.delete(s);continue}const{phase:a,flashEndTime:l,fadeEndTime:c}=r,d="flash"===a?l:c;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:u,eGui:{style:h}}=s;switch(a){case"flash":u.toggleCss(o,!1),u.toggleCss(n,!0),h.transition=`background-color ${c-l}ms`,h.transitionDelay=l-e+"ms",t=Math.min(c,t??1/0),r.phase="fade";break;case"fade":u.toggleCss(o,!1),u.toggleCss(n,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),i.delete(s)}}}null==t?(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 s=function(e){const{rowIndex:t,rowPinned:s,column:i}=e;return`${t}.${null==s?"null":s}.${i.getId()}`}(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}}],userComponents:{agAnimateShowChangeCellRenderer:class extends ls{constructor(){super(_f),this.eValue=i.dRA,this.eDelta=i.dRA,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),n=(0,i.Qmv)(o)?o:s,r=t>=0,a=this.eDelta;a.textContent=r?"↑"+n:"↓"+n,a.classList.toggle("ag-value-change-delta-up",r),a.classList.toggle("ag-value-change-delta-down",!r)}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"),(0,i.fDi)(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:n,lastValue:r,beans:a}=this;if(s===r)return!1;if((0,i.Qmv)(o)?n.textContent=o:(0,i.Qmv)(s)?n.textContent=s:(0,i.fDi)(n),a.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;const l=s&&"object"==typeof s&&"toNumber"in s?s.toNumber():s,c=r&&"object"==typeof r&&"toNumber"in r?r.toNumber():r;if(l===c)return!1;if("number"==typeof l&&"number"==typeof c){const t=l-c;this.showDelta(e,t)}return r&&n.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},agAnimateSlideCellRenderer:class extends ls{constructor(){super(Of),this.eCurrent=i.dRA,this.refreshCount=0,this.registerCSS(".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}")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,i=ni({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=s.textContent,this.getGui().insertBefore(i,s),t.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")}),50),window.setTimeout((()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)}),3e3)}))}refresh(e,t=!1){let s=e.value;if((0,i.MWY)(s)&&(s=""),s===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return(0,i.Qmv)(e.valueFormatted)?o.textContent=e.valueFormatted:(0,i.Qmv)(e.value)?o.textContent=s:(0,i.fDi)(o),!0}}},apiFunctions:{flashCells:function(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming((()=>{for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(i,t)}))}}},Hf={moduleName:"RenderApi",version:cn,apiFunctions:{setGridAriaProperty:function(e,t,s){if(!t)return;const i=e.ctrlsSvc.getGridBodyCtrl().eGridViewport,o=`aria-${t}`;null===s?i.removeAttribute(o):i.setAttribute(o,s)},refreshCells:function(e,t={}){e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.refreshCells(t)))},refreshHeader:function(e){e.frameworkOverrides.wrapIncoming((()=>{e.ctrlsSvc.getHeaderRowContainerCtrl()?.refresh()}))},isAnimationFrameQueueEmpty:function(e){return e.animationFrameSvc?.isQueueEmpty()??!0},flushAllAnimationFrames:function(e){e.animationFrameSvc?.flushAllFrames()},getSizesForCurrentTheme:function(e){return{rowHeight:q(e),headerHeight:Ei(e)}},getCellRendererInstances:function(e,t={}){const s=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const e=i.getCellRenderer();null!=e&&s.push(Iu(e))}if(t.columns?.length)return s;const i=[],o=Nc(t.rowNodes);for(const t of e.rowRenderer.getAllRowCtrls())if((!o||Lc(t.rowNode,o))&&t.isFullWidth())for(const e of t.getModeCellRenderers())null!=e&&i.push(Iu(e));return[...i,...s]}}},Gf={moduleName:"RowAutoHeight",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=(0,i.pkA)(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,pinnedRowModel:s}=this.beans,i=e.autoHeightCols;let o=!1;const n=e=>{if(G(this.gos,e))return;const t=this.getRowAutoHeight(e,i);null!=t&&t!==e.rowHeight&&(e.setRowHeight(t),o=!0)};s?.forEachPinnedRow?.("top",n),s?.forEachPinnedRow?.("bottom",n),t.forEachDisplayedNode?.(n),o&&t.onRowHeightChanged?.()}getRowAutoHeight(e,t){const{rowSpanSvc:s}=this.beans,i=e.__autoHeights;let o=Y(this.beans,e).height;for(const n of t){let t=i?.[n.colId];const r=s?.getCellSpan(n,e);if(r){if(r.getLastNode()!==e)continue;if(t=r.getLastNodeAutoHeight(),!t)return}if(null==t){if(this.colSpanSkipCell(n,e))continue;return}o=Math.max(t,o)}return o}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),null==t)return void delete e.__autoHeights[s.getId()];const i=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,i!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:i,visibleCols:o}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=o.getLeftColsForRow(t);break;case"right":n=o.getRightColsForRow(t);break;case null:n=i.getColsWithinViewport(t)}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(G(this.gos,e.rowNode)||!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:n,column:r}=e,a=this.beans,l=c=>{if(this.beans.editSvc?.isEditing(e))return;if(!e.isAlive()||!s.isAlive())return;const{paddingTop:d,paddingBottom:u,borderBottomWidth:h,borderTopWidth:p}=(0,i.rqk)(o),g=d+u+h+p,f=t.offsetHeight+g;if(c<5){const e=(0,i.BxM)(a);if(!e?.contains(t)||0==f)return void window.setTimeout((()=>l(c+1)),0)}this.setRowAutoHeight(n,f,r)},c=()=>l(0);c();const d=(0,i.QSI)(a,t,c);return s.addDestroyFunc((()=>{d(),this.setRowAutoHeight(n,void 0,r)})),!0}setAutoHeightActive(e){this.active=e}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:s}of e)if(t&&!this.beans.colModel.colSpanActive||(t=this.beans.colViewport.getColsWithinViewport(s).filter((e=>e.isAutoHeight()))),0!==t.length){if(!s.__autoHeights)return!1;for(const e of t){const t=s.__autoHeights[e.colId];if(!t||s.rowHeight<t)return!1}}return!0}}]},zf=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&&this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){const e=this.firstNode.__autoHeights?.[this.col.colId];if(null==e)return;let t=0;for(const e of this.spannedNodes)e!==this.lastNode&&(t+=e.rowHeight);return e-t}},Wf=class{constructor(e,t){this.beans=e,this.column=t,this.centerValueNodeMap=null,this.topValueNodeMap=null,this.bottomValueNodeMap=null}buildCache(e){const{gos:t,pinnedRowModel:s,rowModel:i,valueSvc:o,pagination:n}=this.beans,r=this.column,a=r.colDef,l=this.getNodeMap(e),c=new Map,d=t.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p="function"==typeof h;let g,f=null,m=null;const v=(e,t)=>{f=e,m=null,g=t},w=e=>{if(G(t,e))return void v(null,null);const s=!(e.isExpandable()||e.group||e.detail||d&&d({rowNode:e}));if(null==e.rowIndex||!s)return void v(null,null);if(e.level!==f?.level||e.footer||m&&e.rowIndex-1!==m?.getLastNode().rowIndex)return void v(e,o.getValueFromData(r,e));const i=o.getValueFromData(r,e);if(p){const s=xe(t,{valueA:g,nodeA:f,valueB:i,nodeB:e,column:r,colDef:a});if(!h(s))return void v(e,i)}else if(u?!u(g,i):g!==i)return void v(e,i);if(!m){const e=l?.get(f);e?.firstNode===f?(e.reset(),m=e):m=new zf(r,f),c.set(f,m)}m.addSpannedNode(e),c.set(e,m)};switch(e){case"center":i.forEachDisplayedNode?.((e=>{(!n||n.isRowInPage(e.rowIndex))&&w(e)})),this.centerValueNodeMap=c;break;case"top":s?.forEachPinnedRow("top",w),this.topValueNodeMap=c;break;case"bottom":s?.forEachPinnedRow("bottom",w),this.bottomValueNodeMap=c}}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}}},jf=class extends Jl{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell";const i=()=>{jl(this),this.setAriaRowSpan()};this.addManagedListeners(s.eventSvc,{paginationChanged:i,recalculateRowBounds:i,pinnedHeightChanged:i})}setComp(e,t,s,i,o,n,r){this.eWrapper=s,super.setComp(e,t,s,i,o,n,r),this.setAriaRowSpan()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowCtrl:t}=this,s=t.getAriaRowIndex();e&&null!=s&&(0,i.vwK)(e,s)}setAriaRowSpan(){this.eGui&&(0,i.HVY)(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(mi(t))return void(this.focusedCellPosition=void 0);const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},Uf=class extends nc{getInitialRowClasses(){return["ag-spanned-row",this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(t)return t.firstNode!==this.rowNode?void 0:new jf(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!!t&&(!(t.firstNode!==this.rowNode)&&e.getCellSpan()===t)}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},$f={moduleName:"CellSpan",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.active=!1,this.spanningColumns=null,this.debouncePinnedEvent=(0,i.pkA)(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=(0,i.pkA)(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){if(!this.gos.get("enableCellSpan"))return;this.active=!0;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){let t=this.spanningColumns;if(t){if(t.has(e))return}else t=new Map,this.spanningColumns=t;const s=new Wf(this.beans,e);t.set(e,s),this.buildCache(s)}columnRowSpanChanged(e){if(!this.active)return;const t=this.spanningColumns?.get(e);if(e.colDef.spanRows){if(!t)return void this.register(e);this.buildCache(t)}else t&&this.deregister(e)}refreshCols(){if(this.active){const e=this.beans.colModel.colsList;for(let t=0,s=e.length;t<s;++t){const s=e[t];s.colDef.spanRows&&this.register(s)}}}buildCache(e){e.buildCache("top"),e.buildCache("bottom"),e.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.isAlive()&&this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns?.delete(e)}onRowDataUpdated({node:e}){const t=this.beans.spannedRowRenderer;e.rowPinned?this.pinnedTimeout??(this.pinnedTimeout=window.setTimeout((()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t?.createCtrls("top"),t?.createCtrls("bottom")}),0)):this.modelTimeout??(this.modelTimeout=window.setTimeout((()=>{this.modelTimeout=null,this.buildModelCaches(),t?.createCtrls("center")}),0))}buildModelCaches(){this.clearModelTimeout();const e=this.spanningColumns;if(e)for(const t of e.values())t.buildCache("center");this.debounceModelEvent()}buildPinnedCaches(){this.clearPinnedTimeout();const e=this.spanningColumns;if(e)for(const t of e.values())t.buildCache("top"),t.buildCache("bottom");this.debouncePinnedEvent()}isCellSpanning(e,t){return!!this.spanningColumns?.get(e)?.getCellSpan(t)}getCellSpanByPosition(e){const{column:t,rowIndex:s}=e,i=this.spanningColumns?.get(t);if(!i)return;const{pinnedRowModel:o,rowModel:n}=this.beans;let r;switch(e.rowPinned){case"top":r=o?.getPinnedTopRow(s);break;case"bottom":r=o?.getPinnedBottomRow(s);break;default:r=n.getRow(s)}return r&&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){return this.spanningColumns?.get(e)?.getCellSpan(t)}forEachSpannedColumn(e,t){const s=this.spanningColumns;if(s)for(const i of s.values()){const s=i.getCellSpan(e);s&&t(i.column,s)}}clearModelTimeout(){const e=this.modelTimeout;null!=e&&(this.modelTimeout=null,clearTimeout(e))}clearPinnedTimeout(){const e=this.pinnedTimeout;null!=e&&(this.pinnedTimeout=null,clearTimeout(e))}destroy(){super.destroy(),this.active=!1,this.spanningColumns=null,this.clearPinnedTimeout(),this.clearModelTimeout()}},class extends ke{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,s=this.getCtrlsMap(e),i=s.size,o=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const e of o)e.isAlive()&&t?.forEachSpannedColumn(e.rowNode,((e,t)=>{if(n.has(t.firstNode))return;const i=s.get(t.firstNode);if(i)return n.set(t.firstNode,i),void s.delete(t.firstNode);r=!0;const o=new Uf(t.firstNode,this.beans,!1,!1,!1);n.set(t.firstNode,o)}));this.setCtrlsMap(e,n);const a=n.size===i;if(r||!a){for(const e of s.values())e.destroyFirstPass(!0),e.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,s=t?.getCellSpanByPosition(e);if(!s)return;const i=this.getCtrlsMap(e.rowPinned).get(s.firstNode);return i?i.getAllCellCtrls().find((t=>t.column===e.column)):void 0}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}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}}]},Yf=class extends ke{constructor(){super(...arguments),this.column=null}destroy(){this.destroyColumn(),super.destroy()}refreshCols(){const e=this.isEnabled(),t=this.column;if(e&&!t){const e=this.createColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const s=new lt(e,null,t,!1,this.colKind);return this.beans.context.createBean(s),this.column=s,s}return!e&&t?(this.destroyColumn(),null):t}refreshColDef(e){const t=this.column;if(t){const s=this.createColDef();t.setColDef(s,null,e);const i=this.beans;ze(i,{state:[Et(i,s,t.colId)]},e)}}destroyColumn(){const e=this.column;e&&(this.column=null,e.isAlive()&&e.destroy())}},Kf=(e,t,s,i)=>{const o=s.isSelected();return o===i.isSelected()?0:o?1:-1},qf=(e,t)=>{for(let s=0,i=e.length;s<i;++s){const i=e[s],o=i.childrenAfterGroup;null!==o&&(qf(o,t),t(i))}},Zf=(e,t,s,i)=>{if(null!=s){const e=s.getSortedRows();for(let t=0,s=e.length;t<s;++t){const s=e[t];null===s.childrenAfterGroup||s.destroyed||i(s)}return}if(null==e)return;const o=e.childrenAfterGroup;null!==o&&(t&&qf(o,i),i(e))},Qf={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},Jf=class extends ls{constructor(){super(Qf,[ya]),this.eCheckbox=i.dRA}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:s}=this,o=t.isSelected(),n=(0,i.MbN)(e,o),[r,a]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],l=e(r,a);s.setValue(o,!0),s.setInputAriaLabel(`${l} (${n})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:ds,click:e=>{ds(e),this.eCheckbox.isDisabled()||this.beans.selectionSvc?.handleSelectionEvent(e,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",(({currentValue:e,previousValue:t})=>{("object"==typeof e?ce(e):void 0)!==("object"==typeof t?ce(t):void 0)&&this.onSelectableChanged()})),pe(this.gos)||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:s,gos:i}=this,o=t.selectable,n=this.getIsVisible();let r;if("function"==typeof n){const i=s?.callbackParams;if(e){const s=e.createColumnFunctionCallbackParams(t);r=n({...i,...s})}else r=n({...i,node:t,data:t.data})}else r=n??!1;const a=o&&!r||!o&&r,l=o||r,c=i.get("rowSelection"),d=c&&"string"!=typeof c?!ce(c):!!e?.colDef.showDisabledCheckboxes;this.setVisible(l&&(!a||d)),this.setDisplayed(l&&(!a||d)),l&&this.eCheckbox.setDisabled(a),s?.removeHidden&&this.setDisplayed(l)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&"string"!=typeof t?re(t):this.column?.colDef?.checkboxSelection}},Xf=class{constructor(e,t){this.rowModel=e,this.pinnedRowModel=t,this.selectAll=!1,this.rootId=null,this.endId=null}reset(){this.rootId=null,this.endId=null}setRoot(e){this.rootId=e.id,this.endId=null}setEndRange(e){this.endId=e.id}getRange(){const e=this.getRoot(),t=this.getEnd();return null==e||null==t?[]:this.getNodesInRange(e,t)??[]}isInRange(e){return null!==this.rootId&&this.getRange().some((t=>t.id===e.id))}getRoot(e){return this.rootId?this.getRowNode(this.rootId):e?(this.setRoot(e),e):void 0}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t;const{rowModel:s,pinnedRowModel:i}=this;return t??(t=s.getRowNode(e)),i?.isManual()&&(t??(t=i.getPinnedRowById(e,"top")),t??(t=i.getPinnedRowById(e,"bottom"))),t}isRangeStartTheRoot(e){const{rootId:t}=this;return null!==t&&(e.id===t||Ns(this.getRowNode(t))?.id===e.id)}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const s=this.isRangeStartTheRoot(t[0]),i=t.findIndex((t=>t.id===e.id));if(i>-1){const o=t.slice(0,i),n=t.slice(i+1);return this.setEndRange(e),s?{keep:o,discard:n}:{keep:n,discard:o}}return{keep:t,discard:[]}}extend(e,t=!1){const s=this.getRoot();if(null==s){const s=this.getRange().slice();return t&&e.depthFirstSearch((e=>!e.group&&s.push(e))),s.push(e),this.setRoot(e),{keep:s,discard:[]}}const i=this.getNodesInRange(s,e);if(!i)return this.setRoot(e),{keep:[e],discard:[]};if(i.find((e=>e.id===this.endId)))return this.setEndRange(e),{keep:i,discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:i,discard:t}}}getNodesInRange(e,t){const{pinnedRowModel:s,rowModel:i}=this;if(!s?.isManual())return i.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&!t.rowPinned){const o=zl(s,"top",e,void 0),n=i.getNodesInRangeForSelection(i.getRow(0),t);return null===n?null:o.concat(n)}if("bottom"===e.rowPinned&&!t.rowPinned){const o=zl(s,"bottom",void 0,e),n=i.getRowCount(),r=i.getRow(n-1),a=i.getNodesInRangeForSelection(t,r);return null===a?null:a.concat(o)}if(!e.rowPinned&&!t.rowPinned)return i.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&"top"===t.rowPinned)return zl(s,"top",e,t);if("bottom"===e.rowPinned&&"top"===t.rowPinned){const o=zl(s,"top",t,void 0),n=zl(s,"bottom",void 0,e),r=i.getRow(0),a=i.getRow(i.getRowCount()-1),l=i.getNodesInRangeForSelection(r,a);return null===l?null:o.concat(l).concat(n)}if(!e.rowPinned&&"top"===t.rowPinned){const o=zl(s,"top",t,void 0),n=i.getNodesInRangeForSelection(i.getRow(0),e);return null===n?null:o.concat(n)}if("top"===e.rowPinned&&"bottom"===t.rowPinned){const o=zl(s,"top",e,void 0),n=zl(s,"bottom",void 0,t),r=i.getRow(0),a=i.getRow(i.getRowCount()-1),l=i.getNodesInRangeForSelection(r,a);return null===l?null:o.concat(l).concat(n)}if("bottom"===e.rowPinned&&"bottom"===t.rowPinned)return zl(s,"bottom",e,t);if(!e.rowPinned&&"bottom"===t.rowPinned){const o=zl(s,"bottom",void 0,t),n=i.getRow(i.getRowCount()-1),r=i.getNodesInRangeForSelection(e,n);return null===r?null:r.concat(o)}return null}},em=class extends ke{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains((0,i.UlD)(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new Ca);this.cbSelectAll=t,t.addCss("ag-header-select-all"),(0,i.lXX)(t.getGui(),"presentation"),this.showOrHideSelectAll();const s=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:s,paginationChanged:s,modelUpdated:s}),this.addManagedPropertyListener("rowSelection",(({currentValue:e,previousValue:t})=>{const s=e=>"string"!=typeof e&&e&&"singleRow"!==e.mode?e.selectAll:void 0;s(e)!==s(t)&&this.showOrHideSelectAll(),this.updateStateOfCheckbox()})),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){this.isAlive()&&this.showOrHideSelectAll("uiColumnMoved"===e.source)}showOrHideSelectAll(e=!1){const t=this.isCheckboxSelection();this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel(e)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.getSelectAllMode(),t=this.beans.selectionSvc,s=this.cbSelectAll,i=t.getSelectAllState(e);s.setValue(i);const o=t.hasNodesToSelect(e);s.setDisabled(!o),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:s,cbSelectAll:o,cbSelectAllVisible:n}=this,r=o.getValue(),a=(0,i.MbN)(t,r),l=t("ariaRowSelectAll","Press Space to toggle all rows selection");s.setAriaDescriptionProperty("selectAll",n?`${l} (${a})`:null),o.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||s.announceAriaDescription()}checkSelectionType(e){return!!fe(this.gos)||(this.warn(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:s}=this.beans;return!(!B(t)&&!z(t)&&(this.warn(129,{feature:e,rowModel:s.getType()}),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let s="uiSelectAll";"currentPage"===t?s="uiSelectAllCurrentPage":"filtered"===t&&(s="uiSelectAllFiltered");const i={source:s,selectAll:t},o=this.beans.selectionSvc;e?o.selectAllRowNodes(i):o.deselectAllRowNodes(i)}isCheckboxSelection(){const{column:e,gos:t,beans:s}=this,i="object"==typeof t.get("rowSelection")?"headerCheckbox":"headerCheckboxSelection";return tm(s,e)&&this.checkRightRowModelType(i)&&this.checkSelectionType(i)}getSelectAllMode(){const e=ve(this.gos,!1);if(e)return e;const{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:s}=this.column.colDef;return t?"currentPage":s?"filtered":"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function tm({gos:e,selectionColSvc:t},s){const i=e.get("rowSelection"),o=s.colDef,{headerCheckboxSelection:n}=o;let r=!1;if("object"==typeof i){const e=bt(s),o=yt(s);("autoGroupColumn"===le(i)&&o||e&&t?.isEnabled())&&(r=ae(i))}else r="function"==typeof n?n(xe(e,{column:s,colDef:o})):!!n;return r}var sm=class extends ke{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new Xf(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],(()=>{const t=pe(e);t!==this.isRowSelectable&&(this.isRowSelectable=t,this.updateSelectable())})),this.isRowSelectable=pe(e);const s=t.rowModel;this.addManagedEventListeners({cellValueChanged:e=>this.updateRowSelectable(e.node),rowNodeDataChanged:e=>{s.refreshingData||this.updateRowSelectable(e.node)}})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new Jf}createSelectAllFeature(e){if(tm(this.beans,e))return new em(e)}isMultiSelect(){return fe(this.gos)}onRowCtrlSelected(e,t){const s=e.getGui();if(!s)return;const o=!!e.rowNode.isSelected();s.rowComp.toggleCss("ag-row-selected",o);const n=s.element;(0,i.QyW)(n,o),n.contains((0,i.UlD)(this.beans))&&t()}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;const t=e.isSelected(),s=this.beans.editSvc?.isEditing({rowNode:e});if(!e.selectable||s)return;const i=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(i,"rowSelection")}isRowSelectionBlocked(e){return!e.selectable||e.rowPinned&&!Gl(e)||!U(this.gos)}updateRowSelectable(e,t){const s=e.pinnedSibling,i=e.rowPinned&&s?s.selectable:this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,i,t),i}setRowSelectable(e,t,s){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),s)return;if(we(this.gos)){const t=this.calculateSelectedFromChildren(e);return void this.setNodesSelected({nodes:[e],newValue:t??!1,source:"selectableChanged"})}e.isSelected()&&!e.selectable&&this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,s=!1;const i=e.childrenAfterGroup;if(!i?.length)return e.selectable?e.__selected:null;for(let e=0,o=i.length;e<o;e++){const o=i[e];let n=o.isSelected();if(!o.selectable){const e=this.calculateSelectedFromChildren(o);if(null===e)continue;n=e}switch(n){case!0:t=!0;break;case!1:s=!0;break;default:return}}return t&&s?void 0:!!t||!s&&(e.selectable?e.__selected:null)}selectRowNode(e,t,s,i="api"){if(t&&e.destroyed)return!1;const o=!e.selectable&&t,n=e.__selected===t;if(o||n)return!1;e.__selected=t,e.dispatchRowEvent("rowSelected");const r=e.sibling;r&&r.footer&&r.__localEventService&&r.dispatchRowEvent("rowSelected");const a=e.pinnedSibling;return a?.rowPinned&&a.__localEventService&&a.dispatchRowEvent("rowSelected"),this.eventSvc.dispatchEvent({...Ts(e,this.gos,"rowSelected"),event:s||null,source:i}),!0}isCellCheckboxSelection(e,t){const s=this.gos.get("rowSelection");if(s&&"string"!=typeof s){const i=bt(e)&&re(s);return e.isColumnFunc(t,i)}return e.isColumnFunc(t,e.colDef.checkboxSelection)}inferNodeSelections(e,t,s,i){const{gos:o,selectionCtx:n}=this,r=e.isSelected(),a=we(o),l=function(e){const t=he(e);return!0===t||"enableSelection"===t}(o),c=function(e){const t=he(e);return!0===t||"enableDeselection"===t}(o),d=this.isMultiSelect(),u="rowClicked"===i;if(u&&!l&&!c)return null;if(t&&s&&d){const t=n.getRoot();if(t){if(t.isSelected()){const t=n.isInRange(e)?n.truncate(e):n.extend(e,a);return{deselect:t.discard,select:t.keep,reset:!1}}return{select:[],deselect:n.extend(e,a).keep,reset:!1}}return null}if(t&&d){const t=n.selectAll?this.beans.rowModel.getRow(0):void 0,s=n.getRoot(t),i=n.isInRange(e)?n.truncate(e):n.extend(e,a);return{select:i.keep,deselect:i.discard,reset:n.selectAll||!(!s||s.isSelected())}}if(s){if(u){const t=!r;return t&&!l||!t&&!c?null:(n.setRoot(e),{node:e,newValue:t,clearSelection:!1})}return n.setRoot(e),{node:e,newValue:!r,clearSelection:!d}}{n.setRoot(e);const t=function(e){const t=e.get("rowSelection");return"string"==typeof t?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}(o),s=u&&(!t||!l);if("filteredDescendants"===me(o)&&void 0===r&&B(o))return{node:e,newValue:!1,checkFilteredNodes:!0,clearSelection:!d||s};if(u){const i=r?!t:l;return i===r&&!s||i&&!l||!i&&!c?null:{node:e,newValue:i,clearSelection:!d||s,keepDescendants:e.group&&a}}return{node:e,newValue:!r,clearSelection:!d||s}}}};function im(e,t){return(0!==e||0!==t)&&(e>0&&t>0?void 0:e>0)}function om(e,t){let s=t.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}function nm(e){if(!1===e.isSelected())return!0;const t=e.childrenAfterFilter;if(t)for(let e=0,s=t.length;e<s;++e)if(nm(t[e]))return!0;return!1}var rm={moduleName:"SharedRowSelection",version:cn,beans:[class extends Yf{constructor(){super(...arguments),this.beanName="selectionColSvc",this.colKind="selection"}postConstruct(){this.addManagedPropertyListener("rowSelection",(e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Pt(e.source))})),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}updateColumns(e){this.refreshColDef(Pt(e.source))}isEnabled(){const{gos:e,beans:t}=this,s=e.get("rowSelection");if("object"!=typeof s||!U(e))return!1;if("autoGroupColumn"===s.checkboxLocation&&t.autoColSvc?.columns.length)return!1;const i=!!re(s),o=ae(s);return i||o}createColDef(){const{gos:e}=this,t=e.get("selectionColumnDef"),s=e.get("enableRtl"),{rowSpan:i,spanRows:o,...n}=t??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator:Kf,editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...n,colId:wt,chartDataType:"excluded"}}onSelectionOptionsChanged(e,t,s){const i=(t&&"string"!=typeof t?re(t):void 0)!==(e&&"string"!=typeof e?re(e):void 0),o=(t&&"string"!=typeof t?ae(t):void 0)!==(e&&"string"!=typeof e?ae(e):void 0),n=le(e),r=le(t);(i||o||n!==r)&&this.beans.colModel.refreshAll(s)}}],css:[':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:where(:not(.ag-disabled)){cursor:pointer}:where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";inset:-8px;position:absolute}'],apiFunctions:{setNodesSelected:function(e,t){const s=t.nodes.filter((e=>!!e));if(!s.length)return;if(!s.every((t=>t.rowPinned&&!Gl(t)?(e.log.warn(59),!1):void 0!==t.id||(e.log.warn(60),!1))))return;const{source:i,newValue:o}=t;e.selectionSvc?.setNodesSelected({nodes:s,source:i??"api",newValue:o})},selectAll:function(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})},deselectAll:function(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})},getSelectedNodes:function(e){return e.selectionSvc?.getSelectedNodes()??[]},getSelectedRows:function(e){return e.selectionSvc?.getSelectedRows()??[]}}};function am(e,t){const{column:s,comp:i}=t,o=s.colDef,n=o.cellClassRules,r=dm(e,t,o);Xl(e.expressionSvc,n===t.customStyleClassRules?void 0:t.customStyleClassRules,n,r,(e=>i.toggleCss(e,!0)),(e=>i.toggleCss(e,!1))),t.customStyleClassRules=n}function lm(e,t){const s=t.column.colDef,i=s.cellStyle;if(!i)return;let o;o="function"==typeof i?i(dm(e,t,s)):i,o&&t.comp.setUserStyles(o)}function cm(e,t){const{column:s,comp:i}=t,o=s.colDef,n=dm(e,t,o),r=t.customStyleStaticClasses;if(r)for(const e of r)i.toggleCss(e,!1);const a=e.cellStyles.getStaticCellClasses(o,n);t.customStyleStaticClasses=a;for(const e of a)i.toggleCss(e,!0)}function dm(e,t,s){const{value:i,rowNode:o,column:n}=t;return xe(e.gos,{value:i,data:o.data,node:o,colDef:s,column:n,rowIndex:o.rowIndex})}var um={moduleName:"AllCommunity",version:cn,dependsOn:[br,Td,vf,Yh,Kh,qh,Zh,Qh,Jh,Xh,$h,cf,df,uf,hf,lf,pf,gf,xf,Xc,Af,Lf,Ha,sd,id,Hf,yd,Or,Vf,{moduleName:"RowSelection",version:cn,rowModels:["clientSide","infinite","viewport"],beans:[class extends sm{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1,this.selectionBatchDepth=0,this.pendingSelectionChanged=!1,this.pendingSelectionSource=null}postConstruct(){super.postConstruct();const{gos:e}=this;this.csrm=Rs(this.beans),this.mode=ge(e),this.groupSelectsDescendants=we(e),this.groupSelectsFiltered="filteredDescendants"===me(e),this.masterSelectsDetail="detail"===Ce(e),this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],(()=>{const t=we(e),s=ge(e),i="filteredDescendants"===me(e);this.masterSelectsDetail="detail"===Ce(e),t===this.groupSelectsDescendants&&i===this.groupSelectsFiltered&&s===this.mode||(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=i,this.mode=s)}))}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;const i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(null==i)return 0;if(this.selectionCtx.selectAll=!1,"select"in i)return i.reset?this.resetNodes():this.selectRange(i.deselect,!1,s),this.selectRange(i.select,!0,s);{const t=i.checkFilteredNodes?nm(i.node):i.newValue;return this.setNodesSelected({nodes:[i.node],newValue:t,clearSelection:i.clearSelection,keepDescendants:i.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:i,event:o,source:n,keepDescendants:r=!1}){const a=i.length;if(0===a)return 0;const{gos:l}=this;if(!U(l)&&e)return this.warn(132),0;const c=this.isMultiSelect();if(a>1&&!c)return this.warn(130),0;let d=0;for(let t=0;t<a;t++){const s=i[t].primaryRow;!s.rowPinned||Gl(s)?void 0!==s.id?e&&s.destroyed||(this.groupSelectsFiltered&&s.group&&!l.get("treeData")||this.selectRowNode(s,e,o,n)&&(this.detailSelection.delete(s.id),d++),this.groupSelectsDescendants&&s.childrenAfterGroup?.length&&(d+=this.selectChildren(s,e,n,o))):this.warn(60):this.warn(59)}return s||(1===a&&"api"===n&&this.selectionCtx.setRoot(i[0].primaryRow),e&&(t||!c)&&(d+=this.clearOtherNodes(i[0].primaryRow,r,n)),d>0&&(this.updateGroupsFromChildrenSelections(n,void 0,o),this.dispatchSelectionChanged(n))),d}selectRange(e,t,s){let i=0;for(let o=0,n=e.length;o<n;++o){const n=e[o].primaryRow;n.group&&this.groupSelectsDescendants||this.selectRowNode(n,t,void 0,s)&&i++}return i>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)),i}selectChildren(e,t,s,i){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,event:i,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];for(const t of this.selectedNodes.values()){const s=t.data;null!=s&&e.push(s)}return e}getSelectionCount(){return this.selectedNodes.size}removeFromSelection(e,t){const s=e.id,i=this.selectedNodes;e.__selected&&i.get(s)===e&&(i.delete(s),this.detailSelection.delete(s),e.__selected=!1,this.pendingSelectionChanged=!0,this.pendingSelectionSource??(this.pendingSelectionSource=t))}updateGroupsFromChildrenSelections(e,t,s){if(!this.groupSelectsDescendants)return!1;const i=this.csrm;if(!i)return!1;const o=i.rootNode;if(!o)return!1;let n=!1;return Zf(o,i.hierarchical,t,(t=>{if(t!==o){const i=this.calculateSelectedFromChildren(t);n=this.selectRowNode(t,null!==i&&i,s,e)||n}})),n}clearOtherNodes(e,t,s){const i=new Map;let o=0;for(const n of this.selectedNodes.values()){const r=n.id==e.id;(!t||!om(e,n))&&!r&&(o+=this.setNodesSelected({nodes:[n],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&n.parent&&i.set(n.parent.id,n.parent))}for(const e of i.values()){const t=this.calculateSelectedFromChildren(e);this.selectRowNode(e,null!==t&&t,void 0,s)}return o}selectRowNode(e,t,s,i="api"){const o=super.selectRowNode(e,t,s,i);if(o&&(!this.groupSelectsDescendants||!e.group)){const t=this.selectedNodes;e.isSelected()?t.set(e.id,e):t.delete(e.id)}return o}syncInRowNode(e,t){const s=this.selectedNodes,i=t?.id;null!=i&&i!==e.id&&s.get(i)===e&&s.set(i,t);const o=e.id,n=s.has(o);e.__selected=n,n&&s.set(o,e)}createDaemonNode(e){if(!e.id)return;const t=new Ds(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}reset(e){this.selectedNodes.size&&(this.resetNodes(),this.dispatchSelectionChanged(e))}resetNodes(){const e=this.selectedNodes;for(const t of e.values())this.selectRowNode(t,!1);e.clear()}getBestCostNodeSelection(){const e=this.csrm;if(!e)return;const t=e.getTopLevelNodes();if(null===t)return;const s=[];return function e(t){for(let i=0,o=t.length;i<o;i++){const o=t[i];o.isSelected()?s.push(o):o.group&&o.childrenAfterGroup&&e(o.childrenAfterGroup)}}(t),s}isEmpty(){return 0===this.selectedNodes.size}deselectAllRowNodes({source:e,selectAll:t}){const s=this.csrm;let i=!1;const o=t=>{this.selectRowNode(t.primaryRow,!1,void 0,e)&&(i=!0)};if("currentPage"===t||"filtered"===t){if(!s)return void this.error(102);const e=this.getNodesToSelect(t);for(let t=0,s=e.length;t<s;++t)o(e[t])}else this.selectedNodes.forEach(o),this.selectedNodes.clear();if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){const t=this.updateGroupsFromChildrenSelections(e);i||(i=t)}i&&this.dispatchSelectionChanged(e)}getSelectAllState(e){let t=0,s=0;const i=this.getNodesToSelect(e);for(let e=0,o=i.length;e<o;++e){const o=i[e];this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&s++)}return im(t,s)??null}hasNodesToSelect(e){const t=this.getNodesToSelect(e);for(let e=0,s=t.length;e<s;++e)if(t[e].selectable)return!0;return!1}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],s=e=>t.push(e);if("currentPage"===e)return this.forEachNodeOnPage((e=>{if(e.group)if(e.footer||e.expanded)this.groupSelectsDescendants||s(e);else{const t=e=>{s(e);const i=e.childrenAfterFilter;if(i)for(let e=0,s=i.length;e<s;++e)t(i[e])};t(e)}else s(e)})),t;const i=this.beans.rowModel;return"filtered"===e?(i.forEachNodeAfterFilter(s),t):(i.forEachNode(s),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:s}=this.beans,i=t.getFirstRow(),o=t.getLastRow();for(let t=i;t<=o;t++){const i=s.getRow(t);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:s}=this;if(!U(t))return void this.warn(132);if(function(e){return"string"!=typeof e.get("rowSelection")}(t)&&!fe(t))return void this.warn(130);if(!this.canSelectAll())return;const{source:i,selectAll:o}=e;let n=!1;const r=this.getNodesToSelect(o);for(let e=0,t=r.length;e<t;++e)n=this.selectRowNode(r[e].primaryRow,!0,void 0,i)||n;if(s.selectAll=!0,this.csrm&&this.groupSelectsDescendants){const e=this.updateGroupsFromChildrenSelections(i);n||(n=e)}n&&this.dispatchSelectionChanged(i)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(e||(e=[]),!Array.isArray(e))return void this.error(103);const i=[],o=this.csrm,n=new Set(e);if(o)for(const e of n){const t=o.getRowNode(e);t&&i.push(t)}else this.beans.rowModel.forEachNode((e=>{n.has(e.id)&&i.push(e)}));s&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:i,source:t})}canSelectAll(){return!!this.csrm}recomputeSelectable(e){const t=this.updateRowSelectable(e,!0);return!t&&e.isSelected()&&this.selectRowNode(e,!1,void 0,"selectableChanged")&&(this.detailSelection.delete(e.id),this.dispatchSelectionChanged("selectableChanged")),t}updateSelectable(e,t){const{gos:s,rowModel:i}=this.beans;if(!U(s))return;const o=this.csrm,n=!!o&&this.groupSelectsDescendants,r=o?o.rootNode:null,a=t?.adds,l=t?.updates;++this.selectionBatchDepth;try{if(o)if(n)Zf(r,i.hierarchical,e,(e=>{let t=!1;const s=e.childrenAfterGroup;for(let e=0,i=s.length;e<i;++e){const i=s[e],o=i.group||a&&!a.has(i)&&!l.has(i)?i.selectable:this.recomputeSelectable(i);t||(t=o)}this.setRowSelectable(e,t,!0)}));else if(e||!a)Zf(r,i.hierarchical,e,(e=>{e!==r&&this.recomputeSelectable(e);const t=e.childrenAfterGroup;for(let e=0,s=t.length;e<s;++e){const s=t[e];s.group||a&&!a.has(s)&&!l.has(s)||this.recomputeSelectable(s)}}));else{for(const e of a)this.recomputeSelectable(e);for(const e of l)this.recomputeSelectable(e)}else i.forEachNode((e=>this.recomputeSelectable(e)));!e&&n&&this.updateGroupsFromChildrenSelections?.("selectableChanged")}finally{this.endSelectionBatch()}}updateSelectableAfterGrouping(e,t){++this.selectionBatchDepth;try{this.isRowSelectable&&this.updateSelectable(e,t),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}finally{this.endSelectionBatch()}}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail||!e.expanded)return;const s=e.detailNode?.detailGridInfo?.api;if(!s)return;const i=s.getDisplayedRowCount();if(0===i&&void 0===e.isSelected())return;const o=function(e){let t=0,s=0;return e.forEachNode((e=>{e.isSelected()?++t:e.selectable&&++s})),im(t,s)}(s);e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o&&i>0&&this.detailSelection.set(e.id,new Set(s.getSelectedNodes().map((e=>e.id))))}setDetailSelectionState(e,t,s){if(!this.masterSelectsDetail)return;if(!fe(t))return void this.warn(269);const i=this.detailSelection.get(e.id);switch(e.isSelected()){case!0:s.selectAll();break;case!1:s.deselectAll();break;case void 0:(()=>{if(!i?.size)return!1;const e=[];for(const t of i){const i=s.getRowNode(t);i&&e.push(i)}e.length&&s.setNodesSelected({nodes:e,newValue:!0,source:"masterDetail"})})()}}dispatchSelectionChanged(e){if(this.selectionBatchDepth>0)return this.pendingSelectionChanged=!0,void(this.pendingSelectionSource??(this.pendingSelectionSource=e));this.pendingSelectionChanged=!1,this.pendingSelectionSource=null,this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}flushPendingSelectionChanged(){0===this.selectionBatchDepth&&this.pendingSelectionChanged&&this.dispatchSelectionChanged(this.pendingSelectionSource)}endSelectionBatch(){0==--this.selectionBatchDepth&&this.flushPendingSelectionChanged()}}],dependsOn:[rm]},Oc,{moduleName:"CellStyle",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,i){Xl(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,i),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let i;return i="function"==typeof s?s(t):s,"string"==typeof i&&(i=[i]),i||[]}setupCellCustomStyle(e){!function(e,t){lm(e,t),am(e,t),cm(e,t)}(this.beans,e)}applyCellUserStyles(e){lm(this.beans,e)}applyCellClassesFromColDef(e){cm(this.beans,e)}applyCellClassRules(e){am(this.beans,e)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach((e=>{s(e)}))}}]},Sd,{moduleName:"RowStyle",version:cn,beans:[class extends ke{constructor(){super(...arguments),this.beanName="rowStyleSvc"}processClassesFromGridOptions(e,t){const s=this.gos,i=t=>{if("string"==typeof t)e.push(t);else if(Array.isArray(t))for(const s of t)e.push(s)},o=s.get("rowClass");o&&i(o);const n=s.getCallback("getRowClass");n&&i(n({data:t.data,node:t,rowIndex:t.rowIndex}))}preProcessRowClassRules(e,t){this.processRowClassRules(t,(t=>{e.push(t)}),(()=>{}))}processRowClassRules(e,t,s){const{gos:i,expressionSvc:o}=this.beans,n=xe(i,{data:e.data,node:e,rowIndex:e.rowIndex});Xl(o,void 0,i.get("rowClassRules"),n,t,s)}processStylesFromGridOptions(e){const t=this.gos,s=t.get("rowStyle"),i=t.getCallback("getRowStyle");let o;if(i&&(o=i({data:e.data,node:e,rowIndex:e.rowIndex})),o||s)return Object.assign({},s,o)}}]},wf,Gc,Bf,Yd,Cf,Gf,Vr,Sr,$f,cd]};["box-sizing: border-box","display: flex","flex-direction: column","width: 100%","height: 100%","min-height: 120px","overflow: auto","background: #fff","color: #181d1f","border: 2px solid color-mix(in srgb, #cc222f 60%, #babfc7)","font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif","font-size: 13px","line-height: 1.5"].join(";"),["display: flex","align-items: center","justify-content: space-between","gap: 12px","padding: 12px 16px","border-bottom: 1px solid #babfc7"].join(";"),["display: flex","flex-direction: column","gap: 16px","padding: 12px 16px"].join(";"),["font-weight: 600","font-size: 14px","color: #cc222f"].join(";"),["flex: none","cursor: pointer","padding: 2px 10px","border: 1px solid #babfc7","border-radius: 4px","background: #f8f8f8","color: inherit","font: inherit","font-size: 12px"].join(";");var hm=class{setGridId(e){this.gridId=e}wrap(e,t,s,i){const o=this.createWrapper(e,i);for(const e of t??[])this.createMethod(o,e,!0);for(const e of s??[])this.createMethod(o,e,!1);return o}createMethod(e,t,s){e.addMethod(t,this.createMethodProxy(e,t,s))}createMethodProxy(e,t,s){const i=this.gridId;return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(s&&_n(i,49,{methodName:t}),null)}}},pm=class extends x{constructor(e){super(e,hs)}}},79193:(e,t,s)=>{s.d(t,{Ay:()=>o});var i=s(7386);const o=i.default;i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString},80286:e=>{const{AbortController:t,AbortSignal:s}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=s,e.exports.default=t},85859:(e,t,s)=>{var i,o=s(13390),n=s(78773);function r(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),-1===e.indexOf("-")&&-1===e.indexOf("_"))return e;{let t="",s=!1;const i=e.match(/^-+/);for(let o=i?i[0].length:0;o<e.length;o++){let i=e.charAt(o);s&&(s=!1,i=i.toUpperCase()),0===o||"-"!==i&&"_"!==i?"-"!==i&&"_"!==i&&(t+=i):s=!0}return t}}function a(e,t){const s=e.toLowerCase();t=t||"-";let i="";for(let o=0;o<e.length;o++){const n=s.charAt(o),r=e.charAt(o);i+=n!==r&&o>0?`${t}${s.charAt(o)}`:r}return i}function l(e){return null!=e&&("number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||!/^0[^.]/.test(e)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e))}let c;function d(e){return void 0!==e?e+1:1}function u(e){return"__proto__"===e?"___proto___":e}!function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"}(i||(i={}));var h,p,g,f=s(4308),m=s(15088).process;const v=m&&m.env&&m.env.YARGS_MIN_NODE_VERSION?Number(m.env.YARGS_MIN_NODE_VERSION):12,w=null!==(p=null===(h=null==m?void 0:m.versions)||void 0===h?void 0:h.node)&&void 0!==p?p:null===(g=null==m?void 0:m.version)||void 0===g?void 0:g.slice(1);if(w&&Number(w.match(/^([^.]+)/)[1])<v)throw Error(`yargs parser supports a minimum Node.js version of ${v}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const C=m?m.env:{},y=new class{constructor(e){c=e}parse(e,t){const s=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),o=function(e){if(Array.isArray(e))return e.map((e=>"string"!=typeof e?e+"":e));e=e.trim();let t=0,s=null,i=null,o=null;const n=[];for(let r=0;r<e.length;r++)s=i,i=e.charAt(r)," "!==i||o?(i===o?o=null:"'"!==i&&'"'!==i||o||(o=i),n[t]||(n[t]=""),n[t]+=i):" "!==s&&t++;return n}(e),n="string"==typeof e,h=function(e){const t=[],s=Object.create(null);let i=!0;for(Object.keys(e).forEach((function(s){t.push([].concat(e[s],s))}));i;){i=!1;for(let e=0;e<t.length;e++)for(let s=e+1;s<t.length;s++)if(t[e].filter((function(e){return-1!==t[s].indexOf(e)})).length){t[e]=t[e].concat(t[s]),t.splice(s,1),i=!0;break}}return t.forEach((function(e){const t=(e=e.filter((function(e,t,s){return s.indexOf(e)===t}))).pop();void 0!==t&&"string"==typeof t&&(s[t]=e)})),s}(Object.assign(Object.create(null),s.alias)),p=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},s.configuration),g=Object.assign(Object.create(null),s.default),f=s.configObjects||[],m=s.envPrefix,v=p["populate--"],w=v?"--":"_",C=Object.create(null),y=Object.create(null),b=s.__||c.format,S={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},x=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,R=new RegExp("^--"+p["negation-prefix"]+"(.+)");[].concat(s.array||[]).filter(Boolean).forEach((function(e){const t="object"==typeof e?e.key:e,s=Object.keys(e).map((function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]})).filter(Boolean).pop();s&&(S[s][t]=!0),S.arrays[t]=!0,S.keys.push(t)})),[].concat(s.boolean||[]).filter(Boolean).forEach((function(e){S.bools[e]=!0,S.keys.push(e)})),[].concat(s.string||[]).filter(Boolean).forEach((function(e){S.strings[e]=!0,S.keys.push(e)})),[].concat(s.number||[]).filter(Boolean).forEach((function(e){S.numbers[e]=!0,S.keys.push(e)})),[].concat(s.count||[]).filter(Boolean).forEach((function(e){S.counts[e]=!0,S.keys.push(e)})),[].concat(s.normalize||[]).filter(Boolean).forEach((function(e){S.normalize[e]=!0,S.keys.push(e)})),"object"==typeof s.narg&&Object.entries(s.narg).forEach((([e,t])=>{"number"==typeof t&&(S.nargs[e]=t,S.keys.push(e))})),"object"==typeof s.coerce&&Object.entries(s.coerce).forEach((([e,t])=>{"function"==typeof t&&(S.coercions[e]=t,S.keys.push(e))})),void 0!==s.config&&(Array.isArray(s.config)||"string"==typeof s.config?[].concat(s.config).filter(Boolean).forEach((function(e){S.configs[e]=!0})):"object"==typeof s.config&&Object.entries(s.config).forEach((([e,t])=>{"boolean"!=typeof t&&"function"!=typeof t||(S.configs[e]=t)}))),function(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){S.aliases[e]||(S.aliases[e]=[].concat(h[e]||[]),S.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&p["camel-case-expansion"]){const s=r(t);s!==e&&-1===S.aliases[e].indexOf(s)&&(S.aliases[e].push(s),C[s]=!0)}})),S.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&p["camel-case-expansion"]){const s=a(t,"-");s!==e&&-1===S.aliases[e].indexOf(s)&&(S.aliases[e].push(s),C[s]=!0)}})),S.aliases[e].forEach((function(t){S.aliases[t]=[e].concat(S.aliases[e].filter((function(e){return t!==e})))})))}))}))}(s.key,h,s.default,S.arrays),Object.keys(g).forEach((function(e){(S.aliases[e]||[]).forEach((function(t){g[t]=g[e]}))}));let P=null;Object.keys(S.counts).find((e=>G(e,S.arrays)?(P=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",e)),!0):!!G(e,S.nargs)&&(P=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",e)),!0)));let E=[];const I=Object.assign(Object.create(null),{_:[]}),k={};for(let e=0;e<o.length;e++){const t=o[e],s=t.replace(/^-{3,}/,"---");let i,n,r,a,l,c;if("--"!==t&&/^-/.test(t)&&W(t))F(t);else{if(s.match(/^---+(=|$)/)){F(t);continue}if(t.match(/^--.+=/)||!p["short-option-groups"]&&t.match(/^-.+=/))a=t.match(/^--?([^=]+)=([\s\S]*)$/),null!==a&&Array.isArray(a)&&a.length>=3&&(G(a[1],S.arrays)?e=T(e,a[1],o,a[2]):!1!==G(a[1],S.nargs)?e=D(e,a[1],o,a[2]):A(a[1],a[2],!0));else if(t.match(R)&&p["boolean-negation"])a=t.match(R),null!==a&&Array.isArray(a)&&a.length>=2&&(n=a[1],A(n,!!G(n,S.arrays)&&[!1]));else if(t.match(/^--.+/)||!p["short-option-groups"]&&t.match(/^-[^-]+/))a=t.match(/^--?(.+)/),null!==a&&Array.isArray(a)&&a.length>=2&&(n=a[1],G(n,S.arrays)?e=T(e,n,o):!1!==G(n,S.nargs)?e=D(e,n,o):(l=o[e+1],void 0===l||l.match(/^-/)&&!l.match(x)||G(n,S.bools)||G(n,S.counts)?/^(true|false)$/.test(l)?(A(n,l),e++):A(n,j(n)):(A(n,l),e++)));else if(t.match(/^-.\..+=/))a=t.match(/^-([^=]+)=([\s\S]*)$/),null!==a&&Array.isArray(a)&&a.length>=3&&A(a[1],a[2]);else if(t.match(/^-.\..+/)&&!t.match(x))l=o[e+1],a=t.match(/^-(.\..+)/),null!==a&&Array.isArray(a)&&a.length>=2&&(n=a[1],void 0===l||l.match(/^-/)||G(n,S.bools)||G(n,S.counts)?A(n,j(n)):(A(n,l),e++));else if(t.match(/^-[^-]+/)&&!t.match(x)){r=t.slice(1,-1).split(""),i=!1;for(let s=0;s<r.length;s++){if(l=t.slice(s+2),r[s+1]&&"="===r[s+1]){c=t.slice(s+3),n=r[s],G(n,S.arrays)?e=T(e,n,o,c):!1!==G(n,S.nargs)?e=D(e,n,o,c):A(n,c),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(r[s])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===G(l,S.bools)){A(r[s],l),i=!0;break}if(r[s+1]&&r[s+1].match(/\W/)){A(r[s],l),i=!0;break}A(r[s],j(r[s]))}else A(r[s],l)}n=t.slice(-1)[0],i||"-"===n||(G(n,S.arrays)?e=T(e,n,o):!1!==G(n,S.nargs)?e=D(e,n,o):(l=o[e+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(x)||G(n,S.bools)||G(n,S.counts)?/^(true|false)$/.test(l)?(A(n,l),e++):A(n,j(n)):(A(n,l),e++)))}else if(t.match(/^-[0-9]$/)&&t.match(x)&&G(t.slice(1),S.bools))n=t.slice(1),A(n,j(n));else{if("--"===t){E=o.slice(e+1);break}if(p["halt-at-non-option"]){E=o.slice(e);break}F(t)}}}function F(e){const t=L("_",e);"string"!=typeof t&&"number"!=typeof t||I._.push(t)}function D(e,t,s,i){let o,n=G(t,S.nargs);if(n="number"!=typeof n||isNaN(n)?1:n,0===n)return U(i)||(P=Error(b("Argument unexpected for: %s",t))),A(t,j(t)),e;let r=U(i)?0:1;if(p["nargs-eats-options"])s.length-(e+1)+r<n&&(P=Error(b("Not enough arguments following: %s",t))),r=n;else{for(o=e+1;o<s.length&&(!s[o].match(/^-[^0-9]/)||s[o].match(x)||W(s[o]));o++)r++;r<n&&(P=Error(b("Not enough arguments following: %s",t)))}let a=Math.min(r,n);for(!U(i)&&a>0&&(A(t,i),a--),o=e+1;o<a+e+1;o++)A(t,s[o]);return e+a}function T(e,t,s,i){let o=[],r=i||s[e+1];const a=G(t,S.nargs);if(G(t,S.bools)&&!/^(true|false)$/.test(r))o.push(!0);else if(U(r)||U(i)&&/^-/.test(r)&&!x.test(r)&&!W(r)){if(void 0!==g[t]){const e=g[t];o=Array.isArray(e)?e:[e]}}else{U(i)||o.push(N(t,i,!0));for(let i=e+1;i<s.length&&!(!p["greedy-arrays"]&&o.length>0||a&&"number"==typeof a&&o.length>=a)&&(r=s[i],!/^-/.test(r)||x.test(r)||W(r));i++)e=i,o.push(N(t,r,n))}return"number"==typeof a&&(a&&o.length<a||isNaN(a)&&0===o.length)&&(P=Error(b("Not enough arguments following: %s",t))),A(t,o),e}function A(e,t,s=n){if(/-/.test(e)&&p["camel-case-expansion"]){const t=e.split(".").map((function(e){return r(e)})).join(".");M(e,t)}const i=N(e,t,s),o=e.split(".");H(I,o,i),S.aliases[e]&&S.aliases[e].forEach((function(e){const t=e.split(".");H(I,t,i)})),o.length>1&&p["dot-notation"]&&(S.aliases[o[0]]||[]).forEach((function(t){let s=t.split(".");const n=[].concat(o);n.shift(),s=s.concat(n),(S.aliases[e]||[]).includes(s.join("."))||H(I,s,i)})),G(e,S.normalize)&&!G(e,S.arrays)&&[e].concat(S.aliases[e]||[]).forEach((function(e){Object.defineProperty(k,e,{enumerable:!0,get:()=>t,set(e){t="string"==typeof e?c.normalize(e):e}})}))}function M(e,t){S.aliases[e]&&S.aliases[e].length||(S.aliases[e]=[t],C[t]=!0),S.aliases[t]&&S.aliases[t].length||M(t,e)}function N(e,t,s){s&&(t=function(e){return"string"!=typeof e||"'"!==e[0]&&'"'!==e[0]||e[e.length-1]!==e[0]?e:e.substring(1,e.length-1)}(t)),(G(e,S.bools)||G(e,S.counts))&&"string"==typeof t&&(t="true"===t);let i=Array.isArray(t)?t.map((function(t){return L(e,t)})):L(e,t);return G(e,S.counts)&&(U(i)||"boolean"==typeof i)&&(i=d()),G(e,S.normalize)&&G(e,S.arrays)&&(i=Array.isArray(t)?t.map((e=>c.normalize(e))):c.normalize(t)),i}function L(e,t){return p["parse-positional-numbers"]||"_"!==e?(G(e,S.strings)||G(e,S.bools)||Array.isArray(t)||(l(t)&&p["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!U(t)&&G(e,S.numbers))&&(t=Number(t)),t):t}function V(e,t){Object.keys(e).forEach((function(s){const i=e[s],o=t?t+"."+s:s;"object"==typeof i&&null!==i&&!Array.isArray(i)&&p["dot-notation"]?V(i,o):(!B(I,o.split("."))||G(o,S.arrays)&&p["combine-arrays"])&&A(o,i)}))}function _(e,t){if(void 0===m)return;const s="string"==typeof m?m:"",i=c.env();Object.keys(i).forEach((function(o){if(""===s||0===o.lastIndexOf(s,0)){const n=o.split("__").map((function(e,t){return 0===t&&(e=e.substring(s.length)),r(e)}));(t&&S.configs[n.join(".")]||!t)&&!B(e,n)&&A(n.join("."),i[o])}}))}function O(e,t,s,i=!1){Object.keys(s).forEach((function(o){B(e,o.split("."))||(H(e,o.split("."),s[o]),i&&(y[o]=!0),(t[o]||[]).forEach((function(t){B(e,t.split("."))||H(e,t.split("."),s[o])})))}))}function B(e,t){let s=e;p["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){s=s[e]||{}}));const i=t[t.length-1];return"object"==typeof s&&i in s}function H(e,t,s){let i=e;p["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){e=u(e),"object"==typeof i&&void 0===i[e]&&(i[e]={}),"object"!=typeof i[e]||Array.isArray(i[e])?(Array.isArray(i[e])?i[e].push({}):i[e]=[i[e],{}],i=i[e][i[e].length-1]):i=i[e]}));const o=u(t[t.length-1]),n=G(t.join("."),S.arrays),r=Array.isArray(s);let a=p["duplicate-arguments-array"];!a&&G(o,S.nargs)&&(a=!0,(!U(i[o])&&1===S.nargs[o]||Array.isArray(i[o])&&i[o].length===S.nargs[o])&&(i[o]=void 0)),s===d()?i[o]=d(i[o]):Array.isArray(i[o])?a&&n&&r?i[o]=p["flatten-duplicate-arrays"]?i[o].concat(s):(Array.isArray(i[o][0])?i[o]:[i[o]]).concat([s]):a||Boolean(n)!==Boolean(r)?i[o]=i[o].concat([s]):i[o]=s:void 0===i[o]&&n?i[o]=r?s:[s]:!a||void 0===i[o]||G(o,S.counts)||G(o,S.bools)?i[o]=s:i[o]=[i[o],s]}function G(e,t){const s=[].concat(S.aliases[e]||[],e),i=Object.keys(t),o=s.find((e=>i.includes(e)));return!!o&&t[o]}function z(e){const t=Object.keys(S);return[].concat(t.map((e=>S[e]))).some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function W(e){return p["unknown-options-as-args"]&&function(e){return!(e=e.replace(/^-{3,}/,"--")).match(x)&&(!function(e){if(e.match(x)||!e.match(/^-[^-]+/))return!1;let t,s=!0;const i=e.slice(1).split("");for(let o=0;o<i.length;o++){if(t=e.slice(o+2),!z(i[o])){s=!1;break}if(i[o+1]&&"="===i[o+1]||"-"===t||/[A-Za-z]/.test(i[o])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||i[o+1]&&i[o+1].match(/\W/))break}return s}(e)&&!function(e,...t){return[].concat(...t).some((function(t){const s=e.match(t);return s&&z(s[1])}))}(e,/^-+([^=]+?)=[\s\S]*$/,R,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/))}(e)}function j(e){return G(e,S.bools)||G(e,S.counts)||!(`${e}`in g)?(t=function(e){let t=i.BOOLEAN;return G(e,S.strings)?t=i.STRING:G(e,S.numbers)?t=i.NUMBER:G(e,S.bools)?t=i.BOOLEAN:G(e,S.arrays)&&(t=i.ARRAY),t}(e),{[i.BOOLEAN]:!0,[i.STRING]:"",[i.NUMBER]:void 0,[i.ARRAY]:[]}[t]):g[e];var t}function U(e){return void 0===e}return _(I,!0),_(I,!1),function(e){const t=Object.create(null);O(t,S.aliases,g),Object.keys(S.configs).forEach((function(s){const i=e[s]||t[s];if(i)try{let e=null;const t=c.resolve(c.cwd(),i),o=S.configs[s];if("function"==typeof o){try{e=o(t)}catch(t){e=t}if(e instanceof Error)return void(P=e)}else e=c.require(t);V(e)}catch(t){"PermissionDenied"===t.name?P=t:e[s]&&(P=Error(b("Invalid JSON config file: %s",i)))}}))}(I),void 0!==f&&f.forEach((function(e){V(e)})),O(I,S.aliases,g,!0),function(e){let t;const s=new Set;Object.keys(e).forEach((function(i){if(!s.has(i)&&(t=G(i,S.coercions),"function"==typeof t))try{const o=L(i,t(e[i]));[].concat(S.aliases[i]||[],i).forEach((t=>{s.add(t),e[t]=o}))}catch(e){P=e}}))}(I),p["set-placeholder-key"]&&function(e){S.keys.forEach((t=>{~t.indexOf(".")||void 0===e[t]&&(e[t]=void 0)}))}(I),Object.keys(S.counts).forEach((function(e){B(I,e.split("."))||A(e,0)})),v&&E.length&&(I[w]=[]),E.forEach((function(e){I[w].push(e)})),p["camel-case-expansion"]&&p["strip-dashed"]&&Object.keys(I).filter((e=>"--"!==e&&e.includes("-"))).forEach((e=>{delete I[e]})),p["strip-aliased"]&&[].concat(...Object.keys(h).map((e=>h[e]))).forEach((e=>{p["camel-case-expansion"]&&e.includes("-")&&delete I[e.split(".").map((e=>r(e))).join(".")],delete I[e]})),{aliases:Object.assign({},S.aliases),argv:Object.assign(k,I),configuration:p,defaulted:Object.assign({},y),error:P,newAliases:Object.assign({},C)}}}({cwd:m.cwd,env:()=>C,format:o.format,normalize:n.normalize,resolve:n.resolve,require:e=>{if("undefined"!=typeof require)return require(e);if(e.match(/\.json$/))return JSON.parse((0,f.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),b=function(e,t){return y.parse(e.slice(),t).argv};b.detailed=function(e,t){return y.parse(e.slice(),t)},b.camelCase=r,b.decamelize=a,b.looksLikeNumber=l},86637:(e,t,s)=>{s.d(t,{Di:()=>V,M3:()=>H,Tt:()=>C,b8:()=>ce,bD:()=>u,eM:()=>ee,hL:()=>f,iM:()=>ne,u1:()=>y,u6:()=>U});var i,o,n,r,a,l,c="vercel.ai.error",d=Symbol.for(c),u=class e extends(o=Error,i=d,o){constructor({name:e,message:t,cause:s}){super(t),this[i]=!0,this.name=e,this.cause=s}static isInstance(t){return e.hasMarker(t,c)}static hasMarker(e,t){const s=Symbol.for(t);return null!=e&&"object"==typeof e&&s in e&&"boolean"==typeof e[s]&&!0===e[s]}},h="AI_APICallError",p=`vercel.ai.error.${h}`,g=Symbol.for(p),f=class extends(r=u,n=g,r){constructor({message:e,url:t,requestBodyValues:s,statusCode:i,responseHeaders:o,responseBody:r,cause:a,isRetryable:l=null!=i&&(408===i||409===i||429===i||i>=500),data:c}){super({name:h,message:e,cause:a}),this[n]=!0,this.url=t,this.requestBodyValues=s,this.statusCode=i,this.responseHeaders=o,this.responseBody=r,this.isRetryable=l,this.data=c}static isInstance(e){return u.hasMarker(e,p)}},m="AI_EmptyResponseBodyError",v=`vercel.ai.error.${m}`,w=Symbol.for(v),C=class extends(l=u,a=w,l){constructor({message:e="Empty response body"}={}){super({name:m,message:e}),this[a]=!0}static isInstance(e){return u.hasMarker(e,v)}};function y(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var b,S,x,R,P,E,I,k,F,D,T,A,M="AI_InvalidArgumentError",N=`vercel.ai.error.${M}`,L=Symbol.for(N),V=class extends(S=u,b=L,S){constructor({message:e,cause:t,argument:s}){super({name:M,message:e,cause:t}),this[b]=!0,this.argument=s}static isInstance(e){return u.hasMarker(e,N)}},_="AI_InvalidPromptError",O=`vercel.ai.error.${_}`,B=Symbol.for(O),H=class extends(R=u,x=B,R){constructor({prompt:e,message:t,cause:s}){super({name:_,message:`Invalid prompt: ${t}`,cause:s}),this[x]=!0,this.prompt=e}static isInstance(e){return u.hasMarker(e,O)}},G=Symbol.for("vercel.ai.error.AI_InvalidResponseDataError"),z="AI_JSONParseError",W=`vercel.ai.error.${z}`,j=Symbol.for(W),U=class extends(E=u,P=j,E){constructor({text:e,cause:t}){super({name:z,message:`JSON parsing failed: Text: ${e}.\nError message: ${y(t)}`,cause:t}),this[P]=!0,this.text=e}static isInstance(e){return u.hasMarker(e,W)}},$=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),Y=`vercel.ai.error.${"AI_LoadSettingError"}`,K=Symbol.for(Y),q=`vercel.ai.error.${"AI_NoContentGeneratedError"}`,Z=Symbol.for(q),Q="AI_NoSuchModelError",J=`vercel.ai.error.${Q}`,X=Symbol.for(J),ee=class extends(k=u,I=X,k){constructor({errorName:e=Q,modelId:t,modelType:s,message:i=`No such ${s}: ${t}`}){super({name:e,message:i}),this[I]=!0,this.modelId=t,this.modelType=s}static isInstance(e){return u.hasMarker(e,J)}},te=Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError"),se="AI_TypeValidationError",ie=`vercel.ai.error.${se}`,oe=Symbol.for(ie),ne=class e extends(D=u,F=oe,D){constructor({value:e,cause:t,context:s}){let i="Type validation failed";if((null==s?void 0:s.field)&&(i+=` for ${s.field}`),(null==s?void 0:s.entityName)||(null==s?void 0:s.entityId)){i+=" (";const e=[];s.entityName&&e.push(s.entityName),s.entityId&&e.push(`id: "${s.entityId}"`),i+=e.join(", "),i+=")"}super({name:se,message:`${i}: Value: ${JSON.stringify(e)}.\nError message: ${y(t)}`,cause:t}),this[F]=!0,this.value=e,this.context=s}static isInstance(e){return u.hasMarker(e,ie)}static wrap({value:t,cause:s,context:i}){var o,n,r;return e.isInstance(s)&&s.value===t&&(null==(o=s.context)?void 0:o.field)===(null==i?void 0:i.field)&&(null==(n=s.context)?void 0:n.entityName)===(null==i?void 0:i.entityName)&&(null==(r=s.context)?void 0:r.entityId)===(null==i?void 0:i.entityId)?s:new e({value:t,cause:s,context:i})}},re="AI_UnsupportedFunctionalityError",ae=`vercel.ai.error.${re}`,le=Symbol.for(ae),ce=class extends(A=u,T=le,A){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:re,message:t}),this[T]=!0,this.functionality=e}static isInstance(e){return u.hasMarker(e,ae)}}},86834:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(2511))},88245:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(99598))},91705:function(e,t,s){var i,o=this&&this.__createBinding||(Object.create?function(e,t,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(t,s);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,i,o)}:function(e,t,s,i){void 0===i&&(i=s),e[i]=t[s]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),r=0;r<s.length;r++)"default"!==s[r]&&o(t,e,s[r]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.redactValidConnectionString=function(e,t){const s=e.clone(),i=t?.replacementString??"_credentials_",o=t?.redactUsernames??!0;if((s.username||s.password)&&o?(s.username=i,s.password=""):s.password&&(s.password=i),s.searchParams.has("authMechanismProperties")){const e=new a.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",i),s.searchParams.set("authMechanismProperties",e.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",i),s.searchParams.has("proxyUsername")&&o&&s.searchParams.set("proxyUsername",i),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",i),s},t.redactConnectionString=function(e,t){const s=t?.replacementString??"<credentials>",i=t?.redactUsernames??!0;let o;try{o=new a.default(e)}catch{}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,s);const n=s,r=[e=>e.replace(i?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${n}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${n}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${n}`),e=>i?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${n}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${n}`)];for(const t of r)e=t(e);return e};const a=r(s(7386))},92926:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(s){!function(e,t,s){var i=s.css,o=s.media,n=s.sourceMap;o?e.setAttribute("media",o):e.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),t.styleTagTransform(i,e)}(t,e,s)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},93431:(e,t,s)=>{s.d(t,{Ay:()=>o,J0:()=>n});var i=s(68446);const o=i.default,n=(i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString)},93706:(e,t,s)=>{s.d(t,{A:()=>k});var i=s(1582);const o=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];var n=s(72741),r=s(11269),a=s(75272),l=s(23666),c=s(28615),d=s(59597),u=s(52211);const h=g(1),p=g(-1);function g(e){return function(t,s,i){const o=t?t.children:[];let n=(s||0)+e,r=o&&o[n];if(!i)for(;r&&(0,u.m)(r);)n+=e,r=o[n];return r}}const f={}.hasOwnProperty;function m(e){return function(t,s,i){return f.call(e,t.tagName)&&e[t.tagName](t,s,i)}}const v=m({html:function(e,t,s){const i=h(s,t);return!i||"comment"!==i.type},head:w,body:function(e,t,s){const i=h(s,t);return!i||"comment"!==i.type},p:function(e,t,s){const i=h(s,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!s||!("element"===s.type&&("a"===s.tagName||"audio"===s.tagName||"del"===s.tagName||"ins"===s.tagName||"map"===s.tagName||"noscript"===s.tagName||"video"===s.tagName))},li:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&"li"===i.tagName},dt:function(e,t,s){const i=h(s,t);return i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dd:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},rt:C,rp:C,optgroup:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},menuitem:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("menuitem"===i.tagName||"hr"===i.tagName||"menu"===i.tagName)},colgroup:w,caption:w,thead:function(e,t,s){const i=h(s,t);return i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},tbody:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},tfoot:function(e,t,s){return!h(s,t)},tr:function(e,t,s){const i=h(s,t);return!i||"element"===i.type&&"tr"===i.tagName},td:y,th:y});function w(e,t,s){const i=h(s,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&(0,u.m)(i.value.charAt(0)))}function C(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function y(e,t,s){const i=h(s,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}const b=m({html:function(e){const t=h(e,-1);return!t||"comment"!==t.type},head:function(e){const t=e.children,s=[];let i=-1;for(;++i<t.length;){const e=t[i];if("element"===e.type&&("title"===e.tagName||"base"===e.tagName)){if(s.includes(e.tagName))return!1;s.push(e.tagName)}}return t.length>0},body:function(e){const t=h(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&(0,u.m)(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,s){const i=p(s,t),o=h(e,-1,!0);return!(s&&i&&"element"===i.type&&"colgroup"===i.tagName&&v(i,s.children.indexOf(i),s))&&(o&&"element"===o.type&&"col"===o.tagName)},tbody:function(e,t,s){const i=p(s,t),o=h(e,-1);return(!s||!i||"element"!==i.type||"thead"!==i.tagName&&"tbody"!==i.tagName||!v(i,s.children.indexOf(i),s))&&(o&&"element"===o.type&&"tr"===o.tagName)}}),S={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function x(e,t,s){const i=(0,c.I)(e.schema,t),o=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,n=e.settings.allowDangerousCharacters?0:1;let u,h=e.quote;if(!i.overloadedBoolean||s!==i.attribute&&""!==s?(i.boolean||i.overloadedBoolean&&"string"!=typeof s)&&(s=Boolean(s)):s=!0,null==s||!1===s||"number"==typeof s&&Number.isNaN(s))return"";const p=(0,r.l)(i.attribute,Object.assign({},e.settings.characterReferences,{subset:S.name[o][n]}));return!0===s?p:(s=Array.isArray(s)?(i.commaSeparated?l.A:d.A)(s,{padLeft:!e.settings.tightCommaSeparatedLists}):String(s),e.settings.collapseEmptyAttributes&&!s?p:(e.settings.preferUnquoted&&(u=(0,r.l)(s,Object.assign({},e.settings.characterReferences,{subset:S.unquoted[o][n],attribute:!0}))),u!==s&&(e.settings.quoteSmart&&(0,a.D)(s,h)>(0,a.D)(s,e.alternative)&&(h=e.alternative),u=h+(0,r.l)(s,Object.assign({},e.settings.characterReferences,{subset:("'"===h?S.single:S.double)[o][n],attribute:!0}))+h),p+(u?"="+u:u)))}function R(e,t,s,i){return!s||"element"!==s.type||"script"!==s.tagName&&"style"!==s.tagName?(0,r.l)(e.value,Object.assign({},i.settings.characterReferences,{subset:["<","&"]})):e.value}const P=(0,n.A)("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,s,i){return i.settings.bogusComments?"<?"+(0,r.l)(e.value,Object.assign({},i.settings.characterReferences,{subset:[">"]}))+">":"\x3c!--"+e.value.replace(/^>|^->|<!--|-->|--!>|<!-$/g,(function(e){return(0,r.l)(e,Object.assign({},i.settings.characterReferences,{subset:["<",">"]}))}))+"--\x3e"},doctype:function(e,t,s,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,s,o){const n=o.schema,r="svg"!==n.space&&o.settings.omitOptionalTags;let a="svg"===n.space?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const l=[];let c;"html"===n.space&&"svg"===e.tagName&&(o.schema=i.JW);const d=function(e,t){const s=[];let i,o=-1;if(t)for(i in t)if(void 0!==t[i]&&null!==t[i]){const o=x(e,i,t[i]);o&&s.push(o)}for(;++o<s.length;){const t=e.settings.tightAttributes?s[o].charAt(s[o].length-1):null;o!==s.length-1&&'"'!==t&&"'"!==t&&(s[o]+=" ")}return s.join("")}(o,e.properties),u=o.all("html"===n.space&&"template"===e.tagName?e.content:e);return o.schema=n,u&&(a=!1),!d&&r&&b(e,t,s)||(l.push("<",e.tagName,d?" "+d:""),a&&("svg"===n.space||o.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!o.settings.tightSelfClosing||"/"===c||c&&'"'!==c&&"'"!==c)&&l.push(" "),l.push("/")),l.push(">")),l.push(u),a||r&&v(e,t,s)||l.push("</"+e.tagName+">"),l.join("")},raw:function(e,t,s,i){return i.settings.allowDangerousHtml?e.value:R(e,0,s,i)},root:function(e,t,s,i){return i.all(e)},text:R}});function E(e,t,s){return P(e,t,s,this)}function I(e){const t=[],s=e&&e.children||[];let i=-1;for(;++i<s.length;)t[i]=this.one(s[i],i,e);return t.join("")}function k(e){const t=this.data("settings"),s=Object.assign({},t,e);Object.assign(this,{Compiler:function(e){return function(e,t){const s=t||{},n=s.quote||'"',r='"'===n?"'":'"';if('"'!==n&&"'"!==n)throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:E,all:I,settings:{omitOptionalTags:s.omitOptionalTags||!1,allowParseErrors:s.allowParseErrors||!1,allowDangerousCharacters:s.allowDangerousCharacters||!1,quoteSmart:s.quoteSmart||!1,preferUnquoted:s.preferUnquoted||!1,tightAttributes:s.tightAttributes||!1,upperDoctype:s.upperDoctype||!1,tightDoctype:s.tightDoctype||!1,bogusComments:s.bogusComments||!1,tightCommaSeparatedLists:s.tightCommaSeparatedLists||!1,tightSelfClosing:s.tightSelfClosing||!1,collapseEmptyAttributes:s.collapseEmptyAttributes||!1,allowDangerousHtml:s.allowDangerousHtml||!1,voids:s.voids||o,characterReferences:s.characterReferences||s.entities||{},closeSelfClosing:s.closeSelfClosing||!1,closeEmptyElements:s.closeEmptyElements||!1},schema:"svg"===s.space?i.JW:i.qy,quote:n,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(e,s)}})}},95012:(e,t,s)=>{s.d(t,{Ay:()=>o});var i=s(2511);const o=i.default;i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString},95469:(e,t,s)=>{s.d(t,{Ay:()=>o});var i=s(99598);const o=i.default;i.CommaAndColonSeparatedRecord,i.ConnectionString,i.redactConnectionString},95593:e=>{var t=[];function s(e){for(var s=-1,i=0;i<t.length;i++)if(t[i].identifier===e){s=i;break}return s}function i(e,i){for(var n={},r=[],a=0;a<e.length;a++){var l=e[a],c=i.base?l[0]+i.base:l[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var h=s(u),p={css:l[1],media:l[2],sourceMap:l[3]};-1!==h?(t[h].references++,t[h].updater(p)):t.push({identifier:u,updater:o(p,i),references:1}),r.push(u)}return r}function o(e,t){var s=t.domAPI(t);return s.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;s.update(e=t)}else s.remove()}}e.exports=function(e,o){var n=i(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<n.length;r++){var a=s(n[r]);t[a].references--}for(var l=i(e,o),c=0;c<n.length;c++){var d=s(n[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}n=l}}},99094:(e,t,s)=>{s.d(t,{J0:()=>o});var i=s(34633);i.default,i.CommaAndColonSeparatedRecord,i.ConnectionString;const o=i.redactConnectionString},99598:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const i=s(21655),o=s(88245);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return o.redactConnectionString}});const n="__this_is_a_placeholder__",r=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class a extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends i.URL{}class c extends Error{get name(){return"MongoParseError"}}class d extends l{_hosts;constructor(e,t={}){const{looseValidation:s}=t;if(!s&&!(i=e).startsWith("mongodb://")&&!i.startsWith("mongodb+srv://"))throw new c('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var i;const o=e.match(r);if(!o)throw new c("Invalid connection string");const{protocol:l,username:u,password:h,hosts:p,rest:g}=o.groups??{};if(!s){if(!l||!p)throw new c("Protocol and host list are required in the uri");try{decodeURIComponent(u??""),decodeURIComponent(h??"")}catch(e){throw new c(e.message)}const t=/[:/?#[\]@]/gi;if(u?.match(t))throw new c(`Username contains unescaped characters ${u}`);if(!u||!h){const t=e.replace(`${l}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new c("URI contained empty userinfo section")}if(h?.match(t))throw new c("Password contains unescaped characters");if(g?.match(/^[^/?]*@/))throw new c("Invalid connection string")}let f="";"string"==typeof u&&(f+=u),"string"==typeof h&&(f+=`:${h}`),f&&(f+="@");try{super(`${l.toLowerCase()}://${f}${n}${g}`)}catch(i){throw s&&new d(e,{...t,looseValidation:!1}),"string"==typeof i.message&&(i.message=i.message.replace(n,p)),i}if(this._hosts=p.split(","),!s){if(this.isSRV&&1!==this.hosts.length)throw new c("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new c("mongodb+srv URI cannot have port number")}var m;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(m=this.searchParams.constructor,class extends m{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return a.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return n}set host(e){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new d(this.toString(),{looseValidation:!0})}redact(e){return(0,o.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}=this;return{href:e,origin:t,protocol:s,username:i,password:o,hosts:n,pathname:r,search:a,searchParams:l,hash:c}}}t.ConnectionString=d,t.CommaAndColonSeparatedRecord=class extends a{constructor(e){super();for(const t of(e??"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=d}};