205 lines
1.1 MiB
Executable File
205 lines
1.1 MiB
Executable File
import{BeanStub as Hg,_getDocument as zg}from"ag-grid-community";import{_exists as Ug,_logPreInitWarn as Wg}from"ag-grid-community";var Kg=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],r=e[2],a=e[3];s=this.ff(s,i,r,a,t[0],7,-680876936),a=this.ff(a,s,i,r,t[1],12,-389564586),r=this.ff(r,a,s,i,t[2],17,606105819),i=this.ff(i,r,a,s,t[3],22,-1044525330),s=this.ff(s,i,r,a,t[4],7,-176418897),a=this.ff(a,s,i,r,t[5],12,1200080426),r=this.ff(r,a,s,i,t[6],17,-1473231341),i=this.ff(i,r,a,s,t[7],22,-45705983),s=this.ff(s,i,r,a,t[8],7,1770035416),a=this.ff(a,s,i,r,t[9],12,-1958414417),r=this.ff(r,a,s,i,t[10],17,-42063),i=this.ff(i,r,a,s,t[11],22,-1990404162),s=this.ff(s,i,r,a,t[12],7,1804603682),a=this.ff(a,s,i,r,t[13],12,-40341101),r=this.ff(r,a,s,i,t[14],17,-1502002290),i=this.ff(i,r,a,s,t[15],22,1236535329),s=this.gg(s,i,r,a,t[1],5,-165796510),a=this.gg(a,s,i,r,t[6],9,-1069501632),r=this.gg(r,a,s,i,t[11],14,643717713),i=this.gg(i,r,a,s,t[0],20,-373897302),s=this.gg(s,i,r,a,t[5],5,-701558691),a=this.gg(a,s,i,r,t[10],9,38016083),r=this.gg(r,a,s,i,t[15],14,-660478335),i=this.gg(i,r,a,s,t[4],20,-405537848),s=this.gg(s,i,r,a,t[9],5,568446438),a=this.gg(a,s,i,r,t[14],9,-1019803690),r=this.gg(r,a,s,i,t[3],14,-187363961),i=this.gg(i,r,a,s,t[8],20,1163531501),s=this.gg(s,i,r,a,t[13],5,-1444681467),a=this.gg(a,s,i,r,t[2],9,-51403784),r=this.gg(r,a,s,i,t[7],14,1735328473),i=this.gg(i,r,a,s,t[12],20,-1926607734),s=this.hh(s,i,r,a,t[5],4,-378558),a=this.hh(a,s,i,r,t[8],11,-2022574463),r=this.hh(r,a,s,i,t[11],16,1839030562),i=this.hh(i,r,a,s,t[14],23,-35309556),s=this.hh(s,i,r,a,t[1],4,-1530992060),a=this.hh(a,s,i,r,t[4],11,1272893353),r=this.hh(r,a,s,i,t[7],16,-155497632),i=this.hh(i,r,a,s,t[10],23,-1094730640),s=this.hh(s,i,r,a,t[13],4,681279174),a=this.hh(a,s,i,r,t[0],11,-358537222),r=this.hh(r,a,s,i,t[3],16,-722521979),i=this.hh(i,r,a,s,t[6],23,76029189),s=this.hh(s,i,r,a,t[9],4,-640364487),a=this.hh(a,s,i,r,t[12],11,-421815835),r=this.hh(r,a,s,i,t[15],16,530742520),i=this.hh(i,r,a,s,t[2],23,-995338651),s=this.ii(s,i,r,a,t[0],6,-198630844),a=this.ii(a,s,i,r,t[7],10,1126891415),r=this.ii(r,a,s,i,t[14],15,-1416354905),i=this.ii(i,r,a,s,t[5],21,-57434055),s=this.ii(s,i,r,a,t[12],6,1700485571),a=this.ii(a,s,i,r,t[3],10,-1894986606),r=this.ii(r,a,s,i,t[10],15,-1051523),i=this.ii(i,r,a,s,t[1],21,-2054922799),s=this.ii(s,i,r,a,t[8],6,1873313359),a=this.ii(a,s,i,r,t[15],10,-30611744),r=this.ii(r,a,s,i,t[6],15,-1560198380),i=this.ii(i,r,a,s,t[13],21,1309151649),s=this.ii(s,i,r,a,t[4],6,-145523070),a=this.ii(a,s,i,r,t[11],10,-1120210379),r=this.ii(r,a,s,i,t[2],15,718787259),i=this.ii(i,r,a,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,s,i,r,a){return t=this.add32(this.add32(t,e),this.add32(i,a)),this.add32(t<<r|t>>>32-r,s)}ff(e,t,s,i,r,a,n){return this.cmn(t&s|~t&i,e,t,r,a,n)}gg(e,t,s,i,r,a,n){return this.cmn(t&i|s&~i,e,t,r,a,n)}hh(e,t,s,i,r,a,n){return this.cmn(t^s^i,e,t,r,a,n)}ii(e,t,s,i,r,a,n){return this.cmn(s^(t|~i),e,t,r,a,n)}md51(e){const t=e.length,s=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)this.md5cycle(s,this.md5blk(e.substring(i-64,i)));e=e.substring(i-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)r[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(s,r),i=0;i<16;i++)r[i]=0;return r[14]=t*8,this.md5cycle(s,r),s}md5blk(e){const t=[];for(let s=0;s<64;s+=4)t[s>>2]=e.charCodeAt(s)+(e.charCodeAt(s+1)<<8)+(e.charCodeAt(s+2)<<16)+(e.charCodeAt(s+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let s="",i=0;for(;i<4;i++)s+=t[e>>i*8+4&15]+t[e>>i*8&15];return s}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const s=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(s>>16)<<16|s&65535}},ni={"01":"GRID","02":"CHARTS","0102":"BOTH"},So="https://www.ag-grid.com/licensing/",bo=class pe{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new Kg,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(pe.licenseKey),s=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,i=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(s);else if(t.expired){const r=pe.getGridReleaseDate(),a=pe.formatDate(r);this.outputExpiredKey(t.expiry,a,s,i)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,s,i):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,s,i)}static extractExpiry(t){const s=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(pe.decode(s),10))}static extractLicenseComponents(t){let s=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(s=s.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const i=s.length-32,r=s.substring(i),a=s.substring(0,i),[n,o,l]=pe.extractBracketedInformation(s);return{md5:r,license:a,version:n,isTrial:o,type:l}}getLicenseDetails(t){const s=pe.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=pe.getGridReleaseDate(),{md5:r,license:a,version:n,isTrial:o,type:l}=pe.extractLicenseComponents(t);let c=r===this.md5.md5(a)&&!t.includes("For_Trialing_ag-Grid_Only"),d,u,h=null,p=!1,g;function f(){d=h<new Date,u=void 0}if(c&&(h=pe.extractExpiry(a),c=!isNaN(h.getTime()),c))switch(u=i>h,n){case"legacy":case"2":{o&&f();break}case"3":l?.length?(g=l,l!==ni["01"]&&l!==ni["0102"]||s==="BOTH"&&g!=="BOTH"?(c=!1,p=!0):o&&f()):c=!1}return c?{licenseKey:t,valid:c,expiry:pe.formatDate(h),expired:u,version:n,isTrial:o,trialExpired:d,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:t,valid:c,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const s=(this.document.defaultView||window).location,{hostname:i=""}=s;return i}isForceWatermark(){const s=(this.document.defaultView||window).location,{pathname:i}=s;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),r=t.getMonth(),a=t.getFullYear();return i+" "+s[r]+" "+a}static getGridReleaseDate(){return new Date(parseInt(pe.decode(pe.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",r,a,n,o,l,c,d,u=0;const h=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;u<h.length;)o=s.indexOf(h.charAt(u++)),l=s.indexOf(h.charAt(u++)),c=s.indexOf(h.charAt(u++)),d=s.indexOf(h.charAt(u++)),r=o<<2|l>>4,a=(l&15)<<4|c>>2,n=(c&3)<<6|d,i=i+String.fromCharCode(r),c!=64&&(i=i+String.fromCharCode(a)),d!=64&&(i=i+String.fromCharCode(n));return i=pe.utf8_decode(i),i}static utf8_decode(t){t=t.replace(/rn/g,"n");let s="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);r<128?s+=String.fromCharCode(r):r>127&&r<2048?(s+=String.fromCharCode(r>>6|192),s+=String.fromCharCode(r&63|128)):(s+=String.fromCharCode(r>>12|224),s+=String.fromCharCode(r>>6&63|128),s+=String.fromCharCode(r&63|128))}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(t){Ug(this.licenseKey)&&this.licenseKey!==t&&Wg(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey=t,this.chartsLicenseManager?.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const s=t.match(/\[(.*?)\]/g).map(o=>o.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(o=>o==="TRIAL").length===1,r=s.filter(o=>o.indexOf("v")===0)[0],a=r?r.replace("v",""):"legacy",n=ni[s.filter(o=>ni[o])[0]];return[a,i,n]}centerPadAndOutput(t){const s=this.totalMessageLength-t.length;console.error(t.padStart(s/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,s="*",i=""){console.error(t.padEnd(this.totalMessageLength-i.length,s)+i)}outputInvalidLicenseKey(t,s,i){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${s}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${So}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${So}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,s,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,s,i,r){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions${r==""?"":` of ${r}`} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${s}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};bo.RELEASE_INFORMATION="MTc3MDgwOTgzNDk5MQ==";var ds=bo;import{Component as $g,RefPlaceholder as jg}from"ag-grid-community";var Yg='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',qg={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},Xg=class extends $g{constructor(){super(qg),this.eLicenseTextRef=jg,this.registerCSS(Yg)}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},Zg={selector:"AG-WATERMARK",component:Xg},kr=class extends Hg{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new ds(zg(this.beans)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new ds(null).getLicenseDetails(e)}getWatermarkSelector(){return Zg}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){ds.setLicenseKey(e)}static setChartsLicenseManager(e){ds.setChartsLicenseManager(e)}};import{BaseCreator as Jg,_addGridCommonParams as yo,_downloadFile as Gr,_getHeaderClassesFromColDef as Qg,_getHeaderRowCount as ef,_warn as wo}from"ag-grid-community";import{BaseGridSerializingSession as tf,_addGridCommonParams as Or,_isExpressionString as sf,_last as rf,_mergeDeep as af,_warn as nf}from"ag-grid-community";import{_escapeString as of}from"ag-grid-community";var lf=9525,xo={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},oi=`\r
|
||
`;function Fo(e,t,s){if(!t&&t!==""&&t!==0)return"";let i=t;return typeof t=="boolean"&&s&&(i=s(t)),` ${e}="${i}"`}function cf(e={}){const t="<?",s="?>",i=["version"];e.version||(e.version="1.0"),e.encoding&&i.push("encoding"),e.standalone&&i.push("standalone");const r=i.map(a=>`${a}="${e[a]}"`).join(" ");return`${t}xml ${r} ${s}`}function Ro(e,t){let s="";if(e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(r=>{for(const a of Object.keys(r.map))s+=Fo(r.prefix+a,r.map[a],t)}),e.properties.rawMap))for(const r of Object.keys(e.properties.rawMap))s+=Fo(r,e.properties.rawMap[r],t);let i="<"+e.name+s;if(!e.children&&e.textNode==null)return i+"/>"+oi;if(e.textNode!=null)return i+">"+e.textNode+"</"+e.name+">"+oi;if(i+=">"+oi,e.children)for(const r of e.children)i+=Ro(r,t);return i+"</"+e.name+">"+oi}var df=e=>Math.round(e*96/72),Pt=e=>Math.ceil(e*lf),uf=e=>{if(e===void 0)return;const s=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(s,0)},li=(e,t)=>{if(!t)return;let s;return typeof t=="number"?s=t:s=t({rowIndex:e}),s},hf=(e,t)=>{const{colSpan:s,column:i}=e.position;if(e.width)if(s){const r=t.slice(i-1,i+s-1);let a=0;for(let n=0;n<r.length;n++){const o=r[n].getActualWidth();if(e.width<a+o){e.position.colSpan=n+1,e.totalWidth=e.width,e.width=e.totalWidth-a;break}a+=o}}else e.totalWidth=e.width},pf=(e,t)=>{const{rowSpan:s,row:i}=e.position;if(e.height)if(s){let r=0,a=0;for(let n=i;n<i+s;n++){const o=df(li(n,t)||20);if(e.height<r+o){e.position.rowSpan=a+1,e.totalHeight=e.height,e.height=e.totalHeight-r;break}r+=o,a++}}else e.totalHeight=e.height},ie=(e,t)=>{const s=cf({encoding:"UTF-8",standalone:"yes"}),i=Ro(e);return t?i:`${s}${i}`},ut=e=>{const i=String.fromCharCode,r=Math.floor(e/26),a=e%26;return!r||e===26?i(65+e-1):a?r<26?i(65+r-1)+i(65+a-1):ut(r)+i(65+a-1):ut(r-1)+"Z"},gf=e=>e.replaceAll(`
|
||
`,"_x000a_"),ci=e=>{if(e==null)return null;let t="";for(let s=0;s<e.length;s++){const i=e.charCodeAt(s);if(i>=0&&i<=31&&i!==10){const n=`_x${i.toString(16).toUpperCase().padStart(4,"0")}_`;t+=n}else t+=e[s]}return t},ff=e=>{const t=[];for(const s of e.keys()){const i=s.toString(),r={name:"t",textNode:of(ci(i))};i.trim().length!==i.length&&(r.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[r]})}return t},mf=class extends tf{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=e.formulaSvc,this.config=Object.assign({},e),this.workbook=e.workbook,this.stylesByIds={};for(const s of this.config.baseExcelStyles)this.stylesByIds[s.id]=s;const t={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[t.id]=t,this.excelStyles=[...this.config.baseExcelStyles,t]}addCustomContent(e){for(const t of e){const s=this.rows.length+1;let i;!this.config.suppressRowOutline&&t.outlineLevel!=null&&(i=t.outlineLevel);const r={height:li(s,t.height||this.config.rowHeight),cells:(t.cells||[]).map((a,n)=>{const o=this.addImage(s,this.columnsToExport[n],a.data?.value);let l=null;a.styleId&&(l=typeof a.styleId=="string"?[a.styleId]:a.styleId);const c=this.getStyleId(l);if(o)return this.createCell(c,this.getDataTypeForValue(o.value),o.value==null?"":o.value);const d=a.data?.value??"",u=this.getDataTypeForValue(d);return a.mergeAcross?this.createMergedCell(c,u,d,a.mergeAcross):this.createCell(c,u,d)}),outlineLevel:i};t.collapsed!=null&&(r.collapsed=t.collapsed),t.hidden!=null&&(r.hidden=t.hidden),this.rows.push(r)}}onNewHeaderGroupingRow(){const e=[],{freezeRows:t,headerRowHeight:s}=this.config;return this.rows.push({cells:e,height:li(this.rows.length+1,s)}),t&&this.frozenRowCount++,{onColumn:(i,r,a,n,o)=>{const l=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${r}`,columnGroup:i});e.push({...this.createMergedCell(this.getStyleId(l),this.getDataTypeForValue("string"),r,n),collapsibleRanges:o})}}}onNewHeaderRow(){const{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){const{freezeRows:t,rowHeight:s}=this.config;this.skipFrozenRows||(t==="headersAndPinnedRows"&&e?.rowPinned==="top"?this.frozenRowCount++:typeof t=="function"?t(Or(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0:this.skipFrozenRows=!0);const i=this.onNewRow(this.onNewBodyColumn,s);return e&&this.addRowOutlineIfNecessary(e),i}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((t,s)=>this.convertColumnToExcel(t,s))}parse(){const e=this.rows.reduce((s,i)=>Math.max(s,i.cells.length),0);for(;this.cols.length<e;)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));const t=this.createWorksheet();return this.addWorksheetToWorkbook(t)}createWorksheet(){const{sheetName:e}=this.config;let t;if(e!=null){const s=typeof e=="function"?e(Or(this.gos,{})):e;t=String(s).substring(0,31)}else t="ag-grid";return{name:t,table:{columns:this.cols,rows:this.rows}}}addRowOutlineIfNecessary(e){const{gos:t,suppressRowOutline:s,rowGroupExpandState:i="expanded"}=this.config;if(t.get("groupHideOpenParents")||s||e.level==null)return;const a=e.footer?1:0,n=rf(this.rows);if(e.uiLevel==null||e.level===e.uiLevel){const l=Math.min(e.level+a,7);n.outlineLevel=l}if(i==="expanded")return;const o=i==="collapsed";if(e.isExpandable()){const l=!o&&e.expanded;n.collapsed=!l}n.hidden=!!e.parent&&e.parent.level!==-1&&(o||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){for(;e&&e.level!==-1;){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){const s=this.config.columnWidth,r=(e?this.extractHeaderValue(e):void 0)??"",a=e?e.isFilterAllowed():!1;return s?typeof s=="number"?{width:s,displayName:r,filterAllowed:a}:{width:s({column:e,index:t}),displayName:r,filterAllowed:a}:e?{width:Math.max(e.getActualWidth(),75),displayName:r,filterAllowed:a}:{displayName:r,filterAllowed:a}}onNewHeaderColumn(e,t){return s=>{const i=this.extractHeaderValue(s),r=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:i,column:s});t.push(this.createCell(this.getStyleId(r),this.getDataTypeForValue("string"),i))}}onNewBodyColumn(e,t){let s=0;const{freezeColumns:i,rightToLeft:r}=this.config;return(a,n,o)=>{if(s>0){s-=1;return}if(!this.skipFrozenColumns){const m=a.getPinned();i==="pinned"&&m&&(m===!0||m==="left")!==r?this.frozenColumnCount++:typeof i=="function"&&i(Or(this.gos,{column:a}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}const{value:l,valueFormatted:c}=this.extractRowCellValue({column:a,node:o,currentColumnIndex:n,accumulatedRowIndex:e,type:"excel",useRawFormula:!0}),d=l,u=typeof d=="bigint"?d.toString():d,h=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:d,column:a,node:o}),p=this.getStyleId(h),g=a.getColSpan(o),f=this.addImage(e,a,u);if(f)t.push(this.createCell(p,this.getDataTypeForValue(f.value),f.value==null?"":f.value));else if(g>1)s=g-1,t.push(this.createMergedCell(p,this.getDataTypeForValue(d),u,g-1));else{const m=a.isAllowFormula()&&this.formulaSvc?.isFormula(u),C=this.createCell(p,m?"f":this.getDataTypeForValue(d),m?this.formulaSvc?.updateFormulaByOffset({value:u,rowDelta:e-(o.formulaRowIndex+1),useRefFormat:!1}):u,c);t.push(C)}}}onNewRow(e,t){const s=[];return this.rows.push({cells:s,height:li(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,s)()}}addWorksheetToWorkbook(e){const{excelStyles:t,config:s}=this;return this.mapSharedStrings(e),this.frozenColumnCount&&(s.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(s.frozenRowCount=this.frozenRowCount),this.workbook.addWorksheet(t,e,s)}mapSharedStrings(e){let t;for(const s of e.table.rows)for(const i of s.cells){const r=i.data;if(!r||r.type!=="s")continue;const a=r.value;if(a!=null){if(a===""){t??(t=this.workbook.getStringPosition("").toString()),r.value=t;continue}r.value=this.workbook.getStringPosition(String(a)).toString()}}}getDataTypeForValue(e){if(e===void 0)return"empty";let t="s";try{this.isNumerical(e)&&(t="n")}catch{}return t}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e?.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:nf(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,s){if(!this.config.addImageToCell)return;const i=this.config.addImageToCell(e,t,s);if(i)return this.workbook.addBodyImageToMap(i.image,e,t,this.columnsToExport,this.config.rowHeight),i}createCell(e,t,s,i){const r=this.getStyleById(e);!r?.dataType&&t==="s"&&i!=null&&(s=i);const a=this.getTypeFromStyle(r,s)||t,{value:n,escaped:o}=this.getCellValue(a,s),l=[];return r&&l.push(e),o&&l.push("_quotePrefix"),e=this.getStyleId(l)||void 0,{styleId:e,data:{type:a,value:n}}}createMergedCell(e,t,s,i){const r=s??"";return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:t==="s"?String(r):s},mergeAcross:i}}getCellValue(e,t){let s=!1;if(t==null||e==="s"&&t==="")return{value:"",escaped:!1};if(e==="s")t=String(t),t[0]==="'"&&(s=!0,t=t.slice(1));else if(e==="f")t=this.addXlfnPrefix(t).slice(1);else if(e==="n"){const i=Number(t);isNaN(i)?t="":t!==""&&(t=i.toString())}return{value:t,escaped:s}}addXlfnPrefix(e){if(!e)return e;const t=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return e.replace(t,(s,i,r,a)=>`${i}_xlfn.${r}${a}`)}getStyleId(e){if(!e?.length)return null;const t=e.filter(i=>this.stylesByIds[i]!=null);if(!t.length)return null;if(t.length===1)return t[0];const s=t.join("-");return this.mixedStyles[s]||this.addNewMixedStyle(t),this.mixedStyles[s].excelID}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,s={};for(const r of e){const a=this.stylesByIds[r];a&&af(s,a,!0,!0)}s.id=t;const i=e.join("-");this.mixedStyles[i]={excelID:t,key:i,result:s},this.excelStyles.push(s),this.stylesByIds[t]=s}isFormula(e){if(e==null)return!1;const t=String(e);return this.config.autoConvertFormulas&&sf(t)}isNumerical(e){return typeof e=="bigint"?!1:isFinite(e)&&e!==""&&!isNaN(parseFloat(e))}getStyleById(e){return e==null?null:this.stylesByIds[e]||null}};import{_escapeString as Cf,_warn as _r}from"ag-grid-community";var vf={getTemplate(e){const{name:t,ContentType:s,Extension:i,PartName:r}=e;return{name:t,properties:{rawMap:{Extension:i,PartName:r,ContentType:s}}}}},Sf=vf,di=e=>e==="jpg"?"jpeg":e,bf={getTemplate({sheetLen:e,hasCustomProperties:t}){const s=new Array(e).fill(void 0).map((u,h)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${h+1}.xml`})),i=je.size,r=Ge.size,a={};Et.forEach(u=>{a[di(u.type)]=!0});const n=new Array(i).fill(void 0).map((u,h)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${h+1}.xml`})),o=[];Fe.forEach(({name:u})=>{o.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${u}.xml`})});const l=t?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],c=Object.keys(a).map(u=>({name:"Default",ContentType:`image/${u}`,Extension:u}));r&&c.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});const d=[...c,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...s,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...n,...o,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...l].map(u=>Sf.getTemplate(u));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:d}}},yf=bf,wf={getTemplate(e){const s=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s}]}}},xf=wf;import{_escapeString as Ao}from"ag-grid-community";var Ff="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",Rf=e=>Object.keys(e).filter(s=>s&&e[s]!=null).map((s,i)=>({name:"property",properties:{rawMap:{fmtid:Ff,pid:(i+2).toString(),name:Ao(s)??""}},children:[{name:"vt:lpwstr",textNode:Ao(ci(String(e[s])))??""}]})),Af={getTemplate(e){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:Rf(e)}}},Mf=Af,Mo=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),Tf=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},Pf=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:e.altText!=null?e.altText:void 0}},children:[Tf(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),To=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:e.saturation*1e3}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:e.tint*1e3}}}),t},If=(e,t)=>({name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:e.color}},children:To(e)},{name:"a:srgbClr",properties:{rawMap:{val:t.color}},children:To(t)}]}),Ef=(e,t)=>{let s;if(e.transparency){const i=Math.min(Math.max(e.transparency,0),100);s=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(i*1e3)}}}]}if(e.recolor)switch(s||(s=[]),e.recolor.toLocaleLowerCase()){case"grayscale":s.push({name:"a:grayscl"});break;case"sepia":s.push(If({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":s.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:s},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},Df=(e,t)=>{const s={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const a=e.rotation;s.properties={rawMap:{rot:Math.min(Math.max(a,0),360)*6e4}}}return{name:"xdr:spPr",children:[s,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},Lf=e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:s,width:i=0,height:r=0,totalHeight:a,totalWidth:n}=e,{offsetX:o=0,offsetY:l=0,row:c=1,rowSpan:d=1,column:u=1,colSpan:h=1}=t;return{from:{row:c-1,col:u-1,offsetX:Pt(o),offsetY:Pt(l)},to:{row:c-1+(s?1:d-1),col:u-1+(s?1:h-1),offsetX:Pt(i+o),offsetY:Pt(r+l)},height:Pt(a||r),width:Pt(n||i)}},kf=(e,t,s,i)=>({name:"xdr:pic",children:[Pf(e,t+1),Ef(e,s+1),Df(e,i)]}),Gf={getTemplate(e){const{sheetIndex:t}=e,s=je.get(t),i=Dt.get(t),r=s.map((a,n)=>{const o=Lf(a);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[Mo("from",o.from),Mo("to",o.to),kf(a,n,i.get(a.id).index,o),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:r}}},Of=Gf,_f={getTemplate(e){const{Id:t,Type:s,Target:i}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:s,Target:i}}}}},Nf=_f,Bf={getTemplate(e){const t=e.map(s=>Nf.getTemplate(s));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:t}}},us=Bf,Vf={getTemplate(e){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:ff(e)}}},Hf=Vf,zf=e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},Uf={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},Wf=["Dashed","DashDot","DashDotDot"],Kf={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},$f={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},jf={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},Yf=e=>e?Kf[e]||e:"none",Ke=e=>e==null?e:(e.charAt(0)==="#"&&(e=e.substring(1)),e.length===6?"FF"+e:e),ui=(e,t)=>{if(!e)return"thin";const s=zf(t);if(e==="Continuous")return s;const i=Uf[e];return s==="medium"&&Wf.some(r=>r===i)?`medium${i}`:`${i.charAt(0).toLowerCase()}${i.substring(1)}`},qf=e=>$f[e]||"general",Xf=e=>jf[e]||void 0,hs=e=>({name:"color",properties:{rawMap:{rgb:Ke(e||"#000000")}}}),Zf={getTemplate(e){const{left:t,right:s,top:i,bottom:r,diagonal:a}=e,n=t?[hs(t.color)]:void 0,o=s?[hs(s.color)]:void 0,l=i?[hs(i.color)]:void 0,c=r?[hs(r.color)]:void 0,d=a?[hs(a.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t?.style}},children:n},{name:"right",properties:{rawMap:{style:s?.style}},children:o},{name:"top",properties:{rawMap:{style:i?.style}},children:l},{name:"bottom",properties:{rawMap:{style:r?.style}},children:c},{name:"diagonal",properties:{rawMap:{style:a?.style}},children:d}]}}},Jf=Zf,Qf={getTemplate(e){return{name:"borders",properties:{rawMap:{count:e.length}},children:e.map(t=>Jf.getTemplate(t))}}},em=Qf,tm=e=>{const s=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(s,0)},sm={getTemplate(e){const{horizontal:t,indent:s,readingOrder:i,rotate:r,shrinkToFit:a,vertical:n,wrapText:o}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&qf(t),indent:s,readingOrder:i&&tm(i),textRotation:r,shrinkToFit:a,vertical:n&&Xf(n),wrapText:o}}}}},im=sm,rm={getTemplate(e){const t=e.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:e.hideFormula===!0?1:0,locked:t}}}}},am=rm,nm={getTemplate(e){const{alignment:t,borderId:s,fillId:i,fontId:r,numFmtId:a,protection:n,quotePrefix:o,xfId:l}=e,c=[];return t&&c.push(im.getTemplate(t)),n&&c.push(am.getTemplate(n)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:n?1:void 0,applyBorder:s?1:void 0,applyFill:i?1:void 0,borderId:s,fillId:i,applyFont:r?1:void 0,fontId:r,applyNumberFormat:a?1:void 0,numFmtId:a,quotePrefix:o?1:void 0,xfId:l}},children:c.length?c:void 0}}},Po=nm,om={getTemplate(e){return{name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>Po.getTemplate(t))}}},lm=om,cm={getTemplate(e){const{builtinId:t,name:s,xfId:i}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:s,xfId:i}}}}},dm=cm,um={getTemplate(e){return{name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(t=>dm.getTemplate(t))}}},hm=um,pm={getTemplate(e){return{name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>Po.getTemplate(t))}}},gm=pm,fm={getTemplate(e){const{patternType:t,fgTheme:s,fgTint:i,fgRgb:r,bgRgb:a,bgIndexed:n}=e,o={name:"patternFill",properties:{rawMap:{patternType:t}}};return(s||i||r)&&(o.children=[{name:"fgColor",properties:{rawMap:{theme:s,tint:i,rgb:r}}}]),(n||a)&&(o.children||(o.children=[]),o.children.push({name:"bgColor",properties:{rawMap:{indexed:n,rgb:a}}})),{name:"fill",children:[o]}}},mm=fm,Cm={getTemplate(e){return{name:"fills",properties:{rawMap:{count:e.length}},children:e.map(t=>mm.getTemplate(t))}}},vm=Cm,Sm={getTemplate(e){const{size:t,colorTheme:s,color:i="FF000000",fontName:r="Calibri",family:a,scheme:n,italic:o,bold:l,strikeThrough:c,outline:d,shadow:u,underline:h,verticalAlign:p}=e,g=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:s,rgb:i}}},{name:"name",properties:{rawMap:{val:r}}}];return a&&g.push({name:"family",properties:{rawMap:{val:a}}}),n&&g.push({name:"scheme",properties:{rawMap:{val:n}}}),o&&g.push({name:"i"}),l&&g.push({name:"b"}),c&&g.push({name:"strike"}),d&&g.push({name:"outline"}),u&&g.push({name:"shadow"}),h&&g.push({name:"u",properties:{rawMap:{val:h}}}),p&&g.push({name:"vertAlign",properties:{rawMap:{val:p}}}),{name:"font",children:g}}},bm=Sm,ym={getTemplate(e){return{name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(t=>bm.getTemplate(t))}}},wm=ym;import{_escapeString as xm}from"ag-grid-community";function Fm(e){const t=e.split(/(\[[^\]]*\])/);for(let s=0;s<t.length;s++){let i=t[s];i.length&&(i.startsWith("[")||(i=i.replace(/\$/g,'"$"')),t[s]=xm(i))}return t.join("")}var Rm={getTemplate(e){let{formatCode:t,numFmtId:s}=e;return t.length&&(t=Fm(t)),{name:"numFmt",properties:{rawMap:{formatCode:t,numFmtId:s}}}}},Am=Rm,Mm={getTemplate(e){return{name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(t=>Am.getTemplate(t))}}},Tm=Mm,hi,It,ps,gs,fs,Io,pi,Eo,Nr,Do=(e,t)=>(e.includes("mixedStyle")&&t>1&&(e+=`_${t}`),e),Lo=()=>{hi={base:0},It=[],ps=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],gs=[{patternType:"none"},{patternType:"gray125"}],fs=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],Io=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],pi=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],Eo=[{builtinId:0,name:"Normal",xfId:0}]},Pm=e=>{const t=Yf(e.pattern),s=Ke(e.color),i=Ke(e.patternColor);let r=gs.findIndex(a=>{const{patternType:n,fgRgb:o,bgRgb:l}=a;return!(n!=t||o!=s||l!=i)});return r===-1&&(r=gs.length,gs.push({patternType:t,fgRgb:s,bgRgb:i})),r},Im=e=>{if(xo[e])return xo[e];let t=It.findIndex(s=>s.formatCode===e);return t===-1?(t=It.length+164,It.push({formatCode:e,numFmtId:t})):t=It[t].numFmtId,t},Em=e=>{const{borderBottom:t,borderTop:s,borderLeft:i,borderRight:r}=e;let a,n,o,l,c,d,u,h;i&&(o=ui(i.lineStyle,i.weight),u=Ke(i.color)),r&&(l=ui(r.lineStyle,r.weight),h=Ke(r.color)),t&&(a=ui(t.lineStyle,t.weight),c=Ke(t.color)),s&&(n=ui(s.lineStyle,s.weight),d=Ke(s.color));let p=fs.findIndex(g=>{const{left:f,right:m,top:C,bottom:v}=g;if(!f&&(o||u)||!m&&(l||h)||!C&&(n||d)||!v&&(a||c))return!1;const{style:S,color:b}=f||{},{style:y,color:w}=m||{},{style:M,color:T}=C||{},{style:F,color:I}=v||{};return!(S!=o||b!=u||y!=l||w!=h||M!=n||T!=d||F!=a||I!=c)});return p===-1&&(p=fs.length,fs.push({left:{style:o,color:u},right:{style:l,color:h},top:{style:n,color:d},bottom:{style:a,color:c},diagonal:{style:void 0,color:void 0}})),p},Dm=e=>{const{fontName:t="Calibri",color:s,size:i,bold:r,italic:a,outline:n,shadow:o,strikeThrough:l,underline:c,family:d,verticalAlign:u}=e,h=Ke(s),p=uf(d),g=c?c.toLocaleLowerCase():void 0,f=u?u.toLocaleLowerCase():void 0;let m=ps.findIndex(C=>!(C.fontName!=t||C.color!=h||C.size!=i||C.bold!=r||C.italic!=a||C.outline!=n||C.shadow!=o||C.strikeThrough!=l||C.underline!=g||C.verticalAlign!=f||C.family!=p));return m===-1&&(m=ps.length,ps.push({fontName:t,color:h,size:i,bold:r,italic:a,outline:n,shadow:o,strikeThrough:l,underline:g,verticalAlign:f,family:p?.toString()})),m},Lm=e=>{const{alignment:t,borders:s,font:i,interior:r,numberFormat:a,protection:n,quotePrefix:o}=e;let{id:l}=e,c=0,d=0,u=0,h=0;l&&(l=Do(l,Nr),hi[l]==null&&(r&&(c=Pm(r)),s&&(d=Em(s)),i&&(u=Dm(i)),a&&(h=Im(a.format)),hi[l]=pi.length,pi.push({alignment:t,borderId:d||0,fillId:c||0,fontId:u||0,numFmtId:h||0,protection:n,quotePrefix:o,xfId:0})))},km={getTemplate(e){const t=Tm.getTemplate(It),s=wm.getTemplate(ps.map(l=>({...l,size:l.size!=null?l.size:e}))),i=vm.getTemplate(gs),r=em.getTemplate(fs),a=lm.getTemplate(Io),n=gm.getTemplate(pi),o=hm.getTemplate(Eo);return Lo(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,s,i,r,a,n,o,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},Gm=(e,t)=>hi[Do(e,t)]||0,Om=(e,t)=>{Nr=t,Nr===1&&Lo(),e.forEach(Lm)},_m=km;import{_escapeString as Nm}from"ag-grid-community";var Bm={getTemplate(e,t){const{name:s,columns:i,rowRange:r,displayName:a,showRowStripes:n,showColumnStripes:o,showFilterButtons:l,highlightFirstColumn:c,highlightLastColumn:d}=e||{},u=!r||r[0]-r[1]===0;if(!e||!s||!Array.isArray(i)||!i.length||u)return{name:"table"};const h=i.map((v,S)=>({name:"filterColumn",properties:{rawMap:{colId:S.toString(),hiddenButton:l[S]?0:1}}})),p=`A${r[0]}`,g=`${ut(i.length)}${r[1]}`,f=`${p}:${g}`,m=`${t+1}`,C=t?`${a}_${m}`:a;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:C,displayName:C,ref:f,totalsRowShown:0,id:m}},children:[{name:"autoFilter",properties:{rawMap:{ref:f}},children:h},{name:"tableColumns",properties:{rawMap:{count:i.length}},children:i.map((v,S)=>({name:"tableColumn",properties:{rawMap:{id:(S+1).toString(),name:Nm(gf(v)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:c?1:0,showLastColumn:d?1:0,showRowStripes:n?1:0,showColumnStripes:o?1:0}}}]}}},Vm=Bm,ve=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,children:[{name:`a:${s}`,properties:{rawMap:{val:i,lastClr:r}}}]}},Hm={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[ve(["dk1","sysClr","windowText","000000"]),ve(["lt1","sysClr","window","FFFFFF"]),ve(["dk2","srgbClr","44546A"]),ve(["lt2","srgbClr","E7E6E6"]),ve(["accent1","srgbClr","4472C4"]),ve(["accent2","srgbClr","ED7D31"]),ve(["accent3","srgbClr","A5A5A5"]),ve(["accent4","srgbClr","FFC000"]),ve(["accent5","srgbClr","5B9BD5"]),ve(["accent6","srgbClr","70AD47"]),ve(["hlink","srgbClr","0563C1"]),ve(["folHlink","srgbClr","954F72"])]}}},zm=Hm,R=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,properties:{rawMap:{script:i,typeface:s,panose:r}}}},Um={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[R(["latin","Calibri Light",void 0,"020F0302020204030204"]),R(["ea",""]),R(["cs",""]),R(["font","\u6E38\u30B4\u30B7\u30C3\u30AF Light","Jpan"]),R(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),R(["font","\u7B49\u7EBF Light","Hans"]),R(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),R(["font","Times New Roman","Arab"]),R(["font","Times New Roman","Hebr"]),R(["font","Tahoma","Thai"]),R(["font","Nyala","Ethi"]),R(["font","Vrinda","Beng"]),R(["font","Shruti","Gujr"]),R(["font","MoolBoran","Khmr"]),R(["font","Tunga","Knda"]),R(["font","Raavi","Guru"]),R(["font","Euphemia","Cans"]),R(["font","Plantagenet Cherokee","Cher"]),R(["font","Microsoft Yi Baiti","Yiii"]),R(["font","Microsoft Himalaya","Tibt"]),R(["font","MV Boli","Thaa"]),R(["font","Mangal","Deva"]),R(["font","Gautami","Telu"]),R(["font","Latha","Taml"]),R(["font","Estrangelo Edessa","Syrc"]),R(["font","Kalinga","Orya"]),R(["font","Kartika","Mlym"]),R(["font","DokChampa","Laoo"]),R(["font","Iskoola Pota","Sinh"]),R(["font","Mongolian Baiti","Mong"]),R(["font","Times New Roman","Viet"]),R(["font","Microsoft Uighur","Uigh"]),R(["font","Sylfaen","Geor"]),R(["font","Arial","Armn"]),R(["font","Leelawadee UI","Bugi"]),R(["font","Microsoft JhengHei","Bopo"]),R(["font","Javanese Text","Java"]),R(["font","Segoe UI","Lisu"]),R(["font","Myanmar Text","Mymr"]),R(["font","Ebrima","Nkoo"]),R(["font","Nirmala UI","Olck"]),R(["font","Ebrima","Osma"]),R(["font","Phagspa","Phag"]),R(["font","Estrangelo Edessa","Syrn"]),R(["font","Estrangelo Edessa","Syrj"]),R(["font","Estrangelo Edessa","Syre"]),R(["font","Nirmala UI","Sora"]),R(["font","Microsoft Tai Le","Tale"]),R(["font","Microsoft New Tai Lue","Talu"]),R(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[R(["latin","Calibri",void 0,"020F0502020204030204"]),R(["ea",""]),R(["cs",""]),R(["font","\u6E38\u30B4\u30B7\u30C3\u30AF","Jpan"]),R(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),R(["font","\u7B49\u7EBF","Hans"]),R(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),R(["font","Arial","Arab"]),R(["font","Arial","Hebr"]),R(["font","Tahoma","Thai"]),R(["font","Nyala","Ethi"]),R(["font","Vrinda","Beng"]),R(["font","Shruti","Gujr"]),R(["font","DaunPenh","Khmr"]),R(["font","Tunga","Knda"]),R(["font","Raavi","Guru"]),R(["font","Euphemia","Cans"]),R(["font","Plantagenet Cherokee","Cher"]),R(["font","Microsoft Yi Baiti","Yiii"]),R(["font","Microsoft Himalaya","Tibt"]),R(["font","MV Boli","Thaa"]),R(["font","Mangal","Deva"]),R(["font","Gautami","Telu"]),R(["font","Latha","Taml"]),R(["font","Estrangelo Edessa","Syrc"]),R(["font","Kalinga","Orya"]),R(["font","Kartika","Mlym"]),R(["font","DokChampa","Laoo"]),R(["font","Iskoola Pota","Sinh"]),R(["font","Mongolian Baiti","Mong"]),R(["font","Arial","Viet"]),R(["font","Microsoft Uighur","Uigh"]),R(["font","Sylfaen","Geor"]),R(["font","Arial","Armn"]),R(["font","Leelawadee UI","Bugi"]),R(["font","Microsoft JhengHei","Bopo"]),R(["font","Javanese Text","Java"]),R(["font","Segoe UI","Lisu"]),R(["font","Myanmar Text","Mymr"]),R(["font","Ebrima","Nkoo"]),R(["font","Nirmala UI","Olck"]),R(["font","Ebrima","Osma"]),R(["font","Phagspa","Phag"]),R(["font","Estrangelo Edessa","Syrn"]),R(["font","Estrangelo Edessa","Syrj"]),R(["font","Estrangelo Edessa","Syre"]),R(["font","Nirmala UI","Sora"]),R(["font","Microsoft Tai Le","Tale"]),R(["font","Microsoft New Tai Lue","Talu"]),R(["font","Ebrima","Tfng"])]}]}}},Wm=Um,xe=(e,t,s)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:s}),Br=e=>{const[t,s,i,r,a,n]=e,o=[];return o.push(xe("satMod",i)),r&&o.push(xe("lumMod",r)),a&&o.push(xe("tint",a)),n&&o.push(xe("shade",n)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:s}},children:o}]}},gi=(e,t)=>({name:"a:solidFill",children:[xe("schemeClr",e,t)]}),Vr=e=>{const[t,s,i,r,a]=e,[n,o]=a;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[Br(s),Br(i),Br(r)]},{name:"a:lin",properties:{rawMap:{ang:n,scaled:o}}}]}},Hr=e=>{const[t,s,i,r]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:s,cmpd:i,algn:r}},children:[gi("phClr"),xe("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},zr=e=>{const t=[];if(e){const[s,i,r,a,n]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:s,dist:i,dir:r,algn:a,rotWithShape:n}},children:[xe("srgbClr","000000",[xe("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},Km=()=>({name:"a:fillStyleLst",children:[gi("phClr"),Vr(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),Vr(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),$m=()=>({name:"a:lnStyleLst",children:[Hr(["6350","flat","sng","ctr"]),Hr(["12700","flat","sng","ctr"]),Hr(["19050","flat","sng","ctr"])]}),jm=()=>({name:"a:effectStyleLst",children:[zr(),zr(),zr(["57150","19050","5400000","ctr","0"])]}),Ym=()=>({name:"a:bgFillStyleLst",children:[gi("phClr"),gi("phClr",[xe("tint","95000"),xe("satMod","170000")]),Vr(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),qm={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[Km(),$m(),jm(),Ym()]}}},Xm=qm,Zm={getTemplate(){return{name:"a:themeElements",children:[zm.getTemplate(),Wm.getTemplate(),Xm.getTemplate()]}}},Jm=Zm,Qm={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[Jm.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},eC=Qm,tC=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),sC=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),iC=e=>({name:"v:formulas",children:e.map(t=>({name:"v:f",properties:{rawMap:{eqn:t}}}))}),rC=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),ko=e=>{const{aspectratio:t,rotation:s}=e||{},i={};return t&&(i.aspectratio="t"),s&&(i.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:i}}};function aC(e,t,s,i,r){return(e-t)/(s-t)*(r-i)+i}var nC=(e,t)=>{let s;const{recolor:i,brightness:r,contrast:a,id:n}=e;if(i&&(s={},(i==="Washout"||i==="Grayscale")&&(s.gain="19661f",s.blacklevel="22938f"),(i==="Black & White"||i==="Grayscale")&&(s.grayscale="t",i==="Black & White"&&(s.bilevel="t"))),!i||i==="Grayscale"){if(s||(s={}),a!=null&&a!==50){let o="1";a>=0&&(a<50?o=String(a/50):a<100?o=String(50/(100-a)):a===100&&(o="2147483647f")),s.gain=o}r!=null&&r!==50&&(s.blacklevel=aC(r,0,100,-.5,.5).toString())}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:n}}],rawMap:s}}},oC=()=>{const e=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[sC(),iC(e),rC(),ko({aspectratio:!0})]}},Go=e=>Math.floor((e??0)*.74999943307122),lC=(e,t)=>{const{width:s=0,height:i=0,altText:r}=e,a=Go(s),n=Go(i);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${a}pt; height: ${n}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:r}},children:[nC(e,t+1),ko({rotation:!0})]}},cC={getTemplate(e){const t=Ge.get(e.sheetIndex)||[],s=[tC(),oC(),...t.map((i,r)=>lC(i,r))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:s}}},dC=cC,uC={getTemplate(e,t){const s=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:s,"r:id":`rId${s}`}}}}},hC=uC,pC={getTemplate(e){return{name:"sheets",children:e.map((t,s)=>hC.getTemplate(t,s))}}},gC=pC,fC={getTemplate(e,t){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:t}}}]},gC.getTemplate(e)]}}},mC=fC;import{_escapeString as CC}from"ag-grid-community";var vC=e=>Math.ceil((e-12)/7+1),SC={getTemplate(e){const{min:t,max:s,outlineLevel:i,s:r,width:a,hidden:n,bestFit:o}=e;let l=1,c="0";return a>1&&(l=vC(a),c="1"),{name:"col",properties:{rawMap:{min:t,max:s,outlineLevel:i??void 0,width:l,style:r,hidden:n?"1":"0",bestFit:o?"1":"0",customWidth:c}}}}},bC=SC,yC={getTemplate(e){return{name:"mergeCell",properties:{rawMap:{ref:e}}}}},wC=yC;import{_escapeString as Oo}from"ag-grid-community";var xC=e=>{const t=e.charAt(0).toLowerCase();return t==="s"?"inlineStr":t},FC={getTemplate(e,t,s){const{ref:i,data:r,styleId:a}=e,{type:n,value:o}=r||{type:"empty",value:null};let l=n;n==="f"?l="str":n.charAt(0)===n.charAt(0).toUpperCase()&&(l=xC(n));const c={name:"c",properties:{rawMap:{r:i,t:l==="empty"?void 0:l,s:a?Gm(a,s):void 0}}};if(l==="empty")return c;let d;return l==="str"&&n==="f"?d=[{name:"f",textNode:Oo(ci(o))}]:l==="inlineStr"?d=[{name:"is",children:[{name:"t",textNode:Oo(ci(o))}]}]:d=[{name:"v",textNode:o}],Object.assign({},c,{children:d})}},RC=FC,AC=(e,t)=>{const s=[];let i=0;for(let r=0;r<e.length;r++){const a=e[r];a.mergeAcross&&(s.push({pos:r,excelPos:i}),i+=a.mergeAcross),i++}if(s.length)for(let r=s.length-1;r>=0;r--){const a=[],n=e[s[r].pos];for(let o=1;o<=n.mergeAcross;o++)a.push({ref:`${ut(s[r].excelPos+1+o)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});a.length&&e.splice(s[r].pos+1,0,...a)}},MC=e=>e.data?.value!==""||e.styleId!==void 0,TC={getTemplate(e,t,s){const{collapsed:i,hidden:r,height:a,outlineLevel:n,cells:o=[]}=e;AC(o,t);const l=o.filter(MC).map((c,d)=>RC.getTemplate(c,d,s));return{name:"row",properties:{rawMap:{r:t+1,collapsed:i?"1":"0",hidden:r?"1":"0",ht:a,customHeight:a!=null?"1":"0",spans:"1:1",outlineLevel:n||void 0}},children:l}}},PC=TC,IC=(e,t,s)=>{const i=[],r=[];e.forEach((o,l)=>{const c=o.cells;let d=0,u;c.forEach((h,p)=>{const g=p+d+1,f=ut(g),m=l+1;if(h.mergeAcross){d+=h.mergeAcross;const v=ut(p+d+1);i.push(`${f}${m}:${v}${m}`)}t[g-1]||(t[g-1]={});const{collapsibleRanges:C}=h;C&&C.forEach(v=>{r.push([g+v[0],g+v[1]])}),u=t[g-1],u.min=g,u.max=g,h.ref=`${f}${m}`})}),r.sort((o,l)=>o[0]!==l[0]?o[0]-l[0]:l[1]-o[1]);const a=new Map,n=new Map;return r.filter(o=>{const l=o.toString();return a.get(l)?!1:(a.set(l,!0),!0)}).forEach(o=>{const l=t.find(d=>d.min==o[0]&&d.max==o[1]),c=n.get(o[0]);t.push({min:o[0],max:o[1],outlineLevel:s?void 0:c||1,width:(l||{width:100}).width}),n.set(o[0],(c||0)+1)}),i},EC=e=>!e||e!=="Portrait"&&e!=="Landscape"?"portrait":e.toLocaleLowerCase(),DC=e=>{if(e==null)return 1;const s=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return s===-1?1:s+1},LC=e=>{const t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(const s of Object.keys(t))e=e.replace(s,t[s]);return e},kC=e=>e==="Center"?"C":e==="Right"?"R":"L",GC=(e,t)=>(t&&(e+="&"",e+=t.fontName||"Calibri",t.bold!==t.italic?e+=t.bold?",Bold":",Italic":t.bold?e+=",Bold Italic":e+=",Regular",e+=""",t.size&&(e+=`&${t.size}`),t.strikeThrough&&(e+="&S"),t.underline&&(e+=`&${t.underline==="Double"?"E":"U"}`),t.color&&(e+=`&K${t.color.replace("#","").toUpperCase()}`)),e),OC=(e,t,s)=>e.reduce((i,r,a)=>{const n=kC(r.position),o=GC(`${i}&${n}`,r.font),l=["Left","Center","Right"];r.position||(r.position=l[a]);const{image:c}=r;if(r.value==="&[Picture]"&&c){const d=`${n}${t}${s}`;_o(c,d)}return`${o}${CC(LC(r.value))}`},""),_C=e=>{const t=["all","first","even"],s=[];return t.forEach(i=>{const r=e[i],a=i==="all"?"odd":i;if(r)for(const n of Object.keys(r)){const o=r[n],l=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,c=n[0].toUpperCase();if(o){const d=i==="all"?"":i.toUpperCase();s.push({name:`${a}${l}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:OC(o,c,d)})}}}),s},NC=e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(s=>bC.getTemplate(s))}),t),BC=(e,t)=>s=>(e.length&&s.children.push({name:"sheetData",children:e.map((i,r)=>PC.getTemplate(i,r,t))}),s),VC=e=>{const t=e.length;if(!t)return"";const s=new Array(t+1);s[0]=t;for(let r=1;r<=t;r++)s[r]=e.charCodeAt(r-1)&255;let i=0;for(let r=s.length-1;r>=0;r--){const a=s[r],n=i&16384?1:0,o=i<<1&32767;i=(n|o)^a}return(i^52811).toString(16).toUpperCase().padStart(4,"0")},HC=e=>t=>{if(!e)return t;const s=typeof e=="boolean"?{}:e,i={sheet:1},r=s.password?VC(s.password):"";r&&(i.password=r);const a={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(a).forEach(n=>{const o=s[n];o==null||o===a[n]||(i[n]=o?0:1)}),t.children.push({name:"sheetProtection",properties:{rawMap:i}}),t},zC=e=>t=>(e.length&&t.children.push({name:"mergeCells",properties:{rawMap:{count:e.length}},children:e.map(s=>wC.getTemplate(s))}),t),UC=e=>t=>{const{top:s=.75,right:i=.7,bottom:r=.75,left:a=.7,header:n=.3,footer:o=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:r,footer:o,header:n,left:a,right:i,top:s}}}),t},WC=e=>t=>(e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:EC(e.orientation),paperSize:DC(e.pageSize)}}}),t),KC=e=>t=>{if(!e)return t;const s=e.first!=null?1:0,i=e.even!=null?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:s,differentOddEven:i}},children:_C(e)}),t},$C=e=>t=>(e&&t.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}]}),t),jC=e=>t=>(je.get(e)?.length&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),YC=e=>t=>(Ge.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),qC=(e=0,t=0)=>{const s=e>0||t>0;return s?[{name:"pane",properties:{rawMap:{state:s?"frozen":void 0,topLeftCell:s?`${ut(e+1)}${t+1}`:void 0,xSplit:e===0?void 0:e,ySplit:t===0?void 0:t}}}]:void 0},XC=(e=!1,t,s)=>i=>(i.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:e===!0?"1":"0",workbookViewId:"0"}},children:qC(t,s)}]}),i),ZC=()=>e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),JC=e=>t=>{const s=e.reduce((i,r)=>r.outlineLevel&&r.outlineLevel>i?r.outlineLevel:i,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:s||void 0}}}),t},QC={getTemplate(e){const{worksheet:t,currentSheet:s,config:i}=e,{margins:r={},pageSetup:a,headerFooterConfig:n,suppressColumnOutline:o,rightToLeft:l,frozenRowCount:c,frozenColumnCount:d,protectSheet:u}=i,{table:h}=t,{rows:p,columns:g}=h,f=g?.length?IC(p,g,!!o):[],m=Fe.get(s),{children:C}=[ZC(),XC(l,d,c),JC(p),NC(g),BC(p,s+1),HC(u),zC(f),UC(r),WC(a),KC(n),jC(s),YC(s),$C(m)].reduce((v,S)=>S(v),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:C}}},ev=QC,ht=new Map,ge=[],pt=[],gt=new Map,$e=new Map,je=new Map,Ge=new Map,Et=new Map,Dt=new Map,Fe=new Map,tv="AG-GRID-TABLE",Ur="SINGLE_SHEET";function sv(){return Ur}function iv(e){Ur=e}function rv(e,t,s){cv(t),Om(e,ge.length);const i=Object.assign({},s);s.exportAsExcelTable&&s.pivotModeActive&&(_r(163,{featureName:"pivot mode"}),i.exportAsExcelTable=!1),ov(t,i);const r=Mv(t,i);return Tv(r),r}function av(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function nv(e,t){if(Fe.has(e)){_r(164);return}Fe.set(e,t)}function ov(e,t){const{exportAsExcelTable:s,prependContent:i,appendContent:r,headerRowCount:a=0}=t;if(!s)return;const n=typeof s=="boolean"?{}:s,{name:o,showColumnStripes:l,showRowStripes:c,showFilterButton:d,highlightFirstColumn:u,highlightLastColumn:h}=n,p=av(o||tv),g=ge.length-1,{table:f}=e,{rows:m,columns:C}=f,v=i?i.length:0,S=r?r.length:0,b=m.length,y=C.length,w=[],M=[];for(let T=0;T<y;T++){const F=C[T];w.push(F.displayName||""),M.push(d==="match"||d===void 0?F.filterAllowed??!1:d)}if(!w?.length||!b||!p){_r(165);return}nv(g,{name:`table${Fe.size+1}`,displayName:p,columns:w,showFilterButtons:M,rowRange:[a+v,a+(b-a)-S],showRowStripes:c??!0,showColumnStripes:l??!1,highlightFirstColumn:u??!1,highlightLastColumn:h??!1})}function _o(e,t){const s=ge.length-1,i=e;i.headerFooterPosition=t,No({imageToAdd:i,idx:s});let r=Ge.get(s);r||(r=[],Ge.set(s,r)),r.find(a=>a.id===e.id)||r.push(e)}function lv(e,t,s,i,r){const a=ge.length,{row:n,column:o}=e.position||{},l=e;i&&(t!=null&&s!=null&&(!n||!o)&&(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:i.indexOf(s)+1})),hf(l,i),pf(l,r)),No({imageToAdd:l,idx:a});let c=Dt.get(a);c||(c=new Map,Dt.set(a,c));const d=je.get(a);d?d.push(l):je.set(a,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}function No(e){const{imageToAdd:t,idx:s}=e,i=$e.get(t.id);if(i){const r=i.find(a=>a.sheetId===s);r?r.image.push(t):i.push({sheetId:s,image:[t]})}else $e.set(t.id,[{sheetId:s,image:[t]}]),Et.set(t.id,{type:t.imageType,index:Et.size})}function cv(e){const t=Cf(e.name)||"";let s="";for(;ge.indexOf(`${t}${s}`)!==-1;)s===""?s="_1":s=`_${parseInt(s.slice(1),10)+1}`;e.name=`${t}${s}`,ge.push(e.name)}function dv(e){return ht.has(e)?ht.get(e):(ht.set(e,ht.size),ht.size-1)}function uv(){ht.clear(),$e.clear(),je.clear(),Ge.clear(),Et.clear(),Dt.clear(),Fe.clear(),ge=[],pt=[],gt=new Map,Ur="SINGLE_SHEET"}function hv(e){return ie(mC.getTemplate(ge,e))}function pv(e){return ie(_m.getTemplate(e))}function gv(){return ie(Hf.getTemplate(ht))}function fv(e){return ie(xf.getTemplate(e))}function mv(e){return ie(Mf.getTemplate(e))}function Cv(e,t){return ie(yf.getTemplate({sheetLen:e,hasCustomProperties:t}))}function vv(e){const t=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];e&&t.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});const s=us.getTemplate(t);return ie(s)}function Sv(){return ie(eC.getTemplate())}function bv(e,t){return ie(Vm.getTemplate(e,t))}function yv(e){const t=new Array(e).fill(void 0).map((i,r)=>({Id:`rId${r+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${r+1}.xml`})),s=us.getTemplate([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return ie(s)}function wv(e){return ie(Of.getTemplate({sheetIndex:e}))}function xv(e){const t=Dt.get(e)||[],s=[];for(const[i,r]of t){const{index:a,type:n}=r;s.push({Id:`rId${a+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${Et.get(i).index+1}.${di(n)}`})}return ie(us.getTemplate(s))}function Fv(e){return ie(dC.getTemplate({sheetIndex:e}),!0)}function Rv(e){const t=Ge.get(e)||[],s=[];for(let i=0;i<t.length;i++){const r=t[i],a=Et.get(r.id);if(!a)continue;const{index:n,type:o}=a;s.push({Id:`rId${i+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${n+1}.${di(o)}`})}return ie(us.getTemplate(s))}function Av({drawingIndex:e,vmlDrawingIndex:t,tableName:s}={}){if(e===void 0&&t===void 0&&s===void 0)return"";const i=[];e!=null&&i.push({Id:`rId${i.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),t!=null&&i.push({Id:`rId${i.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),s!=null&&i.push({Id:`rId${i.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${s}.xml`});const r=us.getTemplate(i);return ie(r)}function Mv(e,t){return ie(ev.getTemplate({worksheet:e,currentSheet:ge.length-1,config:t}))}var fi=(e,t)=>{if(!e.size)return;const s=new Map;t.forEach((i,r)=>{e.has(i)&&s.set(r,e.get(i))}),e.clear(),s.forEach((i,r)=>e.set(r,i))},Tv=e=>{const t=gt.get(e)??[];t.push(ge.length-1),gt.set(e,t),pt.push(e)},Pv=e=>{const t=new Map(gt),s=[];for(const i of e){const r=t.get(i);if(!r?.length)return null;const a=r.shift();s.push(a),t.set(i,r)}return s},Iv=e=>{if(!e.length||pt.length===0)return null;const t=new Set,s=[];for(const i of e){const r=pt.findIndex((a,n)=>!t.has(n)&&a===i);if(r===-1)return null;t.add(r),s.push(r)}return s},Ev=e=>{const t=new Map;e.forEach((s,i)=>t.set(s,i)),ge=e.map(s=>ge[s]),pt=e.map(s=>pt[s]),fi(je,e),fi(Ge,e),fi(Fe,e),fi(Dt,e),$e.forEach(s=>{s.forEach(i=>{const r=t.get(i.sheetId);r!=null&&(i.sheetId=r)})}),gt=new Map,pt.forEach((s,i)=>{const r=gt.get(s)??[];r.push(i),gt.set(s,r)})},Dv=e=>{if(e.length<=1)return;const t=Pv(e)??Iv(e);t&&Ev(t)},mi=class{getStringPosition(e){return dv(e)}addBodyImageToMap(e,t,s,i,r){lv(e,t,s,i,r)}addHeaderFooterImageToMap(e,t){_o(e,t)}addWorksheet(e,t,s){return rv(e,t,s)}syncOrderWithSheetData(e){Dv(e)}reset(){uv()}setFactoryMode(e){iv(e)}getFactoryMode(){return sv()}getSheetNames(){return[...ge]}};import{_errMsg as Lv}from"ag-grid-community";var kv=async e=>{let t=0;const s=[],i=new WritableStream({write:n=>{s.push(n),t+=n.length}}),r=new ReadableStream({start:n=>{const o=new FileReader;o.onload=l=>{l.target?.result&&n.enqueue(l.target.result),n.close()},o.readAsArrayBuffer(e)}}),a=new window.CompressionStream("deflate-raw");return await r.pipeThrough(a).pipeTo(i),{size:t,content:new Blob(s)}},Gv=async e=>{const t=new Blob([e]),{size:s,content:i}=await kv(t),r=new Uint8Array(await i.arrayBuffer());return{size:s,content:r}},Ov=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},_v=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function re(e,t){let s="";for(let i=0;i<t;i++)s+=String.fromCharCode(e&255),e>>>=8;return s}var Bo=e=>{if(!e.length)return 0;let t=-1,s=0,i=0,r=0;for(let a=0;a<e.length;a++)s=e[a],i=(t^s)&255,r=Nv[i],t=t>>>8^r;return t^-1},Vo=e=>e.length?Bo(typeof e=="string"?new TextEncoder().encode(e):e):0,Nv=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function Bv(e){const t=String.fromCharCode;function s(u){const h=[];if(!u)return[];const p=u.length;let g=0,f,m;for(;g<p;)f=u.charCodeAt(g++),f>=55296&&f<=56319&&g<p?(m=u.charCodeAt(g++),(m&64512)==56320?h.push(((f&1023)<<10)+(m&1023)+65536):(h.push(f),g--)):h.push(f);return h}function i(u){if(u>=55296&&u<=57343)throw new Error(Lv(255,{point:u}))}function r(u,h){return t(u>>h&63|128)}function a(u){if(!(u&4294967168))return t(u);let h="";return u&4294965248?u&4294901760?u&4292870144||(h=t(u>>18&7|240),h+=r(u,12),h+=r(u,6)):(i(u),h=t(u>>12&15|224),h+=r(u,6)):h=t(u>>6&31|192),h+=t(u&63|128),h}const n=s(e),o=n.length;let l=-1,c,d="";for(;++l<o;)c=n[l],d+=a(c);return d}var Ho=(e,t,s,i,r,a)=>{const{content:n,path:o,created:l}=e,c=Ov(l),d=_v(l),u=Vo(r),h=a!==void 0?a:i,p=Bv(o),g=p!==o;let f="";if(g){const S=re(1,1)+re(Vo(p),4)+p;f="up"+re(S.length,2)+S}const m="\0"+(g?"\0\b":"\0\0")+re(t?8:0,2)+re(c,2)+re(d,2)+re(h?u:0,4)+re(a??i,4)+re(i,4)+re(p.length,2)+re(f.length,2),C="PK"+m+p+f,v="PK\0"+m+"\0\0\0\0\0\0"+(n?"\0\0\0\0":"\0\0\0")+re(s,4)+p+f;return{localFileHeader:Uint8Array.from(C,S=>S.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,S=>S.charCodeAt(0))}},zo=e=>{let t;if(typeof e=="string"){const s=atob(e.split(";base64,")[1]);t=Uint8Array.from(s,i=>i.charCodeAt(0))}else t=e;return{size:t.length,content:t}},Vv=async e=>{const{content:t}=e,{size:s,content:i}=t?zo(t):{size:0,content:Uint8Array.from([])};let r,a,n=!1;if(e.type==="file"&&i&&s>0){const l=await Gv(i);r=l.content,a=l.size,n=!0}return{rawContent:i,rawSize:s,deflatedContent:r,deflatedSize:a,isCompressed:n}},Hv=(e,t)=>{const{content:s}=e,{content:i}=s?zo(s):{content:Uint8Array.from([])};return{...Ho(e,!1,t,i.length,i,void 0),content:i,isCompressed:!1}},zv=(e,t,s)=>{const i="PK\0\0\0\0"+re(e,2)+re(e,2)+re(t,4)+re(s,4)+"\0\0";return Uint8Array.from(i,r=>r.charCodeAt(0))},Uo=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}addFile(e,t,s=!1){this.files.push({path:e,created:new Date,content:s?t:new TextEncoder().encode(t),isBase64:s,type:"file"})}async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,s=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;t+=d.length+h.length,s+=u.length}const i=new Uint8Array(t),r=new Uint8Array(s);let a=0,n=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;i.set(d,a),a+=d.length,i.set(h,a),a+=h.length,r.set(u,n),n+=u.length}const o=zv(e.length,s,t),l=new Uint8Array(i.length+r.length+o.length);return l.set(i),l.set(r,i.length),l.set(o,i.length+r.length),l}async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=await Promise.all(e.map(Vv)),s=[];let i=0;for(let r=0;r<e.length;r++){const a=e[r],{rawContent:n,rawSize:o,deflatedContent:l,deflatedSize:c,isCompressed:d}=t[r],u=Ho(a,d,i,o,n,c),h=l??n;s.push({...u,content:h,isCompressed:d}),i+=u.localFileHeader.length+h.length}return this.packageFiles(s)}buildFileStream(){const e=[...this.folders,...this.files],t=[];let s=0;for(const i of e){const r=Hv(i,s),{localFileHeader:a,content:n}=r;t.push(r),s+=a.length+n.length}return this.packageFiles(t)}},Uv=e=>{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!$e.size)return;e.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;$e.forEach(s=>{const i=s[0].image[0],{base64:r,imageType:a}=i;e.addFile(`xl/media/image${++t}.${di(a)}`,r,!0)})},Wv=(e,t)=>{let s=0,i=0;for(let r=0;r<t.length;r++){const a=t[r];e.addFile(`xl/worksheets/sheet${r+1}.xml`,a,!1);const n=$e.size>0&&je.has(r),o=Fe.size>0&&Fe.get(r),l=$e.size&&Ge.has(r);if(!n&&!o&&!l)continue;let c,d,u;n&&(Kv(e,r,s),d=s,s++),l&&($v(e,r,i),u=i,i++),o&&(c=o.name);const h=`xl/worksheets/_rels/sheet${r+1}.xml.rels`;e.addFile(h,Av({tableName:c,drawingIndex:d,vmlDrawingIndex:u}))}},Kv=(e,t,s)=>{const i="xl/drawings",r=`${i}/drawing${s+1}.xml`,a=`${i}/_rels/drawing${s+1}.xml.rels`;e.addFile(a,xv(t)),e.addFile(r,wv(t))},$v=(e,t,s)=>{const i="xl/drawings",r=`${i}/vmlDrawing${s+1}.vml`,a=`${i}/_rels/vmlDrawing${s+1}.vml.rels`;e.addFile(r,Fv(t)),e.addFile(a,Rv(t))},jv=e=>{const t=Fe,s=Array.from(t.keys());for(let i=0;i<s.length;i++){const r=s[i],a=t.get(r);a&&e.addFile(`xl/tables/${a.name}.xml`,bv(a,i))}},Yv=(e,t,s,i,r,a)=>{const n=!!a&&Object.keys(a).some(o=>a[o]!=null);e.addFile("xl/workbook.xml",hv(r)),e.addFile("xl/styles.xml",pv(t)),e.addFile("xl/sharedStrings.xml",gv()),e.addFile("xl/theme/theme1.xml",Sv()),e.addFile("xl/_rels/workbook.xml.rels",yv(i)),e.addFile("docProps/core.xml",fv(s)),n&&e.addFile("docProps/custom.xml",mv(a)),e.addFile("[Content_Types].xml",Cv(i,n)),e.addFile("_rels/.rels",vv(n))},Wo=(e,t,s={},i)=>{if(!t||t.length===0)return wo(159),i.reset(),!1;i.syncOrderWithSheetData(t);const{fontSize:r=11,author:a="AG Grid",activeTab:n=0,customMetadata:o}=s,l=t.length,c=Math.max(Math.min(n,l-1),0);return Uv(e),jv(e),Wv(e,t),Yv(e,r,a,l,c,o),i.reset(),!0},Wr=(e,t=new mi)=>{const{data:s,fontSize:i,author:r,activeSheetIndex:a,customMetadata:n}=e,o=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new Uo;return Wo(l,s,{author:r,fontSize:i,activeTab:a,customMetadata:n},t)?l.getZipFile(o):Promise.resolve(void 0)},Kr=(e,t=new mi)=>{const{data:s,fontSize:i,author:r,activeSheetIndex:a,customMetadata:n}=e,o=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new Uo;if(Wo(l,s,{author:r,fontSize:i,activeTab:a,customMetadata:n},t))return l.getUncompressedZipFile(o)},qv=e=>{const{fileName:t="export.xlsx"}=e,s=new mi;Wr(e,s).then(i=>{if(i){const r=typeof t=="function"?t():t;Gr(r,i)}})},Xv=class extends Jg{constructor(){super(...arguments),this.beanName="excelCreator",this.workbook=new mi}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){wo(160);return}const t=()=>{const i=this.getMergedParams(e),r=this.getData(i),{fontSize:a,author:n,mimeType:o,customMetadata:l}=i,c={data:[r],fontSize:a,author:n,mimeType:o,customMetadata:l};this.packageCompressedFile(c).then(d=>{if(d){const{fileName:u}=i,h=typeof u=="function"?u(yo(this.gos,{})):u;Gr(this.getFileName(h),d)}})},{overlays:s}=this.beans;s?s.showExportOverlay(t):t()}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),s=this.getData(t),{fontSize:i,author:r,mimeType:a,customMetadata:n}=t,o={data:[s],fontSize:i,author:r,mimeType:a,customMetadata:n};return this.packageFile(o)}setFactoryMode(e){this.workbook.setFactoryMode(e)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return Kr(e,this.workbook)}exportMultipleSheetsAsExcel(e){Wr(e,this.workbook).then(t=>{const{fileName:s="export.xlsx"}=e;if(t){const i=typeof s=="function"?s():s;Gr(i,t)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,formula:a,gos:n}=this.beans,o=n.get("excelStyles")||[],l=this.createStyleLinker(o),c={...e,colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,formulaSvc:a,gos:n,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:o,rightToLeft:e.rightToLeft??n.get("enableRtl"),styleLinker:l,headerRowCount:ef(t),pivotModeActive:t.isPivotActive(),workbook:this.workbook};return new mf(c)}createStyleLinker(e){const t=[],s=new Set,i=new Map;e.forEach((n,o)=>{t.push(n.id),s.add(n.id),i.set(n.id,o)});const{gos:r,cellStyles:a}=this.beans;return n=>{const{rowType:o,rowIndex:l,value:c,column:d,columnGroup:u,node:h}=n,p=o==="HEADER",g=o==="HEADER_GROUPING",f=p?d:u;let m=[];if(p||g)return m.push("header"),g&&m.push("headerGroup"),f&&(m=m.concat(Qg(f.getDefinition(),r,d||null,u||null))),m;const C=["cell"];if(!t.length)return C;const v=d.getDefinition();return a?.processAllCellClasses(v,yo(r,{value:c,data:h.data,node:h,colDef:v,column:d,rowIndex:l}),S=>{s.has(S)&&C.push(S)}),C.sort((S,b)=>{const y=i.get(S)??-1,w=i.get(b)??-1;return y===w?0:y<w?-1:1})}}isExportSuppressed(){return this.gos.get("suppressExcelExport")}packageCompressedFile(e){return Wr(e,this.workbook)}packageFile(e){return Kr(e,this.workbook)}};import{KeyCode as we,RefPlaceholder as Zv,_AgTabGuardComp as Jv,_createAgElement as Qv,_getAriaPosInSet as eS,_observeResize as tS,_requestAnimationFrame as Ko,_setAriaLabel as sS,_setAriaPosInSet as iS,_setAriaRole as rS,_setAriaSetSize as aS,_waitUntil as nS}from"ag-grid-community";var oS=":where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:auto;position:relative;width:100%}.ag-virtual-list-container{overflow:hidden;position:relative}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}";function lS(e){return{tag:"div",cls:`ag-virtual-list-viewport ag-${e}-virtual-list-viewport`,role:"presentation",children:[{tag:"div",ref:"eContainer",cls:`ag-virtual-list-container ag-${e}-virtual-list-container`}]}}var $o=class extends Jv{constructor(e,t){super(lS(t?.cssIdentifier||"default")),this.stopPropagationCallbacks=e,this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=Zv,this.awaitStableCallbacks=[],this.registerCSS(oS);const{cssIdentifier:s="default",ariaRole:i="listbox",listName:r,moveItemCallback:a}=t||{};this.cssIdentifier=s,this.ariaRole=i,this.listName=r,this.moveItemCallback=a}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}refreshAriaProperties(){const t=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;rS(s,this.model?.getRowCount()>0?this.ariaRole:"presentation"),sS(s,t)}addResizeObserver(){const e=()=>Ko(this.beans,()=>this.drawVirtualRows()),t=tS(this.beans,this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=eS(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){const{key:t,shiftKey:s}=e;switch(t){case we.UP:case we.DOWN:{const i=t===we.UP;e.preventDefault(),s?this.moveItem(i):this.navigate(i)}break;case we.PAGE_HOME:case we.PAGE_END:case we.PAGE_UP:case we.PAGE_DOWN:this.navigateToPage(t)!==null&&e.preventDefault();break}}onTabKeyDown(e){this.stopPropagationCallbacks?.stopPropagation(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(this.lastFocusedRowIndex==null)return;const t=this.lastFocusedRowIndex+(e?-1:1);if(!(t<0||t>=this.model.getRowCount()))return t}moveItem(e){if(!this.moveItemCallback)return;const t=this.getComponentAt(this.lastFocusedRowIndex);t&&this.moveItemCallback(t,e)}navigate(e){const t=this.getNextRow(e);t!==void 0&&this.focusRow(t)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const i=this.model.getRowCount()-1;let r=-1;return e===we.PAGE_HOME?r=0:e===we.PAGE_END?r=i:e===we.PAGE_DOWN?r=Math.min(t+this.pageSize,i):e===we.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),r===-1?null:(s?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),Ko(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}getItemHeight(){return this.isHeightFromTheme?this.beans.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return!1;const i=e*this.rowHeight,r=i+this.rowHeight,a=this.getGui(),n=a.scrollTop,o=a.offsetHeight,l=n+o,c=t?0:this.rowHeight,d=n>i+c,u=l<r-c;if(d)return a.scrollTop=i,!0;if(u){const h=r-o;return a.scrollTop=h,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,this.refreshAriaProperties(),this.awaitStable(()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;const t=this.model.getRowCount();nS(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;const s=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(const i of s)i()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),s=t.scrollTop,i=s+t.offsetHeight;if(s===i)this.clearVirtualRows();else{const r=Math.floor(s/this.rowHeight),a=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(r,a,e)}}ensureRowsRendered(e,t,s){this.renderedRows.forEach((i,r)=>{(r<e||r>t)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),s&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),s=this.ariaRole==="tree"?"treeitem":"option",i=Qv({tag:"div",cls:`ag-virtual-list-item ag-${this.cssIdentifier}-virtual-list-item`,role:s,attrs:{tabindex:"-1"}});aS(i,this.model.getRowCount()),iS(i,e+1),i.style.height=`${this.rowHeight}px`,i.style.top=`${this.rowHeight*e}px`;const r=this.componentCreator(t,i);r.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(r.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:r,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);t.eDiv.remove(),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{if(s>=e)this.removeRow(s);else{const i=this.model.getRow(s);this.model.areRowsEqual?.(t.value,i)?this.componentUpdater(i,t.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}};import{AutoScrollService as cS,_AgBeanStub as dS,_radioCssClass as jo}from"ag-grid-community";var uS='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',$r="ag-list-item-hovered",Yo=class extends dS{constructor(e,t,s){super(),this.comp=e,this.virtualList=t,this.params=s,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(uS,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:t=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:t=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new cS({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),s=this.virtualList.getComponentAt(t.rowIndex);if(!s)return;const i=s.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,jo(i,$r),jo(i,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),s=Number.parseFloat(window.getComputedStyle(t).paddingTop),i=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),a=Math.max(0,(e.y-s+r)/i),n=this.params.getNumRows(this.comp)-1,o=Math.min(n,a)|0;return{rowIndex:o,position:Math.round(a)>a||a>n?"bottom":"top",component:this.virtualList.getComponentAt(o)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties())}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){const e=this.virtualList.getGui();for(const t of e.querySelectorAll(`.${$r}`))for(const s of[$r,"ag-item-highlight-top","ag-item-highlight-bottom"])t.classList.remove(s);this.lastHoveredListItem=null}};import{AgAbstractLabel as hS,AgInputNumberFieldSelector as pS,RefPlaceholder as jr}from"ag-grid-community";import{AgAbstractInputField as gS}from"ag-grid-community";var qo=class extends gS{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:s}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(s||1)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>{const t=e.target.value;this.setValue(t)}})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());const s=super.setValue(e,t);return this.eInput.value=e,s}},Xo={selector:"AG-INPUT-RANGE",component:qo},ue=class extends hS{constructor(e){super(e,`<div class="ag-slider">
|
||
<label data-ref="eLabel"></label>
|
||
<div class="ag-wrapper ag-slider-wrapper">
|
||
<ag-input-range data-ref="eSlider"></ag-input-range>
|
||
<ag-input-number-field data-ref="eText"></ag-input-number-field>
|
||
</div>
|
||
</div>`,[Xo,pS]),this.eLabel=jr,this.eSlider=jr,this.eText=jr,this.labelAlignment="top"}postConstruct(){super.postConstruct(),this.eSlider.addCss("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:s,step:i,value:r,onValueChange:a}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),s!=null&&this.setTextFieldWidth(s),i!=null&&this.setStep(i),r!=null&&this.setValue(r),a!=null&&this.onValueChange(a)}onValueChange(e){return this.addManagedListeners(this.eText,{fieldValueChanged:()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}}),this.addManagedListeners(this.eSlider,{fieldValueChanged:()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}},le={selector:"AG-SLIDER",component:ue};import{AgPickerField as fS,_createElement as Zo}from"ag-grid-community";import{KeyCode as Oe,RefPlaceholder as _e,_AgComponentStub as mS,_exists as CS,_setDisplayed as vS}from"ag-grid-community";import{AgInputTextField as SS,RefPlaceholder as bS}from"ag-grid-community";var yS=class extends SS{constructor(){super({template:{tag:"div",cls:"ag-color-input",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:"input",ref:"eInput",cls:"ag-input-field-input"},{tag:"div",ref:"eColor",cls:"ag-color-input-color"}]}]}}),this.eColor=bS}wireBeans(e){this.color=e.agChartsExports._Util.Color}setColor(e){const t=e.toRgbaString();this.setValue(this.color.fromString(t).toHexString().toUpperCase(),!0),this.eColor.style.backgroundColor=t}setValue(e,t){const s=this.color.validColorString(e??"");return this.eInput.setCustomValidity(s?"":this.getLocaleTextFunc()("invalidColor","Color value is invalid")),super.setValue(e,t),s&&!t&&this.dispatchLocalEvent({type:"colorChanged"}),this}onColorChanged(e){this.addManagedListeners(this,{colorChanged:()=>e(this.color.fromString(this.value))})}},wS={selector:"AG-COLOR-INPUT",component:yS},Jo=8,Ci=[],xS=class extends mS{constructor(e){super(`<div class="ag-color-panel" tabindex="-1">
|
||
<div data-ref="spectrumColor" class="ag-spectrum-color">
|
||
<div class="ag-spectrum-sat ag-spectrum-fill">
|
||
<div data-ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">
|
||
<div data-ref="spectrumDragger" class="ag-spectrum-dragger"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ag-spectrum-tools">
|
||
<div data-ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">
|
||
<div class="ag-spectrum-hue-background"></div>
|
||
<div data-ref="spectrumHueSlider" class="ag-spectrum-slider"></div>
|
||
</div>
|
||
<div data-ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">
|
||
<div class="ag-spectrum-alpha-background"></div>
|
||
<div data-ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>
|
||
</div>
|
||
<ag-color-input data-ref="colorInput"></ag-color-input>
|
||
<div data-ref="recentColors" class="ag-recent-colors"></div>
|
||
</div>
|
||
</div>`,[wS]),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.spectrumColor=_e,this.spectrumVal=_e,this.spectrumDragger=_e,this.spectrumHue=_e,this.spectrumHueSlider=_e,this.spectrumAlpha=_e,this.spectrumAlphaSlider=_e,this.colorInput=_e,this.recentColors=_e,this.picker=e.picker}wireBeans(e){this._Color=e.agChartsExports._Util.Color}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key===Oe.ENTER&&!e.defaultPrevented&&this.destroy()}),this.addManagedListeners(this.spectrumColor,{keydown:e=>this.moveDragger(e)}),this.addManagedListeners(this.spectrumAlphaSlider,{keydown:e=>this.moveAlphaSlider(e)}),this.addManagedListeners(this.spectrumHueSlider,{keydown:e=>this.moveHueSlider(e)}),this.addManagedListeners(this.spectrumVal,{mousedown:this.onSpectrumDraggerDown.bind(this)}),this.addManagedListeners(this.spectrumHue,{mousedown:this.onSpectrumHueDown.bind(this)}),this.addManagedListeners(this.spectrumAlpha,{mousedown:this.onSpectrumAlphaDown.bind(this)}),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListeners(document,{mouseup:this.onMouseUp.bind(this)}),this.colorInput.onColorChanged(this.setColor.bind(this)),this.addManagedListeners(this.recentColors,{click:this.onRecentColorClick.bind(this),keydown:e=>{(e.key===Oe.ENTER||e.key===Oe.SPACE)&&(e.preventDefault(),this.onRecentColorClick(e))}})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){e.preventDefault(),this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let s,i;if(e instanceof MouseEvent)s=e.clientX-t.left,i=e.clientY-t.top;else{const r=e.key===Oe.LEFT,a=e.key===Oe.RIGHT,n=e.key===Oe.UP,o=e.key===Oe.DOWN,l=n||o,c=r||a;if(!l&&!c)return;e.preventDefault();const{x:d,y:u}=this.getSpectrumValue();s=d+(c?r?-5:5:0),i=u+(l?n?-5:5:0)}s=Math.max(s,0),s=Math.min(s,t.width),i=Math.max(i,0),i=Math.min(i,t.height),this.setSpectrumValue(s/t.width,1-i/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const s=this.moveSlider(this.spectrumHueSlider,e);s!=null&&(this.H=1-s/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const s=this.moveSlider(this.spectrumAlphaSlider,e);s!=null&&(this.A=s/t.width,this.update())}moveSlider(e,t){const s=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();if(!e||!i)return null;const r=s.width/2;let a;if(t instanceof MouseEvent)a=Math.floor(t.clientX-i.left);else{const n=t.key===Oe.LEFT,o=t.key===Oe.RIGHT;if(!n&&!o)return null;t.preventDefault();const l=n?-5:5;a=parseFloat(e.style.left)+r+l}return a=Math.max(a,0),a=Math.min(a,i.width),e.style.left=a-r+"px",a}update(e){const{A:t,S:s,B:i,H:r,_Color:a}=this,n=r*360,o=a.fromHSB(n,s,i,t),l=o.toRgbaString(),d=a.fromHSB(n,s,i).toRgbaString(),h=a.fromHSB(n,1,1).toRgbaString(),p=this.picker;a.fromString(p.getValue()).toRgbaString()!==l&&(this.colorChanged=!0),p.setValue(l),this.spectrumColor.style.backgroundColor=h,this.spectrumDragger.style.backgroundColor=d,this.spectrumHueSlider.style.backgroundColor=h,this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-from",a.fromHSB(n,s,i,0).toRgbaString()),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-to",d),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color",l),e||this.colorInput.setColor(o)}setSpectrumValue(e,t,s){const i=this.spectrumValRect||this.refreshSpectrumRect();if(i==null)return;const r=this.spectrumDragger,a=r.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,r.style.left=e*i.width-a.width/2+"px",r.style.top=(1-t)*i.height-a.height/2+"px",this.update(s)}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect(),s=parseFloat(e.style.left)+t.width/2,i=parseFloat(e.style.top)+t.height/2;return{x:s,y:i}}initRecentColors(){const e=Ci,t=e.map((s,i)=>`<div class="ag-recent-color" id=${i} style="background-color: ${s}; width: 15px; height: 15px;" recent-color="${s}" tabIndex="${this.tabIndex}"></div>`);this.recentColors.innerHTML=t.join(""),vS(this.recentColors,!!e.length)}setValue(e){const t=this._Color.fromString(e);this.setColor(t,!0)}setColor(e,t){const[s,i,r]=e.toHSB();this.H=(isNaN(s)?0:s)/360,this.A=e.a;const a=this.spectrumHueRect||this.refreshHueRect(),n=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=`${(this.H-1)*-a.width-this.spectrumHueSlider.getBoundingClientRect().width/2}px`,this.spectrumAlphaSlider.style.left=`${this.A*n.width-this.spectrumAlphaSlider.getBoundingClientRect().width/2}px`,this.setSpectrumValue(i,r,!t)}onRecentColorClick(e){const t=e.target;if(!CS(t.id))return;const s=parseInt(t.id,10);this.setValue(Ci[s]),this.destroy()}addRecentColor(){const t=this._Color.fromHSB(this.H*360,this.S,this.B,this.A).toRgbaString();let s=Ci;!this.colorChanged||s[0]===t||(s=s.filter(i=>i!=t),s=[t].concat(s),s.length>Jo&&(s=s.slice(0,Jo)),Ci=s)}destroy(){this.addRecentColor(),super.destroy()}};import{_AgComponentStub as FS,_AgTabGuardFeature as RS,_findNextFocusableElement as AS,_setDisplayed as Qo}from"ag-grid-community";import{RefPlaceholder as vi,_AgComponentStub as el,_AgPositionableFeature as MS,_getActiveDomElement as TS,_getInnerHeight as PS,_getInnerWidth as IS,_isVisible as ES,_setDisplayed as DS}from"ag-grid-community";var LS=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function kS(e){return e??(e=e||"default"),{tag:"div",cls:`ag-panel ag-${e}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${e}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${e}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${e}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${e}-panel-content-wrapper`}]}}var Yr=class extends el{constructor(e){super(kS(e.cssIdentifier)),this.config=e,this.closable=!0,this.eContentWrapper=vi,this.eTitleBar=vi,this.eTitleBarButtons=vi,this.eTitle=vi,this.registerCSS(LS)}postConstruct(){const{component:e,closable:t,hideTitleBar:s,title:i,minWidth:r=250,width:a,minHeight:n=250,height:o,centered:l,popup:c,x:d,y:u,postProcessPopupParams:h}=this.config,p=this.beans,g=this.createManagedBean(new MS(this.getGui(),{minWidth:r,width:a,minHeight:n,height:o,centered:l,x:d,y:u,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=g;const f=this.getGui();if(e&&this.setBodyComponent(e),s?DS(this.eTitleBar,!1):(i&&this.setTitle(i),this.setClosable(t??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:C=>{if(f.contains(C.relatedTarget)||f.contains(TS(p))||this.eTitleBarButtons.contains(C.target)){C.preventDefault();return}const v=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");v&&v.focus()}}),c&&g.isPositioned())return;this.renderComponent&&this.renderComponent();let m;if(h){const{type:C,eventSource:v,mouseEvent:S}=h;m=()=>p.popupSvc?.callPostProcessPopup(h,C,f,v,S)}g.initialisePosition(m),this.eContentWrapper.style.height="0"}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const t=this.closeButtonComp=new el({tag:"div",cls:"ag-button"});this.createBean(t);const s=t.getGui(),i=this.beans.iconSvc.createIconNoSpan("close",this.beans);i.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(i),this.addTitleBarButton(t),t.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else this.closeButtonComp&&(this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp))}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const s=this.eTitleBarButtons,i=s.children,r=i.length;t==null&&(t=r),t=Math.max(0,Math.min(t,r)),e.addCss("ag-panel-title-bar-button");const a=e.getGui();t===0?s.prepend(a):t===r?s.append(a):i[t-1].after(a),e.setParentComponent(this)}getBodyHeight(){return PS(this.eContentWrapper)}getBodyWidth(){return IS(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&ES(e)&&this.close(),super.destroy()}},qr=class extends Yr{constructor(e,t){super({...e,popup:!0}),this.callbacks=t,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){const e=this.getGui(),{movable:t,resizable:s,maximizable:i,modal:r}=this.config;this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new RS(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:a=>{if(r)return;const n=a.shiftKey,o=AS(this.beans,e,!1,n);(!o||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(o))&&this.callbacks?.focusNextContainer(this.beans,n)&&a.preventDefault()}}),t&&this.setMovable(t),i&&this.setMaximizable(i),s&&this.setResizable(s),this.config.modal||this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:s,title:i,afterGuiAttached:r}=this.config,a=this.getLocaleTextFunc(),n=this.popupSvc?.addPopup({modal:s,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:i||a("ariaLabelDialog","Dialog"),afterGuiAttached:r});n&&(this.close=n.hideFunc)}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}setMaximized(e){this.isMaximizable&&e!==this.isMaximized&&this.toggleMaximize()}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:s,width:i,height:r}=this.lastPosition;this.setWidth(i),this.setHeight(r),this.positionableFeature.offsetElement(t,s)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){Qo(this.maximizeIcon,!this.isMaximized),Qo(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(const e of this.maximizeListeners)e();this.maximizeListeners.length=0}this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;const s=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),s.addManagedElementListeners(s.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(s,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new FS({tag:"div",cls:"ag-dialog-button"})),t=e.getGui(),s=this.beans.iconSvc;return this.maximizeIcon=s.createIconNoSpan("maximize"),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=s.createIconNoSpan("minimize"),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}},Xr=class extends fS{constructor(e){super({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"chartsColorPicker",...e})}postConstruct(){this.eDisplayFieldColor=Zo({tag:"span",cls:"ag-color-picker-color"}),this.eDisplayFieldText=Zo({tag:"span",cls:"ag-color-picker-value"}),this.eDisplayField.append(this.eDisplayFieldColor,this.eDisplayFieldText),super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.eWrapper.getBoundingClientRect(),t=this.beans.popupSvc.getParentRect();return this.createBean(new qr({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-t.left-190,y:e.top-t.top-250-(this.config.pickerGap??0),postProcessPopupParams:{type:"colorPicker",eventSource:this.eWrapper}},this.config.dialogCallbacks))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new xS({picker:this}));return e.addCss("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>this.pickerComponent?.close()}setValue(e){return this.value===e?this:(this.eDisplayFieldColor.style.backgroundColor=e,this.eDisplayFieldText.textContent=this.beans.agChartsExports._Util.Color.fromString(e).toHexString().toUpperCase(),super.setValue(e))}getValue(){return this.value}},GS={selector:"AG-COLOR-PICKER",component:Xr};import{AgPromise as Zr,KeyCode as Re,_AgTabGuardComp as OS,_createAgElement as _S,_last as NS}from"ag-grid-community";import{KeyCode as tl,_AgBeanStub as BS,_createElement as VS,_setAriaDisabled as HS,_setAriaExpanded as zS,_setAriaHasPopup as US,_setAriaRole as WS}from"ag-grid-community";import{KeyCode as KS,_AgTabGuardComp as $S}from"ag-grid-community";var jS=class extends $S{constructor(e){super(),this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===KS.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}},Si=class extends BS{constructor(e){super(),this.callbacks=e,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){const{menuItemDef:t,isAnotherSubMenuOpen:s,level:i,childComponent:r,contextParams:a}=e;return this.params=e.menuItemDef,this.level=i,this.isAnotherSubMenuOpen=s,this.childComponent=r,this.contextParams=a,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...t,level:i,isAnotherSubMenuOpen:s,openSubMenu:n=>this.openSubMenu(n),closeSubMenu:()=>this.closeSubMenu(),closeMenu:n=>this.closeMenu(n),updateTooltip:(n,o)=>this.refreshTooltip(n,o),onItemActivated:()=>this.onItemActivated()}).then(n=>{if(!n)return;this.menuItemComp=n;const o=n.configureDefaults?.();o&&this.configureDefaults(o===!0?void 0:o)})}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:s=>this.onItemSelected(s)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:s=>{(s.key===tl.ENTER||s.key===tl.SPACE)&&(s.preventDefault(),this.onItemSelected(s))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:s=>{s.stopPropagation(),s.preventDefault()}}),t?.suppressMouseOver||this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const s=VS({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=s;let i,r=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const c=this.createBean(new jS(this.childComponent));c.setParentComponent(this);const d=c.getGui(),u="mouseenter",h=()=>this.cancelDeactivate();d.addEventListener(u,h),i=()=>{d.removeEventListener(u,h),this.destroyBean(c)},s.appendChild(d),this.childComponent.afterGuiAttached&&(r=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const c=this.createBean(new bi(this.level+1,this.contextParams,this.callbacks));c.setParentComponent(this),c.addMenuItems(this.params.subMenu),s.appendChild(c.getGui()),this.addManagedListeners(c,{closeMenu:d=>this.dispatchLocalEvent(d)}),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(c),e&&(r=()=>{c.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.beans.popupSvc,n=()=>{const c=this.eGui;a?.positionPopupForMenu({eventSource:c,ePopup:s,event:t instanceof MouseEvent?t:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},o=this.getLocaleTextFunc(),l=a?.addPopup({modal:!0,eChild:s,positionCallback:n,anchorToElement:this.eGui,ariaLabel:o("ariaLabelSubMenu","SubMenu"),afterGuiAttached:r});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{l&&l.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),i(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||zS(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){this.cancelActivate(),!(this.params.disabled&&!t)&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!0),this.suppressFocus||this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!t})),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen&&this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){this.menuItemComp.select?.(),this.params.action?this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams}))):this.openSubMenu(e&&e.type==="keydown",e),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const t={type:"closeMenu"};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchLocalEvent(t)}onItemActivated(){const e={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY):this.deactivate()}refreshRootElementGui(e){let t=this.menuItemComp.getGui();const{cssClassPrefix:s,params:{cssClasses:i,disabled:r}}=this,a=this.menuItemComp.getRootElement?.();if(a&&(e||t.classList.add("ag-menu-option-custom"),t=a),this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(s);for(const n of i??[])t.classList.add(n);r&&t.classList.add(`${s}-disabled`)}return t}applyAriaProperties(e){const{params:{checked:t,subMenu:s,subMenuRole:i,disabled:r}}=this,a=t!=null;WS(e,a?"menuitemcheckbox":"menuitem"),s&&US(e,i??"menu"),r&&HS(e,!0)}configureDefaults(e){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}const{suppressRootStyles:t,suppressTooltip:s,suppressAria:i,suppressTabIndex:r,suppressFocus:a}=e||{},{params:{tooltip:n,disabled:o}}=this,l=this.eGui=this.refreshRootElementGui(!!t);this.suppressAria=!!i,i||this.applyAriaProperties(l),r||l.setAttribute("tabindex","-1"),s||this.refreshTooltip(n),o||this.addListeners(l,e),this.suppressFocus=!!a}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;const s=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});s&&(this.tooltipFeature=this.createBean(s))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},bi=class extends OS{constructor(e=0,t,s){super({tag:"div",cls:"ag-menu-list",role:"menu"}),this.level=e,this.menuActionParams=t,this.callbacks=s,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(e)),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case Re.UP:case Re.RIGHT:case Re.DOWN:case Re.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case Re.ESCAPE:this.closeIfIsChild()&&this.callbacks.stopPropagationCallbacks.stopPropagation(e);break}}handleFocusIn(e){const t=e.relatedTarget;!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)&&(this.getGui().contains(t)||this.activeMenuItem?.getSubMenuGui()?.contains(t))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){const t=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){e!=null&&Zr.all(e.map(t=>t==="separator"?Zr.resolve({eGui:this.createSeparator()}):typeof t=="string"?(this.callbacks.warnNoItem?.(t),Zr.resolve({eGui:null})):this.addItem(t))).then(t=>{for(const s of t??[])s?.eGui&&(this.appendChild(s.eGui),s.comp&&this.menuItems.push(s.comp))})}addItem(e){const t=this.createManagedBean(new Si(this.callbacks));return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(s=>s.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:s=>{this.dispatchLocalEvent(s)},menuItemActivated:s=>{this.activeMenuItem&&this.activeMenuItem!==s.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=s.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}createSeparator(){const e={tag:"div",cls:"ag-menu-separator-part"};return _S({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[e,e,e,e]})}handleNavKey(e){switch(e){case Re.UP:case Re.DOWN:{const s=this.findNextItem(e===Re.UP);s&&s!==this.activeMenuItem&&s.activate(!1,!0);return}}const t=this.gos.get("enableRtl")?Re.RIGHT:Re.LEFT;e===t?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return t&&t instanceof Si?(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=[...this.menuItems];if(!t.length)return;if(!this.activeMenuItem)return e?NS(t):t[0];e&&t.reverse();let s,i=!1;for(const r of t){if(!i){r===this.activeMenuItem&&(i=!0);continue}s=r;break}return i&&!s?t[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};import{_AgBeanStub as YS,_AgComponentStub as qS,_anchorElementToMouseMoveEvent as sl,_createAgElement as XS,_focusInto as ZS,_getPageBody as JS,_getRootNode as QS,_isPromise as eb,_isVisible as tb}from"ag-grid-community";var sb="ag-menu",ib="ag-context-menu-loading-icon",il=class extends YS{constructor(e){super(),this.params=e,this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenu(e,t,s){const{getMenuItems:i,shouldBlockMenuOpen:r}=this.params,a=i(e,t);if(eb(a)){const n=this.lastPromise+1;return this.lastPromise=n,this.destroyLoadingSpinner||this.createLoadingIcon(t),a.then(o=>{if(this.lastPromise!==n)return;const{target:l}=t,c=!l;o?.length&&(c||tb(l))&&!r?.()&&this.createContextMenu({menuItems:o,menuActionParams:e,mouseEvent:t,anchorToElement:s}),this.destroyLoadingSpinner?.()}),!0}return a?.length?(this.createContextMenu({menuItems:a,menuActionParams:e,mouseEvent:t,anchorToElement:s}),!0):!1}createLoadingIcon(e){const{beans:t}=this,s=this.getLocaleTextFunc(),i=t.iconSvc.createIconNoSpan("loadingMenuItems"),r=XS({tag:"div",cls:ib});r.appendChild(i);const a=QS(t),n=JS(t);if(!n)return;n.appendChild(r),t.ariaAnnounce?.announceValue(s("ariaLabelLoadingContextMenu","Loading Context Menu"),"contextmenu"),t.environment.applyThemeClasses(r),sl(r,e,t);const o=l=>{sl(r,l,t)};a.addEventListener("mousemove",o),this.destroyLoadingSpinner=()=>{a.removeEventListener("mousemove",o),r.remove(),this.destroyLoadingSpinner=null}}createContextMenu(e){const{mapMenuItems:t,menuItemCallbacks:s,beforeMenuOpen:i,onMenuClose:r,afterMenuDestroyed:a,onVisibleChanged:n,onMenuOpen:o}=this.params,{menuItems:l,menuActionParams:c,mouseEvent:d,anchorToElement:u}=e,h=this.beans.popupSvc,p=t?b=>t(l,c,b):()=>l,g=new rb(p,c,s);this.createBean(g);const f=g.getGui();i?.(c);const m={additionalParams:s.getPostProcessPopupParams(c),type:"contextMenu",mouseEvent:d,ePopup:f,nudgeY:1},C=this.getLocaleTextFunc(),v=h?.addPopup({modal:!0,eChild:f,closeOnEsc:!0,closedCallback:b=>{s.preserveRangesWhile(this.beans,()=>{r?.(),this.destroyBean(g),a?.(),n?.(!1,b===void 0?"api":"ui")})},click:d,positionCallback:()=>{const b=this.gos.get("enableRtl");h?.positionPopupUnderMouseEvent({...m,nudgeX:b?(f.offsetWidth+1)*-1:1})},anchorToElement:u,ariaLabel:C("ariaLabelContextMenu","Context Menu")});v&&(o?.(),g.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=g,g.addEventListener("destroyed",()=>{this.activeMenu===g&&(this.activeMenu=null)}),v&&g.addEventListener("closeMenu",b=>v.hideFunc({mouseEvent:b.mouseEvent??void 0,keyboardEvent:b.keyboardEvent??void 0,forceHide:!0}));const S=d&&d instanceof MouseEvent&&d.type==="mousedown";n?.(!0,S?"api":"ui")}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},rb=class extends qS{constructor(e,t,s){super({tag:"div",cls:sb,role:"presentation"}),this.getMenuItems=e,this.menuActionParams=t,this.callbacks=s,this.menuList=null}postConstruct(){const e=this.createManagedBean(new bi(0,this.menuActionParams,this.callbacks)),t=this.getMenuItems(()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener("closeMenu",s=>this.dispatchLocalEvent(s))}afterGuiAttached({hidePopup:e}){e&&this.addDestroyFunc(e);const t=this.menuList;t&&this.callbacks.preserveRangesWhile(this.beans,()=>ZS(t.getGui()))}};import{_AgComponentStub as ab,_createAgElement as yi,_isNodeOrElement as nb,_setAriaChecked as ob,_setAriaExpanded as lb}from"ag-grid-community";var rl=class extends ab{constructor(e){super({tag:"div"}),this.callbacks=e}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){const{checked:e,subMenu:t}=this.params,s=this.getGui();e&&ob(s,e),t&&lb(s,!1)}addIcon(){if(this.params.isCompact)return;const e=yi({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:t,icon:s}=this.params;t?e.appendChild(this.beans.iconSvc.createIconNoSpan("check")):s&&(nb(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:this.callbacks?.warnNoIcon?.()),this.getGui().appendChild(e)}addName(){const e=yi({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=yi({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(e)}addSubMenu(){const e=yi({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),t=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(this.beans.iconSvc.createIconNoSpan(s))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}};import{KeyCode as ms,RefPlaceholder as al,_AgTabGuardComp as cb,_clearElement as db,_createAgElement as wi,_findNextFocusableElement as ub,_focusInto as nl,_getActiveDomElement as ol,_getDocument as hb,_isKeyboardMode as pb,_setAriaLabel as ll,_setAriaRole as gb}from"ag-grid-community";import{TabGuardClassNames as fb,_FOCUS_MANAGED_CLASS as mb,_findFocusableElements as Cb}from"ag-grid-community";function Jr(e,t){if(!t)return null;const s=Cb(e),i=s.indexOf(t);if(i===-1)return null;let r=-1;for(let a=i-1;a>=0;a--)if(s[a].classList.contains(fb.TAB_GUARD_TOP)){r=a;break}return r<=0?null:s[r-1]}function cl(e,t){if(!t)return!1;const s=e.querySelectorAll(`.${mb}`);if(!s.length)return!1;for(let i=0;i<s.length;i++)if(s[i].contains(t))return!0;return!1}function vb(e){return{tag:"div",cls:`ag-tabs ${e}`,children:[{tag:"div",ref:"eHeader"},{tag:"div",ref:"eBody",role:"presentation",cls:"ag-tabs-body"+e?` ${e}-body`:""}]}}var Qr=class extends cb{constructor(e){super(vb(e.cssClass)),this.eHeader=al,this.eBody=al,this.items=[],this.tabbedItemScrollMap=new Map,this.params=e}postConstruct(){if(this.setupHeader(),this.params.items)for(const e of this.params.items)this.addItem(e);this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,s=(i,r)=>{i.classList.add(`ag-tabs-${r}`),t&&i.classList.add(`${t}-${r}`)};e?(this.setupCloseButton(s),this.eTabHeader=wi({tag:"div",role:"presentation"}),s(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,gb(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(e){const t=wi({tag:"button"});e(t,"close-button");const s=this.beans.iconSvc.createIconNoSpan("close");ll(t,this.params.closeButtonAriaLabel),t.appendChild(s),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});const i=wi({tag:"div",role:"presentation"});e(i,"close-button-wrapper"),i.appendChild(t),this.eHeader.appendChild(i),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case ms.RIGHT:case ms.LEFT:{if(!this.eTabHeader.contains(ol(this.beans)))return;const t=e.key===ms.RIGHT,s=this.gos.get("enableRtl"),i=this.items.indexOf(this.activeItem),r=t!==s?Math.min(i+1,this.items.length-1):Math.max(i-1,0);if(i===r)return;e.preventDefault();const a=this.items[r];this.showItemWrapper(a),a.eHeaderButton.focus();break}case ms.UP:case ms.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,eHeader:s,eBody:i,activeItem:r,params:a}=this,{suppressTrapFocus:n,enableCloseButton:o}=a,l=ol(t),c=e.target,d=e.shiftKey;if(s.contains(l)){e.preventDefault(),o&&d&&!this.eCloseButton?.contains(l)?this.eCloseButton?.focus():n&&d?Jr(hb(t).body,c)?.focus():this.focusBody(e.shiftKey);return}let u=null;if(cl(i,c)&&(d&&(u=Jr(i,c)),!u&&!n&&(u=r.eHeaderButton)),!u&&i.contains(l)&&(u=ub(t,i,!1,d),!u)){n&&!d?this.forceFocusOutOfContainer(d):o&&!d?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader());return}u&&(e.preventDefault(),u.focus())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return nl(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=wi({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});t.appendChild(e.title),this.eTabHeader.appendChild(t),ll(t,e.titleLabel);const s={tabbedItem:e,eHeaderButton:t};this.items.push(s),t.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(e){const t=this.items.find(s=>s.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){const{tabbedItem:t,eHeaderButton:s}=e;if(this.params.onItemClicked?.({item:t}),this.activeItem===e){this.params.onActiveItemClicked?.();return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),db(this.eBody),t.bodyPromise.then(i=>{this.eBody.appendChild(i);const r=!pb();if(this.params.suppressFocusBodyOnOpen||nl(this.eBody,!1,r),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const a=t.getScrollableContainer?.()||i;[this.lastScrollListener]=this.addManagedElementListeners(a,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,a.scrollTop)}});const n=this.tabbedItemScrollMap.get(t.name);n!==void 0&&setTimeout(()=>{a.scrollTop=n},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.()),s.classList.add("ag-tab-selected"),this.activeItem=e}};import{AgCheckboxSelector as Sb,AgToggleButton as bb,KeyCode as Cs,RefPlaceholder as Lt,_AgComponentStub as dl,_isComponent as ea,_removeFromParent as yb,_setAriaExpanded as wb,_setAriaRole as ta,_setDisplayed as ft}from"ag-grid-community";var xb=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function Fb(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return{tag:"div",cls:`ag-group ag-${t}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${t}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${s} ag-${t}-group-container`}]}}var Ae=class extends dl{constructor(e={}){super(Fb(e),[Sb]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=Lt,this.cbGroupEnabled=Lt,this.eContainer=Lt,this.registerCSS(xb);const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:r,suppressToggleExpandOnEnableChange:a,useToggle:n}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=n??!1,this.alignItems=e.alignItems||"center",this.expanded=r??!0,i!=null&&(this.suppressEnabledCheckbox=i),a!=null&&(this.suppressToggleExpandOnEnableChange=a)}postConstruct(){if(this.setupTitleBar(),this.items.length){const r=this.items;this.items=[],this.addItems(r)}const e=this.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,onExpandedChange:s,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),ft(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(r=>{this.setEnabled(r,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(r)}),t!=null&&this.onEnableChange(t),s!=null&&this.onExpandedChange(s)}refreshChildDisplay(){ft(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCss(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),ft(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){for(const t of e)this.addItem(t)}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}updateItems(e){const t=this.items;let s=0;for(let i=0;i<t.length;++i){const r=t[i];if(r===e[s])s++;else{const a=ea(r)?r.getGui():r;yb(a)}}for(;s<e.length;)this.insertItem(e[s++]);this.items=e}insertItem(e,t){const s=this.eContainer,i=ea(e)?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(s.prepend(i),this.items.unshift(i)):(s.appendChild(i),this.items.push(i))}hideItem(e,t){const s=this.items[t];ft(s,!e)}getItemIndex(e){const t=ea(e)?e.getGui():e;return this.items.indexOf(t)}setTitle(e){return this.eTitleBar?.setTitle(e),this}addTitleBarWidget(e){return this.eTitleBar?.addWidget(e),this}addCssClassToTitleBar(e){this.eTitleBar?.addCss(e)}dispatchEnableChangeEvent(e){const t={type:"enableChange",enabled:e};this.dispatchLocalEvent(t)}setEnabled(e,t,s){return this.enabled=e,this.refreshDisabledStyles(),s||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),this.eToggle?.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListeners(this,{enableChange:t=>e(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){const e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new Ab(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:t=>this.toggleGroupExpand(t.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new bb({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:t=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCss("ag-group-title-bar"),e.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},sa="ag-disabled-group-title-bar";function Rb(e){const t=e.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${t}-group-title-bar ag-unselectable`,role:e.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${t}-group-title`}]}}var Ab=class extends dl{constructor(e={}){super(Rb(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=Lt,this.eGroupClosedIcon=Lt,this.eTitle=Lt;const{title:t,suppressOpenCloseIcons:s,suppressKeyboardNavigation:i}=e;t&&t.length>0&&(this.title=t),s!=null&&(this.suppressOpenCloseIcons=s),this.suppressKeyboardNavigation=i??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){const e=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(e.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(e.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:t=>{switch(t.key){case Cs.ENTER:case Cs.SPACE:t.preventDefault(),this.dispatchExpandChanged();break;case Cs.RIGHT:case Cs.LEFT:t.preventDefault(),this.dispatchExpandChanged(t.key===Cs.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||wb(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;ft(this.eGroupOpenedIcon,t&&e),ft(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){const t=this.getGui(),s=!!e&&e.length>0;e=s?e:void 0,this.eTitle.textContent=e??"",ft(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains(sa);return this.refreshDisabledStyles(i),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(sa),t.removeAttribute("tabindex"),ta(t,"presentation")):(t.classList.remove(sa),typeof this.title=="string"&&!this.suppressKeyboardNavigation?(this.activateTabIndex([t]),ta(t,"group")):(t.removeAttribute("tabindex"),ta(t,"presentation")))}},H={selector:"AG-GROUP-COMPONENT",component:Ae};import{TooltipModule as Mb,_FilterCoreModule as Tb,_FilterValueModule as Pb,_PopupModule as Ib,_SharedDragAndDropModule as Eb}from"ag-grid-community";var D="35.1.0",B={moduleName:"EnterpriseCore",version:D,beans:[kr],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:kr.setLicenseKey},Db='.ag-advanced-filter-header{align-items:center;background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);display:flex;position:relative}.ag-advanced-filter{align-items:center;display:flex;width:100%}.ag-advanced-filter-buttons{display:contents}.ag-advanced-filter-header-cell{height:100%;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding)}.ag-advanced-filter-apply-button,.ag-advanced-filter-builder-button{align-items:center;background-color:unset;border:0;display:flex;font-size:var(--ag-font-size);font-weight:600;line-height:normal;padding:var(--ag-spacing);white-space:nowrap;&:where(.ag-standard-button):where(:not(:disabled)){cursor:pointer;&:where(.ag-standard-button):hover{background-color:var(--ag-row-hover-color)}}}:where(.ag-ltr) .ag-advanced-filter-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-button{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-advanced-filter-builder-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-advanced-filter-builder-button-label{margin-right:var(--ag-spacing)}.ag-advanced-filter-builder{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-advanced-filter-builder-list{flex:1;overflow:auto}.ag-advanced-filter-builder-button-panel{border-top:var(--ag-advanced-filter-builder-button-bar-border);display:flex;justify-content:flex-end;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-advanced-filter-builder-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-cancel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-builder-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-cancel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-advanced-filter-builder-item-wrapper{align-items:center;display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}:where(.ag-ltr) .ag-advanced-filter-builder-item-wrapper{padding-left:calc(var(--ag-icon-size)/2);padding-right:var(--ag-icon-size)}:where(.ag-rtl) .ag-advanced-filter-builder-item-wrapper{padding-left:var(--ag-icon-size);padding-right:calc(var(--ag-icon-size)/2)}:where(.ag-virtual-list-viewport) .ag-advanced-filter-builder-item-wrapper .ag-tab-guard{position:absolute}.ag-advanced-filter-builder-item-tree-line{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size)}.ag-advanced-filter-builder-item-tree-line-root:before{height:50%;top:50%}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative}.ag-advanced-filter-builder-item-tree-line-horizontal:after,.ag-advanced-filter-builder-item-tree-line-horizontal:before,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:after,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before,.ag-advanced-filter-builder-item-tree-line-vertical-top:after,.ag-advanced-filter-builder-item-tree-line-vertical-top:before,.ag-advanced-filter-builder-item-tree-line-vertical:after,.ag-advanced-filter-builder-item-tree-line-vertical:before{content:"";height:100%;position:absolute}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:var(--ag-border-width) solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons{display:flex;gap:var(--ag-spacing);padding:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height)}.ag-advanced-filter-builder-virtual-list-item:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}.ag-advanced-filter-builder-invalid{color:var(--ag-subtle-text-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color)}:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}';function Lb(e){return e.filterManager?.getAdvFilterModel()??null}function kb(e,t){e.filterManager?.setAdvFilterModel(t)}function Gb(e){e.filterManager?.toggleAdvFilterBuilder(!0,"api")}function Ob(e){e.filterManager?.toggleAdvFilterBuilder(!1,"api")}import{BeanStub as _b,_exists as Nb,_parseDateTimeFromString as ul,_serialiseDate as hl,_toStringOrNull as kt}from"ag-grid-community";var Bb={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterReset:"Reset",advancedFilterCancel:"Cancel",advancedFilterClear:"Clear",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationNotABigInt:"Value is not a big integer",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderClear:"Clear",advancedFilterBuilderReset:"Reset",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};import{_parseBigIntOrNull as pl}from"ag-grid-community";function ia(e,t,s){if(!e)return"";const i=s-t;return i?e.slice(0,e.length-i):e}function Ye(e,t,s,i,r,a,n){const o=s+(!e.length||n?0:1);let l=0;return r&&(e[o]===" "?l=1:(i+=" ",a&&(i+='"'))),{updatedValue:e.slice(0,t)+i+e.slice(o),updatedPosition:t+i.length+l}}function Vb(e,t,s){let i=t;for(;i<s&&e[i]===" ";)i++;return i}function ra(e,t,s,i){let r=t,a=!1;for(;r<e.length;){const n=e[r];if(n==="("){i&&e[r-1]===" "?a=!0:r=r-1;break}else if(n===" "||s&&n===")"){r=r-1;break}r++}return{endPosition:r,isEmpty:a}}function aa(e,t,s,i){s!==t&&(e.expression=Ye(e.expression,i-t.length+1,i,s).updatedValue)}var Hb=class{constructor(e,t){this.params=e,this.startPosition=t,this.type="column",this.valid=!0,this.hasStartChar=!1,this.hasEndChar=!1,this.colName=""}parse(e,t){if(e===na&&!this.colName)this.hasStartChar=!0;else if(e===oa&&this.hasStartChar){if(this.parseColumn(!1,t))return this.hasEndChar=!0,!1;this.colName+=e}else this.colName+=e}getDisplayValue(){return(this.hasStartChar?na:"")+this.colName+(this.hasEndChar?oa:"")}getColId(){return this.colId}complete(e){this.parseColumn(!0,e)}getValidationError(){return this.valid?null:{message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidColumn"),startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}}parseColumn(e,t){this.endPosition=t;const s=this.params.advFilterExpSvc.getColId(this.colName);return s&&this.hasStartChar&&(this.colId=s.colId,aa(this.params,this.colName,s.columnName,t-1),this.colName=s.columnName,this.column=this.params.colModel.getColDefCol(this.colId),this.column)?(this.baseCellDataType=this.params.dataTypeSvc?.getBaseDataType(this.column)??"text",!0):(e&&(this.valid=!1),this.baseCellDataType="text",!1)}},zb=class{constructor(e,t,s){this.params=e,this.startPosition=t,this.baseCellDataType=s,this.type="operator",this.valid=!0,this.expectedNumOperands=0,this.operator=""}parse(e,t){if(e===" "||e===")"){if(this.parseOperator(!1,t-1))return!0;this.operator+=e}else this.operator+=e}complete(e){this.parseOperator(!0,e)}getValidationError(){return this.valid?null:{message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidOption"),startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}}getDisplayValue(){return this.operator}getOperatorKey(){return this.parsedOperator}parseOperator(e,t){const s=this.params.advFilterExpSvc.getDataTypeExpressionOperator(this.baseCellDataType),i=s.findOperator(this.operator);if(this.endPosition=t,i){this.parsedOperator=i;const a=s.operators[i];this.expectedNumOperands=a.numOperands;const n=a.displayValue;return aa(this.params,this.operator,n,t),this.operator=n,!0}return(e||!(i===null))&&(this.valid=!1),!1}},Ub=class{constructor(e,t,s,i){this.params=e,this.startPosition=t,this.baseCellDataType=s,this.column=i,this.type="operand",this.valid=!0,this.operand="",this.validationMessage=null,this.filterValidationSetters={number:()=>{(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotANumber"))},bigint:()=>{(this.quotes||pl(this.modelValue)===null)&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotABigInt"))},date:r=>{r==null&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidDate"))},dateString:(...r)=>this.filterValidationSetters.date(...r),dateTime:(...r)=>this.filterValidationSetters.date(...r),dateTimeString:(...r)=>this.filterValidationSetters.date(...r),boolean(){},object(){},text(){}}}parse(e,t){if(e===" ")if(this.quotes)this.operand+=e;else return this.parseOperand(!1,t),!0;else if(e===")"){if(this.baseCellDataType==="number"||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(!this.operand&&!this.quotes&&(e==="'"||e==='"'))this.quotes=e;else{if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;this.operand+=e}}complete(e){this.parseOperand(!0,e)}getValidationError(){return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){const{advFilterExpSvc:s}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=s.translate("advancedFilterValidationMissingQuote");else if(this.modelValue==="")this.valid=!1,this.validationMessage=s.translate("advancedFilterValidationMissingValue");else{const i=s.getOperandModelValue(this.operand,this.baseCellDataType,this.column);i!=null&&(this.modelValue=i),this.filterValidationSetters[this.baseCellDataType](i)}}},na="[",oa="]",Wb=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0,this.operandValueGetters={number:Number,bigint:s=>pl(s),date:s=>this.params.valueSvc.parseValue(this.columnParser.column,null,s,void 0),dateString:s=>this.operandValueGetters.date(s),dateTime:s=>this.operandValueGetters.date(s),dateTimeString:s=>this.operandValueGetters.date(s),boolean:s=>s,object:s=>s,text:s=>s}}parseExpression(){let e=this.startPosition;const{expression:t}=this.params;for(;e<t.length;){const s=t[e];if(!(s===" "&&this.isAwaiting)){if(this.isAwaiting=!1,!this.parser){let r;this.columnParser?this.operatorParser?(this.operandParser=new Ub(this.params,e,this.columnParser.baseCellDataType,this.columnParser.column),r=this.operandParser):(this.operatorParser=new zb(this.params,e,this.columnParser.baseCellDataType),r=this.operatorParser):(this.columnParser=new Hb(this.params,e),r=this.columnParser),this.parser=r}const i=this.parser.parse(s,e);if(i!=null){if(this.isComplete())return this.returnEndPosition(i?e-1:e,!0);this.parser=void 0,this.isAwaiting=!0}}e++}return this.parser?.complete?.(e-1),this.returnEndPosition(e)}isValid(){return this.isComplete()&&this.columnParser.valid&&this.operatorParser.valid&&(!this.operandParser||this.operandParser.valid)}getValidationError(){const e=this.columnParser?.getValidationError()??this.operatorParser?.getValidationError()??this.operandParser?.getValidationError();if(e)return e;const t=this.params.expression.length;let s;return this.columnParser?this.operatorParser?this.operatorParser.expectedNumOperands&&!this.operandParser&&(s="advancedFilterValidationMissingValue"):s="advancedFilterValidationMissingOption":s="advancedFilterValidationMissingColumn",s?{message:this.params.advFilterExpSvc.translate(s),startPosition:t,endPosition:t}:null}getFunction(e){return this.getFunctionCommon(e,(t,s,i,r)=>(a,n,o)=>o.operators[s].evaluator(a.getValue(i,n),n,o.evaluatorParams[r],t==null?void 0:o.operands[t]))}getAutocompleteListParams(e){if(this.isColumnPosition(e))return this.getColumnAutocompleteListParams(e);if(this.isOperatorPosition(e))return this.getOperatorAutocompleteListParams(e);if(!this.isBeyondEndPosition(e))return{enabled:!1}}updateExpression(e,t,s){const{expression:i}=this.params;if(this.isColumnPosition(e))return Ye(this.params.expression,this.startPosition,this.columnParser?.getColId()?this.columnParser.endPosition:ra(i,e).endPosition,this.params.advFilterExpSvc.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const r=this.getBaseCellDataTypeFromOperatorAutocompleteType(s),a=this.hasOperand(r,t.key),n=a&&this.doesOperandNeedQuotes(r);let o;if(this.operatorParser?.startPosition!=null&&e<this.operatorParser.startPosition)o=Ye(i,e,e,t.displayValue??t.key,a,n);else{let l,c=!1;if(this.operatorParser?.getOperatorKey())l=this.operatorParser.endPosition;else{const{endPosition:d,isEmpty:u}=ra(i,e,!0,!0);l=d,c=u}o=Ye(i,Vb(i,this.columnParser.endPosition+1,l),l,t.displayValue??t.key,a,n,c)}return{...o,hideAutocomplete:!a}}return null}getModel(){const e=this.columnParser.getColId(),t={filterType:this.columnParser.baseCellDataType,colId:e,type:this.operatorParser.getOperatorKey()};return this.operatorParser.expectedNumOperands&&(t.filter=this.operandParser.getModelValue()),t}getFunctionCommon(e,t){const s=this.columnParser.getColId(),i=this.operatorParser?.getOperatorKey(),{operators:r,evaluatorParams:a,operands:n}=e,o=this.params.advFilterExpSvc.getExpressionOperator(this.columnParser.baseCellDataType,i),l=this.addToListAndGetIndex(r,o),c=this.params.advFilterExpSvc.getExpressionEvaluatorParams(s),d=this.addToListAndGetIndex(a,c),u=this.operatorParser?.expectedNumOperands===0?void 0:this.addToListAndGetIndex(n,this.getOperandValue());return t(u,l,s,d)}getOperandValue(){const{baseCellDataType:e,column:t}=this.columnParser,s=this.operandValueGetters[e](this.operandParser.getRawValue());return e==="dateString"||e==="dateTimeString"?this.params.dataTypeSvc?.getDateParserFunction(t)(s)??s:s}isComplete(){return!!(this.operatorParser&&(!this.operatorParser.expectedNumOperands||this.operatorParser.expectedNumOperands&&this.operandParser))}isColumnPosition(e){return this.columnParser?.endPosition==null||e<=this.columnParser.endPosition+1}isOperatorPosition(e){return this.operatorParser?.endPosition==null||e<=this.operatorParser.endPosition+1}isBeyondEndPosition(e){return this.isComplete()&&this.endPosition!=null&&e>this.endPosition+1&&this.endPosition+1<this.params.expression.length}returnEndPosition(e,t){return this.endPosition=t?e:e-1,e}getColumnAutocompleteListParams(e){return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),"column",this.getColumnSearchString(e))}getColumnSearchString(e){const t=this.columnParser?.getDisplayValue()??"",s=ia(t,e,this.columnParser?.endPosition==null?this.params.expression.length:this.columnParser.endPosition+1),i=this.columnParser?.hasStartChar&&s.length>0,r=this.columnParser?.hasEndChar&&s.length===t.length+2;return i?s.slice(1,r?-1:void 0):s}getOperatorAutocompleteListParams(e){const t=this.columnParser?.column;if(!t)return{enabled:!1};const s=this.columnParser.baseCellDataType,i=this.operatorParser?.startPosition!=null&&e<this.operatorParser.startPosition?"":ia(this.operatorParser?.getDisplayValue()??"",e,this.operatorParser?.endPosition==null?this.params.expression.length:this.operatorParser.endPosition+1);return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getOperatorAutocompleteEntries(t,s),`operator-${s}`,i)}getBaseCellDataTypeFromOperatorAutocompleteType(e){return e?.replace("operator-","")}hasOperand(e,t){return!e||!t||(this.params.advFilterExpSvc.getExpressionOperator(e,t)?.numOperands??0)>0}doesOperandNeedQuotes(e){return e!=="number"&&e!=="bigint"}addToListAndGetIndex(e,t){const s=e.length;return e.push(t),s}};function xi(e,t,s){let i=!1;const r=e.toLocaleLowerCase(),a=r+" ",n=Object.keys(t).find(o=>{const l=t[o],c=s(l).toLocaleLowerCase();return c.startsWith(a)&&(i=!0),c===r});return n||(i?null:void 0)}function la(e,t){return(t??Object.keys(e)).map(i=>({key:i,displayValue:e[i].displayValue}))}var gl=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return la(this.operators,e)}findOperator(e){return xi(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,n)=>a.includes(n)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(a,n)=>!a.includes(n)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,n)=>a===n),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(a,n)=>a!=n),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,n)=>a.startsWith(n)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,n)=>a.endsWith(n)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null||typeof t=="string"&&t.trim().length===0,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null&&(typeof t!="string"||t.trim().length>0),numOperands:0}}}evaluateExpression(e,t,s,i,r,a){return e==null?r:s.caseSensitive?a(s.valueConverter(e,t),i):a(s.valueConverter(e,t).toLocaleLowerCase(),i.toLocaleLowerCase())}},Gt=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return la(this.operators,e)}findOperator(e){return xi(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInEquals,(n,o)=>!t(n,o)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInGreaterThan,(n,o)=>n>o),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInGreaterThan,(n,o)=>n>=o),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInLessThan,(n,o)=>n<o),numOperands:1},lessThanOrEqual:{displayValue:e("advancedFilterLessThanOrEqual"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInLessThan,(n,o)=>n<=o),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:s=>s==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:s=>s!=null,numOperands:0}}}evaluateSingleOperandExpression(e,t,s,i,r,a){return e==null?r:a(s.valueConverter(e,t),i)}},Kb=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return la(this.operators,e)}findOperator(e){return xi(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:t=>!!t,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:t=>t===!1,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null,numOperands:0}}}},$b=class extends _b{constructor(){super(...arguments),this.beanName="advFilterExpSvc",this.filterOperandGetters={number:e=>kt(e.filter)??"",bigint:e=>kt(e.filter)??"",date:e=>{const t=this.colModel.getColDefCol(e.colId);return t?this.valueSvc.formatValue(t,null,ul(kt(e.filter)??"")):null},dateTime:e=>this.filterOperandGetters.date(e),dateString:e=>{const t=this.colModel.getColDefCol(e.colId);if(!t)return null;const{filter:s}=e,r=this.dataTypeSvc?.getDateFormatterFunction(t)?.(ul(kt(e.filter)??"")??void 0)??s;return this.valueSvc.formatValue(t,null,r)},dateTimeString:e=>this.filterOperandGetters.dateString(e),boolean:()=>null,object:()=>null,text:()=>null},this.operandModelValueGetters={number:e=>Nb(e)?Number(e):null,bigint:e=>e,date:(e,t,s)=>hl(this.valueSvc.parseValue(t,null,e,void 0),!!this.dataTypeSvc?.getDateIncludesTimeFlag(s)),dateTime:(...e)=>this.operandModelValueGetters.date(...e),dateString:(e,t,s)=>{const i=this.valueSvc.parseValue(t,null,e,void 0);return this.dataTypeSvc?hl(this.dataTypeSvc.getDateParserFunction(t)(i)??null,this.dataTypeSvc.getDateIncludesTimeFlag(s)):i},dateTimeString:(...e)=>this.operandModelValueGetters.dateString(...e),boolean:e=>e,object:e=>e,text:e=>e},this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.colNames=e.colNames,this.dataTypeSvc=e.dataTypeSvc}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){const{type:t}=e;return this.expressionJoinOperators[t]??t}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:a})=>a===t);let r;return i?(r=i.displayValue,this.columnNameToIdMap[r.toLocaleUpperCase()]={colId:t,columnName:r}):r=t,r}getOperatorDisplayValue(e){return this.getExpressionOperator(e.filterType,e.type)?.displayValue??e.type}getOperandModelValue(e,t,s){return this.operandModelValueGetters[t](e,s,t)}getOperandDisplayValue(e,t){const{filter:s,filterType:i}=e;if(s==null)return"";let r=this.filterOperandGetters[i](e);return i!=="number"&&i!=="bigint"&&(r??(r=kt(s)??""),t||(r=`"${r}"`)),t?r:` ${r}`}parseColumnFilterModel(e){const t=this.getColumnDisplayValue(e)??"",s=this.getOperatorDisplayValue(e)??"",i=this.getOperandDisplayValue(e);return`[${t}] ${s}${i}`}updateAutocompleteCache(e,t){if(t==="column"){const{key:s,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:s,columnName:i}}}translate(e,t){let s=Bb[e];return typeof s=="function"&&(s=s(t)),this.getLocaleTextFunc()(e,s,t)}generateAutocompleteListParams(e,t,s){return{enabled:!0,type:t,searchString:s,entries:e}}getColumnAutocompleteEntries(){if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const e=this.colModel.getColDefCols()??[],t=[],s=this.gos.get("includeHiddenColumnsInAdvancedFilter");for(const i of e)i.getColDef().filter&&(s||i.isVisible()||i.isRowGroupActive())&&t.push({key:i.getColId(),displayValue:this.colNames.getDisplayNameForColumn(i,"advancedFilter")});return t.sort((i,r)=>{const a=i.displayValue??"",n=r.displayValue??"";return a<n?-1:n>a?1:0}),t}getOperatorAutocompleteEntries(e,t){const s=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(s)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){return this.getDataTypeExpressionOperator(e)?.operators?.[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),s=this.columnNameToIdMap[t];if(s)return s;const r=this.getColumnAutocompleteEntries().find(({displayValue:a})=>a.toLocaleUpperCase()===t);if(r){const{key:a,displayValue:n}=r,o={colId:a,columnName:n};return this.columnNameToIdMap[t]=o,o}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const s=this.colModel.getColDefCol(e);if(!s)return{valueConverter:a=>a};switch(this.dataTypeSvc?.getBaseDataType(s)){case"dateTimeString":case"dateString":t={valueConverter:this.dataTypeSvc?.getDateParserFunction(s)??(a=>a)};break;case"object":s.getColDef().filterValueGetter?t={valueConverter:a=>a}:t={valueConverter:(a,n)=>this.valueSvc.formatValue(s,n,a)??(typeof a.toString=="function"?a.toString():"")};break;case"text":case void 0:t={valueConverter:a=>kt(a)};break;default:t={valueConverter:a=>a};break}const{filterParams:r}=s.getColDef();return r&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(a=>{const n=r[a];n&&(t[a]=n)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){const t=this.colModel.getColDefCol(e)??void 0,s=(t?this.dataTypeSvc?.getBaseDataType(t):void 0)??"text";return{column:t,baseCellDataType:s}}generateExpressionOperators(){const e=(s,i)=>this.translate(s,i),t={translate:e,equals:(s,i)=>s.getTime()===i.getTime()};return{text:new gl({translate:e}),boolean:new Kb({translate:e}),object:new gl({translate:e}),number:new Gt({translate:e,equals:(s,i)=>s===i}),bigint:new Gt({translate:e,equals:(s,i)=>s===i}),date:new Gt(t),dateString:new Gt(t),dateTime:new Gt(t),dateTimeString:new Gt(t)}}getColumnValue({displayValue:e}){return`${na}${e}${oa}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){const t=e.getColDef().filterParams?.filterOptions;return t&&t.every(i=>typeof i=="string")?t:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}};import{BeanStub as jb,_exists as Yb,_isClientSideRowModel as qb,_isServerSideRowModel as Xb,_warn as Zb}from"ag-grid-community";import{BeanStub as Jb,_getAbsoluteHeight as Qb,_getAbsoluteWidth as ey,_removeFromParent as ty}from"ag-grid-community";import{_STOP_PROPAGATION_CALLBACKS as sy,_focusNextGridCoreContainer as iy}from"ag-grid-community";var fl={stopPropagationCallbacks:sy,focusNextContainer:(e,t)=>iy(e,t),configureFocusableContainer:(e,t)=>{const s=e.ctrlsSvc.get("gridCtrl");s.addFocusableContainer(t),t.addDestroyFunc(()=>s.removeFocusableContainer(t))}},Fi=class extends qr{constructor(e){super(e,fl)}};import{AgFilterButtonSelector as ry,Component as ay,RefPlaceholder as vs,_createIconNoSpan as ny,_makeNull as oy,_setDisabled as ml,_setDisplayed as Cl}from"ag-grid-community";import{AgInputTextFieldSelector as ly,Component as cy,KeyCode as Me,RefPlaceholder as dy,_isNothingFocused as uy,_makeNull as vl}from"ag-grid-community";var Sl=".ag-autocomplete{align-items:center;display:flex;width:100%;>:where(.ag-text-field){flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}}.ag-autocomplete-virtual-list-item:hover{background-color:var(--ag-row-hover-color)}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}";import{AgPopupComponent as hy,KeyCode as py,RefPlaceholder as gy,_exists as fy,_fuzzySuggestions as my,_isVisible as Cy}from"ag-grid-community";import{_STOP_PROPAGATION_CALLBACKS as vy}from"ag-grid-community";var Ot=class extends $o{constructor(e){super(vy,e)}};import{Component as Sy,_clearElement as by,_createElement as yy,_exists as wy}from"ag-grid-community";var xy={tag:"div",cls:"ag-autocomplete-row",role:"presentation",children:[{tag:"div",cls:"ag-autocomplete-row-label"}]},Fy=class extends Sy{constructor(){super(xy),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.toggleCss("ag-autocomplete-row-selected",e)}setSearchString(e){let t=!1;const{value:s}=this;if(s&&wy(e)){const i=s.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){t=!0,this.hasHighlighting=!0;const r=i+e.length,a=this.getGui().lastElementChild;by(a),a.append(s.slice(0,i),yy({tag:"b",children:s.slice(i,r)}),s.slice(r))}}!t&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){this.getGui().lastElementChild.textContent=this.value??"\xA0"}},Ry={tag:"div",cls:"ag-autocomplete-list-popup",children:[{tag:"div",ref:"eList",cls:"ag-autocomplete-list"}]},bl=class extends hy{constructor(e){super(Ry),this.params=e,this.eList=gy,this.searchString="",this.lastAutoListHeight=null}postConstruct(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Ot({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:t=>this.autocompleteEntries[t]});const e=this.virtualList.getGui();this.addManagedListeners(e,{click:()=>this.params.onConfirmed(),mousemove:this.onMouseMove.bind(this),mousedown:t=>t.preventDefault()}),this.setSelectedValue(0),this.updateListHeight()}onNavigationKeyDown(e,t){e.preventDefault();const s=this.autocompleteEntries.indexOf(this.selectedValue),i=t===py.UP?s-1:s+1;this.checkSetSelectedValue(i)}setSearch(e){this.searchString=e,fy(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0),this.updateListHeight()),this.updateSearchInList()}runContainsSearch(e,t){let s,i=!1;const r=e.toLocaleLowerCase(),a=t.filter(n=>{const l=n.toLocaleLowerCase().indexOf(r),c=l===0,d=l>=0;return d&&(!s||!i&&c||i===c&&n.length<s.length)&&(s=n,i=c),d});return!s&&a.length&&(s=a[0]),{topMatch:s,allMatches:a}}runStartsWithSearch(e,t){const s=e.toLocaleLowerCase(),i=t.filter(a=>a.toLocaleLowerCase().startsWith(s));return{topMatch:i[0],allMatches:i}}runSearch(){const{autocompleteEntries:e,useFuzzySearch:t,useStartsWithSearch:s,forceLastSelection:i}=this.params,r=e.map(c=>c.displayValue??c.key);let a,n;if(t)a=my({inputValue:this.searchString,allSuggestions:r,hideIrrelevant:!0}).values,n=a.length?a[0]:void 0;else{const c=s?this.runStartsWithSearch(this.searchString,r):this.runContainsSearch(this.searchString,r);a=c.allMatches,n=c.topMatch}let o=e.filter(({key:c,displayValue:d})=>a.includes(d??c));if(!o.length&&this.selectedValue&&i?.(this.selectedValue,this.searchString)&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),this.updateListHeight(),!n)return;const l=a.indexOf(n);this.checkSetSelectedValue(l)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}updateListHeight(){if(!this.params.autoSizeList)return;const e=this.autocompleteEntries.length,t=this.virtualList.getRowHeight(),s=this.params.maxVisibleItems??e;let r=Math.min(e,s)*t;e===0&&(r=t),this.lastAutoListHeight!==r&&(this.lastAutoListHeight=r,this.eList.style.height=`${r}px`,Cy(this.eList)&&this.params.onListHeightChanged?.())}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((s,i)=>{s.updateSelected(e===i)}))}createRowComponent(e){const t=new Fy;return this.createBean(t),t.setState(e.displayValue??e.key,e===this.selectedValue),t}onMouseMove(e){const t=this.virtualList,s=t.getGui().getBoundingClientRect(),i=t.getScrollTop(),r=e.clientY-s.top+i,a=Math.floor(r/t.getRowHeight());this.checkSetSelectedValue(a)}afterGuiAttached(){this.virtualList.refresh(),this.updateListHeight()}getSelectedValue(){return this.autocompleteEntries.length?this.selectedValue??null:null}},Ay={tag:"div",cls:"ag-autocomplete",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eAutocompleteInput"}]},My=class extends cy{constructor(){super(Ay,[ly]),this.eAutocompleteInput=dy,this.isListOpen=!1,this.lastPosition=0,this.valid=!0,this.registerCSS(Sl)}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const t=vl(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchLocalEvent({type:"eventValueChanged",value:e}),this.validate(e)}updateAutocompleteList(e){const t=this.listGenerator?.(e,this.lastPosition)??{enabled:!1};(!t.type||t.type!==this.autocompleteListParams?.type)&&this.isListOpen&&this.closeList();const s=this.isListOpen;if(this.autocompleteListParams=t,t?.enabled){s||this.openList();const{searchString:i}=t;this.autocompleteList.setSearch(i??"")}else s&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case Me.ENTER:this.onEnterKeyDown(e);break;case Me.TAB:this.onTabKeyDown(e);break;case Me.DOWN:case Me.UP:this.onUpDownKeyDown(e,t);break;case Me.LEFT:case Me.RIGHT:case Me.PAGE_HOME:case Me.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case Me.ESCAPE:this.onEscapeKeyDown(e);break;case Me.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){const e=this.autocompleteList?.getSelectedValue();e&&(this.closeList(),this.dispatchLocalEvent({type:"eventOptionSelected",value:this.getValue(),position:this.lastPosition,updateEntry:e,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){e.preventDefault(),this.isListOpen?this.autocompleteList?.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){this.updateLastPosition(),this.updateAutocompleteList(this.eAutocompleteInput.getValue()??null)}setCaret(e,t){(t||uy(this.beans))&&this.eAutocompleteInput.getFocusableElement().focus();const s=this.eAutocompleteInput.getInputElement();s.setSelectionRange(e,e),e===s.value.length&&(s.scrollLeft=s.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){this.lastPosition=this.eAutocompleteInput.getInputElement().selectionStart??0}validate(e){if(!this.validator)return;const t=this.validationMessage=this.validator(e);this.eAutocompleteInput.getInputElement().setCustomValidity(t??""),this.valid=!t,this.dispatchLocalEvent({type:"eventValidChanged",isValid:this.valid,validationMessage:t})}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new bl({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},s=this.popupSvc.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupSvc.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=s.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchLocalEvent({type:"eventValueConfirmed",value:this.getValue(),isValid:this.isValid()})}getValue(){return vl(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:s,silent:i,updateListOnlyIfOpen:r,restoreFocus:a}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(s??this.lastPosition,a),i||this.updateValue(t),(!r||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}},Ty={selector:"AG-AUTOCOMPLETE",component:My},ca={buttons:["apply"],suppressBuilderButton:!1},yl={apply:"advancedFilterApply",clear:"advancedFilterClear",cancel:"advancedFilterCancel",reset:"advancedFilterReset"},Py={tag:"div",cls:"ag-advanced-filter",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"ag-autocomplete",ref:"eAutocomplete"},{tag:"ag-filter-button",ref:"eButtons",cls:"ag-advanced-filter-buttons"},{tag:"button",ref:"eBuilderFilterButton",cls:"ag-button ag-advanced-filter-builder-button",children:[{tag:"span",ref:"eBuilderFilterButtonIcon",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eBuilderFilterButtonLabel",cls:"ag-advanced-filter-builder-button-label"}]}]},wl=class extends ay{constructor(){super(Py,[Ty,ry]),this.eAutocomplete=vs,this.eButtons=vs,this.eBuilderFilterButton=vs,this.eBuilderFilterButtonIcon=vs,this.eBuilderFilterButtonLabel=vs,this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.advancedFilter=e.advancedFilter,this.filterManager=e.filterManager,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipShowDelayOverride:()=>1e3,getLocation:()=>"advancedFilter"})),this.eAutocomplete.setListGenerator((s,i)=>this.generateAutocompleteListParams(i)).setValidator(()=>this.validateValue()).setForceLastSelection((s,i)=>this.forceLastSelection(s,i)).setInputAriaLabel(this.advFilterExpSvc.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advFilterExpSvc.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListeners(this.eAutocomplete,{eventValueChanged:({value:s})=>this.onValueChanged(s),eventValueConfirmed:({isValid:s})=>this.onValueConfirmed(s),eventOptionSelected:({position:s,updateEntry:i,autocompleteType:r})=>this.onOptionSelected(s,i,r),eventValidChanged:({isValid:s,validationMessage:i})=>this.onValidChanged(s,i)});const{buttons:e,suppressBuilderButton:t}={...ca,...this.gos.get("advancedFilterParams")};this.setupButtons(e),this.setupBuilderButton(t),this.beans.gos.addManagedPropertyListener("advancedFilterParams",s=>{const i={...ca,...s.currentValue},r={...ca,...s.previousValue};if(i.buttons!==r.buttons){const a=i.buttons.map(n=>({type:n,label:this.advFilterExpSvc.translate(yl[n])}));this.eButtons.updateButtons(a)}i.suppressBuilderButton!==r.suppressBuilderButton&&Cl(this.eBuilderFilterButton,!i.suppressBuilderButton)})}refresh(){const e=this.advancedFilter.getExpressionDisplayValue();this.eAutocomplete.setValue({value:e??"",position:e?.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),this.eButtons.updateValidity(!e&&!this.isApplyDisabled&&!this.advancedFilter.isCurrentExpressionApplied())}setupButtons(e){const t=e.map(i=>({type:i,label:this.advFilterExpSvc.translate(yl[i])})),s=i=>()=>{this.updateModel(i)};this.eButtons.addManagedListeners(this.eButtons,{apply:s("apply"),clear:s("clear"),reset:s("reset"),cancel:s("cancel")}),this.eButtons.updateButtons(t)}updateModel(e){switch(e){case"apply":this.onValueConfirmed(this.eAutocomplete.isValid());break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":this.advancedFilter.setModel(this.advancedFilter.getModel()),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"clear":this.eAutocomplete.setValue({value:"",restoreFocus:!0});break}}setupBuilderButton(e){this.eBuilderFilterButtonIcon.appendChild(ny("advancedFilterBuilder",this.beans)),this.eBuilderFilterButtonLabel.textContent=this.advFilterExpSvc.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedElementListeners(this.eBuilderFilterButton,{click:()=>this.openBuilder()}),this.addManagedListeners(this.advancedFilter.getCtrl(),{advancedFilterBuilderClosed:()=>this.closeBuilder()}),Cl(this.eBuilderFilterButton,!e)}onValueChanged(e){e=oy(e),this.advancedFilter.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilter.createExpressionParser(e);const t=this.expressionParser?.parseExpression();t&&t!==e&&this.eAutocomplete.setValue({value:t,silent:!0,restoreFocus:!0})}onValueConfirmed(e){!e||this.isApplyDisabled||(this.eButtons?.updateValidity(!1),this.advancedFilter.applyExpression(),this.filterManager?.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,s){const{updatedValue:i,updatedPosition:r,hideAutocomplete:a}=this.updateExpression(e,t,s);this.eAutocomplete.setValue({value:i,position:r,updateListOnlyIfOpen:a,restoreFocus:!0})}validateValue(){return this.expressionParser?.isValid()?null:this.expressionParser?.getValidationMessage()??null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilter.isCurrentExpressionApplied(),this.eButtons.updateValidity(!this.isApplyDisabled),this.tooltipFeature?.setTooltipAndRefresh(t)}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advFilterExpSvc.getDefaultAutocompleteListParams("")}updateExpression(e,t,s){return this.advFilterExpSvc.updateAutocompleteCache(t,s),this.expressionParser?.updateExpression(e,t,s)??this.advancedFilter.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},s){return!!s.toLocaleLowerCase().match(`^${(t??e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,ml(this.eBuilderFilterButton,!0),this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui",eventSource:this.eBuilderFilterButton}))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,ml(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}};import{Component as Iy,KeyCode as Ss,_clearElement as Ey,_findNextFocusableElement as Dy,_focusInto as Ly,_getActiveDomElement as ky,_getFloatingFiltersHeight as Gy,_setAriaColIndex as Oy,_setAriaColSpan as _y,_setAriaRole as Ny,_setAriaRowIndex as By,_setDisplayed as Vy}from"ag-grid-community";var Hy={tag:"div",cls:"ag-advanced-filter-header",role:"row"},zy=class extends Iy{constructor(e){super(Hy),this.enabled=e}wireBeans(e){this.colModel=e.colModel,this.focusSvc=e.focusSvc,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter));const e=()=>{this.enabled&&this.setEnabledHeight()};this.addManagedEventListeners({gridColumnsChanged:()=>this.onGridColumnsChanged(),columnHeaderHeightChanged:e,stylesChanged:e}),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addGuiEventListener("keydown",t=>this.onKeyDown(t)),this.addGuiEventListener("focusout",t=>{this.getFocusableElement().contains(t.relatedTarget)||this.focusSvc.clearAdvancedFilterColumn()})}getFocusableElement(){return this.eAdvancedFilter?.getGui()??this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){this.eAdvancedFilter?.refresh()}getHeight(){return this.height}setInputDisabled(e){this.eAdvancedFilter?.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new wl);const s=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCss("ag-advanced-filter-header-cell"),this.setEnabledHeight(),this.setAriaRowIndex(),Ny(s,"gridcell"),Oy(s,1),this.setAriaColumnCount(s),t.appendChild(s)}else Ey(t),this.destroyBean(this.eAdvancedFilter),this.height=0;Vy(t,e),this.enabled=e}setEnabledHeight(){const e=this.getGui();this.height=Gy(this.beans);const t=`${this.height}px`;e.style.height=t,e.style.minHeight=t}setAriaColumnCount(e){_y(e,this.colModel.getCols().length)}setAriaRowIndex(){By(this.getGui(),this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case Ss.ENTER:{this.hasFocus()&&Ly(this.getFocusableElement())&&e.preventDefault();break}case Ss.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case Ss.UP:this.navigateUpDown(!0,e);break;case Ss.DOWN:this.navigateUpDown(!1,e);break;case Ss.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=Dy(this.beans,this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}break}}navigateUpDown(e,t){this.hasFocus()&&this.focusSvc.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusSvc.focusLastHeader():this.focusSvc.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return ky(this.beans)===this.getFocusableElement()}};import{Component as Uy,FilterButtonComp as Wy,RefPlaceholder as Ky,_exists as $y,_removeFromParent as jy}from"ag-grid-community";import{BeanStub as Yy,DragSourceType as qy}from"ag-grid-community";var xl=class extends Yo{},Xy=class extends Yy{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new xl(this.comp,this.virtualList,{dragSourceType:qy.AdvancedFilterBuilder,addListeners:(e,t,s)=>{e.addManagedListeners(this,{advancedFilterBuilderDragStarted:t,advancedFilterBuilderDragEnded:s})},getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}};import{Component as Zy,RefPlaceholder as Jy,_setAriaLabel as Qy,_setAriaLevel as ew}from"ag-grid-community";import{AgInputTextFieldSelector as tw,_setAriaLabel as sw,_setAriaLabelledBy as iw,_setDisplayed as rw,_stopPropagationForAgGrid as aw}from"ag-grid-community";import{AgInputTextFieldSelector as nw,AgPickerField as ow,KeyCode as ae,RefPlaceholder as Fl,_addGridCommonParams as lw,_clearElement as da,_createIconNoSpan as cw,_debounce as Rl,_exists as Al,_fuzzySuggestions as dw,_getActiveDomElement as uw,_getEditorRendererDetails as hw,_isElementOverflowingCallback as pw,_isEventFromPrintableCharacter as gw,_isVisible as fw,_setAriaActiveDescendant as mw,_stopPropagationForAgGrid as Cw}from"ag-grid-community";import{Component as vw,KeyCode as _t,_clearElement as Sw,_findFocusableElements as bw,_findNextFocusableElement as yw,_getActiveDomElement as Ml,_getDocument as ww,_setAriaPosInSet as xw,_setAriaRole as Fw,_setAriaSetSize as Rw}from"ag-grid-community";import{Component as Aw,RefPlaceholder as Tl}from"ag-grid-community";var Mw={tag:"div",cls:"ag-pill",role:"option",children:[{tag:"span",ref:"eText",cls:"ag-pill-text"},{tag:"span",ref:"eButton",cls:"ag-button ag-pill-button",role:"presentation"}]},Tw=class extends Aw{constructor(e){super(Mw),this.config=e,this.eText=Tl,this.eButton=Tl}postConstruct(){const{config:e,eButton:t}=this,{onKeyDown:s,onButtonClick:i}=e;this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),this.addGuiEventListener("focus",()=>{this.eButton.focus()}),s&&this.addGuiEventListener("keydown",s),i&&this.addManagedElementListeners(t,{click:i})}toggleCloseButtonClass(e,t){this.eButton.classList.toggle(e,t)}setText(e){this.eText.textContent=e}getText(){return this.eText.textContent}},Pw={tag:"div",cls:"ag-pill-container"},Iw=class extends vw{constructor(){super(Pw),this.pills=[]}init(e){this.params=e,this.getKey=e.valueFormatter??(t=>String(t)),this.refresh()}refresh(){this.clearPills();const{params:e,onPillKeyDown:t,getKey:s}=this;let i=e.getValue();if(!Array.isArray(i)){if(i==null)return;i=[i]}const r=e.valueFormatter??(n=>String(n)),a=i.length;Fw(this.getGui(),a===0?"presentation":"listbox");for(let n=0;n<a;n++){const o=i[n],l=this.createBean(new Tw({onButtonClick:()=>this.onPillButtonClick(l),onKeyDown:t.bind(this)})),c=l.getGui();xw(c,n+1),Rw(c,a),e.onPillMouseDown&&l.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&l.addGuiEventListener("focus",e.announceItemFocus),l.setText(r(o)??""),l.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(c),this.pills.push({key:s(o)??n.toString(),pill:l})}}onNavigationKeyDown(e){const{key:t}=e;if(!this.pills.length||t!==_t.LEFT&&t!==_t.RIGHT)return;e.preventDefault();const{params:s,beans:i}=this,r=Ml(i),a=this.getGui();if(a.contains(r)){const n=yw(i,a,!1,t===_t.LEFT);n?n.focus():s.eWrapper&&s.eWrapper.focus()}else{const n=bw(a);n.length>0&&n[t===_t.RIGHT?0:n.length-1].focus()}}clearPills(){const e=this.getGui();e.contains(Ml(this.beans))&&this.params.eWrapper&&this.params.eWrapper.focus(),Sw(e),this.destroyBeans(this.pills.map(({pill:t})=>t)),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t!==_t.DELETE&&t!==_t.BACKSPACE)return;e.preventDefault();const s=ww(this.beans),i=this.pills.findIndex(({pill:a})=>a.getGui().contains(s.activeElement));if(i===-1)return;const r=this.pills[i];r?.pill&&this.deletePill(r.pill,i)}deletePill(e,t){const{getKey:s,pills:i,params:r}=this,a=(i[t??-1]??i.find(({pill:o})=>o===e))?.key,n=(r.getValue()||[]).filter(o=>s(o)!==a);if(r.setValue(n),!n.length&&r.eWrapper)r.eWrapper.focus();else if(t!=null){const{pill:o}=i[Math.min(t,i.length-1)];o&&o.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},Ew=".ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-virtual-list-viewport.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-rich-select-loading){display:flex;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}.ag-pill-button:hover{color:var(--ag-accent-color);cursor:pointer}";import{KeyCode as Dw,_createElement as Pl,_createIconNoSpan as Lw,_requestAnimationFrame as Il,_setAriaActiveDescendant as kw,_setAriaControlsAndLabel as Gw,_setAriaLabel as Ow,_setDisplayed as mt}from"ag-grid-community";import{Component as _w,_addGridCommonParams as Nw,_clearElement as Bw,_createElement as El,_exists as bs,_getEditorRendererDetails as Vw,_isElementOverflowingCallback as Hw,_setAriaSelected as zw,_toString as Uw}from"ag-grid-community";var Ww={tag:"div",cls:"ag-rich-select-row",role:"presentation"},Kw=class extends _w{constructor(e){super(Ww),this.params=e}wireBeans(e){this.userCompFactory=e.userCompFactory,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("highlightTooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0},this))}setState(e){const{params:t}=this,s=t.valueFormatter?.(e)??"";this.populateWithRenderer(e,s)||this.populateWithoutRenderer(e,s),this.value=e}highlightString(e){const{parsedValue:t,params:s}=this;if(s.cellRenderer||!bs(t))return;let i=bs(e);if(i){const r=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(r>=0){const a=r+e.length,n=this.getGui().querySelector("span");n&&(Bw(n),n.append(t.slice(0,r),El({tag:"span",cls:"ag-rich-select-row-text-highlight",children:t.slice(r,a)}),t.slice(a)))}else i=!1}i||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();zw(t.parentElement,e),this.toggleCss("ag-rich-select-row-selected",e)}getValue(){return this.value}toggleHighlighted(e){this.toggleCss("ag-rich-select-row-highlighted",e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}populateWithoutRenderer(e,t){const s=this.getGui(),i=El({tag:"span"});i.style.overflow="hidden",i.style.textOverflow="ellipsis";const r=Uw(bs(t)?t:e);this.parsedValue=bs(r)?r:null,s.appendChild(i),this.renderValueWithoutRenderer(r),this.shouldDisplayTooltip=Hw(()=>i),this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue)}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.textContent=bs(e)?e:"\xA0")}populateWithRenderer(e,t){let s,i;const{cellRenderer:r,cellRendererParams:a}=this.params;if(r){const n=this.getParentComponent()?.getParentComponent();i=Vw(this.userCompFactory,this.params,Nw(this.gos,{value:e,valueFormatted:t,cellRendererParams:a,getValue:()=>n?.getValue(),setValue:o=>{n?.setValue(o,!0)},setTooltip:(o,l)=>{this.gos.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=l,this.tooltipFeature?.setTooltipAndRefresh(o)}}))}return i&&(s=i.newAgStackInstance()),s&&Ol(s,this.getGui()),s?(s.then(n=>{this.addDestroyFunc(()=>{this.destroyBean(n)})}),!0):!1}},Dl="ag-rich-select-list",Ll="ag-rich-select-row",kl=0,$w=1,ua=2,ha=3,jw=class extends Ot{constructor(e,t,s){super({cssIdentifier:"rich-select"}),this.params=e,this.richSelectWrapper=t,this.getSearchString=s,this.lastRowHovered=-1,this.selectedItems=new Set,this.loadingState=ha,this.params=e,this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct();const e=this.getLocaleTextFunc();this.loadingLabel=e("loadingOoo","Loading..."),this.noMatchesLabel=e("noMatches","No matches to show"),this.eLoadingIcon=Lw("richSelectLoading",this.beans,null),this.eStateCompLabel=Pl({tag:"span",cls:"ag-loading-text",children:this.loadingLabel}),this.eStateComp=Pl({tag:"div",cls:"ag-rich-select-loading",children:[{tag:"span",cls:"ag-loading-icon",children:[this.eLoadingIcon?()=>this.eLoadingIcon:void 0]},{tag:"span",cls:"ag-loading-text",children:[()=>this.eStateCompLabel]}]}),this.appendChild(this.eStateComp);const{cellRowHeight:t,pickerAriaLabelKey:s,pickerAriaLabelValue:i}=this.params;t&&this.setRowHeight(t);const r=this.getGui(),a=this.getAriaElement();this.addManagedListeners(r,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this)}),r.classList.add(Dl);const n=`${Dl}-${this.getCompId()}`;a.setAttribute("id",n);const l=this.getLocaleTextFunc()(s,i);Ow(a,l),Gw(this.richSelectWrapper,a)}setIsLoading(){this.setLoadingState(kl)}setLoadingState(e){this.loadingState=e,this.toggleStateComp(),this.toggleVisibility()}toggleStateComp(){const{eStateComp:e,eStateCompLabel:t,eLoadingIcon:s,loadingState:i,loadingLabel:r,noMatchesLabel:a,params:n}=this;if(e){if(i===kl){t.textContent=r,s&&mt(s,!0),mt(e,!0);return}if(i===ua&&n.allowNoResultsCopy){t.textContent=a,s&&mt(s,!1),mt(e,!0);return}mt(e,!1)}}shouldBeVisible(){return this.loadingState===ua?!!this.params.allowNoResultsCopy:this.loadingState!==ha}toggleVisibility(e){const t=this.getGui();e===void 0?mt(t,this.shouldBeVisible()):mt(t,e)}navigateToPage(e){const t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&Il(this.beans,()=>{if(!this.isAlive())return null;this.highlightIndex(t)}),t}drawVirtualRows(e){super.drawVirtualRows(e),this.refreshSelectedItems()}highlightFilterMatch(e){this.forEachRenderedRow(t=>{t.highlightString(e)})}onNavigationKeyDown(e,t){Il(this.beans,()=>{if(!this.currentList||!this.isAlive())return;const s=this.currentList.length,i=this.lastRowHovered,r=e===Dw.DOWN?1:-1,a=Math.min(Math.max(i===-1?0:i+r,0),s-1);this.highlightIndex(a),t()})}selectValue(e){if(!this.currentList||e==null)return!1;const t=this.getIndicesForValues(e),s=t.length>0;return s&&(this.refresh(),this.ensureIndexVisible(t[0]),this.refresh(!0)),this.selectListItems(Array.isArray(e)?e:[e]),s}selectListItems(e,t=!1){t||this.selectedItems.clear();for(let s=0;s<e.length;s++){const i=e[s];this.findItemInSelected(i)===void 0&&this.selectedItems.add(i)}this.refreshSelectedItems()}getCurrentList(){return this.currentList}setCurrentList(e){const t=Yw(e);this.setLoadingState(t),e||(e=[]),this.currentList=e,this.setModel({getRowCount:()=>e.length,getRow:s=>e[s],areRowsEqual:(s,i)=>s===i})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList?.[this.lastRowHovered]}highlightIndex(e,t){this.currentList&&(e<0||e>=this.currentList.length?this.lastRowHovered=-1:(this.lastRowHovered=e,this.ensureIndexVisible(e,!t)&&!t&&this.refresh(!0)),this.forEachRenderedRow((s,i)=>{const r=e===i;if(s.toggleHighlighted(r),r){const a=`${Ll}-${s.getCompId()}`;kw(this.richSelectWrapper,a),this.richSelectWrapper.setAttribute("data-active-option",a)}}))}getIndicesForValues(e){const{currentList:t}=this;if(!t||t.length===0||e==null)return[];if(Array.isArray(e)||(e=[e]),e.length===0)return[];const{valueFormatter:s}=this.params,i=[],r=typeof e[0]=="object",a=t.map(s);for(const n of e){let o=-1;r?o=a.indexOf(s(n)):o=t.indexOf(n),o>=0&&i.push(o)}return i}toggleListItemSelection(e){const t=this.findItemInSelected(e);t!==void 0?this.selectedItems.delete(t):this.selectedItems.add(e),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{const t=this.findItemInSelected(e.getValue())!==void 0;e.updateSelected(t)})}findItemInSelected(e){if(typeof e=="object"){const t=this.params.valueFormatter,s=t(e);for(const i of this.selectedItems)if(t(i)===s)return i}else return this.selectedItems.has(e)?e:void 0}createRowComponent(e,t){const s=new Kw(this.params);t.setAttribute("id",`${Ll}-${s.getCompId()}`),s.setParentComponent(this),this.createBean(s),s.setState(e);const{highlightMatch:i,searchType:r="fuzzy"}=this.params;return i&&r!=="fuzzy"&&s.highlightString(this.getSearchString()),s}getRowForMouseEvent(e){if(!this.model)return-1;const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),r=e.clientY-s.top+i;return Math.min(Math.floor(r/this.getRowHeight()),this.model.getRowCount()-1)}onMouseMove(e){const t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.highlightIndex(t,!0))}onMouseDown(e){e.preventDefault()}onMouseOut(e){this.getGui().contains(e.relatedTarget)||this.highlightIndex(-1)}onClick(e){const{multiSelect:t}=this.params;if(!this.currentList?.length)return;const s=this.getRowForMouseEvent(e),i=this.currentList[s];t?this.toggleListItemSelection(i):(this.selectListItems([i]),this.dispatchValueSelected())}dispatchValueSelected(){this.dispatchLocalEvent({type:"richSelectListRowSelected",fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eStateComp=void 0}};function Yw(e){return e?e.length?$w:ua:ha}var qw=300,Xw={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-rich-select-value ag-picker-collapsed",children:[{tag:"span",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"span",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Ri=class extends ow{constructor(e){super({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"richSelectOpen",ariaRole:"combobox",template:e?.template??Xw,agComponents:[nw],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.searchStringCreator=null,this.eInput=Fl,this.eDeselect=Fl,this.skipWrapperAnnouncement=!1;const{value:t,valueList:s,searchStringCreator:i,onSearch:r}=e||{};t!==void 0&&(this.value=t),i&&(this.searchStringCreator=i),s!=null&&this.setValueList({valueList:s,isInitial:!0});const{searchDebounceDelay:a=qw}=this.config;r&&(this.onSearchCallbackDebounced=Rl(this,r,a)),this.registerCSS(Ew)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.ariaAnnounce=e.ariaAnnounce,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0})),super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(cw("richSelectRemove",this.beans));const{allowTyping:e,placeholder:t,suppressDeselectAll:s}=this.config;this.eDeselect.classList.add("ag-hidden"),e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.setupAriaProperties();const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Rl(this,this.clearSearchString.bind(this),i),this.renderSelectedValue(),e&&this.eInput.onValueChange(r=>this.searchTextFromString(r)),this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),s||this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){const{eWrapper:e,gos:t}=this;e.tabIndex=t.get("tabIndex");const s=this.getLocaleTextFunc();this.ariaDeleteSelection=s("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=s("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=s("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new jw(this.config,this.getFocusableElement(),()=>this.searchString)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(e){const{value:t,eDisplayField:s,config:i,gos:r}=this,{allowTyping:a,cellRenderer:n,cellRendererParams:o,initialInputValue:l,multiSelect:c,suppressDeselectAll:d,suppressMultiSelectPillRenderer:u,valueFormatter:h,onSearch:p}=i,g=Gl(t,h);if(a){this.eInput.setValue(l??g,!!e&&!!p);return}if(c&&!d){const C=t==null||Array.isArray(t)&&t.length===0;this.eDeselect.classList.toggle("ag-hidden",C)}let f;if(c&&!u){this.createOrUpdatePillContainer(s);return}n&&(f=hw(this.userCompFactory,i,lw(this.gos,{value:t,valueFormatted:g,cellRendererParams:o,getValue:()=>this.getValue(),setValue:C=>{this.setValue(C,!0)},setTooltip:(C,v)=>{r.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=v,this.tooltipFeature?.setTooltipAndRefresh(C)}})));let m;if(f&&(m=f.newAgStackInstance()),m)da(s),Ol(m,s),m.then(C=>{this.addDestroyFunc(()=>this.destroyBean(C))});else{if(Al(this.value))s.innerText=g,s.classList.remove("ag-display-as-placeholder");else{const{placeholder:C}=i;Al(C)?(s.textContent=C,s.classList.add("ag-display-as-placeholder")):da(s)}this.shouldDisplayTooltip=pw(()=>this.eDisplayField),this.tooltipFeature?.setTooltipAndRefresh(g??null)}}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueListInternal(e){const{listComponent:t,isPickerDisplayed:s,value:i}=this,{valueList:r,refresh:a,isInitial:n}=e;n&&this.setValues(r),t&&(this.listComponent?.setCurrentList(r),a&&(this.values?t.refresh(!0):s&&(t.selectValue(i)||t.refresh()),this.alignPickerToComponent()))}setValueList(e){const{valueList:t}=e;if(!t||Array.isArray(t)){this.setValueListInternal(e);return}this.listComponent?.setIsLoading(),t.then(s=>{s&&this.setValueListInternal({...e,valueList:s})})}setValues(e){this.values=e,this.searchStrings=this.getSearchStringsFromValues(e||[])}showPicker(){const{listComponent:e,value:t}=this;if(!e)return;super.showPicker();let s=t;t===void 0&&(s=null),e.selectValue(s);const i=e.getIndicesForValues(Array.isArray(s)?s:[s])[0];i!=null?(this.tooltipFeature?.attemptToHideTooltip(),e.highlightIndex(i)):e.refresh()}createOrUpdatePillContainer(e){if(!this.pillContainer){const t=this.pillContainer=this.createBean(new Iw);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),da(e),e.appendChild(t.getGui());const{config:s,eWrapper:i,ariaDeleteSelection:r}=this,{valueFormatter:a}=s;t.init({eWrapper:i,valueFormatter:a,onPillMouseDown:n=>{n.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(r)},getValue:()=>this.getValue(),setValue:n=>this.setValue(n,!0)})}this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh())}doWhileBlockingAnnouncement(e){this.skipWrapperAnnouncement=!0,e(),this.skipWrapperAnnouncement=!1}onWrapperFocus(){const{eInput:e,config:t}=this,{allowTyping:s,multiSelect:i,suppressDeselectAll:r}=t;if(s){const a=e.getFocusableElement();a.focus(),a.select()}else i&&!r&&!this.skipWrapperAnnouncement&&this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}onDeselectAllMouseDown(e){e.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===ae.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!gw(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e==null&&(e=""),this.searchString=e,this.runSearch()}getSearchStringsFromValues(e){const{config:{valueFormatter:t}}=this;return typeof e[0]=="object"&&this.searchStringCreator?this.searchStringCreator(e):e.map(s=>Gl(s,t))}filterListModel(e){const{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;if(this.onSearchCallbackDebounced){this.onSearchCallbackDebounced(this.searchString);return}const e=this.searchStrings;if(!e){this.listComponent.highlightIndex(-1);return}const{suggestions:t,filteredValues:s}=this.getSuggestionsAndFilteredValues(this.searchString,e),{filterList:i,highlightMatch:r,searchType:a="fuzzy"}=this.config,n=!!(i&&this.searchString!=="");this.filterListModel(n?s:this.values||[]),this.highlightEmptyValue()||this.highlightListValue(t,s,n),r&&a!=="fuzzy"&&this.listComponent?.highlightFilterMatch(this.searchString),this.listComponent?.toggleVisibility()}highlightEmptyValue(){if(this.searchString===""){const e=this.searchStrings?.indexOf("");if(e!==void 0&&e!==-1)return this.listComponent?.highlightIndex(e),!0}return!1}highlightListValue(e,t,s){if(e.length){const i=s?0:this.searchStrings?.indexOf(e[0]);i!==void 0&&this.listComponent?.highlightIndex(i)}else if(this.listComponent?.highlightIndex(-1),!s||t.length)this.listComponent?.ensureIndexVisible(0);else if(s){this.getAriaElement().removeAttribute("data-active-option");const i=this.listComponent?.getAriaElement();i&&mw(i,null)}}getSuggestionsAndFilteredValues(e,t){let s=[];const i=[];if(!e.length)return{suggestions:s,filteredValues:i};const{searchType:r="fuzzy",filterList:a}=this.config,n=this.values||[];if(r==="fuzzy"){const o=dw({inputValue:e,allSuggestions:t,hideIrrelevant:!0});s=o.values;const l=o.indices;if(a&&l.length)for(let c=0;c<l.length;c++)i.push(n[l[c]])}else s=t.filter((o,l)=>{const c=o.toLocaleLowerCase(),d=this.searchString.toLocaleLowerCase(),u=r==="match"?c.startsWith(d):c.includes(d);return a&&u&&i.push(n[l]),u});return{suggestions:s,filteredValues:i}}clearSearchString(){this.searchString=""}setValue(e,t,s,i){if(this.value===e)return this;const r=Array.isArray(e);if(e!=null){if(!r){const a=this.listComponent?.getCurrentList();if((a?a.indexOf(e):-1)===-1)return this}s||this.listComponent?.selectValue(e)}return super.setValue(e,t),i||this.renderSelectedValue(s),this}onNavigationKeyDown(e,t,s){e.preventDefault();const i=t===ae.DOWN;if(!this.isPickerDisplayed&&i){this.showPicker();return}this.listComponent?.onNavigationKeyDown(t,s)}onEnterKeyDown(e){if(this.isPickerDisplayed&&(e.preventDefault(),this.listComponent?.getCurrentList())){const t=this.listComponent.getLastItemHovered();this.config.multiSelect||t===void 0?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([t]),!0)}}onDeleteKeyDown(e){const{eWrapper:t,beans:s}=this;uw(s)===t&&(e.preventDefault(),this.setValue([],!0))}onTabKeyDown(){const{config:e,isPickerDisplayed:t,listComponent:s}=this,{multiSelect:i}=e;if(!(!t||!s)){if(i){const r=this.getValueFromSet(s.getSelectedItems());r&&this.setValue(r,!1,!0,!0)}else{const r=s.getLastItemHovered();r!==void 0&&this.setValue(r,!1,!0)}this.hidePicker()}}getValueFromSet(e){const{multiSelect:t}=this.config;let s=null;for(const i of e){if(e.size===1&&!t){s=i;break}s||(s=[]),s.push(i)}return Array.isArray(s)&&s.sort(),s}onListValueSelected(e,t){const s=this.getValueFromSet(e);this.setValue(s,!1,!0),this.config.multiSelect||this.dispatchPickerEventAndHidePicker(s,t)}dispatchPickerEventAndHidePicker(e,t){const s={type:"fieldPickerValueSelected",fromEnterKey:t,value:e};this.dispatchLocalEvent(s),this.hidePicker()}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const{key:t,isComposing:s}=e,{isPickerDisplayed:i,config:{allowTyping:r,multiSelect:a,suppressDeselectAll:n},listComponent:o,pickerComponent:l}=this;switch(t){case ae.LEFT:case ae.RIGHT:(!r||this.pillContainer)&&(e.preventDefault(),this.pillContainer&&(this.listComponent?.highlightIndex(-1),this.pillContainer.onNavigationKeyDown(e)));break;case ae.PAGE_HOME:case ae.PAGE_END:if(r){e.preventDefault();const c=this.eInput.getInputElement(),d=t===ae.PAGE_HOME?0:c.value.length;c.setSelectionRange(d,d);break}case ae.PAGE_UP:case ae.PAGE_DOWN:e.preventDefault(),l&&o?.navigateToPage(t);break;case ae.DOWN:case ae.UP:s||this.onNavigationKeyDown(e,t,()=>{a&&(this.doWhileBlockingAnnouncement(()=>this.eWrapper.focus()),this.announceAriaValue(this.ariaToggleSelection))});break;case ae.ESCAPE:i&&(fw(this.listComponent.getGui())&&(e.preventDefault(),Cw(e)),this.hidePicker());break;case ae.ENTER:s?e.preventDefault():this.onEnterKeyDown(e);break;case ae.SPACE:if((!r||s)&&e.preventDefault(),!s&&i&&a&&o){const c=o.getLastItemHovered();c!==void 0&&o.toggleListItemSelection(c)}break;case ae.TAB:this.onTabKeyDown();break;case ae.DELETE:a&&!n&&this.onDeleteKeyDown(e);break;default:r||this.buildSearchStringFromKeyboardEvent(e)}}announceAriaValue(e){this.ariaAnnounce?.announceValue(e,"richSelect")}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),this.searchStrings=void 0,super.destroy()}},Gl=(e,t)=>t?.(e)??String(e??"");function Ol(e,t){e.then(s=>{const i=s.getGui();i!=null&&t.appendChild(i)})}var Zw={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},_l=class extends Ri{constructor(e){super({...e,template:Zw,agComponents:[tw]}),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;rw(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),iw(this.eWrapper,""),sw(this.eWrapper,t)}onEnterKeyDown(e){aw(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}};import{BeanStub as Jw,KeyCode as ys,_getActiveDomElement as Nl,_isStopPropagationForAgGrid as Bl,_stopPropagationForAgGrid as Ai}from"ag-grid-community";var Vl=class extends Jw{constructor(e,t,s){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=s}postConstruct(){this.addManagedElementListeners(this.eGui,{keydown:t=>{switch(t.key){case ys.TAB:t.defaultPrevented||Ai(t);break;case ys.UP:case ys.DOWN:Ai(t);break;case ys.ESCAPE:if(Bl(t))return;this.eGui.contains(Nl(this.beans))&&(t.preventDefault(),Ai(t),this.focusWrapper.focus());break}}});const e="ag-advanced-filter-builder-virtual-list-item-highlight";this.addManagedListeners(this.focusWrapper,{keydown:t=>{if(t.key===ys.ENTER){if(Bl(t))return;Nl(this.beans)===this.focusWrapper&&(t.preventDefault(),Ai(t),this.eFocusableComp.getFocusableElement().focus())}},focusin:()=>{this.focusWrapper.classList.add(e)},focusout:t=>{this.focusWrapper.contains(t.relatedTarget)||this.focusWrapper.classList.remove(e)}})}};function Hl(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:s=>s==null?"":s.displayValue??s.key,pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${t??120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}var Qw={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",ref:"eItem",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"},children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"}]}]}]},ex=class extends Zy{constructor(e,t){super(Qw),this.item=e,this.focusWrapper=t,this.eItem=Jy}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){ew(this.focusWrapper,2);const e=Hl(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new _l(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>{this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}}),this.eItem.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>t.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new Vl(this.getGui(),this.focusWrapper,t)),Qy(this.focusWrapper,this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}};import{DragSourceType as tx,KeyCode as pa,RefPlaceholder as qe,TabGuardComp as sx,_createElement as zl,_createIconNoSpan as ws,_removeAriaExpanded as ix,_setAriaDisabled as Ul,_setAriaExpanded as Wl,_setAriaLabel as Mi,_setAriaLevel as rx,_setDisplayed as Ti,_setVisible as ax,_stopPropagationForAgGrid as ga}from"ag-grid-community";import{Component as nx,_exists as xs,_removeFromParent as ox,_toStringOrNull as lx}from"ag-grid-community";var cx=class extends nx{constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"}),this.validationMessage=null}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}init(e){const{item:t,createPill:s}=e;this.item=t,this.createPill=s,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advFilterExpSvc.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){const t=this.advFilterExpSvc.getColumnDetails(e.colId);this.baseCellDataType=t.baseCellDataType,this.column=t.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:this.getColumnDisplayValue()??this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getColumnAutocompleteEntries()}),update:s=>this.setColumnKey(s),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),xs(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:this.getOperatorDisplayValue()??this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){const{filter:e}=this.filterModel,t=(typeof e=="number"||typeof e=="bigint"?lx(e):e)??"";this.eOperandPill=this.createPill({key:t,valueFormatter:s=>this.advFilterExpSvc.getOperandDisplayValue({...this.filterModel,filter:s},!0),baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:s=>this.setOperand(s),ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advFilterExpSvc.getColumnDetails(e);this.column=t.column;const s=t.baseCellDataType;this.baseCellDataType!==s&&(this.baseCellDataType=s,this.setOperatorKey(void 0),this.eOperatorPill&&(ox(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,t===0?this.destroyOperandPill():(this.createOperandPill(),this.baseCellDataType!=="number"&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){let t=e;this.baseCellDataType==="number"&&(t=xs(e)?Number(e):""),this.filterModel.filter=t,this.validate()}getNumOperands(e){return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType,e)?.numOperands??0}destroyOperandPill(){delete this.filterModel.filter,this.eOperandPill?.getGui().remove(),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;xs(this.getColumnKey())?xs(this.getOperatorKey())?this.numOperands>0&&!xs(this.getOperandDisplayValue())&&(e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationEnterValue")):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectOption"):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchLocalEvent({type:"advancedFilterBuilderValidChanged"}))}getDefaultColumnDisplayValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectOption")}};import{AgInputDateField as Pi,AgInputNumberField as dx,AgInputTextField as Ii,Component as ux,KeyCode as fa,RefPlaceholder as Kl,_exists as hx,_setAriaDescribedBy as px,_setAriaLabel as gx,_setDisplayed as $l,_stopPropagationForAgGrid as ma}from"ag-grid-community";var fx={number:[dx],bigint:[Ii],boolean:[Ii],object:[Ii],text:[Ii],date:[Pi],dateString:[Pi],dateTime:[Pi,e=>e.setIncludeTime(!0)],dateTimeString:[Pi,e=>e.setIncludeTime(!0)]},mx={tag:"div",cls:"ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"ePill",cls:"ag-advanced-filter-builder-pill",role:"button",children:[{tag:"span",ref:"eLabel",cls:"ag-advanced-filter-builder-pill-display"}]}]},Cx=class extends ux{constructor(e){super(mx),this.params=e,this.ePill=Kl,this.eLabel=Kl;const{value:t,valueFormatter:s}=e;this.value=t,this.displayValue=s(t)}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,px(this.ePill,this.eLabel.id),gx(this.ePill,t),this.renderValue(),this.addManagedListeners(this.ePill,{click:s=>{s.preventDefault(),this.showEditor()},keydown:s=>{s.key===fa.ENTER&&(s.preventDefault(),ma(s),this.showEditor())}}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;$l(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedElementListeners(e,{keydown:t=>{switch(t.key){case fa.ENTER:t.preventDefault(),ma(t),this.updateValue(!0);break;case fa.ESCAPE:t.preventDefault(),ma(t),this.hideEditor(!0);break}},focusout:()=>this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){const[t,s]=fx[e],i=this.createBean(new t);return s?.(i),i}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,t.getGui().remove(),this.destroyBean(t),$l(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;const{displayValue:t,eLabel:s,params:i}=this,{type:r}=i,{classList:a}=s;a.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),hx(t)?r==="number"||r==="bigint"?(e=t,a.add("ag-advanced-filter-builder-value-number")):(e=`"${t}"`,a.add("ag-advanced-filter-builder-value-text")):(e=this.advFilterExpSvc.translate("advancedFilterBuilderEnterValue"),a.add("ag-advanced-filter-builder-value-empty")),s.textContent=e}updateValue(e){if(!this.eEditor)return;const t=this.eEditor.getValue()??"";this.dispatchLocalEvent({type:"fieldValueChanged",value:t}),this.value=t,this.displayValue=this.params.valueFormatter(t),this.renderValue(),this.hideEditor(e)}};import{Component as vx}from"ag-grid-community";var Sx=class extends vx{wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"})}init(e){const{item:t,createPill:s}=e,i=t.filterModel;this.filterModel=i,this.ePill=s({key:i.type,displayValue:this.advFilterExpSvc.parseJoinOperator(i),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getJoinOperatorAutocompleteEntries()}),update:r=>i.type=r,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advFilterExpSvc.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}};import{AgInputTextFieldSelector as bx,_setAriaLabel as yx,_setAriaLabelledBy as wx,_stopPropagationForAgGrid as xx}from"ag-grid-community";var Fx={tag:"div",cls:"ag-picker-field ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display ag-advanced-filter-builder-pill-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Rx=class extends Ri{constructor(e){super({...e,template:Fx,agComponents:[bx]}),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),wx(this.eWrapper,""),yx(this.eWrapper,t)}createPickerComponent(){if(!this.values){const{values:e}=this.params.getEditorParams();this.values=e;const t=this.value.key,s=e.find(i=>i.key===t)??{key:t,displayValue:this.value.displayValue};this.value=s}return super.createPickerComponent()}onEnterKeyDown(e){xx(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},Ax={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",ref:"eTreeLines",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eValidation",cls:"ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid",attrs:{"aria-hidden":"true"}}]},{tag:"div",ref:"eButtons",cls:"ag-advanced-filter-builder-item-buttons",children:[{tag:"span",ref:"eMoveUpButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"span",ref:"eMoveDownButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"div",ref:"eAddButton",role:"presentation"},{tag:"span",ref:"eRemoveButton",cls:"ag-advanced-filter-builder-item-button",role:"button"}]}]},Ca=class extends sx{constructor(e,t,s){super(Ax),this.item=e,this.dragFeature=t,this.focusWrapper=s,this.eTreeLines=qe,this.eDragHandle=qe,this.eButtons=qe,this.eValidation=qe,this.eMoveUpButton=qe,this.eMoveDownButton=qe,this.eAddButton=qe,this.eRemoveButton=qe,this.moveUpDisabled=!1,this.moveDownDisabled=!1}wireBeans(e){this.dragAndDrop=e.dragAndDrop,this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){const{filterModel:e,level:t,showMove:s}=this.item,i=e.filterType==="join";if(this.ePillWrapper=this.createManagedBean(i?new Sx:new cx),this.ePillWrapper.init({item:this.item,createPill:r=>this.createPill(r)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),t===0){const r=zl({tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-bottom ag-advanced-filter-builder-item-tree-line-root"});this.eTreeLines.appendChild(r),Ti(this.eDragHandle,!1),Ti(this.eButtons,!1),Wl(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(ws("advancedFilterBuilderDrag",this.beans)),this.setupValidation(),this.setupMoveButtons(s),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();rx(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new Vl(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListeners(this.ePillWrapper,{advancedFilterBuilderValueChanged:()=>this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}),advancedFilterBuilderValidChanged:()=>this.updateValidity()})}setState(e){const{level:t}=this.item;if(t===0)return;const{showMove:s}=this.item,{disableMoveUp:i,disableMoveDown:r,treeLines:a,showStartTreeLine:n}=e;this.updateTreeLines(a,n),this.updateAriaExpanded(),s&&(this.moveUpDisabled=!!i,this.moveDownDisabled=!!r,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",i),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",r),Ul(this.eMoveUpButton,!!i),Ul(this.eMoveDownButton,!!r),this.moveUpTooltipFeature?.refreshTooltip(),this.moveDownTooltipFeature?.refreshTooltip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;t<e;t++)this.eTreeLines.appendChild(zl({tag:"div",cls:"ag-advanced-filter-builder-item-tree-line"}))}updateTreeLines(e,t){const s=e.length-1,{children:i}=this.eTreeLines;for(let a=0;a<s;a++){const n=i.item(a);n&&n.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!e[a])}const r=i.item(s);if(r){r.classList.add("ag-advanced-filter-builder-item-tree-line-horizontal");const a=e[s];r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-top",a),r.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!a)}this.eDragHandle.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-bottom",t)}setupValidation(){this.eValidation.appendChild(ws("advancedFilterBuilderInvalid",this.beans)),this.validationTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){const e=Hl(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new _l(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}),this.eAddButton.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(ws("advancedFilterBuilderRemove",this.beans)),this.addManagedListeners(this.eRemoveButton,{click:()=>this.removeItem(),keydown:e=>{e.key===pa.ENTER&&(e.preventDefault(),ga(e),this.removeItem())}}),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")})),Mi(this.eRemoveButton,this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(ws("advancedFilterBuilderMoveUp",this.beans)),this.addManagedListeners(this.eMoveUpButton,{click:()=>this.moveItem(!0),keydown:t=>{t.key===pa.ENTER&&(t.preventDefault(),ga(t),this.moveItem(!0))}}),this.moveUpTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")})),Mi(this.eMoveUpButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(ws("advancedFilterBuilderMoveDown",this.beans)),this.addManagedListeners(this.eMoveDownButton,{click:()=>this.moveItem(!1),keydown:t=>{t.key===pa.ENTER&&(t.preventDefault(),ga(t),this.moveItem(!1))}}),this.moveDownTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")})),Mi(this.eMoveDownButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(Ti(this.eMoveUpButton,!1),Ti(this.eMoveDownButton,!1))}updateValidity(){ax(this.eValidation,!this.item.valid),this.validationTooltipFeature?.refreshTooltip(),this.updateAriaLabel()}createPill(e){const{key:t,cssClass:s,update:i,ariaLabel:r}=e,a=n=>{n!=null&&(i(n),this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}))};if(e.isSelect){const{getEditorParams:n,pickerAriaLabelKey:o,pickerAriaLabelValue:l,displayValue:c}=e,d=this.gos.get("advancedFilterBuilderParams"),u=`${d?.pillSelectMinWidth??140}px`,h=`${d?.pillSelectMaxWidth??200}px`,p=this.createBean(new Rx({pickerAriaLabelKey:o,pickerAriaLabelValue:l,pickerType:"ag-list",value:{key:t,displayValue:c},valueFormatter:g=>g==null?"":g.displayValue??g.key,variableWidth:!0,minPickerWidth:u,maxPickerWidth:h,getEditorParams:n,wrapperClassName:s,ariaLabel:r,pickerIcon:"advancedFilterBuilderSelectOpen"}));return this.addManagedListeners(p,{fieldPickerValueSelected:({value:g})=>a(g?.key)}),p}else{const{baseCellDataType:n,valueFormatter:o}=e,l=this.createBean(new Cx({value:t,valueFormatter:o,cssClass:s,type:n,ariaLabel:r}));return this.addManagedListeners(l,{fieldValueChanged:({value:c})=>a(c)}),l}}setupDragging(){const e={type:tx.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>"notAllowed",getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragStarted",item:this.item}),onDragStopped:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragEnded"})};this.dragAndDrop.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDrop.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,s=this.ePillWrapper.getValidationMessage();let i;s?i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,s]):i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[e,t]),Mi(this.focusWrapper,i)}updateAriaExpanded(){ix(this.focusWrapper);const{filterModel:e}=this.item;e?.filterType==="join"&&e.conditions.length&&Wl(this.focusWrapper,!0)}removeItem(){this.dispatchLocalEvent({type:"advancedFilterBuilderRemoved",item:this.item})}moveItem(e){this.dispatchLocalEvent({type:"advancedFilterBuilderMoved",item:this.item,backwards:e})}},Mx={apply:"advancedFilterBuilderApply",clear:"advancedFilterBuilderClear",cancel:"advancedFilterBuilderCancel",reset:"advancedFilterBuilderReset"},Tx={tag:"div",cls:"ag-advanced-filter-builder",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eList",cls:"ag-advanced-filter-builder-list",role:"presentation"}]},Px=class extends Uy{constructor(){super(Tx),this.eList=Ky}wireBeans(e){this.filterManager=e.filterManager,this.advancedFilter=e.advancedFilter,this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){const e=this.gos.get("advancedFilterBuilderParams");this.params={buttons:["apply","cancel"],...e},this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:t})=>{this.params.showMoveButtons=!!t?.showMoveButtons,this.params.buttons=t?.buttons??["apply","cancel"],this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new Xy(this,this.virtualList)),this.resetButtonsPanel(this.params.buttons)}refresh(){const e=this.virtualList;let t=e.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),t!=null&&(e.getComponentAt(t)||(t=0),e.focusRow(t))}getNumItems(){return this.items.length}moveItem(e,t){!t||!e||this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}setupVirtualList(){const e=this.virtualList=this.createManagedBean(new Ot({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderList"),moveItemCallback:this.virtualListMoveItemCallback.bind(this)}));e.setComponentCreator(this.createItemComponent.bind(this)),e.setComponentUpdater(this.updateItemComponent.bind(this)),e.setRowHeight(40),this.eList.appendChild(e.getGui()),e.setModel({getRowCount:()=>this.items?.length||0,getRow:t=>this.items[t],areRowsEqual:(t,s)=>t===s}),this.buildList(),e.refresh()}resetButtonsPanel(e){const t=e&&e.length>0;let s=this.eButtons;if(t){const i=e.map(a=>({type:a,label:this.advFilterExpSvc.translate(Mx[a])}));if(!s){s=this.createBean(new Wy),this.appendChild(s.getGui());const a=n=>({event:o})=>{this.updateModel(n),this.afterAction(n,o)};s.addManagedListeners(s,{apply:a("apply"),clear:a("clear"),reset:a("reset"),cancel:a("cancel")}),this.eButtons=s}s.updateButtons(i);const r=s.getApplyButton();if(r){const a=n=>this.toggleCss("ag-advanced-filter-builder-validation",n);this.addManagedElementListeners(r,{mouseenter:()=>a(!0),mouseleave:()=>a(!1)})}}else s&&(jy(s.getGui()),this.eButtons=this.destroyBean(s))}updateModel(e){switch(e){case"apply":this.advancedFilter.setModel(this.filterModel),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":break;case"clear":this.filterModel=this.formatFilterModel(null),this.refreshList(!1);break}}afterAction(e,t){switch(e){case"apply":{t?.preventDefault(),this.close();break}case"reset":{this.close();break}case"cancel":{this.close();break}}}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,s){const i=this.items[t],r=i.filterModel?.filterType==="join"&&s==="bottom",a=r?i.filterModel:i.parent;if(!a||this.isChildOrSelf(a,e.filterModel)||i===e)return;this.removeItemFromParent(e);let n;r?n=0:(n=a.conditions.indexOf(i.filterModel),n===-1?n=a.conditions.length:s==="bottom"&&(n+=1)),a.conditions.splice(n,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||t.filterType==="join"&&t.conditions.some(s=>this.isChildOrSelf(e,s))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilter.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return e=e??{filterType:"join",type:"AND",conditions:[]},e.filterType!=="join"&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,s,i,r)=>{if(s.push({filterModel:t,level:i,parent:r,valid:!0,showMove:this.params.showMoveButtons}),t.filterType==="join"){for(const a of t.conditions)e(a,s,i+1,t);i===0&&s.push({filterModel:null,level:i+1,parent:t,valid:!0})}};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const t=[];for(const s of this.items)s.valid||t.push(s.filterModel);if(this.buildList(),t.length)for(const s of this.items)s.filterModel&&t.includes(s.filterModel)&&(s.valid=!1)}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const s=this.items.indexOf(e),i=(o,l)=>{const d=this.items.find(u=>u.filterModel===o)?.parent;if(d){const{conditions:u}=d;i(d,l),l.push(u[u.length-1]===o)}},r=[],{filterModel:a}=e;a&&(i(a,r),r[0]=!1);const n=a?.filterType==="join"&&!!a.conditions.length;t.setState({disableMoveUp:s===1,disableMoveDown:!this.canMoveDown(e,s),treeLines:r,showStartTreeLine:n})}createItemComponent(e,t){const s=this.createBean(e.filterModel?new Ca(e,this.dragFeature,t):new ex(e,t));return s.addManagedListeners(s,{advancedFilterBuilderRemoved:({item:i})=>this.removeItem(i),advancedFilterBuilderValueChanged:()=>this.validate(),advancedFilterBuilderAdded:({item:i,isJoin:r})=>this.addItem(i,r),advancedFilterBuilderMoved:({item:i,backwards:r})=>this.moveItemUpDown(i,r)}),s instanceof Ca&&this.updateItemComponent(e,s),s}addItem(e,t){const{parent:s,level:i,filterModel:r}=e,a=r?.filterType==="join",n=t?{filterType:"join",type:"AND",conditions:[]}:{},o=a?r:s;let l=a?0:o.conditions.indexOf(r);l>=0?(a||(l+=1),o.conditions.splice(l,0,n)):o.conditions.push(n);let c=this.items.indexOf(e);const d=c>=0;if(d){e.filterModel&&c++;const u=[{filterModel:n,level:a?i+1:i,parent:o,valid:t,showMove:this.params.showMoveButtons}];this.items.splice(c,0,...u)}this.refreshList(d),d&&this.virtualList.getComponentAt(c)?.afterAdd()}removeItem(e){const t=e.parent,{filterModel:s}=e,i=t.conditions.indexOf(s);t.conditions.splice(i,1);const r=e.filterModel?.filterType==="join",a=this.items.indexOf(e),n=!r&&a>=0;n&&this.items.splice(a,1),this.refreshList(n),a>=0&&this.virtualList.focusRow(a)}moveItemUpDown(e,t,s){const i=this.items.indexOf(e),r=t?i-1:i+1;if(r===0||!t&&!this.canMoveDown(e,i))return;const a=this.items[r],n=this.removeItemFromParent(e),{level:o,filterModel:l,parent:c}=e,{level:d,filterModel:u,parent:h}=a;if(t)if(d===o&&u.filterType==="join")u.conditions.push(l);else if(d<=o){const f=h.conditions.indexOf(u);h.conditions.splice(f,0,l)}else c.conditions[n-1].conditions.push(l);else if(d===o)if(u.filterType==="join")u.conditions.splice(0,0,l);else{const f=h.conditions.indexOf(u);h.conditions.splice(f+1,0,l)}else if(n<c.conditions.length)c.conditions.splice(n+1,0,l);else{const f=this.items.find(C=>C.filterModel===c),m=f.parent.conditions.indexOf(f.filterModel)+1;f.parent.conditions.splice(m,0,l)}this.refreshList(!1);const p=this.items.findIndex(({filterModel:f})=>f===l);if(p<0)return;const g=this.virtualList.getComponentAt(p);g instanceof Ca&&(s||g.focusMoveButton(t))}virtualListMoveItemCallback(e,t){const s=e.item,i=this.items.indexOf(s);i<=0||i===this.items.length-1||t&&i===1||!t&&!this.canMoveDown(s,i)||(this.moveItemUpDown(s,t,!0),this.virtualList.focusRow(i+(t?-1:1)))}canMoveDown(e,t){return!(e.level===1&&t===this.items.length-2||e.level===1&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui"})}validate(){let e=this.items.every(({valid:s})=>s),t=null;e?(e=JSON.stringify(this.filterModel)!==this.stringifiedModel,e||(t=this.advFilterExpSvc.translate("advancedFilterBuilderValidationAlreadyApplied"))):t=this.advFilterExpSvc.translate("advancedFilterBuilderValidationIncomplete"),this.eButtons?.updateValidity(e,t)}validateItems(){const e=s=>{s.type=void 0},t=s=>{delete s.filter};for(const s of this.items){if(!s.valid||!s.filterModel||s.filterModel.filterType==="join")continue;const{filterModel:i}=s,{colId:r}=i,a=this.advFilterExpSvc.getColumnAutocompleteEntries().find(({key:c})=>c===r),n=this.advFilterExpSvc.getColumnDetails(i.colId);if(!a||!n.column){s.valid=!1,i.colId=void 0,e(i),t(i);continue}const l=this.advFilterExpSvc.getDataTypeExpressionOperator(n.baseCellDataType).operators[i.type];if(!l){s.valid=!1,e(i),t(i);continue}l.numOperands>0&&!$y(i.filter)&&(s.valid=!1)}}},Ix=class extends Jb{constructor(e){super(),this.enabled=e}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.popupSvc=e.popupSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.environment=e.environment}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsSvc.whenReady(this,()=>this.setAdvancedFilterComp()),this.addManagedEventListeners({advancedFilterEnabledChanged:({enabled:e})=>this.onEnabledChanged(e)}),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addManagedPropertyListener("advancedFilterBuilderParams",e=>{e.currentValue?.suppressFullScreenButton!==e.previousValue?.suppressFullScreenButton&&this.eBuilderDialog?.setMaximizable(e.currentValue?.suppressFullScreenButton??!0)}),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog?.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp&&(this.eHeaderComp?.getGui().remove(),this.destroyBean(this.eHeaderComp)),this.eHeaderComp=this.createManagedBean(new zy(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return this.eHeaderComp?(this.eHeaderComp.getFocusableElement().focus(),!0):!1}refreshComp(){this.eFilterComp?.refresh(),this.eHeaderComp?.refresh()}refreshBuilderComp(){this.eBuilderComp?.refresh()}getHeaderHeight(){return this.eHeaderComp?.getHeight()??0}setInputDisabled(e){this.eFilterComp?.setInputDisabled(e),this.eHeaderComp?.setInputDisabled(e)}toggleFilterBuilder(e){const{source:t,force:s,eventSource:i}=e;if(s&&this.eBuilderDialog||s===!1&&!this.eBuilderDialog)return;if(this.eBuilderDialog){this.builderDestroySource=t,this.destroyBean(this.eBuilderDialog);return}this.setInputDisabled(!0);const{width:r,height:a,minWidth:n}=this.getBuilderDialogSize(),{suppressFullScreenButton:o}={suppressFullScreenButton:!1,...this.gos.get("advancedFilterBuilderParams")};this.eBuilderComp=this.createBean(new Px),this.eBuilderDialog=this.createBean(new Fi({title:this.advFilterExpSvc.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:r,height:a,resizable:!0,movable:!0,maximizable:!o,centered:!0,closable:!0,minWidth:n,afterGuiAttached:()=>this.eBuilderComp?.afterGuiAttached(),postProcessPopupParams:{type:"advancedFilterBuilder",eventSource:i}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener("destroyed",()=>{this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchLocalEvent({type:"advancedFilterBuilderClosed"}),this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource??"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"advancedFilterBuilderVisibleChanged",source:e,visible:t})}getBuilderDialogSize(){const e=this.gos.get("advancedFilterBuilderParams")?.minWidth??500,t=this.popupSvc.getPopupParent(),s=Math.round(ey(t))-2,i=Math.round(Qb(t)*.75)-2,r=Math.min(Math.max(700,e),s),a=Math.min(600,i);return{width:r,height:a,minWidth:e}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new wl),s=t.getGui();this.environment.applyThemeClasses(s),s.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(s),this.eFilterComp=t}}setHeaderCompEnabled(){this.eHeaderComp?.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(ty(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}},Ex=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;e<t.length;){const s=t[e];if(s===" "){if(this.parseOperator(e-1))return this.activeOperator++,e-1;this.operators[this.activeOperator]+=s}else this.operators[this.activeOperator]+=s;e++}return this.parseOperator(e-1),e}isValid(){return!this.validationError&&(!this.operators.length||!!this.parsedOperator)}getValidationError(){return this.validationError}getFunction(){return this.parsedOperator==="OR"?"||":"&&"}getModel(){return this.parsedOperator==="OR"?"OR":"AND"}getAutocompleteListParams(e,t){let s;if(t==null)s="";else{const r=this.operators[t],a=this.operatorEndPositions[t];s=ia(r,e,a==null?this.params.expression.length:a+1)}let i=this.params.advFilterExpSvc.getJoinOperatorAutocompleteEntries();return(t||t==null&&this.activeOperator)&&(i=i.filter(({key:r})=>r===this.parsedOperator)),this.params.advFilterExpSvc.generateAutocompleteListParams(i,"join",s)}updateExpression(e,t,s){let{expression:i}=this.params;const r=t.displayValue??t.key;if(s===0)for(let o=this.operatorEndPositions.length-1;o>0;o--){const l=this.operatorEndPositions[o];l!=null&&(i=Ye(i,this.operatorStartPositions[o],l,r).updatedValue)}const a=this.operatorStartPositions.length>s?this.operatorStartPositions[s]:e,n=(this.operatorEndPositions.length>s?this.operatorEndPositions[s]:void 0)??ra(i,e,!0).endPosition;return Ye(i,a,n,r,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",s=this.params.advFilterExpSvc.getExpressionJoinOperators(),i=xi(t,s,r=>r);if(i){this.operatorEndPositions[this.activeOperator]=e;const r=s[i];if(this.activeOperator){if(i!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=i;return t!==r&&(aa(this.params,t,r,e),this.operators[this.activeOperator]=r),!0}else return i===null?!1:(this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},Dx=class Bg{constructor(t,s){this.params=t,this.startPosition=s,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new Ex(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:s}=this.params;for(;t<s.length;){const i=s[t];if(i==="("&&!this.expectingOperator){const r=new Bg(this.params,t+1);t=r.parseExpression(),this.expressionParsers.push(r),this.expectingExpression=!1,this.expectingOperator=!0}else{if(i===")")return this.endPosition=t-1,this.startPosition===0&&(this.extraEndBracket=!0),t;if(i!==" ")if(this.expectingExpression){const r=new Wb(this.params,t);t=r.parseExpression(),this.expressionParsers.push(r),this.expectingExpression=!1,this.expectingOperator=!0}else this.expectingOperator&&(t=this.operatorParser.parseExpression(t),this.expectingOperator=!1,this.expectingExpression=!0)}t++}return this.startPosition>0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(t=>t.isValid())}getValidationError(){const t=this.operatorParser.getValidationError();for(let i=0;i<this.expressionParsers.length;i++){const r=this.expressionParsers[i].getValidationError();if(r)return t&&t.startPosition<r.startPosition?t:r}if(t)return t;if(this.extraEndBracket)return{message:this.params.advFilterExpSvc.translate("advancedFilterValidationExtraEndBracket"),startPosition:this.endPosition+1,endPosition:this.endPosition+1};let s;return this.expressionParsers.length===this.operatorParser.getNumOperators()?s="advancedFilterValidationMissingCondition":this.missingEndBracket&&(s="advancedFilterValidationMissingEndBracket"),s?{message:this.params.advFilterExpSvc.translate(s),startPosition:this.params.expression.length,endPosition:this.params.expression.length}:null}getFunction(t){const s=this.operatorParser.getFunction(),i=this.expressionParsers.map(a=>a.getFunction(t)),r=s==="&&"?"every":"some";return(a,n,o)=>i[r](l=>l(a,n,o))}getAutocompleteListParams(t){if(this.endPosition!=null&&t>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const s=this.getExpressionParserIndex(t);if(s==null)return this.params.expression[t]==="("?{enabled:!1}:this.getColumnAutocompleteListParams();const r=this.expressionParsers[s].getAutocompleteListParams(t);if(!r){if(s<this.expressionParsers.length-1)return this.operatorParser.getAutocompleteListParams(t,s);if(this.expressionParsers.length===this.operatorParser.getNumOperators()){const a=this.operatorParser.getLastOperatorEndPosition();return a==null||t<=a+1?this.operatorParser.getAutocompleteListParams(t,this.operatorParser.getNumOperators()-1):this.getColumnAutocompleteListParams()}return this.params.expression[t-1]===")"?{enabled:!1}:this.operatorParser.getAutocompleteListParams(t)}return r}updateExpression(t,s,i){const r=this.params.expression,a=this.getExpressionParserIndex(t);if(a==null){const l=i==="column"?this.params.advFilterExpSvc.getColumnValue(s):s.displayValue??s.key;return Ye(r,this.startPosition,this.startPosition,l,!0)}const o=this.expressionParsers[a].updateExpression(t,s,i);return o??(i==="column"?Ye(r,t,r.length-1,this.params.advFilterExpSvc.getColumnValue(s),!0):this.endPosition!=null&&t>this.endPosition+1?null:this.operatorParser.updateExpression(t,s,a))}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(t=>t.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(t){let s;for(let i=0;i<this.expressionParsers.length&&!(this.expressionParsers[i].startPosition>t);i++)s=i;return s}},Lx=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new Dx(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:s,endPosition:i}=e;return s<this.params.expression.length?this.params.advFilterExpSvc.translate("advancedFilterValidationMessage",[t,this.params.expression.slice(s,i+1).trim()]):this.params.advFilterExpSvc.translate("advancedFilterValidationMessageAtEnd",[t])}getFunction(){const e=this.createFunctionParams();return{expressionFunction:this.joinExpressionParser.getFunction(e),params:e}}getAutocompleteListParams(e){return this.joinExpressionParser.getAutocompleteListParams(e)??{enabled:!1}}updateExpression(e,t,s){return this.joinExpressionParser.updateExpression(e,t,s)}getModel(){return this.isValid()?this.joinExpressionParser.getModel():null}createFunctionParams(){return{operands:[],operators:[],evaluatorParams:[]}}},kx=class extends jb{constructor(){super(...arguments),this.beanName="advancedFilter",this.appliedExpression=null,this.expression=null,this.isValid=!0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.dataTypeSvc=e.dataTypeSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.filterValueSvc=e.filterValueSvc,this.filterManager=e.filterManager}postConstruct(){this.setEnabled(this.gos.get("enableAdvancedFilter"),!0),this.ctrl=this.createManagedBean(new Ix(this.enabled)),this.expressionProxy={getValue:(e,t)=>{const s=this.colModel.getColDefCol(e);return s?this.filterValueSvc.getValue(s,t):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedEventListeners({newColumnsLoaded:e=>this.onNewColumnsLoaded(e)}),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>{this.updateValidity()&&this.filterManager?.onFilterChanged({source:"advancedFilter"})})}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){const e=this.createExpressionParser(this.appliedExpression);return e?.parseExpression(),e?.getModel()??null}setModel(e){const t=(i,r)=>{if(i.filterType==="join"){const a=this.advFilterExpSvc.parseJoinOperator(i),n=i.conditions.map(o=>t(o)).filter(o=>Yb(o)).join(` ${a} `);return r||i.conditions.length<=1?n:`(${n})`}else return this.advFilterExpSvc.parseColumnFilterModel(i)},s=e?t(e,!0):null;this.setExpressionDisplayValue(s),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new Lx({expression:e,colModel:this.colModel,dataTypeSvc:this.dataTypeSvc,valueSvc:this.valueSvc,advFilterExpSvc:this.advFilterExpSvc}):null}getDefaultExpression(e){const t=this.advFilterExpSvc.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const s=this.enabled,i=qb(this.gos)||Xb(this.gos);e&&!i&&Zb(123),this.enabled=e&&i,!t&&this.enabled!==s&&this.eventSvc.dispatchEvent({type:"advancedFilterEnabledChanged",enabled:this.enabled})}applyExpression(){const e=this.createExpressionParser(this.expression);e?.parseExpression(),this.applyExpressionFromParser(e)}getAppliedExpressionDisplayValue(){return this.appliedExpression}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid){this.expressionFunction=null,this.expressionParams=null,this.appliedExpression=null;return}const{expressionFunction:t,params:s}=e.getFunction();this.expressionFunction=t,this.expressionParams=s,this.appliedExpression=this.expression}updateValidity(){this.advFilterExpSvc.resetColumnCaches();const e=this.createExpressionParser(this.expression);e?.parseExpression();const s=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),s}onNewColumnsLoaded(e){if(e.source!=="gridInitializing"||!this.dataTypeSvc?.isPendingInference)return;this.ctrl.setInputDisabled(!0);const[t]=this.addManagedEventListeners({dataTypesInferred:()=>{t?.(),this.ctrl.setInputDisabled(!1)}})}},jl={moduleName:"AdvancedFilter",version:D,beans:[kx,$b],icons:{advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",advancedFilterBuilderSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},apiFunctions:{getAdvancedFilterModel:Lb,setAdvancedFilterModel:kb,showAdvancedFilterBuilder:Gb,hideAdvancedFilterBuilder:Ob},dependsOn:[B,Tb,Eb,Ib,Pb,Mb],css:[Db]};import{ColumnApiModule as Gx}from"ag-grid-community";import{STRUCTURED_SCHEMA_FEATURES as Ox}from"ag-grid-community";var Nt=class{constructor(e){this._defs={},this._nullable=!1,this.description=e}_collectNestedDefs(e){const t={...this._defs};for(const s of e)s&&typeof s=="object"&&"$defs"in s&&(Object.assign(t,s.$defs),delete s.$defs);return t}_toJSON(e={}){const t={type:this._nullable?[this.type,"null"]:this.type,description:this.description,...e};return Object.keys(this._defs).length>0&&(t.$defs=this._defs),t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}},_x=class extends Nt{constructor(e){super(typeof e=="string"?e:e?.description),this.type="string",typeof e=="object"&&e&&(this._pattern=e.pattern,this._format=e.format)}pattern(e){return this._pattern=e,this}format(e){return this._format=e,this}toJSON(){return this._toJSON({pattern:this._pattern,format:this._format})}},Nx=class extends Nt{constructor(e){super(typeof e=="string"?e:e?.description),this.type="number",typeof e=="object"&&e&&(this._minimum=e.minimum,this._maximum=e.maximum,this._exclusiveMinimum=e.exclusiveMinimum,this._exclusiveMaximum=e.exclusiveMaximum,this._multipleOf=e.multipleOf)}minimum(e){return this._minimum=e,this}exclusiveMinimum(e){return this._exclusiveMinimum=e,this}maximum(e){return this._maximum=e,this}exclusiveMaximum(e){return this._exclusiveMaximum=e,this}multipleOf(e){return this._multipleOf=e,this}toJSON(){return this._toJSON({minimum:this._minimum,exclusiveMinimum:this._exclusiveMinimum,maximum:this._maximum,exclusiveMaximum:this._exclusiveMaximum,multipleOf:this._multipleOf})}},Yl=class extends Nt{constructor(e,t){super(t),this._enum=e,this.type="string"}toJSON(){return this._toJSON({enum:this._enum})}},Bx=class extends Yl{constructor(e,t){super([e],t)}},Vx=class extends Nt{constructor(e){super(e),this.type="boolean"}toJSON(){return this._toJSON()}},Hx=class extends Nt{constructor(e,t){super(typeof t=="string"?t:t?.description),this.items=e,this.type="array",typeof t=="object"&&t&&(this._minItems=t.minItems,this._maxItems=t.maxItems)}minItems(e){return this._minItems=e,this}maxItems(e){return this._maxItems=e,this}toJSON(){const e=this.items.toJSON(),t=this._collectNestedDefs([e]);return this._defs=t,this._toJSON({items:e,minItems:this._minItems,maxItems:this._maxItems})}},zx=class extends Nt{constructor(e,t){super(t),this.properties=e,this.type="object"}toJSON(){const e=Object.fromEntries(Object.keys(this.properties).map(s=>[s,this.properties[s].toJSON()])),t=this._collectNestedDefs(Object.values(e));return this._defs=t,this._toJSON({required:Object.keys(this.properties),additionalProperties:!1,properties:e})}},Ux=class{constructor(e,t){this.schemas=e,this._nullable=!1,this._defs={},this.description=t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}_collectNestedDefs(e){const t=this._defs;for(const s of e)s&&typeof s=="object"&&"$defs"in s&&(Object.assign(t,s.$defs),delete s.$defs);return t}toJSON(){const e=this.schemas.map(i=>i.toJSON()),t=this._collectNestedDefs(e),s={anyOf:this._nullable?[...e,{type:"null"}]:e};return this.description&&(s.description=this.description),Object.keys(t).length>0&&(s.$defs=t),s}},Wx=class{constructor(e){this.id=e}nullable(){return this}toJSON(){return{$ref:`#/$defs/${this.id}`}}},x={string:e=>new _x(e),number:e=>new Nx(e),enum:(e,t)=>new Yl(e,t),boolean:e=>new Vx(e),array:(e,t)=>new Hx(e,t),object:(e,t)=>new zx(e,t),union:(e,t)=>new Ux(e,t),literal:(e,t)=>new Bx(e,t),ref:e=>new Wx(e)},Kx=e=>{const{aggFuncSvc:t}=e;if(!t)return;const i=e.colModel.getCols().filter(r=>r.isAllowValue()&&t.getFuncNames(r).length>0);if(i.length!==0)return x.object({aggregationModel:x.array(x.union(i.map(r=>x.object({colId:x.literal(r.getColId(),"Column identifier"),aggFunc:x.enum(e.aggFuncSvc?.getFuncNames(r)||[],"Aggregation function")}))),"Array of column aggregations")},"Aggregation configuration for the grid").nullable()},$x=e=>{const s=e.colModel.getCols().filter(r=>r.isResizable());if(s.length===0)return;const i=s.map(r=>r.getColId());return x.object({columnSizingModel:x.array(x.union([x.object({colId:x.ref("resizableColumnId"),width:x.number("Fixed width in pixels").minimum(20)}),x.object({colId:x.ref("resizableColumnId"),flex:x.number("Flex sizing ratio").minimum(0)})]),"Array of column sizing configurations")},"Column sizing configuration for the grid").define("resizableColumnId",x.enum(i,"Column ID that supports resizing"))},jx=()=>x.object({hiddenColIds:x.array(x.ref("allColumnIds"),"Array of column IDs to hide")},"Column visibility configuration for the grid").nullable(),Yx=({colModel:e,dataTypeSvc:t})=>{if(!t)return;const s=e.getCols(),i={boolean:[],object:[],date:[],dateString:[],dateTime:[],dateTimeString:[],number:[],bigint:[],text:[]};for(const n of s){const o=t.getBaseDataType(n);o&&i[o].push(n.colId)}const r=[],a={};for(const n of Object.keys(i))if(i[n].length>0){const o=`${n}AdvancedFilterModel`,l=rF[n];a[o]=l(i[n]),r.push({$ref:`#/$defs/${o}`})}return a.joinAdvancedFilterModel=x.object({filterType:x.literal("join","Filter type identifier for joining multiple advanced filter conditions"),type:x.enum(["AND","OR"],"Logical operator to combine multiple advanced filter conditions"),conditions:x.array(x.ref("advancedFilterModel"),"Array of advanced filter conditions to be combined")}),a.advancedFilterModel={anyOf:[...r,{$ref:"#/$defs/joinAdvancedFilterModel"}]},x.object({advancedFilterModel:x.ref("advancedFilterModel")},"Advanced filter configuration for the grid").nullable()},qx=e=>x.object({filterType:x.literal("boolean","Filter type identifier for boolean column filters"),colId:x.enum(e,"Column identifier for the boolean column to filter"),type:x.enum(["true","false"],"Boolean value to filter by")}),Xx=e=>x.object({filterType:x.literal("object","Filter type identifier for object column filters"),colId:x.enum(e,"Column identifier for the object column to filter"),filter:x.string("Filter value to compare against object column values").nullable(),type:x.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Object filter operation type")}),Zx=e=>x.object({filterType:x.literal("date","Filter type identifier for date column filters"),colId:x.enum(e,"Column identifier for the date column to filter"),filter:x.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date filter operation type")}),Jx=e=>x.object({filterType:x.literal("date","Filter type identifier for date string column filters"),colId:x.enum(e,"Column identifier for the date string column to filter"),filter:x.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date string filter operation type")}),Qx=e=>x.object({filterType:x.literal("dateTime","Filter type identifier for datetime column filters"),colId:x.enum(e,"Column identifier for the datetime column to filter"),filter:x.string({pattern:"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DDTHH:mm:ss format"}).nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime filter operation type")}),eF=e=>x.object({filterType:x.literal("dateTimeString","Filter type identifier for datetime string column filters"),colId:x.enum(e,"Column identifier for the datetime string column to filter"),filter:x.string({pattern:"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DD HH:mm:ss format"}).nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime string filter operation type")}),tF=e=>x.object({filterType:x.literal("number","Filter type identifier for number column filters"),colId:x.enum(e,"Column identifier for the number column to filter"),filter:x.number("Numeric value to filter by").nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Number filter operation type")}),sF=e=>x.object({filterType:x.literal("bigint","Filter type identifier for bigint column filters"),colId:x.enum(e,"Column identifier for the bigint column to filter"),filter:x.string({pattern:"^-?\\d+$",description:"BigInt value to filter by"}).nullable(),type:x.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"BigInt filter operation type")}),iF=e=>x.object({filterType:x.literal("text","Filter type identifier for text column filters"),colId:x.enum(e,"Column identifier for the text column to filter"),filter:x.string("Text value to filter by").nullable(),type:x.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Text filter operation type")}),rF={boolean:qx,object:Xx,date:Zx,dateString:Jx,dateTime:Qx,dateTimeString:eF,number:tF,bigint:sF,text:iF},aF="agTextColumnFilter",ql="agNumberColumnFilter",Xl="agDateColumnFilter",nF="agSetColumnFilter",oF="agMultiColumnFilter",lF=[aF,ql,Xl],cF=(e,t)=>{const{advancedFilter:s}=e;return s?.isEnabled()?Yx(e):dF(e,t)},dF=(e,t)=>{const{gos:s,colFilter:i,colModel:r}=e;if(!i)return;const n=r.getCols().filter(c=>c.isFilterAllowed());if(n.length===0)return;const o={},l=s.get("enableFilterHandlers");for(const c of n){const d=t?.columns?t.columns[c.getColId()]:void 0,u=c.getColDef(),h=i.getDefaultFilter(c),p=d?.includeSetValues??!1,g=Zl(u.filter,u.filterParams,h,(f=!1,m=0)=>{if(!p)return[];let C;return f?l&&(C=i.getHandler(c,!0).getHandler(m)):C=i.getHandler(c,!0),C?C.getFilterKeys():[]});g&&(o[c.colId]=g.nullable())}return x.object({filterModel:x.object(o)}).nullable()};function Zl(e,t,s,i){let r;if(typeof e=="string"?r=e:typeof e=="object"&&typeof e.component=="string"?r=e.component:(e===!0||typeof e=="object"&&e.component===!0)&&(r=s),!r)return null;if(lF.includes(r)){const a=t?.maxNumConditions,n=t?.filterOptions?t.filterOptions.map(l=>typeof l=="string"?l:typeof l=="object"&&l.displayKey?l.displayKey:null).filter(Boolean):void 0,o=t?.useIsoSeparator||!1;return uF(r,{maxConditions:a,filterOptions:n,useIsoSeparator:o})}else{if(r===nF)return fF(i);if(r===oF)return mF(t.filters,s,i)}return null}var uF=(e,t)=>e===Xl?gF(t):e===ql?pF(t):hF(t),va=(e,t,s=2)=>s===1?e:x.object({filterType:x.literal(t,`Filter type identifier for ${t} filters with multiple conditions`),operator:x.enum(["AND","OR"],"Logical operator to combine multiple filter conditions. Must be included even with a single filter to adhere to the API."),conditions:x.array(e,"Array of filter conditions to be combined").minItems(2).maxItems(s)}),hF=e=>{const t=e.filterOptions??["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],s=x.object({filterType:x.literal("text","Filter type identifier for text filters"),type:x.enum(t,"Text filter operation type"),filter:x.string("Primary filter value").nullable(),filterTo:x.string("Secondary filter value for range operations").nullable()});return va(s,"text",e.maxConditions)},pF=e=>{const t=e.filterOptions??["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],s=x.object({filterType:x.literal("number","Filter type identifier for number filters"),type:x.enum(t,"Number filter operation type"),filter:x.number("Primary filter value").nullable(),filterTo:x.number("Secondary filter value for range operations").nullable()});return va(s,"number",e.maxConditions)},gF=e=>{const t=e.filterOptions??["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],s=e.useIsoSeparator?"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",i=x.object({filterType:x.literal("date","Filter type identifier for date filters"),type:x.enum(t,"Date filter operation type"),dateFrom:x.string({pattern:s,description:"Primary date filter value in YYYY-MM-DD HH:mm:ss format"}).nullable(),dateTo:x.string({pattern:s,description:"Secondary date filter value for range operations in YYYY-MM-DD HH:mm:ss format"}).nullable()});return va(i,"date",e.maxConditions)},fF=e=>{const t=e?e().filter(Boolean):[];return x.object({filterType:x.literal("set","Filter type identifier for set filters"),values:x.array(t.length>0?x.enum(t,"Available values to filter by"):x.string("Filter values"),"Array of values to include in the filter")})},mF=(e,t,s=()=>[])=>x.object({filterType:x.literal("multi","Filter type identifier for multi-condition filters"),filterModels:x.array(x.union(e.map((i,r)=>Zl(i.filter,i.filterParams,t,()=>s(!0,r))),"Union of different filter types that can be combined").nullable(),"Array of filter conditions to be combined with AND/OR logic")}),CF=e=>{const s=e.colModel.getCols().filter(i=>i.isAllowPivot()).map(i=>i.getColId());if(s.length!==0)return x.object({pivotMode:x.boolean("Whether pivot mode is enabled"),pivotColIds:x.array(x.enum(s,"Column ID that supports pivoting"),"Array of column IDs to use as pivot columns")},"Pivot configuration for the grid").nullable()},vF=e=>{const s=e.colModel.getCols().filter(r=>r.isAllowRowGroup());if(s.length===0)return;const i=s.map(r=>r.getColId());return x.object({groupColIds:x.array(x.enum(i,"Column ID that supports row grouping"),"Array of column IDs to group by")},"Row grouping configuration for the grid")},SF=e=>{const{sortSvc:t}=e;if(!t)return;const i=e.colModel.getCols().filter(a=>a.isSortable());if(i.length===0)return;const r=i.map(a=>a.getColId());return x.object({sortModel:x.array(x.object({colId:x.enum(r,"Column ID that supports sorting"),sort:x.enum(["asc","desc"],"Sort direction: ascending or descending"),type:x.enum(["default","absolute"],"Sort type: default or absolute values")}),"Array of sort configurations")},"Sort configuration for the grid").nullable()},bF={aggregation:Kx,filter:cF,sort:SF,pivot:CF,columnVisibility:jx,columnSizing:$x,rowGroup:vF};function yF(e,t){const s=e.colModel.getCols().map(o=>o.getColId()),i={};for(const o of Ox){if(t?.exclude?.includes(o))continue;const l=bF[o],c=l(e,t);c&&(i[o]=c.nullable())}const r=t?.columns??{},a=s.map(o=>r[o]?.description?`${o}: ${r[o].description}`:o).filter(Boolean).join(`
|
||
`);return x.object(i).define("allColumnIds",x.enum(s,a)).toJSON()}var Jl={moduleName:"AiToolkit",version:D,beans:[],dependsOn:[B,Gx],apiFunctions:{getStructuredSchema:yF}};import{_ColumnMoveModule as wF,_PopupModule as xF,_SharedDragAndDropModule as FF}from"ag-grid-community";import{_HorizontalResizeModule as RF}from"ag-grid-community";import{_unwrapUserComp as AF}from"ag-grid-community";function MF(e){return e.sideBar?.comp.isDisplayed()??!1}function TF(e,t){e.sideBar?.comp.setDisplayed(t)}function PF(e,t){e.sideBar?.comp.setSideBarPosition(t)}function IF(e,t,s){e.sideBar?.comp.openToolPanel(t,"api",s)}function EF(e){e.sideBar?.comp.close("api")}function DF(e){return e.sideBar?.comp.openedItem()??null}function LF(e){e.sideBar?.comp.refresh()}function kF(e){return e.sideBar?.comp.isToolPanelShowing()??!1}function GF(e,t){const s=e.sideBar?.comp.getToolPanelInstance(t);return AF(s)}function OF(e){return e.sideBar?.comp.getDef()}import{BeanStub as _F}from"ag-grid-community";import{Component as NF,KeyCode as Ei,ManagedFocusFeature as BF,RefPlaceholder as VF,_addFocusableContainerListener as HF,_addGridCommonParams as Ql,_findNextFocusableElement as zF,_focusInto as UF,_focusNextGridCoreContainer as ec,_getActiveDomElement as tc,_isVisible as WF,_removeFromParent as sc,_setAriaControlsAndLabel as KF,_warn as Sa}from"ag-grid-community";var $F='.ag-tool-panel-wrapper{display:flex;overflow:hidden auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-side-bar-panel-width)}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}';import{Component as jF,KeyCode as YF,_clearElement as qF,_focusNextGridCoreContainer as XF,_stopPropagationForAgGrid as ZF}from"ag-grid-community";import{Component as JF,RefPlaceholder as ba,_createIconNoSpan as QF,_setAriaExpanded as eR}from"ag-grid-community";var tR={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},sR=class extends JF{constructor(e){super(),this.toolPanelDef=e,this.eToggleButton=ba,this.eIconWrapper=ba,this.eLabel=ba}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(tR,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){const e=this.toolPanelDef,t=this.getLocaleTextFunc()(e.labelKey,e.labelDefault);this.eLabel.textContent=t}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",QF(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.toggleCss("ag-selected",e),eR(this.eToggleButton,e)}},iR={tag:"div",cls:"ag-side-buttons",role:"tablist"},rR=class extends jF{constructor(){super(iR),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){if(!(e.key!==YF.TAB||!e.shiftKey)){if(XF(this.beans,!0)){e.preventDefault();return}ZF(e)}}setActiveButton(e){for(const t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){const t=this.createBean(new sR(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),qF(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},aR={selector:"AG-SIDE-BAR-BUTTONS",component:rR};import{_warn as ic}from"ag-grid-community";var rc={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},ac={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},nR={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},Fs={columns:rc,filters:ac,"filters-new":nR};function ya(e){if(e){if(e===!0)return{toolPanels:[rc,ac],defaultToolPanel:"columns"};if(typeof e=="string")return ya([e]);if(Array.isArray(e)){const t=[];for(const s of e){const i=Fs[s];if(!i){ic(215,{key:s,defaultByKey:Fs});continue}t.push(i)}return t.length===0?void 0:{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:oR(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}}function oR(e){const t=[];return e&&e.forEach(s=>{const i=nc(s);i&&t.push(i)}),t}function nc(e){return typeof e!="string"?e:Fs[e]?Fs[e]:(ic(215,{key:e,defaultByKey:Fs}),null)}import{Component as lR}from"ag-grid-community";import{Component as cR}from"ag-grid-community";var dR=class extends cR{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"}),this.minWidth=100,this.maxWidth=null}postConstruct(){const e=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(e,t,s){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:s,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const s=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-e*s));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,t,i)}};function uR(e,t,s){return e.getCompDetails(t,hR,void 0,s,!0)}var hR={name:"toolPanel",optionalMethods:["refresh","getState"]},pR={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel"},gR=class extends lR{constructor(){super(pR)}postConstruct(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new dR);e.setAttribute("id",`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:s,minWidth:i,maxWidth:r,width:a}=e;this.toolPanelId=s,this.width=a;const n=uR(this.beans.userCompFactory,e,t);if(n==null)return!1;const o=n.newAgStackInstance();this.params=n.params,o.then(this.setToolPanelComponent.bind(this));const l=this.resizeBar;return i!=null&&(l.minWidth=i),r!=null&&(l.maxWidth=r),!0}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)});const t=this.width;t&&(this.getGui().style.width=`${t}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t=this.gos.get("enableRtl"),s=e==="left",i=t?s:!s;this.resizeBar.inverted=i}refresh(){this.toolPanelCompInstance?.refresh(this.params)}},fR={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},mR=class extends NF{constructor(){super(fR,[aR]),this.sideBarButtons=VF,this.toolPanelWrappers=[],this.registerCSS($F)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{beans:e,gos:t}=this,{sideBar:s}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:ya(t.get("sideBar")),sideBarState:s}),this.addManagedPropertyListener("sideBar",()=>this.setState()),e.sideBar.comp=this;const i=this.getFocusableElement();this.createManagedBean(new BF(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),HF(e,this,i),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,sideBarButtons:s}=this,i=this.getGui(),r=s.getGui(),a=tc(t),n=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),o=e.target,l=e.shiftKey;if(!n)return ec(t,l)?(e.preventDefault(),!0):ec(t,l,!0);if(r.contains(a)){UF(n,l)&&e.preventDefault();return}if(!l)return;let c=null;n.contains(a)?c=zF(t,n,void 0,!0):cl(n,o)&&(c=Jr(n,o)),c||(c=r.querySelector(".ag-selected button"),c=WF(c)?c:null),c&&c!==e.target&&(e.preventDefault(),c.focus())}handleKeyDown(e){const t=tc(this.beans),s=this.sideBarButtons;if(!s.getGui().contains(t))return;const i=s.getGui(),r=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),a=r.findIndex(l=>l.contains(t));let n=null;switch(e.key){case Ei.LEFT:case Ei.UP:n=Math.max(0,a-1);break;case Ei.RIGHT:case Ei.DOWN:n=Math.min(a+1,r.length-1);break}if(n===null)return;const o=r[n].querySelector("button");o&&(o.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:s}){if(this.setDisplayed(!1),this.sideBar=e,e&&this.sideBarButtons.setDisplayed(!e.hideButtons),e?.toolPanels){const i=e.toolPanels;if(this.createToolPanelsAndSideButtons(i,t,s),!this.toolPanelWrappers.length)return;const r=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(r),this.setSideBarPosition(t?t.position:e.position),r)if(t){const{openToolPanel:a}=t;a&&this.openToolPanel(a,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t=e==="left",s=t?"right":"left";this.toggleCss("ag-side-bar-left",t),this.toggleCss("ag-side-bar-right",!t);for(const i of this.toolPanelWrappers)i.setResizerSizerSide(s);return this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){const e={};for(const t of this.toolPanelWrappers)e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,s){for(const i of e)this.createToolPanelAndSideButton(i,t?.toolPanels?.[i.id],s?.[i.id])}validateDef(e){const{id:t,toolPanel:s}=e;return t==null?(Sa(212),!1):oc(s)&&this.beans.filterManager?.isAdvFilterEnabled()?(Sa(213),!1):!0}createToolPanelAndSideButton(e,t,s){if(!this.validateDef(e)){this.destroyBean(s);return}let i;if(s)i=s;else if(i=this.createBean(new gR),!i.setToolPanelDef(e,Ql(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;i.setDisplayed(!1);const r=i.getGui(),a=e.parent instanceof HTMLElement?e.parent:this;a===e.parent&&(this.beans.environment.applyThemeClasses(a,["ag-external","ag-tool-panel-external"]),r.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr")),a.appendChild(r),this.toolPanelWrappers.push(i);const n=this.sideBarButtons.addButtonComp(e);KF(n.eToggleButton,r)}refresh(){for(const e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){const s=this.sideBar?.toolPanels?.find(i=>(typeof i=="string"?i:i.id)===e);if(s){const i=nc(s);if(i){const r=this.gos.get("initialState")?.sideBar?.toolPanels?.[i.id];i.parent=t;const a=this.toolPanelWrappers.find(n=>n.getToolPanelId()===e);this.createToolPanelAndSideButton(i,r,a)}}}openToolPanel(e,t="api",s){s&&e&&this.renderToolPanelUnderParent(e,s);const i=this.openedItem();if(i===e)return;for(const n of this.toolPanelWrappers){const o=e===n.getToolPanelId();n.setDisplayed(o)}const r=this.openedItem();i!==r&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,i??void 0,t))}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(s=>s.getToolPanelId()===e)[0];if(!t){Sa(214,{key:e});return}return t.getToolPanelInstance()}raiseToolPanelVisibleEvent(e,t,s){const i=!!e&&!!t,r=this.eventSvc;t&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:t,visible:!1,switchingToolPanel:i}),e&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:e,visible:!0,switchingToolPanel:i})}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;for(const t of this.toolPanelWrappers)t.isDisplayed()&&(e=t.getToolPanelId());return e}setState(e){const t=ya(this.gos.get("sideBar")),s={};t&&this.sideBar&&t.toolPanels?.forEach(i=>{const{id:r}=i;if(!r)return;const a=this.sideBar.toolPanels?.find(c=>c.id===r);if(!a||i.toolPanel!==a.toolPanel)return;const n=this.toolPanelWrappers.find(c=>c.getToolPanelId()===r);if(!n)return;const o=Ql(this.gos,{...i.toolPanelParams??{},initialState:e?.toolPanels?.[r],onStateUpdated:()=>this.dispatchSideBarUpdated()});n.getToolPanelInstance()?.refresh(o)===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(c=>c!==n),sc(n.getGui()),s[r]=n)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:s})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(const e of this.toolPanelWrappers)sc(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){this.sideBar?.toolPanels?.some(t=>oc(typeof t=="string"?t:t.toolPanel))&&this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function oc(e){return e==="agFiltersToolPanel"||e==="agNewFiltersToolPanel"}var CR={selector:"AG-SIDE-BAR",component:mR},vR=class extends _F{constructor(){super(...arguments),this.beanName="sideBar"}getSelector(){return CR}},Rs={moduleName:"SideBar",version:D,beans:[vR],apiFunctions:{isSideBarVisible:MF,setSideBarVisible:TF,setSideBarPosition:PF,openToolPanel:IF,closeToolPanel:EF,getOpenedToolPanel:DF,refreshToolPanel:LF,isToolPanelShowing:kF,getToolPanelInstance:GF,getSideBar:OF},dependsOn:[B,RF]},SR='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}';import{_warn as bR}from"ag-grid-community";var lc=class extends rl{constructor(){super({warnNoIcon:()=>bR(227)})}},Di={moduleName:"MenuItem",version:D,userComponents:{agMenuItem:lc},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[SR]};import{Component as yR,_addGridCommonParams as wR,_clearElement as xR,_last as FR}from"ag-grid-community";import{Component as RR,PositionableFeature as AR,RefPlaceholder as cc}from"ag-grid-community";var MR=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}";import{AgCheckboxSelector as TR,AgInputTextFieldSelector as PR,Component as IR,KeyCode as ER,RefPlaceholder as wa,_createIconNoSpan as xa,_debounce as DR,_setDisplayed as Bt}from"ag-grid-community";var LR=300,kR={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},GR=class extends IR{constructor(){super(kR,[TR,PR]),this.eExpand=wa,this.eSelect=wa,this.eFilterTextField=wa}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:t=>{t.key===ER.SPACE&&(t.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.toggleCss("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.toggleCss("ag-column-select-column-readonly",t),this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const e=this.beans;this.eExpand.appendChild(this.eExpandChecked=xa("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=xa("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=xa("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){const e=this.params,t=!e.suppressColumnFilter,s=!e.suppressColumnSelectAll,i=!e.suppressColumnExpandAll,r=!!this.beans.colModel.colDefCols?.treeDepth,a=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(a("searchOoo","Search...")),Bt(this.eFilterTextField.getGui(),t),Bt(this.eSelect.getGui(),s),Bt(this.eExpand,i&&r)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=DR(this,()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},LR)),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,Bt(this.eExpandChecked,e===0),Bt(this.eExpandUnchecked,e===1),Bt(this.eExpandIndeterminate,e===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},OR={selector:"AG-PRIMARY-COLS-HEADER",component:GR};import{Component as _R,DragSourceType as NR,_exists as dc,_setAriaLabel as BR,_setAriaLevel as VR,_warn as HR,isProvidedColumnGroup as zR}from"ag-grid-community";import{AgProvidedColumnGroup as UR,_warn as WR,isProvidedColumnGroup as KR}from"ag-grid-community";import{_last as $R}from"ag-grid-community";function Vt(e){return!!e&&typeof e.children<"u"}function Xe(e){return Vt(e)?e.groupId:e.colId}function uc(e,t,s){const i=(n,o)=>{const c=n.children.map(Xe).includes(Xe(o)),d=$R(n.children),u=d&&Xe(d)!==Xe(o);return c&&u};if(!Vt(e))return!0;const r=e,a=s;if(i(r,a)||r.groupId===t&&!r.children.map(Xe).includes(Xe(a)))return r.children.push(a),!0;for(let n=r.children.length-1;n>=0&&!uc(r.children[n],t,s);n--);return!1}function jR(e){const t=(r,a)=>Vt(r)&&Vt(a)&&Xe(r)===Xe(a),s=(r,a)=>{if(!Vt(a))return r;const n=r,o=a;if(o.children&&o.groupId&&uc(n,o.groupId,o.children[0]))return n;for(const l of o.children)s(n,l);return n},i=[];for(let r=1;r<=e.length;r++){const a=e[r-1],n=e[r];t(a,n)?e[r]=s(a,n):i.push(a)}return i}function hc(e,t){const s=[],i=(a,n)=>{if(Vt(a)){const o=a,l=typeof o.groupId<"u"?o.groupId:o.headerName,c=new UR(o,l,!1,n),d=[];for(const u of o.children){const h=i(u,n+1);h&&d.push(h)}return c.setChildren(d),c}else{const o=a,l=o.colId?o.colId:o.field,c=e.getColDefCol(l);return c||s.push(o),c}},r=[];for(const a of t){const n=i(a,0);n&&r.push(n)}return s.length>0&&WR(217,{invalidColIds:s}),r}function pc(e,t){const s=YR(e),i=jR(s);t(i)}function YR(e){const t=(r,a)=>{let n;if(KR(r))if(r.isPadding())n=a;else{const l=Object.assign({},r.getColGroupDef());l.groupId=r.getGroupId(),l.children=[a],n=l}else{const l=Object.assign({},r.getColDef());l.colId=r.getColId(),n=l}const o=r.getOriginalParent();return o?t(o,n):n};return e.getCols().filter(r=>{const a=r.getColDef();return r.isPrimary()&&!a.showRowGroup}).map(r=>t(r,r.getColDef()))}import{LocalEventService as qR}from"ag-grid-community";var gc=class{constructor(e,t,s,i=!1,r){this.displayName=e,this.depth=s,this.group=i,this.localEventService=new qR,i?(this.columnGroup=t,this._expanded=r,this.children=[]):this.column=t}get expanded(){return!!this._expanded}set expanded(e){e!==this._expanded&&(this._expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"}))}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};import{isProvidedColumnGroup as XR}from"ag-grid-community";import{AgCheckboxSelector as ZR,Component as JR,DragSourceType as QR,KeyCode as Fa,RefPlaceholder as As,TouchListener as fc,_createIcon as mc,_createIconNoSpan as eA,_getShouldDisplayTooltip as tA,_getToolPanelClassesFromColDef as sA,_setAriaDescribedBy as iA,_setAriaExpanded as rA,_setAriaLabel as aA,_setDisplayed as Ra}from"ag-grid-community";import{_applyColumnState as Aa}from"ag-grid-community";function Cc(e,t,s,i){const r=nA(t);vc(e,r,s,i)}function vc(e,t,s,i){e.colModel.isPivotMode()?lA(e,t,s,i):oA(e,t,s,i)}function nA(e){const t=[],s=i=>{for(const r of i)r.passesFilter&&(r.group?s(r.children):t.push(r.column))};return s(e),t}function oA(e,t,s,i){const r=[];for(const a of t)a.getColDef().lockVisible||a.isVisible()!=s&&r.push({colId:a.getId(),hide:!s});r.length>0&&Aa(e,{state:r},i)}function lA(e,t,s,i){cA(e,t,s,i)}function cA(e,t,s,i){const r=[],o=s?l=>{if(!l.isAnyFunctionActive())if(l.isAllowValue()){const c=typeof l.getAggFunc()=="string"?l.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(l);r.push({colId:l.getId(),aggFunc:c})}else l.isAllowRowGroup()?r.push({colId:l.getId(),rowGroup:!0}):l.isAllowPivot()&&r.push({colId:l.getId(),pivot:!0})}:l=>{(l.isPivotActive()||l.isRowGroupActive()||l.isValueActive())&&r.push({colId:l.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(o),r.length>0&&Aa(e,{state:r},i)}function Sc(e,t){const{columns:s,visibleState:i,pivotState:r,eventType:a}=t,n=s.map(o=>{const l=o.getColId();if(e.colModel.isPivotMode()){const c=r?.[l];return{colId:l,pivot:c?.pivot,rowGroup:c?.rowGroup,aggFunc:c?.aggFunc}}else return{colId:l,hide:!i?.[l]}});Aa(e,{state:n},a)}function bc(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}import{Component as dA,_createIconNoSpan as yc,_focusInto as uA,isColumn as hA,isProvidedColumnGroup as pA}from"ag-grid-community";function wc(e,t,s,i){const r=t.getCol(s);let a=e._groupData;a||(a={},e._groupData=a);const n=r.getColId(),o=a[n];o!==i&&(a[n]=i,e.dispatchCellChangedEvent(r,i,o))}function xc(e,t,s){e.group!==s&&(e.group&&!s&&(e.expanded=!1),e.group=s,e.updateHasChildren(),t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent("groupChanged"))}function Ms(e,t){const{gos:s,rowGroupColsSvc:i}=t;if(!i||!e)return!1;const r=s.get("groupLockGroupColumns");if(!e.isRowGroupActive()||r===0)return!1;if(r===-1)return!0;const a=i.columns.findIndex(n=>n.getColId()===e.getColId());return r>a}function Ts(e,t,s){const r=e(t,`${t==="groupBy"?"Group by":"Un-Group by"} ${s}`,[s]);return r.indexOf(s)>=0?r:`${r} ${s}`}import{AgPromise as gA,_STOP_PROPAGATION_CALLBACKS as fA,_addGridCommonParams as mA,_warn as CA}from"ag-grid-community";import{_getRootNode as vA,_isBrowserFirefox as SA,_isBrowserSafari as bA}from"ag-grid-community";function yA(e){const t=vA(e),s="getSelection"in t?t.getSelection():null,i=[];for(let r=0;r<(s?.rangeCount??0);r++){const a=s?.getRangeAt(r);a&&i.push(a)}return{selection:s,ranges:i}}function wA(e,t){if(!e.gos.get("enableCellTextSelection")||!SA()&&!bA())return t();const{selection:i,ranges:r}=yA(e);t(),i?.removeAllRanges();for(const a of r)i?.addRange(a)}var xA={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},Ma={getMenuItemComp:(e,t,s)=>e.userCompFactory.getCompDetails(t,xA,"agMenuItem",mA(e.gos,s),!0)?.newAgStackInstance()??gA.resolve(),getPostProcessPopupParams:({column:e,node:t})=>({column:e,rowNode:t}),preserveRangesWhile:wA,stopPropagationCallbacks:fA,warnNoItem:e=>{CA(228,{menuItemOrString:e})}},FA=class extends Si{constructor(){super(Ma)}},Ta=class extends bi{constructor(e,t={column:null,node:null,value:null}){super(e,t,Ma)}},Fc=class extends dA{constructor(e,t,s){super({tag:"div",cls:"ag-menu"}),this.column=e,this.mouseEventOrTouch=t,this.parentEl=s,this.displayName=null}postConstruct(){const{column:e,beans:{colNames:t}}=this;this.initializeProperties(e);let s;if(hA(e)?s=t.getDisplayNameForColumn(e,"columnToolPanel"):s=t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),this.displayName=s,this.buildMenuItemMap(),this.isActive()){const i=this.mouseEventOrTouch;"preventDefault"in i&&i.preventDefault();const r=this.getMappedMenuItems();if(r.length===0)return;this.displayContextMenu(r)}}initializeProperties(e){let t;pA(e)?t=e.getLeafColumns():t=[e],this.columns=t;const s=this.beans.colModel.isPivotMode();this.allowScrollIntoView=!s&&t.some(this.isColumnValidForScrollIntoView),this.allowGrouping=t.some(i=>i.isPrimary()&&i.isAllowRowGroup()),this.allowValues=t.some(i=>i.isPrimary()&&i.isAllowValue()),this.allowPivoting=s&&t.some(i=>i.isPrimary()&&i.isAllowPivot())}buildMenuItemMap(){const e=this.getLocaleTextFunc(),{beans:t,displayName:s}=this,{rowGroupColsSvc:i,valueColsSvc:r,pivotColsSvc:a,colModel:n}=t,o=new Map;this.menuItemMap=o;const l=n.isPivotMode();o.set("scrollIntoView",{allowedFunction:h=>!h.isPinned()&&!l&&this.isColumnValidForScrollIntoView(h),activeFunction:()=>!1,activateLabel:()=>e("scrollColumnIntoView",`Scroll ${s} into View`,[s]),activateFunction:()=>{const h=this.columns.find(this.isColumnValidForScrollIntoView);h&&this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(h)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});const c=h=>h.isPrimary()&&h.isAllowRowGroup()&&!Ms(h,t);o.set("rowGroup",{allowedFunction:c,activeFunction:h=>h.isRowGroupActive(),activateLabel:()=>Ts(e,"groupBy",s),deactivateLabel:()=>Ts(e,"ungroupBy",s),activateFunction:()=>i?.setColumns(this.addColumnsToList(i.columns,c),"toolPanelUi"),deActivateFunction:()=>i?.setColumns(this.removeColumnsFromList(i.columns,c),"toolPanelUi"),addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});const d=h=>h.isPrimary()&&h.isAllowValue();o.set("value",{allowedFunction:d,activeFunction:h=>h.isValueActive(),activateLabel:()=>e("addToValues",`Add ${s} to values`,[s]),deactivateLabel:()=>e("removeFromValues",`Remove ${s} from values`,[s]),activateFunction:()=>r?.setColumns(this.addColumnsToList(r.columns,d),"toolPanelUi"),deActivateFunction:()=>r?.setColumns(this.removeColumnsFromList(r.columns,d),"toolPanelUi"),addIcon:"valuePanel",removeIcon:"valuePanel"});const u=h=>l&&h.isPrimary()&&h.isAllowPivot();o.set("pivot",{allowedFunction:u,activeFunction:h=>h.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${s} to labels`,[s]),deactivateLabel:()=>e("removeFromLabels",`Remove ${s} from labels`,[s]),activateFunction:()=>a?.setColumns(this.addColumnsToList(a.columns,u),"toolPanelUi"),deActivateFunction:()=>a?.setColumns(this.removeColumnsFromList(a.columns,u),"toolPanelUi"),addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;const s=e.getParent();return s?s.getDisplayedChildren()?.includes(e)??!0:!0}addColumnsToList(e,t){return[...e].concat(this.columns.filter(s=>t(s)&&!e.includes(s)))}removeColumnsFromList(e,t){return e.filter(s=>t(s)&&!this.columns.includes(s))}displayContextMenu(e){const t=this.getGui(),s=this.createBean(new Ta),i=this.getLocaleTextFunc();let r=()=>{};t.appendChild(s.getGui()),s.addMenuItems(e),s.addManagedListeners(s,{closeMenu:()=>{this.parentEl.focus(),r()}});const a=this.beans.popupSvc,n=a.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>uA(s.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:o=>{o instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(s)}});n&&(r=n.hideFunc),a.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[],{menuItemMap:t,columns:s,displayName:i,beans:r}=this;for(const a of t.values()){const n=s.some(l=>a.allowedFunction(l)&&!a.activeFunction(l)),o=s.some(l=>a.allowedFunction(l)&&a.activeFunction(l));n&&e.push({name:a.activateLabel(i),icon:yc(a.addIcon,r,null),action:()=>a.activateFunction()}),o&&a.removeIcon&&a.deactivateLabel&&e.push({name:a.deactivateLabel(i),icon:yc(a.removeIcon,r,null),action:()=>a.deActivateFunction?.()})}return e}},RA={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},Rc=class extends JR{constructor(e,t,s,i){super(),this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.cbSelect=As,this.eLabel=As,this.eGroupOpenedIcon=As,this.eGroupClosedIcon=As,this.eColumnGroupIcons=As,this.processingColumnStateChange=!1;const{columnGroup:r,depth:a,displayName:n}=e;this.columnGroup=r,this.columnDepth=a,this.displayName=n}postConstruct(){this.setTemplate(RA,[ZR]);const{beans:e,cbSelect:t,eLabel:s,displayName:i,columnDepth:r,modelItem:a,focusWrapper:n,columnGroup:o}=this,{registry:l,gos:c}=e,d=eA("columnDrag",e);this.eDragHandle=d,d.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const u=t.getGui(),h=t.getInputElement();u.after(d),h.setAttribute("tabindex","-1"),s.textContent=i??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+r),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(l.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:tA(c,()=>s)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(a,{expandedChanged:this.onExpandChanged.bind(this)});const p=new fc(this.getGui(),!1);this.addManagedListeners(p,{longTap:f=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(p.destroy.bind(p)),this.addManagedListeners(n,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();const g=sA(o.getColGroupDef(),c,null,o);for(const f of g)this.toggleCss(f,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);t(),this.addManagedEventListeners({newColumnsLoaded:t})}handleKeyDown(e){switch(e.key){case Fa.LEFT:e.preventDefault(),this.modelItem.expanded=!1;break;case Fa.RIGHT:e.preventDefault(),this.modelItem.expanded=!0;break;case Fa.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){const{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new Fc(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const e=this.onColumnStateChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})}setupDragging(){if(!this.allowDragging){Ra(this.eDragHandle,!1);return}const e=this.beans,{gos:t,eventSvc:s,dragAndDrop:i}=e;let r=!t.get("suppressDragLeaveHidesColumns");const a={type:QR.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>r?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{r=!t.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{r&&Sc(e,{columns:this.columnGroup.getLeafColumns(),visibleState:n?.visibleState,pivotState:n?.pivotState,eventType:this.eventType})},onGridExit:()=>{r&&this.onChangeCommon(!1)}};i.addDragSource(a,!0),this.addDestroyFunc(()=>i.removeDragSource(a))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},s={};for(const i of e){const r=i.getId();t[r]=i.isVisible(),s[r]=bc(i)}return{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){const{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:s,eColumnGroupIcons:i}=this;t.appendChild(mc("columnSelectClosed",e,null)),s.appendChild(mc("columnSelectOpen",e,null));const r=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:r}),this.addManagedElementListeners(s,{click:r});const a=new fc(i,!0);this.addManagedListeners(a,{tap:r}),this.addDestroyFunc(a.destroy.bind(a))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=s=>{for(const i of s)i.passesFilter&&(i.group?t(i.children):e.push(i.column))};return t(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&Cc(this.beans,this.modelItem.children,e,this.eventType)}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumnGroup","Column Group"),a=e.getValue(),n=a===void 0?i("ariaIndeterminate","indeterminate"):a?i("ariaVisible","visible"):i("ariaHidden","hidden"),o=i("ariaToggleVisibility","Press SPACE to toggle visibility");aA(t,`${s} ${r}`),e.setInputAriaLabel(`${o} (${n})`),iA(t,e.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;const s=this.cbSelect;s.setValue(e),s.setReadOnly(t),this.toggleCss("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.beans.colModel.isPivotMode(),t=this.getVisibleLeafColumns();let s=0,i=0;for(const r of t)(e||!r.getColDef().lockVisible)&&(this.isColumnChecked(r,e)?s++:i++);if(!(s>0&&i>0))return s>0}workOutReadOnlyValue(){const e=this.beans.colModel.isPivotMode();let t=0;for(const s of this.columnGroup.getLeafColumns())e?s.isAnyFunctionAllowed()&&t++:s.getColDef().lockVisible||t++;return t===0}isColumnChecked(e,t){if(t){const s=e.isPivotActive(),i=e.isRowGroupActive(),r=e.isValueActive();return s||i||r}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem,t=e.expanded;e.expanded=!t}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.expanded;Ra(this.eGroupClosedIcon,!e),Ra(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){rA(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect,s=t.getValue();!t.isReadOnly()&&(e&&!s||!e&&s)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},Pa=e=>XR(e)?e.getLeafColumns():e?[e]:[],AA=(e,t,s,i)=>{if(!s||!t)return null;const r=e.colModel.getCols(),a=r.indexOf(s),n=i?a:a+1,o=MA(r,t,n);return n-o},MA=(e,t,s)=>{if(!t)return 0;const i=t[0],r=t.length;return e.indexOf(i)<s?r:0},Ac=(e,t,s)=>e.get("suppressMovableColumns")||t.colModel.isPivotMode()?!0:!!s.find(({colDef:a})=>!!a.suppressMovable||!!a.lockPosition),Mc=(e,t,s)=>{if(!s)return;const{component:i}=s;let r=null,a=s.position==="top";if(i instanceof Rc?(r=i.getColumns()[0],a=!0):i&&(r=i.column),!r)return;const n=AA(e,t,r,a);n!=null&&e.colMoves?.moveColumns(t,n,"toolPanelUi")},TA=e=>e.column;import{AgCheckboxSelector as PA,Component as IA,DragSourceType as EA,KeyCode as DA,RefPlaceholder as Tc,TouchListener as LA,_createIconNoSpan as kA,_getShouldDisplayTooltip as GA,_getToolPanelClassesFromColDef as OA,_setAriaDescribedBy as _A,_setAriaLabel as NA,_setDisplayed as BA,_warn as VA}from"ag-grid-community";var HA={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},zA=class extends IA{constructor(e,t,s,i){super(),this.modelItem=e,this.allowDragging=t,this.groupsExist=s,this.focusWrapper=i,this.eLabel=Tc,this.cbSelect=Tc,this.processingColumnStateChange=!1;const{column:r,depth:a,displayName:n}=e;this.column=r,this.columnDepth=a,this.displayName=n}postConstruct(){this.setTemplate(HA,[PA]);const{beans:e,cbSelect:t,displayName:s,eLabel:i,columnDepth:r,groupsExist:a,column:n,gos:o,focusWrapper:l}=this,c=kA("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const d=t.getGui(),u=t.getInputElement();d.after(c),u.setAttribute("tabindex","-1"),i.textContent=s,a&&this.addCss("ag-column-select-add-group-indent"),this.addCss(`ag-column-select-indent-${r}`),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:GA(o,()=>i),getAdditionalParams:()=>({colDef:n.getColDef()})})),this.setupDragging();const h=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:h}),this.addManagedListeners(n,{columnValueChanged:h,columnPivotChanged:h,columnRowGroupChanged:h,visibleChanged:h}),this.addManagedListeners(l,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});const p=new LA(l);this.addManagedListeners(p,{longTap:f=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(p.destroy.bind(p)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(i,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();const g=OA(n.getColDef(),o,n,null);for(const f of g)this.toggleCss(f,!0)}getColumn(){return this.column}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);e(),this.addManagedEventListeners({newColumnsLoaded:e})}onContextMenu(e){const{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new Fc(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(e){e.key===DA.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&vc(this.beans,[this.column],e,"toolPanelUi"))}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumn","Column"),a=e.getValue()?i("ariaVisible","visible"):i("ariaHidden","hidden"),n=i("ariaToggleVisibility","Press SPACE to toggle visibility");NA(t,`${s} ${r}`),this.cbSelect.setInputAriaLabel(`${n} (${a})`),_A(t,e.getInputElement().id)}setupDragging(){const e=this.eDragHandle;if(!this.allowDragging){BA(e,!1);return}const t=this.beans,{gos:s,eventSvc:i,dragAndDrop:r}=t;let a=!s.get("suppressDragLeaveHidesColumns");const n={type:EA.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>a?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{a=!s.get("suppressDragLeaveHidesColumns"),i.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{i.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:o=>{a&&Sc(t,{columns:[this.column],visibleState:o?.visibleState,pivotState:o?.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{a&&this.onChangeCommon(!1)}};r.addDragSource(n,!0),this.addDestroyFunc(()=>r.removeDragSource(n))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},s={[e]:bc(this.column)};return{columns:[this.column],visibleState:t,pivotState:s}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.beans.colModel.isPivotMode();if(e){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,s=!0;if(e){const i=this.gos.get("functionsReadOnly"),r=!this.column.isAnyFunctionAllowed();t=!i&&!r,s=t}else{const{enableRowGroup:i,enableValue:r,lockPosition:a,suppressMovable:n,lockVisible:o}=this.column.getColDef(),l=!!i||!!r,c=!!a||!!n;t=!o,s=l||!c}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!s),this.toggleCss("ag-column-select-column-readonly",!s&&!t),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect;e!==t.getValue()&&(t.isReadOnly()||t.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){VA(158)}},UA=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},WA="ag-column-select-list",KA=class extends _R{constructor(){super({tag:"div",cls:WA,role:"presentation"}),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(const e of this.destroyColumnItemFuncs)e();this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e;const{suppressSyncLayoutWithGrid:i,contractColumnSelection:r,suppressColumnMove:a}=e;this.allowDragging=t,this.eventType=s,i||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const n=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:n,columnPivotModeChanged:n,columnRowGroupChanged:n,columnValueChanged:n,columnVisible:n,newColumnsLoaded:n}),this.expandGroupsByDefault=!r;const o=a||i,l=this.createManagedBean(new Ot({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(c,d)=>{o||this.moveItems(c,d)}}));this.virtualList=l,this.appendChild(l.getGui()),l.setComponentCreator((c,d)=>(VR(d,c.depth+1),this.createComponentFromItem(c,d))),this.colModel.ready&&this.onColumnsChanged(),!o&&this.createItemDragFeature()}createItemDragFeature(){const{gos:e,beans:t,virtualList:s}=this;this.createManagedBean(new xl(this,s,{dragSourceType:NR.ToolPanel,addListeners:(i,r,a)=>{i.addManagedEventListeners({columnPanelItemDragStart:r,columnPanelItemDragEnd:a})},getCurrentDragValue:i=>TA(i),isMoveBlocked:i=>Ac(e,t,Pa(i)),getNumRows:i=>i.getDisplayedColsList().length,moveItem:(i,r)=>Mc(t,Pa(i),r)}))}moveItems(e,t){const{gos:s,beans:i}=this,{modelItem:r}=e,{group:a,columnGroup:n,column:o,expanded:l}=r,c=Pa(a?n:o);if(Ac(s,i,c))return;const d=this.displayedColsList.indexOf(r),u=t?-1:1;let h=0;if(t){const g=e.columnDepth>0?o.getParent()?.getChildren():null;g?.length&&o===g[0]&&(h=-1)}else a&&(h=l?r.children.length:0);const p=Math.min(Math.max(d+h+u,0),this.displayedColsList.length-1);this.skipRefocus=!0,Mc(i,c,{rowIndex:p,position:t?"top":"bottom",component:this.virtualList.getComponentAt(p)}),this.focusRowIfAlive(p-h).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){const s=this.allowDragging;if(e.group){const r=new Rc(e,s,this.eventType,t);return this.createBean(r),r}const i=new zA(e,s,this.groupsExist,t);return this.createBean(i),i}onColumnsChanged(){const e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);const t=this.getExpandedStates(),s=this.colModel.isPivotMode();!e.suppressSyncLayoutWithGrid&&!s?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;for(const s of t)e[s]=!0;return e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;const s=t.columnGroup;s&&(e[s.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(s=>{if(!s.group)return;const i=s.columnGroup;if(i){const r=e[i.getId()];(r!=null||t)&&(s.expanded=!!r)}})}buildTreeFromWhatGridIsDisplaying(){pc(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){const t=hc(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(s=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){const t=this.onColumnExpanded.bind(this),s=o=>{o.addEventListener("expandedChanged",t);const l=o.removeEventListener.bind(o,"expandedChanged",t);this.destroyColumnItemFuncs.push(l)},i=this.beans.colNames,r=(o,l,c)=>{for(const d of o)zR(d)?a(d,l,c):n(d,l,c)},a=(o,l,c)=>{if(o.getColGroupDef()?.suppressColumnsToolPanel)return;if(o.isPadding()){r(o.getChildren(),l,c);return}const h=i.getDisplayNameForProvidedColumnGroup(null,o,"columnToolPanel"),p=new gc(h,o,l,!0,this.expandGroupsByDefault);c.push(p),s(p),r(o.getChildren(),l+1,p.children)},n=(o,l,c)=>{if(o.getColDef()?.suppressColumnsToolPanel)return;const u=i.getDisplayNameForColumn(o,"columnToolPanel");c.push(new gc(u,o,l))};this.destroyColumnTree(),r(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=i=>{i.passesFilter&&(this.displayedColsList.push(i),i.group&&i.expanded&&i.children.forEach(e))},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new UA(this.displayedColsList));let s=null;this.skipRefocus||(s=t.getLastFocusedRow()),t.refresh(),s!=null&&this.focusRowIfAlive(s),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;BR(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){return e===-1?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}forEachItem(e){const t=i=>{for(const r of i)e(r),r.group&&t(r.children)},s=this.allColsTree;s&&t(s)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}const s=[];this.forEachItem(r=>{if(!r.group)return;const a=r.columnGroup.getId();t.indexOf(a)>=0&&(r.expanded=e,s.push(a))});const i=t.filter(r=>!s.includes(r));i.length>0&&HR(157,{unrecognisedGroupIds:i})}getExpandState(){let e=0,t=0;return this.forEachItem(s=>{s.group&&(s.expanded?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){Cc(this.beans,this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const s=this.colModel.isPivotMode();if(this.forEachItem(i=>{if(i.group||!i.passesFilter)return;const r=i.column,a=r.getColDef();let n;if(s){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;n=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(a.lockVisible)return;n=r.isVisible()}n?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=dc(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=s=>{if(!dc(this.filterText))return!0;const i=s.displayName;return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let r=!1;if(s.group){const n=e(s);for(const o of s.children){const l=t(o,n||i);l&&(r=l)}}const a=i||r?!0:e(s);return s.passesFilter=a,a};for(const s of this.allColsTree)t(s,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree&&this.forEachItem(t=>{t.group&&t.expanded&&e.push(t.columnGroup.getId())}),e}},$A={selector:"AG-PRIMARY-COLS-LIST",component:KA},jA={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},Pc=class extends RR{constructor(){super(jA,[OR,$A]),this.primaryColsHeaderPanel=cc,this.primaryColsListPanel=cc,this.registerCSS(MR)}init(e,t,s){const{primaryColsHeaderPanel:i,primaryColsListPanel:r}=this;i.init(t);const a=t.suppressColumnFilter,n=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&a&&n&&i.setDisplayed(!1),this.addManagedListeners(r,{groupExpanded:l=>{i.setExpandState(l.state),t.onStateUpdated()},selectionChanged:l=>i.setSelectionState(l.state)}),r.init(t,e,s),this.addManagedListeners(i,{expandAll:r.doSetExpandedAll.bind(r,!0),collapseAll:r.doSetExpandedAll.bind(r,!1),selectAll:r.doSetSelectedAll.bind(r,!0),unselectAll:r.doSetSelectedAll.bind(r,!1),filterChanged:l=>r.setFilterText(l.filterText)}),this.positionableFeature=this.createManagedBean(new AR(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},YA=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select{border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}",qA=class extends yR{constructor(){super({tag:"div",cls:"ag-column-panel"}),this.initialised=!1,this.childDestroyFuncs=[],this.registerCSS(YA)}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const s={...wR(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=s;const{childDestroyFuncs:i,colToolPanelFactory:r,gos:a}=this,n=a.isModuleRegistered("SharedPivot"),o=n||a.isModuleRegistered("SharedRowGrouping");!s.suppressPivotMode&&r&&n&&(this.pivotModePanel=r.createPivotModePanel(this,i));const l=this.createBean(new Pc);if(this.primaryColsPanel=l,i.push(()=>this.destroyBean(this.primaryColsPanel)),l.init(!0,s,"toolPanelUi"),l.addCss("ag-column-panel-column-select"),this.appendChild(l),r){!s.suppressRowGroups&&o&&(this.rowGroupDropZonePanel=r.createRowGroupPanel(this,i)),!s.suppressValues&&o&&(this.valuesDropZonePanel=r.createValuesPanel(this,i)),!s.suppressPivots&&n&&(this.pivotDropZonePanel=r.createPivotPanel(this,i)),this.setLastVisible();const[c]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});i.push(()=>c())}this.initialised=!0}setPivotModeSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,!0)),this.setLastVisible())}setRowGroupsSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setValuesSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setPivotSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible())}setResizers(){for(const e of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!e)continue;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))}}setLastVisible(){const e=this.getGui(),t=Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop"));for(const r of t)r.classList.remove("ag-last-column-drop");const s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=FR(s);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const t=this.getGui().children;for(let s=0;s<t.length;s++){const{style:i}=t[s];i.removeProperty("height"),i.removeProperty("flex")}}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){const e=this.childDestroyFuncs;for(const t of e)t();e.length=0,xR(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};import{BeanStub as XA}from"ag-grid-community";import{_createIconNoSpan as ZA}from"ag-grid-community";import{DragSourceType as Ic,_shouldUpdateColVisibilityAfterGroup as JA}from"ag-grid-community";import{Component as QA,KeyCode as Ht,ManagedFocusFeature as eM,PositionableFeature as tM,_areEqual as sM,_clearElement as Ec,_createElement as Li,_createIconNoSpan as iM,_findFocusableElements as rM,_findNextFocusableElement as Ia,_getActiveDomElement as Dc,_isKeyboardMode as aM,_last as nM,_setAriaHidden as oM,_setAriaLabel as lM,_setAriaPosInSet as cM,_setAriaRole as dM,_setAriaSetSize as uM}from"ag-grid-community";var hM=".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}.ag-column-drop-cell-button:hover{opacity:1}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{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-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}.ag-select-agg-func-virtual-list-item:hover{background-color:var(--ag-selected-row-background-color)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}";function Lc(e,t,s){e==null||t==null||e.splice(s,0,...t)}var pM={tag:"div",cls:"ag-unselectable",role:"presentation"},kc=class extends QA{constructor(e){super(pM),this.horizontal=e,this.state="notDragging",this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=Li({tag:"div"}),this.addElementClasses(this.ePillDropList,"list"),this.registerCSS(hM)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:s}=e;return t.contains(s.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){for(const e of this.guiDestroyFunctions)e();this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Ec(this.getGui()),Ec(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new eM(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new tM(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),lM(this.ePillDropList,this.getAriaLabel())}onTabKeyDown(e){const t=rM(this.getFocusableElement(),null,!0),s=t.length;if(s===0)return;const{shiftKey:i}=e,r=Dc(this.beans),a=r===t[0],n=r===nM(t);s===1||a&&i||n&&!i||t[i?0:s-1].focus()}onKeyDown(e){const{key:t}=e,s=!this.horizontal;let i=t===Ht.DOWN,r=t===Ht.UP;if(!s){const a=this.gos.get("enableRtl");i=!a&&t===Ht.RIGHT||a&&t===Ht.LEFT,r=!a&&t===Ht.LEFT||a&&t===Ht.RIGHT}if(!(!i&&!r))if(e.preventDefault(),e.shiftKey)this.moveFocusedItem(r);else{const a=Ia(this.beans,this.getFocusableElement(),!1,r);a&&a.focus()}}moveFocusedItem(e){const t=this.getFocusedItem();if(t===-1)return;const s=e?-1:1;if(!this.normalizeAndUpdateInsertIndex(t,t+s))return;const r=this.childPillComponents[t];if(!r.isMovable())return;const a=r.getItem();this.focusItemAtIndex(this.insertIndex),this.rearrangeItems([a],!0)}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${s}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);return t<0?!1:this.normalizeAndUpdateInsertIndex(this.insertIndex,t)}normalizeAndUpdateInsertIndex(e,t){const s=this.minimumAllowedNewInsertIndex(),i=Math.max(s,t),r=i!==e;return r&&(this.insertIndex=i),r}getNewInsertIndex(e){const t=e.event,s=this.horizontal?t.clientX:t.clientY,i=this.childPillComponents.map(a=>a.getGui().getBoundingClientRect()),r=i.findIndex(a=>this.horizontal?a.right>s&&a.left<s:a.top<s&&a.bottom>s);if(r===-1){const a=this.gos.get("enableRtl");return i.every(l=>s>(this.horizontal?l.right:l.bottom))?a&&this.horizontal?0:this.childPillComponents.length:i.every(l=>s<(this.horizontal?l.left:l.top))?a&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(e){this.state==="notDragging"&&(this.state="rearrangeItems",this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){const t=this.getItems(e.dragSource.getDragItem());this.state="newItemsIn";const s=t.filter(r=>this.isItemDroppable(r,e)),i=s.every(r=>this.childPillComponents.map(a=>a.getItem()).indexOf(r)!==-1);if(s.length!==0){if(this.potentialDndItems=s,i){this.state="notDragging";return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state==="rearrangeItems"){const t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragCancel(e){this.isPotentialDndItems()&&(this.state==="newItemsIn"&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragStop(){this.isPotentialDndItems()&&(this.state==="newItemsIn"?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}removeItems(e){const t=this.getExistingItems().filter(s=>!e.includes(s));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),s=e.filter(i=>t.indexOf(i)<0);Lc(t,s,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e,t){let s;return t?s=this.getExistingItems().filter(i=>e.indexOf(i)===-1):s=this.getNonGhostItems().slice(),Lc(s,e,this.insertIndex),sM(s,this.getExistingItems())?!1:(this.updateItems(s),!0)}refreshGui(){let e=0;this.horizontal||(e=this.ePillDropList.scrollTop);const t=this.resizeEnabled,s=this.getFocusedItem(),{eGridDiv:i}=this.beans,r=aM();let a=null;r&&(a=Ia(this.beans,i)??Ia(this.beans,i,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),e!==0&&(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),r&&this.restoreFocus(s,a)}getFocusedItem(){const e=this.getGui(),t=Dc(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}focusItemAtIndex(e){const t=this.getGui(),i=Array.from(t.querySelectorAll(".ag-column-drop-cell"))[e];i&&i.focus({preventScroll:!0})}restoreFocus(e,t){const s=this.getGui(),i=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;i.length===0&&t.focus();const r=Math.min(i.length-1,e),a=i[r];a&&a.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(t=>!this.potentialDndItems.includes(t)):e}addItemsToGui(){const t=this.getNonGhostItems().map(s=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){const s=this.potentialDndItems.map(i=>this.createItemComponent(i,!0));this.insertIndex>=t.length?t.push(...s):t.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),t.forEach((s,i)=>{i>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){const{childPillComponents:e,ePillDropList:t}=this,s=e.length;dM(t,s===0?"presentation":"listbox");for(let i=0;i<s;i++){const a=e[i].getGui();cM(a,i+1),uM(a,s)}}createItemComponent(e,t){const s=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return s.addEventListener("columnRemove",this.removeItems.bind(this,[e])),this.createBean(s),this.guiDestroyFunctions.push(()=>this.destroyBean(s)),t||this.childPillComponents.push(s),s}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const s=Li({tag:"div"});if(oM(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(t,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(t),!this.horizontal){const i=Li({tag:"span"});this.addElementClasses(i,"title"),i.textContent=e,s.appendChild(i)}this.appendChild(s)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=Li({tag:"span"});t.textContent=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=this.gos.get("enableRtl"),s=iM(t?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(s,"cell-separator"),e.appendChild(s)}}};import{Component as gM,DragSourceType as fM,KeyCode as ki,RefPlaceholder as mM,_createElement as CM}from"ag-grid-community";import{Component as vM,KeyCode as SM,RefPlaceholder as Ea,TouchListener as bM,_createIconNoSpan as Gc,_setAriaLabel as yM,_setDisplayed as wM}from"ag-grid-community";var xM={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},Oc=class extends vM{constructor(e,t,s,i,r){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=s,this.template=i,this.agComponents=r,this.eText=Ea,this.eDragHandle=Ea,this.eButton=Ea}postConstruct(){this.setTemplate(this.template??xM,this.agComponents);const e=this.getGui(),{beans:t,eDragHandle:s,eText:i,eButton:r}=this;this.addElementClasses(e),this.addElementClasses(s,"drag-handle"),this.addElementClasses(i,"text"),this.addElementClasses(r,"button"),s.appendChild(Gc("columnDrag",t)),r.appendChild(Gc("cancel",t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),yM(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const s=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(s)}}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());e(),this.addManagedEventListeners({newColumnsLoaded:e})}getDragSourceId(){}getDefaultIconName(){return"notAllowed"}addDragSource(){const{beans:{dragAndDrop:e},eDragHandle:t}=this,s=this.createGetDragItem(),i=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>i,getDragItem:s,dragItemName:this.getDisplayName()};e?.addDragSource(r,!0),this.addDestroyFunc(()=>e?.removeDragSource(r))}setupComponents(){this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost&&this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){wM(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:"columnRemove"};this.addGuiEventListener("keydown",s=>this.onKeyDown(s)),this.addManagedElementListeners(this.eButton,{click:s=>{this.dispatchLocalEvent(e),s.stopPropagation()}});const t=new bM(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===SM.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"}))}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${s}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},FM=class extends Oc{constructor(e,t,s,i,r){super(t,s,r),this.column=e,this.dropZonePurpose=i,this.eSortIndicator=mM,this.popupShowing=!1}postConstruct(){const{sortSvc:e,colNames:t}=this.beans;this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},e?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},e&&(this.agComponents=[e.getSortIndicatorSelector()]),this.displayName=t.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),e&&(this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}})),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const s=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const r=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(r)}if(this.isGroupingZone()&&this.column.isSortable()&&!s){const r=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(r)}super.addAdditionalAriaInstructions(e,t)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.getLocaleTextFunc(),{name:t,aggFuncName:s}=this.getColumnAndAggFuncName(),i=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),r={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},a=this.column.getSort(),n=this.gos.get("rowGroupPanelSuppressSort");return[s&&`${s}${i}`,t,this.isGroupingZone()&&!n&&a&&`, ${r[a]}`].filter(o=>!!o).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const s=this.column.getAggFunc(),i=typeof s=="string"?s:"agg";t=this.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){if(!(!this.column.isSortable()||!this.isGroupingZone())&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=t=>{t.preventDefault(),this.beans.sortSvc.progressSortFromEvent(this.column,t)};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===ki.ENTER&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===ki.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const{aggFuncSvc:e,popupSvc:t}=this.beans,s=new Ot({cssIdentifier:"select-agg-func"}),i=e.getFuncNames(this.column),r=this.getGui(),a=s.getGui();s.setModel({getRow:function(h){return i[h]},getRowCount:function(){return i.length}}),this.createBean(s);const n=CM({tag:"div",cls:"ag-select-agg-func-popup"});n.style.top="0px",n.style.left="0px",n.appendChild(a),n.style.width=`${r.clientWidth}px`;const[o]=this.addManagedElementListeners(n,{focusout:h=>{!n.contains(h.relatedTarget)&&d&&d.hideFunc()}}),l=h=>{this.destroyBean(s),this.popupShowing=!1,h?.key==="Escape"&&r.focus(),o&&o()},c=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:l,ariaLabel:c("ariaLabelAggregationFunction","Aggregation Function")});d&&s.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc)),s.addGuiEventListener("keydown",h=>{if(h.key===ki.ENTER||h.key===ki.SPACE){const p=s.getLastFocusedRow();if(p==null)return;const g=s.getComponentAt(p);g&&g.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:r,ePopup:n,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),s.refresh();let u=i.findIndex(h=>h===this.column.getAggFunc());u===-1&&(u=0),s.focusRow(u)}createAggSelect(e,t){const s=()=>{e(),this.getGui().focus(),this.beans.valueColsSvc?.setColumnAggFunc?.(this.column,t,"toolPanelDragAndDrop")},i=this.getLocaleTextFunc(),r=t.toString(),a=i(r,r);return new RM(s,a)}isGroupingAndLocked(){return this.isGroupingZone()&&Ms(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return fM.ToolPanel}destroy(){super.destroy(),this.column=null}},RM=class extends gM{constructor(e,t){super({tag:"div",cls:"ag-select-agg-func-item",children:t}),this.selectItem=e,this.addGuiEventListener("click",this.selectItem)}},Da=class extends kc{constructor(e,t){super(e),this.dropZonePurpose=t,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e){return e===Ic.HeaderCell||e===Ic.ToolPanel}minimumAllowedNewInsertIndex(){const{gos:e,rowGroupColsSvc:t}=this.beans,s=e.get("groupLockGroupColumns"),i=t?.columns.length??0;return s===-1?i:Math.min(s,i)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&JA(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const i=e.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const s=e.dragSource.getDragItem();this.setColumnsVisible(s.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,s){if(e){const i=e.filter(r=>!r.getColDef().lockVisible);this.beans.colModel.setColsVisible(i,t,s)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(e,t,s,i){return new FM(e,t,s,this.dropZonePurpose,i)}},_c=class extends Da{constructor(e){super(e,"pivot")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),s=e("pivots","Column Labels");super.init({icon:ZA("pivotPanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.beans.colModel,t=e.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const s=e.isPivotActive();this.setDisplayed(t&&s);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()?!1:e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.pivotColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.pivotColsSvc?.columns??[]}};import{_createIconNoSpan as AM}from"ag-grid-community";var Nc=class extends Da{constructor(e){super(e,"rowGroup")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),s=e("groups","Row Groups");super.init({icon:AM("rowGroupPanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()||e.colDef.showRowGroup?!1:e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.rowGroupColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.rowGroupColsSvc?.columns??[]}};import{_createIconNoSpan as MM}from"ag-grid-community";var TM=class extends Da{constructor(e){super(e,"aggregation")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),s=e("values","Values");super.init({icon:MM("valuePanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()?!1:e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.valueColsSvc?.setColumns(e,"toolPanelUi")}getExistingItems(){return this.beans.valueColsSvc?.columns??[]}};import{AgToggleButtonSelector as PM,Component as IM,RefPlaceholder as EM}from"ag-grid-community";var DM={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},LM=class extends IM{constructor(){super(...arguments),this.cbPivotMode=EM}postConstruct(){this.setTemplate(DM,[PM]);const e=this.cbPivotMode,{colModel:t,ctrlsSvc:s,gos:i}=this.beans;e.setValue(t.isPivotMode());const r=this.getLocaleTextFunc();e.setLabel(r("pivotMode","Pivot Mode"));const a=()=>{const o=!!e.getValue();if(o!==t.isPivotMode()){i.updateGridOptions({options:{pivotMode:o},source:"toolPanelUi"});for(const l of s.getHeaderRowContainerCtrls())l.refresh()}},n=()=>{const o=t.isPivotMode();e.setValue(o)};this.addManagedListeners(e,{fieldValueChanged:a}),this.addManagedEventListeners({newColumnsLoaded:n,columnPivotModeChanged:n})}},kM=class extends XA{constructor(){super(...arguments),this.beanName="colToolPanelFactory"}setPanelVisible(e,t,s){return e?e.setDisplayed(t):t&&(e=s()),e}createRowGroupPanel(e,t){return this.createPanel(e,t,new Nc(!1))}createValuesPanel(e,t){return this.createPanel(e,t,new TM(!1))}createPivotPanel(e,t){return this.createPanel(e,t,new _c(!1))}createPivotModePanel(e,t,s){return this.createPanel(e,t,new LM,s)}createPanel(e,t,s,i){return s=e.createBean(s),t.push(()=>e.destroyBean(s)),i?e.prependChild(s):e.appendChild(s),s}},Bc={moduleName:"ColumnsToolPanel",version:D,beans:[kM],userComponents:{agColumnsToolPanel:qA},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[B,Rs,wF,FF,xF,Di]};import{_ColumnMoveModule as GM,_PopupModule as OM,_SharedDragAndDropModule as _M,_SharedMenuModule as NM}from"ag-grid-community";import{BeanStub as BM,_createIconNoSpan as Vc,_warn as Hc}from"ag-grid-community";var VM=class extends BM{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}getChartItems(e){const t=this.beans,s=t.chartSvc,i=e==="pivotChart";if(!s)return null;const r=this.getLocaleTextFunc.bind(this),a=i?new HM(t,s,r):new zM(t,s,r),n=s.isEnterprise();let o=a.getMenuItem();if(o?.subMenu&&!n){const c=d=>({...d,subMenu:d.subMenu?.filter(u=>!u._enterprise).map(u=>c(u))});o=c(o)}const l=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return l&&(o=this.filterAndOrderChartMenu(o,l,a.getConfigLookup())),this.cleanInternals(o)}cleanInternals(e){if(!e)return e;const t=s=>{delete s?._key,delete s?._enterprise;for(const i of s?.subMenu??[])t(i);return s};return t(e)}buildLookup(e){const t={},s=i=>{if(t[i._key]=i,i.subMenu)for(const r of i.subMenu)s(r)};return s(e),t}filterAndOrderChartMenu(e,t,s){const i=this.buildLookup(e),r={...e,subMenu:[]};for(const a of Object.keys(t)){const n=t[a],o=s[a];if(o===null)continue;if(o==null){Hc(173,{group:a});continue}const l=i[o._key];if(l)if(l.subMenu){const c=n.map(d=>{const u=o[d];if(u==null){Hc(174,{group:a,chartType:d});return}return i[u]}).filter(d=>d!==void 0);c.length>0&&(l.subMenu=c,r.subMenu?.push(l))}else r.subMenu?.push(l)}return r.subMenu?.length==0?null:r}},HM=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,a,n=!1)=>({name:e(s,i+"\u200E"),action:()=>this.chartSvc.createPivotChart({chartType:r}),_key:a,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","pivotPie"),t("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","pivotLineChart"),t("stackedLine","Stacked","stackedLine","pivotStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","pivotArea"),t("stackedArea","Stacked","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","pivotScatter"),t("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","pivotFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),t("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:Vc("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},zM=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,a,n=!1)=>({name:e(s,i),action:()=>this.chartSvc.createChartFromCurrentRange(r),_key:a,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","rangePie"),t("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","rangeLineChart"),t("stackedLine","Stacked","stackedLine","rangeStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","rangeArea"),t("stackedArea","Stacked","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","rangeScatter"),t("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line","radarLine","rangeRadarLine"),t("radarArea","Radar Area","radarArea","rangeRadarArea"),t("nightingale","Nightingale","nightingale","rangeNightingale"),t("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram","histogram","rangeHistogram",!1),t("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap","treemap","rangeTreemap"),t("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap","heatmap","rangeHeatmap"),t("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","rangeFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),t("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:Vc("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}};import{BeanStub as UM,_addGridCommonParams as WM,_findNextFocusableElement as KM}from"ag-grid-community";var $M=class extends UM{constructor(){super(...arguments),this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,s,i){const r=e.createManagedBean(new Pc),a=i??t?.getColDef().columnChooserParams??{},{contractColumnSelection:n,suppressColumnExpandAll:o,suppressColumnFilter:l,suppressColumnSelectAll:c,suppressSyncLayoutWithGrid:d,columnLayout:u}=a;return r.init(!!s,WM(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n,suppressColumnExpandAll:!!o,suppressColumnFilter:!!l,suppressColumnSelectAll:!!c,suppressSyncLayoutWithGrid:!!u||!!d,onStateUpdated:()=>{}}),"columnMenu"),u&&r.setColumnLayout(u),r}showColumnChooser({column:e,chooserParams:t,eventSource:s,headerPosition:i}){this.hideActiveColumnChooser();const r=this.createColumnSelectPanel(this,e,!0,t),a=this.getLocaleTextFunc(),n=this.beans,{visibleCols:o,focusSvc:l,menuUtils:c}=n,d=o.allCols.indexOf(e),u=e?l.focusedHeader??i??null:null;this.activeColumnChooserDialog=this.createBean(new Fi({title:a("chooseColumns","Choose Columns"),component:r,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{KM(n,r.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:h=>{const p=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&c.restoreFocusOnClose({column:e,headerPosition:u,columnIndex:d,eventSource:s},p,h,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:s}})),this.activeColumnChooser=r}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}};import{BeanStub as jM,_addGridCommonParams as YM,_getDisplaySortForColumn as qM,_getGrandTotalRow as XM,_isClientSideRowModel as ZM,_isLegacyMenuEnabled as JM}from"ag-grid-community";import{BeanStub as QM,_createIconNoSpan as Y,_exists as eT,_getRowNode as tT,_normalizeSortType as sT,_resetColumnState as iT,_warn as rT}from"ag-grid-community";var aT={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function nT(e,t){const s=aT[t];s&&e.assertModuleRegistered(s,`menu item '${t}'`)}var Ct="separator";function zc(e,t){if(e)for(let s=e.length-2;s>=0;s--){const i=e[s]===t,r=e[s+1]===t;i&&r&&e.splice(s+1,1)}}var oT={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:e=>({type:sT(e.getSortDef()?.type),direction:null})}},lT=class extends QM{constructor(){super(...arguments),this.beanName="menuItemMapper"}mapWithStockItems(e,t,s,i,r){if(!e)return[];const a=[],n=this.getLocaleTextFunc(),{beans:o,gos:l}=this,{pinnedCols:c,colAutosize:d,aggFuncSvc:u,rowGroupColsSvc:h,colNames:p,colModel:g,clipboardSvc:f,expansionSvc:m,focusSvc:C,csvCreator:v,excelCreator:S,menuSvc:b,colChooserFactory:y,sortSvc:w,chartMenuItemMapper:M,valueColsSvc:T,pinnedRowModel:F}=o,I=(E,P,N,k)=>{switch(nT(l,E),E){case"pinSubMenu":return c&&P?{name:n("pinColumn","Pin Column"),icon:Y("menuPin",o,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return c&&P?{name:n("pinLeft","Pin Left"),action:()=>c.setColsPinned([P],"left",k),checked:!!P&&P.isPinnedLeft()}:null;case"pinRight":return c&&P?{name:n("pinRight","Pin Right"),action:()=>c.setColsPinned([P],"right",k),checked:!!P&&P.isPinnedRight()}:null;case"clearPinned":return c&&P?{name:n("noPin","No Pin"),action:()=>c.setColsPinned([P],null,k),checked:!!P&&!P.isPinned()}:null;case"pinRowSubMenu":{const A=l.get("enableRowPinning"),L=[],_=s?.rowPinned??s?.pinnedSibling?.rowPinned;return _&&L.push("unpinRow"),A&&A!=="bottom"&&_!="top"&&L.push("pinTop"),A&&A!=="top"&&_!="bottom"&&L.push("pinBottom"),F?.isManual()?{name:n("pinRow","Pin Row"),icon:Y("rowPin",o,P),subMenu:L}:null}case"pinTop":return F?.isManual()?{name:n("pinTop","Pin to Top"),icon:Y("rowPinTop",o,P),action:({node:A,column:L})=>A&&F.pinRow(A,"top",L)}:null;case"pinBottom":return F?.isManual()?{name:n("pinBottom","Pin to Bottom"),icon:Y("rowPinBottom",o,P),action:({node:A,column:L})=>A&&F.pinRow(A,"bottom",L)}:null;case"unpinRow":return F?.isManual()?{name:n("unpinRow","Unpin Row"),icon:Y("rowUnpin",o,P),action:({node:A,column:L})=>A&&F.pinRow(A,null,L)}:null;case"valueAggSubMenu":return u&&T&&(P?.isPrimary()||P?.getColDef().pivotValueColumn)?{name:n("valueAggregation","Value Aggregation"),icon:Y("menuValue",o,null),subMenu:cT(P,u,T,n),disabled:l.get("functionsReadOnly")}:null;case"autoSizeThis":return d?{name:n("autosizeThisColumn","Autosize This Column"),action:()=>P&&d.autoSizeColumn(P,k,l.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return d?{name:n("autosizeAllColumns","Autosize All Columns"),action:()=>d.autoSizeAllColumns({source:k,skipHeader:l.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return h?{name:Ts(n,"groupBy",p.getDisplayNameForColumn(P,"header")),disabled:l.get("functionsReadOnly")||P?.isRowGroupActive()||!P?.getColDef().enableRowGroup,action:()=>h.addColumns([P],k),icon:Y("menuAddRowGroup",o,null)}:null;case"rowUnGroup":if(h&&l.isModuleRegistered("SharedRowGrouping")){const A=P?.getColDef().showRowGroup,L=l.get("groupLockGroupColumns");let _,j,W;if(A===!0)_=n("ungroupAll","Un-Group All"),j=l.get("functionsReadOnly")||L===-1||L>=(h.columns.length??0),W=()=>h.setColumns(h.columns.slice(0,L),k);else if(typeof A=="string"){const Z=g.getColDefCol(A),Ce=Z!=null?p.getDisplayNameForColumn(Z,"header"):A;_=Ts(n,"ungroupBy",Ce),j=l.get("functionsReadOnly")||Ms(Z,o),W=()=>{h.removeColumns([A],k)}}else _=Ts(n,"ungroupBy",p.getDisplayNameForColumn(P,"header")),j=l.get("functionsReadOnly")||!P?.isRowGroupActive()||!P?.getColDef().enableRowGroup||Ms(P,o),W=()=>h.removeColumns([P],k);return{name:_,disabled:j,action:W,icon:Y("menuRemoveRowGroup",o,null)}}else return null;case"resetColumns":return{name:n("resetColumns","Reset Columns"),action:()=>iT(o,k)};case"expandAll":return m?{name:n("expandAll","Expand All Row Groups"),action:()=>m.expandAll(!0)}:null;case"contractAll":return m?{name:n("collapseAll","Collapse All Row Groups"),action:()=>m.expandAll(!1)}:null;case"copy":return f?{name:n("copy","Copy"),shortcut:n("ctrlC","Ctrl+C"),icon:Y("clipboardCopy",o,null),action:()=>f.copyToClipboard()}:null;case"copyWithHeaders":return f?{name:n("copyWithHeaders","Copy with Headers"),icon:Y("clipboardCopy",o,null),action:()=>f.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return f?{name:n("copyWithGroupHeaders","Copy with Group Headers"),icon:Y("clipboardCopy",o,null),action:()=>f.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(f){const A=C.getFocusedCell(),L=A?tT(o,A):null,_=L?A?.column.isCellEditable(L):!1;return{name:n("cut","Cut"),shortcut:n("ctrlX","Ctrl+X"),icon:Y("clipboardCut",o,null),disabled:!_||l.get("suppressCutToClipboard"),action:()=>f.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(f){const A=l.get("suppressClipboardApi")||l.get("suppressClipboardPaste")||!P||!s||!P.isCellEditable(s)||P.isSuppressPaste(s);return{name:n("paste","Paste"),shortcut:n("ctrlV","Ctrl+V"),icon:Y("clipboardPaste",o,null),disabled:A,action:()=>f.pasteFromClipboard()}}else return null;case"export":{const A=[];return!l.get("suppressCsvExport")&&v&&A.push("csvExport"),!l.get("suppressExcelExport")&&S&&A.push("excelExport"),A.length?{name:n("export","Export"),subMenu:A,icon:Y("save",o,null)}:null}case"csvExport":return v?{name:n("csvExport","CSV Export"),icon:Y("csvExport",o,null),action:()=>v.exportDataAsCsv()}:null;case"excelExport":return S?{name:n("excelExport","Excel Export"),icon:Y("excelExport",o,null),action:()=>S.exportDataAsExcel()}:null;case"separator":return E;case"pivotChart":case"chartRange":return M.getChartItems(E);case"columnFilter":return b&&P?{name:n("columnFilter","Column Filter"),icon:Y("filter",o,null),action:()=>b.showFilterMenu({column:P,buttonElement:N(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{const A=C.focusedHeader;return y?{name:n("columnChooser","Choose Columns"),icon:Y("columns",o,null),action:()=>y.showColumnChooser({column:P,eventSource:N(),headerPosition:A})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!w||!P)return null;const{fallback:A,getSortDef:L}=oT[E];return{name:n(E,A),icon:Y(E,o,null),action:()=>w.setSortForColumn(P,L(P),!1,k)}}default:return rT(176,{key:E}),null}};for(const E of e){let P;if(typeof E=="string"?P=I(E,t,i,r):P={...E},!P)continue;const N=P,{subMenu:k}=N;k&&k instanceof Array&&(N.subMenu=this.mapWithStockItems(k,t,s,i,r)),P!=null&&a.push(P)}return zc(a,Ct),a}};function cT(e,t,s,i){let r;if(e.isPrimary())r=e;else{const n=e.getColDef().pivotValueColumn;r=eT(n)?n:void 0}const a=[];if(r){const n=r.isValueActive(),o=t.getFuncNames(r);a.push({name:i("noAggregation","None"),action:()=>{s.removeColumns([r],"contextMenu"),s.setColumnAggFunc(r,void 0,"contextMenu")},checked:!n});for(const l of o)a.push({name:i(l,t.getDefaultFuncLabel(l)),action:()=>{s.setColumnAggFunc(r,l,"contextMenu"),s.addColumns([r],"contextMenu")},checked:n&&r.getAggFunc()===l})}return a}var dT=class extends jM{constructor(){super(...arguments),this.beanName="colMenuFactory"}createMenu(e,t,s,i){const r=e.createManagedBean(new Ta(0,{column:s??null,node:null,value:null})),a=this.beans.menuItemMapper.mapWithStockItems(t,s??null,null,i,"columnMenu");return r.addMenuItems(a),r}getMenuItems(e=null,t=null){const s=this.getDefaultMenuOptions(e);let i;const r=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(r))i=r;else if(typeof r=="function")i=r(YM(this.gos,{column:e,columnGroup:t,defaultItems:s}));else{const a=this.gos.getCallback("getMainMenuItems");a?i=a({column:e,columnGroup:t,defaultItems:s}):i=s}return zc(i,Ct),i}getDefaultMenuOptions(e){const t=[],{beans:s,gos:i}=this,{colChooserFactory:r,rowGroupColsSvc:a,colModel:n,expansionSvc:o,sortSvc:l,menuSvc:c,pinnedCols:d,aggFuncSvc:u,colAutosize:h}=s,p=JM(i),g=()=>{!p&&r&&t.push("columnChooser"),t.push("resetColumns")};if(!e)return g(),t;const{colDef:f}=e,m=d&&!f.lockPinned,C=a?.columns.length??0,v=C>0,S=XM(i),b=i.get("treeData"),y=e.isPrimary(),w=!y||u&&e.isAllowValue()&&(v||S||b);if(l&&!p&&e.isSortable()){const{isDefaultSortAllowed:M,isAbsoluteSortAllowed:T,isAbsoluteSort:F,isDefaultSort:I,isAscending:E,isDescending:P,direction:N}=qM(e,s);M&&!(E&&I)&&t.push("sortAscending"),M&&!(P&&I)&&t.push("sortDescending"),T&&!(E&&F)&&t.push("sortAbsoluteAscending"),T&&!(P&&F)&&t.push("sortAbsoluteDescending"),N&&t.push("sortUnSort"),t.push(Ct)}if(c?.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(Ct)),m&&t.push("pinSubMenu"),w&&t.push("valueAggSubMenu"),(m||w)&&t.push(Ct),h&&(f.suppressAutoSize||t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(Ct)),a&&i.isModuleRegistered("SharedRowGrouping")){const M=t.length;f.showRowGroup?t.push("rowUnGroup"):e.isAllowRowGroup()&&y&&(e.isRowGroupActive()?Ms(e,s)||t.push("rowUnGroup"):t.push("rowGroup")),t.length>M&&t.push(Ct)}return g(),o&&(ZM(i)||i.get("ssrmExpandAllAffectsAllRows"))&&(b||C>(n.isPivotMode()?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}};import{BeanStub as uT,_addGridCommonParams as hT,_attemptToRestoreCellFocus as pT,_exists as Uc,_getGrandTotalRow as gT,_isIOSUserAgent as fT}from"ag-grid-community";var Wc="ag-context-menu-open",mT=class extends uT{constructor(){super(...arguments),this.beanName="contextMenuSvc",this.focusedCell=null}postConstruct(){this.menu=this.createManagedBean(new il({menuItemCallbacks:Ma,getMenuItems:this.getMenuItems.bind(this),mapMenuItems:this.mapWithStockItems.bind(this),beforeMenuOpen:this.beforeMenuOpen.bind(this),onMenuOpen:this.onMenuOpen.bind(this),onMenuClose:this.onMenuClose.bind(this),afterMenuDestroyed:this.afterMenuDestroyed.bind(this),onVisibleChanged:this.dispatchVisibleChangedEvent.bind(this),shouldBlockMenuOpen:()=>!!this.beans.overlays?.exclusive}))}hideActiveMenu(){this.menu.hideActiveMenu()}getMenuItems(e,t){const{column:s,node:i,value:r}=e,a=[],{clipboardSvc:n,chartSvc:o,csvCreator:l,excelCreator:c,colModel:d,rangeSvc:u,gos:h}=this.beans;if(Uc(i)&&n&&s&&(h.get("suppressCutToClipboard")||a.push("cut"),a.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),h.get("enableCharts")&&o&&(d.isPivotMode()&&a.push("pivotChart"),u&&!u.isEmpty()&&a.push("chartRange")),Uc(i)){const m=h.get("enableRowPinning"),C=h.get("isRowPinnable");if(m){const w=i.level>-1&&i.footer,M=i.level===-1&&i.footer,T=gT(h);(M&&!(T==="pinnedBottom"||T==="pinnedTop")||!M&&!w)&&(C?.(i)??!0)&&a.push("pinRowSubMenu")}const v=h.get("suppressExcelExport")||!c,S=h.get("suppressCsvExport")||!l;!fT()&&(!v||!S)&&a.push("export")}const p=a.length?a:void 0,g=s?.getColDef().contextMenuItems;return Array.isArray(g)?g:typeof g=="function"?g(hT(h,{column:s,node:i,value:r,defaultItems:p,event:t})):h.getCallback("getContextMenuItems")?.({column:s,node:i,value:r,defaultItems:p,event:t})??a}getContextMenuPosition(e,t){const s=this.getRowCtrl(e),i=this.getCellGui(s,t);if(!i)return{x:0,y:s?.getRowYPosition()??0};const r=i.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(e){const t=e.rowNode??null,s=e.column??null;let{anchorToElement:i,value:r,source:a}=e;t&&s&&r==null&&(r=this.beans.valueSvc.getValueForDisplay({column:s,node:t,from:"edit"}).value),i==null&&(i=this.getContextMenuAnchorElement(t,s)),this.beans.menuUtils.onContextMenu({mouseEvent:e.mouseEvent??null,touchEvent:e.touchEvent??null,showMenuCallback:n=>this.menu.showMenu({node:t,column:s,value:r},n,i),source:a})}handleContextMenuMouseEvent(e,t,s,i){const r=i?.rowNode??s?.rowNode??null,a=i?.column??s?.findFullWidthInfoForEvent(e||t)?.column??null,{valueSvc:n,ctrlsSvc:o}=this.beans,l=a?n.getValue(a,r,"edit"):null,c=o.getGridBodyCtrl(),d=i?i.eGui:c.eGridBody;this.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:a,value:l,anchorToElement:d,source:"ui"})}beforeMenuOpen(e){e.column||this.beans.focusSvc.clearFocusedCell()}onMenuOpen(){const{ctrlsSvc:e,focusSvc:t}=this.beans;e.getGridBodyCtrl().eGridBody.classList.add(Wc),this.focusedCell=t.getFocusedCell()}onMenuClose(){this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(Wc)}afterMenuDestroyed(){const{beans:e,focusedCell:t}=this;pT(e,t)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"contextMenuVisibleChanged",visible:e,source:t})}getRowCtrl(e){const{rowIndex:t,rowPinned:s}=e||{};if(t!=null)return this.beans.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s})||void 0}getCellGui(e,t){return!e||!t?void 0:e.getCellCtrl(t)?.eGui||void 0}getContextMenuAnchorElement(e,t){const s=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,i=this.getRowCtrl(e);if(!i)return s;const r=this.getCellGui(i,t);return r||(i.isFullWidth()?i.getFullWidthElement():s)}mapWithStockItems(e,t,s){const{column:i,node:r}=t;return this.beans.menuItemMapper.mapWithStockItems(e,i,r,s,"contextMenu")}};import{AgPromise as La,BeanStub as Kc,Component as CT,FilterComp as vT,RefPlaceholder as ST,_createElement as bT,_createIconNoSpan as ka,_error as yT,_focusInto as wT,_isColumnMenuAnchoringEnabled as xT,_isLegacyMenuEnabled as Gi,_setColMenuVisible as $c,_warn as FT,isColumn as RT}from"ag-grid-community";var Ze="filterMenuTab",Je="generalMenuTab",vt="columnsMenuTab",Oi=[Je,Ze,vt],AT=class extends Kc{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,s,i,r){const{column:a,columnGroup:n}=this.splitColumnOrGroup(e),o=r?"filterMenuTab":void 0;this.showMenu(a,n,l=>{const c=l.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:s,additionalParams:{column:a},mouseEvent:t,ePopup:c}),o&&l.showTab?.(o),this.dispatchVisibleChangedEvent(!0,!1,a,n,o)},s,o,void 0,t.target,i)}splitColumnOrGroup(e){const t=e&&RT(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,s,i,r){let a=-1,n="left";this.gos.get("enableRtl")&&(a=1,n="right");const o=r?"filterMenuTab":void 0,l=o?[o]:void 0,c=Gi(this.gos),d=(c?9:4)*a,u=c?-23:4,{column:h,columnGroup:p}=this.splitColumnOrGroup(e);this.showMenu(h,p,g=>{const f=g.getGui();this.beans.popupSvc.positionPopupByComponent({type:s,additionalParams:{column:h},eventSource:t,ePopup:f,alignSide:n,nudgeX:d,nudgeY:u,position:"under",keepWithinBounds:!0}),o&&g.showTab?.(o),this.dispatchVisibleChangedEvent(!0,!1,h,p,o)},s,o,l,t,i)}showMenu(e,t,s,i,r,a,n,o){const l=this.getMenuParams(e,t,a,n);if(!l)return;const{menu:c,eMenuGui:d,anchorToElement:u,restoreFocusParams:h}=l,p=[],{menuUtils:g,popupSvc:f}=this.beans;p.push(C=>{const v=c.getGui();this.destroyBean(c),e&&($c(e,!1,"contextMenu"),g.restoreFocusOnClose(h,v,C)),o?.()});const m=this.getLocaleTextFunc();if(f.addPopup({modal:!0,eChild:d,closeOnEsc:!0,closedCallback:C=>{for(const v of p)v(C);this.dispatchVisibleChangedEvent(!1,!1,e,t,r)},afterGuiAttached:C=>c.afterGuiAttached(Object.assign({},{container:i},C)),positionCallback:r?()=>s(c):void 0,ariaLabel:m("ariaLabelColumnMenu","Column Menu")}),r||(c.showTabBasedOnPreviousSelection?.(),s(c)),xT(this.gos)){const C=f.setPopupPositionRelatedToElement(d,u);C&&e&&this.addStopAnchoring(C,e,p)}c.addEventListener("tabSelected",C=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=C.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&$c(e,!0,"contextMenu"),this.activeMenu=c,c.addEventListener("destroyed",()=>{this.activeMenu===c&&(this.activeMenu=null)})}addStopAnchoring(e,t,s){e.then(i=>{t.__addEventListener("leftChanged",i),t.__addEventListener("visibleChanged",i),s.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("visibleChanged",i)})})}getMenuParams(e,t,s,i){const{focusSvc:r,visibleCols:a,ctrlsSvc:n}=this.beans,o={column:e,headerPosition:r.focusedHeader,columnIndex:a.allCols.indexOf(e),eventSource:i},l=this.createMenu(e,t,o,s,i);return l?{menu:l,eMenuGui:l.getGui(),anchorToElement:i||n.getGridBodyCtrl().eGridBody,restoreFocusParams:o}:void 0}createMenu(e,t,s,i,r){if(Gi(this.gos))return this.createBean(new MT(e,s,this.lastSelectedTab,i,r));{const a=this.beans.colMenuFactory.getMenuItems(e,t);return a.length?this.createBean(new TT(a,e,s,r)):void 0}}dispatchVisibleChangedEvent(e,t,s,i,r){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??r??(Gi(this.gos)?Je:"columnMenu"),column:s??null,columnGroup:i??null})}isMenuEnabled(e){if(!Gi(this.gos))return!0;const t=!this.beans.filterManager?.isFilterAllowed(e),s=e.getColDef().menuTabs??Oi;return(t&&s.includes(Ze)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,s){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:s,source:"ui",showMenuCallback:i=>(this.showMenuAfterMouseEvent(e,i,"columnMenu"),!0)})}},MT=class extends Kc{constructor(e,t,s,i,r){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=s,this.restrictTo=i,this.sourceElement=r,this.tabFactories={},this.includeChecks={};const{tabFactories:a,includeChecks:n}=this;a[Je]=this.createMainPanel.bind(this),a[Ze]=this.createFilterPanel.bind(this),a[vt]=this.createColumnsPanel.bind(this),n[Je]=()=>!0,n[Ze]=()=>e?!!this.beans.filterManager?.isFilterAllowed(e):!1,n[vt]=()=>!0}postConstruct(){const e=this.getTabsToCreate().map(s=>this.createTab(s)),t=new Qr({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(t),this.mainMenuList?.setParentComponent(t),this.addDestroyFunc(()=>this.destroyBean(t))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??Oi).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,s=Oi;return this.restrictTo!=null&&(t=this.restrictTo.indexOf(e)>-1,s=this.restrictTo),t=t&&Oi.indexOf(e)>-1,t||FT(175,{menuTabName:e,itemsToConsider:s}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){const{tabItemColumns:t,tabbedLayout:s,tabItemFilter:i,tabItemGeneral:r}=this;t&&e===vt?s.showItem(t):i&&e===Ze?s.showItem(i):r&&e===Je?s.showItem(r):s.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=vt;break;case this.tabItemFilter:t=Ze;break;case this.tabItemGeneral:t=Je;break}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){const{beans:e,column:t}=this,s=e.colMenuFactory,i=s.createMenu(this,s.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=i,i.addEventListener("closeMenu",this.onHidePopup.bind(this));const r={title:ka("legacyMenu",e,t),titleLabel:Je.replace("MenuTab",""),bodyPromise:La.resolve(i.getGui()),name:Je};return this.tabItemGeneral=r,r}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new vT(this.column,"COLUMN_MENU")):null;this.filterComp=e,e?.hasFilter()||yT(119);const t=i=>e?.afterGuiAttached(i),s=()=>e?.afterGuiDetached();return this.tabItemFilter={title:ka("filterTab",this.beans,this.column),titleLabel:Ze.replace("MenuTab",""),bodyPromise:La.resolve(e?.getGui()),afterAttachedCallback:t,afterDetachedCallback:s,name:Ze},this.tabItemFilter}createColumnsPanel(){const e=bT({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:t,column:s}=this,r=t.colChooserFactory.createColumnSelectPanel(this,s).getGui();r.classList.add("ag-menu-column-select"),e.appendChild(r);const a={title:ka("columns",t,s),titleLabel:vt.replace("MenuTab",""),bodyPromise:La.resolve(e),name:vt};return this.tabItemColumns=a,a}afterGuiAttached(e){const{container:t,hidePopup:s}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:s}),s&&(this.hidePopupFunc=s,this.addDestroyFunc(s))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},TT=class extends CT{constructor(e,t,s,i){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"}),this.menuItems=e,this.column=t,this.restoreFocusParams=s,this.sourceElement=i,this.eColumnMenu=ST}postConstruct(){const e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),wT(this.mainMenuList.getGui())}};function PT(e,t){const{contextMenuSvc:s}=e;if(!s)return;const{rowNode:i,column:r,value:a,x:n,y:o}=t||{};let{x:l,y:c}=s.getContextMenuPosition(i,r);n!=null&&(l=n),o!=null&&(c=o),s.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:l,clientY:c}),rowNode:i,column:r,value:a,source:"api"})}function IT(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})}function ET(e){e.colChooserFactory?.hideActiveColumnChooser()}import{BeanStub as DT,_findTabbableParent as LT,_getActiveDomElement as kT,_isNothingFocused as jc,_isVisible as GT,_last as OT}from"ag-grid-community";var _T=class extends DT{constructor(){super(...arguments),this.beanName="menuUtils"}restoreFocusOnClose(e,t,s,i){const{eventSource:r}=e,a=s instanceof KeyboardEvent;if(!i&&!a||!r)return;const n=kT(this.beans);!t.contains(n)&&!jc(this.beans)||this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,s){let i;s?.keyboardEvent&&(i=s.keyboardEvent),e(i&&{keyboardEvent:i});const r=this.beans,a=r.focusSvc,n=a.getFocusedCell();if(jc(r))if(n){const{rowIndex:o,rowPinned:l,column:c}=n;a.setFocusedCell({rowIndex:o,column:c,rowPinned:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){const{mouseEvent:t,touchEvent:s,showMenuCallback:i,source:r}=e;if(!this.gos.get("allowContextMenuWithControlKey")&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),r==="ui"&&this.gos.get("suppressContextMenu")))return;const a=t??s.touches[0];if(i(a)){const n=t??s;n?.cancelable&&n.preventDefault()}}async focusHeaderCell(e){const{column:t,columnIndex:s,headerPosition:i,eventSource:r}=e,{visibleCols:a,headerNavigation:n,focusSvc:o}=this.beans,l=await a.allCols.some(c=>c===t);if(this.isAlive()){if(t?.isAlive()&&l&&r&>(r)){const c=LT(r);c&&(n?.scrollToColumn(t),c.focus())}else if(i&&s!==-1){const c=a.allCols,d=c[s]||OT(c);d&&o.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:d}})}}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&e.which===2&&e.preventDefault()}},Yc={moduleName:"MenuCore",version:D,beans:[lT,VM,_T],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[B,OM,NM,Di]},Ga={moduleName:"ColumnMenu",version:D,beans:[AT,dT,$M],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:IT,hideColumnChooser:ET},dependsOn:[Yc,_M,GM]},Oa={moduleName:"ContextMenu",version:D,beans:[mT],apiFunctions:{showContextMenu:PT},dependsOn:[Yc]},NT={moduleName:"Menu",version:D,dependsOn:[Ga,Oa]};import{_EditCoreModule as BT}from"ag-grid-community";import{AgAbstractCellEditor as VT,KeyCode as qc,_addGridCommonParams as HT,_missing as zT,_warn as zt}from"ag-grid-community";var Xc=class extends VT{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"}),this.currentSearchRequest=0,this.onSearchCallback=e=>{const t=++this.currentSearchRequest,s=this.eEditor;s.setValueList({refresh:!0,valueList:void 0});const i=this.params;if(i.search=e,!i.search)return;if(typeof i.values!="function"){this.isFullAsync()&&zt(294);return}const r=i.values(i);if(Array.isArray(r)){this.isFullAsync()&&zt(294),s.setValueList({refresh:!0,valueList:r});return}s.setValueList({valueList:r.then(a=>{if(t===this.currentSearchRequest)return a}),refresh:!0})}}initialiseEditor(e){const{cellStartedEdit:t,values:s,eventKey:i}=this.params;zT(s)&&zt(180);const{params:r,valueList:a}=this.buildRichSelectParams(),n=this.createManagedBean(new Ri(r));this.eEditor=n,n.addCss("ag-cell-editor"),this.appendChild(n),this.isFullAsync()&&n.showPicker(),this.eEditor.setValueList({valueList:a,refresh:!0,isInitial:!0}),a&&!Array.isArray(a)&&a.then(l=>{const c=this.getSearchStringCallback(l);c&&n.setSearchStringCreator(c),this.processEventKey(i)}),this.addManagedListeners(n,{fieldPickerValueSelected:this.onEditorPickerValueSelected.bind(this)}),this.focusAfterAttached=t}onEditorPickerValueSelected(e){this.gos.get("editType")!=="fullRow"&&setTimeout(()=>this.params.stopEditing(!e.fromEnterKey))}getPlaceholderText(){const{valuePlaceholder:e}=this.params;if(e!==void 0)return e;const t=this.getLocaleTextFunc();return this.isFullAsync()?t("typeToSearchOoo","Type to search..."):t("advancedFilterBuilderSelectOption","Select an option...")}isFullAsync(){const{allowTyping:e,filterListAsync:t,values:s}=this.params;return!(typeof s=="function")&&t&&zt(294),!!(e&&t&&typeof s=="function")}getInitialValueList(){const e=this.params,{values:t}=e,s=this.isFullAsync(),i=Array.isArray(t)||!t,r=typeof t=="function";if(i)return t??[];if(!r)return[];if(!s)return t({...e})}buildRichSelectParams(){const e=this.params,{cellRenderer:t,cellRendererParams:s,cellHeight:i,value:r,values:a,formatValue:n,searchDebounceDelay:o,valueListGap:l,valueListMaxHeight:c,valueListMaxWidth:d,allowTyping:u,filterList:h,searchType:p,highlightMatch:g,eventKey:f,multiSelect:m,suppressDeselectAll:C,suppressMultiSelectPillRenderer:v}=e,S={value:r,cellRenderer:t,cellRendererParams:s,cellRowHeight:i,searchDebounceDelay:o,valueFormatter:n,pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:l,allowTyping:u,filterList:h,searchType:p,highlightMatch:g,maxPickerHeight:c,maxPickerWidth:d,placeholder:this.getPlaceholderText(),initialInputValue:f?.length===1?f:f===qc.BACKSPACE?"":void 0,multiSelect:m,suppressDeselectAll:C,suppressMultiSelectPillRenderer:v},b=this.getInitialValueList(),y=this.isFullAsync();return Array.isArray(a)?(S.valueList=b,S.searchStringCreator=this.getSearchStringCallback(b)):typeof a=="function"&&y&&(S.onSearch=this.onSearchCallback,S.allowNoResultsCopy=!0,S.filterList=!0),m&&u&&(e.allowTyping=!1,S.allowTyping=!1,zt(181)),{params:S,valueList:b}}getSearchStringCallback(e){if(typeof e[0]!="object")return;const t=this.params,{colDef:s,formatValue:i}=t;if(s.cellEditorParams?.formatValue)return a=>a.map(i);const{keyCreator:r}=s;if(r){zt(266);const{column:a,node:n,data:o}=t;return l=>l.map(c=>{const d=HT(this.gos,{value:c,colDef:s,column:a,node:n,data:o});return r(d)})}return a=>a.map(i)}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;const s=this.eEditor,{allowTyping:i,eventKey:r,cellStartedEdit:a}=t;if(e){const n=s.getFocusableElement();n.focus(),i&&(!r||r.length!==1)&&n.select()}a&&s.showPicker(),this.processEventKey(r)})}processEventKey(e){e&&(e===qc.BACKSPACE?this.eEditor.searchTextFromString(null):e?.length===1&&this.eEditor.searchTextFromString(e))}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){const{params:e}=this,t=this.eEditor.getValue();return e.parseValue?.(t)??t}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e;return t?t({value:this.getValue(),internalErrors:null,cellEditorParams:e}):null}},Zc={moduleName:"RichSelect",version:D,beans:[],userComponents:{agRichSelect:Xc,agRichSelectCellEditor:Xc},icons:{richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},dependsOn:[B,BT]};import{_ColumnFilterModule as UT}from"ag-grid-community";import{AgInputTextFieldSelector as WT,KeyCode as Ps,ProvidedFilter as KT,RefPlaceholder as Is,_areEqual as $T,_createIconNoSpan as jT,_exists as YT,_getActiveDomElement as qT,_makeNull as Jc,_setDisplayed as _a,_warn as Es}from"ag-grid-community";var St="__AG_SELECT_ALL__",bt="__AG_ADD_SELECTION_TO_FILTER__",XT=class{constructor(e,t,s,i,r){this.valueSvc=e,this.getValueFormatter=t,this.formatter=s,this.column=i,this.getUseFormatterFromColumn=r,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,s){this.displayedKeys=Array.from(s)}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r){this.displayedKeys=[];const a=this.getValueFormatter();for(const n of s)if(n==null)r&&this.displayedKeys.push(n);else{const o=e(n),l=this.valueSvc.formatValue(this.column,null,o,a,this.getUseFormatterFromColumn()),c=this.formatter(l);i(c)&&this.displayedKeys.push(n)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return St}getAddSelectionToFilterItem(){return bt}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}};import{AgCheckboxSelector as ZT,Component as JT,RefPlaceholder as _i,_addGridCommonParams as QT,_createIcon as Na,_getCellRendererDetails as Qc,_getShouldDisplayTooltip as eP,_isShowTooltipWhenTruncated as tP,_setAriaChecked as sP,_setAriaDescribedBy as iP,_setAriaExpanded as rP,_setAriaLabel as aP,_setAriaLabelledBy as nP,_setAriaLevel as oP,_setDisplayed as Ba,_toStringOrNull as ed,_warn as lP}from"ag-grid-community";var cP={tag:"div",cls:"ag-set-filter-item",attrs:{"aria-hidden":"true"},children:[{tag:"span",cls:"ag-set-filter-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-set-filter-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-set-filter-group-opened-icon"},{tag:"span",ref:"eGroupIndeterminateIcon",cls:"ag-set-filter-group-indeterminate-icon"}]},{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},dP={tag:"div",cls:"ag-set-filter-item",children:[{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},uP=class extends JT{constructor(e){super(e.isGroup?cP:dP,[ZT]),this.eCheckbox=_i,this.eGroupOpenedIcon=_i,this.eGroupClosedIcon=_i,this.eGroupIndeterminateIcon=_i,this.formattedValue=null,this.focusWrapper=e.focusWrapper,this.value=e.value,this.params=e.params,this.translate=e.translate,this.valueFormatter=e.valueFormatter,this.useFormatterFromColumn=e.shouldUseFormatterFromColumn,this.item=e.item,this.isSelected=e.isSelected,this.isTree=e.isTree,this.depth=e.depth??0,this.isGroup=e.isGroup,this.groupsExist=e.groupsExist,this.isExpanded=e.isExpanded,this.hasIndeterminateExpandState=e.hasIndeterminateExpandState}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"setFilterValue",shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getAdditionalParams:()=>{const{colDef:e,column:t}=this.params,s={colDef:e,column:t,valueFormatted:this.formattedValue??void 0};return this.isTree&&(s.level=this.depth),s}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&(this.addCss("ag-set-filter-indent-"+this.depth),this.getGui().style.setProperty("--ag-indentation-level",String(this.depth))),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCss("ag-set-filter-add-group-indent"),oP(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),!this.params.readOnly&&this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){const{eGroupClosedIcon:e,eGroupOpenedIcon:t,eGroupIndeterminateIcon:s,hasIndeterminateExpandState:i,beans:r}=this;e.appendChild(Na("setFilterGroupClosed",r,null)),t.appendChild(Na("setFilterGroupOpen",r,null));const a=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(e,{click:a}),this.addManagedElementListeners(t,{click:a}),i&&(s.appendChild(Na("setFilterGroupIndeterminate",r,null)),this.addManagedElementListeners(s,{click:a})),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(e,t){if(this.isGroup&&e!==this.isExpanded){this.isExpanded=e;const s={type:"expandedChanged",isExpanded:!!e,item:this.item};t||this.dispatchLocalEvent(s),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){const{isExpanded:e,hasIndeterminateExpandState:t,eGroupClosedIcon:s,eGroupOpenedIcon:i,eGroupIndeterminateIcon:r}=this;Ba(s,t?e===!1:!e),Ba(i,e===!0),t&&Ba(r,e===void 0)}onCheckboxChanged(e){this.isSelected=e;const t={type:"selectionChanged",isSelected:e,item:this.item};this.dispatchLocalEvent(t),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.getLocaleTextFunc(),t=this.eCheckbox.getValue(),s=t===void 0?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");nP(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const s=this.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();aP(i,`${e} ${s}`),iP(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();sP(e,this.eCheckbox.getValue())}refreshAriaExpanded(){rP(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,s){this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(s,!0);const{cellRendererComponent:i,cellRendererParams:r,beans:a,params:n}=this;if(this.valueFunction){const o=this.valueFunction();this.setTooltipAndCellRendererParams(o,o),i||this.renderCellWithoutCellRenderer()}if(i){const o=Qc(a.userCompFactory,n,r);if(!i.refresh?.(o?.params??r)){const c=i;this.renderCell(),this.destroyBean(c)}}}render(){const{params:{column:e}}=this;let{value:t}=this,s=null;typeof t=="function"?(this.valueFunction=t,s=this.valueFunction(),t=s):this.isTree?s=ed(t):s=this.getFormattedValue(e,t),this.formattedValue=s,this.setTooltipAndCellRendererParams(t,s),this.renderCell()}setTooltipAndCellRendererParams(e,t){const s=this.gos;if(this.params.showTooltips&&(!tP(s)||!this.params.cellRenderer)){const i=t??ed(e);this.shouldDisplayTooltip=eP(s,()=>this.eCheckbox.getGui().querySelector(".ag-label")),this.tooltipFeature?.setTooltipAndRefresh(i)}this.cellRendererParams=QT(s,{value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(i,r)=>{s.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=r,this.tooltipFeature?.setTooltipAndRefresh(i)}})}getFormattedValue(e,t){return this.beans.valueSvc.formatValue(e,null,t,this.valueFormatter,!!this.useFormatterFromColumn)}renderCell(){const t=Qc(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(t==null){this.renderCellWithoutCellRenderer();return}t.then(s=>{s&&(this.cellRendererComponent=s,this.eCheckbox.setLabel(s.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(s))})}renderCellWithoutCellRenderer(){const{valueFormatted:e,value:t}=this.cellRendererParams;let s=e??t??this.translate("blanks");typeof s!="string"&&(lP(208),s=""),this.eCheckbox.setLabel(s),this.setupFixedAriaLabels(s)}getComponentHolder(){return this.params.column.getColDef()}};import{_defaultComparator as hP,_last as pP,_makeNull as gP,_toStringOrNull as fP,_translate as mP,_warn as CP}from"ag-grid-community";var vP={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches.",ariaSearchFilterValues:"Search filter values",ariaFilterList:"Filter List",filterSummaryListInactive:"is (All)",filterSummaryListSeparator:", ",filterSummaryListShort:e=>`is (${e[0]})`,filterSummaryListLong:e=>`is (${e[0]}) and ${e[1]} more`};function Va(e,t,s){let i=e;return i?(i=i.map(r=>fP(gP(r))),!t&&s&&i.some(r=>r==null)?pP(i)==null?null:i.filter(r=>r!=null):i):null}function he(e,t,s){return mP(e,vP,t,s)}function SP(e){e.excelMode==="windows"?(e.buttons||(e.buttons=["apply","cancel"]),e.closeOnApply==null&&(e.closeOnApply=!0)):e.excelMode==="mac"&&(e.buttons||(e.buttons=["reset"]),e.applyMiniFilterWhileTyping==null&&(e.applyMiniFilterWhileTyping=!0),e.debounceMs==null&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,CP(207))}function bP(){return([e,t],[s,i])=>{if(t==null)return i==null?0:-1;if(i==null)return 1;for(let r=0;r<t.length;r++){if(r>=i.length)return 1;const a=hP(t[r],i[r]);if(a!==0)return a}return 0}}import{_getDateParts as yP,_warn as wP}from"ag-grid-community";var td=class{constructor(e,t,s,i){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=s,this.treeDataOrGrouping=i,this.allDisplayedItemsTree=new Map,this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:St,children:this.allDisplayedItemsTree,expanded:!0,key:St,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:bt,expanded:!0,key:bt,parentTreeKeys:[]}}updateParams(e,t){this.treeListPathGetter=e,this.treeListFormatter=t}updateDisplayedValuesToAllAvailable(e,t,s,i){i==="reload"?this.generateItemTree(e,t,s):i==="otherFilter"?(this.updateAvailable(s),this.updateExpandAll()):i==="miniFilter"&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r,a){a==="reload"?this.generateItemTree(e,t,s):a==="otherFilter"&&this.updateAvailable(s),this.updateFilter(i,r),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,s){const i=new Map;this.allDisplayedItemsTree=i;let r=!1;const a=this.getTreeListPathGetter(e,s);for(const n of t){const o=e(n),l=a(o)??[null],c=l.length;c>1&&(r=!0);const d=s.has(n);let u=i,h,p=[];for(let g=0;g<c;g++){const f=l[g];u||(u=new Map,h.children=u);const m=f?.toUpperCase()??null;h=u.get(m),h||(h={treeKey:f,depth:g,filterPasses:!0,expanded:!1,available:d,parentTreeKeys:p},g===l.length-1&&(h.key=n),u.set(m,h)),u=h.children,p=[...p,f]}}this.groupsExist=r,this.updateAvailable(s),this.selectAllItem.children=i,this.selectAllItem.expanded=!1}getTreeListPathGetter(e,t){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return i=>i;let s=!1;for(const i of t){const r=e(i);if(r instanceof Date){s=!0;break}else if(r!=null)break}return s?i=>yP(i,!1):(wP(211),i=>[String(i)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{for(const s of t.values())!s.filterPasses||!s.available||(this.activeDisplayedItemsFlat.push(s),s.children&&s.expanded&&e(s.children))};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{const s=t.children;if(s)for(const i of s.values())e(i);t.filterPasses=!0};for(const t of this.allDisplayedItemsTree.values())e(t)}updateFilter(e,t){const s=i=>i.available?i.treeKey==null?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)):!1;for(const i of this.allDisplayedItemsTree.values())this.recursiveItemCheck(i,!1,s,"filterPasses")}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(s,i)=>{const r=s.children;if(r){if(!s.expanded||!i)for(const a of r.values())a.filterPasses&&t(a,!1)}else e(s.key)};for(const s of this.activeDisplayedItemsFlat)t(s,!0)}someDisplayedKey(e){const t=(s,i)=>{const r=s.children;if(r){if(!s.expanded||!i){for(const a of r.values())if(a.filterPasses&&t(a,!1))return!0;return!1}}else return e(s.key);return!1};return this.activeDisplayedItemsFlat.some(s=>t(s,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(s,i,r)=>{for(const a of s.values()){if(!a.filterPasses||!a.available||!a.children)continue;if(i=i||!!a.expanded,r=r||!a.expanded,i&&r)return;const n=e(a.children,i,r);if(n===void 0)return;n?i=!0:r=!0}return i&&r?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,s,i){let r=!1;const a=e.children;if(a)for(const o of a.values()){const l=this.recursiveItemCheck(o,t||s(e),s,i);r=r||l}const n=t||r||s(e);return e[i]=n,n}updateAvailable(e){const t=s=>e.has(s.key);for(const s of this.allDisplayedItemsTree.values())this.recursiveItemCheck(s,!1,t,"available")}},sd=class extends KT{constructor(){super("setFilter","set-filter"),this.filterType="set",this.eMiniFilter=Is,this.eFilterLoading=Is,this.eFilterLoadingIcon=Is,this.eSetFilterList=Is,this.eFilterNoMatches=Is,this.hardRefreshVirtualList=!1,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.selectedKeys=new Set}setParams(e){super.setParams(e);const t=this.updateHandler(e.getHandler()),{column:s,textFormatter:i,treeList:r,treeListPathGetter:a,treeListFormatter:n}=e;this.formatter=i??(o=>o??null),this.displayValueModel=r?new td(this.formatter,a,n,t.isTreeDataOrGrouping()):new XT(this.beans.valueSvc,()=>this.handler.valueFormatter,this.formatter,s,()=>this.handler.shouldUseValueFormatterFromColumn()),t.valueModel.allKeys.then(o=>{this.isAlive()&&(this.updateDisplayedValues("reload",o??[]),this.resetSelectionState(o??[]))}),t.valueModel.isLoading()&&this.setIsLoading(!0),this.initialiseFilterBodyUi()}refresh(e){return this.params.treeList!==e.treeList?!1:(this.updateHandler(e.getHandler()),super.refresh(e))}updateParams(e,t){super.updateParams(e,t),this.updateMiniFilter(),e.suppressSelectAll!==t.suppressSelectAll&&this.createVirtualListModel(e);const{textFormatter:s,treeListPathGetter:i,treeListFormatter:r}=e;this.formatter=s??(a=>a??null),this.displayValueModel instanceof td&&this.displayValueModel.updateParams(i,r),this.handler.refreshFilterValues(!0)}updateHandler(e){if(this.handler!==e){for(const s of this.handlerDestroyFuncs??[])s();this.handlerDestroyFuncs=[...this.addManagedListeners(e,{anyFilterChanged:s=>{e.valueModel.allKeys.then(i=>{this.isAlive()&&(this.updateDisplayedValues("otherFilter",i??[]),s.updated&&(this.checkAndRefreshVirtualList(),this.showOrHideResults()))})},dataChanged:({hardRefresh:s})=>{e.valueModel.allKeys.then(i=>{this.isAlive()&&(this.updateDisplayedValues("reload",i??[]),this.setSelectedModel(this.state.model?.values??null),s&&(this.hardRefreshVirtualList=!0),this.checkAndRefreshVirtualList())})}}),...this.addManagedListeners(e.valueModel,{loadingStart:()=>this.setIsLoading(!0),loadingEnd:()=>this.setIsLoading(!1)})],this.handler=e}return e}updateUiVisibility(){}createBodyTemplate(){return{tag:"div",cls:"ag-set-filter",children:[{tag:"div",ref:"eFilterLoading",cls:"ag-filter-loading ag-loading ag-hidden",children:[{tag:"span",ref:"eFilterLoadingIcon",cls:"ag-loading-icon"},{tag:"span",cls:"ag-loading-text",children:he(this,"loadingOoo")}]},{tag:"ag-input-text-field",ref:"eMiniFilter",cls:"ag-mini-filter"},{tag:"div",ref:"eFilterNoMatches",cls:"ag-filter-no-matches ag-hidden",children:he(this,"noMatches")},{tag:"div",ref:"eSetFilterList",cls:"ag-set-filter-list",role:"presentation"}]}}getAgComponents(){return[WT]}handleKeyDown(e){if(super.handleKeyDown(e),e.defaultPrevented)return;const t=()=>{if(!this.eSetFilterList.contains(qT(this.beans)))return;const s=this.virtualList.getLastFocusedRow();if(s==null)return;const i=this.virtualList.getComponentAt(s);if(i==null)return;e.preventDefault();const{readOnly:r}=this.params;if(!r)return i};switch(e.key){case Ps.SPACE:t()?.toggleSelected();break;case Ps.ENTER:this.handleKeyEnter(e);break;case Ps.LEFT:t()?.setExpanded(!1);break;case Ps.RIGHT:t()?.setExpanded(!0);break}}handleKeyEnter(e){e.preventDefault();const{excelMode:t,readOnly:s}=this.params;!t||s||(this.params.onAction("apply",void 0,e),this.params.excelMode==="mac"&&this.eMiniFilter.getInputElement().select())}setModelAndRefresh(e){return this.setSelectedModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()})}setModelIntoUi(e){this.setMiniFilter(this.params.state.state?.miniFilterValue??null,!0);const t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){const e=this.getSelectedModel();return e?{values:e,filterType:this.filterType}:null}areNonNullModelsEqual(e,t){return $T(e.values,t.values)}setIsLoading(e){_a(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){const e=jT("setFilterLoading",this.beans,this.params.column);e&&this.eFilterLoadingIcon.appendChild(e)}initVirtualList(){const e=he(this,"ariaFilterList"),t=!!this.params.treeList,s=this.virtualList=this.createBean(new Ot({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),i=this.eSetFilterList;t&&i.classList.add("ag-set-filter-tree-list"),i.appendChild(s.getGui());const{cellHeight:r}=this.params;r!=null&&s.setRowHeight(r);const a=(o,l)=>this.createSetListItem(o,t,l);s.setComponentCreator(a);const n=(o,l)=>this.updateSetListItem(o,l);s.setComponentUpdater(n),this.createVirtualListModel(this.params)}createVirtualListModel(e){let t;e.suppressSelectAll?t=new xP(this.displayValueModel):t=new FP(this.displayValueModel,this.showAddCurrentSelectionToFilter.bind(this)),e.treeList&&(t=new RP(t)),this.virtualList.setModel(t)}getSelectAllLabel(){const e=this.miniFilterText==null||!this.params.excelMode?"selectAll":"selectAllSearchResults";return he(this,e)}getAddSelectionToFilterLabel(){return he(this,"addCurrentSelectionToFilter")}createSetListItem(e,t,s){const i=this.displayValueModel.hasGroups(),{isSelected:r,isExpanded:a}=this.isSelectedExpanded(e),{value:n,depth:o,isGroup:l,hasIndeterminateExpandState:c,selectedListener:d,expandedListener:u}=this.newSetListItemAttributes(e),h={focusWrapper:s,value:n,params:this.params,translate:g=>he(this,g),valueFormatter:this.handler.valueFormatter,shouldUseFormatterFromColumn:this.handler.shouldUseValueFormatterFromColumn(),item:e,isSelected:r,isTree:t,depth:o,groupsExist:i,isGroup:l,isExpanded:a,hasIndeterminateExpandState:c},p=this.createBean(new uP(h));return p.addEventListener("selectionChanged",d),u&&p.addEventListener("expandedChanged",u),p}newSetTreeItemAttributes(e){const t=this.displayValueModel.hasGroups();return e.key===St?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:s=>this.onSelectAll(s.isSelected),expandedListener:s=>this.onExpandAll(s.item,s.isExpanded)}:e.key===bt?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:s=>{this.addCurrentSelectionToFilter=s.isSelected,this.refreshAfterSelection()}}:e.children?{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:s=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:s=>this.onExpandedChanged(s.item,s.isExpanded)}:{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:s=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===St?{value:()=>this.getSelectAllLabel(),selectedListener:t=>this.onSelectAll(t.isSelected)}:e===bt?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:t=>{this.addCurrentSelectionToFilter=t.isSelected,this.refreshAfterSelection()}}:{value:this.handler.valueModel.allValues.get(e)??null,selectedListener:t=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){const{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;return this.isSetFilterModelTreeItem(e)?(s=e.expanded,e.key===St?t=this.isSelectAllSelected():e.key===bt?t=this.isAddCurrentSelectionToFilterChecked():e.children?t=this.areAllChildrenSelected(e):t=this.selectedKeys.has(e.key)):e===St?t=this.isSelectAllSelected():e===bt?t=this.isAddCurrentSelectionToFilterChecked():t=this.selectedKeys.has(e),{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){const{eMiniFilter:e}=this;this.updateMiniFilter(),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(he(this,"ariaSearchFilterValues")),this.addManagedElementListeners(e.getInputElement(),{keydown:t=>this.onMiniFilterKeyDown(t)})}updateMiniFilter(){const{eMiniFilter:e,miniFilterText:t,params:s}=this;e.setDisplayed(!s.suppressMiniFilter),e.setValue(t)}afterGuiAttached(e){super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(he(this,"searchOoo")),e?.suppressFocus||(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList.awaitStable(()=>this.virtualList.focusRow(0)))}afterGuiDetached(){super.afterGuiDetached();const{column:e,excelMode:t,model:s,onStateChange:i}=this.params;this.beans.colFilter?.shouldKeepStateOnDetach(e)||(t&&this.resetMiniFilter(),(t||s!==this.state.model)&&(i({model:s,state:this.getState()}),this.showOrHideResults()))}canApply(e){return this.params.excelMode?e==null||e.values.length>0:!0}onNewRowsLoaded(){}setFilterValues(e){Es(283),this.handler.setFilterValues(e)}resetFilterValues(){Es(283),this.handler.resetFilterValues()}refreshFilterValues(){Es(283),this.doRefreshFilterValues()}doRefreshFilterValues(){this.handler.refreshFilterValues()}onAnyFilterChanged(){}onMiniFilterInput(e){if(!this.doSetMiniFilter(this.eMiniFilter.getValue()))return;if(e){this.showOrHideResults();return}const{applyMiniFilterWhileTyping:t,readOnly:s,excelMode:i}=this.params,r=!s&&(t||!!i),a=t&&!s?"debounce":void 0;this.updateUiAfterMiniFilterChange(r,a)}updateUiAfterMiniFilterChange(e,t){if(e){const{excelMode:s,readOnly:i,model:r}=this.params;s&&!i&&this.miniFilterText==null?this.setModelAndRefresh(r?.values??null):this.selectAllMatchingMiniFilter(!0)}this.checkAndRefreshVirtualList(),this.onUiChanged(e?t:"prevent"),this.showOrHideResults()}showOrHideResults(){const e=this.miniFilterText!=null&&this.displayValueModel.getDisplayedValueCount()<1;_a(this.eFilterNoMatches,e),_a(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.doSetMiniFilter(null)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:s}=this.params;e.key===Ps.ENTER&&!t&&!s&&this.updateUiAfterMiniFilterChange(!0,"immediately")}focusRowIfAlive(e){return e==null?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}onSelectAll(e){e?this.selectAllMatchingMiniFilter():this.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const s=i=>{if(!i.filterPasses)return;const r=i.children;if(r)for(const a of r.values())s(a);else this.setKeySelected(i.key,t)};s(e),this.refreshAfterSelection()}onItemSelected(e,t){this.setKeySelected(e,t),this.refreshAfterSelection()}onExpandAll(e,t){const s=i=>{if(i.filterPasses&&i.available&&i.children){for(const r of i.children.values())s(r);i.expanded=t}};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e,t){this.eMiniFilter.setValue(e,t),this.onMiniFilterInput(t)}doSetMiniFilter(e){return e=Jc(e),this.miniFilterText===e?!1:(e===null&&(this.addCurrentSelectionToFilter=!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}getUiChangeEventParams(){return{miniFilterValue:this.miniFilterText}}getState(){const e=this.miniFilterText;return e?{miniFilterValue:e}:void 0}checkAndRefreshVirtualList(){this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return Es(283),this.handler.getFilterKeys()}getFilterValues(){return Es(283),this.handler.getFilterValues()}refreshVirtualList(){this.params.refreshValuesOnOpen?this.doRefreshFilterValues():this.checkAndRefreshVirtualList()}isSelectAllSelected(){if(this.params.defaultToNothingSelected){if(this.hasSelections()&&this.isEverythingVisibleSelected())return!0;if(this.isNothingVisibleSelected())return!1}else{if(this.hasSelections()&&this.isNothingVisibleSelected())return!1;if(this.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=s=>{if(s.children){let i=!1,r=!1;for(const a of s.children.values()){if(!a.filterPasses||!a.available)continue;const n=t(a);if(n===void 0||(n?i=!0:r=!0,i&&r))return}return i}else return this.selectedKeys.has(s.key)};return this.params.defaultToNothingSelected?this.hasSelections()&&t(e):t(e)}resetExpansion(){if(!this.params.treeList)return;const e=this.displayValueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){const t=s=>{const i=s.children;if(i){for(const r of i.values())t(r);s.expanded=!1}};t(e),this.updateDisplayedValues("expansion")}}getModelAsString(e){return this.handler.getModelAsString(e)}getPositionableElement(){return this.eSetFilterList}updateDisplayedValues(e,t){if(e==="expansion"){this.displayValueModel.refresh();return}const s=this.handler,i=s.valueModel;if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable(o=>i.allValues.get(o)??null,t,i.availableKeys,e);return}const r=s.caseFormat(this.formatter(this.miniFilterText)||""),a=o=>o!=null&&s.caseFormat(o).includes(r),n=!!this.params.excelMode&&a(he(this,"blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(o=>i.allValues.get(o)??null,t,i.availableKeys,a,n,e)}hasSelections(){return this.params.defaultToNothingSelected?this.selectedKeys.size>0:this.handler.valueModel.allValues.size!==this.selectedKeys.size}isInWindowsExcelMode(){return this.params.excelMode==="windows"}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&YT(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){this.miniFilterText==null?this.selectedKeys=new Set(this.handler.valueModel.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(t=>this.selectedKeys.add(t)))}deselectAllMatchingMiniFilter(){this.miniFilterText==null?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}setKeySelected(e,t){t?this.selectedKeys.add(e):(this.params.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e))}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.selectedKeys.has(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.selectedKeys.has(e))}getSelectedModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.params.model?.values:void 0;if(e?.length){if(this.selectedKeys){const t=new Set([...e,...this.selectedKeys]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setSelectedModel(e){const t=this.handler,s=t.valueModel;return s.allKeys.then(i=>{if(e==null)this.resetSelectionState(i??[]);else{this.selectedKeys.clear();const r=new Map;s.allValues.forEach((a,n)=>{r.set(t.caseFormat(n),n)}),e.forEach(a=>{const n=t.caseFormat(Jc(a)),o=r.get(n);o!==void 0&&this.selectedKeys.add(o)})}})}resetSelectionState(e){this.params.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}getFilterHandler(){return this.handler}destroy(){this.virtualList=this.destroyBean(this.virtualList);for(const e of this.handlerDestroyFuncs??[])e();this.handler=void 0,this.displayValueModel=void 0,this.selectedKeys.clear(),super.destroy()}},xP=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},FP=class{constructor(e,t){this.model=e,this.showAddCurrentSelectionToFilter=t}getRowCount(){const t=this.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();const t=this.showAddCurrentSelectionToFilter(),s=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},RP=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}};import{BeanStub as AP,_addGridCommonParams as MP,_debounce as TP,_error as id,_isClientSideRowModel as PP,_last as IP,_makeNull as Ha,_toStringOrNull as za}from"ag-grid-community";import{AgPromise as EP,BeanStub as DP,_makeNull as LP}from"ag-grid-community";var kP=class extends DP{constructor(e,t,s,i,r){super(),this.createKey=e,this.caseFormat=t,this.getValue=s,this.isTreeDataOrGrouping=i,this.isTreeData=r}extractUniqueValuesAsync(e,t){return new EP(s=>{if(this.beans.rowModel.rowCountReady)s(this.extractUniqueValues(e,t));else{const[i]=this.addManagedEventListeners({rowCountReady:()=>{i?.(),s(this.extractUniqueValues(e,t))}})}})}extractUniqueValues(e,t){const s=new Map,i=this.extractExistingFormattedKeys(t),r=new Set,a=this.isTreeData(),n=this.isTreeDataOrGrouping(),o=this.beans.rowGroupColsSvc?.columns,l=this.gos.get("groupAllowUnbalanced"),c=(d,u)=>{const h=this.caseFormat(d);if(!r.has(h)){r.add(h);let p=d,g=LP(u);const f=i?.get(h);f!=null&&(p=f,g=t.get(f)),s.set(p,g)}};return this.beans.rowModel.forEachLeafNode(d=>{if(!d.data||!e(d))return;if(n){this.addValueForTreeDataOrGrouping(d,a,o,c,l);return}const u=this.getValue(d);if(u!=null&&Array.isArray(u)){for(const h of u)c(this.createKey(h,d),h);u.length===0&&c(null,null)}else c(this.createKey(u,d),u)}),s}addValueForTreeDataOrGrouping(e,t,s=[],i,r){let a;if(t){if(e.childrenAfterGroup?.length)return;a=e.getRoute()??[e.key??e.id]}else a=s.map(o=>this.beans.valueSvc.getKeyForNode(o,e)),a.push(this.getValue(e));const n=Va(a,t,r);i(this.createKey(n),n)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((s,i)=>{t.set(this.caseFormat(i),i)}),t}},GP=class{constructor(e){this.caseFormat=e,this.keys=null}isNull(){return this.keys==null}isEmpty(){return!this.keys?.size}update(e){const t=new Set;this.keys=t;const s=e?.values;if(s){const i=this.caseFormat;for(let r=0,a=s.length;r<a;r++)t.add(i(s[r]))}}has(e){return!!this.keys?.has(this.caseFormat(e))}destroy(){this.keys=null}};import{AgPromise as Ni,BeanStub as OP,_addGridCommonParams as _P,_defaultComparator as rd,_error as NP,_makeNull as BP,_warn as ad}from"ag-grid-community";var nd=(e=>(e[e.PROVIDED_LIST=0]="PROVIDED_LIST",e[e.PROVIDED_CALLBACK=1]="PROVIDED_CALLBACK",e[e.TAKEN_FROM_GRID_VALUES=2]="TAKEN_FROM_GRID_VALUES",e))(nd||{}),Ua=nd,VP=class extends OP{constructor(e,t,s,i,r){super(),this.clientSideValuesExtractor=e,this.caseFormat=t,this.createKey=s,this.isTreeDataOrGrouping=i,this.params=r,this.allValues=new Map,this.availableKeys=new Set,this.providedValues=null,this.initialised=!1}postConstruct(){const e=this.params,t=e.handlerParams.filterParams.values;this.updateParams(e),t==null?this.valuesType=2:(this.valuesType=Array.isArray(t)?0:1,this.providedValues=t),this.updateAllValues()}refresh(e){const t=e.handlerParams;if(t.source!=="colDef")return;const{values:s,suppressSorting:i}=t.filterParams,r=this.providedValues,a=this.params.handlerParams.filterParams.suppressSorting;this.params=e,this.updateParams(e),this.providedValues=s??null,(this.providedValues!==r||i!==a)&&(!s||s.length===0?(this.valuesType=2,this.providedValues=null):this.valuesType=Array.isArray(s)?0:1,this.updateAllValues())}updateParams(e){const{handlerParams:{colDef:t,filterParams:{comparator:s,treeList:i,treeListPathGetter:r}},usingComplexObjects:a}=e,n=s??t.comparator,o=this.isTreeDataOrGrouping();let l;o&&!n?l=bP():i&&!r&&!n?l=([c,d],[u,h])=>rd(d,h):l=([c,d],[u,h])=>n(d,h),this.entryComparator=l,this.keyComparator=n??rd,this.compareByValue=!!(a&&n||o||i&&!r)}updateAllValues(){return this.allKeys=new Ni(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync().then(t=>e(this.processAllValues(t)));break;case 0:{e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break}case 1:{this.dispatchLocalEvent({type:"loadingStart"});const t=this.providedValues,{column:s,colDef:i}=this.params.handlerParams,r=_P(this.gos,{success:a=>{this.dispatchLocalEvent({type:"loadingEnd"}),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(a))))},colDef:i,column:s});window.setTimeout(()=>t(r),0);break}}}),this.allKeys.then(e=>{this.updateAvailableKeys(e??[]),this.initialised=!0}),this.allKeys}getAvailableValues(e){return this.sortKeys(this.getValuesFromRows(e))}overrideValues(e){return this.allKeys.then(()=>{this.valuesType=0,this.providedValues=e})}refreshAvailable(){return new Ni(e=>{if(this.showAvailableOnly()){this.allKeys.then(t=>{const s=t??[];this.updateAvailableKeys(s),e(!0)});return}e(!1)})}refreshAll(){return new Ni(e=>{this.allKeys.then(()=>{this.updateAllValues().then(()=>{e()})})})}isLoading(){return!this.initialised&&this.valuesType===1}isInitialised(){return this.initialised}getValueForFormatter(e){return this.initialised?this.allValues.get(e):e}getAvailableKeys(e){return this.initialised?e.filter(t=>this.availableKeys.has(t)):e}getParamsForValuesFromRows(e){if(!this.clientSideValuesExtractor){NP(113);return}return e&&!this.params.handlerParams.filterParams.caseSensitive?this.allValues:void 0}getValuesFromRows(e){const t=this.getParamsForValuesFromRows(!0);return this.clientSideValuesExtractor?.extractUniqueValues(e,t)??null}getValuesFromRowsAsync(){const e=this.getParamsForValuesFromRows(!1);return this.clientSideValuesExtractor?.extractUniqueValuesAsync(()=>!0,e)??Ni.resolve(null)}processAllValues(e){const t=this.sortKeys(e);return this.allValues=e??new Map,t}uniqueValues(e){const t=new Map,s=new Set,{caseFormat:i,createKey:r}=this;for(const a of e??[]){const n=BP(a),o=r(n),l=i(o);s.has(l)||(s.add(l),t.set(o,n))}return t}validateProvidedValues(e){if(this.params.usingComplexObjects&&e?.length){const t=e[0];t&&typeof t!="object"&&typeof t!="function"&&(this.createKey(t)==null?ad(209):ad(210))}return e}sortKeys(e){const t=e??new Map,s=this.params.handlerParams.filterParams;if(s.suppressSorting)return Array.from(t.keys());let i;return this.compareByValue?i=Array.from(t.entries()).sort(this.entryComparator).map(([r])=>r):i=Array.from(t.keys()).sort(this.keyComparator),s.excelMode&&t.has(null)&&(i=i.filter(r=>r!=null),i.push(null)),i}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(e){const t=this.showAvailableOnly()?this.getAvailableValues(s=>this.params.handlerParams.doesRowPassOtherFilter(s)):e;this.availableKeys=new Set(t),window.setTimeout(()=>{this.isAlive()&&this.dispatchLocalEvent({type:"availableValuesChanged"})})}},HP=class extends AP{constructor(){super(...arguments),this.filterType="set",this.treeDataTreeList=!1,this.groupingTreeList=!1,this.caseSensitive=!1,this.noValueFormatterSupplied=!1,this.useValueFormatterFromColumn=!1}init(e){this.updateParams(e);const t=this.isTreeDataOrGrouping.bind(this),s=()=>this.treeDataTreeList,i=this.createKey,r=this.caseFormat.bind(this),{gos:a,beans:n}=this,o=PP(a,n.rowModel)?this.createManagedBean(new kP(i,r,e.getValue,t,s)):void 0,l=this.createManagedBean(new VP(o,r,i,t,{handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}));this.addManagedListeners(l,{availableValuesChanged:e.onModelAsStringChange}),this.valueModel=l,this.appliedModel=new GP(this.caseFormat.bind(this)),this.appliedModel.update(e.model),this.validateModel(e),this.addEventListenersForDataChanges()}refresh(e){this.updateParams(e),this.valueModel.refresh({handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}),this.appliedModel.update(e.model),this.validateModel(e)}updateParams(e){this.params=e;const{colDef:t,filterParams:{caseSensitive:s,treeList:i,keyCreator:r}}=e;this.caseSensitive=!!s;const a=!!t.showRowGroup;this.treeDataTreeList=this.gos.get("treeData")&&!!i&&a,this.groupingTreeList=!!this.beans.rowGroupColsSvc?.columns.length&&!!i&&a;const n=r??t.keyCreator;this.createKey=this.generateCreateKey(n,this.isTreeDataOrGrouping()),this.setValueFormatter(n,e)}doesFilterPass(e){const{appliedModel:t,treeDataTreeList:s,groupingTreeList:i}=this;if(t.isNull())return!0;if(t.isEmpty())return!1;const{node:r}=e;if(s)return this.doesFilterPassForTreeData(r);if(i)return this.doesFilterPassForGrouping(r);const a=this.params.getValue(r);return a!=null&&Array.isArray(a)?a.length===0?t.has(null):a.some(n=>t.has(this.createKey(n,r))):t.has(this.createKey(a,r))}getFormattedValue(e){let t=this.valueModel.getValueForFormatter(e);this.isTreeDataOrGrouping()&&Array.isArray(t)&&(this.noValueFormatterSupplied||this.useValueFormatterFromColumn)&&(t=IP(t));const s=this.beans.valueSvc.formatValue(this.params.column,null,t,this.valueFormatter,this.useValueFormatterFromColumn);return s??za(t)??he(this,"blanks")}getModelAsString(e,t){const{values:s}=e??{},i=t==="filterToolPanel";if(s==null)return i?he(this,"filterSummaryListInactive"):"";const r=this.valueModel.getAvailableKeys(s),a=r.length,n=i?3:10,o=r.slice(0,n).map(l=>this.getFormattedValue(l));if(i){const l=o.join(he(this,"filterSummaryListSeparator"));return a>3?he(this,"filterSummaryListLong",[l,String(a-3)]):he(this,"filterSummaryListShort",[l])}return`(${a}) ${o.join(",")}${a>10?",...":""}`}onAnyFilterChanged(){window.setTimeout(()=>{this.isAlive()&&this.valueModel.refreshAvailable().then(e=>{this.dispatchLocalEvent({type:"anyFilterChanged",updated:!!e})})})}onNewRowsLoaded(){this.syncAfterDataChange()}setFilterValues(e){this.valueModel.overrideValues(e).then(()=>{this.refreshFilterValues()})}resetFilterValues(){this.valueModel.valuesType=Ua.TAKEN_FROM_GRID_VALUES,this.syncAfterDataChange()}refreshFilterValues(e){this.valueModel.isInitialised()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged",hardRefresh:!0}),this.validateModel(this.params,void 0,!e)})}getFilterKeys(){return Array.from(this.valueModel.allValues.keys())}getFilterValues(){return Array.from(this.valueModel.allValues.values())}isTreeDataOrGrouping(){return this.treeDataTreeList||this.groupingTreeList}caseFormat(e){return e==null||typeof e!="string"||this.caseSensitive?e:e.toUpperCase()}addEventListenersForDataChanges(){this.addManagedPropertyListeners(["groupAllowUnbalanced"],()=>this.syncAfterDataChange());const e=TP(this,this.syncAfterDataChange.bind(this),0);this.addManagedEventListeners({cellValueChanged:t=>{t.column===this.params.column&&e()}})}syncAfterDataChange(){this.isValuesTakenFromGrid()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged"}),this.validateModel(this.params,{afterDataChange:!0})})}validateModel(e,t,s){const i=this.valueModel;i.allKeys.then(()=>{const r=e.model;if(r==null)return;const a=new Map,n=p=>a.set(this.caseFormat(p),p);if(s)for(const p of i.availableKeys)n(p);else i.allValues.forEach((p,g)=>n(g));const o=[];let l=!1;for(const p of r.values){const g=this.caseFormat(Ha(p)),f=a.get(g);f!==void 0?(o.push(f),f!==p&&(l=!0)):l=!0}const c=o.length,d=e.filterParams;if(c===0&&d.excelMode){e.onModelChange(null,t);return}const h=!d.defaultToNothingSelected&&(this.valueModel.valuesType===Ua.TAKEN_FROM_GRID_VALUES||!d.suppressClearModelOnRefreshValues)&&c===a.size;if(l||!r.filterType||h){const p=h?null:{filterType:this.filterType,values:o};e.onModelChange(p,t)}})}isValuesTakenFromGrid(){return this.valueModel.valuesType===Ua.TAKEN_FROM_GRID_VALUES}doesFilterPassForTreeData(e){if(e.childrenAfterGroup?.length)return!1;const{gos:t,appliedModel:s}=this;return s.has(this.createKey(Va(e.getRoute()??[e.key??e.id],!0,t.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){const{appliedModel:t,params:s,gos:i,beans:{rowGroupColsSvc:r,valueSvc:a}}=this,n=(r?.columns??[]).map(o=>a.getKeyForNode(o,e));return n.push(s.getValue(e)),t.has(this.createKey(Va(n,!1,i.get("groupAllowUnbalanced"))))}generateCreateKey(e,t){return t&&!e?(id(250),()=>null):e?(s,i=null)=>{const r=this.getKeyCreatorParams(s,i);return Ha(e(r))}:s=>Ha(za(s))}getKeyCreatorParams(e,t=null){const{colDef:s,column:i}=this.params;return MP(this.gos,{value:e,colDef:s,column:i,node:t,data:t?.data})}setValueFormatter(e,t){const{colDef:{refData:s,valueFormatter:i},filterParams:{treeList:r,valueFormatter:a}}=t;if(e&&!(a||r||i)){id(249),this.valueFormatter=void 0,this.noValueFormatterSupplied=!0,this.useValueFormatterFromColumn=!1;return}let o=a;!o&&!i&&!s&&(o=l=>za(l.value)),this.valueFormatter=o,this.noValueFormatterSupplied=!a&&!i,this.useValueFormatterFromColumn=!a&&!!i}shouldUseValueFormatterFromColumn(){return this.useValueFormatterFromColumn&&!this.valueFormatter}getCrossFilterModel(e){const{createKey:t,valueModel:s,params:i}=this;return e(t,s.availableKeys,i.model?.values)}destroy(){this.appliedModel.destroy(),super.destroy(),this.valueModel=void 0}};import{AgInputTextFieldSelector as zP,Component as UP,RefPlaceholder as WP,_error as KP}from"ag-grid-community";var $P={tag:"div",cls:"ag-floating-filter-input ag-set-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},jP=class extends UP{constructor(){super($P,[zP]),this.eFloatingFilterText=WP}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0),s=this.getLocaleTextFunc();if(this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const i=e;this.updateFloatingFilterText(i.model)}}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof sd)){KP(248);return}e(t)})}updateFloatingFilterText(e){e==null?this.eFloatingFilterText.setValue(""):this.gos.get("enableFilterHandlers")?this.eFloatingFilterText.setValue(this.params.getHandler().getModelAsString?.(e)??""):this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(t.getModelAsString(e))})}},od={moduleName:"SetFilter",version:D,userComponents:{agSetColumnFilter:{classImp:sd,params:{useForm:!0},processParams:e=>(SP(e),e)},agSetColumnFloatingFilter:jP},dynamicBeans:{agSetColumnFilterHandler:HP},icons:{setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",setFilterLoading:"loading"},dependsOn:[B,UT]};import{_KeyboardNavigationModule as YP}from"ag-grid-community";import{AgPromise as Bi,Component as qP,RefPlaceholder as Wa,_addGridCommonParams as ld,_clearElement as Ka,_removeFromParent as XP,_warn as ZP}from"ag-grid-community";var JP=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function QP(e,t,s){return e.getCompDetails(t,eI,void 0,s,!0)}var eI={name:"statusPanel",optionalMethods:["refresh"]},tI={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},sI={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},iI=class extends qP{constructor(){super(sI),this.updateQueued=!1,this.panelsPromise=Bi.resolve(),this.eStatusBarLeft=Wa,this.eStatusBarCenter=Wa,this.eStatusBarRight=Wa,this.compDestroyFunctions={},this.registerCSS(JP)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}getValidPanels(){const e=this.gos,t=e.get("statusBar")?.statusPanels;return t&&t.filter(s=>{const{rowModels:i,warnArgs:r}=tI[s.statusPanel]??{};return!i||i.includes(e.get("rowModelType"))?!0:(ZP(...r),!1)})}processStatusPanels(e){const t=this.getValidPanels();if(t){const s=t.filter(a=>a.align==="left"),i=t.filter(a=>a.align==="center"),r=t.filter(a=>!a.align||a.align==="right");this.panelsPromise=Bi.all([this.createAndRenderComponents(s,this.eStatusBarLeft,e),this.createAndRenderComponents(i,this.eStatusBarCenter,e),this.createAndRenderComponents(r,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){this.updateQueued||(this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1}))}updateStatusBar(){const e=this.getValidPanels(),t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);const s=new Map;if(t)for(const i of e){const r=i.key??i.statusPanel,a=this.statusBarSvc.getStatusPanel(r);if(a?.refresh){const n=ld(this.gos,{...i.statusPanelParams??{},key:r});a.refresh(n)&&(s.set(r,a),delete this.compDestroyFunctions[r],XP(a.getGui()))}}this.resetStatusBar(),t&&this.processStatusPanels(s)}resetStatusBar(){Ka(this.eStatusBarLeft),Ka(this.eStatusBarCenter),Ka(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(const e of Object.values(this.compDestroyFunctions))e();this.compDestroyFunctions={}}createAndRenderComponents(e,t,s){const i=[];for(const r of e){const a=r.key||r.statusPanel,n=s.get(a);let o;if(n)o=Bi.resolve(n);else{const l=QP(this.userCompFactory,r,ld(this.gos,{key:a}));if(l==null)continue;o=l.newAgStackInstance()}i.push({key:a,promise:o})}return Bi.all(i.map(r=>r.promise)).then(()=>{for(const r of i)r.promise.then(a=>{const n=()=>{this.destroyBean(a)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(r.key,a),t.appendChild(a.getGui()),this.compDestroyFunctions[r.key]=n):n()})})}},rI={selector:"AG-STATUS-BAR",component:iI};import{Component as aI,RefPlaceholder as Ds,_createCellId as nI,_exists as oI,_formatNumberCommas as lI,_getRowBelow as cI,_getRowNode as dI,_isRowBefore as uI,_missing as $a,_parseBigIntOrNull as hI}from"ag-grid-community";import{Component as pI,RefPlaceholder as cd,_addGridCommonParams as gI}from"ag-grid-community";var fI={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},":\xA0",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},mI=BigInt(Number.MIN_SAFE_INTEGER),CI=BigInt(Number.MAX_SAFE_INTEGER),Ls=class extends pI{constructor(){super(fI),this.eLabel=cd,this.eValue=cd}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){let s=null,i;typeof e=="bigint"?(i=e,e>=mI&&e<=CI&&(s=Number(e))):s=e,this.eValue.textContent=this.valueFormatter(gI(this.gos,{value:s,bigintValue:i,totalRows:t,key:this.key}))}},vI={selector:"AG-NAME-VALUE",component:Ls},dd=e=>{let t=0;return e.forEachNodeAfterFilter(s=>{s.data&&t++}),t},ks=e=>{let t=0;return e.forEachNode(s=>{s.data&&t++}),t};function SI(e,t){return typeof e!="number"?"":lI(Math.round(e*100)/100,t)}var bI={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},yI=class extends aI{constructor(){super(bI,[vI]),this.sumAggregationComp=Ds,this.countAggregationComp=Ds,this.minAggregationComp=Ds,this.maxAggregationComp=Ds,this.avgAggregationComp=Ds}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){this.params=e;const t=e.valueFormatter??(i=>{const{value:r,bigintValue:a}=i;return a!=null?a.toString():SI(r,this.getLocaleTextFunc.bind(this))}),s=["avg","count","min","max","sum"];for(const i of s){const r=this.getAllowedAggregationValueComponent(i);r&&(r.key=i,r.valueFormatter=t.bind(this))}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,s){const i=this.getAllowedAggregationValueComponent(e),r=ks(this.beans.rowModel);oI(i)&&i?(i.setValue(t,r),i.setDisplayed(s)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){const t=`${e}AggregationComp`;return this[t]}onCellSelectionChanged(){const e=this.beans,{rangeSvc:t,valueSvc:s}=e,i=t?.getCellRanges();let r=0,a=0n,n=!1,o=!1,l=0,c=0,d=null,u=null,h=null,p=null;const g=F=>{if(typeof F=="number")if(r+=F,(d===null||F<d)&&(d=F),(u===null||F>u)&&(u=F),!Number.isInteger(F)||!Number.isSafeInteger(F))o=!0;else{const I=BigInt(F);a+=I,(h===null||I<h)&&(h=I),(p===null||I>p)&&(p=I)}else{n=!0,a+=F,(h===null||F<h)&&(h=F),(p===null||F>p)&&(p=F);const I=Number(F);r+=I,(d===null||I<d)&&(d=I),(u===null||I>u)&&(u=I)}c++},f={};if(i?.length&&t)for(let F=0;F<i.length;F++){const I=i[F];let E=t.getRangeStartRow(I);const P=t.getRangeEndRow(I);for(;!($a(E)||!E||uI(P,E)||!E||!I.columns);)I.columns.forEach(k=>{if(E===null)return;const A=nI({rowPinned:E.rowPinned,column:k,rowIndex:E.rowIndex});if(f[A])return;f[A]=!0;const L=dI(e,E);if($a(L))return;let _=s.getValue(k,L,"data");if(!($a(_)||_==="")&&(l++,!(typeof _=="object"&&"value"in _&&(_=_.value,_==="")))){if(typeof _=="string"){const j=_.trim();if(j==="")return;const W=Number(j);if(!Number.isFinite(W))return;r+W>=Number.MAX_SAFE_INTEGER||r+W<=Number.MIN_SAFE_INTEGER||W>=Number.MAX_SAFE_INTEGER||W<=Number.MIN_SAFE_INTEGER?(_=hI(j),_===null&&(_=W)):_=W}(typeof _=="number"&&!isNaN(_)||typeof _=="bigint")&&g(_)}}),E=cI(e,E)}const m=l>1,C=c>1,v=n&&!o;let S;v?S=a/BigInt(c):S=r/c;const b=C?v?a:r:null,y=C?v?h:d:null,w=C?v?p:u:null,M=C?S:null,T=C;this.setAggregationComponentValue("count",l,m),this.setAggregationComponentValue("sum",b,C),this.setAggregationComponentValue("min",y,C),this.setAggregationComponentValue("max",w,C),this.setAggregationComponentValue("avg",M,T)}};import{_formatNumberCommas as wI}from"ag-grid-community";var xI=class extends Ls{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e})}onDataChanged(){const{rowModel:e}=this.beans,t=ks(e),s=dd(e);this.setValue(s,t),this.setDisplayed(t!==s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>wI(t,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};import{_formatNumberCommas as FI}from"ag-grid-community";var RI=class extends Ls{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");const e=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:e,selectionChanged:e})}onRowSelectionChanged(){const{selectionSvc:e,rowModel:t}=this.beans,s=e?.getSelectionCount()??0,i=ks(t);if(this.setValue(s,i),s<0){this.setDisplayed(!0);return}this.setDisplayed(s>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>t==null||t>=0?FI(t,this.getLocaleTextFunc.bind(this)):this.getLocaleTextFunc()("statusBarLastRowUnknown","?"))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};import{_formatNumberCommas as ud}from"ag-grid-community";var AI=class extends Ls{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const{rowModel:e}=this.beans,t=dd(e),s=ks(e);this.setValue(t,s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t,totalRows:s})=>{const i=this.getLocaleTextFunc.bind(this),r=ud(t,i),a=ud(s??t,i);if(t===s)return r;const n=i();return`${r} ${n("of","of")} ${a}`})}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};import{_formatNumberCommas as MI}from"ag-grid-community";var TI=class extends Ls{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const e=ks(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>MI(t,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};import{_unwrapUserComp as PI}from"ag-grid-community";function II(e,t){const s=e.statusBarSvc?.getStatusPanel(t);return PI(s)}import{BeanStub as EI}from"ag-grid-community";var DI=class extends EI{constructor(){super(),this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}},hd={moduleName:"StatusBar",version:D,beans:[DI],userComponents:{agAggregationComponent:yI,agTotalRowCountComponent:TI,agFilteredRowCountComponent:xI,agTotalAndFilteredRowCountComponent:AI,agSelectedRowCountComponent:RI},selectors:[rI],apiFunctions:{getStatusPanel:II},dependsOn:[B,YP]};import{_SharedExportModule as LI}from"ag-grid-community";import{_warn as kI}from"ag-grid-community";function pd(e){return e.excelCreator?.getFactoryMode()==="MULTI_SHEET"?(kI(161),!1):!0}function GI(e,t){if(pd(e))return e.excelCreator?.getDataAsExcel(t)}function OI(e,t){pd(e)&&e.excelCreator?.exportDataAsExcel(t)}function _I(e,t){return e.excelCreator?.setFactoryMode("MULTI_SHEET"),e.excelCreator?.getSheetDataForExcel(t)}function NI(e,t){return e.excelCreator?.getMultipleSheetsAsExcel(t)}function BI(e,t){e.excelCreator?.exportMultipleSheetsAsExcel(t)}var gd={moduleName:"ExcelExport",version:D,beans:[Xv],apiFunctions:{getDataAsExcel:GI,exportDataAsExcel:OI,getSheetDataForExcel:_I,getMultipleSheetsAsExcel:NI,exportMultipleSheetsAsExcel:BI},dependsOn:[LI,B]};import{_ColumnFilterModule as VI}from"ag-grid-community";import{AgPromise as Qe,FilterWrapperComp as HI,LocalEventService as zI,ProvidedFilter as UI,_getFilterModel as WI,_refreshFilterUi as KI,_refreshHandlerAndUi as fd,_removeFromArray as $I,_updateFilterModel as jI}from"ag-grid-community";import{AgPromise as Ut,KeyCode as Gs,TabGuardComp as YI,_createElement as qI,_focusInto as XI,_getActiveDomElement as ZI,_isNothingFocused as JI,_setAriaRole as QI}from"ag-grid-community";import{ProvidedFilter as eE}from"ag-grid-community";function Vi(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function Hi(e,t){if(e!=null)for(let s=e.length-1;s>=0;s--)t(e[s],s)}function tE(e,t){return t.title!=null?t.title:e instanceof eE?e.getFilterTitle():"Filter"}function zi(e,t,s,i){const r=[],a=e?.filterModels;for(let n=0;n<t;n++)r[n]=(n===i?s:a?.[n])??null;return r.every(n=>n==null)?null:{filterType:"multi",filterModels:r}}function Ne(e,t){return e?.filterModels?.[t]??null}function Ui(e,t,s,i){const r=s.filterValueGetter;return r?e.colFilter.createGetValue(t,r):i}var md=class extends YI{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"}),this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}refreshGui(e){return e===this.lastOpenedInContainer?Ut.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),Ut.all(this.getFilterWrappers().map((t,s)=>{if(!t)return Ut.resolve(null);const i=this.getFilterFromWrapper(t),r=this.getCompFromWrapper(t),a=this.filterDefs[s],n=tE(i,a);let o;if(a.display==="subMenu"&&e!=="toolPanel")o=this.insertFilterMenu(r,i,n).then(l=>l.getGui());else if(a.display==="subMenu"||a.display==="accordion"){const l=this.insertFilterGroup(i,r,n);o=Ut.resolve(l.getGui())}else o=Ut.resolve(r.getGui());return o})).then(t=>{t.forEach((s,i)=>{s&&(i>0&&this.appendChild(qI({tag:"div",cls:"ag-filter-separator"})),this.appendChild(s))}),this.filterGuis=t,this.lastOpenedInContainer=e}))}destroyChildren(){for(const e of this.guiDestroyFuncs)e();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t,s){const i=e.getGui();QI(i,"dialog");const r=this.createBean(new FA),a={getGui:()=>e.getGui(),afterGuiAttached:n=>{e.afterGuiAttached?.(n),e!==t&&t.afterGuiAttached?.(n)}};return r.init({menuItemDef:{name:s,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:lc,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:a,contextParams:{column:null,node:null,value:null}}).then(()=>{r.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(r)),this.addManagedListeners(r,{menuItemActivated:o=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==o.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=o.menuItem}});const n=r.getGui();return r.addManagedElementListeners(n,{keydown:o=>{const{key:l}=o;switch(l){case Gs.UP:case Gs.RIGHT:case Gs.DOWN:case Gs.LEFT:o.preventDefault(),l===Gs.RIGHT&&r.openSubMenu(!0);break}},focusin:()=>r.activate(),focusout:()=>{!r.isSubMenuOpen()&&!r.isSubMenuOpening()&&r.deactivate()}}),r})}insertFilterGroup(e,t,s){const i=this.createBean(new Ae({title:s,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(t.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached&&i.addManagedListeners(i,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),i}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=Ut.resolve());const s=e?.suppressFocus;t.then(()=>{const{filterDefs:i,filterGuis:r,beans:a}=this,n=this.getFilterWrappers();let o=!!s;i&&Hi(i,(c,d)=>{const u=d===0,h=c.display&&c.display!=="inline",p=s||!u||h,g={...e??{},suppressFocus:p},f=n[d],m=f?this.getFilterFromWrapper(f):void 0;if(f){const C=this.getCompFromWrapper(f);C!==m&&C.afterGuiAttached(g)}if(m&&(this.executeFunctionIfExistsOnFilter(m,"afterGuiAttached",g),u&&!p&&(o=!0)),!s&&u&&h){const C=r[d];C&&(XI(C)||C.focus({preventScroll:!0}),o=!0)}});const l=ZI(a);!o&&(JI(a)||this.getGui().contains(l))&&this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",e=>this.executeOnWrapper(e,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",e=>this.executeOnWrapper(e,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(e,t){}executeFunctionIfExists(e,t){Hi(this.getFilterWrappers(),s=>{s&&(t?.(s),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(s),e))})}executeFunctionIfExistsOnFilter(e,t,...s){const i=e[t];typeof i=="function"&&i.apply(e,s)}onFocusIn(e){const t=this.lastActivatedMenuItem;t!=null&&!t.getGui().contains(e.target)&&(t.deactivate(),this.lastActivatedMenuItem=null)}},Cd=class extends md{constructor(){super(...arguments),this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(e){this.params=e,this.filterDefs=Vi(e);const t=WI(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:s}=e;this.filterChangedCallback=s;const i=this.filterDefs.map((r,a)=>this.createFilter(r,a,t));return new Qe(r=>{Qe.all(i).then(a=>{this.wrappers=a,this.refreshGui("columnMenu").then(()=>{r()})})}).then(()=>{for(const r of this.afterFiltersReadyFuncs)r();this.afterFiltersReadyFuncs.length=0})}refresh(e){return this.params=e,!0}isFilterActive(){return this.wrappers.some(e=>{if(!e)return!1;const{filter:t,handler:s,model:i}=e;return s?i!=null:t.isFilterActive()})}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((s,i)=>{if(!s||t!=null&&i===t)return!0;const{handler:r,filter:a,model:n}=s;return r?n==null||r.doesFilterPass({...e,model:n,handlerParams:s.handlerParams}):!a.isFilterActive()||a.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map(t=>{if(!t)return null;const s=t.filter;return typeof s.getModelFromUi=="function"?s.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.wrappers.map(t=>{if(!t)return null;const{filter:s,handler:i,model:r}=t;return i?r:s.isFilterActive()?s.getModel():null})}:null}setModel(e){const t=(i,r)=>new Qe(a=>{const n=i.setModel(r);n?n.then(a):a()}),s=[];return this.wrappers.forEach((i,r)=>{if(!i)return;const a=Ne(e,r),{filter:n,filterParams:o,handler:l,handlerParams:c,state:d}=i;if(l){const u={model:a,state:d?.state};i.state=u,i.model=a,s.push(fd(()=>Qe.resolve({filter:n,filterParams:o}),l,c,a,u,"api").then(()=>{this.updateActiveListForHandler(r,i.model)}))}else s.push(t(n,a).then(()=>{this.updateActiveListForFilter(r,n)}))}),Qe.all(s).then(()=>{})}applyModel(e="api"){let t=!1;for(const s of this.wrappers)if(s){const i=s.filter;i instanceof UI&&(t=i.applyModel(e)||t)}return t}getChildFilterInstance(e){return this.wrappers[e]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(const e of this.wrappers)this.destroyBean(e?.filter),this.destroyBean(e?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(e){return e.filter}getCompFromWrapper(e){return e.comp}executeOnWrapper(e,t){e.handler?.[t]?.()}createFilter(e,t,s){const i=this.params.column;let r=null,a;const n=this.beans,o=(p,g)=>{const f=this.wrappers[t];if(!f)return;const m={model:p,state:f.state?.state};f.state=m,f.model=p,fd(()=>Qe.resolve({filter:f.filter,filterParams:f.filterParams}),f.handler,f.handlerParams,p,m,"ui").then(()=>{this.onHandlerModelChanged(t,f.model,g)})},{compDetails:l,handler:c,handlerParams:d,createFilterUi:u}=n.colFilter.createFilterInstance(i,e,"agTextColumnFilter",(p,g)=>{const f={...p,filterChangedCallback:g?()=>{}:m=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,m))},doesRowPassOtherFilter:m=>p.doesRowPassOtherFilter(m)&&this.doesFilterPass({node:m,data:m.data},t),getValue:Ui(n,i,e,p.getValue)};return g&&(r=Ne(s,t),a=this.updateDisplayParams(f,t,r,()=>l,()=>c,o)),f});if(!u)return Qe.resolve(null);let h;if(c){const{doesRowPassOtherFilter:p,getValue:g}=d;h={...d,onModelChange:o,doesRowPassOtherFilter:f=>p(f)&&this.doesFilterPass({node:f,data:f.data},t),getValue:Ui(n,i,e,g)},c.init?.({...h,model:r,source:"init"})}return u().then(p=>{if(!c)return{filter:p,comp:p};const g=l?.params,f=a(p);return{filter:p,comp:f,filterParams:g,handler:c,handlerParams:h,model:r}})}updateDisplayParams(e,t,s,i,r,a){const n=this.params.column,o=new zI;e.model=s,e.state={model:s},e.onModelChange=a,e.getHandler=r;const l=(d,u)=>{d.state=u,o.dispatchEvent({type:"filterStateChanged",column:n,state:u})};e.onStateChange=d=>{const u=this.wrappers[t];u&&(l(u,d),KI(u.filter,u.filterParams,u.model??null,d,"ui"))};const c=(d,u,h)=>{const p=this.wrappers[t];if(!p)return;const g=()=>p?.model??null;jI({action:u,filterParams:p.filterParams,getFilterUi:()=>{const f=Qe.resolve(p.filter);return{created:!0,filterParams:p.filterParams,compDetails:i(),create:()=>f,promise:f}},getModel:g,getState:()=>p?.state??{model:g()},updateState:f=>l(p,f),updateModel:f=>p.filterParams?.onModelChange(f,h),processModelToApply:p.handler?.processModelToApply?.bind(p.handler)})};return e.onAction=(d,u,h)=>{c(n,d,u),o.dispatchEvent({type:"filterAction",column:n,action:d,event:h})},d=>{const u=i()?.params;return this.createManagedBean(new HI(n,{comp:d,params:u,isHandler:!0},o,c,!1))}}executeWhenAllFiltersReady(e){(this.wrappers?.length??0)>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveListForFilter(e,t){this.updateActiveList(e,()=>t?.isFilterActive())}updateActiveListForHandler(e,t){this.updateActiveList(e,()=>t!=null)}updateActiveList(e,t){const s=this.activeFilterIndices;$I(this.activeFilterIndices,e),t()&&s.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,s){this.updateActiveListForHandler(e,t),this.filterChanged(e,s)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((s,i)=>{if(e===i||!s)return;const{filter:r,handler:a}=s;a?.onAnyFilterChanged?.(),typeof r.onAnyFilterChanged=="function"&&r.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return"";const t=this.getLastActiveFilterIndex()??0;return this.wrappers[t]?.filter?.getModelAsString?.(e.filterModels[t])??""}};import{BeanStub as sE,_removeFromArray as iE,_warn as vd}from"ag-grid-community";var rE=class extends sE{constructor(){super(...arguments),this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;const t=Vi(e.filterParams);this.filterDefs=t,t.forEach((s,i)=>{const r=this.beans.colFilter.createHandler(e.column,s,"agTextColumnFilter");if(this.handlerWrappers.push(r),!r){vd(278,{colId:e.column.getColId()});return}const{handler:a,handlerParams:n}=r;a.init?.({...this.updateHandlerParams(n,i,!0),model:Ne(e.model,i),source:"init"})}),this.resetActiveList(e.model)}refresh(e){this.params=e;const{model:t,source:s,filterParams:i}=e,r=i?.filters;this.handlerWrappers.forEach((a,n)=>{if(a){const o=this.updateHandlerParams(e,n,!1,r?.[n].filterParams);a.handlerParams=o,a.handler.refresh?.({...o,model:Ne(t,n),source:s})}}),e.source!=="floating"&&e.source!=="ui"&&this.resetActiveList(e.model),e.additionalEventAttributes?.fromButtons&&this.onAnyFilterChanged()}updateHandlerParams(e,t,s,i){const{onModelChange:r,doesRowPassOtherFilter:a,getValue:n}=e,o={...e,onModelChange:(l,c)=>r(zi(this.params.model,this.handlerWrappers.length,l,t),c),doesRowPassOtherFilter:l=>a(l)&&this.doesFilterPass({node:l,data:l.data,model:this.params.model,handlerParams:o},t),getValue:Ui(this.beans,e.column,this.filterDefs[t],n),filterParams:this.updateFilterParams(e,s,i)};return o}updateFilterParams(e,t,s){const i=e.filterParams;s?.buttons&&t&&vd(292,{colId:e.column.getColId()});const r=s?{...i,...s}:i;if(!r.buttons)return r;if(s)return delete r.buttons,r;const{buttons:a,...n}=r;return n}doesFilterPass(e,t){const s=e.model?.filterModels;return s==null?!0:this.handlerWrappers.every((i,r)=>{const a=s[r];if(a==null||t!=null&&r===t)return!0;const n=i?.handler;return!n||n.doesFilterPass({...e,model:a,handlerParams:i.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];const t=e?.filterModels;if(t!=null)for(let s=0;s<this.handlerWrappers.length;s++)t[s]!=null&&this.activeFilterIndices.push(s)}updateActiveList(e,t){const s=this.activeFilterIndices;iE(s,e),t!=null&&s.push(e)}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}getModelAsString(e,t){const s=t==="filterToolPanel",i=()=>s?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!e?.filterModels?.length)return i();const r=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[r]?.handler.getModelAsString?.(e.filterModels[r],t)??i()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){Hi(this.handlerWrappers,e=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){Hi(this.handlerWrappers,e=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(const e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}};import{BeanStub as aE,_getDefaultSimpleFilter as nE,_getFilterParamsForDataType as oE}from"ag-grid-community";var lE=class extends aE{constructor(){super(...arguments),this.beanName="multiFilter"}getParamsForDataType(e,t,s,i){let r=e?.filters;const a=this.beans;r||(r=[{filter:nE(s.baseDataType)},{filter:"agSetColumnFilter"}]);const n=this.getLocaleTextFunc();return r=r.map(o=>{const{filter:l,filterParams:c,filterValueGetter:d}=o;if(typeof l!="string")return o;const{filterParams:u,filterValueGetter:h}=oE(l,c,d??t,s,i,a,n);return{...o,filterParams:u,filterValueGetter:h}}),{filterParams:{...e,filters:r}}}};import{AgPromise as ja,_getFilterDetails as cE,_isUseApplyButton as dE,_refreshFilterUi as uE,_warn as hE}from"ag-grid-community";var Sd=class extends md{constructor(){super(...arguments),this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e;const t=Vi(e).map(i=>{if(i.filterParams?.buttons){hE(292,{colId:e.column.getColId()});const r={...i.filterParams};return delete r.buttons,{...i,filterParams:r}}return i});this.filterDefs=t,this.allState=e.state;const s=this.filterDefs.map((i,r)=>this.createFilter(i,r));return new ja(i=>{ja.all(s).then(r=>{this.filters=r,this.refreshGui("columnMenu").then(()=>{i()})})})}refresh(e){const{model:t,state:s,source:i}=e;if(i==="colDef")return!1;this.params=e;const r=this.filterParams;if(s===this.allState)return!0;this.allState=s;const a=s.state;return this.filters.forEach((n,o)=>{const l=Ne(t,o),c={state:a?.[o],model:Ne(s.model,o)};uE(n,r[o],l,c,i)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(e){return this.filters[e]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(const e of this.filters)this.destroyBean(e);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(e){return e}getCompFromWrapper(e){return e}createFilter(e,t){const s=this.beans.userCompFactory,i=this.updateParams(e,this.params,t),r=cE(s,e,i,"agTextColumnFilter");return r?(this.filterParams[t]=r.params,r.newAgStackInstance()):ja.resolve(null)}updateParams(e,t,s){const{doesRowPassOtherFilter:i,model:r,onModelChange:a,state:n,onStateChange:o,column:l,source:c,onAction:d,onUiChange:u,getValue:h}=t,p=Ne(r,s),g=n?{model:Ne(n.model,s),state:n.state?.[s]}:{model:p},f=()=>{const C=this.getHandler();this.filters.forEach((v,S)=>{s!==S&&(C.getHandler(S)?.onAnyFilterChanged?.(),v?.onAnyFilterChanged?.())})},m=this.beans.colFilter;return{...m.createBaseFilterParams(l),...e,doesRowPassOtherFilter:C=>i(C)&&this.getHandler().doesFilterPass({node:C,data:C.data,model:this.params.model,handlerParams:m.getHandlerParams(l)},s),model:p,state:g,onModelChange:(C,v)=>{const{filters:S,params:b}=this,y=zi(b.model,S.length,C,s);this.updateActiveList(s,C),a(y,v),f()},onStateChange:C=>this.onStateChange(o,s,C),getHandler:()=>this.getHandler().getHandler(s),onAction:(C,v,S)=>{if(dE(t))return;const b=C==="apply"||C==="reset";b&&this.updateActiveList(s,Ne(this.params.state.model,s)),d(C,v,S),b&&f()},onUiChange:u,source:c,getValue:Ui(this.beans,l,e,h)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,s){const{model:i,state:r,valid:a}=s,n=this.validity;n[t]=a;const o=this.allState,l=zi(o.model,this.filters.length,i,t),c=n.every(h=>h!==!1),d=[...o.state??[]];d[t]=r;const u={state:d,model:l,valid:c};this.allState=u,e(u)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??""}};import{AgPromise as pE,Component as gE,_clearElement as fE,_error as mE,_getDefaultFloatingFilterType as CE,_getFloatingFilterCompDetails as vE,_mergeDeep as SE,_setDisplayed as Os}from"ag-grid-community";var bE={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},yE=class extends gE{constructor(){super(bE),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(s=>{const i=s?.newAgStackInstance();i!=null&&(this.compDetailsList.push(s),t.push(i))}),pE.all(t).then(s=>{s.forEach((i,r)=>{this.floatingFilters.push(i);const a=i.getGui();this.appendChild(a),r>0&&Os(a,!1)})})}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:s}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((r,a)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[a],r))){if(s.forEach((r,a)=>{this.floatingFilters[a].refresh?.(r)}),this.gos.get("enableFilterHandlers")){const r=e;if(r.model==null)this.floatingFilters.forEach((a,n)=>{Os(a.getGui(),n===0)});else{const a=r.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((n,o)=>{const l=a==null?o===0:o===a;Os(n.getGui(),l)})}}}else fE(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){const t=[],s=[],i=e.filterParams,r=e.currentParentModel,a=Vi(i);return a.forEach((n,o)=>{const l={...e,parentFilterInstance:d=>{this.parentMultiFilterInstance(u=>{const h=u.getChildFilterInstance(o);h!=null&&d(h)})},currentParentModel:()=>r()?.filterModels?.[o]??null};if(this.gos.get("enableFilterHandlers")){const d=l;d.model=d.model?.filterModels?.[o]??null;const{onModelChange:u,getHandler:h}=d;d.onModelChange=(p,g)=>u(zi(this.params.model,a.length,p,o),g),d.getHandler=()=>h().getHandler(o)}SE(l.filterParams,n.filterParams);const c=this.getCompDetails(n,l);c&&(t.push(c),s.push(l))}),{compDetailsList:t,floatingFilterParamsList:s}}onParentModelChanged(e,t){t?.afterFloatingFilter||this.parentMultiFilterInstance(s=>{if(e==null)this.floatingFilters.forEach((i,r)=>{i.onParentModelChanged(null,t),Os(i.getGui(),r===0)});else{const i=s.getLastActiveFilterIndex();this.floatingFilters.forEach((r,a)=>{const n=e.filterModels.length>a?e.filterModels[a]:null;r.onParentModelChanged(n,t);const o=i==null?a===0:a===i;Os(r.getGui(),o)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){const{colFilter:s,frameworkOverrides:i,userCompFactory:r}=this.beans,a=CE(i,e,()=>s.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return vE(r,e,t,a)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof Cd||t instanceof Sd||mE(120),e(t)})}},bd={moduleName:"MultiFilter",version:D,userComponents:{agMultiColumnFilter:{getComp:e=>e.gos.get("enableFilterHandlers")?{classImp:Sd,params:{useForm:!0}}:Cd},agMultiColumnFloatingFilter:yE},beans:[lE],dynamicBeans:{agMultiColumnFilterHandler:rE},dependsOn:[B,VI,Di]};import{_ColumnFilterModule as wE,_PopupModule as xE}from"ag-grid-community";import{BeanStub as FE,_exists as RE}from"ag-grid-community";var AE=class extends FE{constructor(){super(...arguments),this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const{valueColsSvc:s,colModel:i,rowGroupColsSvc:r}=this.beans,a=e.getColDef().pivotValueColumn,n=RE(a);let o=null,l;if(n){const c=s?.columns??[],d=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&c.length===1,u=e.getColDef().pivotTotalColumnIds!==void 0;if(d&&!u)return t;o=a?a.getAggFunc():null,l=!0}else{const c=e.isValueActive(),d=r?.columns.length!==0,u=i.isPivotMode()||d||this.gos.get("treeData");c&&u?(o=e.getAggFunc(),l=!0):l=!1}if(l){const c=typeof o=="string"?o:"func";return`${this.getLocaleTextFunc()(c,c)}(${t})`}return t}};import{BeanStub as ME,_exists as yd,_last as TE}from"ag-grid-community";var PE={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},IE=class extends ME{constructor(){super(...arguments),this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const e=this.aggFuncsMap;e.sum=EE,e.first=DE,e.last=LE,e.min=kE,e.max=GE,e.count=_E,e.avg=BE,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e).includes(t),r=yd(this.aggFuncsMap[t]);return i&&r}getDefaultFuncLabel(e){return PE[e]??e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(yd(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";const s=this.getFuncNames(e);return s?.length?s[0]:null}addAggFuncs(e){if(this.init(),!!e)for(const t of Object.keys(e))e[t]&&(this.aggFuncsMap[t]=e[t])}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return t??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function EE(e){const{values:t}=e;let s=null;for(let i=0;i<t.length;i++){const r=t[i];typeof r=="number"?s===null?s=r:s+=typeof s=="number"?r:BigInt(r):typeof r=="bigint"&&(s===null?s=r:s=(typeof s=="bigint"?s:BigInt(s))+r)}return s}function DE(e){return e.values.length>0?e.values[0]:null}function LE(e){return e.values.length>0?TE(e.values):null}function kE(e){const{values:t}=e;let s=null;for(let i=0;i<t.length;i++){const r=t[i];(typeof r=="number"||typeof r=="bigint")&&(s===null||s>r)&&(s=r)}return s}function GE(e){const{values:t}=e;let s=null;for(let i=0;i<t.length;i++){const r=t[i];(typeof r=="number"||typeof r=="bigint")&&(s===null||s<r)&&(s=r)}return s}var OE=Object.freeze({toString:function(){return this.value.toString()},toNumber:function(){return this.value}});function _E(e){const{values:t}=e;let s=0;for(let a=0;a<t.length;a++){const n=t[a];s+=n!=null&&typeof n.value=="number"?n.value:1}const i=e.rowNode?.aggData?.[e.column.getColId()];if(i&&i.value===s)return i;const r=Object.create(OE);return r.value=s,r}var NE=Object.freeze({toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}});function BE(e){const{values:t}=e;let s=0,i=0;for(let o=0;o<t.length;o++){const l=t[o];let c=null;typeof l=="number"||typeof l=="bigint"?(c=l,i++):l!=null&&(typeof l.value=="number"||typeof l.value=="bigint")&&typeof l.count=="number"&&(c=l.value*(typeof l.value=="number"?l.count:BigInt(l.count)),i+=l.count),typeof c=="number"?s+=typeof s=="number"?c:BigInt(c):typeof c=="bigint"&&(s=(typeof s=="bigint"?s:BigInt(s))+c)}let r=null;i>0&&(r=s/(typeof s=="number"?i:BigInt(i)));const a=e.rowNode?.aggData?.[e.column?.getColId()];if(a&&a.count===i&&a.value===r)return a;const n=Object.create(NE);return n.count=i,n.value=r,n}function VE(e,t){e.aggFuncSvc&&e.aggFuncSvc.addAggFuncs(t)}function HE(e){e.aggFuncSvc&&e.aggFuncSvc.clear()}function zE(e,t,s){e.valueColsSvc?.setColumnAggFunc?.(t,s,"api")}import{BeanStub as UE,_getGrandTotalRow as WE,_getGroupAggFiltering as KE,_isClientSideRowModel as $E}from"ag-grid-community";import{_addGridCommonParams as jE,_warn as YE}from"ag-grid-community";function Wt({beans:e,values:t,aggFuncOrString:s,column:i,rowNode:r,pivotResultColumn:a,aggregatedChildren:n}){const o=typeof s=="string"?e.aggFuncSvc.getAggFunc(s):s;if(typeof o!="function")return YE(109,{inputValue:s.toString(),allSuggestions:e.aggFuncSvc.getFuncNames(i)}),null;const l=jE(e.gos,{values:t,column:i,colDef:i.colDef,pivotResultColumn:a,rowNode:r,data:r?.data,aggregatedChildren:n});return o(l)}var qE=class extends UE{constructor(){super(...arguments),this.beanName="aggStage",this.step="aggregate",this.refreshProps=["getGroupRowAgg","alwaysAggregateAtRootLevel","suppressAggFilteredOnly","grandTotalRow"],this.clientSide=!1}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotResultCols=e.pivotResultCols,this.valueSvc=e.valueSvc,this.clientSide=$E(e.gos)}execute(e){const t=!this.valueColsSvc?.columns?.length,s=!this.gos.getCallback("getGroupRowAgg");if(t&&s&&e?.active)return;const i=this.createAggDetails(e);this.recursivelyCreateAggData(i)}createAggDetails(e){const t=this.colModel.isPivotActive(),s=this.valueColsSvc?.columns,i=t&&this.pivotColsSvc?this.pivotColsSvc.columns:[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!WE(this.gos),changedPath:e,valueColumns:s??[],pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return KE(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){const t=s=>{if(!s.hasChildren()){s.aggData&&this.setAggDataWithSiblings(s,null);return}if(s.level===-1&&!e.groupIncludeTotalFooter){const a=!this.colModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&a){this.setAggData(s,null);return}}this.aggregateRowNode(s,e)};e.changedPath.forEachChangedNodeDepthFirst(t,!0)}aggregateRowNode(e,t){const s=t.valueColumns.length===0,i=t.pivotColumns.length===0;let r;t.userAggFunc?r=t.userAggFunc({nodes:e.childrenAfterFilter}):s?r=null:i?r=this.aggregateRowNodeUsingValuesOnly(e,t):r=this.aggregateRowNodeUsingValuesAndPivot(e),this.setAggDataWithSiblings(e,r)}aggregateRowNodeUsingValuesAndPivot(e){const t={},s=this.pivotResultCols?.getPivotResultCols()?.list??[];let i=!0;const r=this.beans,a=this.valueSvc;for(let n=0;n<s.length;n++){const o=s[n],l=o.getColDef();if(l.pivotTotalColumnIds!=null){i=!1;continue}let c,d;const u=l.pivotValueColumn;e.leafGroup?(d=wd(e.childrenMapped,l.pivotKeys),c=XE(a,d,u)):(d=e.childrenAfterFilter,c=JE(d,o.getId())),t[l.colId]=Wt({beans:r,values:c,aggFuncOrString:u.getAggFunc(),column:u,rowNode:e,pivotResultColumn:o,aggregatedChildren:d??[]})}if(!i)for(let n=0;n<s.length;n++){const o=s[n],l=o.getColDef();if(!l.pivotTotalColumnIds?.length)continue;const c=l.pivotTotalColumnIds.map(d=>t[d]);t[l.colId]=Wt({beans:r,values:c,aggFuncOrString:l.pivotValueColumn.getAggFunc(),column:l.pivotValueColumn,rowNode:e,pivotResultColumn:o,aggregatedChildren:e.childrenAfterFilter??[]})}return t}aggregateRowNodeUsingValuesOnly(e,t){const s={},{changedPath:i,valueColumns:r,filteredOnly:a}=t,n=i.active?i.getValueColumnsForNode(e,r):r,o=i.active?i.getNotValueColumnsForNode(e,r):null,l=(a?e.childrenAfterFilter:e.childrenAfterGroup)??[],c=ZE(this.valueSvc,l,n),d=e.aggData,u=this.beans;if(n.forEach((h,p)=>{s[h.getId()]=Wt({beans:u,values:c[p],aggFuncOrString:h.getAggFunc(),column:h,rowNode:e,pivotResultColumn:void 0,aggregatedChildren:l})}),o&&d)for(const h of o)s[h.getId()]=d[h.getId()];return s}getAggregatedChildren(e,t){if(!e?.group||!this.clientSide)return[];if(e.rowPinned){const r=e.pinnedSibling;if(!r)return[];e=r}const s=t?.getColDef(),i=s?.pivotKeys;return i?e.leafGroup&&i.length&&!s.pivotTotalColumnIds?wd(e.childrenMapped,i)??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]:this.isSuppressAggFilteredOnly()?e.childrenAfterGroup??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]}setAggDataWithSiblings(e,t){this.setAggData(e,t);const s=e.pinnedSibling;s&&this.setAggData(s,t);const i=e.sibling;if(i){this.setAggData(i,t);const r=i.pinnedSibling;r&&this.setAggData(r,t)}}setAggData(e,t){const s=e.aggData;if(e.aggData=t,e.__localEventService){const i=r=>{const a=e.aggData?e.aggData[r]:void 0,n=s?s[r]:void 0;if(a===n)return;const o=this.colModel.getColById(r);o&&e.dispatchCellChangedEvent(o,a,n)};if(s)for(const r of Object.keys(s))i(r);if(t)for(const r of Object.keys(t))(!s||!(r in s))&&i(r)}}},XE=(e,t,s)=>{if(!t)return[];const i=t.length,r=new Array(i);for(let a=0;a<i;++a)r[a]=e.getValue(s,t[a],"data");return r},ZE=(e,t,s)=>{const i=s.length,r=new Array(i);for(let n=0;n<i;n++)r[n]=[];const a=t.length;for(let n=0;n<a;n++){const o=t[n];for(let l=0;l<i;l++)r[l].push(e.getValue(s[l],o,"data"))}return r},JE=(e,t)=>{if(!e)return[];const s=e.length,i=new Array(s);for(let r=0;r<s;r++)i[r]=e[r].aggData?.[t];return i},wd=(e,t)=>{if(!t)return;let s=e;for(let i=0;i<t.length&&s;i++)s=s[t[i]];if(Array.isArray(s))return s};import{BeanStub as QE,_getGroupAggFiltering as e0}from"ag-grid-community";var t0=class extends QE{constructor(){super(...arguments),this.beanName="filterAggStage",this.step="filter_aggregates",this.refreshProps=[]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const t=this.beans.colModel.isPivotMode(),s=this.filterManager?.isAggregateFilterPresent()||this.filterManager?.isAggregateQuickFilterPresent(),i=l=>!l.node.group,r=l=>l.node.leafGroup,a=e0(this.gos)||(t?r:i),n=(l,c=!1)=>{if(l.childrenAfterFilter){if(l.childrenAfterAggFilter=l.childrenAfterFilter,c)for(const d of l.childrenAfterAggFilter)n(d,c);this.setAllChildrenCount(l)}l.sibling&&(l.sibling.childrenAfterAggFilter=l.childrenAfterAggFilter)},o=l=>{l.childrenAfterAggFilter=l.childrenAfterFilter?.filter(c=>a({node:c})&&this.filterManager.doesRowPassAggregateFilters({rowNode:c})?(n(c,!0),!0):c.childrenAfterAggFilter?.length)||null,this.setAllChildrenCount(l),l.sibling&&(l.sibling.childrenAfterAggFilter=l.childrenAfterAggFilter)};e.forEachChangedNodeDepthFirst(s?o:n,!0)}setAllChildrenCountTreeData(e){const t=e.childrenAfterAggFilter;let s=0;if(t){const i=t.length;s=i;for(let r=0;r<i;++r)s+=t[r].allChildrenCount??0}e.setAllChildrenCount(s===0&&e.level>=0?null:s)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(s=>{s.group?t+=s.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){if(!e.hasChildren()){e.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)}};import{BeanStub as s0,_addGridCommonParams as i0,_getGrandTotalRow as r0,_getGroupTotalRowCallback as a0,_warn as n0}from"ag-grid-community";import{_createRowNodeSibling as o0}from"ag-grid-community";function Be(e,t){if(e.sibling)return;const s=o0(e,t);s.footer=!0,s.setRowTop(null),s.setRowIndex(null),s.oldRowTop=null,s.id="rowGroupFooter_"+e.id,s.sibling=e,e.sibling=s}function Ya(e){const t=e.sibling;t&&(t._destroy(!1),e.sibling=void 0,t.sibling=void 0)}var l0=class extends s0{constructor(){super(...arguments),this.beanName="footerSvc"}addTotalRows(e,t,s,i,r,a){let n=e;if(r){const c=i&&r0(this.gos);return c0(a,c)&&(Be(t,this.beans),s(t.sibling,n++)),n}const o=a0(this.gos);return(i&&o({node:t}))===a&&(Be(t,this.beans),s(t.sibling,n++)),n}getTopDisplayIndex(e,t,s,i){let r=t;if(e[0].footer){if(t===0)return 0;r-=1}const a=e[e.length-1],n=r>=s.length;return a.footer&&n?a.rowIndex:i(r)}doesCellShowTotalPrefix(e,t){return!e.footer||!t?.getColDef().showRowGroup?!1:this.gos.get("treeData")?!0:e.level===-1?this.beans.showRowGroupCols?.columns[0]===t:!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())}applyTotalPrefix(e,t,s,i){const r=i.getColDef().cellRendererParams?.totalValueGetter;if(r){const a=i0(this.gos,{column:i,node:s,value:e,formattedValue:t});if(typeof r==="function")return r(a);if(typeof r=="string")return this.beans.expressionSvc?.evaluate(r,a);n0(179)}return s.level===-1?this.getLocaleTextFunc()("footerTotal","Total")+" ":this.getTotalValue(t??e)??""}getTotalValue(e){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(e??"")}};function c0(e,t){switch(t){case"top":case"pinnedTop":return e==="top";case"bottom":case"pinnedBottom":return e==="bottom";default:return!1}}import{BaseColsService as d0,_exists as u0,_removeFromArray as h0,_warn as p0}from"ag-grid-community";var xd=class extends d0{constructor(){super(...arguments),this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,s)=>this.setValueActive(t,e,s),add:(e,t,s)=>this.setValueActive(!0,e,s),remove:(e,t,s)=>this.setValueActive(!1,e,s)},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColValueActive(e,t,s),getIndexFunc:()=>{},getInitialIndexFunc:()=>{},getValueFunc:e=>{const t=e.aggFunc;if(t===null||t==="")return null;if(t!==void 0)return!!t},getInitialValueFunc:e=>e.initialAggFunc!=null&&e.initialAggFunc!=""},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>h0(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(const s of this.columns){const i=s.getColDef();i.aggFunc!=null&&i.aggFunc!=""?this.setColAggFunc(s,i.aggFunc):s.getAggFunc()||this.setColAggFunc(s,i.initialAggFunc)}return this.columns}setColumnAggFunc(e,t,s){if(!e)return;const i=this.colModel.getColDefCol(e);i&&(this.setColAggFunc(i,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[i],s))}syncColumnWithState(e,t,s){const i=s("aggFunc").value1;i!==void 0&&(typeof i=="string"?(this.setColAggFunc(e,i),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(u0(i)&&p0(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,s){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,s),e&&!t.getAggFunc()&&this.aggFuncSvc)){const i=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,i)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,s){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",s))}},qa={moduleName:"SharedAggregation",version:D,beans:[IE,AE,l0,xd],apiFunctions:{addAggFuncs:VE,clearAggFuncs:HE,setColumnAggFunc:zE},dependsOn:[B]},Xa={moduleName:"Aggregation",version:D,beans:[qE,t0],rowModels:["clientSide"],dependsOn:[qa]};import{AgColumn as g0,BeanStub as f0,GROUP_HIERARCHY_COLUMN_ID_PREFIX as m0,_addColumnDefaultAndTypes as Fd,_areColIdsEqual as C0,_columnsMatch as Rd,_destroyColumnTree as v0,_removeAllFromArray as S0,_updateColsMap as b0}from"ag-grid-community";import{_MONTHS as Ad,_getDateParts as y0,_parseDateTimeFromString as w0}from"ag-grid-community";var x0=({valueSvc:e,dataTypeSvc:t},s,i)=>{const r=e.getValue(s,i,"data");let a=null;return r instanceof Date?a=r:typeof r=="string"&&(a=(t?.getDateParserFunction(s)??w0)(r)??null),a},et=(e,t,s,i)=>r=>{const a=x0(e,t,r.node),n=y0(a);return n?i?.(n[s])??n[s]:null},tt=({colNames:e},t,s)=>i=>{const r=e.getDisplayNameForColumn(t,i.location);return r?`${r} (${s})`:""},F0=Object.fromEntries(Ad.map(e=>[e,e.toLowerCase()])),R0=e=>{const t=Ad[Number.parseInt(e,10)-1]??e,s=F0[t]??e;return{month:t,localeKey:s}};function Md(e){return e.groupHierarchy??e.rowGroupingHierarchy}var A0=class extends f0{constructor(){super(...arguments),this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.filter(s=>!e.list.some(i=>i.getColId()===s.getColId())).concat(e.list),e.tree=t.tree.filter(s=>!e.tree.some(i=>i.getId()===s.getId())).concat(e.tree),b0(e))}createColumns(e){const t=new WeakMap,s=new WeakMap,i=this.createGroupHierarchyColumns(e,t,s);if(C0(i,this.columns?.list??[]))return;v0(this.beans,this.columns?.tree),this.columns=null;const{colGroupSvc:a}=this.beans,n=a?.findDepth(e.tree)??0,o=a?.balanceTreeForAutoCols(i,n)??[];this.columns={list:i,tree:o,treeDepth:n,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=s}updateColumns(e){}getColumn(e){return this.columns?.list.find(t=>Rd(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){const s=this.getVirtualColumnsForColumn(t).concat(t);for(const i of s)e.some(r=>Rd(r,i)||r.getColId()===i.getColId())||e.push(i)}compareVirtualColumns(e,t){const s=this.inverseColumnMap.get(e),i=this.inverseColumnMap.get(t);if(s&&s===i){const r=this.sourceColumnMap.get(s)??[];return r?.indexOf(e)-r?.indexOf(t)}return this.sourceColumnMap.get(e)?.includes(t)?1:this.sourceColumnMap.get(t)?.includes(e)?-1:null}insertVirtualColumnsForCol(e,t){const s=this.getVirtualColumnsForColumn(t);if(!s)return[];let i=e.indexOf(t);return i<0&&(i=e.length-1),S0(e,s),e.splice(i,0,...s),s}getVirtualColumnsForColumn(e){return this.isGroupHierarchyColsEnabledForCol(e)?this.sourceColumnMap.get(e)??[]:[]}isGroupHierarchyColsEnabled(e){return e.list.some(t=>this.isGroupHierarchyColsEnabledForCol(t))}isGroupHierarchyColsEnabledForCol(e){const t=e.getColDef();return!!(Md(t)&&(t.rowGroup||t.enableRowGroup||t.rowGroupIndex!=null||t.pivot||t.enablePivot||t.pivotIndex!=null))}createGroupHierarchyColDefs(e){const t=[],s=e.getColDef(),i=Md(s);if(!i||!this.isGroupHierarchyColsEnabledForCol(e))return t;for(const r of i){let a=null;typeof r=="string"?a=this.createColDefForPart(r,e,s):a=r,a&&t.push(a)}return t}createGroupHierarchyColumns(e,t,s){if(!this.isGroupHierarchyColsEnabled(e))return[];const i=[];for(const r of e.list)for(const a of this.createGroupHierarchyColDefs(r)){const n=a.colId;this.gos.validateColDef(a,n,!0);const o=new g0(a,null,n,!0);this.createBean(o),i.push(o),M0(t,r,o),s.set(o,r)}return i}createColDefForPart(e,t,s){const{beans:i,gos:r}=this,a=`${m0}-${t.getColId()}-${e}`,n={enableRowGroup:s.enableRowGroup,rowGroup:s.rowGroup,enablePivot:s.enablePivot,hide:!0,editable:!1},o=r.get("groupHierarchyConfig")??{};if(e in o){const u={...n,...o[e]};return u.colId??(u.colId=a),Fd(i,u,u.colId,!0)}const l=Fd(i,{colId:a,...n},a,!0),c=this.getLocaleTextFunc(),d=(u,h)=>c?.(u,h)??h;switch(e){case"year":return{...l,headerValueGetter:tt(i,t,d(e,"Year")),valueGetter:et(i,t,0)};case"quarter":return{...l,headerValueGetter:tt(i,t,d(e,"Quarter")),valueGetter:et(i,t,1,u=>(Math.floor(Number(u)/4)+1).toString())};case"month":return{...l,headerValueGetter:tt(i,t,d(e,"Month")),valueGetter:et(i,t,1)};case"formattedMonth":return{...l,headerValueGetter:tt(i,t,d("month","Month")),valueGetter:et(i,t,1,u=>{const h=R0(u);return d(h.localeKey,h.month)})};case"day":return{...l,headerValueGetter:tt(i,t,d(e,"Day")),valueGetter:et(i,t,2)};case"hour":return{...l,headerValueGetter:tt(i,t,d(e,"Hour")),valueGetter:et(i,t,3)};case"minute":return{...l,headerValueGetter:tt(i,t,d(e,"Minute")),valueGetter:et(i,t,4)};case"second":return{...l,headerValueGetter:tt(i,t,d(e,"Second")),valueGetter:et(i,t,5)};default:return null}}};function M0(e,t,s){const i=e.get(t);e.set(t,(i??[]).concat(s))}var T0={moduleName:"GroupHierarchy",version:D,beans:[A0]};import{BaseColsService as P0,_removeFromArray as I0}from"ag-grid-community";var Td=class extends P0{constructor(){super(...arguments),this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,s)=>this.setColPivotActive(e,t,s),add:(e,t,s)=>this.setColPivotActive(e,!0,s),remove:(e,t,s)=>this.setColPivotActive(e,!1,s)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColPivotActive(e,t,s),getIndexFunc:e=>e.pivotIndex,getInitialIndexFunc:e=>e.initialPivotIndex,getValueFunc:e=>e.pivot,getInitialValueFunc:e=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>I0(this.columns,e)}}syncColumnWithState(e,t,s,i){const{value1:r,value2:a}=s("pivot","pivotIndex");(r!==void 0||a!==void 0)&&(typeof a=="number"||r?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof a=="number"&&(i[e.getId()]=a)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,s){e.pivotActive!==t&&(e.pivotActive=t,t&&this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach(r=>this.setColPivotActive(r,t,s)),e.dispatchColEvent("columnPivotChanged",s)),e.dispatchStateUpdatedEvent("pivot")}};import{BaseColsService as E0,_removeFromArray as D0,_shouldUpdateColVisibilityAfterGroup as L0}from"ag-grid-community";var k0=class extends E0{constructor(){super(...arguments),this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,s)=>this.setActive(t,e,s),add:(e,t,s)=>this.setActive(!0,e,s),remove:(e,t,s)=>this.setActive(!1,e,s)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColRowGroupActive(e,t,s),getIndexFunc:e=>e.rowGroupIndex,getInitialIndexFunc:e=>e.initialRowGroupIndex,getValueFunc:e=>e.rowGroup,getInitialValueFunc:e=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>D0(this.columns,e)}}moveColumn(e,t,s){if(this.columns.length===0)return;const i=this.columns[e],r=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,i),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:r,column:r.length===1?r[0]:null,source:s})}syncColumnWithState(e,t,s,i){const{value1:r,value2:a}=s("rowGroup","rowGroupIndex");(r!==void 0||a!==void 0)&&(typeof a=="number"||r?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof a=="number"&&(i[e.getId()]=a)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,s){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,s);const i=this.beans.groupHierarchyColSvc?.getColumn(t);L0(this.gos,e)&&!i&&this.colModel.setColsVisible([t],!e,s)}setColRowGroupActive(e,t,s){e.rowGroupActive!==t&&(e.rowGroupActive=t,t&&this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach(r=>this.setColRowGroupActive(r,t,s)),e.dispatchColEvent("columnRowGroupChanged",s)),e.dispatchStateUpdatedEvent("rowGroup")}};import{AgColumn as G0,BeanStub as O0,GROUP_AUTO_COLUMN_ID as Pd,_addColumnDefaultAndTypes as _0,_applyColumnState as N0,_areColIdsEqual as B0,_columnsMatch as V0,_convertColumnEventSourceType as H0,_destroyColumnTree as Id,_getColumnStateFromColDef as z0,_isColumnsSortingCoupledToGroup as U0,_isGroupMultiAutoColumn as W0,_isGroupUseEntireRow as K0,_mergeDeep as $0,_missing as Za,_updateColsMap as j0,_warn as Y0,isColumnGroupAutoCol as q0}from"ag-grid-community";var X0=class extends O0{constructor(){super(...arguments),this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this))}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),j0(e))}createColumns(e,t,s){const i=this.beans,{colModel:r,gos:a,rowGroupColsSvc:n,colGroupSvc:o}=i,l=r.isPivotMode(),c=K0(a,l),d=l?a.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),u=n?.columns,p=!(u&&u.length>0||a.get("treeData"))||d||c,g=()=>{this.columns&&(Id(i,this.columns.tree),this.columns=null)};if(p){g();return}const f=this.generateAutoCols(u),m=B0(f,this.columns?.list||null),C=e.treeDepth,S=(this.columns?this.columns.treeDepth:-1)==C;if(m&&S){const M=new Map(f.map(T=>[T.getId(),T]));for(const T of this.columns?.list??[]){const F=M.get(T.getId());F&&T.setColDef(F.getColDef(),null,s)}return}g();const b=o?.findDepth(e.tree)??0,y=o?.balanceTreeForAutoCols(f,b)??[];this.columns={list:f,tree:y,treeDepth:b,map:{}},t(M=>{if(!M)return null;const T=M.filter(F=>!q0(F));return[...f,...T]})}updateColumns(e){const t=H0(e.source);this.columns?.list.forEach((s,i)=>this.updateOneAutoCol(s,i,t))}getColumn(e){return this.columns?.list.find(t=>V0(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){const t=[],{gos:s}=this,i=s.get("treeData");let r=W0(s);return i&&r&&(Y0(182),r=!1),r?e.forEach((a,n)=>{t.push(this.createOneAutoCol(a,n))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){const e=this.gos;return e.get("groupDisplayType")==="custom"?!0:e.get("treeDataDisplayType")==="custom"}createOneAutoCol(e,t){let s;e?s=`${Pd}-${e.getId()}`:s=Pd;const i=this.createAutoColDef(s,e,t);i.colId=s;const r=new G0(i,null,s,!0);return this.createBean(r),r}updateOneAutoCol(e,t,s){const i=e.getColDef(),r=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,a=this.beans,n=r!=null?a.colModel.getColDefCol(r):void 0,o=e.getId(),l=this.createAutoColDef(o,n??void 0,t);e.setColDef(l,null,s),N0(a,{state:[z0(l,o)]},s)}createAutoColDef(e,t,s){let i=this.createBaseColDef(t);const r=this.gos.get("autoGroupColumnDef");$0(i,r),i=_0(this.beans,i,e,!0),this.gos.get("treeData")||Za(i.field)&&Za(i.valueGetter)&&Za(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),s&&s>0&&(i.headerCheckboxSelection=!1);const a=U0(this.gos),n=i.valueGetter||i.field!=null;return a&&!n&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:e?.getColId()??!0};return t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e&&(i.headerName=this.beans.colNames.getDisplayNameForColumn(e,"header")??void 0,i.headerValueGetter=e.colDef.headerValueGetter),i}destroy(){Id(this.beans,this.columns?.tree),super.destroy()}};import{_exists as Z0}from"ag-grid-community";import{BeanStub as J0,_createGlobalRowEvent as Q0,_setAriaExpanded as eD}from"ag-grid-community";var Ed=class extends J0{addExpandedCss(e,t){t.isExpandable()&&(e.push("ag-row-group"),e.push(t.expanded?"ag-row-group-expanded":"ag-row-group-contracted"))}getRowExpandedListeners(e){const{rowNode:t}=e,s=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:s,hasChildrenChanged:s}}setExpanded(e,t,s,i){if(e.expanded===t)return;e.expanded=t,e.dispatchRowEvent("expandedChanged");const r={...Q0(e,this.gos,"rowGroupOpened"),expanded:t,event:s||null};this.dispatchExpandedEvent(r,i)}isExpandable(e){return e.footer?!1:this.beans.colModel.isPivotMode()?e.hasChildren()&&!e.leafGroup:e.hasChildren()||e.master}updateExpandedCss(e,t){const s=t.isExpandable(),i=t.expanded==!0;e.forEachGui(void 0,r=>{const a=r.rowComp;a.toggleCss("ag-row-group",s),a.toggleCss("ag-row-group-expanded",s&&i),a.toggleCss("ag-row-group-contracted",s&&!i),eD(r.element,s&&i)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},tD=class extends Ed{constructor(){super(...arguments),this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(e){const t=new Set(e.expandedRowGroupIds);this.beans.rowModel.forEachNode(s=>{const i=s.id;i&&(s.expanded=t.has(i))}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(e=!1){const t=[],s=[];return this.beans.rowModel.forEachNode(i=>{const r=i.id;r&&(i.expanded?t.push(r):e&&i.isExpandable()&&s.push(r))}),{expandedRowGroupIds:t,collapsedRowGroupIds:s}}getExpansionState(){return this.getInternalExpansionState()}expandAll(e){const{gos:t,rowModel:s,colModel:i,eventSvc:r}=this.beans,a=t.get("treeData"),n=i.isPivotActive(),o=c=>{if(c)for(const d of c){const u=()=>{d.expanded=e,o(d.childrenAfterGroup)};if(d.master){u();continue}if(a){Z0(d.childrenAfterGroup)&&u();continue}if(n){!d.leafGroup&&u();continue}d.group&&u()}},l=s.rootNode;l&&o(l.childrenAfterGroup),this.onGroupExpandedOrCollapsed(),r.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(e){const t=this.getInternalExpansionState(!0),s=t.collapsedRowGroupIds.length===0;if(t.expandedRowGroupIds.length===0!==s)return s?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??(this.events=[])).push(e),t){this.dispatchExpandedEvents();return}let s=this.dispatchExpandedDebounced;if(!s){if(!this.isAlive())return;s=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=s}s()}dispatchExpandedEvents(){const{eventSvc:e,rowRenderer:t}=this.beans,s=this.events,i=s?.length;if(!i)return;this.events=null;const r=new Array(i);for(let a=0;a<i;++a)r[a]=s[a].node,e.dispatchEvent(s[a]);this.dispatchStateUpdatedEvent(),t.refreshCells({rowNodes:r})}debounce(e){const t=this.beans.animationFrameSvc;if(!t)return()=>window.setTimeout(e,0);let s=!1;return()=>{if(!t.active){window.setTimeout(e,0);return}s||(s=!0,t.addDestroyTask(()=>{s=!1,e()}))}}};import{BeanStub as sD}from"ag-grid-community";import{_getGrandTotalRow as iD,_getGroupTotalRowCallback as rD,_isGroupMultiAutoColumn as aD}from"ag-grid-community";function Dd(e){let t=e.get("groupHideParentOfSingleChild");return t||(t=e.get("groupRemoveSingleChildren"),!t&&e.get("groupRemoveLowestSingleChildren")&&(t="leafGroupsOnly")),{groupHideParentOfSingleChild:t,isGroupMultiAutoColumn:aD(e),hideOpenParents:e.get("groupHideOpenParents"),grandTotalRow:iD(e),groupTotalRow:rD(e)}}function Ld(e,t,s){return e.groupHideParentOfSingleChild===!0&&s&&t.childrenAfterGroup.length===1}function kd(e,t,s){return e.groupHideParentOfSingleChild==="leafGroupsOnly"&&s&&t.leafGroup&&t.childrenAfterGroup.length===1}function Gd(e,t,s,i,r,a){const n=i&&!s,o=i&&t.leafGroup,l=e.hideOpenParents&&t.expanded&&!t.master&&!o;return!n&&!l&&!r&&!a}var nD=class extends sD{constructor(){super(...arguments),this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){const{beans:e,gos:t}=this,s=[],i=e.rowModel.rootNode;if(!i)return s;const r=e.colModel.isPivotMode(),a=r&&i.leafGroup&&i.aggData,n=a?[i]:i.childrenAfterSort,o=Dd(t);this.recursivelyAddToRowsToDisplay(o,n,s,r,0);const l=s.length>0,c=o.grandTotalRow;if(!a&&l&&c)if(Be(i,e),c==="pinnedBottom"||c==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(c==="pinnedBottom"?"bottom":"top");else{const u=c==="top";this.addRowNodeToRowsToDisplay(o,i.sibling,s,0,u)}return s}recursivelyAddToRowsToDisplay(e,t,s,i,r){if(!t?.length)return;const a=this.beans.masterDetailSvc;for(let n=0;n<t.length;n++){const o=t[n],l=o.hasChildren(),c=Ld(e,o,l),d=kd(e,o,l);if(Gd(e,o,l,i,c,d)&&this.addRowNodeToRowsToDisplay(e,o,s,r),!(i&&o.leafGroup))if(l){const h=c||d;if(o.expanded||h){const p=e.groupTotalRow({node:o});p||Ya(o);const g=h?r:r+1;p==="top"&&(Be(o,this.beans),this.addRowNodeToRowsToDisplay(e,o.sibling,s,g));const f=a?.getDetail(o);f&&this.addRowNodeToRowsToDisplay(e,f,s,r),this.recursivelyAddToRowsToDisplay(e,o.childrenAfterSort,s,i,g),p==="bottom"&&(Be(o,this.beans),this.addRowNodeToRowsToDisplay(e,o.sibling,s,g))}}else{const h=a?.getDetail(o);h&&this.addRowNodeToRowsToDisplay(e,h,s,r)}}}addRowNodeToRowsToDisplay(e,t,s,i,r){r?s.unshift(t):s.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:i)}};import{BeanStub as oD,ChangedPath as lD,_ChangedRowNodes as Od,_csrmFirstLeaf as cD,_csrmReorderAllLeafs as dD,_getCellByPosition as uD,_isClientSideRowModel as hD,_prevOrNextDisplayedRow as pD}from"ag-grid-community";var gD=class extends oD{constructor(){super(...arguments),this.beanName="groupEditSvc",this.pendingEditRefresh=null,this.dropGroupTarget=null,this.dropGroupTimer=null,this.dropGroupThrottled=!1,this.draggingGroups=null}postConstruct(){hD(this.gos)&&this.addManagedListeners(this.eventSvc,{cellValueChanged:e=>this.onCsrmCellChange(e),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(e){return!e.rowDragManaged||!e.sameGrid||!this.gos.get("refreshAfterGroupEdit")?!1:!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(e){const t=new Map,s=i=>{const r=i.childrenAfterGroup;if(r){if(t.has(i))return;const a=r.slice();t.set(i,a);for(const n of a)s(n)}};for(const i of e.rows)i.group&&s(i);this.draggingGroups=t}canSetParent(e){return e.sameGrid?this.beans.groupStage?.treeData?!0:e.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit")?!1:!!this.beans.rowGroupColsSvc?.columns?.length:!1}canDropRow(e,t){if(this.beans.groupStage?.treeData)return!fD(e,t.newParent);const{position:s,target:i,newParent:r,rootNode:a}=t,n=e.parent;if(e.group&&(Nd(e,i)||Nd(e,r)))return!1;if(s==="inside")return!0;if(r&&r!==n)return r!==a||n===a;const o=r??i?.parent??a;if(o!==n)return!1;const l=e.group?e.level:n.level??-1;let c=-1;return i?c=i.group?i.level:i.parent?.level??-1:o&&(c=o.level),!(l>=0&&c>=0&&c!==l)}fixRowsDrop(e,t,s,i){const r=!!this.beans.groupStage?.treeData;if(e.treeData=r,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!r)return;!this.draggingGroups&&this.isGroupingDrop(e)&&!e.suppressMoveWhenRowDragging&&this.initDraggingGroups(e);let n=e.target,o=null,l=!1;const c=e.rootNode,d=this.beans.rowModel,u=this.canStartGroup(n,r);this.updateDropTarget(e,s,u);const h=this.beans.pageBounds?.getLastRow?.()??d.getRowCount()-1;if(t&&(!n||i>=.5&&n.rowIndex===h?o=c:e.moved&&n&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(e)&&(o=n),o||(o=n?.parent??c)),!s&&n&&u&&!(n.group&&n.expanded)&&this.startDropGroupDelay(n),o){if(n&&o===n&&o!==c){const p=o.expanded?pD(d,1,n):null;p?.parent===o?(n=p,i=-.5):l=!0}if(n&&!l){let p=n;for(;p&&p!==c&&p!==o;)n=p,p=p.parent}}e.target=n,e.newParent=o,e.yDelta=i,e.inside=l}clearNewSameParent(e,t){const s=e.newParent;s&&(!t||mD(e.rows,s))&&(e.newParent=null)}updateDropTarget(e,t,s){const i=s?e.target:null;this.dropGroupTarget&&this.dropGroupTarget!==i&&this.resetDragGroup(),i?.childrenAfterSort?.length&&(t&&this.dropGroupThrottled&&!i.expanded&&i.isExpandable?.()&&i.setExpanded(!0,void 0,!0),this.canDropInTarget(i,e)&&(this.dropGroupThrottled=!0,this.dropGroupTarget=i))}canDropInTarget(e,t){if(e.expanded)return!0;if(!e.group)return!1;if(t.pointerPos==="inside")return!0;if(t.treeData)return!1;const s=t.rows,i=e.level;for(let r=0,a=s.length;r<a;++r){const n=s[r];if(n!==e&&n.group&&n.level!==i)return!1}return!0}startDropGroupDelay(e){if(this.dropGroupTarget&&this.dropGroupTarget!==e&&this.resetDragGroup(),this.dropGroupTarget=e,this.dropGroupTimer!==null)return;const t=this.gos.get("rowDragInsertDelay");this.dropGroupTimer=window.setTimeout(()=>{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},t)}resetDragGroup(){this.dropGroupTimer!==null&&(window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null),this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(e){e&&(this.draggingGroups=null),this.resetDragGroup()}shouldDropTargetBeParent({target:e,rows:t,pointerPos:s,treeData:i}){if(!e||s==="none")return!1;if(s==="inside"||!i&&e.group&&!e.expanded)return!0;if(s==="above")return!1;const r=this.beans.rowModel;let n=e.rowIndex+1,o;do o=r.getRow(n++);while(o?.footer);const l=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(o&&o.parent===e&&l?.length){const c=new Set(t);for(let d=0,u=l.length;d<u;++d){const h=l[d];if(h.rowIndex!==null&&!c.has(h))return!0}}return!1}dropGroupEdit(e){const{beans:t}=this,s=e.position,i=e.target??null,r=e.rootNode,a=e.newParent??i?.parent??r,n=t.focusSvc,o=n.getFocusedCell(),l=o&&uD(t,o),c=new Set,d=new Od,u=d.updates;let h;const p=v=>{c.has(v)||(c.add(v),h??(h=this.newGroupValues(a)),this.setRowGroup(v,h)&&u.add(v))},g=v=>{const S=this.draggingGroups?.get(v)??v.childrenAfterGroup,b=S?.length;if(b)for(let y=0;y<b;++y){const w=S[y];w.sourceRowIndex>=0?p(w):g(w)}};for(const v of e.rows)if(v.group)g(v);else{const S=v.sourceRowIndex>=0&&!v.destroyed?v:this.csrmFirstLeaf(v);S&&p(S)}const f=s==="inside"?"above":s,m=s==="inside"?this.findFirstLeafForParent(a,c)??i:i;let C=!1;if(c.size&&f!=="none"&&(C=dD(r._leafs,c,m,f==="above")),!u.size&&!C)return!1;d.reordered=C;for(const v of c)d.updates.add(v);return this.csrmRefresh(d),l?l.focusCell():n.clearFocusedCell(),!0}canStartGroup(e,t){return!e||e.level<0||e.footer||e.detail?!1:e.group?!0:t}flushGroupEdits(){const e=this.pendingEditRefresh;e&&(this.pendingEditRefresh=null,this.csrmRefresh(e))}csrmRefresh(e){const t=this.beans.rowModel,s=t.rootNode;s&&t.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedPath:new lD(!1,s),changedRowNodes:e})}newGroupValues(e){const t=this.beans.rowGroupColsSvc?.columns??[],s=new Array(t.length);let i=-1,r=e;for(;r&&r.level>=0;){const a=t[r.level];if(a){const n=a.getColId(),o=r.level;s[o]=r.groupData?.[n]??r.key??void 0,o>i&&(i=o)}r=r.parent}return{values:s,columns:t,maxLevel:i}}setRowGroup(e,{values:t,columns:s,maxLevel:i}){if(i<0)return!1;const{valueSvc:r}=this.beans;let a=!1;for(let n=0;n<s.length;++n){const o=s[n];if(!o||n>i)continue;const l=t[n],c=r.getValue(o,e,"data");if(c===l||c==null&&l==null)continue;let d=l;const u=r.parseValue(o,e,l,c);u!==void 0&&(d=u),e.setDataValue(o,d,"rowDrag")&&(a=!0)}return a}onCsrmCellChange(e){const{column:t,node:s,source:i}=e;if(!this.gos.get("refreshAfterGroupEdit")||i==="rowDrag"||!t?.isRowGroupActive()||s.group||!s.data)return;if(this.beans.editSvc?.isBatchEditing()){let a=this.pendingEditRefresh;a||(a=_d(),this.pendingEditRefresh=a),a.updates.add(s)}else{const a=_d();a.updates.add(s),this.csrmRefresh(a)}}csrmFirstLeaf(e){if(!e)return null;const t=this.draggingGroups;let s=t?.get(e)??e.childrenAfterGroup;for(;s?.length;){const i=s[0];if(i.sourceRowIndex>=0)return i.destroyed?this.firstAliveChildLeaf(i):i;s=t?.get(i)??i.childrenAfterGroup}return cD(e)}firstAliveChildLeaf(e){const t=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(t){for(const s of t)if(s.sourceRowIndex>=0&&!s.destroyed)return s}return null}findFirstLeafForParent(e,t){if(!e)return null;const s=this.draggingGroups?.get(e)??e?.childrenAfterGroup;if(!s)return null;for(let i=0,r=s.length;i<r;++i){const a=s[i];if(a.sourceRowIndex>=0&&!t.has(a))return a;const n=this.findFirstLeafForParent(a,t);if(n!==null)return n}return null}},_d=()=>{const e=new Od;return e.reordered=!0,e},Nd=(e,t)=>{if(!e||!t)return!1;let s=t;for(;s;){if(s===e)return!0;s=s.parent}return!1},fD=(e,t)=>{if(!t||e.parent===t)return!1;let s=t;const i=e.id;for(;s;){if(s===e||i!=null&&s.id===i)return!0;s=s.parent}return!1},mD=(e,t)=>{for(let s=0,i=e.length;s<i;++s)if(e[s].parent!==t)return!1;return!0};import{BeanStub as CD}from"ag-grid-community";var vD=class extends CD{constructor(){super(...arguments),this.beanName="groupStage",this.step="group",this.refreshProps=["groupAllowUnbalanced","groupDefaultExpanded","groupDisplayType","groupHideOpenParents","initialGroupOrderComparator","treeData","treeDataChildrenField","treeDataParentIdField"],this.treeData=!1,this.hasTreeData=!1,this.needReset=!1,this.nested=!1,this.strategy=void 0}postConstruct(){const e=this.gos;e.isModuleRegistered("TreeData")&&(this.hasTreeData=!0,this.treeData=e.get("treeData")),this.addManagedEventListeners({showRowGroupColsSetChanged:()=>this.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(e){return this.strategy?.nonLeafsById?.get(e)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(e){const t=this.gos,s=this.strategy?.nestedDataGetter;if(e.has("treeData")){const i=t.get("treeData")&&this.hasTreeData;this.treeData!==i&&(this.beans.rowDragSvc?.cancelRowDrag(),this.treeData=i,this.needReset=!0,this.strategy=this.destroyBean(this.strategy))}return this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==s}extractData(){const e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get("rowData")??[];const s=t.length,i=new Array(s);let r=0;for(let a=0;a<s;++a){const n=t[a].data;n!=null&&(i[r++]=n)}return i.length=r,i}execute(e){const t=this.beans,s=t.rowModel.rootNode;if(!s)return!1;const i=this.getStrategy(),r=!!i?.nestedDataGetter,a=this.needReset;return this.nested=r,a&&(this.needReset=!1,t.rowDragSvc?.cancelRowDrag(),e.animate=!1,bD(s,!r)),i?i.execute(s,e)||a:void 0}loadLeafs(e){return e.footer?SD(e):Wi(e)}loadGroupData(e){const t=this.getStrategy();return t?t.loadGroupData(e):(e._groupData=null,null)}clearNonLeafs(){this.strategy?.clearNonLeafs()}getStrategy(){let e=this.strategy;return e!==void 0&&this.isAlive()||(e=this.beans.registry.createDynamicBean(this.treeData?"treeGroupStrategy":"groupStrategy",!1)??null,this.strategy=e&&this.createBean(e)),e}},SD=e=>{const t=e.sibling;if(!t)return null;const s=t._leafs;return s!==void 0?s:Wi(t)},Wi=e=>{const t=e.childrenAfterGroup,s=t?.length;if(e._leafs=null,!s)return null;let i;const r=s===1?t[0]:null;if(r?.group&&r.sourceRowIndex<0)i=r._leafs,i===void 0&&(i=Wi(r));else if(e.leafGroup)i=t;else{i=[];for(let a=0;a<s;++a){const n=t[a];if(n.sourceRowIndex>=0&&i.push(n),!n.group)continue;let o=n._leafs;if(o===void 0&&(o=Wi(n)),o)for(let l=0,c=o.length;l<c;++l)i.push(o[l])}}return e._leafs=i,i},bD=(e,t)=>{const s=e._leafs,i=e.sibling;e.treeNodeFlags=0,e.childrenAfterGroup=s,e.childrenMapped=null,e._groupData=void 0,i&&(i.childrenAfterGroup=e.childrenAfterGroup,i.childrenAfterAggFilter=e.childrenAfterAggFilter,i.childrenAfterFilter=e.childrenAfterFilter,i.childrenAfterSort=e.childrenAfterSort,i.childrenMapped=null,i._groupData=void 0);for(let r=0,a=s.length??0;r<a;++r){const n=s[r],o=n.sibling;n._leafs=void 0,Bd(n),o&&Bd(o),n.parent=e,t&&(n.treeParent=null),n.group=!1,n.updateHasChildren()}e.updateHasChildren()},Bd=e=>{e.key=null,e.treeNodeFlags=0,e.allChildrenCount=null,e.childrenAfterGroup=null,e.childrenAfterAggFilter=null,e.childrenAfterFilter=null,e.childrenAfterSort=null,e.childrenMapped=null,e.level=0,e._groupData=void 0};import{Component as yD,RefPlaceholder as _s,_setAriaRole as wD,_setDisplayed as Vd}from"ag-grid-community";import{BeanStub as xD,KeyCode as FD,_createIconNoSpan as RD,_getCellRendererDetails as Hd,_getCheckboxLocation as AD,_getCheckboxes as MD,_getInnerCellRendererDetails as Ki,_isElementInEventPath as zd,_isRowSelection as TD,_isStopPropagationForAgGrid as Ud,_removeAriaExpanded as PD,_setAriaExpanded as ID,_stopPropagationForAgGrid as ED}from"ag-grid-community";function Wd(e,t,s){let i=e;const r=i.level-t.level;if(r<=0||!s.get("groupHideOpenParents"))return!1;for(let n=0;n<r;n++){if(!(i.parent?.getFirstChild()===i))return!1;i=i.parent}return i===t}var Ja=(e,t,s,i=t.group)=>{const r=e.gos,a=i&&r.get("isGroupOpenByDefault");if(!a){const o=r.get("groupDefaultExpanded");return o===-1||s<o}const n={api:e.gridApi,context:e.gridOptions.context,rowNode:t,field:t.field,key:t.key,level:s,rowGroupColumn:t.rowGroupColumn};return a(n)==!0},Kd=class extends xD{constructor(){super(...arguments),this.indentClass=null}init(e,t,s,i,r,a,n){this.params=n,this.eGui=t,this.eCheckbox=s,this.eExpanded=i,this.eContracted=r,this.comp=e,this.compClass=a;const{node:o,column:l}=n;if(this.node=o,this.displayedNode=o,!this.isEmbeddedRowMismatch()){if(o.footer){this.initFooterCell();return}if(!l){this.initFullWidthCell();return}this.displayedNode=this.beans.showRowGroupColValueSvc?.getDisplayedNode(o,l)??this.node,this.setupExpand(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}}initFooterCell(){const{node:e}=this.params;this.addGroupValue(),this.setupIndent(),e.level===-1||this.comp.toggleCss("ag-row-group-leaf-indent",!0)}initFullWidthCell(){const e=()=>{const{rowDragSvc:t}=this.beans;if(!this.params.rowDrag||!t)return;const s=t.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(s),this.eGui.insertAdjacentElement("afterbegin",s.getGui())};this.setupExpand(),e(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){const e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const{visibleCols:e}=this.beans,t=this.params.pinned==="left",s=this.params.pinned==="right",i=!t&&!s;return this.gos.get("enableRtl")?e.isPinningLeft()?!s:!i:e.isPinningLeft()?!t:!i}addGroupValue(){const{params:{value:e,valueFormatted:t}}=this,s=this.getInnerCompDetails();this.comp.setInnerRenderer(s,t??e??null)}setupExpand(){const{colModel:e}=this.beans,{eGridCell:t,column:s,suppressDoubleClickExpand:i}=this.params,r=(c,d)=>{const u=RD(c,this.beans,null);u&&(d.appendChild(u),this.addDestroyFunc(()=>u.remove()))};r("groupExpanded",this.eExpanded),r("groupContracted",this.eContracted);const a=this.comp,n=()=>{if(!this.isExpandable())return;const d=this.displayedNode.expanded;a.setExpandedDisplayed(d),a.setContractedDisplayed(!d),ID(t,!!this.displayedNode.expanded)},o=()=>{const c=this.isExpandable();a.toggleCss("ag-cell-expandable",c),a.toggleCss("ag-row-group",c);const d=!c&&e.isPivotMode();a.toggleCss("ag-pivot-leaf-group",d);const u=!e.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);a.toggleCss("ag-row-group-leaf-indent",!c&&u);const h=this.getChildCount(),p=h>0?`(${h})`:"";a.setChildCount(p),c?n():(a.setExpandedDisplayed(!1),a.setContractedDisplayed(!1),PD(t))};(()=>{!(s?.isCellEditable(this.displayedNode)&&this.gos.get("enableGroupEdit"))&&!i&&this.addManagedListeners(t,{dblclick:this.onCellDblClicked.bind(this)}),this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:o,masterChanged:o,groupChanged:o,hasChildrenChanged:o,expandedChanged:n})})(),o()}getInnerCompDetails(){const{userCompFactory:e,findSvc:t}=this.beans,s=this.params;if(s.fullWidth){const l=this.gos.get("groupRowRendererParams"),c=Ki(e,l,s);return c||(t?.isMatch(s.node,null)?Ki(e,{...l,innerRenderer:"agFindCellRenderer"},s):void 0)}const i=l=>l&&l.componentClass==this.compClass,r=Ki(e,s,s);if(r&&!i(r))return r;const{displayedNode:{rowGroupColumn:a}}=this,n=a?.colDef,o=a&&s.column?.isRowGroupDisplayed(a.getId());if(n&&o){const l=Hd(e,n,s);if(l)if(i(l)){if(n?.cellRendererParams?.innerRenderer)return Ki(e,n.cellRendererParams,s)}else return l}if(t?.isMatch(s.node,s.column))return Hd(e,{...n??s.colDef,cellRenderer:"agFindCellRenderer"},s)}getChildCount(){const{column:e,suppressCount:t}=this.params;if(t)return 0;const{allChildrenCount:s,rowGroupColumn:i}=this.displayedNode;return!((s??0)>0&&(!i||!e||e?.isRowGroupDisplayed(i.getId())))||this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!Wd(this.node,this.displayedNode,this.gos)?0:s??0}isExpandable(){const{node:e,column:t,colDef:s}=this.params;if(!this.displayedNode.isExpandable()||e.rowPinned)return!1;if(!t)return!0;if(e.hasChildren()&&s){const{showRowGroup:a}=s;if(!a)return!1;if(a===!0)return!0}return e===this.displayedNode?e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())?!0:e.master?s?.showRowGroup===!0||s?.showRowGroup==null:!1:Wd(this.node,this.displayedNode,this.gos)}setupIndent(){const{suppressPadding:e,node:t,colDef:s}=this.params;if(e)return;const i=()=>{let r=t.uiLevel;s&&s.showRowGroup!==!0&&(r=0);const a="ag-row-group-indent-"+r;a!==this.indentClass&&(this.indentClass&&this.comp.toggleCss(this.indentClass,!1),this.indentClass=a,this.comp.toggleCss(a,!0),this.eGui.style.setProperty("--ag-indentation-level",String(r)))};this.addManagedListeners(t,{uiLevelChanged:i.bind(this)}),i()}setupCheckbox(){const{node:e}=this.params;!e.footer&&!e.rowPinned&&!e.detail&&(this.addManagedPropertyListener("rowSelection",({currentValue:s,previousValue:i})=>{const r=typeof s=="object"?s:void 0,a=typeof i=="object"?i:void 0;r?.checkboxLocation!==a?.checkboxLocation&&(this.destroyCheckbox(),this.addCheckbox())}),this.addCheckbox())}addCheckbox(){const{selectionSvc:e}=this.beans;if(!e||!TD(this.gos))return;const{node:t,column:s}=this.params,i=this.gos.get("rowSelection"),r=AD(i);if(r==="selectionColumn")return;if(r==="autoGroupColumn"){const c=s?.getColDef().showRowGroup!=null,d=!s&&t.group;if(!(c||d))return}const a=typeof i=="object"?MD(i):this.params.checkbox;if(!(typeof a=="function"||a===!0))return;if(typeof s?.getColDef().showRowGroup=="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}const l=e.createCheckboxSelectionComponent();this.cbComp=l,this.createBean(l),l.init({rowNode:t,column:s,overrides:{isVisible:a,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(l.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}onExpandClicked(e){Ud(e)||(ED(e),this.onExpandOrContract(e))}onKeyDown(e){!(e.key===FD.ENTER)||this.params.suppressEnterExpand||this.params.column?.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(Ud(e))return;zd(this.eExpanded,e)||zd(this.eContracted,e)||this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;const t=this.displayedNode,s=!t.expanded;!s&&t.sticky&&this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop),t.setExpanded(s,e)}destroy(){super.destroy(),this.destroyCheckbox()}},DD={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},$d=class extends yD{constructor(){super(DD),this.eExpanded=_s,this.eContracted=_s,this.eCheckbox=_s,this.eValue=_s,this.eChildCount=_s}init(e){const t={setInnerRenderer:(a,n)=>this.setRenderDetails(a,n),setChildCount:a=>this.eChildCount.textContent=a,toggleCss:(a,n)=>this.toggleCss(a,n),setContractedDisplayed:a=>Vd(this.eContracted,a),setExpandedDisplayed:a=>Vd(this.eExpanded,a),setCheckboxVisible:a=>this.eCheckbox.classList.toggle("ag-invisible",!a),setCheckboxSpacing:a=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",a)},s=this.createManagedBean(new Kd),i=!e.colDef,r=this.getGui();s.init(t,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),i&&wD(r,s.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(s=>{if(!s)return;const i=()=>this.destroyBean(s);this.isAlive()?(this.eValue.appendChild(s.getGui()),this.addDestroyFunc(i)):i()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},LD=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}";import{BeanStub as kD}from"ag-grid-community";var GD=class extends kD{constructor(){super(...arguments),this.beanName="showRowGroupColValueSvc"}getGroupValue(e,t,s){if(!t)return e.group?{displayedNode:e,value:e.groupValue}:null;const i=this.beans.valueSvc,r=t.colDef.showRowGroup;if(!r)return null;if(e.level===-1&&e.footer)return{displayedNode:e,value:null};if(typeof r=="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(r)??-1)>e.level)return null;const o=this.getDisplayedNode(e,t,!0);if(o)return{displayedNode:o,value:i.getValue(t,o,"data",s)}}const a=i.getValue(t,e,"data",s);if(a==null){const n=this.getDisplayedNode(e,t);if(n)return{displayedNode:n,value:i.getValue(t,n,"data",s)}}return{displayedNode:e,value:a}}formatAndPrefixGroupColValue(e,t,s=!1){const i=this.formatGroupColValue(e,t,s),{value:r,displayedNode:a}=e,n=this.beans.footerSvc;return n?.doesCellShowTotalPrefix(a,t)?n.applyTotalPrefix(r,i,a,t):a.footer&&a.level===-1?null:i}formatGroupColValue(e,t,s=!1){const i=this.beans.valueSvc,{displayedNode:r,value:a}=e,n=r.rowGroupColumn,o=r.group&&!t;if(n&&(o||t?.isRowGroupDisplayed(n.colId))){if(s&&n.colDef.useValueFormatterForExport===!1)return null;const c=i.formatValue(n,r,a);return c==null&&r.key===""?this.getLocaleTextFunc()("blanks","(Blanks)"):c}return!t||r.group||s&&t.colDef.useValueFormatterForExport===!1?null:i.formatValue(t,r,a)}getDisplayedNode(e,t,s=!1){const i=this.gos,r=i.get("groupHideOpenParents"),a=i.get("showOpenedGroup")&&!s;if(!r&&!a)return;const n=t.colDef.showRowGroup;if(n===!0)return e.group?void 0:e.parent??void 0;let o=e;for(;o&&o.rowGroupColumn?.getId()!=n;){const l=o===o.parent?.getFirstChild();if(!a&&!l)return;o=o.parent}if(o!==e)return o??void 0}};import{BeanStub as OD}from"ag-grid-community";var _D=class extends OD{constructor(){super(...arguments),this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){const{colModel:e,rowGroupColsSvc:t}=this.beans,s=this.columns,i=this.colsSet,r=this.colsMap;r.clear();const a=s.length;let n=0,o=!1;const l=e.getCols();for(let c=0,d=l.length;c<d;++c){const u=l[c],p=u.getColDef().showRowGroup;if(typeof p=="string")r.set(p,u);else if(p===!0){const g=t?.columns;if(g)for(let f=0,m=g.length;f<m;++f)r.set(g[f].getId(),u)}else continue;o||(o=n>=a||!i.has(u)),s[n++]=u}if(o||(o=n!==a),o){s.length=n,i.clear();for(let c=0;c<n;++c)i.add(s[c]);this.eventSvc.dispatchEvent({type:"showRowGroupColsSetChanged"})}}getShowRowGroupCol(e){return this.colsMap.get(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;const{rowGroupColsSvc:s,colModel:i}=this.beans;if(t===!0&&s)return s.columns;const r=i.getColDefCol(t);return r?[r]:null}isRowGroupDisplayed(e,t){const s=e.getColDef()?.showRowGroup;return s===!0||s!=null&&s===t}};import{BeanStub as ND,_isClientSideRowModel as BD,_isGroupRowsSticky as VD,_isServerSideRowModel as HD}from"ag-grid-community";import{BeanStub as zD,_getRowHeightForNode as UD,_isClientSideRowModel as WD,_isGroupRowsSticky as KD,_last as $D}from"ag-grid-community";var jD=class extends zD{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=WD(this.gos),this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(e){return this.isClientSide?qD(e):YD(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){const t=e==="top";let s=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,s);const i=new Set,{rowModel:r,rowRenderer:a,pinnedRowModel:n,pageBounds:o,rowContainerHeight:l}=this.beans,{pageFirstPixel:c,pageLastPixel:d}=o.getCurrentPagePixelRange(),u=t?a.firstVisibleVPixel-this.extraTopHeight:a.lastVisibleVPixel-this.extraTopHeight,h=l.divStretchOffset??0,p=c+h,g=d+h,f=S=>{if(i.add(S),t){const b=this.getLastPixelOfGroup(S),y=u+s+S.rowHeight;b<y?S.stickyRowTop=s+(b-y):S.stickyRowTop=s}else{const b=this.getFirstPixelOfGroup(S),y=u-(s+S.rowHeight);b>y?S.stickyRowTop=s-(b-y):S.stickyRowTop=s}s=0,i.forEach(b=>{const y=b.stickyRowTop+b.rowHeight;s<y&&(s=y)})},m=this.areFooterRowsStickySuppressed(),C=this.gos.get("suppressGroupRowsSticky"),v=S=>{if(!S.displayed)return!1;if(S.footer){if(m===!0||m==="grand"&&S.level===-1||m==="group"&&S.level>-1)return!1;const b=S.sibling.rowIndex?S.sibling.rowIndex+1===S.rowIndex:!1;return e==="bottom"&&b||S.level===-1&&n?.getGrandTotalPinned()?!1:!i.has(S)}return S.isExpandable()?C===!0||e==="bottom"?!1:!i.has(S)&&S.expanded:!1};for(let S=0;S<100;S++){let b=u+s;t||(b=u-s),t&&b<p?b=p:!t&&b>g&&(b=g);const y=r.getRowIndexAtPixel(b),w=r.getRow(y);if(w==null)break;const T=this.getStickyAncestors(w).find(I=>(t?I.rowIndex<y:I.rowIndex>y)&&v(I));if(T){f(T);continue}if((t?w.rowTop<b:w.rowTop+w.rowHeight>b)&&v(w)){f(w);continue}break}return t||i.forEach(S=>{S.stickyRowTop=s-(S.stickyRowTop+S.rowHeight)}),this.refreshNodesAndContainerHeight(e,i,s)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=e==="group",s=e==="grand";return t&&s?!0:s?"grand":t?"group":!1}canRowsBeSticky(){const e=KD(this.gos),t=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!s)}getStickyAncestors(e){const t=[];let s=e.footer?e.sibling:e.parent;for(;s;)s.sibling&&t.push(s.sibling),t.push(s),s=s.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(s=>s.rowNode===e)){for(let s=0;s<this.stickyTopRowCtrls.length;s++){const i=this.stickyTopRowCtrls[s].rowNode;i!==e&&t.add(i)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let s=0;s<this.stickyBottomRowCtrls.length;s++){const i=this.stickyBottomRowCtrls[s].rowNode;i!==e&&t.add(i)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,s){const i=e==="top",r=i?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,a={},n=[];for(let p=0;p<r.length;p++){const g=r[p].rowNode;if(!t.has(g)){a[g.id]=r[p],g.sticky=!1;continue}n.push(r[p])}const o=new Set;for(let p=0;p<n.length;p++)o.add(n[p].rowNode);const l=[];t.forEach(p=>{o.has(p)||(p.sticky=!0,l.push(this.createRowCon(p,!1,!1)))});let c=!!l.length||n.length!==r.length;i?this.topContainerHeight!==s&&(this.topContainerHeight=s,this.gridBodyCtrl.setStickyTopHeight(s),c=!0):this.bottomContainerHeight!==s&&(this.bottomContainerHeight=s,this.gridBodyCtrl.setStickyBottomHeight(s),c=!0),this.destroyRowCtrls(a,!1);const d=[...n,...l];d.sort((p,g)=>g.rowNode.rowIndex-p.rowNode.rowIndex),i||d.reverse();for(const p of d)p.setRowTop(p.rowNode.stickyRowTop);const u=this.beans.pageBounds;let h=0;if(i){for(const p of t)p.rowIndex<u.getFirstRow()&&(h+=p.rowHeight);h>this.topContainerHeight&&(h=this.topContainerHeight),this.setOffsetTop(h)}else{for(const p of t)p.rowIndex>u.getLastRow()&&(h+=p.rowHeight);h>this.bottomContainerHeight&&(h=this.bottomContainerHeight),this.setOffsetBottom(h)}return c?(i?this.stickyTopRowCtrls=d:this.stickyBottomRowCtrls=d,!0):!1}ensureRowHeightsValid(){let e=!1;const t=s=>{const i=s.rowNode;if(i.rowHeightEstimated){const r=UD(this.beans,i);i.setRowHeight(r.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}};function YD(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.childStore?.getStoreBounds();return e.footer&&(s=e.sibling.childStore?.getStoreBounds()),(s?.heightPx??0)+(s?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function qD(e){if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.footer?e.sibling:e;for(;i.isExpandable()&&i.expanded;)if(i.master&&i.detailNode)i=i.detailNode;else if(i.childrenAfterSort){if(i.childrenAfterSort.length===0)break;i=$D(i.childrenAfterSort)}return i.rowTop+i.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var XD=class extends ND{constructor(){super(...arguments),this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,s){const i=this.gos;if(VD(i)&&BD(i)||HD(i))return e.createManagedBean(new jD(t,s))}},jd={moduleName:"GroupCellRenderer",version:D,userComponents:{agGroupRowRenderer:$d,agGroupCellRenderer:$d},dynamicBeans:{groupCellRendererCtrl:Kd},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[LD],dependsOn:[B]},Yd={moduleName:"GroupColumn",version:D,beans:[X0,_D,GD,k0,Td,xd],dependsOn:[B,jd]},Ns={moduleName:"ClientSideRowModelHierarchy",version:D,rowModels:["clientSide"],beans:[vD,nD,tD],dependsOn:[B]},Qa={moduleName:"StickyRow",version:D,beans:[XD]},qd={moduleName:"GroupEdit",version:D,beans:[gD],dependsOn:[B,Ns]};import{Component as ZD,_createElement as JD}from"ag-grid-community";var QD=class extends ZD{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const e=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedPropertyListener("rowGroupPanelShow",e),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=JD({tag:"div",cls:"ag-column-drop-wrapper",role:"presentation"}),t=new Nc(!0);this.rowGroupComp=this.createManagedBean(t);const s=new _c(!0);this.pivotComp=this.createManagedBean(s),e.appendChild(t.getGui()),e.appendChild(s.getGui());const i=this.onDropPanelVisible.bind(this);return this.addManagedListeners(t,{displayChanged:i}),this.addManagedListeners(s,{displayChanged:i}),this.onDropPanelVisible(),e}onDropPanelVisible(){const{rowGroupComp:e,pivotComp:t}=this,s=e.isDisplayed()&&t.isDisplayed(),i="ag-column-drop-horizontal-half-width";e.toggleCss(i,s),t.toggleCss(i,s)}onRowGroupChanged(){const e=this.rowGroupComp;if(!e)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const s=this.beans.rowGroupColsSvc?.columns?.length!==0;e.setDisplayed(s)}else e.setDisplayed(!1)}onPivotPanelShow(){const e=this.pivotComp;if(!e)return;const t=this.gos.get("pivotPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const s=this.beans.colModel.isPivotActive();e.setDisplayed(s)}else e.setDisplayed(!1)}},eL={selector:"AG-GRID-HEADER-DROP-ZONES",component:QD};import{AgPromise as Bs,AgSelect as tL,FilterComp as sL,RefPlaceholder as Xd,TabGuardComp as iL,_clearElement as en,_createElement as rL,_setDisplayed as aL,_warn as tn}from"ag-grid-community";function nL(e){return e.buttons&&(e.buttons=[]),e}var oL={tag:"div",cls:"ag-group-filter",children:[{tag:"div",ref:"eGroupField"},{tag:"div",ref:"eUnderlyingFilter"}]},lL=class extends iL{constructor(){super(oL),this.filterType="group",this.eGroupField=Xd,this.eUnderlyingFilter=Xd}wireBeans(e){this.groupFilterSvc=e.groupFilter}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.updateParams().then(()=>{this.addHandlerListeners(this.updateGroups.bind(this))})}refresh(e){const t=e;return this.params=t,t.source==="colDef"&&this.updateParams(),!0}updateParams(){return this.validateParams(),this.updateGroups()}validateParams(){const{colDef:e}=this.params;e.field&&tn(234),e.filterValueGetter&&tn(235),e.filterParams&&tn(236)}addHandlerListeners(e){const t=this.addManagedListeners(this.getHandler(),{sourceColumnsChanged:()=>{this.updateGroups()},destroyed:()=>{for(const s of t)s();this.addHandlerListeners(e)}})}updateGroups(){const{sourceColumns:e,selectedColumn:t}=this.updateGroupField();return this.dispatchLocalEvent({type:"columnsChanged"}),this.getUnderlyingFilters(e,t)}updateGroupField(){this.groupColumn=this.params.column;const e=this.getHandler();if(!e)return{sourceColumns:null};const{sourceColumns:t,hasMultipleColumns:s,selectedColumn:i}=e,r=this.eGroupField;return en(r),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect),s&&t&&(this.createGroupFieldSelectElement(t,i),r.appendChild(this.eGroupFieldSelect.getGui()),r.appendChild(rL({tag:"div",cls:"ag-filter-separator"}))),aL(r,s),{sourceColumns:t,selectedColumn:i}}createGroupFieldSelectElement(e,t){const s=this.createManagedBean(new tL);this.eGroupFieldSelect=s;const i=this.getLocaleTextFunc();s.setLabel(i("groupFilterSelect","Select field:")),s.setLabelAlignment("top"),s.addOptions(e.map(r=>({value:r.getColId(),text:this.beans.colNames.getDisplayNameForColumn(r,"groupFilter",!1)??void 0}))),s.setValue(t.getColId()),s.onValueChange(r=>this.updateSelectedColumn(r)),s.addCss("ag-group-filter-field-select-wrapper"),e.length===1&&s.setDisabled(!0)}getUnderlyingFilters(e,t){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,Bs.resolve();const s=[],i=[],r=this.beans.colFilter;for(const a of e){const n=r.getOrCreateFilterUi(a);n&&s.push(n.then(o=>{o&&i.push({filter:o,column:a}),a.getColId()===t.getColId()&&(this.selectedFilter=o??void 0)}))}return Bs.all(s).then(()=>{this.filterColumnPairs=i})}addUnderlyingFilterElement(e){if(en(this.eUnderlyingFilter),!e)return Bs.resolve();const t=this.createManagedBean(new sL(e,"COLUMN_MENU"));return this.filterComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),t.getFilter()?.then(()=>{t.afterGuiAttached?.(this.afterGuiAttachedParams),!this.afterGuiAttachedParams?.suppressFocus&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()})??Bs.resolve()):Bs.resolve()}updateSelectedColumn(e){if(!e)return;this.filterComp?.afterGuiDetached(),this.destroyBean(this.filterComp);const t=this.getFilterColumnPair(e),s=t?.column;this.selectedFilter=t?.filter,this.getHandler().setSelectedColumn(s),this.dispatchLocalEvent({type:"columnsChanged"}),this.addUnderlyingFilterElement(s)}isFilterActive(){return this.groupFilterSvc.isFilterActive(this.groupColumn)}doesFilterPass(){return!0}getModel(){return null}setModel(){}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement(this.getHandler().selectedColumn)}afterGuiDetached(){en(this.eUnderlyingFilter),this.selectedFilter?.afterGuiDetached?.()}getSelectedColumn(){return this.getHandler().selectedColumn}getHandler(){return this.params.getHandler()}getFilterColumnPair(e){if(e)return this.filterColumnPairs?.find(({column:t})=>t.getColId()===e)}};import{BeanStub as cL,_warn as Zd}from"ag-grid-community";var dL=class extends cL{init(e){this.params=e,this.validateModel(e),this.updateColumns(),this.addManagedEventListeners({columnRowGroupChanged:this.updateColumns.bind(this),filterDestroyed:t=>this.onFilterDestroyed(t)})}refresh(e){this.params=e,this.validateModel(e),e.source==="colDef"&&this.updateColumns()}doesFilterPass(){return!0}setSelectedColumn(e){this.selectedColumn=e,this.dispatchLocalEvent({type:"selectedColumnChanged"})}validateModel(e){e.model!=null&&e.onModelChange(null)}getSourceColumns(){const e=this.params.column;if(this.gos.get("treeData"))return Zd(237),[];const t=this.beans.groupFilter.getSourceColumns(e);return t||(Zd(183),[])}updateColumns(){const e=this.getSourceColumns(),t=e.filter(r=>r.isFilterAllowed());this.sourceColumns=t;let s,i;t.length?e.length===1?(s=t[0],i=!1):(s=this.selectedColumn,(!s||!t.some(r=>r.getId()===s.getId()))&&(s=t[0]),i=!0):(s=void 0,i=!1),this.selectedColumn=s,this.hasMultipleColumns=i,this.dispatchLocalEvent({type:"sourceColumnsChanged"})}onFilterDestroyed({column:e,source:t}){if(t==="gridDestroyed")return;const s=e.getColId();this.sourceColumns?.some(i=>i.getColId()===s)&&setTimeout(()=>{this.isAlive()&&this.updateColumns()})}};import{BeanStub as uL}from"ag-grid-community";var hL=class extends uL{constructor(){super(...arguments),this.beanName="groupFilter"}postConstruct(){this.addManagedEventListeners({columnRowGroupChanged:()=>this.updateFilterFlags("columnRowGroupChanged")})}isGroupFilter(e){return e.getColDef().filter==="agGroupColumnFilter"}isFilterAllowed(e){const t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(s=>t?.isFilterAllowed(s))}isFilterActive(e){const t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(s=>t?.isFilterActive(s))}getSourceColumns(e){return this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e)}updateFilterFlags(e,t){const{autoColSvc:s,colFilter:i}=this.beans;s?.getColumns()?.forEach(r=>{this.isGroupFilter(r)&&i?.setColFilterActive(r,this.isFilterActive(r),e,t)})}};import{AgInputTextField as pL,AgPromise as sn,Component as gL,RefPlaceholder as fL,_clearElement as mL,_isGroupMultiAutoColumn as CL}from"ag-grid-community";var vL={tag:"div",ref:"eFloatingFilter",cls:"ag-group-floating-filter ag-floating-filter-input",role:"presentation"},SL=class extends gL{constructor(){super(vL),this.eFloatingFilter=fL,this.haveAddedColumnListeners=!1}init(e){this.params=e;const t=CL(this.gos),s=this.onColChange.bind(this),i=r=>{t?this.setupUnderlyingFloatingFilterElement().then(()=>r()):(this.setupReadOnlyFloatingFilterElement(),r())};return this.gos.get("enableFilterHandlers")?new sn(r=>i(r)).then(()=>{this.addHandlerListeners(e,s)}):new sn(r=>{this.params.parentFilterInstance(a=>{this.parentFilterInstance=a,i(r)})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{columnsChanged:s})})}refresh(e){if(this.params=e,this.setParams(),this.gos.get("enableFilterHandlers"))if(this.showingUnderlyingFloatingFilter){const t=this.getSelectedColumn(),s=this.beans.colFilter.getFloatingFilterCompDetails(t,this.params.showParentFilter);this.underlyingFloatingFilter?.refresh?.(s?.params)}else this.updateDisplayedValue()}setParams(){const e=this.beans.colNames.getDisplayNameForColumn(this.params.column,"header",!0),t=this.getLocaleTextFunc();this.eFloatingFilterText?.setInputAriaLabel(`${e} ${t("ariaFilterInput","Filter Input")}`)}addHandlerListeners(e,t){const s=this.addManagedListeners(e.getHandler(),{selectedColumnChanged:t,sourceColumnsChanged:t,destroyed:()=>{for(const i of s)i();this.addHandlerListeners(this.params,t)}})}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new pL),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,mL(this.eFloatingFilter);const e=this.getSelectedColumn();if(e&&!e.isVisible()){const t=this.beans.colFilter,s=t.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(s)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(e,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),s.newAgStackInstance().then(i=>{this.underlyingFloatingFilter=i,this.underlyingFloatingFilter?.onParentModelChanged(t.getModelForColumn(e)),this.appendChild(i.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),sn.resolve()}getSelectedColumn(){return this.gos.get("enableFilterHandlers")?this.params.getHandler().selectedColumn:this.parentFilterInstance.getSelectedColumn()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){if(!e.column)return;const t=this.beans.colFilter.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);t&&this.underlyingFloatingFilter?.refresh?.(t.params)}onParentModelChanged(e,t){this.showingUnderlyingFloatingFilter?this.underlyingFloatingFilter?.onParentModelChanged(this.beans.colFilter.getModelForColumn(this.getSelectedColumn()),t):this.updateDisplayedValue()}updateDisplayedValue(){const e=this.eFloatingFilterText;if(!e)return;const t=this.beans.colFilter,s=this.getSelectedColumn(),i=r=>{if(!r)e.setValue(""),e.setDisplayed(!1);else{const a=s?t.getModelForColumn(s):null;e.setValue(a==null?"":r.getModelAsString?.(a)??""),e.setDisplayed(!0)}};this.gos.get("enableFilterHandlers")?i(t.getHandler(s)):t.getOrCreateFilterUi(s)?.then(r=>{i(r)})}onColChange(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}};import{BeanStub as bL,RowNode as yL,_csrmFirstLeaf as Jd,_warn as wL}from"ag-grid-community";var xL=(e,t)=>{if(!e){t.length=0;return}const s=e.length;t.length=s;for(let i=0;i<s;i++){const r=e[i],a=r.getColDef();t[i]={col:r,field:a.field,type:a.type,keyCreator:a.keyCreator,valueGetter:a.valueGetter}}},FL=(e,t)=>{const s=e.length;if(s!==t?.length)return!0;for(let i=0;i<s;i++){const r=e[i],a=t[i];if(r.col!==a)return!0;const n=a.getColDef();if(r.field!==n.field||r.type!==n.type||r.valueGetter!==n.valueGetter||r.keyCreator!==n.keyCreator)return!0}return!1};function RL(e){if(!e)return!1;const t=e.length;if(t<2)return!1;let s=!1;for(let i=1;i<t;i++)if(Qd(e[i-1],e[i])>0){s=!0;break}return s?(e.sort(Qd),!0):!1}function Qd(e,t){const s=e.sourceRowIndex,i=t.sourceRowIndex,r=s>=0,a=i>=0,n=r&&a,o=!r&&!a;return n?s-i:o?e.__objectId-t.__objectId:r?1:-1}var AL=class extends bL{constructor(){super(...arguments),this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){const e=this.nonLeafsById;for(const t of e.values())t._destroy(!1);e.clear()}loadGroupData(e){if(!e.group)return e._groupData=null,null;const t=e.rowGroupColumn,{valueSvc:s,showRowGroupCols:i}=this.beans,r={};if(e._groupData=r,!t)return r;const a=Jd(e),n=t.getId();if(!i)return r;const o=i.columns;for(let l=0,c=o.length;l<c;++l){const d=o[l];d.isRowGroupDisplayed(n)&&(r[d.getColId()]=s.getValue(t,a,"data"))}return r}execute(e,t){const s=t.changedPath;if(this.initRefresh(t)){const i=t.changedRowNodes;i?this.handleDeltaUpdate(e,s,i,!!t.animate):this.shotgunResetEverything(e)}this.positionLeafsAndGroups(s),this.orderGroups(e),this.beans.selectionSvc?.updateSelectableAfterGrouping(s)}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(t=>{const s=t.childrenAfterGroup,i=s?.length;if(!i)return;const r=new Array(i);let a=0,n=!1,o;for(let l=0;l<i;++l){const c=s[l];if(!c.childrenAfterGroup?.length)n||(n=a!==l),r[a++]=c;else if(!o&&c.key===""){o=c;const d=i-1;n||(n=l!==d),r[d]=c}}if(n){for(let c=0;c<i;++c){const d=s[c];d.childrenAfterGroup?.length&&d!==o&&(r[a++]=d)}t.childrenAfterGroup=r;const l=t.sibling;l&&(l.childrenAfterGroup=r)}},!1)}initRefresh(e){const{rowGroupColsSvc:t,colModel:s,gos:i}=this.beans,r=s.isPivotMode();this.pivotMode=r,this.groupEmpty=r||!i.get("groupAllowUnbalanced");const a=t?.columns,n=this.groupCols,o=e.afterColumnsChanged;if(o||!n||this.checkGroupCols)if(this.checkGroupCols=!1,n&&!FL(n,a)){if(o)return!1}else e.animate=!1,xL(a,this.groupCols);return!0}handleDeltaUpdate(e,t,{removals:s,updates:i,adds:r,reordered:a},n){const o=new Set;let l=t;l.active||(l=null);for(let c=0,d=s.length;c<d;++c){const u=s[c],h=this.removeFromParent(u);o.has(h)||(o.add(h),l?.addParentNode(h))}for(const c of i){const d=c.parent;if(l?.addParentNode(d),this.moveNodeInWrongPath(e,c)){o.add(d);const u=c.parent;l?.addParentNode(u),a||(a=(u?.childrenAfterGroup?.length??0)>1)}}if(r.size)for(const c of r){this.insertOneNode(e,c);const d=c.parent;l?.addParentNode(d),a||(a=(d?.childrenAfterGroup?.length??0)>1)}o.size&&(eu(o),this.removeEmptyGroups(o,n)),a&&this.sortChildren(t)}sortChildren(e){e.forEachChangedNodeDepthFirst(t=>{RL(t.childrenAfterGroup)&&e.active&&e.addParentNode(t)},!1,!0)}orderGroups(e){const t=this.gos.getCallback("initialGroupOrderComparator");if(!t)return;const s=this.beans,i=s.gridApi,r=s.gridOptions.context,a=(o,l)=>t({api:i,context:r,nodeA:o,nodeB:l}),n=o=>{const l=o.childrenAfterGroup,c=l?.length;if(!(!c||o.leafGroup)){c>1&&l.sort(a);for(let d=0,u=c;d<u;++d)n(l[d])}};n(e)}moveNodeInWrongPath(e,t){const{valueSvc:s}=this.beans,i=this.groupEmpty;let r=t.parent,a=!1;const n=this.groupCols;if(!n)return!1;for(let o=n.length-1;o>=0;--o){const{col:l}=n[o];let c=s.getKeyForNode(l,t);if(c==null||c===""){if(!i)continue;c=""}if(!r?.parent||r.key!==c){a=!0;break}r=r.parent}return a||(a=!!r?.parent),a?(this.removeFromParent(t),this.insertOneNode(e,t),t.setData(t.data),!0):!1}groupShouldBeRemoved(e){const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),s=e.parent?.childrenMapped;return(s?!s[t]:!0)?!1:!!e.group&&(e.childrenAfterGroup?.length??0)===0}removeEmptyGroups(e,t){const s=this.beans.selectionSvc;let i;const r=Array.from(e),a=this.nonLeafsById;do{e.clear();for(let n=0;n<r.length;++n){let o=r[n];for(;o;){const l=o.parent;if(o.destroyed){r[n]=l,o=l;continue}if(!l)break;if(!this.groupShouldBeRemoved(o)){o=l;continue}e.add(l),this.removeFromParent(o),s&&o.isSelected()&&(i??(i=[]),i.push(o)),r[n]=l,a.delete(o.id),o._destroy(t),o=l}}eu(e)}while(e.size);i&&s.setNodesSelected({nodes:i,newValue:!1,source:"rowGroupChanged"})}removeFromParent(e){const t=e.parent;if(t){const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn),i=t.childrenMapped;i&&delete i[s]}return e.setRowTop(null),e.setRowIndex(null),t}addToParent(e,t){const s=t.childrenMapped??(t.childrenMapped={}),i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);if(s[i]!==e){s[i]=e;let r=t.childrenAfterGroup;if(!r){t.childrenAfterGroup=r=[];const a=t.sibling;a&&(a.childrenAfterGroup=t.childrenAfterGroup)}r.push(e),xc(t,this.beans,!0),rn(t)}}shotgunResetEverything(e){this.beans.selectionSvc?.filterFromSelection?.(i=>!i.group),this.nonLeafsById.clear(),e.leafGroup=!this.groupCols?.length,e.childrenAfterGroup=[],e.childrenMapped={},e.updateHasChildren();const t=e.sibling;t&&(t.childrenAfterGroup=e.childrenAfterGroup,t.childrenMapped=e.childrenMapped);const s=e._leafs;for(let i=0,r=s.length;i<r;++i)this.insertOneNode(e,s[i])}insertOneNode(e,t){let s=e;const{beans:i,pivotMode:r,groupCols:a,groupEmpty:n}=this,o=i.valueSvc;if(!a)return;const l=a.length;for(let c=0;c<l;++c){const d=a[c],u=d.col;let h=o.getKeyForNode(u,t);if(h==null||h===""){if(!n)continue;h=""}const p=s.childrenMapped?.[this.getChildrenMappedKey(h,u)];if(p){s=p;continue}const g=s.level+1,f=g>=l-1,m=this.createGroup(s,d,h,g,f,t);this.addToParent(m,s),this.setExpandedInitialValue(r,m),s=m}s.group||wL(184,{parentGroupData:s.data,childNodeData:t.data}),t.parent=s,t.level=s.level+1,s.childrenAfterGroup.push(t),s.updateHasChildren(),rn(s)}createGroup(e,t,s,i,r,a){const n=t.col,o=(e.level>=0?e.id+"-":"row-group-")+(n.getColId()+"-"+s),l=this.nonLeafsById;let c=l.get(o);return c!==void 0||(c=new yL(this.beans),c.group=!0,c.parent=e,c.field=t.field??null,c.rowGroupColumn=n,c.key=s,c.id=o,c.level=i,c.leafGroup=r,c.rowGroupIndex=i,c.childrenAfterGroup=[],c.childrenMapped={},l.set(o,c),c.groupValue=a&&this.beans.valueSvc.getValue(n,a,"data"),c.setAllChildrenCount(0),c.updateHasChildren()),c}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){if(e&&t.leafGroup){t.expanded=!1;return}t.expanded=Ja(this.beans,t,t.level)}onShowRowGroupColsSetChanged(){const{rowModel:e,valueSvc:t}=this.beans;for(const i of this.nonLeafsById.values()){i._groupData=void 0;const r=i.rowGroupColumn,a=r&&Jd(i);i.groupValue=a&&t.getValue(r,a,"data")}const s=e.rootNode?._leafs;if(s)for(let i=0,r=s.length;i<r;++i){const a=s[i];a.parent._groupData=void 0}}},eu=e=>{for(const t of e){const s=t?.childrenAfterGroup;if(!s)continue;const i=s.length;let r=0;for(let a=0;a<i;++a){const n=s[a];n.parent===t&&!n.destroyed&&(r!==a&&(s[r]=n),++r)}i!==r&&(s.length=r,t.updateHasChildren(),rn(t))}},rn=e=>{for(;e._leafs!==void 0;){const t=e.parent;if(!t)break;e._leafs=void 0,e=t}};function ML(e,t){e.rowGroupColsSvc?.setColumns(t,"api")}function TL(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")}function PL(e,t){e.rowGroupColsSvc?.addColumns(t,"api")}function IL(e,t,s){e.rowGroupColsSvc?.moveColumn?.(t,s,"api")}function EL(e){return e.rowGroupColsSvc?.columns??[]}var tu={moduleName:"SharedRowGrouping",version:D,apiFunctions:{setRowGroupColumns:ML,removeRowGroupColumns:TL,addRowGroupColumns:PL,getRowGroupColumns:EL,moveRowGroupColumn:IL},dependsOn:[B,qa,Yd,Qa,T0]},an={moduleName:"RowGrouping",version:D,dynamicBeans:{groupStrategy:AL},rowModels:["clientSide"],dependsOn:[tu,Xa,Ns,qd]},su={moduleName:"RowGroupingPanel",version:D,selectors:[eL],icons:{pivotPanel:"pivot",rowGroupPanel:"group",panelDelimiter:"small-right",panelDelimiterRtl:"small-left"},dependsOn:[B,xE]},iu={moduleName:"GroupFilter",version:D,userComponents:{agGroupColumnFilter:{classImp:lL,processParams:nL},agGroupColumnFloatingFilter:SL},beans:[hL],dynamicBeans:{agGroupColumnFilterHandler:dL},dependsOn:[B,wE]};import{BeanStub as DL,RowNode as ru,_addGridCommonParams as LL,_getRowHeightAsNumber as au,_getRowIdCallback as kL,_warn as GL}from"ag-grid-community";var OL=class extends DL{constructor(){super(...arguments),this.beanName="rowModel",this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={},this.rootNode=null,this.viewportChangedContext=!1}ensureRowHeightsValid(e,t,s,i){return!1}postConstruct(){const e=this.beans,t=new ru(e);this.rootNode=t,t.level=-1,this.rowHeight=au(e),this.addManagedEventListeners({viewportChanged:this.onViewportChanged.bind(this)}),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=au(e),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){const e=this.datasource;e&&(e.destroy?.(),this.beans.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getPageSize(){return this.gos.get("viewportRowModelPageSize")}getBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getBufferSize(),s=this.getPageSize(),i=e-t;return i<0?0:Math.floor(i/s)*s}calculateLastRow(e){if(e===-1)return e;const t=this.getBufferSize(),s=this.getPageSize(),i=e+t,r=Math.ceil(i/s)*s,a=this.rowCount-1;return Math.min(r,a)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),s=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==s)&&(this.firstRow=t,this.lastRow=s,this.purgeRowsNotInViewport(),this.viewportChangedContext=!0,this.datasource?.setViewportRange(this.firstRow,this.lastRow),this.viewportChangedContext=!1)}purgeRowsNotInViewport(){const e=this.rowNodesByIndex;for(const t of Object.keys(e)){const s=parseInt(t,10);if(s<this.firstRow||s>this.lastRow){if(this.isRowFocused(s)||this.beans.editSvc?.isRowEditing(e[s]))continue;delete e[s]}}}isRowFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.datasource=e,this.rowCount=-1,e.init?e.init(LL(this.gos,{setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)})):GL(226)}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight!==0?Math.floor(e/this.rowHeight):0}resetRowHeights(){}onRowHeightChanged(){}getRowBounds(e){const t=this.rowHeight;return{rowHeight:t,rowTop:t*e}}updateRowHeights(){const e=this.rowHeight;this.forEachNode(t=>{t.setRowHeight(e),t.setRowTop(e*t.rowIndex)}),this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}getOverlayType(){return null}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex,r=s<this.firstRow||s>this.lastRow,a=i<this.firstRow||i>this.lastRow;if(r||a)return[];const n=[],o=s<=i?s:i,l=s<=i?i:s;for(let c=o;c<=l;c++)n.push(this.rowNodesByIndex[c]);return n}forEachNode(e){let t=0;for(const s of Object.keys(this.rowNodesByIndex)){const i=parseInt(s,10),r=this.rowNodesByIndex[i];e(r,t),t++}}setRowData(e){const t=kL(this.beans.gos),s=new Map;if(t)for(const i of Object.values(this.rowNodesByIndex))s.set(i.id,i);for(let i=this.firstRow;i<=this.lastRow;i++){const r=e[i];if(!r)continue;let a,n;t?(a=t({data:r,rowPinned:void 0,level:0,parentKeys:void 0}),n=s.get(a)):n=this.rowNodesByIndex[i],n?(n.updateData(r),n.setRowIndex(i),n.setRowTop(this.rowHeight*i)):(n=this.createBlankRowNode(i),n.setDataAndId(r,a??i.toString())),this.rowNodesByIndex[i]=n}this.viewportChangedContext||this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}createBlankRowNode(e){const t=new ru(this.beans),s=this.rowHeight;return t.setRowHeight(s),t.setRowTop(s*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e;const s=this.eventSvc;s.dispatchEventOnce({type:"rowCountReady"}),s.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:t,animate:!1})}isRowPresent(e){return!!this.getRowNode(e.id)}},nu={moduleName:"ViewportRowModel",version:D,rowModels:["viewport"],beans:[OL],dependsOn:[B]};import{CsvExportModule as _L,HighlightChangesModule as NL,_KeyboardNavigationModule as BL}from"ag-grid-community";function VL(e,t){e.clipboardSvc?.copyToClipboard(t)}function HL(e,t){e.clipboardSvc?.cutToClipboard(t)}function zL(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)}function UL(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)}function WL(e){e.clipboardSvc?.copyRangeDown()}function KL(e){e.clipboardSvc?.pasteFromClipboard()}import{BeanStub as $L,ChangedPath as jL,_createCellId as Kt,_exists as YL,_getActiveDomElement as qL,_getDocument as ou,_getRowBelow as nn,_getRowNode as on,_isClientSideRowModel as lu,_isSameRow as cu,_last as XL,_removeFromArray as ZL,_warn as $i,isColumnSelectionCol as JL,isSpecialCol as QL}from"ag-grid-community";var ji="paste",ln="dragCopy",cn="clipboard";function ek(e,t=","){const s=[],i=a=>a==="\r"||a===`
|
||
`;let r=!1;if(e==="")return[[""]];for(let a=0,n=0,o=0;o<e.length;o++){const l=e[o-1],c=e[o],d=e[o+1],u=()=>{s[a]||(s[a]=[]),s[a][n]||(s[a][n]="")};if(u(),c==='"'&&(r?d==='"'?(s[a][n]+='"',o++):r=!1:(l===void 0||l===t||i(l))&&(r=!0)),!r&&c!=='"'){if(c===t){n++,u();continue}else if(i(c)){n=0,a++,u(),c==="\r"&&d===`
|
||
`&&o++;continue}}s[a][n]+=c}return s}var tk=class extends $L{constructor(){super(...arguments),this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){const{gos:e,rowModel:t,ctrlsSvc:s}=this.beans;lu(e,t)&&(this.clientSideRowModel=t),s.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(t=>{$i(40,{e:t,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=s=>{const i=Date.now();i-this.lastPasteOperationTime<50&&(e=!0,s.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(s=>{s.addEventListener("paste",t),s.focus({preventScroll:!0})},s=>{const i=s.value;e?this.refocusLastFocusedCell():this.processClipboardData(i),s.removeEventListener("paste",t)})}refocusLastFocusedCell(){const{focusSvc:e}=this.beans,t=e.getFocusedCell();t&&e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return YL(e)?e:" "}processClipboardData(e){if(e==null)return;let t=ek(e,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(t=s({data:t})),t==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const{rangeSvc:i,editSvc:r}=this.beans,a=(n,o,l,c)=>{i?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(t,n,o,c):this.pasteStartingFromFocusedCell(t,n,o,l,c),r?.stopEditing(void 0,{source:ji})};this.doPasteOperation(a)}doPasteOperation(e){const t="clipboard",{eventSvc:s,focusSvc:i,rowRenderer:r,gos:a}=this.beans;s.dispatchEvent({type:"pasteStart",source:t});const{clientSideRowModel:n}=this,o=n?.rootNode,l=o&&new jL(a.get("aggregateOnlyChangedColumns"),o),c={},d=[],u=i.getFocusedCell();e(c,d,u,l);const h=[...d];l&&(n.doAggregate(l),l.forEachChangedNodeDepthFirst(p=>{h.push(p)})),r.refreshCells({rowNodes:h}),this.dispatchFlashCells(c),this.fireRowChanged(d),this.refocusLastFocusedCell(),s.dispatchEvent({type:"pasteEnd",source:t})}getPreProcessRangeCallback(e){return t=>{const{rangeSvc:s}=this.beans;if(!s)return;const{rowDiff:i,colDiff:r}=this.getAdjustedRangeDimensionForPaste(t,e);i!==0&&s.extendRangeRowCountBy(t,i),r!==0&&s.extendRangeColumnCountBy(t,r)}}getAdjustedRangeDimensionForPaste(e,t){const s=this.beans.rangeSvc,i=t.length,r=s.getRangeRowCount(e),a=r>=i&&r%i===0,n=t[0].length,o=e.columns.length,l=o>=n&&o%n===0;return{rowDiff:a?0:i-r,colDiff:l?0:n-o}}pasteIntoActiveRange(e,t,s,i){let r=0,a=0;const n=(o,l,c,d)=>{if(d-r>=e.length){if(d%e.length!==0)return;r+=a,a=0}const h=e[d-r];s.push(l);const p=this.gos.getCallback("processCellFromClipboard"),g=c.columns,f=g.findIndex(JL);f!==-1&&g.splice(f,1);for(let m=0;m<g.length;m++){const C=g[m];if(!C.isCellEditable(l)||C.isSuppressPaste(l))continue;let v=m;m>=h.length&&(v=m%h.length);const S=this.processCell(l,C,h[v],ln,p,!0);l.setDataValue(C,S,ji),i?.addParentNode(l.parent,[C]);const{rowIndex:b,rowPinned:y}=o,w=Kt({rowIndex:b,column:C,rowPinned:y});t[w]=!0}a++};this.iterateActiveRanges(n,!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e;const s=[],{visibleCols:i}=this.beans;for(;t&&QL(t);)t=i.getColAfter(t);for(;t!=null;)s.push(t),t=i.getColAfter(t);return s}pasteStartingFromFocusedCell(e,t,s,i,r){if(!i)return;const a={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n=this.getDisplayedColumnsStartingAt(i.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,s,t,r):this.pasteMultipleValues(e,a,s,n,t,cn,r)}isPasteSingleValueIntoRange(e){const t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,s,i){const r=e[0][0],a=(n,o,l)=>{t.push(o),l.columns.forEach(c=>this.updateCellValue(o,c,r,s,cn,i))};this.iterateActiveRanges(a)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){const{rangeSvc:e,gos:t,formula:s,valueSvc:i}=this.beans;if(!e||e.isEmpty())return;const r=[],a=(n,o,l,c)=>{const d=t.getCallback("processCellForClipboard"),u=t.getCallback("processCellFromClipboard"),h=(p,g,f)=>{const{columns:m}=f;r.length?(o.push(g),m.forEach((C,v)=>{if(!C.isCellEditable(g)||C.isSuppressPaste(g))return;C.isAllowFormula()&&s?.isFormula(r[v])&&(r[v]=s?.updateFormulaByOffset({value:r[v],rowDelta:1}));const b=this.processCell(g,C,r[v],ln,u,!0);g.setDataValue(C,b,ji),c&&c.addParentNode(g.parent,[C]);const{rowIndex:y,rowPinned:w}=p,M=Kt({rowIndex:y,column:C,rowPinned:w});n[M]=!0})):m.forEach(C=>{const v=this.processCell(g,C,i.getValue(C,g,"batch"),ln,d,!1,!0);r.push(v)})};this.iterateActiveRanges(h,!0)};this.doPasteOperation(a)}removeLastLineIfBlank(e){const t=XL(e);if(t&&t.length===1&&t[0]===""){if(e.length===1)return;ZL(e,t)}}fireRowChanged(e){if(this.gos.get("editType")==="fullRow")for(const t of e)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}pasteMultipleValues(e,t,s,i,r,a,n){let o=t;const l=this.beans,{gos:c}=l,d=this.clientSideRowModel!=null&&!c.get("enableGroupEdit")&&!c.get("treeData"),u=()=>{for(;;){if(!o)return null;const h=on(l,o);if(o=nn(l,{rowPinned:o.rowPinned,rowIndex:o.rowIndex}),h==null)return null;if(!(h.detail||h.footer||d&&h.group))return h}};for(const h of e){const p=u();p&&(h.forEach((g,f)=>this.updateCellValue(p,i[f],g,r,a,n)),s.push(p))}}updateCellValue(e,t,s,i,r,a){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;const n=this.processCell(e,t,s,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,n,ji);const{rowIndex:o,rowPinned:l}=e,c=Kt({rowIndex:o,column:t,rowPinned:l});i[c]=!0,a&&a.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){this.gos.get("suppressCutToClipboard")||(this.eventSvc.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:s,includeGroupHeaders:i}=e;const{gos:r,focusSvc:a}=this.beans;s==null&&(s=r.get("copyHeadersToClipboard")),i==null&&(i=r.get("copyGroupHeadersToClipboard"));const n={includeHeaders:s,includeGroupHeaders:i},o=r.get("rowSelection"),l=r.get("cellSelection");let c=null;this.shouldCopyCells(l,o)?(this.copySelectedRangeToClipboard(n),c=0):this.shouldCopyRows(o)?(this.copySelectedRowsToClipboard(n),c=1):a.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(n),c=2),t&&c!==null&&this.clearCellsAfterCopy(c)}shouldCopyCells(e,t){const{rangeSvc:s,selectionSvc:i,gos:r}=this.beans;if(!s||s.isEmpty())return!1;if(e)return!(typeof t=="object"&&t.copySelectedRows&&!i?.isEmpty());{const a=r.get("suppressCopySingleCellRanges");return!(!s.isMoreThanOneCell()&&a)}}shouldCopyRows(e){const{selectionSvc:t,gos:s}=this.beans;return t?.isEmpty()??!0?!1:e&&typeof e!="string"?e.copySelectedRows??!1:!s.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(e){const t=this.beans,{rangeSvc:s,focusSvc:i,eventSvc:r}=t;if(r.dispatchEvent({type:"keyShortcutChangedCellStart"}),e===0)s.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(e===1)this.clearSelectedRows();else{const a=i.getFocusedCell();if(a==null)return;const n=on(t,a);n&&this.clearCellValue(n,a.column)}r.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const{selectionSvc:e,visibleCols:t}=this.beans,s=e?.getSelectedNodes()??[],i=t.allCols;for(const r of s)for(const a of i)this.clearCellValue(r,a)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const s=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,s,"clipboardSvc")}iterateActiveRanges(e,t,s){const i=this.beans.rangeSvc;if(!i||i.isEmpty())return;const r=i.getCellRanges(),a=t?[r[0]]:r;for(const n of a)this.iterateActiveRange({cellRange:n,rowCallback:e,preProcessRange:s})}iterateActiveRange(e){const{cellRange:t,preProcessRange:s,rowCallback:i}=e,{beans:r}=this,{rangeSvc:a}=r;if(!a)return;s&&s(t);let n=a.getRangeStartRow(t);const o=a.getRangeEndRow(t);let l=0,c=!1;for(;!c&&n!=null;){const d=on(r,n);c=cu(n,o),i(n,d,t,l++),n=nn(r,n)}}copySelectedRangeToClipboard(e={}){const t=this.beans.rangeSvc;if(!t||t.isEmpty())return;const s=t.areAllRangesAbleToMerge(),{data:i,cellsToFlash:r}=s?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(i),this.dispatchFlashCells(r)}buildDataFromMergedRanges(e,t){const s=new Set,i=e.getCellRanges(),r=new Map,a=[],n={},o=lu(this.gos,this.beans.rowModel),l=new Set;o||this.beans.rowModel.forEachNode(h=>{l.add(h.rowIndex)});for(const h of i){h.columns.forEach(f=>s.add(f));const{rowPositions:p,cellsToFlash:g}=this.getRangeRowPositionsAndCellsToFlash(e,h);for(const f of p){const m=l.has(f.rowIndex);if(!o&&!m)continue;const C=`${f.rowIndex}-${f.rowPinned||"null"}`;r.get(C)||(r.set(C,!0),a.push(f))}Object.assign(n,g)}const c=this.beans.visibleCols.allCols,d=Array.from(s);return d.sort((h,p)=>{const g=c.indexOf(h),f=c.indexOf(p);return g-f}),{data:this.buildExportParams({columns:d,rowPositions:a,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:n}}buildDataFromRanges(e,t){const s=e.getCellRanges(),i=[],r={};for(const a of s){const{rowPositions:n,cellsToFlash:o}=this.getRangeRowPositionsAndCellsToFlash(e,a);Object.assign(r,o),i.push(this.buildExportParams({columns:a.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:i.join(`
|
||
`),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const s=[],i={},r=e.getRangeStartRow(t),a=e.getRangeEndRow(t);let n=r;for(;n;){s.push(n);for(const o of t.columns){const{rowIndex:l,rowPinned:c}=n,d=Kt({rowIndex:l,column:o,rowPinned:c});i[d]=!0}if(cu(n,a))break;n=nn(this.beans,n)}return{rowPositions:s,cellsToFlash:i}}getCellsToFlashFromRowNodes(e){const t=this.beans.visibleCols.allCols,s={};for(let i=0;i<e.length;i++){const{level:r,rowIndex:a,rowPinned:n,sibling:o}=e[i],l=r===-1?o.rowIndex:a;if(l!=null)for(let c=0;c<t.length;c++){const d=t[c],u=Kt({rowIndex:l,column:d,rowPinned:n});s[u]=!0}}return s}copyFocusedCellToClipboard(e={}){let t=this.beans.focusSvc.getFocusedCell();if(t==null)return;t=this.beans.rowSpanSvc?.getCellStart(t)??t;const s=Kt(t),i={rowPinned:t.rowPinned,rowIndex:t.rowIndex},r=t.column,a=this.buildExportParams({columns:[r],rowPositions:[i],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(a),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:s,includeGroupHeaders:i}=e,r=this.buildExportParams({columns:t,includeHeaders:s,includeGroupHeaders:i});this.copyDataToClipboard(r);const a=this.beans.selectionSvc?.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(a))}buildExportParams(e){const{columns:t,rowPositions:s,includeHeaders:i=!1,includeGroupHeaders:r=!1}=e,{gos:a,csvCreator:n}=this.beans,o=({node:c,column:d})=>{const{value:u,valueFormatted:h}=this.beans.valueSvc.getValueForDisplay({column:d,node:c,includeValueFormatted:!0,from:"batch"}),p=h??u??"",g=a.getCallback("processCellForClipboard");return g?g({column:d,node:c,value:p,type:cn,formatValue:f=>this.beans.valueSvc.formatValue(d,c,f)??f,parseValue:f=>this.beans.valueSvc.parseValue(d,c,f,u)??f}):p},l={columnKeys:t,rowPositions:s,skipColumnHeaders:!i,skipColumnGroupHeaders:!r,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,valueFrom:"batch",processCellCallback:a.getCallback("processCellForClipboard"),processRowGroupCallback:o,processHeaderCallback:a.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:a.getCallback("processGroupHeaderForClipboard")};return n.getDataAsCsv(l,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,s,i,r,a,n){const{valueSvc:o,formula:l}=this.beans;return r?r({column:t,node:e,value:s,type:i,formatValue:d=>o.formatValue(t,e??null,d)??d,parseValue:d=>o.parseValue(t,e??null,d,o.getValue(t,e,"edit"))}):a&&t.getColDef().useValueParserForImport!==!1?o.parseValue(t,e??null,s,o.getValue(t,e,"edit")):n&&t.getColDef().useValueFormatterForExport!==!1?l?.isFormula(s)?s:o.formatValue(t,e??null,s)??s:s}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch(i=>{$i(40,{e:i,method:"writeText"}),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=ou(this.beans),i=qL(this.beans);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||$i(41),i?.focus!=null&&i.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;const s=ou(this.beans),i=s.createElement("textarea"),r=i.style;r.width="1px",r.height="1px";const a=s.documentElement;r.top=a.scrollTop+"px",r.left=a.scrollLeft+"px",r.position="absolute",r.opacity="0",this.gridCtrl.getGui().appendChild(i);try{e(i)}catch{$i(42)}t?window.setTimeout(()=>{t(i),i.remove()},100):i.remove()}},du={moduleName:"Clipboard",version:D,beans:[tk],apiFunctions:{copyToClipboard:VL,cutToClipboard:HL,copySelectedRowsToClipboard:zL,copySelectedRangeToClipboard:UL,copySelectedRangeDown:WL,pasteFromClipboard:KL},dependsOn:[B,_L,BL,NL]};import{CellStyleModule as sk,_SharedDragAndDropModule as ik}from"ag-grid-community";var rk='.ag-row-number-cell{background-color:var(--ag-header-background-color);border:none;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);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}.ag-row-numbers-resizer{bottom:-2px;cursor:ns-resize;height:4px;position:absolute;width:100%}:where(.ag-ltr) .ag-row-numbers-resizer{left:0}:where(.ag-rtl) .ag-row-numbers-resizer{right:0}.ag-floating-bottom .ag-row-numbers-resizer{bottom:unset;top:-2px}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}';import{Component as ak,Direction as nk,_getRowNode as ok}from"ag-grid-community";var lk={tag:"div",cls:"ag-row-numbers-resizer"},ck=class extends ak{constructor(e){super(lk),this.cellCtrl=e,this.initialYPosition=-1,this.dragging=!1}postConstruct(){const{beans:e,cellCtrl:t}=this,{dragSvc:s,environment:i}=e;this.defaultRowHeight=i.getDefaultRowHeight(),s.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:this.onDragging.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:!0,stopPropagationForTouch:!0});const r=t.getRowPosition();this.node=ok(this.beans,r)}onDragStart(e){if(!this.node)return;const{beans:{ctrlsSvc:t,eventSvc:s}}=this;t.get("gridCtrl").setResizeCursor(nk.Vertical),this.dragging=!0,this.initialHeight=this.node.rowHeight,s.dispatchEvent({type:"rowResizeStarted",node:this.node,event:e,rowHeight:this.initialHeight})}onDragging(e){let{clientY:t}=e;if(this.cellCtrl.rowNode.rowPinned==="bottom"&&(t*=-1),this.initialYPosition===-1||!this.dragging){this.initialYPosition=t;return}const{beans:s,initialHeight:i,initialYPosition:r,defaultRowHeight:a,node:n}=this;if(i==null)return;const o=n?.rowHeight,l=Math.max(i-(r-t),a);if(o===l)return;n?.setRowHeight(l);const{rowRenderer:c,rowModel:d,pinnedRowModel:u}=s,h=!!n?.rowPinned;h&&c.redraw({afterScroll:!0}),(!h||u?.isManual())&&d.onRowHeightChanged({animate:!1})}onDragStop(e){this.beans.eventSvc.dispatchEvent({type:"rowResizeEnded",node:this.node,event:e,rowHeight:this.node?.rowHeight}),this.clearDragDetails(!0)}onDragCancel(){this.clearDragDetails(!0)}clearDragDetails(e){this.initialYPosition=-1,this.initialHeight=null,this.dragging=!1,e&&this.beans.ctrlsSvc.get("gridCtrl").setResizeCursor(!1)}destroy(){this.clearDragDetails(!1),this.node=void 0,super.destroy()}};import{AgColumn as dk,BeanStub as uk,KeyCode as hk,ROW_NUMBERS_COLUMN_ID as pk,_addGridCommonParams as gk,_applyColumnState as fk,_areColIdsEqual as mk,_convertColumnEventSourceType as Ck,_createElement as vk,_debounce as Sk,_destroyColumnTree as uu,_getColumnStateFromColDef as bk,_getFirstRow as yk,_getRowNode as wk,_interpretAsRightClick as xk,_isRowNumbers as $t,_selectAllCells as Fk,_setAriaLabel as Rk,_updateColsMap as Ak,isRowNumberCol as jt}from"ag-grid-community";import{_isRowNumbers as Mk,_removeFromParent as Tk,_warn as Pk}from"ag-grid-community";function hu(e){const t=Mk(e);return!(!t||typeof t!="object"||!t.enableRowResizer)}var Ik=class{constructor(e,t){this.beans=e,this.cellCtrl=t}refreshRowResizer(){!hu(this.beans)||!this.isRowResizeSupported(this.cellCtrl.rowNode)?this.removeRowResizerFromCellComp():this.addResizerToCellComp()}isRowResizeSupported(e){const{pinnedRowModel:t,rowModel:s,visibleCols:i}=this.beans,r=!!s.onRowHeightChanged;return i.autoHeightCols.length?(Pk(276),!1):e.rowPinned!=null?t?.isManual()?r:!0:r}addResizerToCellComp(){const{beans:e,cellCtrl:t}=this,{eGui:s}=t;let{rowResizer:i}=this;if(i){s.appendChild(i.getGui());return}i=e.registry.createDynamicBean("rowNumberRowResizer",!1,t),i&&(this.rowResizer=e.context.createBean(i),s.appendChild(i.getGui()))}removeRowResizerFromCellComp(){const{rowResizer:e,beans:{context:t}}=this;e&&(Tk(e.getGui()),this.rowResizer=t.destroyBean(e))}destroy(){this.removeRowResizerFromCellComp()}},Ek=class extends uk{constructor(){super(...arguments),this.beanName="rowNumbersSvc",this.isIntegratedWithSelection=!1,this.lastColumnResized=0}postConstruct(){const e=Sk(this,this.refreshCells.bind(this),10);this.addManagedEventListeners({columnResized:()=>{this.lastColumnResized=Date.now()},modelUpdated:t=>{e(!1,!t.keepRenderedRows)},rangeSelectionChanged:()=>this.refreshCells(!0),pinnedRowsChanged:()=>e(!1,!0)}),this.addManagedPropertyListeners(["rowNumbers","cellSelection"],t=>{this.updateColumns(t)}),this.refreshSelectionIntegration(),this.registerRangeSelectionExtension()}shouldSkipColumn(e){return $t(this.beans)&&jt(e)}isAllColumnsSelectionCell(e){return $t(this.beans)&&jt(e.column)}isAllColumnsRange(e,t){return!$t(this.beans)||t.length===0?!1:e.columns.length===t.length&&t.every(s=>e.columns.includes(s))}registerRangeSelectionExtension(){const e=this.beans.rangeSvc;e&&(e.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>e.unregisterRangeSelectionExtension?.(this)))}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),Ak(e))}createColumns(e,t){const s=()=>{uu(this.beans,this.columns?.tree),this.columns=null},{beans:i}=this;if(!$t(i)){s();return}const r=e.treeDepth,n=(this.columns?.treeDepth??-1)==r,o=this.generateRowNumberCols();if(mk(o,this.columns?.list??[])&&n)return;s();const{colGroupSvc:c}=this.beans,d=c?.findDepth(e.tree)??0,u=c?.balanceTreeForAutoCols(o,d)??[];this.columns={list:o,tree:u,treeDepth:d,map:{}},t(p=>{if(!p)return null;const g=p.filter(f=>!jt(f));return[...o,...g]})}handleMouseDownOnCell(e,t){return!this.isIntegratedWithSelection||t.target.classList.contains("ag-row-numbers-resizer")?(this.beans.rangeSvc&&t.preventDefault(),t.stopImmediatePropagation(),!1):(!t.shiftKey&&!xk(this.beans,t)&&this.focusFirstRenderedCellAtRowPosition(e),!0)}updateColumns(e){const t=Ck(e.source);this.refreshSelectionIntegration();for(const s of this.columns?.list??[]){const i=this.createRowNumbersColDef();s.setColDef(i,null,t),fk(this.beans,{state:[bk(i,s.getColId())]},t)}}getColumn(){return this.columns?.list.find(jt)??null}getColumns(){return this.columns?.list??null}setupForHeader(e){const{column:t,eGridHeader:s}=e.params;jt(t)&&(Rk(s,"Row Number"),this.addManagedElementListeners(s,{click:this.onHeaderClick.bind(this),keydown:this.onHeaderKeyDown.bind(this),focus:this.onHeaderFocus.bind(this)}))}createRowNumbersRowResizerFeature(e){if(hu(this.beans))return new Ik(this.beans,e)}refreshSelectionIntegration(){const{beans:e}=this,{gos:t,rangeSvc:s}=e,i=t.get("cellSelection");this.refreshRowNumberOverrides(),this.isIntegratedWithSelection=!!s&&!!i&&!this.isSuppressCellSelectionIntegration}refreshRowNumberOverrides(){const e=$t(this.beans);if(this.rowNumberOverrides={},!e||typeof e!="object")return;e.suppressCellSelectionIntegration&&(this.isSuppressCellSelectionIntegration=!0);const t=["contextMenuItems","context","onCellClicked","onCellContextMenu","onCellDoubleClicked","headerTooltip","headerStyle","headerComponent","headerComponentParams","suppressHeaderKeyboardEvent","tooltipField","tooltipValueGetter","tooltipComponent","tooltipComponentParams","tooltipComponentSelector","valueGetter","valueFormatter","width","maxWidth","minWidth","resizable"];for(const s of t)e[s]!=null&&(this.rowNumberOverrides[s]=e[s])}onHeaderFocus(){this.beans.ariaAnnounce?.announceValue("Press Space to select all cells","ariaSelectAllCells")}onHeaderKeyDown(e){!this.isIntegratedWithSelection||e.key!==hk.SPACE||this.handleFocusAllCellsFromHeader()}onHeaderClick(e){Date.now()-this.lastColumnResized<100||!this.isIntegratedWithSelection||this.getColumn()?.resizing||this.handleFocusAllCellsFromHeader()}handleFocusAllCellsFromHeader(){Fk(this.beans),this.focusFirstRenderedCellAtRowPosition()}refreshCells(e,t){const s=this.getColumn();if(s){if(t){const i=this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(s)],2);i!=null&&this.beans.colResize?.setColumnWidths([{key:s,newWidth:i}],!1,!0,"rowNumbersService")}this.beans.rowRenderer.refreshCells({columns:[s],force:e})}}createDummyElement(e){const t=vk({tag:"div",cls:"ag-cell-value ag-cell"});let s=String(this.beans.rowModel.getRowCount()+1);if(typeof this.rowNumberOverrides.valueFormatter=="function"){const i=gk(this.beans.gos,{data:void 0,value:s,node:null,column:e,colDef:e.colDef});s=this.rowNumberOverrides.valueFormatter(i)}return t.textContent=s,t}createRowNumbersColDef(){const{gos:e,contextMenuSvc:t}=this.beans,s=e.get("enableRtl");return{minWidth:60,width:60,resizable:!1,valueGetter:this.valueGetter.bind(this),contextMenuItems:this.isIntegratedWithSelection||!t?void 0:()=>[],...this.rowNumberOverrides,colId:pk,chartDataType:"excluded",suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPinned:!0,pinned:s?"right":"left",lockPosition:s?"right":"left",editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,suppressSizeToFit:!0,suppressHeaderContextMenu:!0,suppressNavigable:!0,headerClass:this.getHeaderClass(),cellClass:this.getCellClass.bind(this),cellAriaRole:"rowheader"}}valueGetter(e){const t=e.node,s=this.beans.formula?.active,i=t?.pinnedSibling;if(t?.rowPinned&&i){const r=s?i.formulaRowIndex:i.rowIndex;return`${r==null?"-":r+1}`}return String(((s?t?.formulaRowIndex:t?.rowIndex)||0)+1)}getHeaderClass(){const e=["ag-row-number-header"];return this.isIntegratedWithSelection&&e.push("ag-row-number-selection-enabled"),e}getCellClass(e){const{beans:t}=this,{rangeSvc:s,gos:i}=t,{node:r}=e,a=["ag-row-number-cell"],n=i.get("cellSelection");if(!s||!n)return a;this.isIntegratedWithSelection&&a.push("ag-row-number-selection-enabled");const o=s.getCellRanges();if(!o.length)return a;const l=this.beans.visibleCols.allCols.length-1,c=typeof n=="object"&&n.enableHeaderHighlight;for(const d of o)s.isRowInRange({rowIndex:r.rowIndex,rowPinned:r.rowPinned},d)&&(c&&a.push("ag-row-number-range-highlight"),d.columns.length===l&&a.push("ag-row-number-range-selected"));return a}generateRowNumberCols(){const{gos:e,beans:t}=this;if(!$t(t))return[];const s=this.createRowNumbersColDef(),i=s.colId;e.validateColDef(s,i,!0);const r=new dk(s,null,i,!1);return this.createBean(r),[r]}focusFirstRenderedCellAtRowPosition(e){const t=this.beans.editSvc;if(t?.isEditing()&&t.isRangeSelectionEnabledWhileEditing?.()||!e&&(e=yk(this.beans),!e))return;const{beans:s,gos:i}=this,{visibleCols:r,colViewport:a}=s,n=i.get("enableRtl")?r.rightCols:r.leftCols;let o;if(n.length==1){const u=wk(s,e);if(!u)return;o=a.getColsWithinViewport(u)}else o=n;const l=o.find(u=>!jt(u));if(!l)return;const{rowPinned:c,rowIndex:d}=e;setTimeout(()=>{s.focusSvc.setFocusedCell({rowIndex:d,rowPinned:c,column:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})})}destroy(){uu(this.beans,this.columns?.tree),this.rowNumberOverrides=null,super.destroy()}},dn={moduleName:"RowNumbers",version:D,beans:[Ek],dynamicBeans:{rowNumberRowResizer:ck},dependsOn:[B,sk,ik],css:[rk]};import{_ColumnFilterModule as pu}from"ag-grid-community";import{Component as Dk,RefPlaceholder as gu}from"ag-grid-community";import{AgInputTextFieldSelector as Lk,Component as kk,RefPlaceholder as fu,_createIconNoSpan as un,_debounce as Gk,_setDisplayed as Vs}from"ag-grid-community";var Ok={tag:"div",cls:"ag-filter-toolpanel-search",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-filter-toolpanel-search-input"}]},_k=class extends kk{constructor(){super(...arguments),this.eExpand=fu,this.eFilterTextField=fu}postConstruct(){this.setTemplate(Ok,[Lk]);const e=this.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedElementListeners(this.eExpand,{click:this.onExpandClicked.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)})}init(e){this.params=e,this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const{eExpand:e,beans:t}=this;e.appendChild(this.eExpandChecked=un("accordionOpen",t)),e.appendChild(this.eExpandUnchecked=un("accordionClosed",t)),e.appendChild(this.eExpandIndeterminate=un("accordionIndeterminate",t))}showOrHideOptions(){const{params:e,eFilterTextField:t}=this,s=!e.suppressFilterSearch,i=!e.suppressExpandAll,r=this.getLocaleTextFunc();t.setInputPlaceholder(r("searchOoo","Search..."));const a=o=>o.getOriginalParent()&&o.isFilterAllowed(),n=this.beans.colModel.getCols().some(a);Vs(t.getGui(),s),Vs(this.eExpand,i&&n)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=Gk(this,()=>this.dispatchLocalEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()}),300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=this.currentExpandState===0?{type:"collapseAll"}:{type:"expandAll"};this.dispatchLocalEvent(e)}setExpandState(e){this.currentExpandState=e,Vs(this.eExpandChecked,e===0),Vs(this.eExpandUnchecked,e===1),Vs(this.eExpandIndeterminate,e===2)}},Nk={selector:"AG-FILTERS-TOOL-PANEL-HEADER",component:_k};import{Component as Bk,_addGridCommonParams as Vk,_clearElement as Hk,_exists as hn,_getActiveDomElement as zk,_mergeDeep as Uk,_setAriaLabel as Wk,_warn as mu,isProvidedColumnGroup as Cu}from"ag-grid-community";import{Component as Kk,FilterComp as $k,KeyCode as vu,RefPlaceholder as Hs,_clearElement as jk,_createElement as Yk,_createIconNoSpan as pn,_setAriaExpanded as Su,_setAriaLabel as qk,_setAriaRole as Xk,_setDisplayed as st}from"ag-grid-community";var Zk={tag:"div",cls:"ag-filter-toolpanel-instance",children:[{tag:"div",ref:"eFilterToolPanelHeader",cls:"ag-filter-toolpanel-header ag-filter-toolpanel-instance-header",role:"button",attrs:{"aria-expanded":"false"},children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"span",ref:"eFilterName",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilterIcon",cls:"ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon"}]},{tag:"div",ref:"agFilterToolPanelBody",cls:"ag-filter-toolpanel-instance-body ag-filter"}]},bu=class extends Kk{constructor(e,t){super(Zk),this.hideHeader=e,this.expandedCallback=t,this.eFilterToolPanelHeader=Hs,this.eFilterName=Hs,this.agFilterToolPanelBody=Hs,this.eFilterIcon=Hs,this.eExpand=Hs,this.expanded=!1}postConstruct(){const{beans:e,eExpand:t,eFilterIcon:s}=this,i=pn("accordionOpen",e);this.eExpandChecked=i;const r=pn("accordionClosed",e);this.eExpandUnchecked=r,t.appendChild(i),t.appendChild(r);const a=this.getLocaleTextFunc();qk(s,a("ariaFilterActive","Filter Active")),Xk(s,"img")}setColumn(e){this.column=e;const{beans:t,eFilterToolPanelHeader:s,eFilterIcon:i,eExpandChecked:r,hideHeader:a}=this;this.eFilterName.innerText=t.colNames.getDisplayNameForColumn(e,"filterToolPanel",!1)||"",this.addManagedListeners(s,{click:this.toggleExpanded.bind(this),keydown:this.onKeyDown.bind(this)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),this.addInIcon("filterActive",i,e),st(i,this.isFilterActive()),st(r,!1),a?(st(s,!1),s.removeAttribute("tabindex")):s.setAttribute("tabindex","0"),this.addManagedListeners(e,{filterChanged:this.onFilterChanged.bind(this)})}onKeyDown(e){const{key:t}=e,{ENTER:s,SPACE:i,LEFT:r,RIGHT:a}=vu;t!==s&&t!==i&&t!==r&&t!==a||(e.preventDefault(),t===s||t===i?this.toggleExpanded():t===vu.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,s){if(t==null)return;const i=pn(e,this.beans,s);t.appendChild(i)}isFilterActive(){return!!this.beans.colFilter?.isFilterActive(this.column)}onFilterChanged(){st(this.eFilterIcon,this.isFilterActive()),this.dispatchLocalEvent({type:"filterChanged"})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,Su(this.eFilterToolPanelHeader,!0),st(this.eExpandChecked,!0),st(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){const t=Yk({tag:"div",cls:"ag-filter-toolpanel-instance-filter"}),s=this.createManagedBean(new $k(this.column,"TOOLBAR"));this.filterComp=s,s.hasFilter()&&s.getFilter()?.then(i=>{this.underlyingFilter=i,i&&(t.appendChild(s.getGui()),this.agFilterToolPanelBody.appendChild(t),s.afterGuiAttached({container:"toolPanel",suppressFocus:e}))})}collapse(){if(!this.expanded)return;this.expanded=!1,Su(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),st(this.eExpandChecked,!1),st(this.eExpandUnchecked,!0);const e=this.filterComp;e?.afterGuiDetached(),this.destroyBean(e),this.expandedCallback()}removeFilterElement(){jk(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}onPanelHidden(){if(!this.expanded)return;const e=this.underlyingFilter;e&&e.afterGuiDetached?.()}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.column&&this.expanded&&this.collapse()}};import{Component as Jk,RefPlaceholder as Qk,_clearElement as eG,_createIconNoSpan as tG,_getShouldDisplayTooltip as sG,_setAriaLabel as iG,_setAriaRole as rG,isProvidedColumnGroup as Yi}from"ag-grid-community";var it=class extends Jk{constructor(e,t,s,i,r){super(),this.columnGroup=e,this.childFilterComps=t,this.expandedCallback=s,this.depth=i,this.showingColumn=r,this.filterGroupComp=Qk}postConstruct(){const e={cssIdentifier:"filter-toolpanel",direction:"vertical"};this.setTemplate({tag:"div",cls:"ag-filter-toolpanel-group-wrapper",children:[{tag:"ag-group-component",ref:"filterGroupComp"}]},[H],{filterGroupComp:e}),this.setGroupTitle();const{filterGroupComp:t,depth:s,childFilterComps:i,gos:r}=this;t.setAlignItems("stretch"),t.addCss(`ag-filter-toolpanel-group-level-${s}`),t.getGui().style.setProperty("--ag-indentation-level",String(s)),t.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${s}-header`);for(const n of i)t.addItem(n),n.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${s+1}-header`),n.getGui().style.setProperty("--ag-indentation-level",String(s+1));const a=this.showingColumn?this.columnGroup:void 0;this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"filterToolPanelColumnGroup",shouldDisplayTooltip:sG(r,()=>t.getGui().querySelector(".ag-group-title")),getAdditionalParams:()=>({colDef:a?.getColDef(),column:a})})),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filterActive")}setupTooltip(){if(!this.showingColumn)return;const e=()=>{this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip)};e(),this.addManagedEventListeners({newColumnsLoaded:e})}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}onPanelHidden(){for(const e of this.childFilterComps)e.onPanelHidden()}isColumnGroup(){return Yi(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName??""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const t=tG(e,this.beans);if(t){t.classList.add("ag-filter-toolpanel-group-instance-header-icon");const s=this.getLocaleTextFunc();iG(t,s("ariaFilterActive","Filter Active")),rG(t,"img")}this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){for(const t of this.childFilterComps)t instanceof bu&&e(t)}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(s=>s.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(s=>s.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:e,collapsed:t})}getColumns(){return Yi(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){for(const e of this.getColumns())this.addManagedListeners(e,{filterChanged:()=>this.refreshFilterClass()});Yi(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){const e=this.getColumns(),t=()=>e.some(s=>s.isFilterActive());this.filterGroupComp.toggleCss("ag-has-filter",t())}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){const e=this.columnGroup,t=Yi(e)?this.getColumnGroupName(e):this.getColumnName(e);this.filterGroupName=t,this.filterGroupComp.setTitle(t||"")}getColumnGroupName(e){return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.beans.colNames.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),eG(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},aG=class extends Bk{constructor(){super({tag:"div",cls:"ag-filter-list-panel"}),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(e){this.colModel=e.colModel}init(e){this.initialised=!0;const t=Vk(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});Uk(t,e),this.params=t,t.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:s=>{s.key==="filters"&&!s.visible&&this.onPanelHidden()},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.colModel.ready&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}const e=this.colModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){pc(this.colModel,this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel.getColDefColTree();this.recreateFilters(e)}setFiltersLayout(e){const t=hc(this.colModel,e);this.recreateFilters(t)}recreateFilters(e){const t=zk(this.beans);this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const s=this.getExpansionState();this.destroyFilters();const i=this.recursivelyAddComps(e,0,s);this.filterGroupComps=i;const r=i.length;if(r){for(const n of i)this.appendChild(n);this.setFirstAndLastVisible(0,r-1)}const a=this.searchFilterText;hn(a)&&this.searchFilters(a),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,s){return e.map(i=>{if(Cu(i))return this.recursivelyAddFilterGroupComps(i,t,s)?.flatMap(l=>l)??[];const r=i;if(!this.shouldDisplayFilter(r))return[];const a=t===0,n=new bu(a,()=>this.onFilterExpanded());if(this.createBean(n),n.setColumn(r),s.get(r.getId())&&n.expand(),t>0)return n;const o=this.createBean(new it(r,[n],this.onGroupExpanded.bind(this),t,!0));return o.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.get(o.getFilterGroupId())||o.collapse(),o}).flatMap(i=>i)}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),s=e("filters","Filters"),l=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;Wk(this.getAriaElement(),`${t} ${l} ${s}`)}recursivelyAddFilterGroupComps(e,t,s){if(!this.filtersExistInChildren(e.getChildren()))return;if(e.getColGroupDef()?.suppressFiltersToolPanel)return[];const r=e.isPadding()?t:t+1,a=this.recursivelyAddComps(e.getChildren(),r,s).flatMap(l=>l);if(e.isPadding())return a;const n=new it(e,a,this.onGroupExpanded.bind(this),t,!1);this.createBean(n),n.addCssClassToTitleBar("ag-filter-toolpanel-header");const o=s.get(n.getFilterGroupId());return(this.isInitialState&&!o||o===!1)&&n.collapse(),[n]}filtersExistInChildren(e){return e.some(t=>Cu(t)?this.filtersExistInChildren(t.getChildren()):this.shouldDisplayFilter(t))}shouldDisplayFilter(e){const t=e.getColDef()?.suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:s,expandedGroupIds:i}=this.params.initialState;for(const r of s)e.set(r,!0);for(const r of i)e.set(r,!0);return e}const t=s=>{e.set(s.getFilterGroupId(),s.isExpanded());for(const i of s.getChildren())i instanceof it?t(i):e.set(i.getColumn().getId(),i.isExpanded())};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const s=[],i=r=>{const a=r.getFilterGroupId();(!t||t.includes(a))&&(e&&r.isColumnGroup()?r.expand():r.collapse(),s.push(a));for(const o of r.getChildren())o instanceof it&&i(o)};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(a=>s.indexOf(a)<0);r.length>0&&mu(166,{unrecognisedGroupIds:r})}}expandFilters(e,t){const s=[],i=r=>{if(r instanceof it){let o=!1;for(const l of r.getChildren())i(l)&&(e?(r.expand(),o=!0):r.isColumnGroup()||r.collapse());return o}const a=r.getColumn().getColId(),n=!t||t.includes(a);return n&&(e?r.expand():r.collapse(),s.push(a)),n};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(a=>s.indexOf(a)<0);r.length>0&&mu(167,{unrecognisedColIds:r})}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const s=r=>{if(r.isColumnGroup()){r.isExpanded()?e++:t++;for(const a of r.getChildren())a instanceof it&&s(a)}};this.filterGroupComps.forEach(s);let i;e>0&&t>0?i=2:t>0?i=1:i=0,this.dispatchLocalEvent({type:"groupExpanded",state:i})}performFilterSearch(e){this.searchFilterText=hn(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=a=>!hn(e)||a.toLowerCase().indexOf(e)!==-1,s=(a,n)=>{if(!(a instanceof it))return t(a.getColumnFilterName()||"");const o=a.getChildren(),l=t(a.getFilterGroupName()),c=n||l;if(c){a.hideGroup(!1);for(let u=0;u<o.length;u++)s(o[u],c),a.hideGroupItem(!1,u);return!0}let d=!1;return o.forEach((u,h)=>{const p=s(u,n);a.hideGroupItem(!p,h),p&&(d=!0)}),a.hideGroup(!d),d};let i,r;this.filterGroupComps.forEach((a,n)=>{s(a,!1);const o=a.getGui()?.classList.contains("ag-hidden");i===void 0?o||(i=n,r=n):!o&&r!==n&&(r=n)}),this.setFirstAndLastVisible(i,r),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((s,i)=>{s.removeCss("ag-first-group-visible"),s.removeCss("ag-last-group-visible"),i===e&&s.addCss("ag-first-group-visible"),i===t&&s.addCss("ag-last-group-visible")})}onPanelHidden(){for(const e of this.filterGroupComps)e.onPanelHidden()}getExpandedFiltersAndGroups(){const e=[],t=new Set,s=i=>{if(i instanceof it){for(const a of i.getChildren())s(a);const r=i.getFilterGroupId();i.isExpanded()&&!t.has(r)&&e.push(r)}else i.isExpanded()&&t.add(i.getColumn().getColId())};return this.filterGroupComps.forEach(s),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),Hk(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},nG={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:aG},oG=".ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>:where(.ag-filter-icon),>:where(.ag-filter-toolpanel-expand),>:where(.ag-filter-toolpanel-search-input),>:where(.ag-header-cell-text){align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}",lG={tag:"div",cls:"ag-filter-toolpanel",children:[{tag:"ag-filters-tool-panel-header",ref:"filtersToolPanelHeaderPanel"},{tag:"ag-filters-tool-panel-list",ref:"filtersToolPanelListPanel"}]},cG=class extends Dk{constructor(){super(lG,[Nk,nG]),this.filtersToolPanelHeaderPanel=gu,this.filtersToolPanelListPanel=gu,this.initialised=!1,this.listenerDestroyFuncs=[],this.registerCSS(oG)}init(e){if(this.initialised){for(const o of this.listenerDestroyFuncs)o();this.listenerDestroyFuncs=[]}this.initialised=!0;const s={...{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1},...e};this.params=s;const{filtersToolPanelHeaderPanel:i,filtersToolPanelListPanel:r}=this;i.init(s),r.init(s);const{suppressExpandAll:a,suppressFilterSearch:n}=s;a&&n&&i.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(i,{expandAll:()=>r.expandFilterGroups(!0),collapseAll:()=>r.expandFilterGroups(!1),searchChanged:o=>r.performFilterSearch(o.searchText)}),...this.addManagedListeners(r,{filterExpanded:s.onStateUpdated,groupExpanded:o=>{i.setExpandState(o.state),s.onStateUpdated()}}))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}};import{BeanStub as dG,FilterComp as uG}from"ag-grid-community";var hG=class extends dG{constructor(){super(...arguments),this.beanName="filterPanelSvc",this.states=new Map,this.orderedStates=[],this.initialStateApplied=!1,this.columnsLoaded=!1,this.isActive=!1}postConstruct(){if(!this.gos.get("enableFilterHandlers"))return;const e=this.updateFilterStates.bind(this),t=()=>this.dispatchStatesUpdates(void 0,!0),s=this.onFilterDestroyed.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>{this.columnsLoaded=!0,this.initialStateApplied||this.applyState(),e()},dataTypesInferred:e,filterChanged:e,filterDestroyed:s,filterHandlerDestroyed:s,filterOpened:t,filterClosed:t});const i=({column:r})=>{this.states.get(r.getColId())?.refresh?.(),t()};this.addManagedListeners(this.beans.colFilter,{filterStateChanged:i,filterModelAsStringChanged:i})}updateParams(e,t){this.params=e;let s=!1;if(t&&(this.currState=t,this.columnsLoaded)){const i=new Set(t.filters?.map(r=>r.colId));for(const r of this.getIds())i.has(r)||this.remove(r);this.clear(),this.applyState(),this.updateFilterStates(),s=!0}s||this.dispatchStatesUpdates(),this.beans.colFilter?.setGlobalButtons(!!e.buttons?.length)}getIds(){return Array.from(this.states.keys())}getAvailable(){const e=this.beans,t=[];for(const s of e.colModel.getColDefCols()??[]){const i=s.getColId();s.isFilterAllowed()&&!s.colDef.suppressFiltersToolPanel&&!this.states.get(i)&&t.push({id:i,name:yu(e,s)})}return t}add(e){this.createFilter(e,!0),this.dispatchStatesUpdates(e)}remove(e){const{states:t,orderedStates:s,beans:{colFilter:i,selectableFilter:r}}=this,a=t.get(e);if(!a)return;a.destroy?.();const n=a.state.column;t.delete(e),r?.clearActive(e),i?.destroyFilter(n),this.eventSvc.dispatchEvent({type:"filterSwitched",column:n});const o=s.indexOf(e);s.splice(o,1);const l=s[o];this.dispatchStatesUpdates(l)}getState(e){return this.states.get(e)?.state}updateFilterState(e,t,s,i){const r=this.getState(e);r&&(r[t]=s,i||this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:r}))}expand(e,t){const s=this.states.get(e);if(!s)return;s.destroy?.();const{handler:i,state:{column:r}}=s,a=this.createFilterState(r,i,t);this.states.set(e,a),this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:a.state})}updateType(e,t){const s=this.states.get(e);if(!s)return;const i=s.state;if(i.expanded===!1)return;const r=i.filterDefs;if(!r)return;const{colFilter:a,selectableFilter:n}=this.beans;n?.setActive(e,r,t),a.filterParamsChanged(e,"columnFilter");const o=i.column;this.eventSvc.dispatchEvent({type:"filterSwitched",column:o});const l=this.states.get(e);if(!l)return;const c=l.state;this.dispatchLocalEvent({type:"filterPanelStateChanged",id:e,state:c})}getActions(){const e=this.params?.buttons;if(!e?.length)return;const t=!!this.beans.colFilter?.canApplyAll();return{actions:e,canApply:t}}doAction(e){this.beans.colFilter?.updateAllModels(e)}getGridState(){const e=[];return this.states.forEach((t,s)=>{e.push({colId:s,expanded:t.state.expanded})}),{filters:e}}createFilter(e,t){const s=this.createFilterStateWrapper(e,t);s&&(this.states.set(e,s),this.orderedStates.push(e))}createFilterStateWrapper(e,t){const{colModel:s,colFilter:i}=this.beans,r=s.getColDefCol(e);if(r&&!r.colDef.suppressFiltersToolPanel){const a=i.getHandler(r,!0);if(a)return this.createFilterState(r,a,t)}}updateFilterStates(){if(!this.params)return;const e=this.beans.colFilter.getModel(),t=new Set;for(const s of Object.keys(e)){const i=this.states.get(s);i?i.refresh?.():this.createFilter(s),t.add(s)}this.states.forEach((s,i)=>{t.has(i)||s.refresh?.()}),this.dispatchStatesUpdates()}createFilterState(e,t,s){const i=this.beans,{colFilter:r,selectableFilter:a}=i,n=yu(i,e),o=e.getColId(),l=()=>!!this.params?.buttons&&r.hasUnappliedModel(o),c=l();if(s){const d=e.colDef,{filterDefs:u,activeFilterDef:h}=a?.getDefs(e,d)??{},p=this.createBean(new uG(e,"TOOLBAR",!0));return{state:{column:e,name:n,isEditing:c,expanded:s,detail:p.getGui(),activeFilterDef:h,filterDefs:u,afterGuiAttached:p.afterGuiAttached.bind(p),afterGuiDetached:p.afterGuiDetached.bind(p)},handler:t,refresh:()=>{this.updateFilterState(o,"isEditing",l())},destroy:()=>this.destroyBean(p)}}else{const d=e.getColId(),u=()=>t.getModelAsString?.(r.getStateForColumn(d).model,"filterToolPanel")??"";return{state:{column:e,name:n,isEditing:c,expanded:!1,summary:u()},handler:t,refresh:()=>{this.updateFilterState(d,"isEditing",l(),!0),this.updateFilterState(d,"summary",u())}}}}onFilterDestroyed({column:e,source:t}){const{colFilter:s,filterManager:i}=this.beans;if(!s?.isAlive()||!i?.isFilterAllowed(e))return;const r=this.states,a=e.getColId(),n=r.get(a);if(n){const o=this.createFilterStateWrapper(a,n.state.expanded);o?(n.destroy?.(),r.set(a,o)):this.remove(a),t==="api"&&this.dispatchStatesUpdates()}}dispatchStatesUpdates(e,t){this.dispatchLocalEvent({type:"filterPanelStatesChanged",activeId:e,action:t})}applyState(){if(this.params&&this.columnsLoaded){this.initialStateApplied=!0;for(const{colId:e,expanded:t}of this.currState?.filters??[])this.createFilter(e,t)}}destroy(){this.clear(),this.params=void 0,this.currState=void 0,super.destroy()}clear(){const{states:e,orderedStates:t}=this;e.forEach(s=>s.destroy?.()),e.clear(),t.length=0}};function yu(e,t){return e.colNames.getDisplayNameForColumn(t,"filterToolPanel")??t.getColId()}import{BeanStub as pG,_addGridCommonParams as gG,_getDefaultSimpleFilter as fG,_getFilterParamsForDataType as mG,_isSetFilterByDefault as CG,_warn as vG}from"ag-grid-community";import{_removeFromParent as SG,_translate as bG}from"ag-grid-community";var yG={addFilterCard:"Add Filter",ariaLabelAddFilterField:"Add Filter Field",ariaLabelFilterCardDelete:"Delete Filter",ariaLabelFilterCardHasEdits:"Has Edits",agTextColumnFilterDisplayName:"Simple Filter",agNumberColumnFilterDisplayName:"Simple Filter",agDateColumnFilterDisplayName:"Simple Filter",agSetColumnFilterDisplayName:"Selection Filter",agMultiColumnFilterDisplayName:"Combo Filter",addFilterPlaceholder:"Search columns..."};function Yt(e,t){return bG(e,yG,t)}function wG(e,t,s){let i=0;for(let r=0;r<s.length;r++){const a=s[r];a===t[i]?i++:SG(a)}for(;i<t.length;)e.appendChild(t[i++])}var xG=class extends pG{constructor(){super(...arguments),this.beanName="selectableFilter",this.selectedFilters=new Map,this.valueGetters=new Map}postConstruct(){const{gos:e,selectedFilters:t}=this,s=e.get("initialState")?.filter?.selectableFilters??{};for(const i of Object.keys(s))t.set(i,s[i])}getFilterValueGetter(e){return this.valueGetters.get(e)}isSelectable(e){return e.filter==="agSelectableColumnFilter"}getFilterDef(e,t){return this.getDefs(e,t).activeFilterDef}getDefs(e,t,s){if(!this.isSelectable(t))return;const i=this.beans,{gos:r,dataTypeSvc:a,colFilter:n}=i;let o=t.filterParams;const l=e.colDef;typeof o=="function"&&(o=o(gG(r,{column:e,colDef:l})));const c=a?.getBaseDataType(e),d=a?.getDataTypeDefinition(e),u=a?.getFormatValue(c),{filters:h,defaultFilterParams:p,defaultFilterIndex:g}=o??{},f=S=>{const{filter:b,filterParams:y,name:w,filterValueGetter:M=l.filterValueGetter}=S,T=p?{...p,...y}:y;let F;d&&u&&(b==="agMultiColumnFilter"?F=i.multiFilter?.getParamsForDataType(T,M,d,u):F=mG(b,T,M,d,u,i,this.getLocaleTextFunc()));let I;if(!w){let E=b;typeof b=="boolean"&&(E=n?.getDefaultFilterFromDataType(()=>c)),typeof E=="string"?I=Yt(this,`${E}DisplayName`):(vG(280,{colId:e.getColId()}),I="")}return p||F||I?{...S,filterParams:T,name:I??w,...F}:S},m=(h??this.getDefaultFilters(e)).map(f);let C=s??this.selectedFilters.get(e.getColId())??g??(!h&&CG(r)?1:0);C>=m.length&&(C=0);const v=m[C];return{filterDefs:m,activeFilterDef:v}}setActive(e,t,s,i){const r=t.indexOf(s);if(r<0)return;const{selectedFilters:a,valueGetters:n}=this;a.set(e,r);const o=s.filterValueGetter;o?n.set(e,o):n.delete(e),i||this.onChange()}clearActive(e){const{selectedFilters:t,valueGetters:s}=this;t.delete(e),s.delete(e),this.onChange()}getState(){return Object.fromEntries(this.selectedFilters)}setState(e){this.clearAll();const t=this.beans.colModel;for(const s of Object.keys(e)){const i=t.getColDefCol(s);if(i){const r=this.getDefs(i,i.colDef,e[s]);r&&this.setActive(s,r.filterDefs,r.activeFilterDef,!0)}}}destroy(){this.clearAll(),super.destroy()}clearAll(){const{selectedFilters:e,valueGetters:t}=this;e.clear(),t.clear()}onChange(){this.dispatchLocalEvent({type:"selectedFilterChanged"})}getDefaultFilters(e){const t=this.beans,{gos:s,dataTypeSvc:i}=t,r=s.isModuleRegistered("MultiFilter"),a=i?.getBaseDataType(e);return[{filter:fG(a,!1)},{filter:"agSetColumnFilter"},...r?[{filter:"agMultiColumnFilter"}]:[]]}};import{Component as FG,_warn as RG}from"ag-grid-community";import{Component as AG,FilterButtonComp as MG,RefPlaceholder as TG,_focusInto as wu,_getActiveDomElement as PG,_isNothingFocused as xu,_removeFromParent as IG,_translateForFilter as EG}from"ag-grid-community";import{Component as DG,_clearElement as Fu,_createElement as LG,_createIconNoSpan as kG}from"ag-grid-community";var GG={tag:"div",cls:"ag-filter-card ag-filter-card-add"},OG=class extends DG{constructor(e){super(GG),this.options=new Map,this.setOptions(e)}postConstruct(){this.showButton()}refresh(e){this.setOptions(e);const{eSelect:t,options:s}=this;t&&t.setValueList({valueList:Array.from(s.keys()),refresh:!0})}showButton(){Fu(this.getGui()),this.destroySelect();const e=LG({tag:"button",cls:"ag-button ag-standard-button ag-filter-add-button",children:[{tag:"span",children:[()=>kG("filterAdd",this.beans)]},{tag:"span",cls:"ag-filter-add-button-label",children:Yt(this,"addFilterCard")}]});this.activateTabIndex([e]);const t=this.showSelect.bind(this);e.addEventListener("click",t),this.removeButton=()=>{e.removeEventListener("click",t)},this.appendChild(e),e.focus()}showSelect(){Fu(this.getGui()),this.destroyButton();const e="ariaLabelAddFilterField",t={className:"ag-filter-add-select",pickerType:"virtual-list",pickerAriaLabelKey:e,pickerAriaLabelValue:Yt(this,e),placeholder:Yt(this,"addFilterPlaceholder"),value:"",valueList:Array.from(this.options.keys()),searchType:"matchAny",allowTyping:!0,filterList:!0,highlightMatch:!0,valueFormatter:i=>this.options.get(i)},s=this.createManagedBean(new Ri(t));this.eSelect=s,this.appendChild(s.getGui()),s.showPicker(),s.getFocusableElement().focus(),s.addManagedListeners(s,{fieldPickerValueSelected:({value:i})=>this.dispatchLocalEvent({type:"filterSelected",id:i}),pickerHidden:()=>{this.showButton()}})}setOptions(e){const t=this.options;t.clear();for(const{id:s,name:i}of e)t.set(s,i)}destroySelect(){this.eSelect=this.destroyBean(this.eSelect)}destroyButton(){this.removeButton=this.removeButton?.()}destroy(){this.destroySelect(),this.destroyButton(),super.destroy()}};import{Component as _G,RefPlaceholder as qt,_clearElement as NG,_createIcon as gn,_removeFromParent as BG,_setAriaControls as Ru,_setAriaExpanded as VG,_setAriaLabel as Au,_setDisplayed as HG}from"ag-grid-community";import{AgSelectSelector as zG,Component as UG,RefPlaceholder as WG,_removeFromParent as KG}from"ag-grid-community";var $G={tag:"div",cls:"ag-filter-card-body",children:[{tag:"ag-select",cls:"ag-filter-type-select",ref:"eFilterType"}]},jG=class extends UG{constructor(){super(...arguments),this.eFilterType=WG}postConstruct(){const e={onValueChange:t=>this.dispatchLocalEvent({type:"filterTypeChanged",filterDef:t})};this.setTemplate($G,[zG],{eFilterType:e}),this.eFilterType.setDisplayed(!1)}refresh(e){const t=this.state;this.state=e;const{activeFilterDef:s,filterDefs:i,detail:r,afterGuiAttached:a,afterGuiDetached:n}=e,{activeFilterDef:o,filterDefs:l,detail:c}=t??{},d=this.eFilterType;if(i!==l){d.clearOptions();const u=i?.map(h=>({value:h,text:h.name}));u&&d.clearOptions().addOptions(u).setValue(s,!0),d.setDisplayed(!!u)}else s!==o&&d.setValue(s,!0);r!==c&&(c&&(KG(c),n()),this.appendChild(r),a({container:"newFiltersToolPanel",suppressFocus:!0}))}};import{Component as YG}from"ag-grid-community";var qG={tag:"div",cls:"ag-filter-card-summary",attrs:{"aria-hidden":"true"}},XG=class extends YG{constructor(){super(qG)}refresh(e){this.getGui().textContent=e.summary}},ZG={tag:"div",cls:"ag-filter-card",children:[{tag:"div",cls:"ag-filter-card-header",role:"presentation",children:[{tag:"div",cls:"ag-filter-card-heading",role:"heading",attrs:{"aria-level":"2"},children:[{tag:"button",ref:"eExpand",cls:"ag-button ag-filter-card-expand",children:[{tag:"span",ref:"eTitle",cls:"ag-filter-card-title"},{tag:"span",ref:"eEditing",cls:"ag-filter-card-editing-icon"},{tag:"span",ref:"eExpandIcon",cls:"ag-filter-card-expand-icon"}]}]},{tag:"button",ref:"eDelete",cls:"ag-button ag-filter-card-delete",children:[{tag:"span",ref:"eDeleteIcon",cls:"ag-filter-card-delete-icon"}]}]}]},JG=class extends _G{constructor(e){super(ZG),this.id=e,this.eTitle=qt,this.eExpand=qt,this.eDelete=qt,this.eExpandIcon=qt,this.eDeleteIcon=qt,this.eEditing=qt}postConstruct(){const{beans:e,eDelete:t,eExpand:s,eDeleteIcon:i,eEditing:r,id:a}=this,n=e.filterPanelSvc;Au(t,Yt(this,"ariaLabelFilterCardDelete")),i.appendChild(gn("close",e,null)),this.activateTabIndex([s,t]),this.addManagedElementListeners(s,{click:()=>n.expand(a,!this.state?.expanded)}),this.addManagedElementListeners(t,{click:()=>n.remove(a)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),r.appendChild(gn("filterCardEditing",e,null))}refresh(e){const{eExpand:t,eEditing:s,state:i,beans:r}=this;this.state=e;const{name:a,expanded:n,isEditing:o}=e;this.eTitle.textContent=a,HG(s,o),(!i||n!==i.expanded)&&this.toggleExpand(e);let l=n?null:`${a} ${e.summary}`;o&&(l=`${l??a}. ${Yt(this,"ariaLabelFilterCardHasEdits")}`),Au(t,l);const c=u=>{if(u)return BG(u.getGui()),this.destroyBean(u)},d=(u,h,p)=>(u||(u=this.createBean(new h),p?.(u),this.appendChild(u.getGui())),u.refresh(e),u);if(e.expanded){this.summaryComp=c(this.summaryComp);const u=d(this.detailComp,jG,p=>p.addManagedListeners(p,{filterTypeChanged:({filterDef:g})=>r.filterPanelSvc.updateType(this.id,g)}));this.detailComp=u;const h=`ag-${this.getCompId()}-filter`;u.getGui().id=h,Ru(t,h)}else this.detailComp=c(this.detailComp),this.summaryComp=d(this.summaryComp,XG),Ru(t,null)}toggleExpand(e){const t=!!e.expanded,{eExpandIcon:s,eExpand:i,beans:r}=this;NG(s),s.appendChild(gn(t?"filterCardCollapse":"filterCardExpand",r,null)),VG(i,t)}onFilterOpened(e){const{state:t,beans:s,id:i}=this;e.source==="COLUMN_MENU"&&e.column===t?.column&&t?.expanded&&s.filterPanelSvc.expand(i,!1)}destroy(){this.detailComp=this.destroyBean(this.detailComp),this.summaryComp=this.destroyBean(this.summaryComp),this.state=void 0,super.destroy()}};function QG(e){return!!e?.id}function eO(e){return!!e?.action}var tO={tag:"div",cls:"ag-filter-panel",children:[{tag:"div",cls:"ag-filter-panel-container",ref:"eContainer"}]},sO=class extends AG{constructor(){super(tO),this.eContainer=TG,this.filters=new Map}refresh(e){if(eO(e)){this.refreshActions();return}if(QG(e)){this.filters.get(e.id)?.refresh(e.state);return}const{eContainer:t,filters:s,beans:i}=this,r=i.filterPanelSvc,a=r.getIds(),n=new Map,o=!xu(i),l=o?PG(i):void 0,c=o&&t.contains(l),d=[],u=[];for(const C of a){const v=s.get(C)??this.createBean(new JG(C));v.refresh(r.getState(C)),n.set(C,v),u.push(v.getGui())}this.filters=n;const h=[];s.forEach((C,v)=>{d.push(C.getGui()),n.has(v)||h.push(C)});let p=this.addFilterComp;p&&d.push(p.getGui());const g=r.getAvailable();g.length?(p||(p=this.createBean(new OG(g)),p.addManagedListeners(p,{filterSelected:({id:C})=>r.add(C)})),p.refresh(g),u.push(p.getGui())):p=this.destroyBean(p),this.addFilterComp=p,wG(t,u,d);for(const C of h)this.destroyBean(C);const f=e?.activeId,m=f&&n.get(f)?.getGui();m?wu(m):c&&xu(i)&&wu(u[u.length-1]??t),this.refreshActions()}refreshActions(){const e=this.beans.filterPanelSvc,{actions:t,canApply:s}=e.getActions()??{};let i=this.buttonComp;if(t?.length){const r=t.map(a=>({type:a,label:EG(this,`${a}Filter`)}));if(!i){i=this.createBean(new MG({className:"ag-filter-panel-buttons"})),this.getGui().appendChild(i.getGui());const a={};for(const n of["apply","clear","reset","cancel"])a[n]=()=>e.doAction(n);i.addManagedListeners(i,a)}i.updateButtons(r),i.updateValidity(s!==!1)}else i&&(IG(i.getGui()),i=this.destroyBean(i));this.buttonComp=i}destroy(){this.beans.filterPanelSvc?.clear?.(),this.addFilterComp=this.destroyBean(this.addFilterComp),this.buttonComp=this.destroyBean(this.buttonComp);const e=this.filters;e.forEach(t=>this.destroyBean(t)),e.clear(),super.destroy()}},iO=".ag-filter-panel{display:flex;flex-direction:column;width:100%;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-filter-panel .ag-simple-filter-body-wrapper{padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel .ag-mini-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-vertical-spacing)}.ag-filter-panel-container{display:flex;flex:1;flex-direction:column;gap:var(--ag-widget-container-vertical-padding);overflow:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-card{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius)}.ag-filter-card-header{align-items:center;display:flex;flex-direction:row;gap:var(--ag-spacing);padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-heading{flex:1;overflow:hidden;padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));padding-top:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing))}:where(.ag-ltr) .ag-filter-card-heading{padding-left:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-heading{padding-right:var(--ag-widget-horizontal-spacing)}.ag-filter-card-expand{align-items:center;display:flex;flex-direction:row;width:100%}.ag-filter-card-title{font-weight:var(--ag-header-font-weight);overflow:hidden;text-overflow:ellipsis}.ag-filter-card-expand-icon{display:flex;flex:1;justify-content:end}.ag-filter-card-editing-icon{margin:0 var(--ag-spacing)}.ag-filter-card-delete-icon,.ag-filter-card-editing-icon,.ag-filter-card-expand-icon,.ag-filter-card-summary{color:var(--ag-filter-panel-card-subtle-color)}.ag-filter-card-delete-icon,.ag-filter-card-expand-icon{transition:color .25s ease-in-out}.ag-filter-card-delete-icon:hover,.ag-filter-card-expand-icon:hover,.ag-filter-card-heading:hover .ag-filter-card-expand-icon{color:var(--ag-filter-panel-card-subtle-hover-color)}.ag-filter-add-button,.ag-filter-card-delete,.ag-filter-card-expand{border-radius:var(--ag-button-border-radius)}.ag-filter-card-summary,.ag-filter-type-select{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-filter-card-delete{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-delete{margin-left:var(--ag-widget-horizontal-spacing)}.ag-filter-card-summary{margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-type-select{padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-add{border:0;padding:0}.ag-filter-add-button{align-items:center;display:flex;flex-direction:row;line-height:1.5;width:100%}:where(.ag-ltr) .ag-filter-add-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-add-button-label{margin-right:var(--ag-spacing)}.ag-filter-add-select{border:0;.ag-rich-select-value{border:0;padding:calc(((1.5*var(--ag-font-size) + 2*var(--ag-button-vertical-padding)) - var(--ag-input-height))/2) var(--ag-spacing)}}:where(.ag-ltr) .ag-filter-add-select{.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)!important}}:where(.ag-rtl) .ag-filter-add-select{.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)!important}}.ag-filter-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-buttons-button{line-height:1.5}.ag-filter-panel .ag-filter-panel-buttons-apply-button{background-color:var(--ag-filter-panel-apply-button-background-color);color:var(--ag-filter-panel-apply-button-color)}.ag-filter-panel-buttons:where(:last-child),.ag-filter-panel-container:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-panel .ag-set-filter-body-wrapper,.ag-filter-panel .ag-simple-filter-body-wrapper{padding-bottom:var(--ag-widget-container-vertical-padding)}",rO=class extends FG{constructor(){super(),this.registerCSS(iO)}init(e){if(!this.gos.get("enableFilterHandlers")){RG(282);return}const t=this.beans.filterPanelSvc;t.isActive=!0,this.addDestroyFunc(()=>{t.isActive=!1}),this.updateParams(e,e.initialState);const s=this.createManagedBean(new sO);this.filterPanel=s;const i=r=>{s.refresh(r),e.onStateUpdated()};i(),this.addManagedListeners(t,{filterPanelStatesChanged:i,filterPanelStateChanged:i})}getGui(){return this.filterPanel?.getGui()}refresh(e){return this.updateParams(e,e.initialState),!0}updateParams(e,t){this.beans.filterPanelSvc?.updateParams(e,t)}getState(){return this.beans.filterPanelSvc?.getGridState()??{}}},Mu={moduleName:"FiltersToolPanel",version:D,userComponents:{agFiltersToolPanel:cG},icons:{filtersToolPanel:"filter"},dependsOn:[Rs,B,pu]},Tu={moduleName:"NewFiltersToolPanel",version:D,userComponents:{agNewFiltersToolPanel:rO},beans:[hG,xG],icons:{filterAdd:"filter-add",filtersToolPanel:"filter",richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading",filterCardExpand:"chevron-down",filterCardCollapse:"chevron-up",filterCardEditing:"edit"},dependsOn:[Rs,B,pu]};import{EventApiModule as aO}from"ag-grid-community";import{Component as nO,RefPlaceholder as oO,_getGridRegisteredModules as lO,_missing as cO,_warn as Pu,createGrid as dO}from"ag-grid-community";import{BeanStub as uO,_addGridCommonParams as hO,_focusInto as pO,_isSameRow as gO,_missing as fO,_warn as qi}from"ag-grid-community";var Iu=class extends uO{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,t.pinned==null&&(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){const t=this.params,s={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},i={rowIndex:e.rowIndex,rowPinned:e.rowPinned};gO(s,i)&&pO(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",s=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",i=this.comp;i.toggleCss(t,!0),i.toggleDetailGridCss(s,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;if(e=="everything"||e=="nothing"||e=="rows"){this.refreshStrategy=e;return}e!=null&&qi(170,{providedStrategy:e}),this.refreshStrategy="rows"}createDetailGrid(){const{params:e,gos:t}=this;if(fO(e.detailGridOptions)){qi(171);return}const s=t.get("theme"),i=e.detailGridOptions.theme;i&&i!==s&&qi(267);const r={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:s};t.get("detailRowAutoHeight")&&(r.domLayout="autoHeight"),this.comp.setDetailGrid(r)}registerDetailWithMaster(e){const{params:t,beans:{selectionSvc:s,findSvc:i,expansionSvc:r}}=this,a=t.node.id,n=t.api,o={id:a,api:e},l=t.node;if(n.isDestroyed())return;n.addDetailGridInfo(a,o),l.detailGridInfo=o;const c=l.parent;i?.registerDetailGrid(l,e);function d(){c&&s?.refreshMasterNodeState(c)}function u({source:p}){if(p==="expandAll")return e.expandAll();if(p==="collapseAll")return e.collapseAll()}function h({node:p,source:g}){p!==c||g==="masterDetail"||e.isDestroyed()||s?.setDetailSelectionState(c,t.detailGridOptions,e)}e.addEventListener("firstDataRendered",()=>{if(e.isDestroyed()||n.isDestroyed())return;s?.setDetailSelectionState(c,t.detailGridOptions,e),e.addEventListener("selectionChanged",d),n.addEventListener("rowSelected",h),e.isModuleRegistered("CsrmSsrmSharedApiModule")&&(n.addEventListener("expandOrCollapseAll",u),r?.setDetailsExpansionState(e))}),this.addManagedListeners(c,{masterChanged:p=>{p.node.master||this.onDestroy(o)}}),this.addDestroyFunc(()=>this.onDestroy(o))}onDestroy(e){const{params:t}=this,s=t.node,i=t.api;s.detailGridInfo===e&&(i.isDestroyed()||i.removeDetailGridInfo(s.id),s.detailGridInfo=null)}loadRowData(){this.loadRowDataVersion++;const e=this.loadRowDataVersion,t=this.params;if(t.detailGridOptions?.rowModelType==="serverSide"){t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}const s=t.getDetailRowData;if(!s){qi(172);return}const i=a=>{this.loadRowDataVersion===e&&this.comp.setRowData(a)},r={node:t.node,data:t.node.data,successCallback:i,context:hO(this.gos,{}).context};s(r)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},mO=class{constructor(e){this.parentWrapper=e}wrap(e,t,s,i){return this.parentWrapper.wrap(e,t,s,i)}},CO={tag:"div",cls:"ag-details-row"},vO={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},SO=class extends nO{constructor(){super(...arguments),this.eDetailGrid=oO}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();const t={toggleCss:(s,i)=>this.toggleCss(s,i),toggleDetailGridCss:(s,i)=>this.eDetailGrid.classList.toggle(s,i),setDetailGrid:s=>this.setDetailGrid(s),setRowData:s=>this.setRowData(s),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new Iu),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){const e=this.params;if(e.pinned){this.setTemplate(CO);return}const t=()=>{this.setTemplate(vO)};if(cO(e.template))t();else if(typeof e.template=="string")this.setTemplate(e.template,[]);else if(typeof e.template=="function"){const s=e.template,i=s(e);this.setTemplate(i,[])}else Pu(168),t();this.eDetailGrid==null&&Pu(169)}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("frameworkCompWrapper"),s=new mO(t),{frameworkOverrides:i}=this.beans,r=dO(this.eDetailGrid,e,{frameworkOverrides:i,providedBeanInstances:{frameworkCompWrapper:s},modules:lO(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=r,this.ctrl?.registerDetailWithMaster(r),this.addDestroyFunc(()=>{r.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}};function Xi(e,t){const s=e.masterDetailSvc?.store;return s?t(s):void 0}function bO(e,t,s){Xi(e,i=>{i[t]=s})}function yO(e,t){Xi(e,s=>{delete s[t]})}function wO(e,t){return Xi(e,s=>s[t])}function xO(e,t){Xi(e,s=>{let i=0;Object.values(s).forEach(r=>{r&&t(r,i++)})})}var FO=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}";import{BeanStub as RO,RowNode as AO,_exists as MO,_getClientSideRowModel as TO,_isClientSideRowModel as Eu,_isServerSideRowModel as Du,_observeResize as PO}from"ag-grid-community";var IO=class extends RO{constructor(){super(...arguments),this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){const e=this.gos;Eu(e)&&(this.enabled=this.isEnabled()),Du(e)&&this.addEventListeners()}addEventListeners(){const e=i=>{this.setMaster(i.node,!1,!0)};let t;const s=()=>{if(t){for(const i of t)i();t=void 0}this.isEnabled()&&(t=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:e}))};s(),this.gos.addPropertyEventListener("masterDetail",s)}refreshModel(e){if(e.changedProps){const t=this.isEnabled();if(this.enabled!==t){this.setMasters(null);return}}e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMaster(e,t,s){const i=e.master,r=this.isEnabled();let a=r;const n=this.gos,o=n.get("isRowMaster"),l=n.get("treeData");if(r)if(t||s){if(o){const d=e.data;a=!!d&&!!o(d)}}else a=i;const c=this.beans;if(!l)if(a&&t){const d=c.rowGroupColsSvc?.columns.length??0;e.expanded=Ja(c,e,d,!1)}else!a&&i&&(e.expanded=!1);a!==i&&(e.master=a,e.dispatchRowEvent("masterChanged"))}setMasters(e){if(this.enabled=this.isEnabled(),e){for(const t of e.updates)this.setMaster(t,!1,!0);for(const t of e.adds)this.setMaster(t,!0,!1)}else{const t=TO(this.beans)?.rootNode?._leafs;if(t)for(let s=0,i=t.length;s<i;++s)this.setMaster(t[s],!0,!1)}}getDetail(e){if(!e.master||!e.expanded)return null;let t=e.detailNode;return t||(t=new AO(this.beans),t.detail=!0,t.selectable=!1,t.parent=e,MO(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t)}setupDetailRowAutoHeight(e,t){const{gos:s,beans:i}=this;if(!s.get("detailRowAutoHeight"))return;const r=()=>{const n=t.clientHeight;if(n!=null&&n>0){const o=()=>{const{rowModel:l}=this.beans,{rowNode:c}=e;c.setRowHeight(n),(Eu(s,l)||Du(s,l))&&l.onRowHeightChanged()};window.setTimeout(o,0)}},a=PO(i,t,r);e.addDestroyFunc(a),r()}destroy(){this.store={},super.destroy()}},EO={moduleName:"SharedMasterDetail",version:D,beans:[IO],userComponents:{agDetailCellRenderer:SO},dynamicBeans:{detailCellRendererCtrl:Iu},apiFunctions:{addDetailGridInfo:bO,removeDetailGridInfo:yO,getDetailGridInfo:wO,forEachDetailGridInfo:xO},dependsOn:[B,jd,Qa],css:[FO]},Lu={moduleName:"MasterDetail",version:D,dependsOn:[EO,Ns,aO]};import{_DragModule as DO,_KeyboardNavigationModule as LO}from"ag-grid-community";import{_addGridCommonParams as kO,_getCellByPosition as Zi,_getFillHandle as fn,_getLastRow as GO,_getNormalisedMousePosition as ku,_getRowAbove as mn,_getRowBelow as zs,_getRowNode as OO,_isRowBefore as _O,_isSameRow as Se,_last as Xt,_stopPropagationForAgGrid as NO,_toStringOrNull as BO,_warn as VO,isRowNumberCol as HO}from"ag-grid-community";import{Component as zO,_areCellsEqual as UO,_getCellPositionForEvent as WO,_getPageBody as Gu,_isRowBefore as KO,_isVisible as $O,_last as jO,_setDisplayed as YO}from"ag-grid-community";var Ou=class extends zO{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:e=>{let t=!1;if(this.dragging||(t=!0,this.dragging=!0,Gu(this.beans).classList?.add(this.getDraggingCssClass())),this.updateValuesOnMove(e),t){this.changedCalculatedValues=!1;return}this.beans.rangeSvc.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:_u,mousedown:_u})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(e){const t=WO(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&UO(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),Gu(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}getType(){return this.type}refresh(e,t){const s=this.cellCtrl,i=this.getGui(),r=t??jO(this.beans.rangeSvc.getCellRanges()),a=r.startRow,n=r.endRow;if(a&&n&&(KO(n,a)?(this.rangeStartRow=n,this.rangeEndRow=a):(this.rangeStartRow=a,this.rangeEndRow=n)),s!==e||!$O(i)){this.cellCtrl=e;const o=e.comp.getParentOfValue();o&&o.appendChild(i)}this.cellRange=r}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){YO(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(e){if(!this.cellRange)return;const{id:t,type:s}=this.cellRange;if(!t||t!==e.id)return;const i=this.beans.rangeSvc?.getCellRanges().find(r=>r.id===t&&r.type===s);i&&i!==this.cellRange&&(this.cellRange=i)}},_u=e=>{e.stopPropagation()};function qO(e){const t=e.length;let s=0;if(t<=1)return e;for(let u=0;u<e.length;u++){const h=e[u],p=h.toString().split("e-");if(p.length>1){s=Math.max(s,parseInt(p[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let i=0,r=0,a=0,n=0,o=0;for(let u=0;u<t;u++)o=e[u],i+=u,r+=o,n+=u*u,a+=u*o;const l=(t*a-i*r)/(t*n-i*i),c=r/t-l*i/t,d=[];for(let u=0;u<=t;u++)d.push(parseFloat((u*l+c).toFixed(s)));return d}var XO={tag:"div",cls:"ag-fill-handle"},ZO=class extends Ou{constructor(){super(XO),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}postConstruct(){super.postConstruct(),this.addManagedElementListeners(this.getGui(),{dblclick:this.onDblClick.bind(this)})}onDblClick(e){NO(e);const{cellRange:t,rangeStartRow:s,beans:i}=this,{rangeSvc:r,visibleCols:a}=i,n=GO(i);if(!n)return;const o=this.getFillHandleDirection();this.dragAxis=o==="xy"?"y":o;const l=r?.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:t.columns[0],rowEndIndex:this.dragAxis==="x"?t.endRow?.rowIndex??null:n.rowIndex,rowEndPinned:this.dragAxis==="x"?t.endRow?.rowPinned:n.rowPinned,columnEnd:this.dragAxis==="x"?Xt(a.allCols):Xt(t.columns)});this.isUp=!1,this.isLeft=!1,l&&this.performFill({event:e,initialRange:t,finalRange:l}),this.dragAxis=void 0}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=ku(this.beans,e));const{x:t,y:s}=this.initialXY,{x:i,y:r}=ku(this.beans,e),a=Math.abs(t-i),n=Math.abs(s-r),o=this.getFillHandleDirection();let l;o==="xy"?l=a>n?"x":"y":l=o,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}shouldSkipCell(e){return HO(e.column)}onDrag(e){if(!this.initialPosition){const s=this.cellCtrl;if(!s)return;this.initialPosition=s.cellPosition}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",{cellRange:s,rangeStartRow:i,rangeEndRow:r,beans:{rangeSvc:a}}=this,n=s.columns.length;let o;if(!this.isUp&&!this.isLeft)o=a.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:s.columns[0],rowEndIndex:t?r.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?r.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[n-1]});else{const l=t?i:this.lastCellMarked;o=a.createCellRangeFromCellRangeParams({rowStartIndex:l.rowIndex,rowStartPinned:l.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnEnd:s.columns[n-1]})}o&&this.performFill({event:e,initialRange:s,finalRange:o,shouldUpdateRange:!0})}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:s,shouldUpdateRange:i}){const{eventSvc:r,rangeSvc:a}=this.beans;r.dispatchEvent({type:"fillStart"}),this.handleValueChanged(t,s,e),i&&a.setCellRanges([s]),r.dispatchEvent({type:"fillEnd",initialRange:t,finalRange:s})}getFillHandleDirection(){const e=fn(this.gos)?.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?(VO(177),"xy"):e:"xy"}handleValueChanged(e,t,s){const{beans:i}=this,{rangeSvc:r,gos:a,valueSvc:n}=i,o=r.getRangeEndRow(e),l=r.getRangeStartRow(e),c=r.getRangeEndRow(t),d=r.getRangeStartRow(t),u=this.dragAxis==="y";if(this.isReduce&&!fn(a)?.suppressClearOnFillReduction){const y=u?e.columns:e.columns.filter(M=>t.columns.indexOf(M)<0),w=u?zs(i,c):d;w&&this.clearCellsInRange(w,o,y);return}const h=[],p=[],g=[],f=[];let m=!0,C=0;const v=()=>{h.length=0,p.length=0,g.length=0,f.length=0,C=0},S=(y,w)=>{let M=this.isUp?o:l,T=!1;for(u&&(m=!0,v());!T&&M;){const F=OO(i,M);if(!F)break;if(u&&y)b(h,y,F,()=>!Se(M,this.isUp?l:o));else if(w){m=!0,v();for(const I of w)b(h,I,F,()=>I!==(this.isLeft?e.columns[0]:Xt(e.columns)))}T=Se(M,this.isUp?d:c),M=this.isUp?mn(this.beans,M):zs(i,M)}},b=(y,w,M,T)=>{let F,I=!1;if(m)F=n.getValue(w,M,"edit"),p.push(F),g.push(n.getValue(w,M,"edit",!0)),f.push(n.getValueForDisplay({column:w,node:M,from:"edit"}).valueFormatted),m=T();else{const{value:E,fromUserFunction:P,sourceCol:N,sourceRowNode:k}=this.processValues({event:s,values:y,initialValues:p,initialNonAggregatedValues:g,initialFormattedValues:f,col:w,rowNode:M,idx:C++});if(F=E,w.isCellEditable(M)){const A=n.getValue(w,M,"edit");if(!P){if(N){const L=N.getColDef();if(L.useValueFormatterForExport!==!1&&L.valueFormatter){const _=n.getValueForDisplay({column:N,node:k,includeValueFormatted:!0,from:"edit"}).valueFormatted;_!=null&&(F=_)}}w.getColDef().useValueParserForImport!==!1&&(F=n.parseValue(w,M,N?F:BO(F),A))}!P||A!==F?M.setDataValue(w,F,"rangeSvc"):I=!0}}I||y.push({value:F,column:w,rowNode:M})};if(u)e.columns.forEach(y=>{S(y)});else{const y=this.isLeft?[...t.columns].reverse():t.columns;S(void 0,y)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}clearCellsInRange(e,t,s){const i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[i],restoreSourceInBatch:!0})}processValues(e){const{formula:t,valueSvc:s}=this.beans,{event:i,values:r,initialValues:a,initialNonAggregatedValues:n,initialFormattedValues:o,col:l,rowNode:c,idx:d}=e,u=fn(this.gos)?.setFillValue,h=this.dragAxis==="y";let p;if(h?p=this.isUp?"up":"down":p=this.isLeft?"left":"right",u){const m=kO(this.gos,{event:i,values:r.map(({value:v})=>v),initialValues:a,initialNonAggregatedValues:n,initialFormattedValues:o,currentIndex:d,currentCellValue:s.getValue(l,c,"edit"),direction:p,column:l,rowNode:c}),C=u(m);if(C!==!1)return{value:C,fromUserFunction:!0}}const g=m=>typeof m=="number"&&Number.isFinite(m)||typeof m=="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(m.trim()),f=r.every(({value:m})=>g(m));if(i.altKey||!f){const m=String(Xt(r)?.value??"");if(f&&a.length===1){const w=this.isUp||this.isLeft?-1:1;return{value:parseFloat(m)+1*w,fromUserFunction:!1}}const{value:C,column:v,rowNode:S}=r[d%r.length];let b;const y=v.isAllowFormula()&&t?.isFormula(m);if(y){const w=p==="up"?-1:p==="down"?1:0,M=p==="left"?-1:p==="right"?1:0;b=t.updateFormulaByOffset({value:m,rowDelta:w,columnDelta:M})}else b=C;return{value:b,fromUserFunction:!1,sourceCol:y?void 0:v,sourceRowNode:S}}return{value:Xt(qO(r.map(({value:m})=>Number(m)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(const e of this.markedCells){if(!e.isAlive())continue;const{comp:t}=e;t.toggleCss("ag-selection-fill-top",!1),t.toggleCss("ag-selection-fill-right",!1),t.toggleCss("ag-selection-fill-bottom",!1),t.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(Se(t,e))return;const s=_O(t,e),{rangeStartRow:i,rangeEndRow:r}=this;s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,i=t.column;if(s===i)return;const r=this.beans.visibleCols.allCols,a=r.indexOf(s),n=r.indexOf(i);n<=a&&n>=r.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,n<a),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,s){const i=this.beans,{rangeSvc:r}=i;let a=e;do{const n=this.cellRange,o=n.columns.length;for(let l=0;l<o;l++){const c=n.columns[l],u={...{rowIndex:a.rowIndex,rowPinned:a.rowPinned},column:c},h=r.isCellInSpecificRange(u,n),p=Se(a,e);if(s&&(this.isUp=!0),!p){const g=Zi(i,u);if(g){this.markedCells.push(g);const f=g.comp;h||(f.toggleCss("ag-selection-fill-left",l===0),f.toggleCss("ag-selection-fill-right",l===o-1)),f.toggleCss(s?"ag-selection-fill-top":"ag-selection-fill-bottom",Se(a,t))}}}if(Se(a,t))break}while(a=s?mn(this.beans,a):zs(i,a))}reduceVertical(e,t){let s=e;const i=this.beans;do{const r=this.cellRange,a=r.columns.length,n=Se(s,t);for(let o=0;o<a;o++){const c={...{rowIndex:s.rowIndex,rowPinned:s.rowPinned},column:r.columns[o]},d=Zi(i,c);d&&(this.markedCells.push(d),d.comp.toggleCss("ag-selection-fill-bottom",Se(s,t)))}if(n)break}while(s=mn(i,s))}extendHorizontal(e,t,s){const i=this.beans,{visibleCols:r}=i,a=r.allCols,n=a.indexOf(s?t.column:e.column),o=a.indexOf(s?this.cellRange.columns[0]:t.column),l=s?0:1,c=a.slice(n+l,o+l),{rangeStartRow:d,rangeEndRow:u}=this;for(const h of c){let p=d,g=!1;do{g=Se(p,u);const f=Zi(i,{rowIndex:p.rowIndex,rowPinned:p.rowPinned,column:h});if(f){this.markedCells.push(f);const m=f.comp;m.toggleCss("ag-selection-fill-top",Se(p,d)),m.toggleCss("ag-selection-fill-bottom",Se(p,u)),s?(this.isLeft=!0,m.toggleCss("ag-selection-fill-left",h===c[0])):m.toggleCss("ag-selection-fill-right",h===Xt(c))}p=zs(i,p)}while(!g)}}reduceHorizontal(e,t){const s=this.beans,{visibleCols:i}=s,r=i.allCols,a=r.indexOf(t.column),n=r.indexOf(e.column),o=r.slice(a,n),{rangeStartRow:l,rangeEndRow:c}=this;for(const d of o){let u=l,h=!1;do{h=Se(u,c);const p=Zi(this.beans,{rowIndex:u.rowIndex,rowPinned:u.rowPinned,column:d});p&&(this.markedCells.push(p),p.comp.toggleCss("ag-selection-fill-right",d===o[0])),u=zs(s,u)}while(!h)}}refresh(e,t){const s=t??this.beans.rangeSvc.getCellRanges()[0];if(!s.startRow||!s.endRow){this.destroy();return}super.refresh(e,s)}};import{CellRangeType as Nu,_isSameRow as JO,_last as Bu}from"ag-grid-community";var QO=class extends Ou{constructor(){super({tag:"div",cls:"ag-range-handle"}),this.type=1,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const s=this.beans.rangeSvc,i=this.cellRange??Bu(s.getCellRanges());i&&(this.rangeFixed||(this.fixRangeStartEnd(i),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},s.getCellRanges().length===2&&s.getCellRanges()[0].type===Nu.DIMENSION&&i.type===Nu.VALUE&&!JO(this.endPosition,s.getRangeEndRow(i))&&s.updateRangeRowBoundary({cellRange:s.getCellRanges()[0],boundary:"end",cellPosition:{...this.endPosition,column:s.getCellRanges()[0].columns[0]},silent:!0}),s.extendRangeToCell(i,this.endPosition))}shouldSkipCell(e){return!1}onDragEnd(e){const t=this.cellRange??Bu(this.beans.rangeSvc.getCellRanges());t&&(this.fixRangeStartEnd(t),this.rangeFixed=!1)}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.beans.rangeSvc,s=t.getRangeStartRow(e),i=t.getRangeEndRow(e),r=e.columns[0];e.startRow=s,e.endRow=i,e.startColumn=r}},e1=".ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing),.ag-cell-range-selected.ag-cell-range-chart,.ag-cell-range-selected:not(.ag-cell-focus){background-color:var(--ag-range-selection-background-color);&.ag-cell-range-chart{background-color:var(--ag-range-selection-chart-background-color)!important;&.ag-cell-range-chart-category{background-color:var(--ag-range-selection-chart-category-background-color)!important}}}.ag-cell-range-selected-1.ag-cell-range-chart,.ag-cell-range-selected-1.ag-formula-range,.ag-cell-range-selected-1:not(.ag-cell-focus),.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing){background-color:var(--ag-range-selection-background-color)}.ag-cell-range-selected-2.ag-cell-range-chart,.ag-cell-range-selected-2.ag-formula-range,.ag-cell-range-selected-2:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-3.ag-cell-range-chart,.ag-cell-range-selected-3.ag-formula-range,.ag-cell-range-selected-3:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-4.ag-cell-range-chart,.ag-cell-range-selected-4.ag-formula-range,.ag-cell-range-selected-4:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell){&.ag-cell-range-top{border-top-color:var(--ag-range-selection-border-color);border-top-style:var(--ag-range-selection-border-style)}&.ag-cell-range-right{border-right-color:var(--ag-range-selection-border-color);border-right-style:var(--ag-range-selection-border-style)}&.ag-cell-range-bottom{border-bottom-color:var(--ag-range-selection-border-color);border-bottom-style:var(--ag-range-selection-border-style)}&.ag-cell-range-left{border-left-color:var(--ag-range-selection-border-color);border-left-style:var(--ag-range-selection-border-style)}}.ag-cell.ag-selection-fill-top,.ag-cell.ag-selection-fill-top.ag-cell-range-selected{border-top:1px dashed;border-top-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-right,:where(.ag-ltr) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-right,:where(.ag-rtl) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}.ag-cell.ag-selection-fill-bottom,.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected{border-bottom:1px dashed;border-bottom-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-left,:where(.ag-ltr) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-left,:where(.ag-rtl) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}.ag-fill-handle,.ag-range-handle{background-color:var(--ag-range-selection-border-color);bottom:-1px;height:6px;position:absolute;width:6px}:where(.ag-ltr) .ag-fill-handle,:where(.ag-ltr) .ag-range-handle{right:-1px}:where(.ag-rtl) .ag-fill-handle,:where(.ag-rtl) .ag-range-handle{left:-1px}.ag-fill-handle{cursor:crosshair}:where(.ag-ltr) .ag-range-handle{cursor:nwse-resize}:where(.ag-rtl) .ag-range-handle{cursor:nesw-resize}";function t1(e){return e.rangeSvc?.getCellRanges()??null}function s1(e,t){e.rangeSvc?.addCellRange(t)}function Vu(e){e.rangeSvc?.removeAllCellRanges()}import{AutoScrollService as i1,BeanStub as r1,KeyCode as a1,_areCellsEqual as n1,_areEqual as Hu,_exists as o1,_getAbsoluteRowIndex as zu,_getCellCtrlForEventTarget as l1,_getEnableColumnSelection as c1,_getFirstRow as Cn,_getLastRow as vn,_getRowAbove as Us,_getRowBelow as Zt,_getRowCtrlForEventTarget as d1,_getRowNode as u1,_getSuppressMultiRanges as h1,_interpretAsRightClick as p1,_isCellSelectionEnabled as Ji,_isDomLayout as g1,_isRowBefore as ce,_isSameRow as Te,_isUsingNewCellSelectionAPI as f1,_last as J,_makeNull as Uu,_missing as m1,_removeAllFromArray as C1,_removeFromArray as Qi,_warn as Sn}from"ag-grid-community";import{CellRangeType as er,_isSameRow as Wu,_last as v1,_missing as S1,_setAriaSelected as b1}from"ag-grid-community";var Ws="ag-cell-range-selected",y1="ag-cell-range-chart",w1="ag-cell-range-single-cell",Ku="ag-cell-range-chart-category",x1="ag-cell-range-handle",F1="ag-cell-range-top",R1="ag-cell-range-right",A1="ag-cell-range-bottom",M1="ag-cell-range-left";function T1(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="range":!1:e.get("enableRangeHandle")}function $u(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="fill":!1:e.get("enableFillHandle")}var P1=class{constructor(e,t){this.beans=e,this.cellCtrl=t,this.rangeColorClass=null,this.handleColorClass=null,this.rangeSvc=e.rangeSvc}setComp(e){this.cellComp=e,this.eGui=this.cellCtrl.eGui,this.onCellSelectionChanged()}unsetComp(){this.beans.context.destroyBean(this.selectionHandle)}onCellSelectionChanged(){const e=this.cellComp;if(!e)return;const{rangeSvc:t,cellCtrl:s,eGui:i}=this,r=t.getCellRangeCount(s.cellPosition);this.rangeCount=r;const a=this.getHasChartRange();this.hasChartRange=a,e.toggleCss(Ws,r!==0),e.toggleCss(`${Ws}-1`,r===1),e.toggleCss(`${Ws}-2`,r===2),e.toggleCss(`${Ws}-3`,r===3),e.toggleCss(`${Ws}-4`,r>=4),e.toggleCss(y1,a),b1(i,r>0?!0:void 0),e.toggleCss(w1,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),s=!t&&e.top,i=!t&&e.right,r=!t&&e.bottom,a=!t&&e.left,n=this.cellComp;n.toggleCss(F1,s),n.toggleCss(R1,i),n.toggleCss(A1,r),n.toggleCss(M1,a)}isSingleCell(){const{rangeSvc:e}=this;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(s=>[er.DIMENSION,er.VALUE].includes(s.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshRangeStyleAndHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,s=!1,i=!1,r=!1;const{rangeSvc:a,beans:{visibleCols:n},cellCtrl:{cellPosition:o}}=this,l=o.column,c=a.getCellRanges().filter(h=>a.isCellInSpecificRange(o,h));if(!c.length)return{top:t,right:s,bottom:i,left:r};let d,u;e?(d=n.getColAfter(l),u=n.getColBefore(l)):(d=n.getColBefore(l),u=n.getColAfter(l)),d||(r=!0),u||(s=!0);for(let h=0;h<c.length&&!(t&&s&&i&&r);h++){const p=c[h],g=a.getRangeStartRow(p),f=a.getRangeEndRow(p);!t&&Wu(g,o)&&(t=!0),!i&&Wu(f,o)&&(i=!0),!r&&d&&p.columns.indexOf(d)<0&&(r=!0),!s&&u&&p.columns.indexOf(u)<0&&(s=!0)}return{top:t,right:s,bottom:i,left:r}}refreshRangeStyleAndHandle(){const{context:e}=this.beans;if(e.isDestroyed())return;this.styleCellForRangeType();const t=this.getRangeForHandle();this.selectionHandle&&!t&&(this.selectionHandle=e.destroyBean(this.selectionHandle)),t&&this.addSelectionHandle(t),this.refreshHandleColor(t),this.cellComp.toggleCss(x1,!!this.selectionHandle)}styleCellForRangeType(){if(this.hasChartRange){const{rangeSvc:e}=this,t=e.getCellRanges()[0],i=t.type===er.DIMENSION&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,t);this.cellComp.toggleCss(Ku,i)}else this.cellComp.toggleCss(Ku,!1),this.applyRangeColor(this.getRangeColorClass())}applyRangeColor(e){this.rangeColorClass&&this.rangeColorClass!==e&&(this.cellComp.toggleCss(this.rangeColorClass,!1),this.cellComp.toggleCss("ag-formula-range",!1)),e&&(this.cellComp.toggleCss(e,!0),this.cellComp.toggleCss("ag-formula-range",e.startsWith("ag-formula-range"))),this.rangeColorClass=e??null}getRangeColorClass(){const{rangeSvc:e,rangeCount:t}=this;if(!e||!t)return null;const s=e.getCellRanges();for(let i=s.length-1;i>=0;i--){const r=s[i],a=r.colorClass;if(a&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,r))return a}return null}refreshHandleColor(e){const t=this.selectionHandle?.getGui?.(),s=e?.colorClass??null;if(!t){this.handleColorClass=null;return}this.handleColorClass&&this.handleColorClass!==s&&t.classList.remove(this.handleColorClass),s?t.classList.add(s):this.handleColorClass&&t.classList.remove(this.handleColorClass),this.handleColorClass=s??null}getRangeForHandle(){const{gos:e,editSvc:t}=this.beans,s=this.rangeSvc,i=s.getCellRanges(),r=i.length;if(this.rangeCount<1||r<1)return null;const a=t?.isRangeSelectionEnabledWhileEditing(),n=a?i:[v1(i)];for(const o of n){const{cellPosition:l,column:c}=this.cellCtrl,d=$u(e)&&!c.isSuppressFillHandle(),u=T1(e);let p=!t?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(a||r===1&&(d||u));if(this.hasChartRange&&(p=o.type===er.VALUE),p&&o.endRow!=null&&s.isContiguousRange(o)&&s.isBottomRightCell(o,l))return o}return null}addSelectionHandle(e){const{beans:t}=this,s=t.editSvc?.isRangeSelectionEnabledWhileEditing(),i=e.type,a=!s&&$u(t.gos)&&S1(i)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==a&&(this.selectionHandle=t.context.destroyBean(this.selectionHandle)),!this.selectionHandle){const n=t.registry.createDynamicBean(a===0?"fillHandle":"rangeHandle",!1);n&&(this.selectionHandle=t.context.createBean(n))}this.selectionHandle?.refresh(this.cellCtrl,e)}destroy(){this.unsetComp()}};import{BeanStub as I1,_isCellSelectionEnabled as ju}from"ag-grid-community";var E1=class extends I1{constructor(e){super(),this.eContainer=e}postConstruct(){const{beans:e,gos:t,eContainer:s}=this,i=e.rangeSvc,r={eElement:s,onDragStart:i.onDragStart.bind(i),onDragStop:i.onDragStop.bind(i),onDragging:i.onDragging.bind(i)},a=e.dragSvc,n=a.addDragSource.bind(a,r),o=a.removeDragSource.bind(a,r);this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{ju(t)?n():o()}),this.addDestroyFunc(o),ju(t)&&n()}};import{BeanStub as D1}from"ag-grid-community";var L1=class extends D1{constructor(e,t){super(),this.column=e,this.eGui=t}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)})}onClick(e){this.beans.rangeSvc?.handleColumnSelection(this.column,e)}};import{BeanStub as k1}from"ag-grid-community";var G1=class extends k1{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let e;this.column.isColumn?e=[this.column]:e=this.column.getDisplayedLeafColumns();for(const t of e)this.columnMap.set(t,!1)}refreshActive(){const{gos:e,rangeSvc:t}=this.beans,s=e.get("cellSelection");this.isActive=!!(s&&t&&typeof s=="object"&&s.enableHeaderHighlight)}setupRangeHeaderHighlight(){const e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();const e=this.beans.rangeSvc.getCellRanges();let t=!1,s=!0;for(const i of e){if(t)break;for(const r of i.columns)this.columnMap.has(r)&&(this.columnMap.set(r,!0),t||(t=!0))}for(const i of Array.from(this.columnMap.values()))if(i===!1){s=!1;break}this.comp.toggleCss("ag-header-range-highlight",t&&s)}destroy(){super.destroy(),this.comp=null,this.column=null}},O1=class extends r1{constructor(){super(...arguments),this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsSvc.whenReady(this,i=>{const r=i.gridBodyCtrl;this.autoScrollService=new i1({scrollContainer:r.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>r.scrollFeature.getVScrollPosition().top,setVerticalPosition:a=>r.scrollFeature.setVerticalScrollPosition(a),getHorizontalPosition:()=>r.scrollFeature.getHScrollPosition().left,setHorizontalPosition:a=>r.scrollFeature.setHorizontalScrollPosition(a),shouldSkipVerticalScroll:()=>!g1(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!r.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(e){this.rangeSelectionExtensions.includes(e)||this.rangeSelectionExtensions.push(e)}unregisterRangeSelectionExtension(e){Qi(this.rangeSelectionExtensions,e)}shouldSuppressRangeSelection(e){return this.rangeSelectionExtensions.some(t=>t.shouldSuppressRangeSelection?.(e))}shouldSkipColumn(e){return this.rangeSelectionExtensions.some(t=>t.shouldSkipColumn?.(e))}isAllColumnsSelectionCell(e){return this.rangeSelectionExtensions.some(t=>t.isAllColumnsSelectionCell?.(e))}isAllColumnsRange(e,t){return this.rangeSelectionExtensions.some(s=>s.isAllColumnsRange?.(e,t))}updateSelectionModeForCell(e){this.setSelectionMode(this.isAllColumnsSelectionCell(e))}onDragStart(e){const t=this.gos,s=e.target;if(!Ji(t)||d1(t,s)?.isSuppressMouseEvent(e)||this.shouldSuppressRangeSelection(s))return;const{shiftKey:i}=e,r=this.isMultiRange(e),a=i&&!!this.cellRanges?.length;!r&&(!a||o1(J(this.cellRanges).type))&&this.removeAllCellRanges(!0);const n=this.dragSvc.startTarget;if(n&&this.updateValuesOnMove(n),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=r&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=J(this.cellRanges);else{const o={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},l=this.getColumnsFromModel([this.lastCellHovered.column]);if(!l?.length)return;this.draggingRange={startRow:o,endRow:o,columns:l,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}onDragging(e){const{dragging:t,lastCellHovered:s,newestRangeStartCell:i,autoScrollService:r,cellHasChanged:a}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const n=p=>s&&s.rowPinned===p&&i.rowPinned===p,o=n("top")||n("bottom");if(r.check(e,o),!a||!s)return;const l=i?.column,c=s?.column,d=this.calculateColumnsBetween(l,c);if(!d)return;const{rowIndex:u,rowPinned:h}=s;this.draggingRange.endRow={rowIndex:u,rowPinned:h},this.draggingRange.columns=d,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleCols.allCols;for(const s of this.cellRanges){const i=s.columns;s.columns=s.columns.filter(a=>a.isVisible()&&e.indexOf(a)!==-1),!Hu(i,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)}const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=J(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleCols.allCols,i=t.map(r=>s.indexOf(r)).sort((r,a)=>r-a);return J(i)-i[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?ce(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return ce(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(e){const t=this.beans,s=this.getRangeStartRow(e),i=this.getRangeEndRow(e),r=zu(t,s);return zu(t,i)-r+1}handleCellMouseDown(e,t){const{beans:s}=this,i=e.target;if(this.shouldSuppressRangeSelection(i))return;const r=this.isAllColumnsSelectionCell(t);if(r&&e.preventDefault(),e.shiftKey)return this.extendLatestRangeToCell(t);if(r&&p1(s,e))return;const a=this.isMultiRange(e);this.updateSelectionModeForCell(t);const n=this.calculateColumnsBetween(t.column,t.column);if(!n)return;const o=r?this.findContainingRange({columns:n,startRow:t,endRow:t}):void 0;r&&!!o&&a&&(e.ctrlKey||e.metaKey)&&o?this.removeRowFromAllColumnsRange(t,o):this.setRangeToCell(t,a)}isMultiRange(e){const{ctrlKey:t,metaKey:s}=e,{editingWithRanges:i,allowMulti:r}=this.getMultiRangeContext();return i||(r?t||s:!1)}getMultiRangeContext(){const{gos:e,editSvc:t}=this.beans,s=!!t?.isEditing()&&!!t?.isRangeSelectionEnabledWhileEditing(),i=h1(e)&&!s;return{editingWithRanges:s,suppressMultiRanges:i,allowMulti:!i}}removeRowFromAllColumnsRange(e,t){const{beans:s,cellRanges:i}=this,r=Cn(s),a=vn(s),n=this.getRangeStartRow(t),o=this.getRangeEndRow(t);if(!n&&Te(r,e))tr(t,Zt(s,r),"top");else if(!o&&Te(a,e))tr(t,Us(s,a),"bottom");else if(Te(n,o))Qi(i,t);else if(Te(n,e))tr(t,Zt(s,e),"top");else if(Te(o,e))tr(t,Us(s,e),"bottom");else{const l=Us(s,e),c=Zt(s,e);t.startRow=n,t.endRow=l??void 0,i.push({...t,startRow:c??void 0,endRow:o})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(e,t=!1){const{gos:s}=this;if(!Ji(s))return;this.updateSelectionModeForCell(e);const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;const{suppressMultiRanges:r}=this.getMultiRangeContext();(r||!t||m1(this.cellRanges))&&this.removeAllCellRanges(!0);const a={rowIndex:e.rowIndex,rowPinned:e.rowPinned},n={startRow:a,endRow:a,columns:i,startColumn:e.column};this.cellRanges.push(n),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(e){const t=e.columns[0],s=J(e.columns);return this.newestRangeStartCell?.column===t?s:t}extendRangeRowCountBy(e,t){const{beans:s}=this,{startRow:i,endRow:r}=e;if(!i||!r)return;let a=0,n;const o=ce(r,i);o?n=i:n=r;const l=t>0?Zt:Us,c=Math.abs(t);for(;a<c;){const u=l(s,n);if(!u)break;n=u,a++}if(a!==c)return;const d={...n,column:this.getRangeLastColumn(e)};this.updateRangeRowBoundary({cellRange:e,boundary:o?"start":"end",cellPosition:d})}extendRangeColumnCountBy(e,t){const{columns:s,startColumn:i}=e;if(t===0)return;const r=this.getColumnsFromModel();if(!r)return;const a=J(s),n=i===s[0]?a:s[0];if(!a||!n)return;let o=r.indexOf(i);const l=r.indexOf(n),c=l<o;c&&(o=l);const u=s.length+t;if(u<=0)return;const h=[];for(let p=o;p<o+u;p++){const g=r[p];if(!g)break;h.push(g)}if(h.length===u){if(c){const p=J(h);e.startColumn=p,this.focusCellOnNewColumn(e,p)}e.columns=h,this.dispatchChangedEvent(!0,!0,e.id)}}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=J(this.cellRanges);this.updateSelectionModeForCell(e),this.updateRangeRowBoundary({cellRange:t,boundary:"end",cellPosition:e})}extendRangeToCell(e,t){e&&(this.updateSelectionModeForCell(t),this.updateRangeRowBoundary({cellRange:e,boundary:"end",cellPosition:t}))}updateRangeRowBoundary(e){const{cellRange:t,boundary:s,cellPosition:i,silent:r=!1}=e,a=i.column,n=this.calculateColumnsBetween(t.startColumn,a);!n||B1(t,i)||(s==="start"&&this.focusCellOnNewRow(t,i),t.columns=n,t[s==="start"?"startRow":"endRow"]={rowIndex:i.rowIndex,rowPinned:i.rowPinned},r||this.dispatchChangedEvent(!0,!0,t.id))}getRangeEdgeColumns(e){const t=this.visibleCols.allCols,s=e.columns.map(i=>t.indexOf(i)).filter(i=>i>-1).sort((i,r)=>i-r);return{left:t[s[0]],right:t[J(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,i=J(this.cellRanges),r=this.newestRangeStartCell,a=i.endRow.rowIndex,n=i.endRow.rowPinned,l={column:this.getRangeLastColumn(i),rowIndex:a,rowPinned:n},c=this.cellNavigation.getNextCellToFocus(t,l,s);if(c)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:c.rowIndex,rowEndPinned:c.rowPinned,columnStart:r.column,columnEnd:c.column}),c}setCellRange(e){Ji(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(Hu(this.cellRanges,e)||!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);const t=this.getColumnsFromModel(this.visibleCols.allCols)??[];let s=!1;for(const i of e){if(i.columns&&i.startRow){const r=this.getColumnsFromModel(i.columns);if(!r||r.length===0)continue;i.columns=r;const{startRow:a}=i;this.setNewestRangeStartCell({rowIndex:a.rowIndex,rowPinned:a.rowPinned,column:i.columns[0]})}!s&&t.length>0&&this.isAllColumnsRange(i,t)&&(s=!0),this.cellRanges.push(i)}this.setSelectionMode(s),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(e){const{beans:t,eventSvc:s}=this,{cellEventSource:i="rangeSvc",dispatchWrapperEvents:r,wrapperEventSource:a="deleteKey",restoreSourceInBatch:n}=e;let{cellRanges:o}=e;r&&(s.dispatchEvent({type:"cellSelectionDeleteStart",source:a}),s.dispatchEvent({type:"rangeDeleteStart",source:a})),o||(o=this.cellRanges);const{valueSvc:l,editSvc:c}=t,d=!!c?.isBatchEditing();this.forEachEditableCellInRanges(o,(u,h)=>{if(n&&d){c?.batchResetToSourceValue({rowNode:u,column:h});return}const p=l.getDeleteValue(h,u);u.setDataValue(h,p,i)}),r&&(s.dispatchEvent({type:"cellSelectionDeleteEnd",source:a}),s.dispatchEvent({type:"rangeDeleteEnd",source:a}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){const{columns:s,columnStart:i,columnEnd:r,rowStartIndex:a,rowStartPinned:n,rowEndIndex:o,rowEndPinned:l}=e,c=this.getColumnsFromParams(s,i,r);if(!c||!t&&c.columns.length===0)return;const{columns:d,startsOnTheRight:u}=c,h=Yu(a,n),p=Yu(o,l);return{startRow:h,endRow:p,columns:d,startColumn:this.getColumnFromModel(i)??(u?J(d):d[0])}}addCellRange(e){const t=this.gos;if(!Ji(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);const s=this.createCellRangeFromCellRangeParams(e);if(s)return s.startRow&&this.setNewestRangeStartCell({rowIndex:s.startRow.rowIndex,rowPinned:s.startRow.rowPinned,column:s.startColumn}),this.cellRanges.push(s),this.dispatchChangedEvent(!1,!0,s.id),s}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;for(const i of this.cellRanges)this.forEachRowInRange(i,r=>{const a=`${r.rowPinned||"normal"}_${r.rowIndex}`,n=e.get(a),o=i.columns.map(l=>l.getId());if(n){const l=o.filter(c=>n.indexOf(c)===-1);n.push(...l)}else e.set(a,o)});let s;for(const i of e.values()){const r=i.sort().join();if(s===void 0){s=r;continue}if(s!==r)return!1}return!0}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns?.includes(e.column),i=this.isRowInRange(e,t);return s&&i}isColumnInAnyRange(e){const{beans:t}=this,s=Cn(t),i=vn(t);if(!s||!i)return!1;const r=e.isColumn?[e]:e.getDisplayedLeafColumns();return this.findContainingRange({columns:r,startRow:s,endRow:i},!0)!=null}findContainingRange({columns:e,startRow:t,endRow:s},i=!1){const r=this.cellRanges;for(let a=r.length-1;a>=0;a--){const n=r[a],o=e.every(c=>n.columns.includes(c));let l=!1;if(i)l=Te(n.startRow,t)&&Te(n.endRow,s);else{const c=t&&this.isRowInRange(t,n),d=s&&this.isRowInRange(s,n);l=!!c&&!!d}if(o&&l)return n}}isBottomRightCell(e,t){const s=this.visibleCols.allCols,i=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:r,endRow:a}=e,n=ce(r,a)?a:r,o=s.indexOf(t.column)===J(i),l=t.rowIndex===n.rowIndex&&Uu(t.rowPinned)===Uu(n.rowPinned);return o&&l}getCellRangeCount(e){return this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t){const s=this.getRangeStartRow(t),i=this.getRangeEndRow(t),r=Te(e,s),a=Te(e,i);if(r||a)return!0;const n=!ce(e,s),o=ce(e,i);return n&&o}intersectLastRange(e){const{editingWithRanges:t,suppressMultiRanges:s}=this.getMultiRangeContext();if(t||s||e&&this.dragging||this.isEmpty())return;const i=J(this.cellRanges),r=this.getRangeStartRow(i),a=this.getRangeEndRow(i),n=[];for(const o of this.cellRanges.slice(0,-1)){const l=this.getRangeStartRow(o),c=this.getRangeEndRow(o),d=o.columns,u=d.filter(p=>i.columns.indexOf(p)===-1);if(u.length===d.length){n.push(o);continue}if(ce(a,l)||ce(c,r)){n.push(o);continue}const h=n.length;if(ce(l,r)){const p={columns:[...d],startColumn:i.startColumn,startRow:{...l},endRow:Us(this.beans,r)};n.push(p)}if(u.length>0){const p={columns:u,startColumn:u.includes(i.startColumn)?i.startColumn:u[0],startRow:_1([{...r},{...l}]),endRow:N1([{...a},{...c}])};n.push(p)}ce(a,c)&&n.push({columns:[...d],startColumn:i.startColumn,startRow:Zt(this.beans,a),endRow:{...c}}),n.length-h===1&&(n[n.length-1].id=o.id)}this.cellRanges=n,e&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,s){e.createManagedBean(new G1(t,s))}setSelectionMode(e){this.selectionMode=e?1:0}refreshRangeStart(e){const{startColumn:t,columns:s}=e,i=(l,c)=>{const d=e.columns.filter(u=>u!==l);l?(e.startColumn=l,e.columns=c?[l,...d]:[...d,l]):e.columns=d},{left:r,right:a}=this.getRangeEdgeColumns(e);if(t===s[0]&&t!==r){i(r,!0);return}t===J(s)&&t===a&&i(a,!1)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,s){const i=!e&&!t&&!s;let r,a=!1;return i||e?r=this.getColumnsFromModel(i?void 0:e):t&&s&&(r=this.calculateColumnsBetween(t,s),r?.length&&(a=r[0]!==this.getColumnFromModel(t))),r?{columns:r,startsOnTheRight:a}:void 0}verifyCellRanges(e){const{suppressMultiRanges:t}=this.getMultiRangeContext(),s=f1(e)&&t&&this.cellRanges.length>1;return s&&Sn(93),!s}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),i=this.getRangeEndRow(e);let r=s;for(;r&&(t(r),!Te(r,i));)r=Zt(this.beans,r)}forEachEditableCellInRanges(e,t){const{beans:s}=this;for(const i of e)this.forEachRowInRange(i,r=>{const a=u1(s,r);if(a)for(let n=0;n<i.columns.length;n++){const o=this.getColumnFromModel(i.columns[n]);o?.isCellEditable(a)&&t(a,o)}})}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}updateValuesOnMove(e){const t=l1(this.gos,e),s=t?.cellPosition;if(this.cellHasChanged=!1,!s||this.lastCellHovered&&n1(s,this.lastCellHovered))return;const i=this.beans.editSvc;if(i?.isEditing(t,{withOpenEditor:!0})&&!i?.isRangeSelectionEnabledWhileEditing()){this.dragSvc.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s}dispatchChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:s}),this.eventSvc.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:s})}getColumnFromModel(e){return typeof e=="string"?this.colModel.getCol(e):e}getColumnsFromModel(e){const{visibleCols:t,selectionMode:s}=this;(!e||s===1)&&(e=t.allCols);const i=[];for(const r of e){const a=this.getColumnFromModel(r);!a||this.shouldSkipColumn(a)||i.push(a)}return i.length?i:void 0}calculateColumnsBetween(e,t){const s=this.visibleCols.allCols,i=this.getColumnFromModel(e),r=this.getColumnFromModel(t),a=i===r,n=s.indexOf(i);if(n<0){Sn(178,{colId:i.getId()});return}const o=a?n:s.indexOf(r);if(o<0){Sn(178,{colId:r.getId()});return}if(a||this.selectionMode===1)return this.getColumnsFromModel([i]);const l=Math.min(n,o),c=l===n?o:n;return this.getColumnsFromModel(s.slice(l,c+1))}focusCellOnNewColumn(e,t){const{focusSvc:s}=this.beans,i=s.getFocusedCell();i&&this.isCellInSpecificRange(i,e)&&s.setFocusedCell({...i,column:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}focusCellOnNewRow(e,t){const{focusSvc:s}=this.beans,i=s.getFocusedCell();i&&this.isCellInSpecificRange(i,e)&&s.setFocusedCell({...t,column:i.column,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}createDragListenerFeature(e){return new E1(e)}createCellRangeFeature(e){return new P1(this.beans,e)}createHeaderGroupCellMouseListenerFeature(e,t){return new L1(e,t)}handleColumnSelection(e,t){const{gos:s,beans:i,columnRangeSelectionCtx:r,cellRanges:a}=this;if(!c1(s))return;const{suppressMultiRanges:n,editingWithRanges:o}=this.getMultiRangeContext(),l=a.length>0,c=t.ctrlKey||t.metaKey,d=!o||c,u=Cn(i),h=vn(i);if(!u||!h)return;if(t.key===a1.ENTER&&t.preventDefault(),t.shiftKey){const g=r.root;if(!g)return;const f=e.isColumn?e:J(e.getLeafColumns()),m=this.findContainingRange({columns:[g],startRow:u,endRow:h},!0);if(!m){Qi(a,r.lastCellRange),this.selectColumns(this.calculateColumnsBetween(g,f),u,h);return}this.updateRangeRowBoundary({cellRange:m,boundary:"end",cellPosition:{column:f,...h}});return}l&&(n||!c&&!o)&&this.removeAllCellRanges(!0);const p=(g,f)=>{const m=this.findContainingRange({columns:g,startRow:u,endRow:h},!0);if(m&&d)this.deselectColumnsFromRange(m,g);else{const C=this.selectColumns(g,u,h);C&&(r.lastCellRange=C)}r.root=f};if(e.isColumn)p([e],e);else{const g=e.getDisplayedLeafColumns();p(g,g[0])}}deselectColumnsFromRange(e,t){C1(e.columns,t),t.includes(e.startColumn)&&(e.startColumn=e.columns[0]),e.columns.length===0&&Qi(this.cellRanges,e),this.dispatchChangedEvent(!0,!0)}selectColumns(e,t,s){return this.addCellRange({columns:e,columnStart:e[0],columnEnd:J(e),rowStartIndex:t.rowIndex,rowStartPinned:t.rowPinned,rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned})}};function Yu(e,t){return e!=null?{rowIndex:e,rowPinned:t}:void 0}function _1(e){let t;for(const s of e)(t===void 0||ce(t,s))&&(t=s);return t}function N1(e){let t;for(const s of e)(t===void 0||ce(s,t))&&(t=s);return t}function B1(e,t){const{startRow:s,endRow:i}=e,r=ce(s,i)?i:s,a=t.rowIndex===r.rowIndex&&t.rowPinned===r.rowPinned,n=e.columns[0],o=J(e.columns),l=e.startColumn===n?o:n;return t.column===l&&a}function tr(e,t,s){let i;s==="top"?i=!e.startRow||!e.endRow||ce(e.startRow,e.endRow)?"startRow":"endRow":i=!e.startRow||!e.endRow||ce(e.startRow,e.endRow)?"endRow":"startRow",e[i]=t??void 0}var sr={moduleName:"CellSelection",version:D,beans:[O1],dynamicBeans:{fillHandle:ZO,rangeHandle:QO},apiFunctions:{getCellRanges:t1,addCellRange:s1,clearRangeSelection:Vu,clearCellSelection:Vu},dependsOn:[B,LO,DO],css:[e1]},V1={moduleName:"RangeSelection",version:D,dependsOn:[sr]};import{_CsrmSsrmSharedApiModule as H1,_RowModelSharedApiModule as z1,_SharedRowSelectionModule as U1,_SortModule as W1,_SsrmInfiniteSharedApiModule as K1,onRowHeightChanged as $1,resetRowHeights as j1}from"ag-grid-community";import{Component as Y1,RefPlaceholder as qu,_createIconNoSpan as q1}from"ag-grid-community";var X1={tag:"div",cls:"ag-loading",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},Z1=class extends Y1{constructor(){super(X1),this.eLoadingIcon=qu,this.eLoadingText=qu}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingError","ERR")}setupLoading(){const e=q1("groupLoading",this.beans,null);e&&this.eLoadingIcon.appendChild(e),this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingOoo","Loading...")}refresh(e){return!1}},J1={moduleName:"LoadingCellRenderer",version:D,userComponents:{agLoadingCellRenderer:Z1},icons:{groupLoading:"loading"},dependsOn:[B]};import{_ColumnGroupModule as Q1}from"ag-grid-community";function e_(e){return e.colModel.isPivotMode()}function t_(e,t,s){return e.pivotResultCols?.lookupPivotResultCol(t,s)??null}function s_(e,t){e.valueColsSvc?.setColumns(t,"api")}function i_(e){return e.valueColsSvc?.columns??[]}function r_(e,t){e.valueColsSvc?.removeColumns(t,"api")}function a_(e,t){e.valueColsSvc?.addColumns(t,"api")}function n_(e,t){e.pivotColsSvc?.setColumns(t,"api")}function o_(e,t){e.pivotColsSvc?.removeColumns(t,"api")}function l_(e,t){e.pivotColsSvc?.addColumns(t,"api")}function c_(e){return e.pivotColsSvc?.columns??[]}function d_(e,t){e.pivotResultCols?.setPivotResultCols(t,"api")}function u_(e){const t=e.pivotResultCols?.getPivotResultCols();return t?t.list:null}import{BeanStub as h_}from"ag-grid-community";var Xu="PivotRowTotal_",p_=({headerName:e},{headerName:t})=>e&&!t?1:!e&&t?-1:!e&&!t?0:e<t?-1:e>t?1:0,g_=e=>(t,s)=>e(t.headerName,s.headerName),f_=class extends h_{constructor(){super(...arguments),this.beanName="pivotColDefSvc"}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){const e=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e);function s(r,a=[]){return r.forEach(n=>{n.children!==void 0?s(n.children,a):a.push(n)}),a}const i=s(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),t}createPivotColumnsFromUniqueValues(e){const t=this.pivotColsSvc?.columns??[],s=t.length;return this.recursivelyBuildGroup(0,e,[],s,t)}recursivelyBuildGroup(e,t,s,i,r){if(e>=i)return this.buildMeasureCols(s);const{pivotComparator:a}=r[e].getColDef(),n=a?g_(a):p_,o=this.valueColsSvc?.columns;if(o?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===i-1){const c=[];for(const d of t.keys()){const u=[...s,d],h=this.createColDef(o[0],d,u);h.columnGroupShow="open",c.push(h)}return c.sort(n),c}const l=[];for(const c of t.keys()){const d=this.pivotDefaultExpanded===-1||e<this.pivotDefaultExpanded,u=[...s,c];l.push({children:this.recursivelyBuildGroup(e+1,t.get(c),u,i,r),headerName:c,pivotKeys:u,columnGroupShow:"open",openByDefault:d,groupId:this.generateColumnGroupId(u)})}return l.sort(n),l}buildMeasureCols(e){const t=this.valueColsSvc?.columns??[];return t.length===0?[this.createColDef(null,"-",e)]:t.map(s=>{const i=this.colNames.getDisplayNameForColumn(s,"header"),r=this.createColDef(s,i,e);return r.columnGroupShow="open",r})}addExpandablePivotGroups(e,t){const s=this.gos.get("suppressExpandablePivotGroups");if(s||this.gos.get("pivotColumnGroupTotals"))return;const i=(r,a,n)=>{if("children"in r){const{valueColsSvc:c}=this,{columns:d=[]}=c??{},u=new Map;r.children.forEach(g=>{i(g,a,u)});const h=!r.children.some(g=>g.children),p=h&&d.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(const g of d){const f=this.colNames.getDisplayNameForColumn(g,"header"),m=this.createColDef(g,f,r.pivotKeys);m.pivotTotalColumnIds=u.get(g.getColId()),m.columnGroupShow=s?"open":"closed",m.aggFunc=g.getAggFunc(),(!h||p)&&(r.children.push(m),a.push(m))}this.merge(n,u);return}if(!r.pivotValueColumn)return;const o=r.pivotValueColumn.getColId();n.has(o)?n.get(o).push(r.colId):n.set(o,[r.colId])};e.forEach(r=>{i(r,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const s=this.gos.get("pivotColumnGroupTotals")==="after",i=this.valueColsSvc?.columns,r=i?.map(a=>a.getAggFunc());if(!(!r||r.length<1||!this.sameAggFuncs(r))&&i){const a=i[0];e.forEach(n=>{this.recursivelyAddPivotTotal(n,t,a,s)})}}recursivelyAddPivotTotal(e,t,s,i){const r=e;if(!r.children){const n=e;return n.colId?[n.colId]:null}let a=[];if(r.children.forEach(n=>{const o=this.recursivelyAddPivotTotal(n,t,s,i);o&&(a=a.concat(o))}),r.children.length>1){const o=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),l=this.createColDef(s,o,e.pivotKeys,!0);l.pivotTotalColumnIds=a,l.aggFunc=s.getAggFunc(),l.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const c=e.children;i?c.push(l):c.unshift(l),t.push(l)}return a}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const s=this.gos.get("pivotRowTotals")==="after",r=(this.valueColsSvc?.columns??[]).slice();s||r.reverse();const a=r.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let n=0;n<r.length;n++){const o=r[n],l=this.colNames.getDisplayNameForColumn(o,"header"),c=this.createColDef(o,l,[]),d=[];for(let h=0;h<t.length;h++){const p=t[h];p.pivotValueColumn===o&&d.push(p.colId)}c.pivotTotalColumnIds=d,c.colId=Xu+c.colId;const u=a?{children:[c],pivotKeys:[],groupId:`${Xu}_pivotGroup_${o.getColId()}`}:c;t.push(c),s?e.push(u):e.unshift(u)}}recreateColDef(e){const{pivotValueColumn:t,headerName:s,pivotKeys:i,pivotTotalColumnIds:r,columnGroupShow:a,colId:n,valueGetter:o,aggFunc:l}=e;if(!t)return e;const c=this.createColDef(t,s,i,!!r);return c.columnGroupShow=a,c.colId=n,c.valueGetter=o,c.aggFunc=l,c.pivotTotalColumnIds=r,this.gos.get("processPivotResultColDef")?.(c),c}createColDef(e,t,s,i=!1){const r={};if(e){const a=e.getColDef();Object.assign(r,a),r.hide=!1}return r.headerName=t,r.colId=this.generateColumnId(s||[],e&&!i?e.getColId():""),r.field=r.colId,r.valueGetter=a=>a.data?.[a.colDef.field],r.pivotKeys=s,r.pivotValueColumn=e,r.filter===!0&&(r.filter="agNumberColumnFilter"),r}sameAggFuncs(e){if(e.length==1)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}merge(e,t){t.forEach((s,i)=>{const a=[...e.has(i)?e.get(i):[],...s];e.set(i,a)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(s=>s.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(i=>i.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t=new Map;for(let r=0;r<e.length;r++){const n=e[r].split(this.fieldSeparator);let o=t;for(let l=0;l<n.length;l++){const c=n[l];let d=o.get(c);d||(d=new Map,o.set(c,d)),o=d}}const s=(r,a,n,o)=>{const l=[];for(const[u,h]of n){const p=s(`${r}${this.fieldSeparator}${u}`,u,h,o+1);l.push(p)}if(l.length===0){const u=this.colModel.getColDefCol(a);if(u){const p=this.colNames.getDisplayNameForColumn(u,"header")??a,g=this.createColDef(u,p,void 0,!1);return g.colId=r,g.aggFunc=u.getAggFunc(),g.valueGetter=f=>f.data?.[r],g}return{colId:r,headerName:a,valueGetter:p=>p.data?.[r]}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&l.length===1&&"colId"in l[0]?(l[0].headerName=a,l[0]):{openByDefault:this.pivotDefaultExpanded===-1||o<this.pivotDefaultExpanded,groupId:r,headerName:a,children:l}},i=[];for(const[r,a]of t){const n=s(r,r,a,0);i.push(n)}return i}};import{BeanStub as m_,_areEqual as C_,_createColumnTree as v_,_createColumnTreeWithIds as S_,_destroyColumnTree as Zu,_exists as b_,_getColumnsFromTree as y_}from"ag-grid-community";var w_=class extends m_{constructor(){super(...arguments),this.beanName="pivotResultCols"}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols}destroy(){Zu(this.beans,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const s=this.colModel.getColDefCol(t);let i=null;for(const r of this.pivotResultCols.list){const a=r.getColDef().pivotKeys,n=r.getColDef().pivotValueColumn;C_(a,e)&&n===s&&(i=r)}return i}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.colModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.colModel.ready&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const i=(t==="api"?v_:S_)(this.beans,e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);Zu(this.beans,this.pivotResultCols?.tree,i.columnTree);const r=i.columnTree,a=i.treeDepth,n=y_(r),o={};this.pivotResultCols={tree:r,treeDepth:a,list:n,map:o};for(const c of this.pivotResultCols.list)this.pivotResultCols.map[c.getId()]=c;const l=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.colModel.refreshCols(!l,t)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.colModel.refreshCols(!1,t);this.visibleCols.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),s=this.gos.get("processPivotResultColGroupDef");if(!t&&!s)return;const i=r=>{r.forEach(a=>{if(b_(a.children)){const o=a;s&&s(o),i(o.children)}else t&&t(a)})};e&&i(e)}};import{BeanStub as x_,_jsonEquals as F_,_missing as R_}from"ag-grid-community";var Ju="Exceeded maximum allowed pivot column count.",ir=e=>{const t={};return e.forEach((s,i)=>t[i]=s instanceof Map?ir(s):s),t},A_=class extends x_{constructor(){super(...arguments),this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.pivotColDefSvc=e.pivotColDefSvc}execute(e){this.colModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent()&&(this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),e&&(e.active=!1))}executePivotOn(e){const t=this.valueColsSvc?.columns.length??1,s=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=s===-1?-1:s/t;let i;try{i=this.bucketUpRowNodes(e)}catch(C){if(C.message===Ju){this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const r=this.setUniqueValues(i),a=this.valueColsSvc?.columns??[],n=a.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),o=a.map(C=>C.getAggFunc().toString()).join("#"),l=this.aggregationColumnsHashLastTime!==n,c=this.aggregationFuncsHashLastTime!==o;this.aggregationColumnsHashLastTime=n,this.aggregationFuncsHashLastTime=o;const d=(this.rowGroupColsSvc?.columns??[]).map(C=>C.getId()).join("#"),u=d!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=d;const h=this.gos.get("pivotRowTotals"),p=this.gos.get("pivotColumnGroupTotals"),g=this.gos.get("suppressExpandablePivotGroups"),f=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),m=h!==this.pivotRowTotalsLastTime||p!==this.pivotColumnGroupTotalsLastTime||g!==this.suppressExpandablePivotGroupsLastTime||f!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=h,this.pivotColumnGroupTotalsLastTime=p,this.suppressExpandablePivotGroupsLastTime=g,this.removePivotHeaderRowWhenSingleValueColumnLastTime=f,this.lastTimeFailed||r||l||u||c||m){const C=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);this.pivotResultCols.setPivotResultCols(C,"rowModelUpdated"),e&&(e.active=!1)}this.lastTimeFailed=!1}setUniqueValues(e){return F_(ir(this.uniqueValues),ir(e))?!1:(this.uniqueValues=e,!0)}bucketUpRowNodes(e){this.currentUniqueCount=0;const t=new Map;e.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const s=i=>{i.leafGroup?this.bucketRowNode(i,t):i.childrenAfterFilter?.forEach(s)};return e.executeFromRootNode(s),t}bucketRowNode(e,t){const s=this.pivotColsSvc?.columns;s?.length===0?e.childrenMapped=null:e.childrenMapped=ir(this.bucketChildren(e.childrenAfterFilter,s,0,t)),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t=[],s,i){const r=new Map,a=t[s],n=this.maxUniqueValues!==-1;if(e.forEach(l=>{let c=this.valueSvc.getKeyForNode(a,l);if(R_(c)&&(c=""),!i.get(c)){this.currentUniqueCount+=1,i.set(c,new Map);const d=this.currentUniqueCount>this.maxUniqueValues;if(n&&d)throw new Error(Ju)}r.has(c)||r.set(c,[]),r.get(c).push(l)}),s===t.length-1)return r;const o=new Map;for(const l of r.keys())o.set(l,this.bucketChildren(r.get(l),t,s+1,i.get(l)));return o}},Qu={moduleName:"SharedPivot",version:D,beans:[w_,f_,Td],apiFunctions:{isPivotMode:e_,getPivotResultColumn:t_,setValueColumns:s_,getValueColumns:i_,removeValueColumns:r_,addValueColumns:a_,setPivotColumns:n_,removePivotColumns:o_,addPivotColumns:l_,getPivotColumns:c_,setPivotResultColumns:d_,getPivotResultColumns:u_},dependsOn:[tu,Q1]},eh={moduleName:"Pivot",version:D,rowModels:["clientSide"],beans:[A_],dependsOn:[Qu,an,Ns]};import{BeanStub as M_,RowNode as T_,_EmptyArray as Jt,_removeFromArray as P_,_warn as rr}from"ag-grid-community";var th=e=>{const t=e.split(".");if(t.includes("__proto__"))return()=>{};const s=t.length;return s<2?i=>i?.[e]:i=>{let r=0;do if(i=i?.[t[r++]],r===s)return i;while(typeof i=="object")}},fe=2147483648,me=1073741824,ar=536870912,rt=268435456,Ks=268435455,bn=String.fromCodePoint(31,41150,8291),yn=3,I_=class extends M_{constructor(){super(...arguments),this.nestedDataGetter=null,this.parentIdGetter=null,this.nonLeafsById=null,this.nodesToUnselect=null,this.fullReload=!1}postConstruct(){this.onPropChange(null)}onPropChange(e){const t=this.gos;if(!e||e.has("treeDataParentIdField")){const s=t.get("treeDataParentIdField"),i=s?th(s):null;this.fullReload||(this.fullReload=this.parentIdGetter!==i),this.parentIdGetter=i,i&&(this.nestedDataGetter=null)}if(!e||e.has("treeDataChildrenField")){const s=this.parentIdGetter?"":t.get("treeDataChildrenField"),i=s?th(s):null;this.fullReload||(this.fullReload=this.nestedDataGetter!==i),this.nestedDataGetter=i}}destroy(){this.nodesToUnselect=null,this.reset(),super.destroy()}reset(){this.clearNonLeafs(),this.deselectHiddenNodes(!1),this.fullReload=!0}clearNonLeafs(){const e=this.nonLeafsById;if(e){for(const t of e.values())t._destroy(!1);e.clear(),this.nonLeafsById=null}}getNonLeaf(e){return this.nonLeafsById?.get(e)}loadGroupData(e){const t=e.key;if(t==null)return e._groupData=null,null;const s={};e._groupData=s;const i=this.beans.showRowGroupCols?.columns;if(i)for(let r=0,a=i.length;r<a;++r)s[i[r].getColId()]=t;return s}execute(e,t){this.fullReload&&this.reset();const{changedRowNodes:s,changedPath:i}=t,r=i?.active?i:void 0,a=this.fullReload||!s&&!r,n=!!s&&this.flagUpdatedNodes(s);(a||n)&&(this.fullReload=!1,this.parentIdGetter?this.loadSelfRef(e,a):this.nestedDataGetter?this.loadNested(e,s,a):this.loadDataPath(e,a));const o=this.initRowsParents(e);this.destroyFillerRows(!!t.animate),this.initRowsChildrenSize(e);let l=this.preprocessRows(e);const c=o||(l&fe)!==0;l&=~fe;const d=this.traverseRoot(e,r);return l>0&&l!==d&&(this.handleCycles(e),this.traverseRoot(e,r)),e.treeNodeFlags=0,this.deselectHiddenNodes(o||a),c}flagUpdatedNodes(e){const{adds:t,updates:s,removals:i}=e;let r=i.length>0;if(t.size>0){r=!0;for(const a of t)a.treeNodeFlags|=me}if(s.size>0){r=!0;for(const a of s)a.treeNodeFlags|=me}return r}initRowsParents(e){const t=e._leafs,s=t.length;let i=!1;for(let r=0;r<s;++r)this.initRowParent(t[r])&&(i=!0);return i}initRowParent(e){let t=!1;for(;;){const s=e.parent,i=e.treeParent;if(i===null){s&&(t=!0,this.hideRow(e));break}let r=i.treeNodeFlags+1;const a=s!==i;if(a&&(t=!0,r|=me,e.parent=i),a&&s&&(s.destroyed&&D_(i,s)&&(r|=rt),s.treeNodeFlags|=me),i.sourceRowIndex>=0||i.treeNodeFlags&ar||i.treeParent===null){i.treeNodeFlags=r;break}i.treeNodeFlags=r|ar|e.treeNodeFlags&me,e=i}return t}destroyFillerRows(e){const t=this.nonLeafsById;if(t){for(const s of t.values())(s.treeParent===null||!(s.treeNodeFlags&Ks))&&(t.delete(s.id),s._destroy(e),this.hideRow(s));t.size===0&&(this.nonLeafsById=null)}}initRowsChildrenSize(e){this.initRowChildrenSize(e);const t=e._leafs,s=t.length;for(let r=0;r<s;++r)this.initRowChildrenSize(t[r]);const i=this.nonLeafsById;if(i!==null)for(const r of i.values())this.initRowChildrenSize(r)}initRowChildrenSize(e){let{childrenAfterGroup:t,_leafs:s,treeNodeFlags:i}=e;const r=t?.length,a=i&Ks;if(e.treeNodeFlags=i&~Ks|((r||0)===a?0:fe),a===0&&e.level>=0){if(t!==Jt){e.childrenAfterGroup=Jt;const n=e.sibling;n&&(n.childrenAfterGroup=Jt)}}else if(r!==a||t===s)if(!t||t===Jt||t===s){e.childrenAfterGroup=t=new Array(a);const n=e.sibling;n&&(n.childrenAfterGroup=t)}else t.length=a}preprocessRows(e){const t=e._leafs,s=t.length;let i=0,r=!1;for(let a=0;a<s;++a){let n=t[a];for(;;){const o=n.treeParent;if(o===null)break;++i;let l=o.treeNodeFlags;const c=o.childrenAfterGroup,d=l&Ks;if(l=l&~Ks|d+1,(l&fe||c[d]!==n)&&(l|=fe,c[d]=n,r=!0),o.treeNodeFlags=l,o.data||!(o.treeNodeFlags&ar)||o.treeParent===null)break;o.treeNodeFlags=l&~ar|n.treeNodeFlags&me,n=o}}return i|(r?fe:0)}traverseRoot(e,t){let s=0;const i=e.childrenAfterGroup;for(let r=0,a=i.length;r<a;++r)s+=this.traverse(i[r],0,!1,t);return s&~fe}traverse(e,t,s,i){const r=e.childrenAfterGroup,a=r.length;let n=e.treeNodeFlags;e.treeNodeFlags=n&rt,e.level=t,e.group!==!!a?(xc(e,this.beans,!!a),n|=me):e.hasChildren()!==!!a&&(e.updateHasChildren(),n|=me),n&(me|fe)&&i?.addParentNode(e),a!==0||e.master?n&rt||(e.treeNodeFlags|=rt,e.expanded=Ja(this.beans,e,t)):(e.expanded&&(e.expanded=!1),n&rt&&(e.treeNodeFlags&=~rt)),s&&e.rowIndex!==null&&e.clearRowTopAndRowIndex(),s||(s=e.expanded===!1),++t,n&=fe;for(let l=0;l<a;++l){const c=r[l],d=this.traverse(c,t,s,i);n=n+(d&~fe)|d&fe}return n&fe&&(e._leafs=void 0),n+1}handleCycles(e){const t=new Set,s=a=>{if(t.has(a))return!1;t.add(a);for(const n of a.childrenAfterGroup)s(n);return!0};s(e);const i=e.childrenAfterGroup;i.length=0;const r=e._leafs;for(let a=0,n=r.length;a<n;++a){const o=r[a],l=o.treeParent;l&&s(o)?(l.treeNodeFlags|=fe|me,o.parent=e,P_(l.childrenAfterGroup,o),i.push(o),rr(270,{id:o.id,parentId:l?.id??""})):l===e&&i.push(o)}}loadNested(e,t,s){if(!s&&t){for(const r of t.adds)r.key=r.id;return}const i=e._leafs;for(let r=0,a=i.length;r<a;++r){const n=i[r],o=n.id;n.key!==o&&nr(n,o)}}loadSelfRef(e,t){const s=e._leafs,i=s.length;if(!this.gos.get("getRowId")){for(let o=0;o<i;o++)s[o].treeParent=null;return}const a=this.beans.rowModel,n=this.parentIdGetter;for(let o=0;o<i;o++){const l=s[o];if(t||l.treeNodeFlags&me||l.treeParent?.destroyed){let c;const d=n?.(l.data);d!=null&&(c=a.getRowNode(d),c||rr(271,{id:l.id,parentId:d})),l.treeParent=c??e;const u=l.id;l.key!==u&&nr(l,u)}else l.treeParent??(l.treeParent=e)}}loadFlattened(e){const t=e._leafs;for(let s=0,i=t.length;s<i;++s){const r=t[s];r.treeParent=e;const a=r.id;r.key!==a&&nr(r,a)}}loadDataPath(e,t){const s=this.gos.get("getDataPath");if(!s){this.loadFlattened(e);return}const i=new Map,r=new Map;let a;t||(a=this.loadExistingDataPath(e,i,r));const n=e._leafs;for(let o=0,l=n.length;o<l;++o){const c=n[o];if(!t&&c.treeParent!==null&&!(c.treeNodeFlags&me))continue;const d=s(c.data),u=d?.length;if(!u){rr(185,{data:c.data});continue}const h=d[u-1];c.key!==h&&nr(c,h);const p=d.join(bn);r.set(c,p);const g=i.get(p);g===void 0?i.set(p,c):g!==c&&(a=this.duplicatedPath(i,a,g,c,p))}a&&this.processDuplicatePaths(a,r),this.buildFromPaths(e,i,r)}loadExistingDataPath(e,t,s){let i;const r=e._leafs;for(let a=0,n=r.length;a<n;++a){const o=r[a],l=o.treeParent;if(l===null||o.treeNodeFlags&me)continue;let c=o.key,d=l;for(;d&&d!==e&&d!==o;){c=bn+c;const u=s.get(d);if(u!==void 0){c=u+c;break}c=d.key+c,d=d.treeParent}if(d!==o){s.set(o,c);const u=t.get(c);u===void 0?t.set(c,o):u!==o&&(i=this.duplicatedPath(t,i,u,o,c))}}return i}duplicatedPath(e,t,s,i,r){i.sourceRowIndex<s.sourceRowIndex&&e.set(r,i);const a=(t??(t=new Map)).get(r);return a===void 0?t.set(r,[s,i]):a.push(i),t}buildFromPaths(e,t,s){const i=new Array(48),r=e._leafs;for(let a=0,n=r.length;a<n;++a){const o=r[a],l=s.get(o);if(l===void 0)continue;const c=this.splitPathKey(i,l);let d=0,u=e;for(let h=c-1;h>=0;--h){const p=t.get(l.slice(0,i[h]));if(p){u=p,d=h+1;break}}d<c&&(u=this.buildMissingFillers(t,l,i,c,d,u)),o.treeParent=u}}splitPathKey(e,t){let s=0,i=0;const r=t.length;for(;i<r;){const a=t.indexOf(bn,i);if(a===-1)break;e[s++]=a,i=a+yn}return s}buildMissingFillers(e,t,s,i,r,a){let n=0,o="row-group";a.sourceRowIndex<0&&a.treeParent&&(n=r,o=a.id);do{const l=r===0?0:s[r-1]+yn,c=s[r],d=t.slice(0,c);let u=e.get(d);if(u===void 0){const h=l===0?d:t.slice(l,c);o=this.makeFillerIdBase(t,s,r,o,n)+h,u=this.getOrCreateFiller(h,o),e.set(d,u),n=r+1}else u.sourceRowIndex<0&&(o=u.id,n=r+1);u.treeParent=a,a=u,++r}while(r<i);return a}processDuplicatePaths(e,t){for(const s of e.values()){s.sort(E_);const i=s.length,r=new Array(i-1);for(let n=1;n<i;++n){const o=s[n];t.delete(o),o.treeParent=null,r[n-1]=o.data}const a=s[0];rr(186,{rowId:a.id,rowData:a.data,duplicateRowsData:r})}}getOrCreateFiller(e,t){const s=this.nonLeafsById??(this.nonLeafsById=new Map);let i=s.get(t);return i===void 0&&(i=new T_(this.beans),i.id=t,i.key=e,i.group=!0,i.leafGroup=!1,i.rowGroupIndex=null,s.set(t,i)),i}makeFillerIdBase(e,t,s,i,r){for(;r<s;){const a=r>0?t[r-1]+yn:0,n=t[r];i+="-"+r+"-"+e.slice(a,n),++r}return i+"-"+s+"-"}deselectHiddenNodes(e){const t=this.beans.selectionSvc,s=this.nodesToUnselect,i="rowDataChanged";if(s&&(this.nodesToUnselect=null,t?.setNodesSelected({newValue:!1,nodes:s,suppressFinishActions:!0,source:i})),(s||e)&&t?.updateGroupsFromChildrenSelections?.(i),s){const r=t?.getSelectedNodes()??null;this.eventSvc.dispatchEvent({type:"selectionChanged",source:i,selectedNodes:r,serverSideState:null})}}hideRow(e){e.isSelected()&&(this.nodesToUnselect??(this.nodesToUnselect=[])).push(e),e.parent=null,e.group=!1,e.treeParent=null,e.treeNodeFlags=0,e.childrenAfterGroup=Jt,e._leafs=void 0,e._groupData=null;const t=e.sibling;t&&(t.childrenAfterGroup=Jt),e.updateHasChildren(),e.rowIndex!==null&&e.clearRowTopAndRowIndex()}onShowRowGroupColsSetChanged(){const e=this.beans.rowModel.rootNode._leafs;if(!e)return;for(let s=0,i=e.length;s<i;++s)e[s]._groupData=void 0;const t=this.nonLeafsById;if(t)for(const s of t.values())s._groupData=void 0}},E_=(e,t)=>e.sourceRowIndex-t.sourceRowIndex,D_=(e,t)=>t.treeNodeFlags&rt&&!(e.treeNodeFlags&rt)&&e.treeParent!==null&&e.sourceRowIndex<0?(e.expanded=t.expanded,!0):!1,nr=(e,t)=>{const s=e._groupData!==void 0;e.key=t,e.groupValue=t;const i=e.sibling;i&&(i.key=t),s&&(e._groupData=void 0,e.setData(e.data))},sh={moduleName:"SharedTreeData",version:D,dependsOn:[B,qa,Yd,Qa]},ih={moduleName:"TreeData",version:D,dynamicBeans:{treeGroupStrategy:I_},rowModels:["clientSide"],dependsOn:[sh,Xa,Ns,qd]};import{BeanStub as L_,RowNode as k_,_doOnce as G_,_exists as wn,_getGroupTotalRowCallback as rh,_getRowHeightAsNumber as O_,_getRowHeightForNode as ah,_warn as __}from"ag-grid-community";var N_="ag-Grid-MissingKey",B_=class extends L_{constructor(){super(...arguments),this.beanName="ssrmBlockUtils"}wireBeans(e){this.valueSvc=e.valueSvc,this.showRowGroupCols=e.showRowGroupCols,this.nodeManager=e.ssrmNodeManager,this.expansionSvc=e.expansionSvc,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}createRowNode(e){const t=new k_(this.beans),s=e.rowHeight!=null?e.rowHeight:O_(this.beans);return t.setRowHeight(s),t.group=e.group,t.leafGroup=e.leafGroup,t.level=e.level,t.uiLevel=e.level,t.parent=e.parent,t.stub=!0,t.__needsRefreshWhenVisible=!1,t.group&&(t.expanded=!1,t.field=e.field,t.rowGroupColumn=e.rowGroupColumn,t.rowGroupIndex=e.level),t}destroyRowNode(e,t=!1){e.childStore&&!t&&(this.destroyBean(e.childStore),e.childStore=null);const s=e.sibling;s&&!e.footer&&this.destroyRowNode(s,!1),e._destroy(!0),e.id!=null&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();const t=this.gos.get("getServerSideGroupKey"),s=e.hasChildren();s&&t!=null&&(e.key=t(e.data)),!s&&e.childStore!=null&&(this.destroyBean(e.childStore),e.childStore=null,e.master||(e.expanded=!1))}setRowGroupInfo(e){if(e.key=this.valueSvc.getValue(e.rowGroupColumn,e,"data"),(e.key===null||e.key===void 0)&&G_(()=>{__(190,{rowGroupId:e.rowGroupColumn?.getId(),data:e.data})},"SSBlock-BadKey"),this.gos.get("groupAllowUnbalanced")&&e.key===""){const r=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(r,e))}rh(this.beans.gos)({node:e})&&(Be(e,this.beans),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");t!=null?e.master=t(e.data):e.master=!0}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):e.group?(this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):this.gos.get("masterDetail")}updateRowFooter(e){if(!e.footer){if(e.group&&rh(this.beans.gos)({node:e})&&!e.sibling){Be(e,this.beans);return}e.sibling&&Ya(e)}}setDataIntoRowNode(e,t,s,i){e.stub=!1;const r=this.gos.get("treeData");e.setDataAndId(t,s);const a=e.group;(r||!a)&&this.gos.get("masterDetail")&&this.setMasterDetailInfo(e),r?this.setTreeGroupInfo(e):a&&this.setRowGroupInfo(e),(r||a)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),wn(t)&&(e.setRowHeight(ah(this.beans,e,!1,i).height),e.sibling?.setRowHeight(ah(this.beans,e.sibling,!1,i).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=e.key;e.groupValue=t,e.sibling&&(e.sibling.groupValue=t);const s=this.showRowGroupCols?.columns;if(!s)return;const i=this.gos.get("treeData");for(const r of s){let a=e._groupData;if(a||(a={},e._groupData=a),i)a[r.getColId()]=t;else if(r.isRowGroupDisplayed(e.rowGroupColumn.getId())){const n=this.valueSvc.getValue(e.rowGroupColumn,e,"data");a[r.getColId()]=n}}}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&!!e.childStore&&e.childStore?.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode?.clearRowTopAndRowIndex()}setDisplayIndex(e,t,s,i){const r=this.gos.get("groupAllowUnbalanced")&&e.group&&e.key==="";if(this.gos.get("groupHideOpenParents")&&e.group&&e.expanded||r?(e.setRowIndex(null),e.setRowTop(null)):(e.setRowIndex(t.value++),e.setRowTop(s.value),s.value+=e.rowHeight),e.setUiLevel(i),e.footer)return;if(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.value++),e.detailNode.setRowTop(s.value),s.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&!!e.childStore){const l=e.childStore;e.expanded||r?l.setDisplayIndexes(t,s,r?i:i+1):l.clearDisplayIndexes()}}extractRowBounds(e,t){const s=i=>({rowHeight:i.rowHeight,rowTop:i.rowTop});if(e.rowIndex===t)return s(e);if(e.hasChildren()&&e.expanded&&e.childStore){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&e.detailNode&&e.detailNode.rowIndex===t)return s(e.detailNode)}isPixelInNodeRange(e,t){return!wn(e.rowTop)||!wn(e.rowHeight)?!1:t>=e.rowTop&&t<e.rowTop+e.rowHeight}getIndexAtPixel(e,t){if(this.isPixelInNodeRange(e,t))return e.rowIndex;const s=e.master&&e.expanded,i=e.detailNode;if(s&&i&&this.isPixelInNodeRange(i,t))return i.rowIndex;if(e.hasChildren()&&e.expanded&&e.childStore){const r=e.childStore;if(r.isPixelInRange(t))return r.getRowIndexAtPixel(t)}return null}createNodeIdPrefix(e){const t=[];let s=e;for(;s&&s.level>=0;)s.key===""?t.push(N_):t.push(s.key),s=s.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){const t=!!this.expansionSvc?.isNodeExpanded(e),s=e.expanded;!!s!==t?e.setExpanded(t):s===void 0&&(e.expanded=t)}};import{BeanStub as V_,_isServerSideRowModel as H_}from"ag-grid-community";var z_=class extends V_{constructor(){super(...arguments),this.beanName="ssrmExpandListener"}postConstruct(){H_(this.gos)&&this.addManagedEventListeners({rowExpansionStateChanged:this.onRowExpandStateChanged.bind(this)})}onRowExpandStateChanged(){const e=this.beans,t=e.expansionSvc;e.rowModel.forEachNode(s=>{t.updateExpandedState(s)}),this.eventSvc.dispatchEvent({type:"storeUpdated"})}};import{BeanStub as U_,_isServerSideRowModel as W_,_jsonEquals as K_}from"ag-grid-community";var $_=class extends U_{constructor(){super(...arguments),this.beanName="ssrmFilterListener"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.filterManager=e.filterManager,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){W_(this.gos)&&this.addManagedEventListeners({advancedFilterEnabledChanged:()=>this.onFilterChanged(!0),filterChanged:()=>this.onFilterChanged()})}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const s=t.filterModel;let i,r;if(this.filterManager?.isAdvFilterEnabled()){i=this.filterManager.getAdvFilterModel();const l=e?Object.keys(s??{}):this.getAdvancedFilterColumns(s),c=this.getAdvancedFilterColumns(i);for(const d of l)c.add(d);r=Array.from(c)}else if(i=this.filterManager?.getFilterModel()??{},e){const l=this.getAdvancedFilterColumns(s);for(const c of Object.keys(i))l.add(c);r=Array.from(l)}else r=this.findChangedColumns(s,i);const a=this.listenerUtils.isSortingWithValueColumn(r),n=this.listenerUtils.isSortingWithSecondaryColumn(r),o={valueColChanged:a,secondaryColChanged:n,changedColumns:r};this.serverSideRowModel.refreshAfterFilter(i,o)}findChangedColumns(e,t){const s={};for(const r of Object.keys(e))s[r]=!0;for(const r of Object.keys(t))s[r]=!0;const i=[];for(const r of Object.keys(s))!K_(e[r],t[r])&&i.push(r);return i}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const s=i=>{if(i.filterType==="join")for(const r of i.conditions)s(r);else t.add(i.colId)};return s(e),t}};import{BeanStub as j_}from"ag-grid-community";var Y_=class extends j_{constructor(){super(...arguments),this.beanName="ssrmListenerUtils"}wireBeans(e){this.pivotResultCols=e.pivotResultCols,this.valueColsSvc=e.valueColsSvc}isSortingWithValueColumn(e){const t=(this.valueColsSvc?.columns??[]).map(s=>s.getColId());for(let s=0;s<e.length;s++)if(t.indexOf(e[s])>-1)return!0;return!1}isSortingWithSecondaryColumn(e){const t=this.pivotResultCols?.getPivotResultCols();if(!t)return!1;const s=t.list.map(i=>i.getColId());for(let i=0;i<e.length;i++)if(s.indexOf(e[i])>-1)return!0;return!1}};import{BeanStub as q_,_isServerSideRowModel as X_}from"ag-grid-community";var Z_=class extends q_{constructor(){super(...arguments),this.beanName="ssrmSortSvc"}wireBeans(e){this.sortSvc=e.sortSvc,this.serverSideRowModel=e.rowModel,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){X_(this.gos)&&this.addManagedEventListeners({sortChanged:this.onSortChanged.bind(this)})}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortSvc.getSortModel(),s=e.sortModel,i=this.findChangedColumnsInSort(t,s),r=this.listenerUtils.isSortingWithValueColumn(i),a=this.listenerUtils.isSortingWithSecondaryColumn(i),n={valueColChanged:r,secondaryColChanged:a,changedColumns:i};this.serverSideRowModel.refreshAfterSort(t,n)}findChangedColumnsInSort(e,t){let s=[];for(const a of[e,t])if(a){const n=a.map(o=>o.colId);s=s.concat(n)}const i=(a,n)=>{const o=a?a.sort:null,l=n?n.sort:null;return o!==l},r=(a,n)=>{const o=a?t.indexOf(a):-1,l=n?e.indexOf(n):-1;return o!==l};return s.filter(a=>{const n=t.find(l=>l.colId===a),o=e.find(l=>l.colId===a);return i(n,o)||r(n,o)})}};import{BeanStub as J_,_warn as Q_}from"ag-grid-community";var eN=class extends J_{constructor(){super(...arguments),this.beanName="ssrmNodeManager",this.rowNodes=new Map}addRowNode(e){const t=e.id;this.rowNodes.has(t)&&Q_(187,{rowId:t,firstData:this.rowNodes.get(t).data,secondData:e.data}),this.rowNodes.set(t,e)}removeNode(e){const t=e.id;this.rowNodes.delete(t)}destroy(){this.clear(),super.destroy()}clear(){this.rowNodes.clear(),super.destroy()}};import{BeanStub as tN,RowNode as sN,_debounce as iN,_getRowHeightAsNumber as rN,_getRowHeightForNode as $s,_isGetRowHeightFunction as aN,_isRowSelection as nN,_jsonEquals as oN,_warn as lN}from"ag-grid-community";var cN=class extends tN{constructor(){super(...arguments),this.beanName="rowModel",this.started=!1,this.managingPivotResultColumns=!1,this.onRowHeightChanged_debounced=iN(this,this.onRowHeightChanged.bind(this),100)}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.filterManager=e.filterManager,this.sortSvc=e.sortSvc,this.rowRenderer=e.rowRenderer,this.nodeManager=e.ssrmNodeManager,this.storeFactory=e.ssrmStoreFactory,this.pivotColDefSvc=e.pivotColDefSvc}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}postConstruct(){const e=this.resetRootStore.bind(this);this.addManagedEventListeners({newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onStoreUpdated.bind(this),columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","cacheBlockSize"],e),this.addManagedPropertyListeners(["groupAllowUnbalanced","groupTotalRow"],()=>this.onStoreUpdated()),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){nN(this.gos)&&!this.gos.exists("getRowId")&&lN(188,{feature:"selection"})}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,s){const i=this.getRootStore();if(!i)return;const r=i.getChildStore(s);r&&r.applyRowData(e,t,e.rowData.length)}isLastRowIndexKnown(){const e=this.getRootStore();return e?e.isLastRowIndexKnown():!1}onColumnEverything(){if(!this.storeParams){this.resetRootStore();return}const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=c=>{const d={};for(const p of c.oldCols)d[p.id]=p;const u=c.newCols.every(p=>{const g=d[p.id];return g&&delete d[p.id],g&&g.field===p.field&&g.aggFunc===p.aggFunc}),h=!c.allowRemovedColumns&&!!Object.values(d).length;return u&&!h},r=!oN(this.storeParams.sortModel,this.sortSvc?.getSortModel()??[]),a=!i({oldCols:this.storeParams.rowGroupCols,newCols:e}),n=!i({oldCols:this.storeParams.pivotCols,newCols:s}),o=!!e?.length&&!i({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(r||a||n||o)this.resetRootStore();else{const c=this.createStoreParams();this.storeParams.rowGroupCols=c.rowGroupCols,this.storeParams.pivotCols=c.pivotCols,this.storeParams.valueCols=c.valueCols}}destroyRootStore(){this.rootNode?.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const s=this.getRootStore();s&&(s.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefSvc){this.gos.assertModuleRegistered("SharedPivot",2);return}const t=this.pivotColDefSvc.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.pivotResultCols?.setPivotResultCols(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=$s(this.beans,this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const s=$s(this.beans,this.rootNode.sibling);this.rootNode.sibling.setRowHeight(s.height,s.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const s=$s(this.beans,t);t.setRowHeight(s.height,s.estimated);const i=t.detailNode;if(i){const r=$s(this.beans,i);i.setRowHeight(r.height,r.estimated)}if(t.sibling){const r=$s(this.beans,t.sibling);i?.setRowHeight(r.height,r.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new sN(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.pivotResultCols?.setPivotResultCols(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e=[]){return e.map(t=>({id:t.getId(),aggFunc:t.getAggFunc(),displayName:this.colNames.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=aN(this.gos);return{valueCols:t,rowGroupCols:e,pivotCols:s,pivotMode:this.colModel.isPivotMode(),filterModel:this.filterManager?.isAdvFilterEnabled()?this.filterManager?.getAdvFilterModel():this.filterManager?.getFilterModel()??{},sortModel:this.sortSvc?.getSortModel()??[],datasource:this.datasource,lastAccessedSequence:{value:0},dynamicRowHeight:i}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){this.eventSvc.dispatchEvent({type:"modelUpdated",animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1})}onStoreUpdated(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes({value:0},{value:0},0)}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const s=this.getRootStore();s&&(s.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){return this.rootNode?.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:rN(this.beans)}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(s=>{const i=s.getBlockStates();for(const r of Object.keys(i))t[r]=i[r]}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}getOverlayType(){return this.getRootStore()?.getDisplayIndexEnd()===0?this.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows":null}isRowsToRender(){return this.getRootStore()!=null&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachDisplayedNode(e){const t=(s,i)=>{s.stub||!s.displayed||e(s,i)};this.forEachNode(t)}forEachNodeAfterFilterAndSort(e,t=!1){const s=this.getRootStore();s&&s.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const s=this.getRootStore();if(!s)return!0;const i=s.getChildStore(e);return i&&t(i),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,s=>s.refreshStore(e.purge==!0))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex;if(s===null&&i===null)return[];if(i===null)return e?[e]:[];if(s===null)return[t];const r=[],[a,n]=[s,i].sort((o,l)=>o-l);return this.forEachNode(o=>{const l=o.rowIndex;l==null||o.stub||l>=a&&l<=n&&r.push(o)}),r.length!==n-a+1?null:r}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s),s.detailNode&&s.detailNode.id===e&&(t=s.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const s=this.getRootStore();s&&s.setRowCount(e,t)}destroy(){this.destroyDatasource(),this.destroyRootStore(),super.destroy()}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}};import{_getServerSideRowModel as or,_warn as dN}from"ag-grid-community";function uN(e){return e.selectionSvc?.getSelectionState()??null}function hN(e,t){e.selectionSvc?.setSelectionState(t,"api")}function pN(e,t){return e.ssrmTxnManager?.applyTransaction(t)}function gN(e,t){const s=t.startRow??0,i=t.route??[];if(s<0){dN(189,{startRow:s});return}or(e)?.applyRowData(t.successParams,s,i)}function fN(e,t,s){return e.ssrmTxnManager?.applyTransactionAsync(t,s)}function mN(e){or(e)?.retryLoads()}function CN(e){return e.ssrmTxnManager?.flushAsyncTransactions()}function vN(e,t){or(e)?.refreshStore(t)}function SN(e){return or(e)?.getStoreState()??[]}import{RowNode as bN,_exists as yN,_getRowHeightForNode as wN}from"ag-grid-community";import{BeanStub as xN}from"ag-grid-community";var xn=class extends xN{constructor(){super(...arguments),this.name="expand",this.expanded=new Set,this.collapsed=new Set,this.initialState=new Map}setExpandedState({expandedRowGroupIds:e,collapsedRowGroupIds:t}){this.expanded=new Set(e),this.collapsed=new Set(t);for(const s of this.expanded)this.initialState.set(s,!1);for(const s of this.collapsed)this.initialState.set(s,!0)}getExpandedState(){return{expandedRowGroupIds:Array.from(this.expanded),collapsedRowGroupIds:Array.from(this.collapsed)}}setRowExpanded(e,t){const s=e.id,i=this.initialState.get(s)===t;if(t){this.collapsed.delete(s),i||this.expanded.add(s);return}this.expanded.delete(s),i||this.collapsed.add(s)}isRowExpanded(e){const t=e.id;if(this.expanded.has(t))return!0;if(this.collapsed.has(t))return!1;const s=this.initialState.get(t);if(s!=null)return s;const i=this.getInitialRowState(e);return this.initialState.set(t,i),i}getInitialRowState(e){if(!e.isExpandable())return!1;const t=this.gos.getCallback("isServerSideGroupOpenByDefault");if(!t)return!1;const s={data:e.data,rowNode:e};return t(s)}isRowInitialised(e){return this.initialState.has(e)}expandAll(e){this.beans.rowModel.forEachNode(t=>{this.setRowExpanded(t,e)})}};import{BeanStub as FN}from"ag-grid-community";var nh=class extends FN{constructor(){super(...arguments),this.name="expandAll",this.allExpanded=void 0,this.flipped=new Set}setExpandedState(e){this.allExpanded=e.expandAll,this.flipped=new Set(e.invertedRowGroupIds)}getExpandedState(){return{expandAll:this.allExpanded,invertedRowGroupIds:Array.from(this.flipped)}}setRowExpanded(e,t){const s=e.id;if(t===this.allExpanded){this.flipped.delete(s);return}this.flipped.add(s)}isRowExpanded(e){const t=e.id;return this.allExpanded!==this.flipped.has(t)}isRowInitialised(){return!0}expandAll(e){this.allExpanded=e,this.flipped.clear()}},RN=class extends Ed{constructor(){super(...arguments),this.beanName="expansionSvc"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}postConstruct(){const e=()=>{this.strategy=this.createManagedBean(new xn)};this.addManagedEventListeners({columnRowGroupChanged:e,columnPivotChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListener("ssrmExpandAllAffectsAllRows",t=>{t.currentValue||(this.strategy=this.createManagedBean(new xn),this.updateAllNodes(),this.dispatchStateUpdatedEvent())}),e()}setExpansionState(e){const t="expandAll"in e,s=this.isExpandAllStrategy(this.strategy);t!==s&&(this.strategy=t?this.createManagedBean(new nh):this.createManagedBean(new xn)),this.strategy.setExpandedState(e),this.dispatchStateUpdatedEvent(),this.updateAllNodes()}getExpansionState(){return this.strategy.getExpandedState()}updateAllNodes(){this.serverSideRowModel.forEachNode(e=>{super.setExpanded(e,this.isNodeExpanded(e))})}isNodeExpanded(e){return this.strategy.isRowExpanded(e)}setExpanded(e,t,s,i){this.strategy.setRowExpanded(e,t),super.setExpanded(e,t,s),this.dispatchStateUpdatedEvent(),this.updateExpandedState(e)}expandAll(e){const t=this.beans.gos.get("ssrmExpandAllAffectsAllRows"),s=!this.isExpandAllStrategy(this.strategy)&&t;this.strategy=s?new nh:this.strategy,this.strategy.expandAll(e),this.updateAllNodes(),this.dispatchStateUpdatedEvent(),this.beans.eventSvc.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}isExpandAllStrategy(e){return e.name==="expandAll"}onGroupExpandedOrCollapsed(){}setDetailsExpansionState(e){const{gos:t}=this.beans;if(!t.get("ssrmExpandAllAffectsAllRows"))return;const s=this.getExpansionState();if(s.expandAll===void 0)return;const r=s.expandAll&&s.invertedRowGroupIds.length===0;if((!s.expandAll&&s.invertedRowGroupIds.length===0)!==r)return r?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e){this.eventSvc.dispatchEvent(e),this.beans.rowRenderer.refreshCells({rowNodes:[e.node]})}updateExpandedState(e){const t=e.childStore;if(e.expanded){if(e.master&&!e.detailNode&&(e.detailNode=this.createDetailNode(e)),!t&&e.hasChildren()){const s=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(s,e))}}else t&&this.gos.get("purgeClosedRowNodes")&&(e.childStore=this.destroyBean(t))}createDetailNode(e){const t=new bN(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,yN(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const s=200,i=wN(this.beans,t).height;return t.rowHeight=i||s,t}};import{BaseSelectionService as AN,_error as MN,_getGroupSelectsDescendants as oh,_getRowSelectionMode as lh,_isMultiRowSelection as TN,_isRowSelection as lr,_isUsingNewRowSelectionAPI as PN,_warn as yt}from"ag-grid-community";import{BeanStub as IN,_error as cr,_isMultiRowSelection as ch,_isUsingNewRowSelectionAPI as EN,_warn as dr}from"ag-grid-community";var Fn=class extends IN{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectAllUsed=!1,this.selectedNodes={}}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){if(typeof e!="object"){cr(116);return}if(!("selectAll"in e)){cr(116);return}if(typeof e.selectAll!="boolean"){cr(117);return}if(!("toggledNodes"in e)||!Array.isArray(e.toggledNodes))return dr(197);const t={selectAll:e.selectAll,toggledNodes:new Set};e.toggledNodes.forEach(i=>{typeof i=="string"?t.toggledNodes.add(i):dr(196,{key:i})});const s=t.selectAll||t.toggledNodes.size>1;if(EN(this.gos)&&!ch(this.gos)&&s){dr(130);return}this.selectedState=t}deleteSelectionStateFromParent(e,t){if(this.selectedState.toggledNodes.size===0)return!1;let s=!1;for(const i of t)this.selectedState.toggledNodes.delete(i)&&(s=!0);return s}setNodesSelected(e){const{nodes:t,clearSelection:s,newValue:i,source:r}=e;if(t.length===0)return 0;const a=s&&i;if(!ch(this.gos)||a){if(t.length>1)return cr(130),0;const o=t[0],l=o.footer?o.sibling:o;return i&&l.selectable?(this.selectedNodes={[l.id]:l},this.selectedState={selectAll:!1,toggledNodes:new Set([l.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),1}const n=(o,l=i)=>{const c=o.footer?o.sibling:o;l&&c.selectable?this.selectedNodes[c.id]=c:delete this.selectedNodes[c.id],l===this.selectedState.selectAll||!c.selectable?this.selectedState.toggledNodes.delete(c.id):this.selectedState.toggledNodes.add(c.id)};for(const o of t)n(o);return t.length===1&&r==="api"&&this.selectionCtx.setRoot(t[0].footer?t[0].sibling:t[0]),1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(e=!1,t=!0){const{selectedState:{selectAll:s},selectedNodes:i,selectAllUsed:r}=this;return t&&r&&dr(199),e&&s?null:Object.values(i)}getSelectedRows(){return(this.getSelectedNodes()??[]).map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}isEmpty(){return!this.selectedState.selectAll&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAll:e,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed||(this.selectAllUsed=e)}getSelectAllState(){return this.selectedState.selectAll?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}};import{BeanStub as DN,_error as wt,_isMultiRowSelection as LN,_warn as kN}from"ag-grid-community";var ur=class extends DN{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}wireBeans(e){this.rowModel=e.rowModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.filterManager=e.filterManager,this.selectionSvc=e.selectionSvc}postConstruct(){this.addManagedEventListeners({modelUpdated:()=>this.removeRedundantState(),columnRowGroupChanged:()=>this.selectionSvc.reset("rowGroupChanged")})}getSelectedState(){const{gos:e,rowGroupColsSvc:t,selectedState:s}=this,i=e.get("treeData"),r=(a,n,o)=>{const l={nodeId:o};if((i||t&&n<=t.columns.length)&&(l.selectAllChildren=a.selectAllChildren),a.toggledNodes.size){const c=[];a.toggledNodes.forEach((d,u)=>{const h=r(d,n+1,u);c.push(h)}),l.toggledNodes=c}return l};return r(s,0)}setSelectedState(e){if("selectAll"in e){wt(111);return}const t=(s,i)=>{if(typeof s!="object")throw wt(243),new Error;if("selectAllChildren"in s&&typeof s.selectAllChildren!="boolean")throw wt(244),new Error;if("toggledNodes"in s){if(!Array.isArray(s.toggledNodes))throw wt(245),new Error;if(!s.toggledNodes.every(l=>typeof l=="object"&&"nodeId"in l&&typeof l.nodeId=="string"))throw wt(246),new Error}const r=s.selectAllChildren??!i,a=s.toggledNodes?.map(o=>[o.nodeId,t(o,r)]);if(a?.some(([,o])=>r===o.selectAllChildren&&o.toggledNodes.size===0))throw wt(247),new Error;return{selectAllChildren:r,toggledNodes:new Map(a)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch{}}deleteSelectionStateFromParent(e,t){let s=this.selectedState;const i=[...e];for(;s&&i.length;)s=s.toggledNodes.get(i.pop());if(!s)return!1;let r=!1;for(const a of t)s?.toggledNodes.delete(a)&&(r=!0);return r&&this.removeRedundantState(),r}setNodesSelected({nodes:e,newValue:t,clearSelection:s,source:i}){if(e.length===0)return 0;const r=s&&t;if(!LN(this.gos)||r){if(e.length>1)return wt(130),0;this.deselectAllRowNodes()}for(const a of e){const n=a.footer?a.sibling:a,o=this.getRouteToNode(n);this.recursivelySelectNode(o,this.selectedState,t)}return this.removeRedundantState(),e.length===1&&i==="api"&&this.selectionCtx.setRoot(e[0].footer?e[0].sibling:e[0]),1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],s){if(t.length===0){const i=s.toggledNodes.has(e.id);return e.hasChildren()&&s.toggledNodes.get(e.id)?.toggledNodes.size?void 0:s.selectAllChildren?!i:i}if(s.toggledNodes.has(e.id)){const i=s.toggledNodes.get(e.id);if(i)return this.isNodePathSelected(t,i)}return s.selectAllChildren}getRouteToNode(e){const t=[];let s=e;for(;s.parent;)t.push(s),s=s.parent;return t.reverse()}removeRedundantState(){if(this.filterManager?.isAnyFilterPresent())return;const e=(t=this.selectedState,s,i)=>{if(t.toggledNodes.forEach((n,o)=>{e(n,o,t)}),s){const o=this.rowModel.getRowNode(s)?.childStore;if(o?.isLastRowIndexKnown()&&t.toggledNodes.size>=o.getRowCount()){for(const d of t.toggledNodes.entries()){const[u,h]=d;if(h.toggledNodes.size>0||!this.rowModel.getRowNode(u))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const r=t.toggledNodes.size===0,a=i?.selectAllChildren===t.selectAllChildren;r&&a&&i?.toggledNodes.delete(s)};e()}recursivelySelectNode([e,...t],s,i){if(!e)return;if(!t.length){const o=e.selectable;if(s.selectAllChildren===i||!o){s.toggledNodes.delete(e.id);return}const c={selectAllChildren:i,toggledNodes:new Map};s.toggledNodes.set(e.id,c);return}const a=s.toggledNodes.has(e.id),n=s.toggledNodes.get(e.id)??{selectAllChildren:s.selectAllChildren,toggledNodes:new Map};a||s.toggledNodes.set(e.id,n),this.recursivelySelectNode(t,n,i),s.selectAllChildren===n.selectAllChildren&&n.toggledNodes.size===0&&s.toggledNodes.delete(e.id)}getSelectedNodes(e=!1){if(kN(202),this.selectedState.selectAllChildren&&e)return null;const t=[];return this.rowModel.forEachNode(s=>{s.isSelected()&&t.push(s)}),t}processNewRow(){}getSelectedRows(){return this.getSelectedNodes()?.map(e=>e.data)??[]}getSelectionCount(){return-1}isEmpty(){return!this.selectedState.selectAllChildren&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAllChildren:e,toggledNodes:new Map}}getSelectAllState(){return this.selectedState.selectAllChildren?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}},GN=class extends AN{constructor(){super(...arguments),this.beanName="selectionSvc"}postConstruct(){super.postConstruct(),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{const s=oh(this.gos),i=s&&this.selectionStrategy instanceof Fn?ur:!s&&this.selectionStrategy instanceof ur?Fn:void 0;i&&(this.destroyBean(this.selectionStrategy),this.selectionStrategy=this.createManagedBean(new i(this.selectionCtx)),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}),this.addManagedPropertyListeners(["rowSelection"],()=>{const s=lh(this.gos);s!==this.selectionMode&&(this.selectionMode=s,this.deselectAllRowNodes({source:"api"}))}),this.selectionMode=lh(this.gos);const t=oh(this.gos)?ur:Fn;this.selectionStrategy=this.createManagedBean(new t(this.selectionCtx))}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;let i=0;const r=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);return r==null?0:(this.selectionCtx.selectAll=!1,"select"in r?(r.reset?this.selectionStrategy.deselectAllRowNodes({source:"api"}):this.selectionStrategy.setNodesSelected({nodes:r.deselect,newValue:!1,source:s}),i=this.selectionStrategy.setNodesSelected({nodes:r.select,newValue:!0,source:s})):i=this.selectionStrategy.setNodesSelected({nodes:[r.node],newValue:r.newValue,clearSelection:r.clearSelection,event:e,source:s}),this.shotgunResetNodeSelectionState(s),this.dispatchSelectionChanged(s),i)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(!lr(this.gos)){e&&yt(132);return}Array.isArray(e)||(e?(this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(t)):this.deselectAllRowNodes({source:t}))}setNodesSelected(e){if(!lr(this.gos)&&e.newValue)return yt(132),0;const{nodes:t,...s}=e;if(t.length>1&&this.selectionMode!=="multiRow")return yt(130),0;const i={nodes:t.filter(a=>a.selectable),...s};if(!i.nodes.length)return 0;const r=this.selectionStrategy.setNodesSelected(i);return this.shotgunResetNodeSelectionState(i.source),this.dispatchSelectionChanged(i.source),r}deleteSelectionStateFromParent(e,t){this.selectionStrategy.deleteSelectionStateFromParent(e,t)&&(this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}shotgunResetNodeSelectionState(e){this.beans.rowModel.forEachNode(t=>{if(t.stub)return;const s=this.selectionStrategy.isNodeSelected(t);s!==t.isSelected()&&this.selectRowNode(t,s,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()??[]}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e){this.selectionStrategy.processNewRow(e);const t=this.selectionStrategy.isNodeSelected(e);if(t!=!1&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api");return}e.__selected=t}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"}),this.selectionCtx.reset()}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(){return!0}selectAllRowNodes(e){if(!lr(this.gos)){yt(132);return}if(dh(e),PN(this.gos)&&!TN(this.gos))return yt(130);this.selectionStrategy.selectAllRowNodes(e),this.selectionCtx.selectAll=!0,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!0,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}deselectAllRowNodes(e){dh(e),this.selectionStrategy.deselectAllRowNodes(e),this.selectionCtx.selectAll=!1,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!1,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}getSelectAllState(e){return this.selectionStrategy.getSelectAllState(e)}getBestCostNodeSelection(){return yt(194,{method:"getBestCostNodeSelection"})}updateSelectable(){if(!lr(this.gos))return;const e=[];this.beans.rowModel.forEachNode(t=>{!this.updateRowSelectable(t,!0)&&t.isSelected()&&e.push(t)}),e.length&&this.setNodesSelected({nodes:e,newValue:!1,source:"selectableChanged"})}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.selectionStrategy instanceof ur?null:this.selectionStrategy.getSelectedNodes(!0,!1),serverSideState:this.getSelectionState()})}updateSelectableAfterGrouping(){return MN(194,{method:"updateSelectableAfterGrouping"})}refreshMasterNodeState(){}setDetailSelectionState(){}};function dh({selectAll:e}){(e==="filtered"||e==="currentPage")&&yt(195,{justCurrentPage:e==="currentPage"})}import{BeanStub as ON}from"ag-grid-community";var _N=class extends ON{constructor(){super(...arguments),this.beanName="rowChildrenSvc"}getHasChildrenValue(e){const t=this.gos.get("treeData"),s=this.gos.get("isServerSideGroup");return!e.stub&&!e.footer&&(t?!!s&&s(e.data):!!e.group)}};import{BeanStub as NN,_addGridCommonParams as BN,_getMaxConcurrentDatasourceRequests as VN}from"ag-grid-community";var HN=class extends NN{constructor(){super(...arguments),this.beanName="lazyBlockLoadingSvc",this.outboundRequests=0,this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}wireBeans(e){this.rowRenderer=e.rowRenderer,this.rowModel=e.rowModel}postConstruct(){this.maxOutboundRequests=VN(this.gos)}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,setTimeout(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}onLoadComplete(){this.outboundRequests-=1,this.queueLoadCheck()}hasAvailableLoadBandwidth(){return this.maxOutboundRequests===void 0?!0:this.outboundRequests<this.maxOutboundRequests}queueLoadAction(){const e=this.getBlockToLoad();if(!e)return;const t=this.nextBlockToLoad&&this.nextBlockToLoad.cache===e.cache&&this.nextBlockToLoad.index===e.index;if(!t&&(!this.nextBlockToLoad||!t)){this.nextBlockToLoad=e,window.clearTimeout(this.loaderTimeout);const s=Number(this.nextBlockToLoad.index),i=this.nextBlockToLoad.cache,r=e.index+e.cache.getBlockSize();this.loaderTimeout=window.setTimeout(()=>{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,s,r),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,s){this.hasAvailableLoadBandwidth()&&(this.executeLoad(e,t,s),this.queueLoadCheck())}executeLoad(e,t,s){const i=e.getSsrmParams(),r={startRow:t,endRow:s,rowGroupCols:i.rowGroupCols,valueCols:i.valueCols,pivotCols:i.pivotCols,pivotMode:i.pivotMode,groupKeys:e.store.getParentNode().getRoute()??[],filterModel:i.filterModel,sortModel:i.sortModel},a=this.cacheLoadingNodesMap.get(e),n=()=>{for(let u=0;u<s-t;u++)a.delete(t+u)},o=()=>{for(let u=0;u<s-t;u++)a.add(t+u)},l=u=>{this.onLoadComplete(),e.onLoadSuccess(t,s-t,u),n()},c=()=>{this.onLoadComplete(),e.onLoadFailed(t,s-t),n()},d=BN(this.gos,{request:r,success:l,fail:c,parentNode:e.store.getParentNode()});o(),this.outboundRequests+=1,e.getSsrmParams().datasource?.getRows(d)}getBlockToLoad(){const e=this.rowRenderer.firstRenderedRow,t=this.rowRenderer.lastRenderedRow;for(let o=e;o<=t;o++){const l=this.rowModel.getRow(o);if(!l)continue;const c=l.parent?.childStore;if(!c)continue;const d=c.getCache(),u=d.getNodes().getBy("node",l);if(!(!u||this.cacheLoadingNodesMap.get(d)?.has(u.index))&&(l.__needsRefreshWhenVisible||l.stub&&!l.failedLoad))return{cache:d,index:d.getBlockStartIndex(u.index)}}let s=null,i=null,r=Number.MAX_SAFE_INTEGER;for(const o of this.cacheLoadingNodesMap.keys())o.getNodesToRefresh().forEach(c=>{if(c.rowIndex==null){i=c,s=o;return}const d=o.getNodes().getBy("node",c);if(!d||this.cacheLoadingNodesMap.get(o)?.has(d.index))return;const h=Math.abs(e-c.rowIndex),p=Math.abs(c.rowIndex-t);h<r&&(i=c,r=h,s=o),p<r&&(i=c,r=p,s=o)});if(!s)return;const a=s,n=a.getNodes().getBy("node",i)?.index;return n==null?void 0:{cache:a,index:a.getBlockStartIndex(n)}}isRowLoading(e,t){return this.cacheLoadingNodesMap.get(e)?.has(t)??!1}};import{BeanStub as zN,_warn as uh}from"ag-grid-community";import{BeanStub as UN,ServerSideTransactionResultStatus as Rn,_getGroupTotalRowCallback as hh,_getRowHeightAsNumber as ph,_getRowIdCallback as WN,_warn as KN}from"ag-grid-community";import{BeanStub as $N,_getRowHeightAsNumber as jN,_getRowIdCallback as YN,_warn as qN}from"ag-grid-community";var XN=class{constructor(...e){this.indexes=e,this.maps=new Map(this.indexes.map(t=>[t,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){return this.maps.get(e).get(t)}set(e){for(const t of this.indexes)this.maps.get(t).set(e[t],e)}delete(e){for(const t of this.indexes)this.maps.get(t).delete(e[t])}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){return this.maps.get(e).values()}forEach(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)e(s.value)}find(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)if(e(s.value))return s.value}filter(e){const t=this.getIterator(this.indexes[0]);let s;const i=[];for(;(s=t.next())&&!s.done;)e(s.value)&&i.push(s.value);return i}},ZN=100,An=class extends $N{constructor(e,t,s,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=s,this.storeParams=i}wireBeans(e){this.rowRenderer=e.rowRenderer,this.blockUtils=e.ssrmBlockUtils,this.focusSvc=e.focusSvc,this.nodeManager=e.ssrmNodeManager,this.serverSideRowModel=e.rowModel,this.rowNodeSorter=e.rowNodeSorter,this.sortSvc=e.sortSvc,this.lazyBlockLoadingSvc=e.lazyBlockLoadingSvc,this.colModel=e.colModel}postConstruct(){this.lazyBlockLoadingSvc.subscribe(this),this.nodeMap=new XN("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set;const{blockUtils:e,gos:t,store:s}=this;this.defaultNodeIdPrefix=e.createNodeIdPrefix(s.getParentNode()),this.getRowIdFunc=YN(t),this.isMasterDetail=t.get("masterDetail")}destroy(){this.lazyBlockLoadingSvc.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1,super.destroy()}getRowByDisplayIndex(e){if(!this.store.isDisplayIndexInStore(e))return;const t=this.nodeDisplayIndexMap.get(e);if(t)return(t.stub||t.__needsRefreshWhenVisible)&&this.lazyBlockLoadingSvc.queueLoadCheck(),t;if(this.gos.get("groupHideOpenParents")||this.gos.get("groupAllowUnbalanced")){const l=this.nodeMap.find(c=>!!c.node.childStore?.isDisplayIndexInStore(e));if(l)return l.node.childStore?.getRowUsingDisplayIndex(e)}if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const i=this.nodeDisplayIndexMap.get(e-1);if(i){if(this.isMasterDetail&&i.master&&i.expanded)return i.detailNode;if(i.expanded&&i.childStore?.isDisplayIndexInStore(e))return i.childStore?.getRowUsingDisplayIndex(e);const l=this.nodeMap.getBy("node",i);return this.createStubNode(l.index+1,e)}const r=this.getSurroundingNodesByDisplayIndex(e);if(r==null){const l=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(l,e)}const{previousNode:a,nextNode:n}=r;if(a?.node.expanded&&a.node.childStore?.isDisplayIndexInStore(e))return a.node.childStore?.getRowUsingDisplayIndex(e);if(n){const l=n.node.rowIndex-e,c=n.index-l;return this.createStubNode(c,e)}const o=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(o,e)}createStubNode(e,t){const s=this.store.getRowBounds(t),i=this.createRowAtIndex(e,null,r=>{r.setRowIndex(t),r.setRowTop(s.rowTop),this.nodeDisplayIndexMap.set(t,r)});if(e===0&&this.gos.get("groupHideOpenParents")){const r=this.store.getParentNode().groupData;if(r)for(const a of Object.keys(r))wc(i,this.colModel,a,r[a])}return this.lazyBlockLoadingSvc.queueLoadCheck(),i}getRowByStoreIndex(e){return this.nodeMap.getBy("index",e)?.node}skipDisplayIndexes(e,t,s){if(e===0)return;const i=jN(this.beans);t.value+=e,s.value+=e*i}setDisplayIndexes(e,t,s){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(n=>{i[n.index]=n.node});let r=-1;for(const n of Object.keys(i)){const o=i[n],l=Number(n),c=l-1-r;this.skipDisplayIndexes(c,e,t);const d=l===0;if(o.firstChild!==d&&(o.firstChild=d,o.dispatchRowEvent("firstChildChanged")),d&&this.gos.get("groupHideOpenParents")){const u=this.store.getParentNode().groupData;if(u)for(const h of Object.keys(u))wc(o,this.colModel,h,d?u[h]:void 0)}this.blockUtils.setDisplayIndex(o,e,t,s),o.rowIndex!=null&&this.nodeDisplayIndexMap.set(o.rowIndex,o),r=l}const a=this.numberOfRows-1-r;this.skipDisplayIndexes(a,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){this.numberOfRows=e,t!=null&&(this.isLastRowKnown=t,t===!1&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){return this.nodeDisplayIndexMap.get(e)??null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,s;return this.nodeMap.forEach(i=>{if(e>i.node.rowIndex){(s==null||s.node.rowIndex<i.node.rowIndex)&&(s=i);return}(t==null||t.node.rowIndex>i.node.rowIndex)&&(t=i)}),!s&&!t?null:{previousNode:s,nextNode:t}}getDisplayIndexFromStoreIndex(e){const t=this.nodeMap.getBy("index",e);if(t)return t.node.rowIndex;let s,i;if(this.nodeMap.forEach(n=>{if(e>n.index){(i==null||i.index<n.index)&&(i=n);return}(s==null||s.index>n.index)&&(s=n)}),!s)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!i)return this.store.getDisplayIndexStart()+e;const r=e-i.index;return(i.node.childStore?.getDisplayIndexEnd()??i.node.rowIndex)+r}createRowAtIndex(e,t,s){const i=this.nodeMap.getBy("index",e);if(i){const{node:a}=i;if(a.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,a))return this.blockUtils.updateDataIntoRowNode(a,t),this.nodesToRefresh.delete(a),a;if(this.getRowIdFunc==null&&a.hasChildren()&&a.expanded)return this.nodesToRefresh.delete(a),a;this.destroyRowAtIndex(e)}if(t&&this.getRowIdFunc!=null){const a=this.getRowId(t),n=a&&this.removedNodeCache?.get(a);if(n)return this.removedNodeCache?.delete(a),this.blockUtils.updateDataIntoRowNode(n,t),this.nodeMap.set({id:n.id,node:n,index:e}),this.nodesToRefresh.delete(n),n.__needsRefreshWhenVisible=!1,n;const o=this.nodeMap.getBy("id",a);if(o){this.nodeMap.delete(o);const{node:l,index:c}=o;return this.blockUtils.updateDataIntoRowNode(l,t),this.nodeMap.set({id:l.id,node:l,index:e}),this.nodesToRefresh.delete(l),l.__needsRefreshWhenVisible=!1,this.getBlockStartIndex(c)===this.getBlockStartIndex(e)||this.markBlockForVerify(c),l}}const r=this.blockUtils.createRowNode(this.store.getRowDetails());if(t!=null){const a=this.getPrefixedId(this.store.getIdSequence().value++);this.blockUtils.setDataIntoRowNode(r,t,a,void 0),this.blockUtils.checkOpenByDefault(r),this.nodeManager.addRowNode(r)}return this.nodeMap.set({id:r.id,node:r,index:e}),s&&s(r),r}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:a,index:n})=>{const o=this.getBlockStartIndex(n);!a.stub&&!a.failedLoad&&(e[o]=(e[o]??0)+1);let l="loaded";a.failedLoad?l="failed":this.lazyBlockLoadingSvc.isRowLoading(this,o)?l="loading":(this.nodesToRefresh.has(a)||a.stub)&&(l="needsLoading"),t[o]||(t[o]=new Set),t[o].add(l)});const s={loading:4,failed:3,needsLoading:2,loaded:1},i=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),r={};for(const a of Object.keys(t)){const o=[...t[a]].sort((d,u)=>(s[d]??0)-(s[u]??0))[0],l=Number(a)/this.getBlockSize(),c=i?`${i}-${l}`:String(l);r[c]={blockNumber:l,startRow:Number(a),endRow:Number(a)+this.getBlockSize(),pageStatus:o,loadedRowCount:e[a]??0}}return r}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,s]=this.getBlockBounds(e);this.nodeMap.filter(r=>r.index>=t&&r.index<s).forEach(({node:r})=>{r.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;const s=this.getRowId(e);return s===null?t.data===e:t.id===s}purgeStubsOutsideOfViewport(){const{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,s=this.getBlockStartIndex(e),[,i]=this.getBlockBounds(t);this.nodeMap.forEach(r=>{this.lazyBlockLoadingSvc.isRowLoading(this,r.index)||r.node.failedLoad||r.node.stub&&(r.index<s||r.index>i)&&this.destroyRowAtIndex(r.index)})}getBlocksDistanceFromRow(e,t){const s={};return e.forEach(({node:i,index:r})=>{const[a,n]=this.getBlockBounds(r);if(a in s)return;const o=Math.abs(i.rowIndex-t);let l;const c=this.nodeMap.getBy("index",[n-1]);c&&(l=Math.abs(c.node.rowIndex-t));const d=l==null||o<l?o:l;s[a]=d}),Object.entries(s)}purgeExcessRows(){if(this.purgeStubsOutsideOfViewport(),this.store.getDisplayIndexEnd()==null||this.storeParams.maxBlocksInCache==null)return;const{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,s=new Set,i=new Set;this.nodeMap.forEach(({index:p,node:g})=>{const f=this.getBlockStartIndex(p);s.add(f),g.rowIndex>=e&&g.rowIndex<=t&&i.add(f)});const r=Math.max(i.size,this.storeParams.maxBlocksInCache??0),n=s.size-r;if(n<=0)return;let o=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;i.forEach(p=>{o>p&&(o=p),l<p&&(l=p)});const c=this.nodeMap.filter(({node:p,index:g})=>{const f=this.getBlockStartIndex(g);return!(f>=o&&f<=l)&&!this.isNodeCached(p)});if(c.length===0)return;const d=e+(t-e)/2,u=this.getBlocksDistanceFromRow(c,d),h=this.getBlockSize();u.sort((p,g)=>Math.sign(g[1]-p[1]));for(let p=0;p<Math.min(n,u.length);p++){const g=Number(u[p][0]);for(let f=g;f<g+h;f++){const m=this.nodeMap.getBy("index",f);!m||this.isNodeCached(m.node)||this.destroyRowAtIndex(f)}}}isNodeFocused(e){const t=this.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e.rowIndex}isNodeCached(e){const t=e.isExpandable()&&e.expanded,s=this.gos.get("groupAllowUnbalanced")&&e.key==="",i=!!this.beans.editSvc?.isRowEditing(e);return t||this.isNodeFocused(e)||s||i}extractDuplicateIds(e){if(this.getRowIdFunc==null)return[];const t=new Set,s=new Set;return e.forEach(i=>{const r=this.getRowId(i);if(t.has(r)){s.add(r);return}t.add(r)}),[...s]}onLoadSuccess(e,t,s){if(!this.live)return;const i=s.groupLevelInfo;if(this.store.setStoreInfo(i),this.getRowIdFunc!=null){const n=this.extractDuplicateIds(s.rowData);if(n.length>0){const o=n.join(", ");qN(205,{duplicateIdText:o}),this.onLoadFailed(e,t);return}}s.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(s.pivotResultFields);const r=this.nodesToRefresh.size>0;if(s.rowData.forEach((n,o)=>{const l=e+o,c=this.nodeMap.getBy("index",l);if(c?.node?.stub){this.createRowAtIndex(l,n);return}if(c&&this.doesNodeMatch(n,c.node)){this.blockUtils.updateDataIntoRowNode(c.node,n),this.nodesToRefresh.delete(c.node),c.node.__needsRefreshWhenVisible=!1;return}this.createRowAtIndex(l,n)}),s.rowCount!=null&&s.rowCount!==-1)this.numberOfRows=s.rowCount,this.isLastRowKnown=!0;else if(t>s.rowData.length)this.numberOfRows=e+s.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const n=e+s.rowData.length+1;n>this.numberOfRows&&(this.numberOfRows=n)}this.isLastRowKnown&&this.nodeMap.filter(o=>o.index>=this.numberOfRows).forEach(o=>this.destroyRowAtIndex(o.index)),this.fireStoreUpdatedEvent();const a=this.nodesToRefresh.size===0;r&&a&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){this.nodesToRefresh.size===0&&(this.removedNodeCache.forEach(t=>{this.blockUtils.destroyRowNode(t)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t||this.nodesToRefresh.size>0)return;let s=-1;return this.nodeMap.find(r=>(s+=1,!!(r.index!==s||r.node.__needsRefreshWhenVisible||r.node.stub)))==null}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){if(!this.live)return;const s=this.nodesToRefresh.size>0;for(let r=e;r<e+t&&r<this.getRowCount();r++){let{node:a}=this.nodeMap.getBy("index",r)??{};a&&this.nodesToRefresh.delete(a),a?.stub||(a&&!a.stub&&this.destroyRowAtIndex(r),a=this.createRowAtIndex(r)),a.__needsRefreshWhenVisible=!1,a.failedLoad=!0}const i=this.nodesToRefresh.size===0;s&&i&&this.fireRefreshFinishedEvent(),this.fireStoreUpdatedEvent()}markNodesForRefresh(){this.nodeMap.forEach(e=>{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingSvc.queueLoadCheck(),this.isLastRowKnown&&this.numberOfRows===0&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(this.getRowIdFunc==null)return null;const{level:t}=this.store.getRowDetails(),s=this.store.getParentNode().getRoute()??[];return this.getRowIdFunc({data:e,parentKeys:s.length>0?s:void 0,level:t})}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortSvc?.getSortOptions()??[],t=e.some(n=>n.sort!=null),s=this.rowNodeSorter;if(!t||!s)return;const i=new Array(this.nodeMap.getSize()),r=this.nodeMap;r.forEach(n=>i[n.index]=n.node),r.clear();const a=s.doFullSortInPlace(i,e);for(let n=0,o=a.length;n<o;++n){const l=a[n];r.set({id:l.id,node:l,index:n})}}updateRowNodes(e){const t=[];return e.forEach(s=>{const i=this.getRowId(s),r=this.nodeMap.getBy("id",i);r&&(this.blockUtils.updateDataIntoRowNode(r.node,s),t.push(r.node))}),t}insertRowNodes(e,t){const s=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),i=t==null&&this.isLastRowKnown?s:t;if(i==null||s<i)return[];const r={};e.forEach(l=>{const c=this.getRowId(l);c&&this.isNodeInCache(c)||(r[c]=l)});const a=Object.values(r),n=a.length;if(n===0)return[];const o=this.nodeMap.filter(l=>l.index>=i);return o.forEach(l=>this.nodeMap.delete(l)),o.forEach(l=>{this.nodeMap.set({node:l.node,index:l.index+n,id:l.id})}),this.numberOfRows+=n,a.map((l,c)=>this.createRowAtIndex(i+c,l))}removeRowNodes(e,t){const s=[],i=[];let r=0;const a=[...e],n=this.getOrderedNodeMap();let o=-1;for(const c of Object.keys(n)){o+=1;const d=n[c],u=a.findIndex(p=>p===d.id);if(u!==-1){a.splice(u,1),this.destroyRowAtIndex(Number(c)),s.push(d.node),r+=1;continue}if(r===0)continue;const h=Number(c);o!==h&&i.push(d.node),this.nodeMap.delete(d),this.nodeMap.set({id:d.id,node:d.node,index:h-r})}return t!=null&&t>=0?(this.numberOfRows=t,this.isLastRowKnown=!0):this.numberOfRows-=r,a.length>0&&i.length>0&&(i.forEach(c=>c.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingSvc.queueLoadCheck()),s}getBlockSize(){return this.storeParams.cacheBlockSize||ZN}getBlockStartIndex(e){const t=this.getBlockSize();return e-e%t}getBlockBounds(e){const t=this.getBlockStartIndex(e),s=this.getBlockSize();return[t,t+s]}},JN=class extends UN{constructor(e,t,s){super(),this.idSequence={value:0},this.ssrmParams=e,this.parentRowNode=s,this.storeParams=t,this.level=s.level+1,this.group=e.rowGroupCols?this.level<e.rowGroupCols.length:!1,this.leafGroup=e.rowGroupCols?this.level===e.rowGroupCols.length-1:!1,this.info={}}wireBeans(e){this.blockUtils=e.ssrmBlockUtils,this.storeUtils=e.ssrmStoreUtils,this.selectionSvc=e.selectionSvc,this.rowGroupColsSvc=e.rowGroupColsSvc}postConstruct(){let e=1;if(this.level===0&&(e=this.storeUtils.getServerSideInitialRowCount()??1,this.eventSvc.dispatchEventOnce({type:"rowCountReady"})),this.cache=this.createManagedBean(new An(this,e,!1,this.storeParams)),!this.gos.get("treeData")&&this.group&&this.rowGroupColsSvc){const s=this.ssrmParams.rowGroupCols[this.level];this.groupField=s.field,this.rowGroupColumn=this.rowGroupColsSvc.columns[this.level]}}destroy(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.destroyBean(this.cache),super.destroy()}applyRowData(e,t,s){this.cache.onLoadSuccess(t,s,e)}applyTransaction(e){const t=WN(this.gos);if(!t)return KN(206),{status:Rn.Cancelled};const s=this.gos.getCallback("isApplyServerSideTransaction");if(s){const d={transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info};if(!s(d))return{status:Rn.Cancelled}}const i=this.cache.isStoreFullyLoaded();let r;e.update?.length&&(r=this.cache.updateRowNodes(e.update));let a;if(e.add?.length){let d=e.addIndex;d!=null&&d<0&&(d=void 0),a=this.cache.insertRowNodes(e.add,d)}let n;if(e.remove?.length){const d=e.remove.map(h=>t({level:this.level,parentKeys:this.parentRowNode.getRoute()??[],data:h})),u=[...new Set(d)];n=this.cache.removeRowNodes(u,e.rowCount)}const o=this.gos.get("serverSideEnableClientSideSort"),l=r?.length||a?.length;return i&&o&&l&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(r,n),{status:Rn.Applied,update:r,add:a,remove:n}}updateSelectionAfterTransaction(e,t){if(!this.selectionSvc)return;const s=[];for(const i of e??[])i.isSelected()&&!i.selectable&&s.push(i);for(const i of t??[])i.isSelected()&&s.push(i);s.length&&this.selectionSvc.setNodesSelected({newValue:!1,clearSelection:!1,nodes:s,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return this.cache.getRowCount()===0?!1:this.displayIndexStart<=e&&e<this.getDisplayIndexEnd()}setDisplayIndexes(e,t,s){this.displayIndexStart=e.value,this.topPx=t.value;const i=this.parentRowNode.level>-1&&hh(this.gos)({node:this.parentRowNode});i||Ya(this.parentRowNode),i==="top"&&(Be(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.cache.setDisplayIndexes(e,t,s),i==="bottom"&&(Be(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.displayIndexEnd=e.value,this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t={value:0}){e(this,t.value++),this.cache.getNodes().forEach(s=>{const i=s.node.childStore;i&&i.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t={value:0}){this.cache.getNodes().forEach(s=>{e(s.node,t.value++);const i=s.node.childStore;i&&i.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t={value:0},s=!1){const i=this.parentRowNode.level>-1&&hh(this.gos)({node:this.parentRowNode});i==="top"&&e(this.parentRowNode.sibling,t.value++);const r=this.cache.getOrderedNodeMap();for(const a of Object.values(r)){e(a.node,t.value++);const n=a.node.childStore;n&&n.forEachNodeDeepAfterFilterAndSort(e,t,s)}i==="bottom"&&e(this.parentRowNode.sibling,t.value++)}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){if(!this.isDisplayIndexInStore(e))return null;const t=this.cache.getNodeCachedByDisplayIndex(e);if(t){const o=this.blockUtils.extractRowBounds(t,e);if(o)return o}const{previousNode:s,nextNode:i}=this.cache.getSurroundingNodesByDisplayIndex(e)??{};if(s){const o=this.blockUtils.extractRowBounds(s.node,e);if(o!=null)return o}const r=ph(this.beans);if(i){const o=(i.node.rowIndex-e)*r;return{rowTop:i.node.rowTop-o,rowHeight:r}}const a=this.topPx+this.heightPx,n=(this.getDisplayIndexEnd()-e)*r;return{rowTop:a-n,rowHeight:r}}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<this.topPx)return this.getDisplayIndexStart();if(e>=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e<this.parentRowNode.sibling.rowTop+this.parentRowNode.sibling.rowHeight)return this.parentRowNode.sibling.rowIndex;let t=Number.MAX_SAFE_INTEGER,s=null,i=Number.MAX_SAFE_INTEGER,r=null;if(this.cache.getNodes().forEach(({node:l})=>{const c=Math.abs(e-l.rowTop);if(l.rowTop<e){c<t&&(t=c,s=l);return}c<i&&(i=c,r=l)}),s=s,r=r,s){const l=this.blockUtils.getIndexAtPixel(s,e);if(l!=null)return l}const a=ph(this.beans);if(r){const l=r.rowTop,c=Math.ceil((l-e)/a);return r.rowIndex-c}const n=this.topPx+this.heightPx,o=Math.floor((n-e)/a);return this.getDisplayIndexEnd()-o}getChildStore(e){return this.storeUtils.getChildStore(e,this,t=>{const s=this.cache.getNodes().find(i=>i.node.key==t);return s?s.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const s=this.cache.isStoreFullyLoaded(),i=this.gos.get("serverSideEnableClientSideSort");if(!(s&&i)){const a=this.cache.getRowCount(),n=this.cache.isLastRowIndexKnown();this.destroyBean(this.cache),this.cache=this.createManagedBean(new An(this,a,n,this.storeParams));return}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(s=>s.refreshAfterSort(e))}refreshAfterFilter(e){if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){this.refreshStore(!0);return}this.forEachChildStoreShallow(s=>s.refreshAfterFilter(e))}refreshStore(e){if(e){this.destroyBean(this.cache),this.cache=this.createManagedBean(new An(this,1,!1,this.storeParams)),this.fireStoreUpdatedEvent();return}this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){return this.cache.getDisplayIndexFromStoreIndex(e)??e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){return this.cache.getNodes().filter(({node:s})=>s.rowIndex>=e.rowIndex&&s.rowIndex<=t.rowIndex).map(({node:s})=>s)}addStoreStates(e){e.push({route:this.parentRowNode.getRoute()??[],rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){this.eventSvc.dispatchEvent({type:"storeUpdated"})}fireRefreshFinishedEvent(){this.eventSvc.dispatchEvent({type:"storeRefreshed",route:this.parentRowNode.getRoute()})}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}getFirstNode(){return this.cache.getNodes().getBy("index",0)?.node??null}},QN=class extends zN{constructor(){super(...arguments),this.beanName="ssrmStoreFactory"}wireBeans(e){this.colModel=e.colModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.rowAutoHeight=e.rowAutoHeight}createStore(e,t){const s=this.getStoreParams(e,t);return new JN(e,s,t)}getStoreParams(e,t){const s=this.getLevelSpecificParams(t),i=this.getBlockSize(s),r=this.getMaxBlocksInCache(e,s);return{cacheBlockSize:i,maxBlocksInCache:r}}getMaxBlocksInCache(e,t){const s=t?.maxBlocksInCache!=null?t.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(s!=null&&s>=0){if(e.dynamicRowHeight){uh(203);return}if(this.rowAutoHeight?.active){uh(204);return}return s}}getBlockSize(e){const t=e?.cacheBlockSize!=null?e.cacheBlockSize:this.gos.get("cacheBlockSize");return t!=null&&t>0?t:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(!t)return;const s={level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.rowGroupColsSvc?.columns??[],pivotColumns:this.pivotColsSvc?.columns??[],pivotMode:this.colModel.isPivotMode()};return t(s)}};import{BeanStub as eB,_isServerSideRowModel as gh}from"ag-grid-community";var tB=class extends eB{constructor(){super(...arguments),this.beanName="ssrmStoreUtils"}wireBeans(e){this.colModel=e.colModel,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}getChildStore(e,t,s){if(!e?.length)return t;const i=e[0],r=s(i);if(r){if(e.length===1&&!r.childStore){const o=this.serverSideRowModel.getParams();r.childStore=this.createBean(this.storeFactory.createStore(o,r))}const a=e.slice(1,e.length),n=r.childStore;return n?n.getChildStore(a):null}return null}isServerRefreshNeeded(e,t,s){if(s.valueColChanged||s.secondaryColChanged)return!0;const i=e.level+1;if(!(i<t.length))return!0;const n=t[i].id;return s.changedColumns.indexOf(n)>-1?!0:this.colModel.getCols().filter(d=>d.getColDef().showRowGroup&&s.changedColumns.includes(d.getId())).map(d=>d.getColDef().showRowGroup).some(d=>d===!0||d===n)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&gh(this.gos)}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&gh(this.gos)}};import{BeanStub as sB,ServerSideTransactionResultStatus as Qt,_isServerSideRowModel as iB}from"ag-grid-community";var rB=class extends sB{constructor(){super(...arguments),this.beanName="ssrmTxnManager",this.asyncTransactions=[]}wireBeans(e){this.valueCache=e.valueCache,this.serverSideRowModel=e.rowModel,this.selectionSvc=e.selectionSvc}postConstruct(){iB(this.gos)}applyTransactionAsync(e,t){this.asyncTransactionsTimeout==null&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],s=[];let i=!1;for(const r of this.asyncTransactions){let a;if(this.serverSideRowModel.executeOnStore(r.transaction.route,l=>{a=l.applyTransaction(r.transaction)})?a==null&&(a={status:Qt.StoreNotFound}):a={status:Qt.StoreNotStarted},t.push(a),a.status==Qt.StoreLoading){s.push(r);continue}r.callback&&e.push(()=>r.callback(a)),a.status===Qt.Applied&&(i=!0)}e.length>0&&window.setTimeout(()=>{for(const r of e)r()},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=s,i&&(this.valueCache?.onDataChanged(),this.eventSvc.dispatchEvent({type:"storeUpdated"})),t.length>0&&this.eventSvc.dispatchEvent({type:"asyncTransactionsFlushed",results:t})}flushAsyncTransactions(){this.asyncTransactionsTimeout!=null&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)}))if(t){if(this.valueCache?.onDataChanged(),t.remove&&this.selectionSvc){const i=t.remove.map(r=>r.id);this.selectionSvc.deleteSelectionStateFromParent(e.route||[],i)}return this.eventSvc.dispatchEvent({type:"storeUpdated"}),t}else return{status:Qt.StoreNotFound};else return{status:Qt.StoreNotStarted}}},fh={moduleName:"ServerSideRowModel",version:D,rowModels:["serverSide"],beans:[cN,z_,tB,B_,eN,rB,$_,QN,Y_,GN,HN,_N,RN,Z_],dependsOn:[B,W1,U1,Qu,sh,J1]},mh={moduleName:"ServerSideRowModelApi",version:D,apiFunctions:{getServerSideSelectionState:uN,setServerSideSelectionState:hN,applyServerSideTransaction:pN,applyServerSideTransactionAsync:fN,applyServerSideRowData:gN,retryServerSideLoads:mN,flushServerSideAsyncTransactions:CN,refreshServerSide:vN,getServerSideGroupLevelState:SN,resetRowHeights:j1,onRowHeightChanged:$1},dependsOn:[B,z1,H1,K1]};import{AgAbstractCellEditor as aB,KeyCode as Mn,RefPlaceholder as nB,_isBrowserSafari as oB,_placeCaretAtEnd as lB}from"ag-grid-community";import{AgContentEditableField as cB,_createElement as dB,_getDocument as Tn,_getWindow as Ch,_placeCaretAtEnd as uB}from"ag-grid-community";var vh=/\$?[A-Za-z]+\$?[0-9]+(?::\$?[A-Za-z]+\$?[0-9]+)?/g,hB=/^(\$?)([A-Za-z]+)(\$?)([0-9]+)(?::(\$?)([A-Za-z]+)(\$?)([0-9]+))?$/,pB=/[A-Za-z0-9]/,js=e=>!!e&&pB.test(e),hr=e=>!!e&&/[A-Za-z]/.test(e),Sh=e=>js(e??void 0),bh=(e,t,s)=>{const i=t>0?e[t-1]:null;if(Sh(i))return!1;if(s.endsWith(":"))return!0;const r=t+s.length,a=r<e.length?e[r]:null;return!Sh(a)},Pn=(e,t={})=>{const i=(t.allowTrailingColon??!1)&&e.endsWith(":")?e.slice(0,-1):e,r=hB.exec(i);if(!r)return null;const[,a,n,o,l,c,d,u,h]=r;return{startCol:n,startRow:l,startColAbsolute:a==="$",startRowAbsolute:o==="$",...!!(d&&h)?{endCol:d,endRow:h,endColAbsolute:c==="$",endRowAbsolute:u==="$"}:null}},yh=e=>{const t=[];let s,i=0;for(vh.lastIndex=0;(s=vh.exec(e))!=null;){let r=s[0];const a=s.index??0,n=a+r.length;n<e.length&&e[n]===":"&&(r+=":"),bh(e,a,r)&&(t.push({ref:r,start:a,end:a+r.length,index:i}),i+=1)}return t},gB=".ag-formula-token{line-height:var(--ag-line-height,1.6)}.ag-formula-token-color-1{color:var(--ag-formula-token-1-color)}.ag-formula-token-color-2{color:var(--ag-formula-token-2-color)}.ag-formula-token-color-3{color:var(--ag-formula-token-3-color)}.ag-formula-token-color-4{color:var(--ag-formula-token-4-color)}.ag-formula-token-color-5{color:var(--ag-formula-token-5-color)}.ag-formula-token-color-6{color:var(--ag-formula-token-6-color)}.ag-formula-token-color-7{color:var(--ag-formula-token-7-color)}.ag-formula-range-color-1{--ag-range-selection-border-color:var(--ag-formula-token-1-color);--ag-range-selection-background-color:var(--ag-formula-token-1-background-color)}.ag-formula-range-color-2{--ag-range-selection-border-color:var(--ag-formula-token-2-color);--ag-range-selection-background-color:var(--ag-formula-token-2-background-color)}.ag-formula-range-color-3{--ag-range-selection-border-color:var(--ag-formula-token-3-color);--ag-range-selection-background-color:var(--ag-formula-token-3-background-color)}.ag-formula-range-color-4{--ag-range-selection-border-color:var(--ag-formula-token-4-color);--ag-range-selection-background-color:var(--ag-formula-token-4-background-color)}.ag-formula-range-color-5{--ag-range-selection-border-color:var(--ag-formula-token-5-color);--ag-range-selection-background-color:var(--ag-formula-token-5-background-color)}.ag-formula-range-color-6{--ag-range-selection-border-color:var(--ag-formula-token-6-color);--ag-range-selection-background-color:var(--ag-formula-token-6-background-color)}.ag-formula-range-color-7{--ag-range-selection-border-color:var(--ag-formula-token-7-color);--ag-range-selection-background-color:var(--ag-formula-token-7-background-color)}.ag-fill-handle.ag-formula-range-color-1,.ag-range-handle.ag-formula-range-color-1{background-color:var(--ag-formula-token-1-color)}.ag-fill-handle.ag-formula-range-color-2,.ag-range-handle.ag-formula-range-color-2{background-color:var(--ag-formula-token-2-color)}.ag-fill-handle.ag-formula-range-color-3,.ag-range-handle.ag-formula-range-color-3{background-color:var(--ag-formula-token-3-color)}.ag-fill-handle.ag-formula-range-color-4,.ag-range-handle.ag-formula-range-color-4{background-color:var(--ag-formula-token-4-color)}.ag-fill-handle.ag-formula-range-color-5,.ag-range-handle.ag-formula-range-color-5{background-color:var(--ag-formula-token-5-color)}.ag-fill-handle.ag-formula-range-color-6,.ag-range-handle.ag-formula-range-color-6{background-color:var(--ag-formula-token-6-color)}";import{BeanStub as fB,KeyCode as Ve,_getDocument as mB}from"ag-grid-community";var wh=new Set(["=","+","-","*","/","^",",","(",";","<",">","&"]),xh=(e,t)=>{for(let s=t-1;s>=0;s--){const i=e[s];if(i!=null&&i.trim()!=="")return i}return null};import{isSpecialCol as CB}from"ag-grid-community";var vB="ag-formula-token-color",SB="ag-formula-range-color",In=(e,t)=>{const s=t??0;return{tokenClass:`${vB}-${s+1}`,rangeClass:`${SB}-${s+1}`,colorIndex:s}},En=e=>{if(!e)return null;const t=/ag-formula-range-color-(\d+)/.exec(e);if(!t)return null;const s=parseInt(t[1],10);return Number.isFinite(s)?s-1:null},bB=(e,t,s)=>{if(!e)return;const{rangeClass:i}=In(t,s);e.colorClass=i},Fh=(e,t)=>{const s=Pn(t,{allowTrailingColon:!0});if(!s)return null;const{formula:i}=e,{startCol:r,startRow:a,endCol:n,endRow:o}=s,l=r,c=n??r,d=i?.getColByRef(l),u=i?.getColByRef(c);if(!d||!u)return null;const h=parseInt(a,10)-1,p=o?parseInt(o,10)-1:h;if(h<0||p<0)return null;const g=e.rowModel;return!g?.getFormulaRow(h)||!g.getFormulaRow(p)?null:{rowStartIndex:h,rowEndIndex:p,columnStart:d,columnEnd:u}},yB=e=>{const t=e.rangeSvc?.getCellRanges(),s=t?.length?t[t.length-1]:null;return s?at(e,s):null},at=(e,t)=>{const{rangeSvc:s,formula:i}=e;if(!s||!i)return null;const r=s.getRangeStartRow(t),a=s.getRangeEndRow(t);if(!r||!a||r.rowPinned||a.rowPinned)return null;const n=Math.min(r.rowIndex,a.rowIndex)+1,o=Math.max(r.rowIndex,a.rowIndex)+1,l=t.columns?.filter(m=>!CB(m)&&!!i.getColRef(m));if(!l?.length)return null;const c=[...l],d=c[0],u=c[c.length-1],h=i.getColRef(d),p=i.getColRef(u);return!h||!p?null:h===p&&n===o?`${h}${n}`:`${h}${n}:${p}${o}`},es=(e,t)=>{const s=yh(t),{formula:i}=e;if(!i)return s;const r=[];let a=0;for(const n of s)Fh(e,n.ref)&&(r.push({...n,index:a}),a+=1);return r},Rh=(e,t)=>es(e,t).map(({ref:i,index:r})=>({ref:i,index:r})),wB=class extends fB{constructor(e){super(),this.field=e,this.functionAutocompleteList=null,this.functionAutocompleteToken=null,this.functionAutocompleteEntries=null,this.functionAutocompleteSearch=null}postConstruct(){this.addManagedElementListeners(this.field.getContentElement(),{keydown:this.onContentKeyDown.bind(this),mouseup:this.updateFunctionAutocomplete.bind(this),focusin:this.updateFunctionAutocomplete.bind(this),focusout:this.closeFunctionAutocomplete.bind(this)}),this.addDestroyFunc(()=>this.closeFunctionAutocomplete())}onPlainValueUpdated(){this.closeFunctionAutocomplete()}onFormulaValueUpdated(){this.updateFunctionAutocomplete()}onContentKeyDown(e){if(this.functionAutocompleteList)switch(e.key){case Ve.ENTER:case Ve.TAB:e.preventDefault(),e.stopPropagation(),this.confirmFunctionAutocomplete();return;case Ve.ESCAPE:e.preventDefault(),e.stopPropagation(),this.closeFunctionAutocomplete();return;case Ve.UP:case Ve.DOWN:this.functionAutocompleteList.onNavigationKeyDown(e,e.key);return}switch(e.key){case Ve.LEFT:case Ve.RIGHT:case Ve.PAGE_HOME:case Ve.PAGE_END:this.scheduleFunctionAutocompleteUpdate();break}}scheduleFunctionAutocompleteUpdate(){setTimeout(()=>{this.isAlive()&&this.updateFunctionAutocomplete()})}updateFunctionAutocomplete(){if(!this.isContentFocused()){this.closeFunctionAutocomplete();return}const{field:e,beans:t}=this,s=e.getCurrentValue();if(!s.trimStart().startsWith("=")){this.closeFunctionAutocomplete();return}const r=e.getCaretOffsetsForAutocomplete(s);if(!r){this.closeFunctionAutocomplete();return}if(FB(t,s,r.valueOffset)){this.closeFunctionAutocomplete();return}const a=xB(s,r.valueOffset,t.formula??null);if(!a){this.closeFunctionAutocomplete();return}const{prefix:n}=a;if(!n.length){this.closeFunctionAutocomplete();return}const o=this.getFunctionAutocompleteEntries();if(!o.length){this.closeFunctionAutocomplete();return}const l=n.toLocaleLowerCase();if(!o.some(({key:d})=>d.toLocaleLowerCase().startsWith(l))){this.closeFunctionAutocomplete();return}this.functionAutocompleteToken=a,this.openFunctionAutocomplete(o),this.functionAutocompleteList&&this.functionAutocompleteSearch!==n&&(this.functionAutocompleteList.setSearch(n),this.functionAutocompleteSearch=n)}getFunctionAutocompleteEntries(){const e=this.beans.formula,t=e?.active?e.getFunctionNames?.()??[]:[];return(!this.functionAutocompleteEntries||this.functionAutocompleteEntries.length!==t.length)&&(this.functionAutocompleteEntries=t.map(s=>({key:s}))),this.functionAutocompleteEntries}openFunctionAutocomplete(e){if(this.functionAutocompleteList||!e.length)return;const t=this.beans.popupSvc;if(!t)return;let s=null;const i=()=>{this.functionAutocompleteList&&s&&t.positionPopupByComponent(s)};this.functionAutocompleteList=this.createManagedBean(new bl({autocompleteEntries:e,onConfirmed:()=>this.confirmFunctionAutocomplete(),useStartsWithSearch:!0,autoSizeList:!0,maxVisibleItems:10,onListHeightChanged:i}));const r=this.functionAutocompleteList.getGui();s={ePopup:r,type:"autocomplete",eventSource:this.field.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0};const a=t.addPopup({eChild:r,anchorToElement:this.field.getGui(),positionCallback:i,ariaLabel:"Formula functions"});this.functionAutocompleteHidePopup=a.hideFunc,this.functionAutocompleteList.afterGuiAttached()}closeFunctionAutocomplete(){this.functionAutocompleteToken=null,this.functionAutocompleteSearch=null,this.functionAutocompleteList&&(this.functionAutocompleteHidePopup?.(),this.functionAutocompleteHidePopup=void 0,this.destroyBean(this.functionAutocompleteList),this.functionAutocompleteList=null)}confirmFunctionAutocomplete(){const e=this.functionAutocompleteToken,t=this.functionAutocompleteList?.getSelectedValue();if(!e||!t){this.closeFunctionAutocomplete();return}const{field:s}=this,i=s.getCurrentValue(),r=t.key,a=i.slice(0,e.start)+r+i.slice(e.end),n=e.start+r.length,o=a[n]==="("?a:a.slice(0,n)+"("+a.slice(n);s.getContentElement().focus({preventScroll:!0}),s.applyFormulaValueChange({currentValue:i,nextValue:o,caret:n+1}),this.closeFunctionAutocomplete()}isContentFocused(){return mB(this.beans).activeElement===this.field.getContentElement()}},xB=(e,t,s)=>{if(t<0||t>e.length||RB(e,t))return null;let i=t;for(;i>0&&js(e[i-1]);)i--;let r=t;for(;r<e.length&&js(e[r]);)r++;if(i===r)return null;let a=r;if(t!==r){const l=e.slice(t,r),c=Pn(l);!!c&&(!s||!!s.getColByRef(c.startCol))&&(a=t)}const n=e.slice(i,a);if(!n||!hr(n[0])||e[i-1]==="$")return null;const o=xh(e,i);return o!=null&&!wh.has(o)?null:{start:i,end:a,prefix:e.slice(i,t)}},FB=(e,t,s)=>{for(const i of es(e,t))if(s>=i.start&&s<=i.end)return!0;return!1},RB=(e,t)=>{let s=!1;for(let i=0;i<t&&i<e.length;i++)if(e[i]==='"'){if(e[i+1]==='"'){i++;continue}s=!s}return s};import{BeanStub as AB,_last as Dn,isSpecialCol as MB}from"ag-grid-community";var TB=class extends AB{constructor(e){super(),this.field=e,this.rangeSelectionEnabled=!1,this.trackedRangeRefs=new Map,this.trackedRanges=new Map,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.suppressSelectionChangeHandling=!1,this.handleEditorDeactivated=()=>{this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!0)}}postConstruct(){this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this)}),this.addDestroyFunc(()=>this.disableRangeSelectionWhileEditing()),this.addDestroyFunc(()=>this.unregisterActiveEditor())}onValueUpdated(e,t){if(this.skipNextValueUpdate){this.skipNextValueUpdate=!1;return}if(this.isActiveEditor()){if(t){this.enableRangeSelectionWhileEditing()&&(this.skipNextValueUpdate=!0,this.field.setValue(e,!0)),this.syncRangesFromFormula(e);return}this.disableRangeSelectionWhileEditing()}}setEditingCellRef(e,t,s){this.editingColumn=e,this.editingRowIndex=t??void 0,this.editingCellRef=s}setEditorActive(e){if(e){this.registerActiveEditor();return}this.unregisterActiveEditor()}withSelectionChangeHandlingSuppressed(e){const t=this.suppressSelectionChangeHandling;this.suppressSelectionChangeHandling=!0;try{e()}finally{this.suppressSelectionChangeHandling=t}}deactivateForFocusLoss(){this.isActiveEditor()&&(this.handleEditorDeactivated(),this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.unregisterActiveEditor())}registerActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;if(!t||!t.registerActiveEditor(e,this.handleEditorDeactivated))return;this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!1);const i=this.field.getCurrentValue(),r=i.trimStart().startsWith("=");this.onValueUpdated(i,r)}unregisterActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;t&&t.unregisterActiveEditor(e,this.handleEditorDeactivated)}isActiveEditor(){const e=this.field.getCompId(),{formulaInputManager:t}=this.beans;return!!t&&t.isActiveEditor(e)}getTrackedRefCount(e){return this.trackedRangeRefs.get(e)??0}hasTrackedRef(e){return this.getTrackedRefCount(e)>0}addTrackedRef(e){this.trackedRangeRefs.set(e,this.getTrackedRefCount(e)+1)}removeTrackedRef(e){const t=this.getTrackedRefCount(e)-1;if(t<=0){this.trackedRangeRefs.delete(e);return}this.trackedRangeRefs.set(e,t)}enableRangeSelectionWhileEditing(){return this.rangeSelectionEnabled?!1:(this.rangeSelectionEnabled=!0,this.beans.editSvc?.enableRangeSelectionWhileEditing?.(),!0)}disableRangeSelectionWhileEditing(){!this.rangeSelectionEnabled&&!this.trackedRangeRefs.size||(this.rangeSelectionEnabled=!1,this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.clearTrackedRanges(this.isActiveEditor()))}clearTrackedRanges(e=!0){e&&Array.from(this.trackedRangeRefs.keys()).forEach(s=>this.removeRangeForRef(s)),this.trackedRangeRefs.clear(),this.trackedRanges.clear()}getLiveRanges(){return this.beans.rangeSvc?.getCellRanges()??[]}withSuppressedRangeEvents(e){this.suppressRangeEvents=!0,e(),this.suppressRangeEvents=!1}setCellRangesSilently(e){const t=this.beans.rangeSvc;t&&this.withSuppressedRangeEvents(()=>t.setCellRanges(e))}getColorIndexForTokenOrRef(e,t){return this.field.getColorIndexForToken(t??null)??this.field.getColorIndexForRef(e)}normaliseRefForComparison(e){return e?(e.endsWith(":")?e.slice(0,-1):e).replace(/\$/g,"").toUpperCase():null}tagRangeColor(e,t,s){const{rangeClass:i}=In(t,s);return e.colorClass===i?!1:(bB(e,t,s),!0)}trackRange(e,t,s){const i=this.trackedRanges.get(e),r=s!==void 0?s:i?.tokenIndex??null;i?i.ref!==t&&(this.removeTrackedRef(i.ref),this.addTrackedRef(t)):this.addTrackedRef(t),this.trackedRanges.set(e,{ref:t,tokenIndex:r})}getUntrackedFormulaRangesByRef(){const e=new Map,t=this.getLiveRanges();for(const s of t){if(this.trackedRanges.has(s)||En(s.colorClass)==null)continue;const i=at(this.beans,s);if(!i||i===this.editingCellRef)continue;const r=e.get(i);r?r.push(s):e.set(i,[s])}return e}syncRangesFromFormula(e){const t=e??this.field.getCurrentValue()??"";if(!this.rangeSelectionEnabled){this.clearTrackedRanges();return}const s=Rh(this.beans,t),i=new Map;for(const c of s){const{ref:d,index:u}=c;if(d===this.editingCellRef)continue;const h=i.get(d)??[];h.push(u),i.set(d,h)}for(const c of Array.from(this.trackedRangeRefs.keys()))i.has(c)||this.removeRangeForRef(c);if(!this.beans.rangeSvc)return;const a=new Set(this.getLiveRanges());for(const[c,d]of this.trackedRanges.entries())a.has(c)||(this.trackedRanges.delete(c),this.removeTrackedRef(d.ref));const n=this.getUntrackedFormulaRangesByRef();let o=!1;for(const[c,d]of i.entries()){const u=[];for(const[p,g]of this.trackedRanges.entries())g.ref===c&&u.push(p);const h=n.get(c);for(;u.length<d.length&&h?.length;){const p=h.shift();p&&u.push(p)}for(;u.length>d.length;){const p=u.pop();p&&this.removeTrackedRange(p)}for(;u.length<d.length;){const p=d[u.length],g=this.addRangeForRef(c,!1,p);if(!g)break;u.push(g)}for(let p=0;p<u.length&&p<d.length;p++){const g=u[p],f=d[p];this.trackRange(g,c,f);const m=this.getColorIndexForTokenOrRef(c,f);this.tagRangeColor(g,c,m)&&(o=!0)}}const l=[];for(const c of n.values())c.length&&l.push(...c);if(l.length){const c=this.getLiveRanges(),d=c.filter(u=>!l.includes(u));d.length!==c.length&&(this.setCellRangesSilently(d),o=!0)}o&&this.refreshRangeStyling()}onCellSelectionChanged(e){if(!this.isActiveEditor()||!this.rangeSelectionEnabled||!this.beans.editSvc?.isRangeSelectionEnabledWhileEditing?.())return;if(this.ignoreNextRangeEvent){this.ignoreNextRangeEvent=!1;return}if(this.suppressSelectionChangeHandling)return;const{finished:t,started:s}=e,i=this.getLiveRanges(),r=i.filter(u=>!this.isSpecialOnlyRange(u));if(r.length!==i.length){this.setCellRangesSilently(r),this.refocusEditingCell();return}const a=i.length?Dn(i):null,n=a?at(this.beans,a):null,o=!!a&&!this.trackedRanges.has(a)&&!!n&&n!==this.editingCellRef,l=t&&(s||o),c=this.ensureTrackedRangeColors();if(this.suppressRangeEvents){c&&this.refreshRangeStyling();return}if((s||o)&&this.field.rememberCaret(),!o&&this.handleRemovedRangeTokens()){this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(this.updateTrackedRangeTokens())return;const d=yB(this.beans);if(!d||d===this.editingCellRef){this.refocusEditingCell();return}if(l){const{action:u,previousRef:h,tokenIndex:p}=this.field.applyRangeInsert(d);if(u==="none"){this.keepLatestSelectionOnly(a),this.beans.editSvc?.stopEditing(void 0,{source:"edit"});return}if(u==="replace"&&h===d){this.discardLatestRangeForRef(d),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}this.tagLatestRangeForRef(d,p),this.handleRangeTokenUpdate(h,d,!0,u==="insert",p),this.syncRangesFromFormula(this.field.getCurrentValue()),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(!s&&!t){const{previousRef:u,tokenIndex:h}=this.field.insertOrReplaceToken(d,!1);this.tagLatestRangeForRef(d,h),this.handleRangeTokenUpdate(u,d,!1,!1),this.refocusEditingCell();return}this.tagLatestRangeForRef(d),t&&(this.field.restoreCaretAfterToken(),this.refocusEditingCell())}keepLatestSelectionOnly(e){!e||this.getLiveRanges().length<=1||this.setCellRangesSilently([e])}isSpecialOnlyRange(e){const t=e.columns;return!!t?.length&&t.every(s=>MB(s))}handleRangeTokenUpdate(e,t,s,i,r){if(s){!i&&e&&e!==t&&this.removeRangeForRef(e,r),this.addRangeForRef(t,!0,r);return}if(i||!e){this.addTrackedRef(t);return}e!==t&&(this.removeTrackedRef(e),this.addTrackedRef(t))}addRangeForRef(e,t,s){const i=this.beans.rangeSvc;if(!i)return;let r;if(t)r=this.findLatestRangeForRef(e,!0)??this.findLatestRangeForRef(e,!1);else{const a=Fh(this.beans,e);if(!a)return;this.withSuppressedRangeEvents(()=>{r=i.addCellRange(a)})}if(r){const a=this.getColorIndexForTokenOrRef(e,s);this.tagRangeColor(r,e,a),this.trackRange(r,e,s),this.refreshRangeStyling()}return r}findLatestRangeForRef(e,t){const s=this.getLiveRanges();for(let i=s.length-1;i>=0;i--){const r=s[i];if(at(this.beans,r)===e&&!(t&&this.trackedRanges.has(r)))return r}}tagLatestRangeForRef(e,t){const{trackedRanges:s}=this,i=this.getLiveRanges(),r=i.length?Dn(i):null;if(!r)return;const a=s.get(r)?.tokenIndex??null,n=this.getColorIndexForTokenOrRef(e,t??a);this.tagRangeColor(r,e,n),this.refreshRangeStyling()}discardLatestRangeForRef(e){const t=this.getLiveRanges();if(!t.length)return;const s=Dn(t);if(at(this.beans,s)===e){if(this.trackedRanges.has(s)){this.removeTrackedRange(s);return}this.setCellRangesSilently(t.slice(0,-1))}}ensureTrackedRangeColors(){const e=this.getLiveRanges();if(!e.length)return!1;let t=!1;for(const s of e){const i=this.trackedRanges.get(s),r=i?.ref??at(this.beans,s);if(!r||!this.hasTrackedRef(r))continue;const a=i?.tokenIndex??null,n=this.field.getColorIndexForToken(a),o=En(s.colorClass),l=n??(this.field.hasColorForRef(r)?this.field.getColorIndexForRef(r):this.field.moveColorToRef(void 0,r,o??void 0));l!=null&&(this.tagRangeColor(s,r,l)&&(t=!0),this.trackedRanges.has(s)||this.trackRange(s,r,a))}return t}handleRemovedRangeTokens(){if(!this.beans.rangeSvc||this.trackedRanges.size===0)return!1;const e=this.field.getCurrentValue(),t=Rh(this.beans,e).filter(({ref:l})=>l!==this.editingCellRef);if(!t.length)return!1;const s=this.getLiveRanges(),i=new Set(s),r=new Map;for(const l of s){const c=at(this.beans,l);!c||c===this.editingCellRef||r.set(c,(r.get(c)??0)+1)}const a=new Map;for(const l of t){const{ref:c}=l;a.set(c,(a.get(c)??0)+1)}for(const[l,c]of Array.from(a.entries())){const d=r.get(l)??0,u=c-d;u>0?a.set(l,u):a.delete(l)}if(!a.size)return!1;const n=[];for(const[l,c]of Array.from(this.trackedRanges.entries())){if(i.has(l))continue;const{ref:d}=c,u=a.get(d)??0;u<=0||(a.set(d,u-1),n.push({range:l,tracked:c}))}if(!n.length)return!1;n.sort((l,c)=>(c.tracked.tokenIndex??-1)-(l.tracked.tokenIndex??-1));let o=!1;for(const{range:l,tracked:c}of n){const{ref:d,tokenIndex:u}=c;o=this.field.removeTokenRef(d,u??null)||o,this.trackedRanges.delete(l),this.removeTrackedRef(d)}return o&&this.syncRangesFromFormula(this.field.getCurrentValue()),o}refreshRangeStyling(){const{eventSvc:e}=this.beans;e&&(this.ensureTrackedRangeColors(),this.ignoreNextRangeEvent=!0,e.dispatchEvent({type:"cellSelectionChanged",started:!1,finished:!1}))}refocusEditingCell(){const{focusSvc:e}=this.beans,{editingColumn:t,editingRowIndex:s}=this;!e||t==null||s==null||e.setFocusedCell({column:t,rowIndex:s,rowPinned:null,preventScrollOnBrowserFocus:!0})}removeTrackedRange(e){const t=this.trackedRanges.get(e);if(!t)return;const s=this.getLiveRanges(),i=s.filter(r=>r!==e);i.length!==s.length&&this.setCellRangesSilently(i),this.trackedRanges.delete(e),this.removeTrackedRef(t.ref)}removeRangeForRef(e,t){if(!(!e||!this.hasTrackedRef(e))){if(t!=null){let s=!1;for(const[i,r]of Array.from(this.trackedRanges.entries())){const{ref:a,tokenIndex:n}=r;if(!(a!==e||n!==t)){this.removeTrackedRange(i),s=!0;break}}if(!s){for(const[i,r]of Array.from(this.trackedRanges.entries()))if(r.ref===e){this.removeTrackedRange(i);break}}return}for(const[s,i]of Array.from(this.trackedRanges.entries()))i.ref===e&&this.removeTrackedRange(s)}}updateTrackedRangeTokens(){if(!this.beans.rangeSvc)return!1;const e=this.getLiveRanges(),t=this.normaliseRefForComparison(this.editingCellRef);let s=!1;for(const i of e){const r=this.trackedRanges.get(i);if(!r)continue;const{ref:a,tokenIndex:n}=r,o=at(this.beans,i),l=this.normaliseRefForComparison(a),c=this.normaliseRefForComparison(o);if(!o||!c||c===l||c===t)continue;const{colorClass:d}=i,h=this.field.getColorIndexForToken(n??null)??this.field.moveColorToRef(a,o,En(d)??void 0),p=this.field.replaceTokenRef(a,o,h,n);p!=null&&(this.tagRangeColor(i,o,h),this.trackRange(i,o,p??n??null),s=!0)}return s&&this.refreshRangeStyling(),s}},Ln=7,PB={"/":"\xF7","*":"\xD7"},IB={"\xF7":"/","\xD7":"*"},EB=class extends cB{constructor(){super({renderValueToElement:!1,className:"ag-formula-input-field"}),this.currentValue="",this.selectionCaretOffset=null,this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=null,this.focusFromMouseTime=null,this.suppressNextFocusCaretPlacement=!1,this.formulaColorByRef=new Map,this.registerCSS(gB),this.registerCSS(Sl)}postConstruct(){super.postConstruct(),this.rangeSyncFeature=this.createManagedBean(new TB(this)),this.autocompleteFeature=this.createManagedBean(new wB(this)),this.addManagedElementListeners(this.getContentElement(),{input:this.onContentInput.bind(this),focus:this.onContentFocus.bind(this),blur:this.onContentBlur.bind(this),mousedown:this.onContentMouseDown.bind(this)})}setValue(e,t){const s=e==null?"":String(e),{isFormula:i,hasFormulaPrefix:r}=this.getFormulaState(s);return i?(this.applyFormulaValue(s,{currentValue:this.getCurrentValue(),silent:t}),this.rangeSyncFeature?.onValueUpdated(s,r),this):(this.applyPlainValue(s,{silent:t,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(s,r),this)}getCurrentValue(){const e=Mh(this.getContentElement());return e!==this.currentValue&&this.setEditorValue(e,!0),this.currentValue}setEditingCellRef(e,t){const s=e?this.beans.formula?.getColRef(e):void 0,i=s&&t!=null&&t!==void 0?`${s}${t+1}`:void 0;if(!i){this.rangeSyncFeature?.setEditingCellRef(void 0,void 0,void 0);return}this.rangeSyncFeature?.setEditingCellRef(e,t,i)}rememberCaret(){const e=xt(this.beans,this.getContentElement(),this.getCurrentValue());this.selectionCaretOffset=e??this.currentValue.length}setEditorValue(e,t=!1){return this.currentValue=e,super.setValue(e,t),this}renderFormula(e){_B({beans:this.beans,contentElement:this.getContentElement(),getColorIndexForToken:this.getColorIndexForToken.bind(this),...e})}renderPlainValue(e,t){const s=this.getContentElement(),i=t??xt(this.beans,s,this.currentValue);s.textContent=e??"";const r=i!=null?Math.min(i,e.length):null;On(this.beans,s,r)}withSelectionChangeHandlingSuppressed(e){if(!this.rangeSyncFeature){e();return}this.rangeSyncFeature.withSelectionChangeHandlingSuppressed(e)}getColorIndexForRef(e){if(!kn(this.beans))return null;const t=this.formulaColorByRef.get(e);if(t!=null)return t;const s=this.formulaColorByRef.size%Ln;return this.formulaColorByRef.set(e,s),s}getColorIndexForToken(e){return!kn(this.beans)||e==null?null:e%Ln}hasColorForRef(e){return this.formulaColorByRef.has(e)}moveColorToRef(e,t,s){const i=e&&this.formulaColorByRef.has(e)?this.getColorIndexForRef(e):s??this.formulaColorByRef.get(t)??this.getColorIndexForRef(t);return e&&e!==t&&this.formulaColorByRef.delete(e),i==null?null:(this.formulaColorByRef.set(t,i),i)}updateFormulaColorsFromValue(e){if(e=e==null?"":String(e),!kn(this.beans)){this.formulaColorByRef.clear();return}const t=DB(this.beans,e);let s=t.length!==this.formulaColorByRef.size;const i=new Map;t.forEach((r,a)=>{const n=a%Ln;i.set(r,n),this.formulaColorByRef.get(r)!==n&&(s=!0)}),s&&(this.formulaColorByRef.clear(),i.forEach((r,a)=>this.formulaColorByRef.set(a,r)))}onContentInput(){const e=this.getContentElement(),t=this.getCurrentValue(),s=xt(this.beans,e,t),i=Mh(e),{isFormula:r,hasFormulaPrefix:a}=this.getFormulaState(i);if(!r){this.applyPlainValue(i,{caret:s,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(i,a);return}this.applyFormulaValue(i,{currentValue:t,caret:s??void 0,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(i,a)}onContentFocus(){if(this.rangeSyncFeature?.setEditorActive(!0),this.suppressNextFocusCaretPlacement){this.suppressNextFocusCaretPlacement=!1;return}const{focusFromMouseTime:e}=this,t=e!=null;this.focusFromMouseTime=null,!t&&uB(this.beans,this.getContentElement())}onContentBlur(e){this.focusFromMouseTime=null;const t=e.relatedTarget,s=t?.closest(".ag-cell-editor"),i=t?.closest(".ag-cell");!t||this.getGui().contains(t)||!s||!i||this.rangeSyncFeature?.deactivateForFocusLoss()}onContentMouseDown(){this.focusFromMouseTime=Date.now()}insertOrReplaceToken(e,t){const s=this.getTokenInsertOffsets(t);if(!s)return{};const{caretOffset:i,valueOffset:r}=s,a=t||this.lastTokenValueLength==null?0:this.lastTokenValueLength,n=this.getCurrentValue(),o=n.slice(0,r)+e+n.slice(r+a),l=Gn(this.beans,o,r)?.index??null;let c;return this.applyFormulaValueChange({currentValue:n,nextValue:o,caret:i+e.length,updateTracking:()=>{c=this.updateLastTokenTracking(e,i,r)}}),{previousRef:c,tokenIndex:l}}removeTokenRef(e,t){const s=this.getCurrentValue(),i=es(this.beans,s);let r;if(t!=null&&(r=i.find(l=>l.index===t),r&&r.ref!==e&&(r=void 0)),r||(r=i.find(l=>l.ref===e)),!r)return!1;const a=s.slice(0,r.start)+s.slice(r.end),n=this.selectionCaretOffset??r.start,o=Math.min(n,a.length);return this.applyFormulaValueChange({currentValue:s,nextValue:a,caret:o,updateTracking:()=>{this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=o,this.lastTokenRef=void 0}}),!0}applyRangeInsert(e){const t=this.getCurrentValue(),s=this.getCaretOffsets(t);if(!s){const{previousRef:l,tokenIndex:c}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:l,tokenIndex:c}}const{valueOffset:i}=s,r=Gn(this.beans,t,i);if(r){const{end:l,ref:c}=r;if(c.endsWith(":")&&i===l){const{previousRef:h,tokenIndex:p}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:h,tokenIndex:p}}const{previousRef:d,tokenIndex:u}=this.replaceTokenAtMatch(r,e);return{action:"replace",previousRef:d,tokenIndex:u}}const a=LB(t,i);if(a){const l=t.slice(0,a.start)+e+t.slice(a.end),c=Gn(this.beans,l,a.start)?.index??null,{previousRef:d}=this.replaceTokenAtMatch(a,e,c);return{action:"replace",previousRef:d,tokenIndex:c}}if(!kB(t,i))return{action:"none"};const{previousRef:n,tokenIndex:o}=this.insertOrReplaceToken(e,!0);return{action:"insert",previousRef:n,tokenIndex:o}}restoreCaretAfterToken(){const t=(this.lastTokenCaretOffset??xt(this.beans,this.getContentElement(),this.getCurrentValue())??this.currentValue.length)+(this.lastTokenValueLength??0);this.selectionCaretOffset=null,this.suppressNextFocusCaretPlacement=!0,setTimeout(()=>{this.isAlive()&&(this.getContentElement().focus({preventScroll:!0}),Tn(this.beans).activeElement===this.getContentElement()&&(this.suppressNextFocusCaretPlacement=!1),On(this.beans,this.getContentElement(),t))})}replaceTokenAtMatch(e,t,s){const i=this.getCurrentValue(),r=i.slice(0,e.start)+t+i.slice(e.end);return this.applyFormulaValueChange({currentValue:i,nextValue:r,caret:e.start+t.length,updateTracking:()=>{this.updateLastTokenTracking(t,e.start,e.start)}}),{previousRef:e.ref,tokenIndex:s??e.index}}getValueOffsetFromCaret(e){const t=this.getContentElement();let s=e,i=0;for(const r of Array.from(t.childNodes)){const a=ts(r),n=pr(r).length;if(s<=a)return i+(a===n?s:0);s-=a,i+=n}return this.currentValue.length}getTokenInsertOffsets(e){return this.getCaretOffsets(this.getCurrentValue(),{useCachedCaret:!0,useCachedValueOffset:!e})}getCaretOffsetsForAutocomplete(e){return this.getCaretOffsets(e)}getCaretOffsets(e,t={useCachedCaret:!1,useCachedValueOffset:!1}){const{beans:s}=this,{useCachedCaret:i,useCachedValueOffset:r}=t,a=this.getContentElement(),n=i?this.selectionCaretOffset??xt(s,a,e)??this.currentValue.length:xt(s,a,e);if(n==null)return null;const o=r&&this.lastTokenValueOffset!=null?this.lastTokenValueOffset:this.getValueOffsetFromCaret(n);return o==null?null:{caretOffset:n,valueOffset:o}}updateLastTokenTracking(e,t,s){const i=this.lastTokenRef;return this.lastTokenValueOffset=s,this.lastTokenValueLength=e.length,this.lastTokenCaretOffset=t,this.lastTokenRef=e,i}getFormulaState(e){const t=e.trimStart().startsWith("=");return{isFormula:this.beans.formula?.isFormula(e)??t,hasFormulaPrefix:t}}dispatchValueChanged(){this.dispatchLocalEvent({type:"fieldValueChanged"})}applyPlainValue(e,t){this.formulaColorByRef.clear(),this.renderPlainValue(e,t.caret),this.setEditorValue(e,t.silent),t.dispatch&&this.dispatchValueChanged(),this.autocompleteFeature?.onPlainValueUpdated()}applyFormulaValue(e,t){this.updateFormulaColorsFromValue(e),this.renderFormula({value:e,currentValue:t.currentValue??this.getCurrentValue(),caret:t.caret??void 0}),this.setEditorValue(e,t.silent),t.dispatch&&this.dispatchValueChanged(),this.autocompleteFeature?.onFormulaValueUpdated()}applyFormulaValueChange(e){const{currentValue:t,nextValue:s,caret:i}=e;this.updateFormulaColorsFromValue(s),e.updateTracking?.(),this.setEditorValue(s),this.renderFormula({currentValue:t,value:s,caret:i}),this.dispatchValueChanged(),this.autocompleteFeature?.onFormulaValueUpdated()}replaceTokenRef(e,t,s,i){const r=this.getContentElement();let a;if(i!=null&&(a=r.querySelector(`.ag-formula-token[data-formula-token-index="${i}"]`)??void 0,a&&Ph(a)!==e&&(a=void 0)),a||(a=Array.from(r.querySelectorAll(".ag-formula-token")).find(u=>Ph(u)===e)),!a)return null;const n=Ah(r,a),o=Ah(r,a,!0);if(n==null||o==null)return null;const l=this.getCurrentValue();s!=null&&this.formulaColorByRef.set(t,s);const c=l.slice(0,o)+t+l.slice(o+e.length),d=NB(a);return this.applyFormulaValueChange({currentValue:l,nextValue:c,caret:n+t.length,updateTracking:()=>{this.updateLastTokenTracking(t,n,o)}}),d??i??null}},kn=e=>{const{gos:t,rangeSvc:s}=e;return!!s&&!!t.get("cellSelection")},DB=(e,t)=>{const s=[],i=new Set;for(const r of es(e,t)){const a=r.ref;i.has(a)||(i.add(a),s.push(a))}return s},Gn=(e,t,s)=>{for(const i of es(e,t))if(s>=i.start&&s<=i.end)return{ref:i.ref,start:i.start,end:i.end,index:i.index};return null},LB=(e,t)=>{for(const s of yh(e))if(t>=s.start&&t<=s.end)return{ref:s.ref,start:s.start,end:s.end,index:s.index};return null},kB=(e,t)=>{const s=xh(e,t);return s==null||wh.has(s)},GB=(e,t,s)=>{const i=[];let r=0;const a=es(e,t),n=Tn(e);for(const o of a){o.start>r&&i.push(n.createTextNode(Ih(t.slice(r,o.start))));const l=s(o.index);i.push(OB(o.ref,l,l!=null,o.index)),r=o.end}return r<t.length&&i.push(n.createTextNode(Ih(t.slice(r)))),i.length||i.push(n.createTextNode("")),i},OB=(e,t,s,i)=>{const r={"aria-label":e,"data-formula-ref":e,"data-formula-token-index":i.toString()};let a;if(s&&t!=null){const o=In(e,t);a=o.tokenClass,r["data-formula-range-class"]=o.rangeClass}const n=dB({tag:"span",cls:"ag-formula-token",attrs:r,children:e});return a&&n.classList.add(a),n},_B=e=>{const{beans:t,contentElement:s,currentValue:i,value:r,getColorIndexForToken:a,caret:n}=e,o=n??xt(t,s,i),l=r.length;s.textContent="";for(const d of GB(t,r,a))s.append(d);const c=o!=null?Math.min(o,l):null;On(t,s,c)},Ah=(e,t,s=!1)=>{if(!e.contains(t))return null;let i=0;for(const r of Array.from(e.childNodes)){if(r===t)return i;i+=s?pr(r).length:ts(r)}return null},Mh=e=>{let t="";return e.childNodes.forEach(s=>{t+=pr(s)}),t},pr=e=>e.nodeType===Node.TEXT_NODE?Eh(e.textContent??""):e.nodeType===Node.ELEMENT_NODE?Array.from(e.childNodes).map(t=>pr(t)).join(""):"",ts=e=>e.nodeType===Node.TEXT_NODE?e.textContent?.length??0:e.nodeType===Node.ELEMENT_NODE?Array.from(e.childNodes).reduce((t,s)=>t+ts(s),0):0,Th=(e,t)=>{let s=t;for(let i=0;i<e.childNodes.length;i++){const r=e.childNodes[i],a=ts(r);if(s>a){s-=a;continue}return r.nodeType===Node.TEXT_NODE?{node:r,localOffset:s}:Th(r,s)}return{node:e,localOffset:e.childNodes.length}},On=(e,t,s)=>{if(s==null)return;const i=Ch(e),r=Tn(e),a=i.getSelection(),n=r.createRange(),{node:o,localOffset:l}=Th(t,s);if(!(!o||!a||!t.isConnected||!o.isConnected)){n.setStart(o,l),n.collapse(!0),a.removeAllRanges();try{a.addRange(n)}catch{}}},xt=(e,t,s)=>{const r=Ch(e).getSelection();if(!r||r.rangeCount===0)return s?.length??null;const a=r.getRangeAt(0);if(!t.contains(a.startContainer))return s?.length??null;if(a.startContainer===t){let l=0;for(let c=0;c<a.startOffset;c++)l+=ts(t.childNodes[c]);return l}let n=a.startOffset,o=a.startContainer;for(;o&&o!==t;){let l=o.previousSibling;for(;l;)n+=ts(l),l=l.previousSibling;o=o.parentNode}return n},Ph=e=>Eh(e.textContent??e.dataset.formulaRef??""),NB=e=>{const t=e.dataset.formulaTokenIndex;if(!t)return null;const s=parseInt(t,10);return Number.isFinite(s)?s:null},Ih=e=>e.replace(/[/*]/g,t=>PB[t]??t),Eh=e=>e.replace(/[÷×]/g,t=>IB[t]??t),BB={1:["invalidFormulaValidation","Invalid formula."],2:["formulaParseInvalidCellReference","Invalid cell reference: ${variable}."],3:["formulaParseInvalidRangeEndReference","Invalid range end reference."],4:["formulaParseUnterminatedString","Unterminated string."],5:["formulaParseUnexpectedCharacter","Unexpected character: ${variable}."],6:["formulaParseOperatorStackUnderflow","Operator stack underflow."],7:["formulaParseMissingOperand","Missing operand for '${variable}'."],8:["formulaParseInternalUnexpectedFrameDuringReduction","Internal error: unexpected frame during reduction."],9:["formulaParseInternalUnexpectedFrameBeforeOpenParen","Internal error: unexpected frame before '('."],10:["formulaParseMisplacedComma","Misplaced comma."],11:["formulaParseCommaOutsideFunctionCall","Comma outside of a function call."],12:["formulaParseInternalUnexpectedFrameBeforeCloseParen","Internal error: unexpected frame before ')'."],13:["formulaParseMismatchedParentheses","Mismatched parentheses."],14:["formulaParseUnsupportedOperand","Unsupported operand: ${variable}."],15:["formulaParseMismatchedParenthesesOrUnfinishedFunctionCall","Mismatched parentheses or unfinished function call."],16:["formulaParseInvalidExpression","Invalid expression."],17:["formulaParseFormulasMustBeginWithEquals","Formulas must begin with =."],18:["formulaSerializeStringContainsQuote",'String contains a quote (") which the tokenizer does not support.',"#PARSE!"],19:["formulaSerializeCannotProduceAbsoluteColumnLabelFromId","Cannot produce absolute COLUMN label from id '${variable}'."],20:["formulaSerializeCannotProduceAbsoluteRowIndexFromId","Cannot produce absolute ROW index from id '${variable}'."],21:["formulaSerializeCannotProduceRowIndexFromId","Cannot produce ROW index from id '${variable}'."],22:["formulaSerializeCannotMapColumnIdToA1Label","Cannot map column id '${variable}' to A1 label."],23:["formulaSerializeCannotParseAbsoluteRowIndex","Cannot parse absolute row index '${variable}'."],24:["formulaSerializeCannotMapRowIdToA1Index","Cannot map row id '${variable}' to A1 index."],25:["formulaEvalRangeNotAllowedInScalarContext","Range is not allowed in scalar context."],26:["formulaEvalUnknownReferenceToCell","Unknown reference to cell.","#REF!"],27:["formulaEvalUnsupportedOperation","Unsupported operation ${variable}.","#NAME?"],28:["formulaEvalInvalidAbsoluteRow","Invalid absolute row.","#REF!"],29:["formulaEvalUnrecognisedRowId","Unrecognised row id.","#REF!"],30:["formulaEvalInvalidAbsoluteColumn","Invalid absolute column.","#REF!"],31:["formulaEvalUnrecognisedColumnId","Unrecognised column id.","#REF!"],32:["formulaEvalUnrecognisedRowInRange","Unrecognised row in range.","#REF!"],33:["formulaEvalUnrecognisedReferenceToCell","Unrecognised reference to cell.","#REF!"],34:["formulaEvalIncompleteRangeReference","Incomplete range reference.","#REF!"],35:["formulaFunctionExpectedExactlyArguments","${variable}: expected exactly ${variable} arguments."],36:["formulaFunctionExpectedAtMostArguments","${variable}: expected at most ${variable} arguments."],37:["formulaFunctionExpectedAtLeastArguments","${variable}: expected at least ${variable} arguments."],38:["formulaFunctionInvalidCriteriaWildcardsWithComparator","Invalid criteria: wildcards with comparator.","#VALUE!"],39:["formulaFunctionNonNumericArgument","${variable}: non-numeric argument.","#VALUE!"],40:["formulaFunctionDivisionByZero","${variable}: division by zero.","#DIV/0!"],41:["formulaFunctionCannotCombineDatesWithBigInt","${variable}: cannot combine dates with BigInt.","#VALUE!"],42:["formulaFunctionRequiresAtLeastOneNumericValue","${variable}: requires at least one numeric value.","#PARSE!"],43:["formulaFunctionRequiresAtLeastOneValue","${variable}: requires at least one value."],44:["formulaFunctionAllValuesMustBeNumbers","${variable}: all values must be numbers.","#VALUE!"],45:["formulaFunctionArgumentMustBeRange","${variable}: ${variable} argument must be a range.","#VALUE!"],46:["formulaFunctionArgumentMustBeValue","${variable}: ${variable} argument must be a value.","#VALUE!"],47:["formulaFunctionRangesHaveDifferentSizes","${variable}: ranges have different sizes.","#VALUE!"],48:["formulaFunctionValuesMustBeNumeric","${variable}: values must be numeric.","#VALUE!"],49:["formulaFunctionValuesMustBeIntegers","${variable}: values must be integers.","#VALUE!"],50:["formulaFunctionUnsupportedValueType","${variable}: unsupported value type.","#VALUE!"],51:["formulaServiceCircularReference","Circular reference.","#CIRCREF!"],52:["formulaServiceExpectedParsableFormula","Expected parsable formula.","#PARSE!"],53:["formulaServiceInternalSchedulingError","Internal scheduling error."],54:["formulaFunctionDivNonNumericArgument","DIV: non-numeric argument.","#VALUE!"],55:["formulaFunctionDivDivisionByZero","DIV: division by zero.","#DIV/0!"],56:["formulaFunctionSumCannotCombineDatesWithBigInt","SUM: cannot combine dates with BigInt.","#VALUE!"],57:["formulaFunctionSumRequiresAtLeastOneNumericValue","SUM: requires at least one numeric value.","#PARSE!"],58:["formulaFunctionAvgRequiresAtLeastOneValue","AVG: requires at least one value."],59:["formulaFunctionMedianAllValuesMustBeNumbers","MEDIAN: all values must be numbers.","#VALUE!"],60:["formulaFunctionMedianRequiresAtLeastOneValue","MEDIAN: requires at least one value."],61:["formulaFunctionSumifFirstArgumentMustBeRange","SUMIF: first argument must be a range.","#VALUE!"],62:["formulaFunctionSumifSecondArgumentMustBeValue","SUMIF: second argument must be a value (criteria).","#VALUE!"],63:["formulaFunctionSumifThirdArgumentMustBeRange","SUMIF: third argument must be a range (sum_range).","#VALUE!"],64:["formulaFunctionSumifRangesHaveDifferentSizes","SUMIF: ranges have different sizes.","#VALUE!"],65:["formulaFunctionCountifFirstArgumentMustBeRange","COUNTIF: first argument must be a range.","#VALUE!"],66:["formulaFunctionCountifSecondArgumentMustBeValue","COUNTIF: second argument must be a value (criteria).","#VALUE!"],67:["formulaFunctionConcatUnsupportedValueType","CONCAT: unsupported value type.","#VALUE!"],68:["formulaFunctionMinRequiresAtLeastOneValue","MIN: requires at least one value."],69:["formulaFunctionMaxRequiresAtLeastOneValue","MAX: requires at least one value."],70:["formulaFunctionPercentNonNumericArgument","PERCENT: non-numeric argument.","#VALUE!"],71:["formulaFunctionPowerNonNumericArgument","POWER: non-numeric argument.","#VALUE!"]},VB=(e,t)=>{if(!t?.length)return e;let s=e,i=0;for(;i<t.length&&s.indexOf("${variable}")!==-1;)s=s.replace("${variable}",t[i++]);return s},Dh=e=>{if(e?.length)return e.map(t=>String(t))},_n=e=>BB[e],HB=(e,t)=>{const[,s]=_n(e);return VB(s,Dh(t))},zB=(e,t,s)=>{const[i,r]=_n(t),a=Dh(s);return e(i,r,a)},UB=class extends aB{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"}),this.eEditor=nB,this.focusAfterAttached=!1}initialiseEditor(e){const t=this.createManagedBean(new EB);this.eEditor=t,t.addCss("ag-cell-editor"),this.appendChild(t),this.addManagedElementListeners(t.getContentElement(),{keydown:n=>this.onFormulaInputKeyDown(n,e.onKeyDown)});const{eventKey:s,cellStartedEdit:i}=e;let r;i?(this.focusAfterAttached=!0,s===Mn.BACKSPACE||s===Mn.DELETE?r="":s&&s.length===1?r=s:r=this.getStartValue(e)):r=this.getStartValue(e);const a=r==null?"":String(r);this.eEditor.setEditingCellRef(e.column,e.rowIndex),this.eEditor.setValue(a,!0)}onFormulaInputKeyDown(e,t){const{key:s}=e;if(s!==Mn.TAB||e.defaultPrevented)return;const{focusSvc:i}=this.beans,r=i?.getFocusedCell();this.eEditor.withSelectionChangeHandlingSuppressed(()=>{t?.(e)});const a=i?.getFocusedCell();let n=!1;if(r&&a){const{rowIndex:l,rowPinned:c,column:d}=r,{rowIndex:u,rowPinned:h,column:p}=a;n=l!==u||c!==h||d!==p}const{defaultPrevented:o}=e;(o||n)&&e.preventDefault(),e.stopPropagation()}getStartValue(e){const{value:t}=e;return t?.toString()??t}isPopup(){return!1}afterGuiAttached(){if(!this.focusAfterAttached)return;const{beans:e,eEditor:t}=this;oB()||this.focusIn(),lB(e,t.getContentElement())}focusIn(){this.eEditor.getContentElement().focus({preventScroll:!0})}getValue(){const e=this.eEditor.getCurrentValue(),{value:t,parseValue:s}=this.params;return typeof e=="string"&&this.isFormulaText(e)?e:e==null&&t==null?t:s(String(e))}getValidationElement(){return this.eEditor.getContentElement()}getValidationErrors(){const{params:e}=this,t=this.eEditor.getCurrentValue(),s=this.getLocaleTextFunc(),{getValidationErrors:i,validateFormulas:r}=e;let a=null;return(r===!0||!!i)&&typeof t=="string"&&this.isFormulaText(t)&&(this.beans.formula?.normaliseFormula(t,!0)||(a=[zB(s,1)])),i?i({value:t,internalErrors:a,cellEditorParams:e}):a}isFormulaText(e){const t=e==null?"":String(e);return this.beans.formula?.isFormula(t)??t.trimStart().startsWith("=")}},WB='.formula-error:after{background-color:var(--ag-invalid-color);content:"";height:12px;position:absolute;top:-6px;width:12px}:where(.ag-ltr) .formula-error:after{right:-6px;transform:rotate(45deg)}:where(.ag-rtl) .formula-error:after{left:-6px;transform:rotate(-45deg)}';import{BeanStub as KB,_addGridCommonParams as $B,_isExpressionString as jB}from"ag-grid-community";var YB=class extends KB{constructor(){super(...arguments),this.beanName="formulaDataSvc",this.hasSource=!1}postConstruct(){const e=this.gos.get("formulaDataSource");e&&this.setDataSource(e)}hasDataSource(){return this.hasSource}getFormula(e){const t=this.dataSource?.getFormula(e);return jB(t)?t:void 0}setFormula(e){this.dataSource?.setFormula(e)}setDataSource(e){this.dataSource=e,this.hasSource=!0,e.init?.(this.createInitParams())}createInitParams(){return $B(this.gos,{})}destroy(){this.dataSource?.destroy?.(),super.destroy()}};import{BeanStub as qB}from"ag-grid-community";var XB=class extends qB{constructor(){super(...arguments),this.beanName="formulaInputManager",this.activeEditor=null,this.activeEditorDeactivate=null}postConstruct(){this.registerRangeSelectionExtension()}registerActiveEditor(e,t){if(this.activeEditor===e&&this.activeEditorDeactivate===t)return!1;const s=this.activeEditorDeactivate;return s&&s!==t&&s(),this.activeEditor=e,this.activeEditorDeactivate=t,!0}unregisterActiveEditor(e,t){this.activeEditor===e&&this.activeEditorDeactivate===t&&(this.activeEditor=null,this.activeEditorDeactivate=null)}isActiveEditor(e){return this.activeEditor===e}shouldSuppressRangeSelection(e){const t=e;return t?.closest?this.activeEditor!=null?!!t.closest(".ag-cell-editor"):!!t.closest(".ag-formula-input-field"):!1}registerRangeSelectionExtension(){const e=this.beans.rangeSvc;e&&(e.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>e.unregisterRangeSelectionExtension?.(this)))}};import{BeanStub as ZB,_convertColumnEventSourceType as JB,_isExpressionString as QB,_warn as ss}from"ag-grid-community";import{_getClientSideRowModel as eV,_isExpressionString as tV}from"ag-grid-community";var Lh=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],gr=new Map;for(const e of Lh){const t=gr.get(e.symbol)??[];t.push(e),gr.set(e.symbol,t)}function is(e,t){const s=gr.get(e)??[];return t?s.find(i=>i.fixity===t):s[0]}var sV=[...new Set(Lh.map(e=>e.symbol))].sort((e,t)=>t.length-e.length),Nn=gr,iV=e=>{if(e?.length)return e.map(t=>String(t))},G=class extends Error{constructor(e,t,s){const i=typeof e=="string",r=!i&&Array.isArray(t)?iV(t):void 0,a=i?e:HB(e,r);if(super(a),this.name="FormulaError",i)this.type=typeof t=="string"?t:"#ERROR!",this.errorId=null,this.localeKey=null,this.defaultMessage=e,this.variableValues=void 0;else{const[n,o,l]=_n(e);this.type=s??l??"#ERROR!",this.errorId=e,this.localeKey=n,this.defaultMessage=o,this.variableValues=r}}getTranslatedMessage(e){return this.localeKey?e(this.localeKey,this.defaultMessage,this.variableValues):this.message}},Q=class extends G{constructor(e,t,s,i){super(e,i,"#PARSE!"),this.errorStart=t,this.errorEnd=s}},rV=(e,t,s)=>{const i=t.trim();if(i.startsWith('"')&&i.endsWith('"')&&i.length>2)return i.slice(1,-1);if(i.toLowerCase()==="true")return!0;if(i.toLowerCase()==="false")return!1;const r=Number(i);if(!isNaN(r))return r;const a=Pn(i);if(a){const{startCol:n,startRow:o,startColAbsolute:l,startRowAbsolute:c,endCol:d,endRow:u,endColAbsolute:h,endRowAbsolute:p}=a,g=(m,C,v,S,b)=>{const y=m||b?C.toUpperCase():e.formula?.getColByRef(C)?.colId,w=v||b?S:eV(e)?.getFormulaRow(Number(S)-1)?.id;if(y==null||w==null)throw new Q(2,0,0,[i]);return{column:{id:y,absolute:m},row:{id:w,absolute:v}}},f=g(l,n,c,o,s);if(d&&u){const m=g(h??!1,d,p??!1,u,s);f.endColumn=m.column,f.endRow=m.row}return f}return null};function aV(e){const t=[];let s=0;const i=(r,a)=>{let n=a;const o=()=>r[n]==="$"?(n++,!0):!1,l=()=>{const h=n;for(;n<r.length&&/[A-Za-z]/.test(r[n]);)n++;return n>h},c=()=>{const h=n;for(;n<r.length&&/[0-9]/.test(r[n]);)n++;return n>h},d=()=>{const h=n;return o(),!l()||(o(),!c())?(n=h,!1):!0};if(!d())return 0;if(r[n]===":"){const h=n;if(n++,!d())throw new Q(3,h,n)}const u=r.slice(a,n);return bh(r,a,u)?n-a:0};for(;s<e.length;){const r=e[s];if(/\s/.test(r)){s++;continue}if(r==='"'){let n=s+1;for(;n<e.length&&e[n]!=='"';)n++;if(n>=e.length)throw new Q(4,s,e.length);t.push(e.slice(s,n+1)),s=n+1;continue}if(/[0-9]/.test(r)||r==="."&&/[0-9]/.test(e[s+1])){let n=s+1;for(;n<e.length&&/[0-9.]/.test(e[n]);)n++;t.push(e.slice(s,n)),s=n;continue}if(r==="$"||hr(r)){const n=i(e,s);if(n>0){t.push(e.slice(s,s+n)),s+=n;continue}let o=s+1;for(;o<e.length&&js(e[o]);)o++;t.push(e.slice(s,o)),s=o;continue}if(r==="("||r===")"||r===","){t.push(r),s++;continue}const a=sV.find(n=>e.startsWith(n,s));if(!a)throw new Q(5,s,s+1,[r]);t.push(a),s+=a.length}return t}function nV(e,t){return e.fixity!=="infix"||t.fixity!=="infix"?!0:e.associativity==="right"&&e.precedence===t.precedence?!1:e.precedence>=t.precedence}function oV(e,t){const s=Nn.get(e);if(!s)return null;const i=t!==void 0&&Nn.has(t);return t!==void 0&&!i&&!(t==="("||t===",")&&t!=="("||t===")"?s.find(n=>n.fixity==="postfix")??s.find(n=>n.fixity==="infix")??null:s.find(n=>n.fixity==="prefix")??s.find(n=>n.fixity==="infix")??null}function lV(e,t,s){const i=aV(t),r=[],a=[],n=()=>{const l=a.pop();if(!l)throw new Q(6,0,0);if(l.kind==="op"){const c=l.def;if(c.fixity!=="infix"){const h=r.pop();if(!h)throw new Q(7,0,0,[c.symbol]);if(c.symbol==="+"&&c.fixity==="prefix"){r.push(h);return}if(c.fixity==="postfix"&&c.symbol==="%"){r.push({type:"operation",operation:c.symbol,operands:[h]});return}c.symbol==="-"&&c.fixity==="prefix"?r.push({type:"operation",operation:"-",operands:[{type:"operand",value:0},h]}):r.push({type:"operation",operation:c.symbol,operands:[h]});return}const d=r.pop(),u=r.pop();if(!u||!d)throw new Q(7,0,0,[c.symbol]);r.push({type:"operation",operation:c.symbol,operands:[u,d]});return}throw new Q(8,0,0)};let o=0;for(;o<i.length;){const l=i[o];if(hr(l[0])&&i[o+1]==="("){const u=l;a.push({kind:"function",name:u,args:[]}),a.push({kind:"parenthesis",outLen:r.length}),o+=2;continue}if(l==="("){a.push({kind:"parenthesis",outLen:r.length}),o++;continue}if(l===","){for(;;){const p=a[a.length-1];if(!p||p.kind==="parenthesis")break;if(p.kind==="op")n();else throw new Q(9,o,o+1)}const u=a[a.length-1];if(!u||u.kind!=="parenthesis")throw new Q(10,o,o+1);const h=a[a.length-2];if(!h||h.kind!=="function")throw new Q(11,o,o+1);r.length>u.outLen&&h.args.push(r.pop()),o++;continue}if(l===")"){for(;;){const p=a[a.length-1];if(!p||p.kind==="parenthesis")break;if(p.kind==="op")n();else throw new Q(12,o,o+1)}const u=a[a.length-1];if(!u||u.kind!=="parenthesis")throw new Q(13,o,o+1);const h=u.outLen;if(a.pop(),a[a.length-1]?.kind==="function"){const p=a.pop();r.length>h&&p.args.push(r.pop()),r.push({type:"operation",operation:p.name,operands:p.args})}o++;continue}const c=Nn.has(l)?oV(l,i[o-1]):null;if(c){for(;;){const u=a[a.length-1];if(!u||u.kind!=="op")break;if(nV(u.def,c))n();else break}a.push({kind:"op",def:c}),o++;continue}const d=rV(e,l,s);if(d==null)throw new Q(14,0,l.length,[l]);r.push({type:"operand",value:d}),o++}for(;a.length;)if(a[a.length-1].kind==="op")n();else throw new Q(15,0,0);if(r.length!==1)throw new Q(16,0,0);return r[0]}var Bn=(e,t,s=!1)=>{if(!tV(t))throw new Q(17,0,1);const i=t.slice(1).trim();return Nh(lV(e,i,s))};function Vn(e,t){return e.type==="operation"&&e.operation.toUpperCase()===t.toUpperCase()}function kh(e,t=!1){return!e||e.type!=="operand"?t:!!e.value}function Gh(e){if(!e||e.type!=="operand")return null;const t=e.value;return typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):null}function Oh(e){if(!Vn(e,"COLUMN"))return null;const t=Gh(e.operands[0]);if(t==null)return null;const s=kh(e.operands[1],!1);return{id:t,absolute:s}}function _h(e){if(!Vn(e,"ROW"))return null;const t=Gh(e.operands[0]);if(t==null)return null;const s=kh(e.operands[1],!1);return{id:t,absolute:s}}function cV(e){if(!Vn(e,"REF"))return null;const t=e.operands;if(t.length!==2&&t.length!==4)return null;const s=Oh(t[0]),i=_h(t[1]);if(!s||!i)return null;const r={column:s,row:i};if(t.length===4){const a=Oh(t[2]),n=_h(t[3]);if(!a||!n)return null;r.endColumn=a,r.endRow=n}return{type:"operand",value:r}}function Nh(e){if(e.type==="operation"){const t=e.operands.map(Nh),s={type:"operation",operation:e.operation,operands:t};return cV(s)??s}return e}import{_getClientSideRowModel as dV}from"ag-grid-community";var fr=e=>e.type==="operation";function Bh(e,t){const s=e.colModel.getColById(t);return s?e.formula?.getColRef(s)??null:null}function uV(e,t){return e.formula?.getColByRef?.(t)?.colId??null}function hV(e,t,s){const i=e.getColById(s);if(!i)return null;const r=t.indexOf(i);return r>=0?r:null}function pV(e,t){const s=e[t];return s?s.getId()??null:null}function Hn(e,t){const s=e.rowModel?.getRowNode?.(t);return s?.formulaRowIndex!=null?s.formulaRowIndex+1:null}function Vh(e,t){return dV(e)?.getFormulaRow?.(t-1)?.id??null}function zn(e){if(e.includes('"'))throw new G(18);return`"${e}"`}function gV(e,t){const s=/^[A-Za-z]+$/.test(t.id);if(t.absolute){if(s)return t.id.toUpperCase();const i=Bh(e,t.id);if(i)return i.toUpperCase();throw new G(19,[t.id])}else{if(s){const i=uV(e,t.id);if(i)return i}return t.id}}function fV(e,t){const{id:s,absolute:i}=t;if(i){if(Vh(e,Number(s))==null)throw new G(20,[s])}else if(Hn(e,s)==null)throw new G(21,[s]);return s}function Hh(e,t){if(t.absolute)return t.id;const s=Bh(e,t.id);if(s)return s.toUpperCase();throw new G(22,[t.id])}function zh(e,t){if(t.absolute){const i=Number(t.id);if(Number.isFinite(i)&&i>=1)return i;throw new G(23,[t.id])}const s=Hn(e,t.id);if(s!=null)return s;throw new G(24,[t.id])}function mV(e,t,s){const i=(o,l)=>(o?"$":"")+String(l),r=s?t.column.id:Hh(e,t.column),a=s?t.row.id:zh(e,t.row),n=i(t.column.absolute,r)+i(t.row.absolute,a);if(t.endColumn&&t.endRow){const o=s?t.endColumn.id:Hh(e,t.endColumn),l=s?t.endRow.id:zh(e,t.endRow);return`${n}:${i(t.endColumn.absolute,o)}${i(t.endRow.absolute,l)}`}return n}function CV(e,t){const s=a=>`COLUMN(${zn(gV(e,a))}${a.absolute?",true":""})`,i=a=>`ROW(${zn(fV(e,a))}${a.absolute?",true":""})`,r=`REF(${s(t.column)},${i(t.row)}`;return t.endColumn&&t.endRow?`${r},${s(t.endColumn)},${i(t.endRow)})`:`${r})`}function Uh(e){if(!fr(e)||e.operation!=="-"||e.operands.length!==2)return null;const[t,s]=e.operands;return t.type==="operand"&&t.value===0?s:null}function vV(e){return fr(e)?!!is(e.operation,"infix"):!1}function Wh(e,t,s){if(!fr(t)||Uh(t))return!1;const i=is(t.operation,"infix");if(!i||i.fixity!=="infix")return!1;const r=e.precedence,a=i.precedence;if(a<r)return!0;if(a>r)return!1;if(e.associativity==="right"){const o=i.symbol===e.symbol;return s==="left"&&o}return e.isAssociative===!0?!1:s==="right"}function SV(e){if(!fr(e))return!1;const t=is(e.operation,"infix");return t?!(t.symbol==="^"):!1}function Kh(e,t,s,i){const r=n=>s?CV(e,n):mV(e,n,i);function a(n){if(n.type==="operand"){const c=n.value;return typeof c=="string"?zn(c):typeof c=="number"?String(c):typeof c=="boolean"?c?"TRUE":"FALSE":r(c)}const o=Uh(n);if(o){const c=a(o);return SV(o)?`-(${c})`:`-${c}`}const l=n.operation.toUpperCase();if(n.operands.length===1){const c=n.operands[0],d=is(l,"postfix");if(d)return`${a(c)}${d.symbol}`;const u=is(l,"prefix");if(u){const h=a(c);return vV(c)?`${u.symbol}(${h})`:`${u.symbol}${h}`}return`${l}(${a(c)})`}if(n.operands.length===2){const c=is(l,"infix");if(c){const[d,u]=n.operands,h=Wh(c,d,"left")?`(${a(d)})`:a(d),p=Wh(c,u,"right")?`(${a(u)})`:a(u);return`${h}${c.symbol}${p}`}}return`${l}(${n.operands.map(a).join(",")})`}return"="+a(t)}import{_getClientSideRowModel as Un}from"ag-grid-community";function $h(e){return!!(e.endColumn&&e.endRow)}function Wn(e,t){const{row:s,column:i}=t,r=s.absolute?Un(e)?.getFormulaRow(Number(s.id)-1):e.rowModel.getRowNode(s.id),a=i.absolute?e.formula.getColByRef(i.id):e.colModel.getColById(i.id);return!r||!a?null:{row:r,column:a}}function jh(e,t,s,i){if(t.type==="operand"){const o=t.value;if(typeof o!="object")return o;if($h(o))throw new G(25);const l=Wn(e,o);if(!l)throw new G(26);return s(l)}const r=e.formula?.getFunction(t.operation);if(!r)throw new G(27,[t.operation]);const{args:a,values:n}=wV(e,t.operands,s,i);return r({row:i.row,column:i.column,args:a,values:n})}function Yh(e,t,s,i){if(t.type==="operand"){const a=t.value;if(typeof a!="object")return{kind:"value",value:a};if($h(a))return FV(e,a,s);const n=Wn(e,a);if(!n)throw new G(26);return{kind:"value",value:s(n)}}return{kind:"value",value:jh(e,t,s,i)}}var bV=class{constructor(e,t,s,i){this.beans=e,this.operandNodes=t,this.getCellValue=s,this.caller=i,this.i=0,this.res={done:!1,value:void 0}}next(){return this.i>=this.operandNodes.length?(this.res.done=!0,this.res.value=void 0,this.res):(this.res.done=!1,this.res.value=Yh(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller),this.res)}[Symbol.iterator](){return this}},yV=class{constructor(e,t,s,i){this.beans=e,this.operandNodes=t,this.getCellValue=s,this.caller=i,this.i=0,this.inner=null,this.res={done:!1,value:void 0}}next(){for(;;){if(this.inner){const t=this.inner.next();if(!t.done)return this.res.done=!1,this.res.value=t.value,this.res;this.inner=null;continue}if(this.i>=this.operandNodes.length)return this.res.done=!0,this.res.value=void 0,this.res;const e=Yh(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller);if(e.kind==="value")return this.res.done=!1,this.res.value=e.value,this.res;this.inner=e[Symbol.iterator]()}}[Symbol.iterator](){return this}};function wV(e,t,s,i){return{args:{[Symbol.iterator](){return new bV(e,t,s,i)}},values:{[Symbol.iterator](){return new yV(e,t,s,i)}}}}function mr(e,t){if(t.absolute){const i=Number(t.id)-1;if(!Number.isFinite(i)||i<0)throw new G(28);return i}const s=e.rowModel?.getRowNode?.(t.id);if(s?.formulaRowIndex==null)throw new G(29);return s.formulaRowIndex}function Cr(e,t){if(t.absolute){const i=e.formula?.getColByRef(t.id);if(!i)throw new G(30);return i}const s=e.colModel.getColById(t.id);if(!s)throw new G(31);return s}var xV=class{constructor(e,t,s,i,r,a){this.beans=e,this.rowStartIndex=t,this.rowEndIndex=s,this.colStart=i,this.colEnd=r,this.getCellValue=a,this.cols=null,this.currentRowIndex=this.rowStartIndex,this.currentColIdx=-1,this.colStartIdx=-1,this.colEndIdx=-1,this.res={done:!1,value:void 0}}initColsOnce(){if(this.cols)return;this.cols=this.beans.colModel.getCols()??[];const e=qh(this.beans,this.colStart,this.colEnd);if(!e){this.colStartIdx=-1,this.colEndIdx=-1;return}[this.colStartIdx,this.colEndIdx]=e,this.currentColIdx=this.colStartIdx}next(){if(!this.cols&&(this.initColsOnce(),this.colStartIdx<0))return this.res.done=!0,this.res;if(this.currentRowIndex<=this.rowEndIndex){const e=Un(this.beans)?.getFormulaRow(this.currentRowIndex);if(!e)throw new G(32);const t=this.cols[this.currentColIdx];return this.currentColIdx<this.colEndIdx?this.currentColIdx++:(this.currentColIdx=this.colStartIdx,this.currentRowIndex++),this.res.value=this.getCellValue({row:e,column:t}),this.res}return this.res.done=!0,this.res.value=void 0,this.res}};function FV(e,t,s){const i=mr(e,t.row),r=t.endRow?mr(e,t.endRow):i,a=Math.min(i,r),n=Math.max(i,r),o=Cr(e,t.column),l=t.endColumn?Cr(e,t.endColumn):o;return{kind:"range",rowStart:a,rowEnd:n,colStart:o,colEnd:l,[Symbol.iterator](){return new xV(e,a,n,o,l,s)}}}function qh(e,t,s){const i=e.colModel.getCols()??[];let r=null,a=null;for(let l=0;l<i.length&&(r===null||a===null);l++){const c=i[l];if(c===s&&(a=l),c===t&&(r=l),a!==null&&r!==null)break}if(r===null||a===null)return null;const n=Math.min(r,a),o=Math.max(r,a);return[n,o]}function*RV(e,t,s,i,r){const a=e.colModel.getCols()??[],n=qh(e,i,r);if(n==null)return;const[o,l]=n;for(let c=t;c<=s;c++){const d=Un(e)?.getFormulaRow(c);if(d)for(let u=o;u<=l;u++)yield{row:d,column:a[u]}}}function*AV(e,t,s){const i=[t];for(;i.length;){const r=i.pop();if(r.type==="operand"){const a=r.value;if(typeof a!="object"||a==null)continue;if(!a.endColumn&&!a.endRow){const h=Wn(e,a);if(!h)throw new G(33);const p=s(h.row,h.column);if(!p||p.isValueReady())continue;yield h;continue}if(!a.endColumn||!a.endRow)throw new G(34);const n=mr(e,a.row),o=mr(e,a.endRow),l=Math.min(n,o),c=Math.max(n,o),d=Cr(e,a.column),u=Cr(e,a.endColumn);for(const h of RV(e,l,c,d,u)){const p=s(h.row,h.column);!p||p.isValueReady()||(yield h)}continue}for(let a=0;a<r.operands.length;a++)i.push(r.operands[a])}}function be(e,t,s){const i=e[Symbol.iterator](),r=new Array(s);for(let a=0;a<s;a++){const n=i.next();if(n.done)throw new G(35,[t,s]);r[a]=n.value}if(!i.next().done)throw new G(35,[t,s]);return r}function rs(e){return{*[Symbol.iterator](){for(const t of e)t!=null&&t!==""&&(yield t)}}}function MV(e,t,s,i){const r=[];for(const a of e)if(r.push(a),r.length>i)throw new G(36,[t,i]);if(r.length<s)throw new G(37,[t,s]);return r}var Kn=e=>e.kind==="range",Xh=e=>e.kind==="value",TV=["<=",">=","<>","<",">","="];function PV(e){for(const t of TV)if(e.startsWith(t))return t;return null}function $n(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(e instanceof Date)return+e;if(typeof e=="string"){const t=Number(e);if(!Number.isNaN(t))return t}return null}function Zh(e){if(e==null)return"";switch(typeof e){case"string":return e;case"number":return String(e);case"boolean":return e?"TRUE":"FALSE"}return e instanceof Date?String(+e):String(e)}function IV(e){let t="^";for(let s=0;s<e.length;s++){const i=e[s];if(i==="~"&&s+1<e.length&&(e[s+1]==="*"||e[s+1]==="?")){t+="\\"+e[++s];continue}if(i==="*"){t+=".*";continue}if(i==="?"){t+=".";continue}/[-/\\^$*+?.()|[\]{}]/.test(i)?t+="\\"+i:t+=i}return t+="$",new RegExp(t,"i")}var EV=(e,t,s)=>{let i=$n(t),r=$n(s);switch((i==null||r==null)&&(i=t,r=Zh(s).toUpperCase()),e){case"<":return r<i;case">":return r>i;case"<=":return r<=i;case">=":return r>=i;case"=":return r===i;case"<>":return r!==i}return!1},DV=(e,t,s)=>{const i=Zh(s),r=t.test(i);return e==="="?r:!r},LV=e=>e==null||e==="";function Jh(e){if(typeof e=="number")return n=>$n(n)===e;if(typeof e!="string")return n=>e===n;const t=e.trim();if(t==="")return LV;const s=PV(t),i=s?t.substring(s.length):t;if(!/[*?]/.test(i))return EV.bind(null,s??"=",i.toUpperCase());if(s&&s!=="="&&s!=="<>")throw new G(38);const a=IV(i);return DV.bind(null,s??"=",a)}var Qh=(e,t,s)=>{if(!s||t===0||s.absolute)return;const{visibleCols:i,colModel:r}=e,a=i.allCols,n=hV(r,a,s.id);if(n==null)return;const o=n+t;if(o<0)return;const l=pV(a,o);l&&(s.id=l)},ep=(e,t,s,i)=>{if(!s||t===0||s.absolute)return;if(i){const o=Number(s.id);if(!Number.isFinite(o))return;s.id=String(o+t);return}const r=Hn(e,s.id);if(r==null)return;const a=r+t;if(a<1)return;const n=Vh(e,a);n&&(s.id=n)},kV=e=>!!e&&typeof e=="object"&&e!==null&&"row"in e&&"column"in e,tp=(e,t,s,i,r)=>{if(t.type==="operand"){const{value:a}=t;if(!kV(a))return;const{row:n,column:o,endRow:l,endColumn:c}=a;ep(e,s,n,r),Qh(e,i,o),ep(e,s,l,r),Qh(e,i,c);return}if(t.type==="operation")for(const a of t.operands)tp(e,a,s,i,r)},GV=({values:e})=>{let t=0;for(const s of e)s!=null&&s!==""&&!isNaN(s)&&t++;return t},OV=({values:e})=>{let t=0;for(const s of e)s!=null&&s!==""&&t++;return t},_V=({values:e})=>{let t=0;for(const s of e)(s==null||s==="")&&t++;return t},NV=({args:e})=>{const[t,s]=be(e,"COUNTIF",2);if(!Kn(t))throw new G(65);if(!Xh(s))throw new G(66);const i=Jh(s.value);let r=0;for(const a of t)i(a)&&r++;return r},BV=()=>new Date,VV=()=>{const e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())},HV=({values:e})=>{const[t,s]=be(e,"EQUALS",2);return t===s},zV=({values:e})=>{const[t,s]=be(e,"NOT_EQUALS",2);return t!==s},UV=({values:e})=>{const[t,s]=be(e,"GT",2);return t>s},WV=({values:e})=>{const[t,s]=be(e,"GTE",2);return t>=s},KV=({values:e})=>{const[t,s]=be(e,"LT",2);return t<s},$V=({values:e})=>{const[t,s]=be(e,"LTE",2);return t<=s},jV=({values:e})=>{const[t,s,i]=be(e,"IF",3);return t?s:i},YV=({values:e})=>{let t=null;for(const s of e)s!=null&&(t===null||s<t)&&(t=s);if(t===null)throw new G(68);return t},qV=({values:e})=>{let t=null;for(const s of e)s!=null&&(t===null||s>t)&&(t=s);if(t===null)throw new G(69);return t},XV=e=>typeof e=="number"&&Number.isFinite(e),sp=24*60*60*1e3;function ZV(e){return e.getTime()/sp}function vr(e){return new Date(e*sp)}function as(e){return e instanceof Date}function Pe(e,t){if(typeof t=="bigint"){const s=Number(t);if(Number.isFinite(s))return s;throw new G(48,[e])}if(XV(t))return t;if(as(t))return ZV(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string"){const s=Number(t.trim());if(Number.isFinite(s))return s}throw new G(48,[e])}function ns(e,t){return typeof t=="bigint"?t:Pe(e,t)}function Ie(e,t){if(typeof t=="bigint")return t;if(!Number.isFinite(t)||!Number.isInteger(t))throw new G(49,[e]);return BigInt(t)}var ip=({values:e})=>{let t=1,s=null;for(const i of rs(e)){const r=ns("PRODUCT",i);if(typeof r=="bigint"){if(s??(s=Ie("PRODUCT",t)),r===0n)return 0n;s*=r;continue}if(s!=null){s*=Ie("PRODUCT",r);continue}if(r===0)return 0;t*=r}return s??t},JV=({values:e})=>{const[t,s]=be(rs(e),"DIVIDE",2),i=Pe("DIV",t),r=Pe("DIV",s);if(i==null||r==null)throw new G(54);if(r===0)throw new G(55);return i/r},jn=({values:e})=>{let t=!1,s=0,i=null,r=!1;for(const a of rs(e)){t||(t=as(a));const n=ns("SUM",a);if(typeof n=="bigint"){if(t)throw new G(56);i??(i=Ie("SUM",s)),i+=n,r=!0;continue}if(typeof i=="bigint"){if(t)throw new G(56);i+=Ie("SUM",n),r=!0;continue}s+=n,r=!0}if(!r)throw new G(57);return typeof i=="bigint"?i:t?vr(s):s},QV=({values:e})=>{const[t,s]=be(rs(e),"MINUS",2),i=as(t),r=as(s);if(i||r){const o=Pe("MINUS",t),l=Pe("MINUS",s);return i&&!r?vr(o-l):o-l}const a=ns("MINUS",t),n=ns("MINUS",s);return typeof a=="bigint"||typeof n=="bigint"?Ie("MINUS",a)-Ie("MINUS",n):a-n},e2=({values:e})=>{const[t]=be(e,"PERCENT",1),s=Pe("PERCENT",t);if(s==null)throw new G(70);return s/100},rp=({values:e})=>{const[t,s]=be(e,"POWER",2),i=Pe("POWER",t),r=Pe("POWER",s);if(i==null||r==null)throw new G(71);return Math.pow(i,r)},t2=({values:e})=>{let t=0,s=0,i=!0;for(const a of rs(e)){const n=Pe("AVG",a);n!=null&&(t+=n,s++,i&&(i=as(a)))}if(s===0)throw new G(58);const r=t/s;return i?vr(r):r},s2=({values:e})=>{let t=!0;const s=[];for(const a of rs(e)){const n=Pe("MEDIAN",a);if(n==null)throw new G(59);s.push(n),t&&(t=as(a))}if(s.length===0)throw new G(60);s.sort((a,n)=>a-n);const i=Math.floor(s.length/2),r=s.length%2===1?s[i]:(s[i-1]+s[i])/2;return t?vr(r):r},i2=()=>Math.random(),r2=({args:e})=>{const[t,s,i]=MV(e,"SUMIF",2,3);if(!Kn(t))throw new G(61);if(!Xh(s))throw new G(62);if(i&&!Kn(i))throw new G(63);const r=Jh(s.value);if(!i){let u=0,h=null;for(const p of t)if(r(p)){const g=ns("SUMIF",p);typeof g=="bigint"?(h??(h=Ie("SUMIF",u)),h+=g):h!=null?h+=Ie("SUMIF",g):u+=g}return h??u}const a=t.rowEnd-t.rowStart,n=i.rowEnd-i.rowStart;if(a!==n)throw new G(64);const o=t[Symbol.iterator](),l=i[Symbol.iterator]();let c=0,d=null;for(;;){const u=o.next(),h=l.next();if(u.done||h.done){if(u.done!==h.done)throw new G(64);break}if(r(u.value)){const p=ns("SUMIF",h.value);typeof p=="bigint"?(d??(d=Ie("SUMIF",c)),d+=p):d!=null?d+=Ie("SUMIF",p):c+=p}}return d??c},Yn=({values:e})=>{let t="";for(const s of e)if(s!=null)switch(typeof s){case"string":{t+=s;break}case"number":{t+=String(s);break}case"boolean":{t+=s?"TRUE":"FALSE";break}case"object":{t+=s.toString();break}default:throw new G(67)}return t},ap={IF:jV,NOW:BV,TODAY:VV,PRODUCT:ip,SUM:jn,ADD:jn,SUMIF:r2,POWER:rp,MIN:YV,MAX:qV,AVERAGE:t2,MEDIAN:s2,COUNT:GV,COUNTA:OV,COUNTBLANK:_V,COUNTIF:NV,RAND:i2,CONCAT:Yn,CONCATENATE:Yn,"+":jn,"-":QV,"*":ip,"/":JV,"^":rp,"%":e2,"=":HV,"&":Yn,"<>":zV,">":UV,">=":WV,"<":KV,"<=":$V},a2=class{constructor(e,t,s,i){this.rowNode=e,this.column=t,this.formulaString=s,this.beans=i,this.error=null,this.ast=null,this.astStale=!0,this._value=void 0,this._valueStale=!0}setFormulaString(e){this.formulaString!==e&&(this.formulaString=e,this.astStale=!0,this._valueStale=!0)}setComputedValue(e){this._value=e,this._valueStale=!1,this.error=null}setError(e){this.error=e,this._valueStale=!1}isValueReady(){return!this._valueStale}getValue(){return this.error?.type??this._value}getError(){return this.error}getAst(){if(!this.astStale)return this.ast;const e=Bn(this.beans,this.formulaString);return this.ast=e??null,this.astStale=!1,this.ast}},n2=class extends ZB{constructor(){super(...arguments),this.beanName="formula",this.cachedResult=new WeakMap,this.colRefMap=new Map,this.functionNames=null,this.active=!1}setFormulasActive(e){const s=e.list.some(i=>i.isAllowFormula())&&this.checkForIncompatibleServices(e);s!==this.active&&(this.active=s,this.refreshFormulas(!0))}checkForIncompatibleServices(e){return this.gos.get("masterDetail")?(ss(295,{blockedService:"Master Detail"}),!1):this.gos.get("treeData")?(ss(295,{blockedService:"Tree Data"}),!1):this.gos.get("enableCellExpressions")?(ss(295,{blockedService:"Cell Expressions"}),!1):e.list.every(t=>t.isAllowPivot()||t.isPivotActive()?(ss(295,{blockedService:"Column Pivoting"}),!1):t.isAllowRowGroup()||t.isRowGroupActive()?(ss(295,{blockedService:"Row Groups"}),!1):t.isAllowValue()||t.isValueActive()||t.getAggFunc()?(ss(295,{blockedService:"Value Aggregation"}),!1):!0)}postConstruct(){this.setupFunctions();const e=()=>{this.active&&this.refreshFormulas(!0)},t=()=>{this.active&&this.setupColRefMap()};this.addManagedPropertyListeners(["masterDetail","enableCellExpressions"],s=>{const{colModel:i}=this.beans;i.cols?.list.some(a=>a.isAllowFormula())&&i.refreshAll(JB(s.source))}),this.addManagedListeners(this.beans.eventSvc,{modelUpdated:e,cellValueChanged:e,rowDataUpdated:e,newColumnsLoaded:t,columnMoved:t})}updateFormulaByOffset(e){const{value:t,rowDelta:s=0,columnDelta:i=0,useRefFormat:r=!0}=e,{beans:a}=this;try{const n=!r,o=Bn(a,t,n);return tp(a,o,s,i,n),Kh(a,o,r,n)}catch{return t}}setupFunctions(){this.supportedOperations=new Map,Object.keys(ap).forEach(t=>{this.supportedOperations.set(t,ap[t])}),this.functionNames=null;const e=this.gos.get("formulaFuncs");e&&Object.keys(e).forEach(t=>{this.supportedOperations.set(t.toUpperCase(),e[t].func)})}getFunctionNames(){if(this.functionNames)return this.functionNames;const e=[];for(const t of this.supportedOperations.keys())hr(t[0])&&[...t].every(s=>js(s))&&e.push(t);return e.sort((t,s)=>t.localeCompare(s)),this.functionNames=e,e}setupColRefMap(){if(!this.active){this.colRefMap=new Map;return}const e="abcdefghijklmnopqrstuvwxyz",t=e.length,s=this.beans.colModel.getCols(),i=new Map;let r=0;s?.forEach(a=>{if(!a.isPrimary())return;let n="",o=r++;for(;n=e[o%t]+n,!(o<t);)o=Math.floor(o/t)-1;a.formulaRef!==n.toUpperCase()&&(a.formulaRef=n.toUpperCase(),a.dispatchColEvent("formulaRefChanged","api")),i.set(n.toUpperCase(),a)}),this.colRefMap=i,this.refreshFormulas(!0)}getColByRef(e){return this.colRefMap.get(e.toUpperCase())??null}getColRef(e){for(const[t,s]of this.colRefMap.entries())if(s===e)return t;return null}refreshFormulas(e){this.cachedResult=new WeakMap,e&&this.beans.rowRenderer.refreshCells({suppressFlash:!0,force:!0})}isFormula(e){return this.active&&QB(e)}normaliseFormula(e,t=!1){const{beans:s}=this;try{const i=Bn(s,e);return Kh(s,i,!t,!1)}catch{return null}}getFormulaError(e,t){return this.cachedResult.get(t)?.get(e)?.error??null}getFunction(e){return this.supportedOperations.get(e.toUpperCase())}ensureCellFormula(e,t){let s=this.cachedResult.get(e),i=s?.get(t);if(i)return i;const r=this.getFormulaFromDataSource(e,t)??this.fetchRawValue(t,e);return typeof r!="string"||r[0]!=="="?null:(i=new a2(e,t,r,this.beans),s||(s=new Map,this.cachedResult.set(e,s)),s.set(t,i),i)}getFormulaFromDataSource(e,t){const s=this.beans.formulaDataSvc;if(s?.hasDataSource())return s.getFormula({column:t,rowNode:e})}coerceFormulaValue(e,t){const s=this.beans.dataTypeSvc?.getBaseDataType(e);if(s==="bigint")return this.toBigIntValue(t)??t;if(s==="number"&&typeof t=="bigint"){const i=Number(t);return Number.isFinite(i)?i:t}return t}toBigIntValue(e){return typeof e=="bigint"?e:typeof e=="number"?!Number.isFinite(e)||!Number.isInteger(e)?null:BigInt(e):null}fetchRawValue(e,t){return this.beans.valueSvc.getValue(e,t,"data")}getVisitorContext(){if(this.activeCtx)return this.activeCtx;const e=new Map,t=(r,a)=>{let n=e.get(r);if(n?.has(a))throw new G(51);n||(n=new Set,e.set(r,n)),n.add(a)},s=(r,a)=>{const n=e.get(r);n&&(n.delete(a),n.size===0&&e.delete(r))},i=r=>{for(const[a,n]of e)for(const o of n)this.ensureCellFormula(a,o)?.setError(r)};return this.activeCtx={setVisited:s,setVisiting:t,errorAllVisitors:i}}makeFormulaFrame(e){const s=this.ensureCellFormula(e.row,e.column).getAst();if(!s)throw new G(52);const i=AV(this.beans,s,this.ensureCellFormula.bind(this));return{address:e,ast:s,unresolvedDepIterator:i}}resolveValue(e,t){const s=this.ensureCellFormula(t,e);if(!s)return this.fetchRawValue(e,t);if(s.isValueReady())return s.getValue();const i=!!this.activeCtx,{setVisited:r,setVisiting:a,errorAllVisitors:n}=this.getVisitorContext(),o=[];try{for(a(t,e),o.push(this.makeFormulaFrame({row:t,column:e}));o.length;){const{address:l,ast:c,unresolvedDepIterator:d}=o[o.length-1],{row:u,column:h}=l,p=this.ensureCellFormula(u,h);if(p.isValueReady()){if(o.pop(),r(u,h),p.error)throw p.error;continue}const g=d.next();if(!g.done){const v=g.value,S=this.ensureCellFormula(v.row,v.column);if(!S||S.isValueReady())continue;a(v.row,v.column),o.push(this.makeFormulaFrame(v));continue}const f=jh(this.beans,c,v=>{const S=this.ensureCellFormula(v.row,v.column);if(S){if(!S.isValueReady())throw new G(53);const b=S.getError();if(b)throw b;return S.getValue()}return this.fetchRawValue(v.column,v.row)},{row:u,column:h}),m=this.coerceFormulaValue(h,f),C=p.getError();if(C)throw r(u,h),C;p.setComputedValue(m),r(u,h),o.pop()}if(!s.isValueReady())throw new G(53);return s.getValue()}catch(l){const c=l instanceof G?l:new G(String(l?.message??l));return n(c),c.type}finally{i||(this.activeCtx=null)}}},np={moduleName:"Formula",version:D,userComponents:{agFormulaCellEditor:UB},beans:[n2,YB,XB],dependsOn:[dn],css:[WB]};import{_preInitErrMsg as o2}from"ag-grid-community";var l2=".ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}";import{Component as c2,RefPlaceholder as d2,_batchCall as u2}from"ag-grid-community";var qn=Symbol("WrappedFunctionMarker"),op=(e,t)=>{if(e[qn])return e;const s=(...i)=>t(e,...i);return s[qn]=qn,s};function h2(e){return{content:`${e.xValue} ${e.yValue}`}}function p2(e){return{content:`${e.yValue}`}}var g2=class extends c2{constructor(){super({tag:"div",cls:"ag-sparkline-wrapper",children:[{tag:"span",ref:"eSparkline"}]}),this.eSparkline=d2,this.cachedWidth=0,this.cachedHeight=0,this.dataRef=[],this.processedData=[]}postConstruct(){this.env=this.beans.environment,this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes","styleNonce"],()=>this.refresh(this.params))}createListener(e=!0){return()=>this.updateSize(this.params?.column?.getActualWidth()??0,(this.params?.node.rowHeight??0)-2,e)}initGridObserver(){const e=this.createListener(),t=this.createListener(!1),s=this.params?.column,i=this.params?.node;s.__addEventListener("columnStateUpdated",e),i.__addEventListener("heightChanged",e),this.addDestroyFunc(()=>{s.__removeEventListener("columnStateUpdated",e),i.__removeEventListener("heightChanged",e)}),t()}updateSize(e,t,s=!0){if(e-=this.env.getCellPadding(),e!==this.cachedWidth||t!==this.cachedHeight){this.cachedWidth=e,this.cachedHeight=t;const i=this.refresh.bind(this);s?u2(()=>this.isAlive()&&i()):i()}}init(e){this.params=e,this.initGridObserver()}refresh(e=this.params){var t;this.params=e;const s=this.cachedWidth,i=this.cachedHeight,r=this.gos.get("styleNonce");if(!this.sparklineInstance&&e&&s>0&&i>0){if(this.sparklineOptions={container:this.eSparkline,width:s,height:i,...e.sparklineOptions,...r?{styleNonce:r}:{},data:this.processData(e.value)},(t=this.sparklineOptions).type??(t.type="line"),this.sparklineOptions.tooltip?.renderer)this.wrapTooltipRenderer();else{const n=this.getDefaultTooltipRenderer();this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:n}}const a=this.sparklineOptions?.theme;return this.sparklineOptions.type==="bar"&&this.sparklineOptions.itemStyler?this.wrapItemStyler(this.sparklineOptions):a?.overrides?.bar?.series?.itemStyler&&this.wrapItemStyler(a.overrides.bar.series),this.sparklineInstance=e.createSparkline(this.sparklineOptions),!0}else if(this.sparklineInstance)return this.sparklineInstance.update({...this.sparklineOptions,data:this.processData(e?.value),width:s,height:i,...r?{styleNonce:r}:{}}),!0;return!1}processData(e){return e?.length?(this.dataRef!==e&&(this.dataRef=e,this.processedData=Array.isArray(e[0])?e.filter(t=>t!=null):e),this.processedData):e??[]}createContext(){return{data:this.params?.data,cellData:this.params?.value}}getDefaultTooltipRenderer(e){const t=e?.title,s=this.sparklineOptions.xKey,i=Array.isArray(this.sparklineOptions.data?.[0]);return!t&&(s||i)?h2:p2}wrapItemStyler(e){e.itemStyler=op(e.itemStyler,(t,s)=>t({...s,context:this.createContext()}))}wrapTooltipRenderer(){this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:op(this.sparklineOptions.tooltip.renderer,(e,t)=>{const s=e({...t,context:this.createContext()});return typeof s=="string"?s:{...this.getDefaultTooltipRenderer(s)(t),...s}})}}destroy(){super.destroy(),this.sparklineInstance?.destroy()}},lp="Sparklines",cp={moduleName:lp,version:D,dependsOn:[B],validate:()=>({isValid:!1,message:o2(258)}),with:e=>(e.setup(),{moduleName:lp,version:D,dependsOn:[B],css:[l2],userComponents:{agSparklineCellRenderer:{classImp:g2,params:{createSparkline:e.createSparkline}}},validate:()=>({isValid:!0})})},f2=".ag-find-cell{display:block;overflow:hidden;text-overflow:ellipsis}.ag-find-match{background-color:var(--ag-find-match-background-color);color:var(--ag-find-match-color)}.ag-find-active-match{background-color:var(--ag-find-active-match-background-color);color:var(--ag-find-active-match-color)}";function m2(e){e.findSvc?.next()}function C2(e){e.findSvc?.previous()}function v2(e){return e.findSvc?.totalMatches??0}function S2(e,t,s){e.findSvc?.goTo(t,s)}function b2(e){e.findSvc?.clearActive()}function y2(e){return e.findSvc?.activeMatch}function w2(e,t){const{node:s,column:i}=t;return e.findSvc?.getNumMatches(s,i)??0}function x2(e,t){return e.findSvc?.getParts(t)??[]}function F2(e){return e.findSvc?.refresh(!0)}import{Component as R2,_clearElement as A2,_createElement as M2,_toString as dp}from"ag-grid-community";var T2={tag:"span",cls:"ag-find-cell"},P2=class extends R2{constructor(){super(T2)}init(e){this.refresh(e)}refresh(e){const{node:t,column:s}=e,{findSvc:i,valueSvc:r}=this.beans,{value:a,valueFormatted:n}=r.getValueForDisplay({column:s,node:t,includeValueFormatted:!0,from:"edit"}),o=n??a??"",l=this.getGui();A2(l);const c=i?.getParts({value:o,node:t,column:s??null});if(!c)l.textContent=dp(o)??"",l.classList.remove("ag-find-cell-active-match");else{let d=!1;for(const{value:u,match:h,activeMatch:p}of c){const g=dp(u)??"";if(h){const f=M2({tag:"mark",cls:"ag-find-match"});f.textContent=g,p&&(f.classList.add("ag-find-active-match"),d=!0),l.appendChild(f)}else l.appendChild(document.createTextNode(g))}l.classList.toggle("ag-find-cell-active-match",d)}return!0}};import{BeanStub as I2,_addGridCommonParams as up,_debounce as E2,_isClientSideRowModel as hp,_isFullWidthGroupRow as D2,_jsonEquals as L2,_missing as Xn,_toString as pp,isSpecialCol as k2}from"ag-grid-community";function gp(e){return e?.toLocaleLowerCase()}function Ys(e,t,s){const i=t(pp(s));let r=0;if(i?.length){let a=-1;for(;a=i.indexOf(e,a+1),a!=-1;)r++}return r}var G2=class extends I2{constructor(){super(...arguments),this.beanName="findSvc",this.active=!1,this.topMatches=new Map,this.topNodes=[],this.topNumMatches=0,this.centerMatches=new Map,this.centerNodes=[],this.centerNumMatches=0,this.bottomMatches=new Map,this.bottomNodes=[],this.caseFormat=gp,this.scrollOnRefresh=!1,this.totalMatches=0}postConstruct(){if(!hp(this.gos))return;const e=this.refresh.bind(this,!1),t=this.refresh.bind(this,!0),s=E2(this,()=>{this.isAlive()&&t()},0);this.refreshDebounced=s,this.addManagedPropertyListener("findSearchValue",e),this.addManagedPropertyListener("findOptions",({currentValue:r,previousValue:a})=>{L2(r,a)||e()}),this.addManagedPropertyListeners(["groupSuppressBlankHeader","showOpenedGroup"],t),this.addManagedEventListeners({modelUpdated:t,displayedColumnsChanged:t,pinnedRowDataChanged:t,cellValueChanged:s,rowNodeDataChanged:s,cellEditingStopped:s,cellEditValuesChanged:s,batchEditingStopped:s});const i=this.beans.rowSpanSvc;i&&this.addManagedListeners(i,{spannedCellsUpdated:s}),e()}next(){this.findAcrossContainers(!1,["top",null,"bottom"],1,1)}previous(){this.findAcrossContainers(!0,["bottom",null,"top"],this.totalMatches,-1)}goTo(e,t){if(!t&&e===this.activeMatch?.numOverall)return;const{topMatches:s,topNumMatches:i,centerMatches:r,centerNumMatches:a,bottomMatches:n}=this;if(e<=i){this.goToInContainer(s,e,0);return}if(e<=a){this.goToInContainer(r,e,i);return}this.goToInContainer(n,e,i+a)}clearActive(){this.activeMatch&&this.setActive(void 0)}isMatch(e,t){return this.active&&!!this.getMatches(e.rowPinned).get(e)?.some(([s])=>s===t)}getNumMatches(e,t){return this.getMatches(e.rowPinned).get(e)?.find(([s])=>s===t)?.[1]??0}getParts(e){const{value:t,node:s,column:i,precedingNumMatches:r}=e,a=this.findSearchValue,n=pp(t)??"";if(Xn(a))return[{value:n}];const o=this.caseFormat(n)??"",l=this.getActiveMatchNum(s,i)-(r??0);let c=0,d=0;const u=a.length,h=[];for(;;){const p=o.indexOf(a,c);if(p!=-1){d++,p>c&&h.push({value:n.slice(c,p)});const g=p+u;h.push({value:n.slice(p,g),match:!0,activeMatch:d===l}),c=g}else return c<n.length&&h.push({value:n.slice(c)}),h}}registerDetailGrid(e,t){const s=this.gos;if(!hp(s))return;const i=()=>s.get("findOptions")?.searchDetail,r=a=>{const o=this.centerMatches.get(e)?.[0]?.[1]??0;a!==o&&this.refreshDebounced()};t.addEventListener("findChanged",a=>{t.isDestroyed()||!this.isAlive()||!this.active||!i()||r(a.totalMatches)}),t.addEventListener("gridPreDestroyed",()=>{if(!this.isAlive()||!this.active||!i())return;const a=e.parent,n=this.findSearchValue;if(!a||!n)return;const o=s.get("detailCellRendererParams")?.getFindMatches?.({node:a,data:a.data,findSearchValue:s.get("findSearchValue"),updateMatches:this.refreshDebounced,getMatchesForValue:l=>Ys(n,this.caseFormat,l)})??0;r(o)}),i()&&t.setGridOption("findSearchValue",s.get("findSearchValue"))}refresh(e){const t=new Set([...this.topNodes,...this.centerNodes,...this.bottomNodes]);this.topNodes=[],this.centerNodes=[],this.bottomNodes=[];const{topNodes:s,topMatches:i,centerMatches:r,centerNodes:a,bottomNodes:n,bottomMatches:o,beans:{gos:l,visibleCols:c,rowModel:d,valueSvc:u,pinnedRowModel:h,pagination:p,rowSpanSvc:g,masterDetailSvc:f,colModel:m},findSearchValue:C}=this,v=l.get("findOptions"),S=v?.caseSensitive?O=>O??void 0:gp;this.caseFormat=S;const b=l.get("findSearchValue"),y=S(b?.trim());this.findSearchValue=y,i.clear(),r.clear(),o.clear();const w=e?this.activeMatch:void 0;this.activeMatch=void 0;const M=l.get("masterDetail")&&v?.searchDetail&&f;if(Xn(y)){if(this.active=!1,this.topNumMatches=0,this.centerNumMatches=0,this.totalMatches=0,this.refreshRows(t),M){const O=f.store;for(const dt of Object.keys(O))O[dt]?.api?.findClearActive()}Xn(C)||this.dispatchFindChanged();return}const T=c.allCols,F=l.getCallback("isFullWidthRow"),I=l.get("detailCellRendererParams"),E=l.get("fullWidthCellRendererParams"),P=l.get("groupRowRendererParams"),N=Dd(l),k=m.isPivotMode();let A=0,L,_,j=!1;const W=(O,dt,We,Er)=>{if(!We)return;let V=L.get(O);V||(V=[],L.set(O,V),_.push(O),Er||t.add(O)),V.push([dt,We]),A+=We},Z=O=>{if(j){let V=O.rowIndex,X=O.parent;for(;V==null&&X;)V=X.rowIndex,X=X.parent;if(V==null||!p.isRowInPage(V))return}const dt=O.hasChildren();if(!Gd(N,O,dt,k,Ld(N,O,dt),kd(N,O,dt)))return;const We=O.data;if(F?.({rowNode:O})){if(E){const V=E.getFindMatches?.({node:O,data:We,findSearchValue:b,updateMatches:this.refreshDebounced,getMatchesForValue:X=>Ys(y,S,X)})??0;W(O,null,V)}return}if(D2(l,O,k)){let V;const X=P?.getFindText;if(X){const Mt=u.getValueForDisplay({node:O,from:"batch"}).value;V=X(up(l,{value:Mt,node:O,data:We,column:null,colDef:null,getValueFormatted:()=>{const{valueFormatted:Tt}=u.getValueForDisplay({node:O,includeValueFormatted:!0,from:"batch"});return Tt}}))}else{const{value:Mt,valueFormatted:Tt}=u.getValueForDisplay({node:O,includeValueFormatted:!0,from:"batch"});V=Tt??Mt}const ke=Ys(y,S,V);W(O,null,ke);return}const Er=O.level>0&&l.get("groupHideOpenParents")&&O.parent?.getFirstChild()===O&&!O.parent?.expanded;for(const V of T){if(k2(V))continue;const X=g?.getCellSpan(V,O);if(X&&X.firstNode!==O||V.colDef.showRowGroup&&Er)continue;let ke;const Mt=V.colDef,Tt=Mt.getFindText;if(Tt){const Dr=u.getValueForDisplay({column:V,node:O,from:"batch"}).value;ke=Tt(up(l,{value:Dr,node:O,data:We,column:V,colDef:Mt,getValueFormatted:()=>{const{valueFormatted:Lr}=u.getValueForDisplay({column:V,node:O,includeValueFormatted:!0,from:"batch"});return Lr}}))}else{const{value:Dr,valueFormatted:Lr}=u.getValueForDisplay({column:V,node:O,includeValueFormatted:!0,from:"batch"});ke=Lr??Dr}const Vg=Ys(y,S,ke);W(O,V,Vg)}if(O.master&&M){const V=O.detailNode;if(V){const X=V.detailGridInfo?.api;if(X){X.setGridOption("findSearchValue",b);const ke=X.findGetTotalMatches();W(V,null,ke);return}}if(I){const X=I.getFindMatches?.({node:O,data:We,findSearchValue:b,updateMatches:this.refreshDebounced,getMatchesForValue:ke=>Ys(y,S,ke)})??0;W(V??{parent:O,dummy:!0},null,X,!V)}}};L=i,_=s,h?.forEachPinnedRow("top",Z),this.topNumMatches=A;let Ce=A;L=r,_=a,A=0,j=!!p&&!!v?.currentPageOnly,d.forEachNodeAfterFilterAndSort(Z,!0),this.centerNumMatches=A,Ce+=A,L=o,_=n,A=0,j=!1,h?.forEachPinnedRow("bottom",Z),Ce+=A,this.totalMatches=Ce,this.active=!0,this.refreshRows(t),w&&this.resetActiveMatch(w),this.dispatchFindChanged()}resetActiveMatch(e){const{column:t,numInMatch:s}=e;let i=e.node;if(i.dummy){const c=i.parent?.detailNode;if(!c)return;i=c}const r=i.rowPinned??null;if(!this.getMatches(r)?.get(i)?.some(([c,d])=>c===t&&d>=s))return;let n=0;r==null?n=this.topNumMatches:r==="bottom"&&(n=this.topNumMatches+this.centerNumMatches),(()=>{const c=this.getMatches(r);for(const d of c.keys()){const u=d===i,h=c.get(d);for(const[p,g]of h){if(u&&p===t){n+=s;return}n+=g}}})();const l={...e,node:i,numOverall:n};this.activeMatch=l,this.refreshRows(new Set([i]),t==null?void 0:new Set([t])),this.scrollOnRefresh&&(this.scrollOnRefresh=!1,this.scrollToActive(l)),this.setDetailActive(l)}refreshRows(e,t){e.size&&this.beans.rowRenderer.refreshCells({rowNodes:[...e],columns:t?[...t]:void 0,force:!0,suppressFlash:!0})}findAcrossContainers(e,t,s,i){if(!this.totalMatches){this.setActive();return}const r=this.activeMatch;let a=t;if(r){const{column:n,node:o,numInMatch:l,numOverall:c}=r,d=o.rowPinned??null,u=c+i;if(this.findInContainer(d,e,u,o,n,l))return;const p=t.indexOf(d),g=t.length;if(t.slice(p+1,g).some(m=>this.findInContainer(m,e,u)))return;a=t.slice(0,p+1)}a.some(n=>this.findInContainer(n,e,s))}findInContainer(e,t,s,i,r,a){const n=this.getMatches(e),o=this.getRowNodes(e),l=t?-1:1;if(i!=null){const h=n.get(i),p=h?.findIndex(([f])=>f===r);if(p!=null&&p!=-1){const[f,m]=h[p];if(t?a>1:a<m)return this.setActive({column:f,node:i,numInMatch:a+l,numOverall:s}),!0}const g=p!=null&&p!=-1?h?.[p+l]:void 0;if(g){const[f,m]=g;return this.setActive({column:f,node:i,numInMatch:t?m:1,numOverall:s}),!0}}let c;if(i==null)c=o[t?o.length-1:0];else{const h=o.findIndex(p=>p===i);c=o[h+l]}if(c==null)return!1;const d=n.get(c),u=d?.[t?d.length-1:0];if(u){const[h,p]=u;return this.setActive({column:h,node:c,numInMatch:t?p:1,numOverall:s}),!0}return!1}dispatchFindChanged(){const{eventSvc:e,activeMatch:t,totalMatches:s,findSearchValue:i}=this;e.dispatchEvent({type:"findChanged",activeMatch:t,totalMatches:s,findSearchValue:i})}setActive(e){if(e&&e.node.rowIndex==null){const s=e.node;let i=s.footer?s.sibling:s.parent;for(;i&&i.level!==-1;)i.expanded=!0,i=i.parent;this.activeMatch=e,this.scrollOnRefresh=!0,this.beans.expansionSvc?.onGroupExpandedOrCollapsed();return}const t=this.activeMatch;this.activeMatch=e,this.refreshAndScrollToActive(e,t),e&&this.setDetailActive(e),this.dispatchFindChanged()}setDetailActive({node:e,numInMatch:t}){e.detail&&e.detailGridInfo?.api?.findGoTo(t)}refreshAndScrollToActive(e,t){if(e||t){const s=new Set,i=new Set;let r=!1;const a=n=>{if(!n)return;const{node:o,column:l}=n;s.add(o),l==null?r=!0:i.add(l)};a(e),a(t),this.refreshRows(s,r?void 0:i)}e&&this.scrollToActive(e)}scrollToActive({node:{rowPinned:e,rowIndex:t},column:s}){const{ctrlsSvc:i,pagination:r,gos:a}=this.beans,n=i.getScrollFeature();e==null&&t!=null&&(r&&!a.get("findOptions")?.currentPageOnly&&!r.isRowInPage(t)&&r.goToPageWithIndex(t),n.ensureIndexVisible(t)),n.ensureColumnVisible(s)}goToInContainer(e,t,s){let i=s;for(const r of e.keys()){const a=e.get(r);for(const[n,o]of a){if(t<=i+o){this.setActive({column:n,node:r,numInMatch:t-i,numOverall:t});return}i+=o}}}getMatches(e){return e==="top"?this.topMatches:e==="bottom"?this.bottomMatches:this.centerMatches}getRowNodes(e){return e==="top"?this.topNodes:e==="bottom"?this.bottomNodes:this.centerNodes}getActiveMatchNum(e,t){const s=this.activeMatch;return s!=null&&s.node===e&&s.column===t?s.numInMatch:0}destroy(){this.topMatches.clear(),this.topNodes.length=0,this.centerMatches.clear(),this.centerNodes.length=0,this.bottomMatches.clear(),this.bottomNodes.length=0,this.activeMatch=void 0,super.destroy()}},O2={moduleName:"FindCore",version:D,rowModels:["clientSide"],beans:[G2],userComponents:{agFindCellRenderer:P2},css:[f2]},fp={moduleName:"Find",version:D,apiFunctions:{findGetTotalMatches:v2,findGoTo:S2,findNext:m2,findPrevious:C2,findGetActiveMatch:y2,findGetNumMatches:w2,findGetParts:x2,findClearActive:b2,findRefresh:F2},dependsOn:[B,O2]};import{_EditCoreModule as _2}from"ag-grid-community";import{_isClientSideRowModel as N2,_warn as B2}from"ag-grid-community";function V2({editSvc:e,gos:t,rowModel:s}){if(!N2(t,s)){B2(289,{rowModelType:t.get("rowModelType")});return}e?.startBatchEditing()}function H2({editSvc:e}){e?.stopBatchEditing({cancel:!0,source:"api",forceCancel:!0})}function z2({editSvc:e}){e?.stopBatchEditing({source:"api",forceStop:!0,commit:!0})}function U2(e){return e.editSvc?.isBatchEditing()??!1}var mp={moduleName:"BatchEdit",version:D,beans:[],apiFunctions:{isBatchEditing:U2,startBatchEdit:V2,cancelBatchEdit:H2,commitBatchEdit:z2},dependsOn:[_2,B],css:[]};import{_PopupModule as W2,_SharedDragAndDropModule as K2,_preInitErrMsg as Cp}from"ag-grid-community";import{BeanStub as $2}from"ag-grid-community";var j2=class extends $2{constructor(e){super(),this.beanName="agChartsExports",this.isEnterprise=!1,this.create=e.create,this._Theme=e._Theme,this._Scene=e._Scene,this.isEnterprise=e.isEnterprise,this._Util=e._Util}};import{BeanStub as Y2}from"ag-grid-community";import{_parseDateTimeFromString as q2}from"ag-grid-community";function vp(e){return e.chart!=null?e.chart:e}var X2=new Set(["__proto__","constructor","prototype"]);function nt(e,t,s){if(e==null)return s;const i=t.split(".");let r=e;for(;i.length>1;)if(r=r[i.shift()],r==null)return s;const a=r[i[0]];return a??s}function Z2(e,t,s){if(e==null)return;const i=t.split(".");let r=e;i.filter(a=>!X2.has(a)).forEach((a,n)=>{r[a]||(r[a]={}),n<i.length-1&&(r=r[a])}),r[i[i.length-1]]=s}var J2={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},Q2=new Set(["columnLineCombo","areaColumnCombo","customCombo"]),eH=["grouped","stacked","normalized"],Sp={area:{isCartesian:!0,canInvert:!0},bar:{isCartesian:!0,canInvert:!0},histogram:{isCartesian:!0},line:{isCartesian:!0,canInvert:!0},pie:{isPie:!0},donut:{isPie:!0,canInvert:!0},scatter:{isCartesian:!0},bubble:{isCartesian:!0},"radial-column":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radial-bar":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radar-line":{isPolar:!0,isEnterprise:!0,canInvert:!0},"radar-area":{isPolar:!0,isEnterprise:!0,canInvert:!0},nightingale:{isPolar:!0,isEnterprise:!0,canInvert:!0},"range-bar":{isCartesian:!0,isStatistical:!0,isEnterprise:!0,canSwitchDirection:!0},"range-area":{isCartesian:!0,isStatistical:!0,isEnterprise:!0},"box-plot":{isCartesian:!0,isStatistical:!0,isEnterprise:!0,canSwitchDirection:!0},treemap:{isEnterprise:!0,isHierarchical:!0},sunburst:{isEnterprise:!0,isHierarchical:!0},heatmap:{isCartesian:!0,isEnterprise:!0},waterfall:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},funnel:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},"cone-funnel":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},pyramid:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0}};function tH(e){return!!Sp[e]}function Zn(e){return Q2.has(e)}function He(e,t){return!!Sp[e]?.[t]}function sH(e){return He(z(e),"isEnterprise")}var iH=new Set(["stackedColumn","normalizedColumn","stackedBar","normalizedBar"]);function rH(e){return iH.has(e)}function ot(e){return He(e,"isCartesian")}function Jn(e){return e==="funnel"||e==="cone-funnel"||e==="pyramid"}function Qn(e){return He(e,"isPolar")}function aH(e){return He(e,"isRadial")}function Ft(e){return He(e,"isHierarchical")}function nH(e){return He(e,"isStatistical")}function qs(e){return e==="doughnut"?"donut":e}function bp(e){return J2[e]}function z(e){return bp(e)??"line"}function yp(e){return He(e,"isPie")}function oH(e){return e==="pie"||e==="waterfall"||e==="histogram"||e==="funnel"||e==="coneFunnel"||e==="pyramid"}function eo(e){return Ft(z(e))?void 0:1}function Sr(e){return Ft(z(e))?2:oH(e)?1:void 0}function wp(e){return!Zn(e)&&He(z(e),"canInvert")}function lH(e){return He(z(e),"canSwitchDirection")}function to(e){switch(e){case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":case"stackedLine":case"normalizedLine":case"stackedArea":case"normalizedArea":return`${e}Full`;case"doughnut":return"donut";case"areaColumnCombo":return"AreaColumnCombo";default:return e}}import{_warn as cH}from"ag-grid-community";var xp=["number","category","grouped-category","log","time"];function dH(e){switch(e){case"bar":case"stackedBar":case"normalizedBar":return["number","category"];case"groupedBar":return["number","grouped-category"];case"column":case"stackedColumn":case"normalizedColumn":case"line":case"stackedLine":case"normalizedLine":case"area":case"stackedArea":case"normalizedArea":case"histogram":return["category","number"];case"groupedColumn":return["grouped-category","number"];case"scatter":case"bubble":return["number","number"];default:return}}function uH(e,t,s,i,r){const{chartOptionsToRestore:a,chartPaletteToRestore:n,chartThemeToRestore:o,agChartsExports:l}=e,c=CH(e),d=so(c,l._Theme),u=d?{baseTheme:c}:Fp(e,c)??{},h=e.getGridOptionsChartThemeOverrides(),p=e.apiChartThemeOverrides,g=z(e.chartType),f=e.crossFiltering?pH(t,e,g):void 0,v=[d?fH(e,s,(()=>{const S=b=>b?Object.keys(b).some(y=>nt(b[y],"title.enabled",!1)):!1;return S(h)||S(p)})()):void 0,mH(),i,f,h,p,{...a??{}},r].filter(S=>!!S).reduce((S,b)=>({baseTheme:S,overrides:b}),u);if(n&&c===o){const S=e.agChartsExports._Theme.getChartTheme(u).palette;hH(n,S)||(v.palette=n)}return v}function hH(e,t){const s=(i,r)=>i===r?!0:i?.length!==r?.length?!1:i?.every((a,n)=>a===r?.[n])??!1;return s(e.fills,t.fills)&&s(e.strokes,t.strokes)}function so(e,t){return Object.keys(t.themes).includes(e)}function pH(e,t,s){const r={tooltip:{delay:500},legend:{listeners:{legendItemClick:n=>{const o=e.getChart(),l=[n.seriesId,`${n.seriesId}-filtered-out`];for(const c of o.series.filter(d=>l.includes(d.id)))c.toggleSeriesItem(void 0,"category",n.itemId,void 0)}}},listeners:{click:n=>t.crossFilterCallback(n,!0)}};if(s==="pie"||s==="donut")return{[s]:{series:{fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},.7]},{$value:"$1"}]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},.7]},{$value:"$1"}]}]}},...r}};const a={};return s!=="line"&&(a.fill={$if:[{$isEven:[{$value:"$index"}]},{$palette:"fill"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"fill"}]},{$ref:"backgroundColor"},.7]}]}),{[s]:{series:{stroke:{$if:[{$isEven:[{$value:"$index"}]},{$palette:"stroke"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"stroke"}]},{$ref:"backgroundColor"},.7]}]},...a},...r}}}var gH=xp.reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});function fH(e,t,s){const i=e.getExtraPaddingDirections();return{common:{...t?{animation:{duration:500}}:void 0,axes:gH,padding:{top:!s&&i.includes("top")?40:20,right:i.includes("right")?30:20,bottom:i.includes("bottom")?40:20,left:i.includes("left")?30:20}}}}function mH(){return{pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function CH(e){let t=e.getChartThemeName();const s=e.getChartThemes();return s.includes(t)||(t=s[0]),t}function Fp(e,t){const{customChartThemes:s}=e,i=s?.[t];return i||cH(140,{name:t}),i}function io(e){const t={unhighlightedSeries:{opacity:1},highlightedItem:{strokeWidth:2}};return e||(t.unhighlightedItem={opacity:1}),t}var os=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.agChartsExports=e.agChartsExports,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=z(this.chartType),this.chart==null?this.chart=e.agChartsExports.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){this.getChartRef().update(this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){this.getChartRef().updateDelta({theme:{overrides:e}})}getChart(){return vp(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,s){const{chart:i}=this,r=vp(i),a=t||r.title.node.getPlainText(),{width:n,height:o}=e||{};i.download({width:n,height:o,fileName:a,fileFormat:s})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){return this.getChartOptions().theme.overrides??{}}getChartPalette(){return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=z(this.chartProxyParams.chartType);this.chart.updateDelta({theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=z(this.chartProxyParams.chartType);return nt(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return Fp(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((s,i)=>{const r=s[t],a=r?.toString?r.toString():"",n={...s};return n[t]={id:i,value:r,toString:()=>a},n})}getCommonChartOptions(e){const t=this.clearThemeOverrides?{}:this.chart?.getOptions()??{},s=this.chart!=null?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const i=this.chartProxyParams.styleNonce,r=uH(this.chartProxyParams,this,this.agChartsExports.isEnterprise,this.getChartThemeDefaults(),e??s);return{...t,mode:"integrated",...i?{styleNonce:i}:{},suppressFieldDotNotation:!0,theme:r,container:this.chartProxyParams.parentElement}}getChartThemeDefaults(){const e={enabled:!0,snap:!0,label:{enabled:!1}},t=this.agChartsExports.isEnterprise?{zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:e},category:{crosshair:e},log:{crosshair:e},time:{crosshair:e}}}:{};t.minHeight=0,t.minWidth=0,t.navigator={enabled:!1,height:18},t.context=this.chartProxyParams.context;const s={common:t};return this.setSeriesChartThemeDefaults(s),s}setSeriesChartThemeDefaults(e){const t=this.getSeriesChartThemeDefaults();t&&(e[this.standaloneChartType]=t)}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){return this.clearThemeOverrides?{}:this.chart?.getOptions().theme?.overrides??{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},lt=class extends os{constructor(){super(...arguments),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){const s=this.getAxes(e,t);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){const s=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&s?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const s=t.x.type,{categories:i,data:r}=e,[a]=i;switch(s){case"category":return this.transformCategoryData(r,a.id);case"time":return this.transformTimeData(r,a.id,a.convertTime);default:return r}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",t=>t instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,s){const[i]=e.categories;if(i?.chartDataType)return i.chartDataType===t;if(!s)return!1;const r=e.data[0];return r?s(r[i.id]):!1}transformTimeData(e,t,s){return e[0]?.[t]instanceof Date?e:e.map(r=>{const a=r[t];return typeof a=="string"?{...r,[t]:s?s(a):q2(a)}:r})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return this.crossFilteringSelectedPoints.length==0||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[s]=t.categories,i=r=>this.standaloneChartType==="area"?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?r+"-total":r:r+"-total";return e.map(r=>(r.yKey=i(r.yKey),r.listeners={seriesNodeClick:a=>{const n=a.datum[r.xKey],o=a.event.metaKey||a.event.ctrlKey;this.crossFilteringAddSelectedPoint(o,n),this.crossFilterCallback(a)}},r.marker={itemStyler:a=>{const n=a.datum[s.id],o=a.highlightState==="highlighted-item";return{fill:o?"yellow":a.fill,size:o?14:this.crossFilteringPointSelected(n)?8:0}}},this.standaloneChartType==="area"&&(r.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),this.standaloneChartType==="line"&&(r.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),r))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,s=e.fields[0].colId,i=`${s}-filtered-out`,r=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(a=>{const n=a[t.id];this.crossFilteringAllPoints.add(n);const o=this.crossFilteringPointSelected(n);return this.standaloneChartType==="area"&&r===e.chartId&&(a[`${s}-total`]=o?a[s]:a[s]+a[i]),this.standaloneChartType==="line"&&(a[`${s}-total`]=o?a[s]:a[s]+a[i]),a})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if(t!=="waterfall"&&t!=="box-plot"&&t!=="range-bar")return!1;const s=e.theme,i=r=>{const a=r?.overrides?.[t]?.series?.direction;return a!=null?a==="horizontal":typeof r?.baseTheme=="object"?i(r.baseTheme):!1};return i(s)}getSeriesChartThemeDefaults(){return{series:{highlight:io(this.crossFiltering)}}}},vH=class extends lt{getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}},SH=class extends lt{getAxes(e,t){const s=this.isHorizontal(t),i=s?"y":"x",r=s?"x":"y";return{[i]:{type:this.getXAxisType(e),position:s?"left":"bottom"},[r]:{type:"number",position:s?"bottom":"left"}}}getSeries(e){const[t]=e.categories,[s]=e.fields;return[{type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:s.colId,yName:s.displayName??void 0}]}},bH=class extends os{getUpdateOptions(e,t){return{...t,data:this.transformFunnelCategories(e),series:this.getSeries(e)}}transformFunnelCategories(e){const{data:t}=e,[{id:s}]=e.categories;return t.map((i,r)=>({...i,[s]:{name:i[s],id:r,toString:()=>String(i[s])}}))}getSeriesChartThemeDefaults(){const e={crosshair:{enabled:!1}};return{zoom:{enabled:!1},...this.chartType!=="pyramid"&&{axes:{category:e,number:e}}}}getSeries(e){const[{id:t}]=e.categories,[{colId:s}]=e.fields;return[{type:this.standaloneChartType,stageKey:t,valueKey:s}]}};import{GROUP_AUTO_COLUMN_ID as yH}from"ag-grid-community";var br="AG-GRID-DEFAULT-LABEL-KEY";function wH(e,t){const s=Rp(e,i,r);return ro(s);function i(n){return t.length}function r(n,o){const l=t[o],c=n[l];return a(c)}function a(n){return n==null?null:String(n)}}function xH(e,t){const s=Rp(e,i,r);return ro(s);function i(a){return t(a)?.length??0}function r(a,n){const o=t(a);return o&&o[n]}}function ro(e,t=null,s){const{depth:i,rootValues:r,value:a,children:n}=e;if(r)return r.map(l=>({[br]:t,...l}));if(i===0)return[{[br]:t,...a}];const o=[];for(const[l,c]of n.entries())o.push(...ro(c,l,!0));return s?[{[br]:t,children:o,...a??{}}]:o}function Rp(e,t,s){const i={depth:0,children:new Map};for(const a of e){const n=t(a);r(a,n,s,0,i)}return i;function r(a,n,o,l,c){if(l===n)return l===0?(c.rootValues||(c.rootValues=[]),c.rootValues.push(a)):c.value=a,c;{const d=o(a,l),u=c.children.get(d),h=r(a,n,o,l+1,u||{depth:0,children:new Map});return c.children.set(d,h),c.depth=Math.max(1+h.depth,c.depth),c}}}var FH=class extends os{getUpdateOptions(e,t){const{fields:s}=e,[i,r]=s;return{...t,series:this.getSeries(i,r),data:this.getData(e,i,r)}}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"}}}getSeries(e,t){return[{type:this.standaloneChartType,labelKey:br,sizeKey:e?.colId,sizeName:e?.displayName??void 0,colorKey:t?.colId,colorName:t?.displayName??void 0}]}getData(e,t,s){const{categories:i,data:r,groupData:a,grouping:n}=e;if(n){const o=s?r.concat(a?.map(l=>{const c={...l};return delete c[t.colId],c})??[]):r;return xH(o,l=>l[yH]?.value??null)}else{const o=i.map(({id:l})=>l);return wH(r,o)}}},RH=class extends os{getAxes(e){const t=this.standaloneChartType==="radial-bar";return{angle:{type:t?"angle-number":"angle-category"},radius:{type:t?"radius-category":"radius-number"}}}getSeries(e){const{fields:t,categories:s,seriesGroupType:i}=e,[r]=s,a=this.standaloneChartType==="radial-bar",n=this.getSeriesGroupTypeOptions(i);return t.map(o=>({type:this.standaloneChartType,angleKey:a?o.colId:r.id,angleName:a?o.displayName??void 0:r.name,radiusKey:a?r.id:o.colId,radiusName:a?r.name:o.displayName??void 0,...n}))}getSeriesGroupType(){const e=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(e))return;const t=this.getChart().series?.[0]?.properties.toJson(),s=()=>t.normalizedTo?"normalized":"stacked";return e==="nightingale"?t.grouped?"grouped":s():t.stacked?s():"grouped"}getUpdateOptions(e,t){const s=this.getAxes(e);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){if(t.angle.type==="angle-category"||t.radius.type==="radius-category"){const[i]=e.categories;return this.transformCategoryData(e.data,i.id)}else return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:e==="grouped"||void 0,stacked:e!=="grouped"||void 0,normalizedTo:e==="normalized"?100:void 0}:{}}getSeriesChartThemeDefaults(){return{series:{highlight:io(this.crossFiltering)}}}},AH="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY",MH="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",TH="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY";function PH(e,t){return e.reduce((s,i,r,a)=>s.concat(t(i,r,a)),new Array)}var IH=class extends os{getUpdateOptions(e,t){const s=MH,i=TH,r=AH;return{...t,series:this.getSeries(e,s,i,r),data:this.getData(e,s,i,r)}}getSeries(e,t,s,i){const[r]=e.categories;return[{type:this.standaloneChartType,yKey:i,xKey:t,colorKey:s,yName:r.name,xName:void 0,colorName:void 0}]}getData(e,t,s,i){const[r]=e.categories;return PH(e.data,(a,n)=>{const o=a[r.id],l=o==null?"":String(o),c={id:n,value:o,toString:()=>l};return e.fields.map(({colId:d,displayName:u})=>({...a,[t]:u,[s]:a[d],[i]:c}))})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"},series:{tooltip:{renderer:EH}}}}};function EH(e){const{xKey:t,yKey:s,colorKey:i,yName:r,datum:a}=e;return{title:"",data:[{label:r,value:a[s]},{label:a[t],value:i&&a[i]}].map(({label:o,value:l})=>({label:String(o),value:String(l)}))}}import{BeanStub as DH,CellRangeType as Xs,_normalizeSortType as LH,isColumnGroupAutoCol as kH}from"ag-grid-community";import{BeanStub as GH,GROUP_AUTO_COLUMN_ID as OH,_isClientSideRowModel as _H,_isServerSideRowModel as NH,_last as BH,_warn as Ap}from"ag-grid-community";var VH=class extends GH{wireBeans(e){this.sortSvc=e.sortSvc,this.gridRowModel=e.rowModel,this.colModel=e.colModel,this.valueSvc=e.valueSvc,this.pivotResultCols=e.pivotResultCols,this.rowNodeSorter=e.rowNodeSorter}getData(e){if(e.crossFiltering){if(e.grouping)return Ap(141),{chartData:[],colNames:{}};if(!_H(this.gos))return Ap(142),{chartData:[],colNames:{}}}NH(this.gos)&&e.pivoting&&this.updatePivotKeysForSSRM();const s=this.extractRowsFromGridRowModel(e);return s.chartData=this.aggregateRowsByDimension(e,s.chartData),s}extractRowsFromGridRowModel(e){const{crossFiltering:t,startRow:s,endRow:i,valueCols:r,dimensionCols:a,grouping:n,crossFilteringSort:o,combineGroupValues:l}=e;let c=[];const d={},u={},h={};let p={},g=[],f;if(t)p=this.getFilteredRowNodes(),g=this.getAllRowNodes(o),f=g.length;else{const b=this.gridRowModel.getRowCount()-1;s===i&&s===0&&a.length===0&&r.length===0?f=0:f=(i>=0?Math.min(i,b):b)-s+1}if(f>0)for(const b of r){let y=[];const w=b.getColDef().pivotKeys;w&&(y=w.slice());const M=b.getColDef().headerName;M&&y.push(M),y.length>0&&(d[b.getId()]=y)}let m=0,C=0;const v={};for(let b=0;b<f;b++){const y=t?g[b]:this.gridRowModel.getRow(b+s);if(y.footer||y.detail){m++;continue}const w={node:y};for(const M of a){const T=M.colId,F=this.colModel.getCol(T);if(F){const I=this.valueSvc.getValue(F,y,"data");if(n){const E=I?.toString?String(I.toString()):" ",P=this.getGroupLabels(y,E),N=P.slice().reverse();let k={value:N,id:C++,toString:()=>N.filter(Boolean).join(" - ")};if(l){const L=k.toString(),_=v[L];_?k=_:v[L]=k}w[T]=k,y.group&&(u[P.toString()]=b-m);const A=P.slice(1,P.length).toString();A&&(h[A]=u[A])}else w[T]=I}else w[Ee]=b+1}for(const M of r){const T=M.getColId();if(t){const F=T+"-filtered-out",I=this.valueSvc.getValue(M,y,"data");let E=I;I!=null&&(typeof I.toNumber=="function"?E=I.toNumber():typeof I.value=="number"&&(E=I.value)),p[y.id]?(w[T]=E,w[F]=e.aggFunc||e.isScatter?void 0:0):(w[T]=e.aggFunc||e.isScatter?void 0:0,w[F]=E)}else{let F=this.valueSvc.getValue(M,y,"data");F&&typeof F.value=="number"&&(F=F.value),F&&Object.prototype.hasOwnProperty.call(F,"toString")&&(F=parseFloat(F.toString())),w[T]=F!=null&&typeof F.toNumber=="function"?F.toNumber():F}}c.push(w)}let S;if(n){const b=Object.values(h),y=c;c=[],S=[];for(let w=0;w<y.length;w++)(b.includes(w)?S:c).push(y[w])}return{chartData:c,colNames:d,groupChartData:S}}aggregateRowsByDimension(e,t){const s=e.dimensionCols;if(!e.aggFunc||s.length===0)return t;const r=BH(s)?.colId,a={},n=[];for(const o of t){let l=a;for(const c of s){const d=c.colId,u=o[d];if(d===r){let h=l[u];if(!h){h={__children:[]};for(const p of s){const g=p.colId;h[g]=o[g]}l[u]=h,n.push(h)}h.__children.push(o)}else l[u]||(l[u]={}),l=l[u]}}if(this.gos.assertModuleRegistered("SharedAggregation",1))for(const o of n)for(const l of e.valueCols){const c=l.getColId();if(e.crossFiltering){const d=o.__children.filter(f=>typeof f[c]<"u").map(f=>f[c]),u=Wt({beans:this.beans,values:d,aggFuncOrString:e.aggFunc,column:l,rowNode:void 0,pivotResultColumn:void 0,aggregatedChildren:[]});o[c]=u&&typeof u.value<"u"?u.value:u;const h=`${c}-filtered-out`,p=o.__children.filter(f=>typeof f[h]<"u").map(f=>f[h]),g=Wt({beans:this.beans,values:p,aggFuncOrString:e.aggFunc,column:l,rowNode:void 0,pivotResultColumn:void 0,aggregatedChildren:[]});o[h]=g&&typeof g.value<"u"?g.value:g}else{const d=o.__children.map(h=>h[c]),u=Wt({beans:this.beans,values:d,aggFuncOrString:e.aggFunc,column:l,rowNode:void 0,pivotResultColumn:void 0,aggregatedChildren:[]});o[c]=u&&typeof u.value<"u"?u.value:u}}return n}updatePivotKeysForSSRM(){const e=this.pivotResultCols?.getPivotResultCols()?.list;if(!e)return;const t=this.extractPivotKeySeparator(e);for(const s of e)if(t==="")s.getColDef().pivotKeys=[];else{const i=s.getColId().split(t);s.getColDef().pivotKeys=i.slice(0,i.length-1)}}extractPivotKeySeparator(e){if(e.length===0)return"";const t=(i,r)=>{const a=i.getGroupId();return i.getParent()?t(i.getParent(),a):r.split(a)[1][0]},s=e[0];return s.getParent()==null?"":t(s.getParent(),s.getColId())}getGroupLabels(e,t){const s=[t];for(;e&&e.level!==0;)if(e=e.parent,e)if(e.group){const i=this.colModel.getCol(OH);if(i){const r=this.valueSvc.getValue(i,e,"data"),a=r?.toString?String(r.toString()):" ";s.push(a)}}else s.push(e.key);return s}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(e){const t=[];this.gridRowModel.forEachNode(r=>{t.push(r)});const s=this.rowNodeSorter;if(!s)return t;const i=e===!0?this.sortSvc?.getSortOptions():e;return!i||i.length==0?t:s.doFullSortInPlace(t,i)}};import{BeanStub as HH,_getRowNode as zH,_warn as Mp}from"ag-grid-community";var UH=class extends HH{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.valueSvc=e.valueSvc}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e})}getColumn(e){return this.colModel.getColDefCol(e)}getAllDisplayedColumns(){return this.beans.visibleCols.allCols}getColDisplayName(e){return this.colNames.getDisplayNameForColumn(e,"chart")}getColGroupDisplayName(e){return this.colNames.getDisplayNameForColumnGroup(e,"chart")}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getGroupDisplayColumns(){return this.beans.showRowGroupCols?.columns??[]}isPivotMode(){return this.colModel.isPivotMode()}isPivotActive(){return this.colModel.isPivotActive()}getChartColumns(){const e=this.colModel.getCols(),t=new Set,s=new Set;for(const i of e){const r=i.getColDef(),a=r.chartDataType;if(a)switch(a){case"category":case"time":t.add(i);continue;case"series":s.add(i);continue;case"excluded":continue;default:Mp(153,{chartDataType:a});break}if(r.colId==="ag-Grid-AutoColumn"){t.add(i);continue}if(!i.isPrimary()){s.add(i);continue}(this.isInferredValueCol(i)?s:t).add(i)}return{dimensionCols:t,valueCols:s}}isInferredValueCol(e){const t=e.getColId();if(t==="ag-Grid-AutoColumn")return!1;const s=zH(this.beans,{rowIndex:0,rowPinned:null});if(!s)return this.valueColsWithoutSeriesType.has(t);let i=this.valueSvc.getValue(e,s,"data");i==null&&(i=this.extractLeafData(s,e)),i!=null&&(typeof i.toNumber=="function"?i=i.toNumber():typeof i.value=="number"&&(i=i.value));const r=typeof i=="number"||e.colDef.cellDataType==="number"||["series","time"].includes(e.colDef.chartDataType);return r?this.valueColsWithoutSeriesType.add(t):i==null&&e.colDef.cellDataType!=="number"&&Mp(265,{colId:t}),r}extractLeafData(e,t){const s=e.data&&this.valueSvc.getValue(t,e,"data");if(s!=null)return s;const i=e.childrenAfterGroup;if(i)for(let r=0,a=i.length;r<a;++r){const n=i[r],o=this.extractLeafData(n,t);if(o!=null)return o}return null}destroy(){this.valueColsWithoutSeriesType.clear(),super.destroy()}};import{BeanStub as WH,_warn as ao}from"ag-grid-community";var KH=new Set(["line","groupedColumn","stackedColumn","area","stackedArea"]),$H=class extends WH{constructor(e){super(),this.suppressComboChartWarnings=!1,this.chartDataModel=e,this.seriesChartTypes=e.params.seriesChartTypes??[]}postConstruct(){this.initComboCharts()}update(e){this.seriesChartTypes=e??this.seriesChartTypes,this.initComboCharts(),this.updateSeriesChartTypes()}initComboCharts(){const e=this.seriesChartTypes&&this.seriesChartTypes.length>0;(this.chartDataModel.chartType==="customCombo"||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){if(this.chartDataModel.isComboChart()){if(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=t?!1:e.secondaryAxis,e}),this.chartDataModel.chartType==="customCombo"){this.updateSeriesChartTypesForCustomCombo();return}this.updateChartSeriesTypesForBuiltInCombos()}}updateSeriesChartTypesForCustomCombo(){!(this.seriesChartTypes&&this.seriesChartTypes.length>0)&&!this.suppressComboChartWarnings&&ao(150),this.seriesChartTypes=this.seriesChartTypes.map(i=>(KH.has(i.chartType)||(ao(151,{chartType:i.chartType}),i.chartType="line"),i));const t=i=>{(!this.savedCustomSeriesChartTypes||this.savedCustomSeriesChartTypes.length===0)&&(this.savedCustomSeriesChartTypes=this.seriesChartTypes);const r=this.savedCustomSeriesChartTypes.find(a=>a.colId===i.colId);return r||(i.selected&&!this.suppressComboChartWarnings&&ao(152,{colId:i.colId}),{colId:i.colId,chartType:"line",secondaryAxis:!1})},s=this.chartDataModel.valueColState.map(t);this.seriesChartTypes=s,this.savedCustomSeriesChartTypes=s,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel,s=e==="columnLineCombo"?"groupedColumn":"stackedArea",i=e==="columnLineCombo"?"line":"groupedColumn",r=t.filter(n=>n.selected),a=Math.ceil(r.length/2);this.seriesChartTypes=r.map((n,o)=>{const l=o>=a?i:s;return{colId:n.colId,chartType:l,secondaryAxis:!1}})}},Ee="AG-GRID-DEFAULT-CATEGORY",jH=class extends DH{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.colNames={},this.crossFiltering=!1,this.crossFilteringSort=!0,this.grouping=!1,this.useGroupColumnAsCategory=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}wireBeans(e){this.rangeSvc=e.rangeSvc,this.chartTranslation=e.chartTranslation}setParams(e){const{chartType:t,pivotChart:s,chartThemeName:i,switchCategorySeries:r,aggFunc:a,cellRange:n,suppressChartRanges:o,unlinkChart:l,crossFiltering:c,crossFilteringSort:d,seriesGroupType:u,useGroupColumnAsCategory:h}=e;this.chartType=t,this.pivotChart=s??!1,this.chartThemeName=i,this.switchCategorySeries=!!r,this.aggFunc=a,this.referenceCellRange=n,this.suppliedCellRange=n,this.suppressChartRanges=o??!1,this.unlinked=!!l,this.crossFiltering=!!c,this.crossFilteringSort=d??!0,this.seriesGroupType=u,this.useGroupColumnAsCategory=!!h}postConstruct(){this.datasource=this.createManagedBean(new VH),this.chartColSvc=this.createManagedBean(new UH),this.comboChartModel=this.createManagedBean(new $H(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:s}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(t?.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||s)&&this.comboChartModel.update(s),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:s,maintainColState:i,setColsFromRange:r}=e??{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:a,valueCols:n}=this.chartColSvc.getChartColumns(),o=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,s),this.setDimensionCellRange(a,o,t),this.setValueCellRange(n,o,r),!t&&!i&&(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const s={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,crossFilteringSort:this.getCrossFilteringSort(),valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:["scatter","bubble"].includes(this.chartType),combineGroupValues:nH(z(this.chartType))},{chartData:i,colNames:r,groupChartData:a}=this.datasource.getData(s);this.chartData=i,this.groupChartData=a,this.colNames=r,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColSvc.getRowGroupColumns(),s=e||t&&t.length>0,i=this.getSelectedDimensions().map(({colId:n})=>n),a=this.chartColSvc.getGroupDisplayColumns().map(n=>n.getColId()).some(n=>i.includes(n));return!!s&&a}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getValueColState(){return this.valueColState.map(this.displayNameMapper.bind(this))}displayNameMapper(e){const{column:t}=e;if(t){const s=this.getColDisplayName(t);e.displayName=this.isPivotMode()?this.getPivotDisplayName(t,s):s}else{const s=this.colNames[e.colId];e.displayName=s?s.join(" - "):this.getColDisplayName(t)}return e}getPivotDisplayName(e,t){let s=!1,i=[t];const r=a=>{if(!a)return;const n=this.chartColSvc.getColGroupDisplayName(a);n?.length?(i.unshift(n),r(a.getParent())):s=!0};if(r(e.getParent()),s){const a=this.colNames[e.getColId()];a&&(i=a)}return i.join(" - ")}getColDisplayName(e){return this.chartColSvc.getColDisplayName(e)}isPivotMode(){return this.chartColSvc.isPivotMode()}getChartDataType(e){const t=this.chartColSvc.getColumn(e);return t?t.getColDef().chartDataType:void 0}getConvertTime(e){const t=this.chartColSvc.getColumn(e);if(t?.colDef.cellDataType==="dateString")return this.beans.dataTypeSvc?.getDateParserFunction(t)}isPivotActive(){return this.chartColSvc.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===Xs.DIMENSION||this.referenceCellRange.startColumn==null?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return new Set(this.chartColSvc.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),new Set(e)}getRowIndexes(){let e=0,t=0;const{rangeSvc:s,valueCellRange:i,dimensionCellRange:r}=this,a=i||r;if(s&&a){e=s.getRangeStartRow(a).rowIndex;const n=s.getRangeEndRow(a);t=n.rowPinned==="bottom"?-1:n.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:e,valueCols:t}=this.chartColSvc.getChartColumns(),s=this.getAllColumnsFromRanges(),i=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const r=Ft(z(this.chartType));let a=!1,n=1;const o=this.suppliedCellRange.columns[0],l=this.gos.get("treeData"),c=l?null:this.chartColSvc.getRowGroupColumns(),d=l||c&&c.length>0;e.forEach(p=>{const g=kH(p),f=this.crossFiltering&&this.aggFunc?o.getColId()===p.getColId():this.useGroupColumnAsCategory&&d&&g||(!a||r)&&s.has(p);this.dimensionColState.push({column:p,colId:p.getColId(),displayName:this.getColDisplayName(p),selected:f,order:n++}),f&&(a=!0)});const u={colId:Ee,displayName:this.chartTranslation.translate("defaultCategory"),selected:!a,order:0};this.dimensionColState.unshift(u);const h=this.referenceCellRange.columns.filter(p=>t.has(p));t.forEach(p=>{i&&this.referenceCellRange.columns.includes(p)&&(p=h.shift()),this.valueColState.push({column:p,colId:p.getColId(),displayName:this.getColDisplayName(p),selected:s.has(p),order:n++})})}updateColumnState(e,t){const s=c=>c.colId===e.colId,{dimensionColState:i,valueColState:r}=this,a=i.find(s),n=r.find(s);if(a)if(Ft(z(this.chartType)))a.selected=e.selected;else{const d=e.selected?a:i.filter(u=>u!==a).find(({selected:u})=>u);i.forEach(u=>u.selected=u===d)}else n&&(n.selected=e.selected);const o=[...i,...r],l=[];t||(o.forEach((c,d)=>{d===e.order&&l.push(e.colId),c.colId!==e.colId&&l.push(c.colId)}),o.forEach(c=>{const d=l.indexOf(c.colId);c.order=d>=0?l.indexOf(c.colId):o.length-1})),this.reorderColState()}reorderColState(){const e=(t,s)=>t.order-s.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(e,t,s){this.dimensionCellRange=void 0;const i=Ft(z(this.chartType));if(!s&&!this.dimensionColState.length){const o=new Array;e.forEach(l=>{o.length>0&&!i||!t.has(l)||o.push(l)}),o.length>0&&(this.dimensionCellRange=this.createCellRange(Xs.DIMENSION,...o));return}let r=s?[s]:[];if(this.crossFiltering&&this.aggFunc){const o=this.suppliedCellRange.columns[0];r=this.dimensionColState.filter(l=>l.colId===o.getColId())}else(i||r.length===0||r.some(({column:o})=>!o||!e.has(o)))&&(r=this.dimensionColState.filter(o=>o.selected));const a=r.length===1?r[0].colId===Ee:!1,n=r.map(({column:o})=>o).filter(o=>o!=null);n.length>0&&!a&&(this.dimensionCellRange=this.createCellRange(Xs.DIMENSION,...n))}setValueCellRange(e,t,s){this.valueCellRange=void 0;const i=[],r=Sr(this.chartType);let a=0;if(e.forEach(n=>{s?(r==null||a<r)&&t.has(n)&&(i.push(n),a++):this.valueColState.some(o=>o.selected&&o.colId===n.getColId())&&i.push(n)}),i.length>0){let n=[];this.valueColState.length>0?n=this.valueColState.map(o=>o.colId):t.forEach(o=>n.push(o.getColId())),i.sort((o,l)=>n.indexOf(o.getColId())-n.indexOf(l.getColId())),this.valueCellRange=this.createCellRange(Xs.VALUE,...i)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:s,valueCols:i}=this.chartColSvc.getChartColumns(),r=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(s,r),t&&this.setValueCellRange(i,r)}updateSelectedDimensions(e){const t=new Set(e.map(i=>i.getColId()));if(Ft(z(this.chartType))){const i=this.dimensionColState.filter(a=>t.has(a.colId)),r=new Set(i.map(a=>a.colId));this.dimensionColState=this.dimensionColState.map(a=>({...a,selected:r.has(a.colId)}))}else{const r=(this.dimensionColState.find(a=>t.has(a.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(a=>({...a,selected:a.colId===r}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(e.length===0)return;const t=e.map(({column:s})=>s).filter(s=>s!=null);t.length>0&&(this.dimensionCellRange=this.createCellRange(Xs.DIMENSION,...t))}isComboChart(e){return Zn(e??this.chartType)}getCrossFilteringSort(){const e=this.crossFilteringSort;if(typeof e=="boolean")return e;const t=[];return e.forEach(({sort:s,colId:i})=>{const r=this.chartColSvc.getColumn(i);r&&t.push({sort:s,column:r,type:LH(r.getSortDef()?.type)})}),t}},Tp=class extends lt{getAxes(e,t){return{x:{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},y:{type:"number",position:this.isHorizontal(t)?"bottom":"left"}}}computeSeriesStatistics(e,t){const{data:s,fields:i}=e,[r]=e.categories,a=r.id||Ee,n=this.groupDataByCategory(a,s);return Array.from(n).map(([o,l])=>{const c={[r.id]:o};return i.forEach((d,u)=>{const h=l.map(g=>g[d.colId]).filter(g=>typeof g=="number"&&!isNaN(g)),p=t(h);for(const g of Object.keys(p)){const f=`${g}:${u}`;c[f]=h.length>0?p[g]:null}}),c})}groupDataByCategory(e,t){const s=i=>{if(e===Ee)return 1;const r=i[e];return r==null?"":r instanceof Date?r.getTime():r};return t.reduce((i,r)=>{const a=s(r),n=i.get(a);return n?n.push(r):i.set(a,[r]),i},new Map)}},YH=class extends Tp{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>{const s=t.sort((i,r)=>i-r);return{min:s[0],q1:this.quantile(s,.25),median:this.quantile(s,.5),q3:this.quantile(s,.75),max:s[s.length-1]}})}quantile(e,t){const s=(e.length-1)*t,i=Math.floor(s),r=s-i;return e[i+1]!==void 0?e[i]+r*(e[i+1]-e[i]):e[i]}},qH=class extends Tp{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>({min:Math.min(...t),max:Math.max(...t)}))}},XH=class extends Y2{constructor(){super(...arguments),this.beanName="enterpriseChartProxyFactory"}createChartProxy(e){switch(e.chartType){case"histogram":return new vH(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new RH(e);case"rangeBar":case"rangeArea":return new qH(e);case"boxPlot":return new YH(e);case"treemap":case"sunburst":return new FH(e);case"heatmap":return new IH(e);case"waterfall":return new SH(e);case"funnel":case"coneFunnel":case"pyramid":return new bH(e)}}};import{BeanStub as ZH,TabGuardComp as JH,_findFocusableElements as Pp,_findNextFocusableElement as QH}from"ag-grid-community";import{Component as e4}from"ag-grid-community";import{BeanStub as t4,_removeFromParent as s4}from"ag-grid-community";var Ip=class extends t4{constructor(e,t,s,i){super(),this.chartController=e,this.eGui=t,this.cssClass=s,this.createPanels=i,this.panels=[]}postConstruct(){this.addManagedListeners(this.chartController,{chartUpdated:()=>this.refreshPanels(!0),chartApiUpdate:()=>this.refreshPanels(!1)})}addComponent(e){this.createBean(e),this.panels.push(e),e.addCss(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),s=this.chartController.isGrouping(),i=z(t);e&&t===this.chartType&&s===this.isGrouping||(this.destroyPanels(),this.createPanels(t,i),this.chartType=t,this.isGrouping=s)}destroyPanels(){for(const e of this.panels)s4(e.getGui()),this.destroyBean(e);this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}};import{AgInputNumberFieldSelector as i4,Component as r4}from"ag-grid-community";var a4=class extends r4{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(`<div>
|
||
<ag-group-component data-ref="animationGroup">
|
||
<ag-input-number-field data-ref="animationHeightInput"></ag-input>
|
||
</ag-group-component>
|
||
</div>`,[H,i4],{animationGroup:e,animationHeightInput:t})}};import{AgCheckboxSelector as n4,Component as o4}from"ag-grid-community";var Ep=class extends Xr{constructor(e){super({...e,dialogCallbacks:fl})}},De={selector:"AG-COLOR-PICKER",component:Ep},l4=class extends o4{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),s=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),i=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(`<div>
|
||
<ag-group-component data-ref="crosshairGroup">
|
||
<ag-checkbox data-ref="crosshairLabelCheckbox"></ag-checkbox>
|
||
<ag-checkbox data-ref="crosshairSnapCheckbox"></ag-checkbox>
|
||
<ag-color-picker data-ref="crosshairStrokeColorPicker"></ag-color-picker>
|
||
</ag-group-component>
|
||
</div>`,[H,n4,De],{crosshairGroup:e,crosshairLabelCheckbox:t,crosshairSnapCheckbox:s,crosshairStrokeColorPicker:i})}};import{AgCheckboxSelector as c4,Component as d4}from"ag-grid-community";var u4=class extends d4{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);t.minValue=10;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(`<div>
|
||
<ag-group-component data-ref="navigatorGroup">
|
||
<ag-slider data-ref="navigatorHeightSlider"></ag-slider>
|
||
<ag-checkbox data-ref="navigatorMiniChartCheckbox"></ag-checkbox>
|
||
</ag-group-component>
|
||
</div>`,[H,le,c4],{navigatorGroup:e,navigatorHeightSlider:t,navigatorMiniChartCheckbox:s})}};import{AgCheckboxSelector as h4,Component as p4,RefPlaceholder as g4}from"ag-grid-community";var f4=class extends p4{constructor(e){super(),this.chartMenuParamsFactory=e,this.zoomScrollingStepInput=g4}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),s=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);s.step=.01,s.minValue=s.step;const i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");t.onValueChange=(r=>a=>{r&&(r(a),this.zoomScrollingStepInput.setDisabled(!a))})(t.onValueChange),this.setTemplate(`<div>
|
||
<ag-group-component data-ref="zoomGroup">
|
||
<ag-checkbox data-ref="zoomSelectingCheckbox"></ag-checkbox>
|
||
<ag-checkbox data-ref="zoomScrollingCheckbox"></ag-checkbox>
|
||
<ag-slider data-ref="zoomScrollingStepInput"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,h4,le],{zoomGroup:e,zoomScrollingCheckbox:t,zoomScrollingStepInput:s,zoomSelectingCheckbox:i}),this.zoomScrollingStepInput.setDisabled(!t.value)}},m4=["navigator","zoom","animation","crosshair"],C4=class extends e4{constructor(e){super('<div class="ag-chart-advanced-settings-wrapper"></div>'),this.chartMenuContext=e}postConstruct(){this.chartPanelFeature=this.createManagedBean(new Ip(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){for(const s of m4){if(!this.isGroupPanelShownForSeries(s,t))continue;const i=this.createPanel(s);this.chartPanelFeature.addComponent(i)}}isGroupPanelShownForSeries(e,t){return e==="animation"||ot(t)&&!Jn(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:s}=this.chartMenuContext;switch(e){case"navigator":return new u4(t);case"zoom":return new f4(t);case"animation":return new a4(t);case"crosshair":return new l4(s)}}},v4=class extends ZH{constructor(){super(...arguments),this.beanName="advSettingsMenuFactory"}showMenu(e,t){this.hideMenu();const s=this.createBean(new S4(e));this.activeDialog=this.createBean(new Fi({title:this.beans.chartTranslation.translate("advancedSettings"),component:s,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Pp(s.getGui())[0]?.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,t?.focus({preventScroll:!0})}})),this.activeMenu=s}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}},S4=class extends JH{constructor(e){super('<div class="ag-chart-advanced-settings"></div>'),this.chartMenuContext=e}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new C4(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,s=this.advancedSettingsPanel.getGui(),i=QH(this.beans,s,!1,t);if(i)i.focus();else{const r=Pp(s);r.length&&r[t?r.length-1:0].focus()}}};import{BeanStub as b4,Component as y4,RefPlaceholder as w4,_addGridCommonParams as x4,_createIconNoSpan as F4,_focusInto as R4,_isNothingFocused as A4}from"ag-grid-community";var M4=class extends b4{constructor(){super(...arguments),this.beanName="chartMenuListFactory"}wireBeans(e){this.popupSvc=e.popupSvc,this.chartMenuSvc=e.chartMenuSvc,this.chartTranslation=e.chartTranslation}showMenuList(e){const{eventSource:t,showMenu:s,chartMenuContext:i}=e,r=this.chartMenuSvc.doChartToolPanelsExist(i.chartController),a=this.mapWithStockItems(this.getMenuItems(i.chartController,r),i,s,t,r);if(!a.length)return;const n=this.createBean(new T4(a));this.activeChartMenuList=n;let o=-1,l="left";this.gos.get("enableRtl")&&(o=1,l="right");const c=n.getGui();this.popupSvc.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(n),this.activeChartMenuList=void 0,A4(this.beans)&&t.focus({preventScroll:!0})},afterGuiAttached:d=>n.afterGuiAttached(d),positionCallback:()=>{this.popupSvc.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:c,alignSide:l,nudgeX:4*o,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const s=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],i=this.gos.get("chartMenuItems");return i?Array.isArray(i)?i:i(x4(this.gos,{defaultItems:s,chartId:e.getChartId()})):s}mapWithStockItems(e,t,s,i,r){if(!e)return[];const a=[];for(const n of e){let o;if(typeof n=="string"?o=this.getStockMenuItem(n,t,s,i,r):o={...n},!o)continue;const{subMenu:l}=o;Array.isArray(l)&&(o.subMenu=this.mapWithStockItems(l,t,s,i,r)),a.push(o)}return a}getStockMenuItem(e,t,s,i,r){switch(e){case"chartEdit":return r?this.createMenuItem(this.chartTranslation.translate("chartEdit"),"chartsMenuEdit",s):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslation.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuSvc.openAdvancedSettings(t,i));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate("chartUnlink"),"unlinked",()=>this.chartMenuSvc.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslation.translate("chartLink"),"linked",()=>this.chartMenuSvc.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslation.translate("chartDownload"),"chartsDownload",()=>this.chartMenuSvc.downloadChart(t))}return null}createMenuItem(e,t,s){return{name:e,icon:F4(t,this.beans,null),action:s}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}},T4=class extends y4{constructor(e){super(`
|
||
<div data-ref="eChartsMenu" role="presentation" class="ag-menu ag-chart-menu-popup"></div>
|
||
`),this.menuItems=e,this.eChartsMenu=w4}postConstruct(){this.mainMenuList=this.createManagedBean(new Ta(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){this.hidePopupFunc?.()}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),R4(this.mainMenuList.getGui())}};import{BeanStub as P4,_warn as I4}from"ag-grid-community";var E4=class extends P4{constructor(){super(...arguments),this.beanName="chartCrossFilterSvc"}filter(e,t=!1){const s=this.beans.filterManager,i=s?.getFilterModel()??{};if(t){Object.keys(i).length>0&&s?.setFilterModel(null);return}let r=Dp(e);r.indexOf("-filtered-out")&&(r=r.replace("-filtered-out","")),this.updateFilters(i,e,r)}updateFilters(e,t,s){const i=Dp(t),r=this.convertRawValue(s,t.datum[i]);if(r===void 0)return;const a=this.beans.filterManager;a?.getColumnFilterInstance(s).then(n=>{const o=n?.filterType;let l,c=g=>g;if(o==="multi"){const g=L4(n);l=g.setFilter,c=g.processModel??c}else o==="set"&&(l=n);if(!l){I4(154,{colId:s});return}const d=t.event.metaKey||t.event.ctrlKey,u=l.getFilterHandler().getCrossFilterModel((g,f,m)=>k4(d,g(r),f,m)),h=c(u),p=d?{...e}:{};p[s]=h,a?.setFilterModel(p)})}convertRawValue(e,t){const{colModel:s,dataTypeSvc:i}=this.beans,r=s.getColById(e),a=r?.colDef;return a&&i&&a.chartDataType==="time"&&a.cellDataType==="dateString"?i.getDateFormatterFunction(r)(t):t}};function D4(e,t,s){const i=new Array(s);for(let r=0;r<s;r++)i[r]=r===t?e:null;return{filterType:"multi",filterModels:i}}function L4(e){const t=e.getNumChildFilters();for(let s=0;s<t;s++){const i=e.getChildFilterInstance(s);if(i?.filterType==="set")return{setFilter:i,processModel:r=>D4(r,s,t)}}return{}}function Dp(e){return e.xKey||e.calloutLabelKey}function k4(e,t,s,i){let r;if(e)if(s.has(t)&&(i==null||i.includes(t)))if(r=[],i==null)for(const a of s)a!==t&&r.push(a);else for(const a of i)a!==t&&s.has(a)&&r.push(a);else{if(i==null)r=Array.from(s);else{r=[];for(const a of i)s.has(a)&&r.push(a)}r.push(t)}else r=[t];return{filterType:"set",values:r}}import{BeanStub as G4,_warn as Lp}from"ag-grid-community";var O4=["chartUnlink","chartLink","chartDownload","chartMenu"],yr={settings:"chartSettings",data:"chartData",format:"chartFormat"},_4=class extends G4{constructor(){super(...arguments),this.beanName="chartMenuSvc"}wireBeans(e){this.advSettingsMenuFactory=e.advSettingsMenuFactory}downloadChart(e,t,s,i){e.chartController.getChartProxy().downloadChart(t,s,i)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advSettingsMenuFactory?.showMenu(e,t)}hideAdvancedSettings(){this.advSettingsMenuFactory?.hideMenu()}getChartToolbarOptions(){const e=["chartMenu"],t=this.gos.getCallback("getChartToolbarItems");return t?t({defaultItems:e}).filter(i=>O4.includes(i)?!0:(Lp(155,{option:i}),!1)):e}getChartToolPanels(e){const t=this.gos.get("chartToolPanelsDef");let i=t?.panels?.map(n=>{const o=yr[n];return o||Lp(156,{panel:n}),o}).filter(n=>!!n)??Object.values(yr);e.isPivotChart()&&(i=i.filter(n=>n!=="chartData"));const r=t?.defaultToolPanel,a=r&&yr[r]||i[0];return{panels:i,defaultPanel:a}}doesChartToolbarExist(){return this.getChartToolbarOptions().length>0}doChartToolPanelsExist(e){const{panels:t}=this.getChartToolPanels(e);return t.length>0}};import{BeanStub as N4}from"ag-grid-community";var B4={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",stackedLineTooltip:"Stacked",normalizedLineTooltip:"100% Stacked",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",stackedLineFull:"Stacked Line",normalizedLineFull:"100% Stacked Line",customCombo:"Custom Combination",funnel:"Funnel",coneFunnel:"Cone Funnel",pyramid:"Pyramid",funnelGroup:"Funnel",funnelTooltip:"Funnel",coneFunnelTooltip:"Cone Funnel",pyramidTooltip:"Pyramid",dropOff:"Drop-Off",stageLabels:"Stage Labels",reverse:"Reverse",tooltipMode:"Tooltip Mode",tooltipModeSingle:"Single",tooltipModeShared:"Multiple",tooltipModeCompact:"Compact",groupedColumn:"Grouped",stackedColumn:"Stacked",pie:"Pie",donut:"Donut",line:"Line",scatter:"Scatter",bubble:"Bubble",area:"Area",stackedArea:"Stacked",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",heatmap:"Heatmap",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",group:"Group",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},V4=class extends N4{constructor(){super(...arguments),this.beanName="chartTranslation"}translate(e){const t=this.getLocaleTextFunc(),s=B4[e];return t(e,s)}};import{BeanStub as H4,_focusInto as z4,_warn as wr}from"ag-grid-community";import{Component as U4,RefPlaceholder as Zs,_addGridCommonParams as W4,_clearElement as K4,_errMsg as kp,_focusGridInnerElement as $4,_focusInto as j4,_getAbsoluteHeight as Y4,_getAbsoluteWidth as q4,_mergeDeep as X4,_removeFromParent as Z4,_setDisplayed as Gp,_warn as Op}from"ag-grid-community";import{BeanStub as J4,_warn as _p}from"ag-grid-community";import{_warnOnce as Js}from"ag-grid-community";var ls=e=>t=>t==null?!0:e(t),Np=e=>typeof e=="string",no=e=>typeof e=="boolean",Q4=e=>typeof e=="object",Le=(e,t)=>s=>`AG Grid - unable to update chart as invalid params supplied: \`${e}: ${s}\`, expected ${t}.`,Bp=e=>`${e} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,e3=["doughnut"],oo=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"];function t3(e){return!!bp(e)||Zn(e)}function s3(e){return e3.includes(e)}var i3=ls(e=>{if(t3(e))return!0;if(s3(e)){const t=qs(e);return Js(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),r3=ls(e=>typeof e=="object"),a3=ls(e=>typeof e=="object"),n3=ls(e=>typeof e=="string"||typeof e=="function"),Vp=e=>({property:"chartType",validationFn:ls(t=>e||!t||!sH(t)),warnMessage:t=>Bp(`The '${t}' chart type`)}),Hp=e=>({property:"switchCategorySeries",validationFn:ls(t=>{if(!t||e)return!0}),warnMessage:()=>Bp("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0}),lo=()=>[{property:"chartId",validationFn:Np,warnMessage:Le("chartId","string")},{property:"chartType",validationFn:i3,warnMessage:Le("chartType","ChartType")},{property:"chartThemeName",validationFn:Np,warnMessage:Le("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:r3,warnMessage:Le("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:no,warnMessage:Le("unlinkChart","boolean")}],zp=e=>[{property:"cellRange",validationFn:a3,warnMessage:Le("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:no,warnMessage:Le("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:n3,warnMessage:Le("aggFunc","string or IAggFunc")},Hp(e)];function o3(e,t){switch(e.type){case"rangeChartUpdate":return c3(e,t);case"pivotChartUpdate":return d3(e);case"crossFilterChartUpdate":return u3(e,t);default:return Js(`Invalid value supplied for 'type': ${e.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}function l3(e,t){return xr(e,[Vp(t),Hp(t)])}function c3(e,t){const s=[...lo(),Vp(t),...zp(t),{property:"seriesChartTypes",validationFn:i=>i===void 0||Array.isArray(i)&&i.every(Q4),warnMessage:Le("seriesChartTypes","Array of SeriesChartType")},{property:"useGroupColumnAsCategory",validationFn:no,warnMessage:Le("useGroupColumnAsCategory","boolean")}];return xr(e,s,[...oo,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType","useGroupColumnAsCategory"],"UpdateRangeChartParams")}function d3(e){const t=[...lo()];return xr(e,t,[...oo],"UpdatePivotChartParams")}function u3(e,t){const s=[...lo(),...zp(t)];return xr(e,s,[...oo,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}function xr(e,t,s,i){let r;for(const a of t){const{property:n,validationFn:o,warnMessage:l,warnIfFixed:c}=a;if(n in e){const d=e[n],u=o(d);if(u===!0)continue;if(u===!1)return Js(l(d)),!1;r=r||{...e},r[n]=u,c&&Js(l(d))}}if(s){for(const a of Object.keys(e))if(!s.includes(a))return Js(`Unexpected property supplied. ${i} does not contain: \`${a}\`.`),!1}return r||!0}var Up=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],h3=class extends J4{constructor(e){super(),this.model=e,this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}postConstruct(){this.setChartRange(),this.model.unlinked&&this.rangeSvc&&this.rangeSvc.setCellRanges([]);const e=this.updateForGridChange.bind(this,{});this.addManagedEventListeners({cellSelectionChanged:t=>{t.id&&t.id===this.model.chartId&&this.updateForRangeChange()},columnMoved:e,columnPinned:e,columnVisible:e,columnRowGroupChanged:e,modelUpdated:e,cellValueChanged:this.updateForDataChange.bind(this),cellEditValuesChanged:this.updateForDataChange.bind(this)})}update(e){if(!this.validUpdateType(e))return!1;const t=o3(e,this.agChartsExports.isEnterprise);if(!t)return!1;const s=t===!0?e:t;return this.applyValidatedChartParams(s),!0}applyValidatedChartParams(e){const{chartId:t,chartType:s,chartThemeName:i,unlinkChart:r}=e,n={...{chartId:t,pivotChart:this.model.pivotChart,chartType:s??this.model.chartType,chartThemeName:i??this.model.chartThemeName,unlinkChart:r??this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1}};switch(e.type){case"rangeChartUpdate":n.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,n.switchCategorySeries=e.switchCategorySeries??this.model.switchCategorySeries,n.aggFunc=e.aggFunc??this.model.aggFunc,n.seriesChartTypes=e.seriesChartTypes,n.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges,n.seriesGroupType=e.seriesGroupType??this.model.seriesGroupType,n.useGroupColumnAsCategory=e.useGroupColumnAsCategory??this.model.useGroupColumnAsCategory;break;case"crossFilterChartUpdate":n.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,n.switchCategorySeries=!1,n.aggFunc=e.aggFunc??this.model.aggFunc,n.crossFiltering=!0,n.crossFilteringSort=this.model.crossFilteringSort,n.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges;break;case"pivotChartUpdate":n.switchCategorySeries=!1;break}this.model.updateModel(n),n.unlinkChart||n.suppressChartRanges?this.rangeSvc?.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:s}=e??{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:s}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const s=this.getSelectedValueColState().map(o=>({colId:o.colId,displayName:o.displayName})),i=this.getChartData(),r=this.getSelectedDimensions(),a=this.model,n={data:i,groupData:a.groupChartData,grouping:this.isGrouping(),categories:r.map(({colId:o,displayName:l})=>{const c=a.categoryAxisType??a.getChartDataType(o);return{id:o,name:l,chartDataType:c,convertTime:c==="time"?a.getConvertTime(o):void 0}}),fields:s,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:a.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(n):n}invertCategorySeriesParams(e){const[t]=e.categories,s=[{id:Ee,name:""}],i=e.data.map((a,n)=>{const o=`${t.id}:${n}`,l=a[t.id],c=l==null?"":String(l);return{colId:o,displayName:c}}),r=e.fields.map(a=>{const n={[Ee]:a.displayName};for(const[o,l]of e.data.entries()){const c=`${t.id}:${o}`,d=l[a.colId];n[c]=d}return n});return{...e,categories:s,fields:i,data:r}}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides(),chartPalette:this.chartProxy?.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType,useGroupColumnAsCategory:this.model.useGroupColumnAsCategory}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){wp(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,!t&&(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){const s=(o,l)=>{let c=0;for(const d of o)d.selected&&(c>=l?d.selected=!1:c++);c===0&&(o[0].selected=!0)},i=eo(t),r=Sr(t),a=i!=null&&(eo(e)??100)>(i??100),n=r!=null&&(Sr(e)??100)>(r??100);a&&s(this.model.dimensionColState,i),n&&s(this.model.valueColState,r),(a||n)&&(this.model.resetCellRanges(a,n),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||this.raiseChartModelUpdateEvent()}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||Up}getThemes(){return this.getThemeNames().map(t=>{const i=so(t,this.agChartsExports._Theme)?t:this.chartProxy.lookupCustomChartTheme(t);return this.agChartsExports._Theme.getChartTheme(i)})}getPalettes(){return this.getThemes().map(t=>t.palette)}getSelectedValueColState(){return this.model.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.model.getValueColState()}}setChartRange(e=!1){this.rangeSvc&&!this.model.suppressChartRanges&&!this.model.unlinked&&this.rangeSvc.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeSvc&&this.rangeSvc.setCellRanges([]):this.updateForGridChange(),this.dispatchLocalEvent({type:"chartLinkedChanged"})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return["scatter","bubble"].includes(this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(e,t,s){const i=this.model.comboChartModel.seriesChartTypes.find(r=>r.colId===e);if(i){const r=this.model.chartType!=="customCombo";r&&(this.model.chartType="customCombo");const a=i.chartType;t!=null&&(i.chartType=t),s!=null&&(i.secondaryAxis=s),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),r&&this.dispatchLocalEvent({type:"chartTypeChanged"}),a!==t&&this.dispatchLocalEvent({type:"chartSeriesChartTypeChanged"}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(t=>t.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=e??this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[z(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(e.length===0)return"bar";const t=e[0].chartType;return t==="columnLineCombo"?"bar":t==="areaColumnCombo"?"area":z(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){return e.cellRange&&this.rangeSvc?.createPartialCellRangeFromRangeParams(e.cellRange,!0)}validUpdateType(e){if(!e.type)return _p(136),!1;const t={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},s=Object.keys(t).find(r=>t[r]())??"Range Chart",i=e.type===`${s[0].toLowerCase()}${s.slice(1).replace(/ /g,"")}Update`;return i||_p(137,{currentChartType:s,type:e.type}),i}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],s=t?.startRow||null,i=t?.endRow||null;return{rowStartIndex:s?.rowIndex??null,rowStartPinned:s?.rowPinned,rowEndIndex:i?.rowIndex??null,rowEndPinned:i?.rowPinned,columns:e.reduce((r,a)=>r.concat(a.columns.map(n=>n.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){return this.model.seriesGroupType??this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){this.dispatchLocalEvent({type:"chartModelUpdate"}),this.raiseChartOptionsChangedEvent()}raiseChartUpdatedEvent(){this.dispatchLocalEvent({type:"chartUpdated"})}raiseChartApiUpdateEvent(){this.dispatchLocalEvent({type:"chartApiUpdate"})}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides()})}raiseChartRangeSelectionChangedEvent(){this.eventSvc.dispatchEvent({type:"chartRangeSelectionChanged",id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()})}destroy(){super.destroy(),this.rangeSvc&&this.rangeSvc.setCellRanges([])}},p3=class extends lt{getAxes(e){const t={x:{type:this.getXAxisType(e),position:"bottom"},y:{type:"number",position:"left"}};return this.isNormalised()&&(t.y.label={...t.y.label,formatter:s=>Math.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName,normalizedTo:this.chartType==="normalizedArea"?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(s,e):s}isNormalised(){return!this.crossFiltering&&this.chartType==="normalizedArea"}},g3=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),f3=class extends lt{getAxes(e){const t={x:{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},y:{type:"number",position:this.isHorizontal()?"bottom":"left"}};return this.isNormalised()&&(t.y.label={...t.y.label,formatter:s=>Math.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||rH(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(s):s}extractCrossFilterSeries(e){const t=[];for(let s=0;s<e.length;s++){const r={...e[s],listeners:{seriesNodeClick:this.crossFilterCallback}},a={...r,yKey:`${r.yKey}-filtered-out`,showInLegend:!1};t.push(r),t.push(a)}return t}isNormalised(){const e=["normalizedColumn","normalizedBar"];return!this.crossFiltering&&e.includes(this.chartType)}isHorizontal(){return g3.has(this.chartType)}},m3=class extends lt{getAxes(e){const t={x:{type:this.getXAxisType(e),position:"bottom"},y:{type:"number",position:"left"}};return this.isNormalised()&&(t.y.label={...t.y.label,formatter:s=>Math.round(s.value)+"%"}),t}getSeries(e){const[t]=e.categories,s=["normalizedLine","stackedLine"].includes(this.chartType),i=e.fields.map(r=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:r.colId,yName:r.displayName,normalizedTo:s&&this.isNormalised()?100:void 0,stacked:s}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){const e=["normalizedLine"];return!this.crossFiltering&&e.includes(this.chartType)}},C3=class extends lt{getAxes(e){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}getSeries(e){const[t]=e.categories,s=this.isPaired(),i=this.getSeriesDefinitions(e.fields,s),r=t.id===Ee?void 0:t,a=i.map(n=>n?.sizeField?{type:"bubble",xKey:n.xField.colId,xName:n.xField.displayName??void 0,yKey:n.yField.colId,yName:n.yField.displayName??void 0,title:`${n.yField.displayName} vs ${n.xField.displayName}`,sizeKey:n.sizeField.colId,sizeName:n.sizeField.displayName??"",labelKey:r?r.id:n.yField.colId,labelName:r?r.name:void 0}:{type:"scatter",xKey:n.xField.colId,xName:n.xField.displayName??void 0,yKey:n.yField.colId,yName:n.yField.displayName??void 0,title:`${n.yField.displayName} vs ${n.xField.displayName}`,labelKey:r?r.id:n.yField.colId,labelName:r?r.name:void 0});return this.crossFiltering?this.extractCrossFilterSeries(a,e):a}extractCrossFilterSeries(e,t){const{data:s}=t,i=l=>`${l}-filtered-out`,r=(l,c)=>{const d=[1/0,-1/0];if(c!=null)for(const u of l){const h=u[c]??u[i(c)];h<d[0]&&(d[0]=h),h>d[1]&&(d[1]=h)}if(d[0]<=d[1])return d},a=l=>{let c;if(l.type==="bubble"){const{sizeKey:d}=l;c=r(s,d)}return{...l,domain:c,highlight:{highlightedItem:{fill:"yellow"}},listeners:{...l.listeners,seriesNodeClick:this.crossFilterCallback}}},n=l=>{const{yKey:c,xKey:d}=l;let u={};return l.type==="bubble"&&(u={sizeKey:i(l.sizeKey)}),{...l,...u,yKey:i(c),xKey:i(d),showInLegend:!1,listeners:{...l.listeners,seriesNodeClick:h=>{const p=h.datum[i(d)],g={...h,xKey:d,datum:{...h.datum,[d]:p}};this.crossFilterCallback(g)}}}},o=e.map(a);return[...o,...o.map(n)]}getSeriesDefinitions(e,t){if(e.length<2)return[];const s=this.chartType==="bubble";if(t)return s?e.map((r,a)=>a%3===0?{xField:r,yField:e[a+1],sizeField:e[a+2]}:null).filter(r=>r?.yField&&r.sizeField):e.map((r,a)=>a%2===0?{xField:r,yField:e[a+1]}:null).filter(r=>r?.yField);const i=e[0];return s?e.map((r,a)=>a%2===1?{xField:i,yField:r,sizeField:e[a+1]}:null).filter(r=>r?.sizeField):e.filter((r,a)=>a>0).map(r=>({xField:i,yField:r}))}},v3=class extends lt{getAxes(e){const t=e?e.fields:[],s=new Map(t.map(n=>[n.colId,n])),{primaryYKeys:i,secondaryYKeys:r}=this.getYKeys(t,e.seriesChartTypes),a={x:{type:this.getXAxisType(e),position:"bottom"}};return i.length>0&&(a.y={type:"number",position:"left"}),r.length>0&&r.forEach(n=>{const o=s.get(n);if(!(o&&o.colId===n))return;const c={type:"number",position:"right"};a[`y_${n}`]=c}),a}getSeries(e){const{fields:t,seriesChartTypes:s}=e,[i]=e.categories;return t.map(r=>{const a=s.find(n=>n.colId===r.colId);if(a){const n=a.chartType,l=["groupedColumn","groupedBar"].includes(n)?{grouped:!0}:{},c=a.secondaryAxis?`y_${r.colId}`:"y";return{type:z(n),xKey:i.id,yKey:r.colId,yName:r.displayName,yKeyAxis:c,stacked:["stackedArea","stackedColumn"].includes(n),...l}}})}getYKeys(e,t){const s=[],i=[];for(const r of e){const a=r.colId,n=t.find(o=>o.colId===a);n&&(n.secondaryAxis?i.push(a):s.push(a))}return{primaryYKeys:s,secondaryYKeys:i}}setSeriesChartThemeDefaults(e){const t=this.getSeriesChartThemeDefaults();if(!t)return;const s=new Set;for(const i of this.chartProxyParams.seriesChartTypes)s.add(i.chartType);for(const i of s)e[z(i)]=t}};function S3(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const s=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:s}}var b3=class extends os{getUpdateOptions(e,t){return{...t,data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)}}getSeries(e){const[t]=e.categories,s=e.fields.length,i={currentOffset:0,offsetAmount:s>1?20:40},r=this.getFields(e).map(a=>{const n={type:this.standaloneChartType,angleKey:a.colId,angleName:a.displayName,sectorLabelKey:a.colId,calloutLabelName:t.name,calloutLabelKey:t.id};if(this.chartType==="donut"||this.chartType==="doughnut"){const{outerRadiusOffset:o,innerRadiusOffset:l}=S3(i),c=a.displayName?{title:{text:a.displayName,showInLegend:s>1}}:void 0;return{...n,type:"donut",outerRadiusOffset:o,innerRadiusOffset:l,...c}}return n});return this.crossFiltering?this.extractCrossFilterSeries(r):r}getCrossFilterData(e){const t=e.fields[0].colId,s=`${t}-filtered-out`;return e.data.map(i=>{const r=i[t]+i[s];return i[`${t}-total`]=r,i[s]=1,i[t]=i[t]/r,i})}extractCrossFilterSeries(e){const t=e[0],s=t.angleKey,i={...t,radiusMin:0,radiusMax:1,listeners:{seriesNodeClick:this.crossFilterCallback},legendItemKey:t.calloutLabelKey,angleKey:`${s}-total`},r={...i,radiusKey:s,sectorLabelKey:`${s}-total`};return[{...i,radiusKey:`${s}-filtered-out`,showInLegend:!1},r]}getFields(e){return this.chartType==="pie"?e.fields.slice(0,1):e.fields}getSeriesChartThemeDefaults(){return{series:{highlight:io(this.crossFiltering)}}}};import{AgPromise as y3,Component as w3,_warn as x3}from"ag-grid-community";import{Component as F3,RefPlaceholder as R3,_clearElement as A3,_createElement as M3,_createIconNoSpan as T3}from"ag-grid-community";var P3=class extends F3{constructor(){super('<div class="ag-chart-menu" data-ref="eMenu"></div>'),this.eMenu=R3,this.buttonListenersDestroyFuncs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){for(const s of this.buttonListenersDestroyFuncs)s?.();this.buttonListenersDestroyFuncs=[];const t=this.eMenu;A3(t);for(const s of e){const{buttonName:i,iconName:r,callback:a}=s,n=this.createButton(r),o=this.chartTranslation.translate(i+"ToolbarTooltip");o&&n instanceof HTMLElement&&(n.title=o),this.buttonListenersDestroyFuncs.push(...this.addManagedElementListeners(n,{click:l=>a(l.currentTarget)})),t.appendChild(n)}}createButton(e){const t=T3(e,this.beans);t.classList.add("ag-chart-menu-icon");const s=M3({tag:"button",attrs:{type:"button"},cls:"ag-chart-menu-toolbar-button"});return s.appendChild(t),s}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}};import{AgPromise as I3,Component as E3,_createElement as Wp}from"ag-grid-community";import{AgToggleButton as D3,Component as L3,_getDocument as k3,_setDisplayed as G3,_warn as O3}from"ag-grid-community";import{AgSelect as _3,AgToggleButton as N3}from"ag-grid-community";import{AgSelect as B3,Component as V3}from"ag-grid-community";import{AgSelect as H3,Component as z3,DragSourceType as Kp,_escapeString as U3,_getActiveDomElement as W3,_removeFromParent as K3}from"ag-grid-community";var $3=".ag-pill-select{display:flex;flex-direction:column}.ag-pill-select .ag-column-drop-list{padding:0}:where(.ag-pill-select){.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}",j3=class extends z3{constructor(e){super('<div class="ag-pill-select" role="presentation"></div>'),this.config=e??{};const{selectedValueList:t,valueFormatter:s,valueList:i}=this.config;this.selectedValues=t??[],this.valueList=i??[],this.valueFormatter=s??(r=>U3(r)),this.registerCSS($3)}postConstruct(){const{ariaLabel:e,onValuesChange:t,dragSourceId:s}=this.config;this.dropZonePanel=this.createManagedBean(new q3({getValues:()=>this.selectedValues,setValues:r=>this.updateValues(r),isDraggable:()=>this.selectedValues.length>1},r=>this.valueFormatter(r),e,s)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),t!=null&&(this.onValuesChange=t)}setValues(e,t){const{added:s,removed:i,updated:r}=this.getChanges(this.valueList,e);let a=!1;return(s.length||i.length||r.length)&&(a=!0),this.valueList=e,this.updateValues(t,a,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new H3({options:e,placeholder:t,onValueChange:s=>this.addValue(s),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){const e=[],{maxSelection:t}=this.config;if(t&&this.selectedValues.length>=t)return e;for(const s of this.valueList)this.selectedValues.includes(s)||e.push({value:s,text:this.valueFormatter(s)});return e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,s){const i=this.selectedValues;this.selectedValues=e;const r=this.getChanges(i,e),a=t||r.added.length||r.removed.length,n=W3(this.beans),o=this.eSelect?.getGui().contains(n),l=this.dropZonePanel?.getGui().contains(n);s||this.onValuesChange?.(r);const c=a?!this.refreshSelect():!1;this.dropZonePanel.refreshGui(),a&&o&&(c?this.dropZonePanel.focusList(!0):this.eSelect?.getFocusableElement().focus()),l&&!e.length&&this.eSelect?.getFocusableElement().focus()}getChanges(e,t){const s=t.filter(a=>!e.includes(a)),i=e.filter(a=>!t.includes(a)),r=t.filter((a,n)=>e[n]!==a);return{added:s,removed:i,updated:r,selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(K3(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}},Y3=class extends Oc{constructor(e,t,s,i,r,a){super(t,s,!1),this.value=e,this.valueFormatter=i,this.draggable=r,this.sourceId=a}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return Kp.ChartPanel}getDragSourceId(){return this.sourceId}isMovable(){return this.isDraggable()}isDraggable(){return this.draggable}},q3=class extends kc{constructor(e,t,s,i){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=s,this.sourceId=i}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||this.sourceId!=null&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?"move":"notAllowed"}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,s){return new Y3(e,t,s,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===Kp.ChartPanel}},$p=class extends V3{constructor(e,t,s,i){super(i),this.chartController=e,this.allowMultipleSelection=t,this.maxSelection=s}wireBeans(e){this.chartTranslation=e.chartTranslation}addItem(e){this.groupComp.addItem(e)}createGroup(e,t,s,i,r){if(this.allowMultipleSelection){const a=e.filter(n=>n.selected);this.valuePillSelect=this.groupComp.createManagedBean(new j3({valueList:e,selectedValueList:a,valueFormatter:t,selectPlaceholder:this.chartTranslation.translate(s),dragSourceId:i,onValuesChange:n=>this.onValueChange(n),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const a=this.createValueSelectParams(e);a.onValueChange=n=>{for(const o of e)o.selected=!1;n.selected=!0,n.colId===Ee&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:n,skipAnimation:r?.()})},this.valueSelect=this.groupComp.createManagedBean(new B3(a)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:s}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(s,!0)}createValueSelectParams(e){let t;return{options:e.map(i=>{const r=i.displayName??"";return i.selected&&(t=i),{value:i,text:r}}),value:t}}onValueChange({added:e,updated:t,removed:s,selected:i}){let r,a;const n=()=>{i.forEach((o,l)=>{o.order=l}),a=!0};e.length?(r=e[0],r.selected=!0,n()):s.length?(r=s[0],r.selected=!1):t.length&&(n(),r=t[0]),r&&this.chartController.updateForPanelChange({updatedColState:r,resetOrder:a})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}},X3="sum",Z3=class extends $p{constructor(e,t,s,i,r){super(e,s,void 0,'<div id="categoriesGroup"></div>'),this.title=t,this.dimensionCols=i,this.isOpen=r}postConstruct(){this.groupComp=this.createBean(new Ae({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.createGroup(this.dimensionCols,e=>e.displayName??"","categoryAdd","categorySelect",()=>!this.chartController.getAggFunc()),this.createAggFuncControls(this.dimensionCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc())}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new N3({label:this.chartTranslation.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:t!=null,onValueChange:s=>{const i=s?X3:void 0;this.chartController.setAggFunc(i),this.aggFuncSelect?.setValue(i,!0),this.aggFuncSelect?.setDisplayed(i!=null)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new _3({options:[{value:"sum",text:this.chartTranslation.translate("sum")},{value:"first",text:this.chartTranslation.translate("first")},{value:"last",text:this.chartTranslation.translate("last")},{value:"min",text:this.chartTranslation.translate("min")},{value:"max",text:this.chartTranslation.translate("max")},{value:"count",text:this.chartTranslation.translate("count")},{value:"avg",text:this.chartTranslation.translate("avg")}],value:typeof t=="string"?t:void 0,onValueChange:s=>{this.chartController.setAggFunc(s)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){const i=e.filter(r=>r.selected).some(r=>r.colId!==Ee);this.aggFuncToggle?.setValue(t!=null),this.aggFuncSelect?.setValue(typeof t=="string"?t:void 0,!0),this.aggFuncToggle?.setDisplayed(i),this.aggFuncSelect?.setDisplayed(i&&t!=null)}clearAggFuncControls(){this.aggFuncToggle=this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};import{AgSelect as jp,AgToggleButton as J3,Component as Q3,RefPlaceholder as ez}from"ag-grid-community";import{BeanStub as tz}from"ag-grid-community";var Rt=class extends tz{constructor(e){super(),this.chartOptionsProxy=e}wireBeans(e){this.chartTranslation=e.chartTranslation}getDefaultColorPickerParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t??"color"),labelWidth:"flex",inputWidth:"flex",labelAlignment:"top",pickerGap:6},s)}getDefaultNumberInputParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t),labelAlignment:"top",labelWidth:"flex",inputWidth:"flex",precision:s?.precision,step:s?.step,min:s?.min,max:s?.max},{parseInputValue:i=>{const r=Number(i);return isNaN(r)?void 0:r},formatInputValue:i=>i==null?"":`${i}`})}getDefaultSliderParams(e,t,s,i){let r=this.chartOptionsProxy.getValue(e)??0;i&&Array.isArray(r)&&(r=r[0]);const a=this.getDefaultSliderParamsWithoutValueParams(r,t,s);return a.onValueChange=n=>this.chartOptionsProxy.setValue(e,i?[n]:n),a}getDefaultSliderParamsWithoutValueParams(e,t,s){return{label:this.chartTranslation.translate(t),minValue:0,maxValue:Math.max(e,s),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=a=>{this.chartOptionsProxy.setValue(e,typeof a=="boolean"?a:void 0)},r}getDefaultToggleParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=a=>{this.chartOptionsProxy.setValue(e,typeof a=="boolean"?a:void 0)},r}getDefaultSelectParams(e,t,s){return this.getDefaultSelectParamsWithoutValueParams(t,s,this.chartOptionsProxy.getValue(e),i=>{this.chartOptionsProxy.setValue(e,i)})}getDefaultSelectParamsWithoutValueParams(e,t,s,i){return{label:this.chartTranslation.translate(e),labelAlignment:"top",options:t,pickerGap:6,value:s,onValueChange:i}}getDefaultFontPanelParams(e,t){const s=i=>`${e}.${i}`;return this.addEnableParams(s("enabled"),{name:this.chartTranslation.translate(t),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this,keyMapper:s})}addValueParams(e,t,s){const i=this.chartOptionsProxy.getValue(e);return t.value=s?.formatInputValue?s.formatInputValue(i):i,t.onValueChange=r=>{const a=s?.parseInputValue?s.parseInputValue(r):r;this.chartOptionsProxy.setValue(e,a)},t}addEnableParams(e,t){return t.enabled=this.chartOptionsProxy.getValue(e)??!1,t.onEnableChange=s=>this.chartOptionsProxy.setValue(e,s),t}getChartOptions(){return this.chartOptionsProxy}},sz=class extends Q3{constructor(e,t){super(),this.chartMenuContext=e,this.isOpen=t,this.chartSpecificGroup=ez,this.hasContent=!1}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){const t={title:this.getTitle(),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen,items:[...this.createDirectionSelect(),this.createReverseSelect(),this.createGroupTypeSelect()]};this.setTemplate(`
|
||
<div id="chartSpecificGroup">
|
||
<ag-group-component data-ref="chartSpecificGroup"></ag-group-component>
|
||
</div>`,[H],{chartSpecificGroup:t}),this.setDisplayed(this.hasContent)}refresh(){this.hasContent=!1,this.chartSpecificGroup.setTitle(this.getTitle()),this.updateDirectionSelect(),this.updateReverseSelect(),this.updateGroupTypeSelect(),this.setDisplayed(this.hasContent)}getTitle(){const e=this.chartMenuContext.chartController.getChartType();return this.chartTranslation.translate(to(e))}createDirectionSelect(){if(!this.chartSvc.isEnterprise())return[];const{chartOptionsService:e,chartController:t}=this.chartMenuContext,s=e.getSeriesOptionsProxy(()=>z(t.getChartType())),i=this.createManagedBean(new Rt(s)),r=["horizontal","vertical"].map(o=>({value:o,text:this.chartTranslation.translate(o)})),a=i.getDefaultSelectParams("direction","direction",r),n=a.onValueChange;return a.onValueChange=o=>{n(o),t.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new jp(a)),this.updateDirectionSelect(),[this.directionSelect]}createReverseSelect(){const{chartMenuParamsFactory:e}=this.chartMenuContext,t=e.getDefaultToggleParams("series.reverse","reverse");return this.reverseToggle=this.createManagedBean(new J3(t)),this.updateReverseSelect(),this.reverseToggle}updateReverseSelect(){const e=this.chartMenuContext.chartController.getChartType()==="pyramid";this.updateDisplayed(this.reverseToggle,e)}updateDirectionSelect(){const e=lH(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.directionSelect,e)}createGroupTypeSelect(){const{chartController:e,chartMenuParamsFactory:t}=this.chartMenuContext;return this.groupTypeSelect=this.createManagedBean(new jp(t.getDefaultSelectParamsWithoutValueParams("seriesGroupType",eH.map(s=>({value:s,text:this.chartTranslation.translate(`${s}SeriesGroupType`)})),e.getSeriesGroupType(),s=>e.setSeriesGroupType(s)))),this.updateGroupTypeSelect(),this.groupTypeSelect}updateGroupTypeSelect(){const e=["radialColumn","radialBar","nightingale"].includes(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.groupTypeSelect,e)}updateDisplayed(e,t){e?.setDisplayed(t),e&&(this.hasContent=this.hasContent||t)}};import{AgCheckbox as iz,AgSelect as rz,Component as az,_areEqual as nz,_clearElement as oz}from"ag-grid-community";var lz=class extends az{constructor(e,t,s){super('<div id="seriesChartTypeGroup"></div>'),this.chartController=e,this.columns=t,this.isOpen=s,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){nz(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),oz(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.postConstruct()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(s=>s.selected&&!!t.filter(i=>i.colId===s.colId)[0]).map(({colId:s})=>s)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new Ae({title:this.chartTranslation.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();for(const s of e){if(!s.selected)continue;const i=t.filter(c=>c.colId===s.colId)[0];if(!i)continue;this.selectedColIds.push(s.colId);const r=this.seriesChartTypeGroupComp.createManagedBean(new Ae({title:s.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),a=c=>["groupedColumn","stackedColumn","stackedArea"].includes(c),n=this.seriesChartTypeGroupComp.createManagedBean(new iz({label:this.chartTranslation.translate("secondaryAxis"),labelWidth:"flex",disabled:a(i.chartType),value:!!i.secondaryAxis,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,void 0,c)}));r.addItem(n);const o=["line","area","stackedArea","groupedColumn","stackedColumn"].map(c=>({value:c,text:this.chartTranslation.translate(to(c))})),l=r.createManagedBean(new rz({options:o,value:i.chartType,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,c)}));r.addItem(l),this.seriesChartTypeGroupComp.addItem(r),this.chartTypeComps.set(s.colId,l),this.secondaryAxisComps.set(s.colId,n)}this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();for(const t of this.selectedColIds){const s=e.find(a=>a.colId===t);if(!s)continue;const i=this.chartTypeComps.get(t),r=this.secondaryAxisComps.get(t);i?.setValue(s.chartType),r?.setValue(!!s.secondaryAxis),r?.setDisabled(this.isSecondaryAxisDisabled(s.chartType))}}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}};import{AgToggleButton as cz}from"ag-grid-community";var dz=class extends $p{constructor(e,t,s,i,r,a,n){super(e,i,r,'<div id="seriesGroup"></div>'),this.chartOptionsService=t,this.title=s,this.valueCols=a,this.isOpen=n}postConstruct(){if(this.groupComp=this.createBean(new Ae({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new cz({label:this.chartTranslation.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:t=>{this.chartOptionsService.setPairedMode(!!t),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.createGroup(this.valueCols,this.generateGetSeriesLabel(this.valueCols),"seriesAdd","seriesSelect"),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(e)),this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e)}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return a=>a.displayName??"";const t=e.filter(a=>a.selected),s=this.chartController.getChartType()==="bubble",i=this.chartOptionsService.getPairedMode(),r=new Map;return r.set(0,"X"),r.set(1,"Y"),r.set(2,"size"),a=>{const n=a.displayName??"";if(!a.selected)return n;const o=t.indexOf(a);if(o===-1)return n;let l;return i?l=r.get(o%(s?3:2)):o===0?l="X":l=s&&o%2===0?"size":"Y",`${n} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},uz={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0},{type:"chartSpecific",isOpen:!0}]},hz=class extends L3{constructor(e){super('<div class="ag-chart-data-wrapper ag-scrollable-container"></div>'),this.chartMenuContext=e,this.isSwitchCategorySeriesToggled=!1,this.restoreSwitchCategorySeriesToggleFocus=!1,this.panels=[],this.chartController=e.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){this.createSwitchCategorySeriesToggle(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.updatePanels();const e=this.updatePanels.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:e,chartApiUpdate:e})}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){const e=this.chartType,t=this.isSwitchCategorySeriesToggled,{dimensionCols:s,valueCols:i}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const r=this.isSwitchCategorySeriesToggled!==t;this.canRefresh(e,this.chartType)&&!r?(this.categoriesDataPanel?.refresh(s),this.seriesDataPanel?.refresh(i),this.seriesChartTypePanel?.refresh(i),this.chartSpecificPanel?.refresh()):this.recreatePanels(s,i);const a=wp(this.chartType)&&this.chartSvc.isEnterprise()&&!this.chartController.isGrouping();G3(this.switchCategorySeriesToggle.getGui(),a),r&&this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched()),this.restoreSwitchCategorySeriesToggleFocus&&(this.restoreSwitchCategorySeriesToggleFocus=!1,a&&this.switchCategorySeriesToggle.getFocusableElement().focus())}canRefresh(e,t){if(e===void 0)return!1;if(e===t)return!0;const s=i=>["columnLineCombo","areaColumnCombo","customCombo"].includes(i);return!!(s(e)&&s(t))}recreatePanels(e,t){this.clearPanelComponents();const{chartType:s}=this;if(!s)return;const i=this.chartController.isCategorySeriesSwitched();this.getDataPanelDef().groups?.forEach(({type:r,isOpen:a})=>{r===(i?"series":"categories")?(this.categoriesDataPanel=this.createBean(new Z3(this.chartController,this.getCategoryGroupTitle(i),this.getCategoryGroupMultipleSelect(s,i),e,a)),this.panels.push(this.categoriesDataPanel)):r===(i?"categories":"series")?(this.seriesDataPanel=this.createBean(new dz(this.chartController,this.chartMenuContext.chartOptionsService,this.getSeriesGroupTitle(i),this.getSeriesGroupMultipleSelect(s,i),this.getSeriesGroupMaxSelection(s,i),t,a)),this.panels.push(this.seriesDataPanel)):r==="seriesChartType"?this.chartController.isComboChart()&&(this.seriesChartTypePanel=this.createBean(new lz(this.chartController,t,a)),this.panels.push(this.seriesChartTypePanel)):r==="chartSpecific"?(this.chartSpecificPanel=this.createBean(new sz(this.chartMenuContext,a)),this.panels.push(this.chartSpecificPanel)):O3(144,{type:r})}),(i?this.categoriesDataPanel:this.seriesDataPanel)?.addItem(this.switchCategorySeriesToggle.getGui()),this.addPanelComponents()}addPanelComponents(){if(!this.panels.length)return;const t=k3(this.beans).createDocumentFragment();for(const s of this.panels)s.addCss("ag-chart-data-section"),t.appendChild(s.getGui());this.getGui().appendChild(t)}clearPanelComponents(){for(const e of this.panels)e.getGui().remove(),this.destroyBean(e);this.panels=[]}getDataPanelDef(){return this.gos.get("chartToolPanelsDef")?.dataPanel??uz}getCategoryGroupTitle(e){return e?this.chartTranslation.translate("seriesLabels"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return t?!1:eo(e)!==1}getSeriesGroupTitle(e){return e?this.chartTranslation.translate("categoryValues"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return this.getSeriesGroupMaxSelection(e,t)!==1}getSeriesGroupMaxSelection(e,t){if(!t)return Sr(e)}createSwitchCategorySeriesToggle(){this.switchCategorySeriesToggle=this.createManagedBean(new D3({label:this.chartTranslation.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartController.isCategorySeriesSwitched(),onValueChange:e=>{this.restoreSwitchCategorySeriesToggleFocus=!0,this.chartController.switchCategorySeries(e)}}))}};import{Component as pz,_warn as Yp}from"ag-grid-community";import{AgCheckbox as gz,AgSelectSelector as fz,Component as mz,RefPlaceholder as Fr,_removeFromParent as qp,_setDisplayed as Cz}from"ag-grid-community";import{AgAbstractLabel as vz,AgInputNumberFieldSelector as Sz,RefPlaceholder as Rr,_exists as bz,_getActiveDomElement as yz,_setFixedWidth as wz}from"ag-grid-community";var xz=class extends vz{constructor(e){super(e,`<div class="ag-angle-select">
|
||
<div data-ref="eLabel"></div>
|
||
<div class="ag-wrapper ag-angle-select-wrapper">
|
||
<div class="ag-angle-select-field">
|
||
<div data-ref="eParentCircle" class="ag-angle-select-parent-circle">
|
||
<div data-ref="eChildCircle" class="ag-angle-select-child-circle"></div>
|
||
</div>
|
||
</div>
|
||
<ag-input-number-field data-ref="eAngleValue"></ag-input-number-field>
|
||
</div>
|
||
</div>`,[Sz]),this.eLabel=Rr,this.eParentCircle=Rr,this.eChildCircle=Rr,this.eAngleValue=Rr,this.radius=0,this.offsetX=0,this.offsetY=0}wireBeans(e){this.dragSvc=e.dragSvc}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;e!=null&&this.setValue(e,void 0,!0),t!=null&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:()=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:s=>this.calculateAngleDrag(s),onDragStop:()=>{}},this.dragSvc?.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(s=>{(s==null||s==="")&&(s="0"),s=this.eAngleValue.normalizeValue(s);let i=parseFloat(s);i>180&&(i=i-360),this.setValue(i)}),this.updateNumberInput(),bz(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListeners(this,{fieldValueChanged:()=>{this.eAngleValue.getInputElement().contains(yz(this.beans))||this.updateNumberInput()}})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},s=this.eChildCircle,i=t.width/2,r=t.height/2;s.style.left=`${i+Math.cos(e)*8}px`,s.style.top=`${r+Math.sin(e)*8}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,s=Math.atan2(t,e);this.degrees=this.toDegrees(s),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(s)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,s=t.width/2,i=t.height/2,r=e.clientX-t.left,a=e.clientY-t.top,n=r-s,o=a-i,l=Math.atan2(o,n);this.setValue(l,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return e%=Math.PI*2,e<-Math.PI?e+=Math.PI*2:e>=Math.PI&&(e-=Math.PI*2),e}getRadius(){return this.radius}setRadius(e){return this.radius===e?this:(this.radius=e,this.calculateCartesian(),this)}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>{e(this.degrees)}}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,s){let i;return t?i=e:i=this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(i),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(i),s||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}setWidth(e){return wz(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragSvc?.removeDragSource(this.dragListener),super.destroy()}};import{AgSelectSelector as Fz,Component as Rz,RefPlaceholder as Az,_removeFromParent as Mz}from"ag-grid-community";function Tz(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}var ct=class extends Rz{constructor(e){super(),this.params=e,this.fontGroup=Az,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{cssIdentifier:e="charts-format-sub-level",name:t,enabled:s,onEnableChange:i,suppressEnabledCheckbox:r,chartMenuParamsFactory:a,keyMapper:n}=this.params,o={cssIdentifier:e,direction:"vertical",suppressOpenCloseIcons:!0,title:t,enabled:s,suppressEnabledCheckbox:!0,onEnableChange:l=>{i&&i(l)},useToggle:!r};this.setTemplate(`<div class="ag-font-panel">
|
||
<ag-group-component data-ref="fontGroup">
|
||
<ag-select data-ref="familySelect"></ag-select>
|
||
<ag-select data-ref="weightStyleSelect"></ag-select>
|
||
<div class="ag-charts-font-size-color">
|
||
<ag-select data-ref="sizeSelect"></ag-select>
|
||
<ag-color-picker data-ref="colorPicker"></ag-color-picker>
|
||
</div>
|
||
</ag-group-component>
|
||
</div>`,[H,Fz,De],{fontGroup:o,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:a.getDefaultColorPickerParams(n("color"))}),this.toggleCss("ag-font-panel-no-header",!t)}addItem(e,t){t?this.fontGroup.prependItem(e):this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua, serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode, sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let s=e[0];if(t){const a=e.map(n=>n.toLowerCase()).indexOf(t.toLowerCase());if(a>=0)s=e[a];else{const n=Tz(t);e.push(n),s=n}}const i=e.sort().map(r=>({value:r,text:r}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("font",i,`${s}`,r=>this.setFont({fontFamily:r}))}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");e.includes(t)||e.push(t);const s=e.sort((i,r)=>i-r).map(i=>({value:`${i}`,text:`${i}`}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("size",s,`${t}`,i=>this.setFont({fontSize:parseInt(i,10)}))}getWeightStyleSelectParams(){const e=this.getInitialFontValue("fontWeight")??"normal",t=this.getInitialFontValue("fontStyle")??"normal",s=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let i=s.find(a=>a.weight===e&&a.style===t);i||(i={name:"predefined",weight:e,style:t},s.unshift(i));const r=s.map(a=>({value:a.name,text:this.chartTranslation.translate(a.name)}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("weight",r,i.name,a=>{const n=s.find(o=>o.name===a);this.setFont({fontWeight:n.weight,fontStyle:n.style})})}destroyActiveComps(){for(const e of this.activeComps)Mz(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;for(const s of Object.keys(e)){const i=e[s];i&&this.chartOptions.setValue(t(s),i)}}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}};import{Component as Pz,RefPlaceholder as Iz}from"ag-grid-community";var Ez=class extends Pz{constructor(e){super(),this.chartMenuUtils=e,this.axisTicksSizeSlider=Iz}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuUtils:e}=this,t=e.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("ticks"),suppressEnabledCheckbox:!0,useToggle:!0}),s=e.getDefaultColorPickerParams("tick.stroke"),i=e.getDefaultSliderParams("tick.width","width",10),r=e.getDefaultSliderParams("tick.size","length",30);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="axisTicksGroup">
|
||
<ag-color-picker data-ref="axisTicksColorPicker"></ag-color-picker>
|
||
<ag-slider data-ref="axisTicksWidthSlider"></ag-slider>
|
||
<ag-slider data-ref="axisTicksSizeSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{axisTicksGroup:t,axisTicksColorPicker:s,axisTicksWidthSlider:i,axisTicksSizeSlider:r})}setTickSizeSliderDisplayed(e){this.axisTicksSizeSlider.setDisplayed(e)}};import{Component as Dz}from"ag-grid-community";var Lz=class extends Dz{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("gridLines"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.getGridLineColorPickerParams("color"),s=this.getGridLineWidthSliderParams("thickness"),i=this.getGridLineDashSliderParams("lineDash");this.setTemplate(`<div>
|
||
<ag-group-component data-ref="gridLineGroup">
|
||
<ag-color-picker data-ref="gridLineColorPicker"></ag-color-picker>
|
||
<ag-slider data-ref="gridLineWidthSlider"></ag-slider>
|
||
<ag-slider data-ref="gridLineLineDashSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{gridLineGroup:e,gridLineColorPicker:t,gridLineWidthSlider:s,gridLineLineDashSlider:i})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:t=>t?.[0]?.stroke,parseInputValue:t=>{const s=this.chartOptions.getValue("gridLine.style")??[];return s.length===0?[{stroke:t,lineDash:[]}]:[{...s[0],stroke:t}]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){const s=this.chartOptions.getValue("gridLine.style")?.[0]?.lineDash?.[0],i=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(s??0,e,30);return i.onValueChange=r=>{const a=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[r],stroke:a}])},i}},kz="%d %B %Y",Ar=class extends mz{constructor(e,t){super(),this.axisType=e,this.options=t,this.axisGroup=Fr,this.axisTypeSelect=Fr,this.axisPositionSelect=Fr,this.axisTimeFormatSelect=Fr,this.activePanels=[],this.updateFuncs=[];const{chartOptionsService:s,seriesType:i,chartController:r}=t;this.chartOptionsService=s,this.chartController=r,this.chartOptionsSeriesProxy=s.getSeriesOptionsProxy(()=>i)}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,registerGroupComponent:s}=this.options,i=this.axisType,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:e,suppressEnabledCheckbox:!0},a=t.getCartesianAxisOptionsProxy(this.axisType),n=this.createManagedBean(new Rt(a)),o=this.createManagedBean(new Rt(t.getCartesianAxisThemeOverridesProxy(this.axisType))),l=this.getAxisTypeSelectParams(n,t.getCartesianAxisAppliedThemeOverridesProxy(this.axisType)),c=this.getAxisPositionSelectParams(n),d=this.getAxisTimeFormatSelectParams(n),u=this.getAxisColorInputParams(o),h=this.getAxisLineWidthSliderParams(o);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="axisGroup">
|
||
<ag-select data-ref="axisTypeSelect"></ag-select>
|
||
<ag-select data-ref="axisTimeFormatSelect"></ag-select>
|
||
<ag-select data-ref="axisPositionSelect"></ag-select>
|
||
<ag-color-picker data-ref="axisColorInput"></ag-color-picker>
|
||
<ag-slider data-ref="axisLineWidthSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,fz,De,le],{axisGroup:r,axisTypeSelect:l??void 0,axisPositionSelect:c??void 0,axisTimeFormatSelect:d??void 0,axisColorInput:u,axisLineWidthSlider:h}),s(this.axisGroup),this.axisTypeSelect.setDisplayed(!!l.options?.length),c||this.removeTemplateComponent(this.axisPositionSelect);const p=()=>{const f=a.getValue("type")==="time";Cz(this.axisTimeFormatSelect.getGui(),f)};d?(p(),this.addManagedEventListeners({chartOptionsChanged:()=>{p()}})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(o),this.initAxisTicks(o),this.initAxisLabels(o);const g=()=>{for(const f of this.updateFuncs)f()};this.addManagedListeners(this.chartController,{chartUpdated:g,chartModelUpdate:()=>setTimeout(()=>{this.isAlive()&&(this.refreshAxisTypeSelect(n),p())})})}getAxisTypeSelectParams(e,t){const s=e.getChartOptions(),i=this.getAxisTypeSelectOptions(),r=e.getDefaultSelectParams("type","axisType",i);return r.onValueChange=a=>{const n=s.getValue("type");if(a===n)return;const o=t.getValue("*"),l=n==="time",c=a==="time",d=l!==c?c?kz:void 0:null;d===void 0&&s.clearValue?.("label","format"),this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,a),d!=null&&s.setValue("label.format",d),t.setValue("*",o)},r}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),s=!!t.length;this.axisTypeSelect.setDisplayed(s),s&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController,t=e.getChartType(),s=()=>{const i=e.getChartData()[0];return i?e.getSelectedDimensions().every(r=>!isNaN(parseFloat(i[r.colId]))):!1};return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(t)||e.isGrouping()||!this.isCategoryAxis()||e.isCategorySeriesSwitched()||!s()?[]:["category","number","time"].map(i=>({value:i,text:this.translate(i)}))}isCategoryAxis(){const e=this.chartOptionsSeriesProxy.getValue("direction")==="horizontal";return e&&this.axisType==="yAxis"||!e&&this.axisType==="xAxis"}getAxisPositionSelectParams(e){const t=((s,i)=>{if(s==="heatmap")return null;if(i==="xAxis")return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];if(i==="yAxis")return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.stroke")}getAxisLineWidthSliderParams(e){const t=e.getChartOptions(),s=()=>t.getValue("line.enabled")?t.getValue("line.width"):null,i=a=>{t.setValues([{expression:"line.enabled",value:a!=null},{expression:"line.width",value:a??0}])},r=e.getDefaultSliderParamsWithoutValueParams(s()??0,"thickness",10);return r.onValueChange=a=>{i(a===0?null:a)},r}initGridLines(e){if(this.chartController.getChartType()==="heatmap")return;const s=this.createBean(new Lz(e));this.axisGroup.addItem(s),this.activePanels.push(s)}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new Ez(e));this.axisGroup.addItem(t),this.activePanels.push(t);const s=()=>t.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis());this.updateFuncs.push(s),s()}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`label.${i}`},s=this.createBean(new ct(t));this.axisGroup.addItem(s),this.activePanels.push(s),this.addAdditionalLabelComps(s,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const s=this.createRotationWidget("labelRotation",t),i=this.initLabelRotation(s,t);e.addItem(i),e.addItem(s)}initLabelRotation(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=()=>s.getValue("label.autoRotate"),a=d=>{d&&(this.prevRotation=i()),s.setValues([{expression:"label.autoRotate",value:d},{expression:"label.rotation",value:d?void 0:this.prevRotation}]),e.setDisplayed(!d)},o=typeof i()=="number"?!1:r(),l=this.createBean(new gz({label:this.translate("autoRotate"),value:o,onValueChange:a}));e.setDisplayed(!o);const c=()=>l.setDisplayed(this.isGroupedCategoryAxis());return this.updateFuncs.push(c),c(),l}createRotationWidget(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=l=>s.setValue("label.rotation",l),n=`${this.chartTranslation.translate(e)} \xB0`,o=new xz({label:n,labelWidth:"flex",value:i()??0,onValueChange:r});return this.updateFuncs.push(()=>{o.setValue(i()??0)}),this.createBean(o)}isGroupedCategoryAxis(){return this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue("type")==="grouped-category"?!this.isCategoryAxis():!0}addLabelPadding(e,t){const s=this.createBean(new ue(t.getDefaultSliderParams("label.spacing","padding",30)));e.addItem(s)}translate(e){return this.chartTranslation.translate(e)}removeTemplateComponent(e){qp(e.getGui()),this.destroyBean(e)}destroyActivePanels(){for(const e of this.activePanels)qp(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}};import{AgSelect as Gz,Component as Oz,RefPlaceholder as _z}from"ag-grid-community";var Nz=class extends Oz{constructor(e){super(),this.options=e,this.axisGroup=_z}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartAxisMenuParamsFactory:t,registerGroupComponent:s}=this.options,i={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:e,suppressEnabledCheckbox:!0},r=t.getDefaultColorPickerParams("line.stroke"),a=t.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="axisGroup">
|
||
<ag-color-picker data-ref="axisColorInput"></ag-color-picker>
|
||
<ag-slider data-ref="axisLineWidthSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{axisGroup:i,axisColorInput:r,axisLineWidthSlider:a}),s(this.axisGroup),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.options.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const s=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:s,property:"shape"}))}e!=="pie"&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:this.options.chartAxisMenuParamsFactory,keyMapper:i=>`label.${i}`},t=this.createManagedBean(new ct(e)),s=this.createOrientationWidget();t.addItem(s),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){const e=z(this.options.chartController.getChartType());if(!aH(e))return;const t=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],s=this.createManagedBean(new Ae({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:t})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(s)}createSlider(e){const{labelKey:t,defaultMaxValue:s,step:i=.05,property:r}=e,a=this.options.chartAxisMenuParamsFactory.getDefaultSliderParams(r,t,s);return a.step=i,this.createManagedBean(new ue(a))}createSelect(e){const{labelKey:t,options:s,property:i}=e;return this.createManagedBean(new Gz(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(i,t,s)))}translate(e){return this.chartTranslation.translate(e)}};import{Component as Bz,RefPlaceholder as Vz}from"ag-grid-community";import{Component as Hz}from"ag-grid-community";var zz=class extends Hz{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("background"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(`<div>
|
||
<ag-group-component data-ref="chartBackgroundGroup">
|
||
<ag-color-picker data-ref="colorPicker"></ag-color-picker>
|
||
</ag-group-component>
|
||
<div>`,[H,De],{chartBackgroundGroup:e,colorPicker:t})}};import{Component as Uz,RefPlaceholder as Wz}from"ag-grid-community";var Kz=class extends Uz{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t,this.paddingTopSlider=Wz}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("padding"),suppressEnabledCheckbox:!0},t=s=>this.chartMenuUtils.getDefaultSliderParams("padding."+s,s,200);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="chartPaddingGroup">
|
||
<ag-slider data-ref="paddingTopSlider"></ag-slider>
|
||
<ag-slider data-ref="paddingRightSlider"></ag-slider>
|
||
<ag-slider data-ref="paddingBottomSlider"></ag-slider>
|
||
<ag-slider data-ref="paddingLeftSlider"></ag-slider>
|
||
</ag-group-component>
|
||
<div>`,[H,le],{chartPaddingGroup:e,paddingTopSlider:t("top"),paddingRightSlider:t("right"),paddingBottomSlider:t("bottom"),paddingLeftSlider:t("left")}),this.addManagedEventListeners({chartOptionsChanged:s=>{this.updateTopPadding(s.chartOptions)}})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(s=>e?.[s]?.padding?.top).find(s=>s!=null);t!=null&&this.paddingTopSlider.setValue(`${t}`)}},$z=class extends Bz{constructor(e){super(),this.options=e,this.chartGroup=Vz}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartStyle"),expanded:s,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new Kz(t,e)),this.createManagedBean(new zz(t))]};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="chartGroup"></ag-group-component>
|
||
</div>`,[H],{chartGroup:r}),i(this.chartGroup)}};import{BeanStub as jz}from"ag-grid-community";var Yz=class extends jz{constructor(e){super(),this.groupContainer=e,this.id=0,this.groupComponents=new Map}addGroupComponent(e){const t=this.id++;this.groupComponents.set(t,e),e.isExpanded()&&(this.expandedGroupComponent=t),e.onExpandedChange(s=>{if(s){const i=this.expandedGroupComponent;if(this.expandedGroupComponent=t,i!=null){const r=e.getGui(),a=r.offsetTop-this.groupContainer.parentElement.scrollTop;this.groupComponents.get(i)?.toggleGroupExpand(!1,!0);let n=r.offsetTop-a;n<0&&(n=0),n!==this.groupContainer.parentElement.scrollTop&&(this.groupContainer.parentElement.scrollTop=n)}}else this.expandedGroupComponent=void 0})}destroy(){this.groupComponents.clear(),super.destroy()}};import{AgCheckbox as qz,AgSelect as Xz,Component as Zz,RefPlaceholder as Xp}from"ag-grid-community";var Jz=class extends Zz{constructor(e,t){super(),this.options=e,this.legendGroup=Xp,this.enabledGroup=Xp,this.isGradient=["treemap","sunburst","heatmap"].includes(e.seriesType),this.key=this.isGradient?"gradientLegend":"legend",this.chartController=t.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,isExpandedOnInit:t,registerGroupComponent:s}=this.options,i=this.createManagedBean(new Xz(e.getDefaultSelectParams(`${this.key}.position`,"position",["top","right","bottom","left"].map(n=>({value:n,text:this.chartTranslation.translate(n)})))));this.enabledGroup=this.createManagedBean(new Ae(e.addEnableParams(`${this.key}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("legendEnabled"),suppressEnabledCheckbox:!0,useToggle:!0,items:[this.createLabelPanel(e),i,...this.getItems(e)]})));const r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("legend"),suppressEnabledCheckbox:!0,expanded:t,items:[this.enabledGroup]};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="legendGroup">
|
||
</ag-group-component>
|
||
</div>`,[H],{legendGroup:r}),s(this.legendGroup);const a=this.updateLegendEnabledState.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:a,chartApiUpdate:a})}updateLegendEnabledState(){const{valueCols:e}=this.chartController.getColStateForMenu();this.enabledGroup.setEnabled(e.filter(t=>t.selected).length>1)}getItems(e){const t=(s,i,r)=>this.createManagedBean(new ue(e.getDefaultSliderParams(`${this.key}.${s}`,i,r)));return this.isGradient?[this.createManagedBean(new qz(e.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslation.translate("reverseDirection"),labelWidth:"flex"}))),t("gradient.thickness","thickness",40),t("gradient.preferredLength","preferredLength",300),t("spacing","spacing",200)]:[t("spacing","spacing",200),t("item.marker.size","markerSize",40),t("item.marker.strokeWidth","markerStroke",10),t("item.marker.padding","itemSpacing",20),t("item.paddingX","layoutHorizontalSpacing",50),t("item.paddingY","layoutVerticalSpacing",50)]}createLabelPanel(e){const t=this.isGradient?"gradientLegend.scale.label":"legend.item.label",s={enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`${t}.${i}`,cssIdentifier:"charts-format-sub-level-no-header"};return this.createManagedBean(new ct(s))}};import{AgSelect as co,Component as Qz,RefPlaceholder as e5,_error as t5,_removeFromParent as s5}from"ag-grid-community";import{Component as i5,RefPlaceholder as r5,_removeFromParent as a5}from"ag-grid-community";var n5=class extends i5{constructor(e){super(),this.params=e,this.toggleableGroup=r5,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}postConstruct(){const{tag:e,cssIdentifier:t="charts-format-sub-level",title:s,suppressEnabledCheckbox:i}=this.params,r=this.params.chartMenuParamsFactory.addEnableParams(`${e}.enabled`,{cssIdentifier:t,direction:"vertical",suppressOpenCloseIcons:!0,title:s,suppressEnabledCheckbox:!0,useToggle:!i});this.setTemplate(`<div class="ag-toggleable-group-panel">
|
||
<ag-group-component data-ref="toggleableGroup">
|
||
</ag-group-component>
|
||
</div>`,[H],{toggleableGroup:r}),this.toggleCss("ag-toggleable-group-panel-no-header",!s)}addItem(e,t){t?this.toggleableGroup.prependItem(e):this.toggleableGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.toggleableGroup.setEnabled(e)}destroyActiveComps(){for(const e of this.activeComps)a5(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}};import{Component as o5}from"ag-grid-community";var l5=class extends o5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="calloutGroup">
|
||
<ag-slider data-ref="calloutLengthSlider"></ag-slider>
|
||
<ag-slider data-ref="calloutStrokeWidthSlider"></ag-slider>
|
||
<ag-slider data-ref="labelOffsetSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,le],{calloutGroup:e,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}};import{Component as c5}from"ag-grid-community";var d5=class extends c5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},t=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);t.step=.05,this.setTemplate(`<div>
|
||
<ag-group-component data-ref="capsGroup">
|
||
<ag-slider data-ref="capLengthRatioSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,le],{capsGroup:e,capLengthRatioSlider:t})}};import{Component as u5}from"ag-grid-community";var h5=class extends u5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="lineGroup">
|
||
<ag-color-picker data-ref="lineColorPicker"></ag-color-picker>
|
||
<ag-slider data-ref="lineStrokeWidthSlider"></ag-slider>
|
||
<ag-slider data-ref="lineOpacitySlider"></ag-slider>
|
||
<ag-slider data-ref="lineDashSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{lineGroup:e,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,s,i=1,r=!1){const a=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);return a.step=i,a}};import{AgSelectSelector as p5,Component as g5}from"ag-grid-community";function Zp(e){return["square","circle","cross","diamond","plus","triangle","heart"].map(t=>({value:t,text:e.translate(t)}))}var f5=class extends g5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("markers"),suppressEnabledCheckbox:!0,useToggle:!0,suppressOpenCloseIcons:!0});this.setTemplate(`<div>
|
||
<ag-group-component data-ref="seriesMarkersGroup">
|
||
<ag-select data-ref="seriesMarkerShapeSelect"></ag-select>
|
||
<ag-slider data-ref="seriesMarkerSizeSlider"></ag-slider>
|
||
<ag-slider data-ref="seriesMarkerStrokeWidthSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,p5,le],{seriesMarkersGroup:e,seriesMarkerShapeSelect:this.chartMenuUtils.getDefaultSelectParams("marker.shape","shape",Zp(this.chartTranslation)),seriesMarkerSizeSlider:this.chartMenuUtils.getDefaultSliderParams("marker.size","size",60),seriesMarkerStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("marker.strokeWidth","strokeWidth",10)})}};import{AgSelectSelector as m5,Component as C5,RefPlaceholder as v5,_removeFromParent as S5}from"ag-grid-community";var b5=class extends C5{constructor(e){super(),this.chartMenuUtils=e,this.seriesItemsGroup=v5,this.activePanels=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="seriesItemsGroup">
|
||
<ag-select data-ref="seriesItemSelect"></ag-select>
|
||
</ag-group-component>
|
||
</div>`,[H,m5],{seriesItemsGroup:e,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslation.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslation.translate("seriesItemNegative")}],t=s=>{this.destroyActivePanels(),this.initSeriesControls(s)};return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesItemType",e,"positive",t)}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,s,i=1,r=!1){const a=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);a.step=i;const n=this.seriesItemsGroup.createManagedBean(new ue(a));this.seriesItemsGroup.addItem(n),this.activePanels.push(n)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),s=this.createBean(new ct(t));this.seriesItemsGroup.addItem(s),this.activePanels.push(s)}destroyActivePanels(){for(const e of this.activePanels)S5(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}};import{Component as y5}from"ag-grid-community";var w5=class extends y5{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.propertyKey,t=this.chartMenuUtils.addEnableParams(`${e}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("shadow"),suppressEnabledCheckbox:!0,useToggle:!0}),s=this.chartMenuUtils.getDefaultColorPickerParams(`${e}.color`);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="shadowGroup">
|
||
<ag-color-picker data-ref="shadowColorPicker"></ag-color-picker>
|
||
<ag-slider data-ref="shadowBlurSlider"></ag-slider>
|
||
<ag-slider data-ref="shadowXOffsetSlider"></ag-slider>
|
||
<ag-slider data-ref="shadowYOffsetSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{shadowGroup:t,shadowColorPicker:s,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,s){const i=`${this.propertyKey}.${e}`,r=this.chartMenuUtils.getDefaultSliderParams(i,e,s);return r.minValue=t,r}};import{Component as x5}from"ag-grid-community";var F5=class extends x5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="groupSpacing">
|
||
<ag-slider data-ref="groupPaddingSlider"></ag-slider>
|
||
<ag-slider data-ref="groupSpacingSlider"></ag-slider>
|
||
</ag-group-component>
|
||
<ag-group-component data-ref="tileSpacing">
|
||
<ag-slider data-ref="tilePaddingSlider"></ag-slider>
|
||
<ag-slider data-ref="tileSpacingSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,le],{groupSpacing:{...e,title:this.chartTranslation.translate("group")},tileSpacing:{...e,title:this.chartTranslation.translate("tile")},groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};import{AgSelectSelector as R5,Component as A5,RefPlaceholder as M5}from"ag-grid-community";function T5(e){return e[0].toUpperCase()+e.substring(1)}var P5=class extends A5{constructor(e){super(),this.chartMenuUtils=e,this.tooltipMode=M5}postConstruct(){const{chartMenuUtils:e,beans:t}=this,s="tooltip",i=t.chartTranslation,r=e.addEnableParams(`${s}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:i.translate("tooltips"),suppressEnabledCheckbox:!0,useToggle:!0}),a="tooltipMode",n=["single","shared","compact"].map(c=>({value:c,text:i.translate(`${a}${T5(c)}`)})),o=`${s}.mode`,l=e.getDefaultSelectParams(o,a,n);this.setTemplate(`<div>
|
||
<ag-group-component data-ref="tooltipGroup">
|
||
<ag-select data-ref="tooltipMode"></ag-select>
|
||
</ag-group-component>
|
||
</div>`,[H,R5],{tooltipGroup:r,tooltipMode:l}),this.addManagedEventListeners({chartOptionsChanged:()=>{const c=e.getChartOptions().getValue(o);this.tooltipMode.setValue(c,!0)}})}};import{Component as I5}from"ag-grid-community";var E5=class extends I5{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="whiskersGroup">
|
||
<ag-color-picker data-ref="whiskerColorPicker"></ag-color-picker>
|
||
<ag-slider data-ref="whiskerThicknessSlider"></ag-slider>
|
||
<ag-slider data-ref="whiskerOpacitySlider"></ag-slider>
|
||
<ag-slider data-ref="whiskerLineDashSlider"></ag-slider>
|
||
<ag-slider data-ref="whiskerLineDashOffsetSlider"></ag-slider>
|
||
</ag-group-component>
|
||
</div>`,[H,De,le],{whiskersGroup:e,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}},K="tooltips",ee="strokeWidth",Qs="lineWidth",ne="lineDash",q="lineOpacity",oe="fillOpacity",$="labels",ze="shadow",Mr="stageLabels",ei="markers",D5=class extends Qz{constructor(e){super(),this.options=e,this.seriesGroup=e5,this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth(Qs),[ee]:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),[ne]:()=>this.initLineDash(),[q]:()=>this.initOpacity("strokeOpacity"),[oe]:()=>this.initOpacity("fillOpacity"),markers:()=>new f5(this.chartMenuUtils),[$]:()=>this.initLabels(),sectorLabels:()=>this.initSectorLabels(),[ze]:()=>new w5(this.chartMenuUtils),[K]:()=>new P5(this.options.chartMenuParamsFactory),bins:()=>this.initBins(),whiskers:()=>new E5(this.chartMenuUtils),caps:()=>new d5(this.chartMenuUtils),connectorLine:()=>new h5(this.chartMenuUtils),seriesItems:()=>new b5(this.chartMenuUtils),tileSpacing:()=>new F5(this.chartMenuUtils),shape:()=>this.initShape(),size:()=>this.initSize("size","size"),minSize:()=>this.initSize("size","minSize"),maxSize:()=>this.initSize("maxSize","maxSize"),dropoff:()=>this.initDropOff(),stageLabels:()=>this.initStageLabels()},this.seriesWidgetMappings={bar:[K,ee,ne,q,oe,$,ze],pie:[K,ee,q,oe,$,"sectorLabels",ze],donut:[K,ee,q,oe,$,"sectorLabels",ze],line:[K,Qs,ne,q,ei,$],scatter:[K,"shape","size",ee,$],bubble:[K,"shape","minSize","maxSize",ee,$],area:[K,Qs,ne,q,oe,ei,$,ze],histogram:[K,"bins",ee,ne,q,oe,$,ze],"radial-column":[K,ee,ne,q,oe,$],"radial-bar":[K,ee,ne,q,oe,$],"radar-line":[K,ee,ne,q,ei,$],"radar-area":[K,ee,ne,q,oe,ei,$],nightingale:[K,ee,ne,q,oe,$],"box-plot":[K,ee,ne,q,oe,"whiskers","caps"],"range-bar":[K,ee,ne,q,oe,$],"range-area":[K,Qs,ne,q,oe,ei,$,ze],treemap:[K,"tileSpacing"],sunburst:[K],heatmap:[K,$,"lineColor",Qs,q],waterfall:[K,"connectorLine","seriesItems"],funnel:[K,ee,ne,q,oe,$,"dropoff",Mr,ze],"cone-funnel":[K,ee,ne,q,oe,$,Mr],pyramid:[K,ee,ne,q,oe,$,Mr,ze]},this.seriesType=e.seriesType}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,chartController:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:e,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="seriesGroup">
|
||
</ag-group-component>
|
||
</div>`,[H],{seriesGroup:r}),i(this.seriesGroup),this.chartMenuUtils=this.createManagedBean(new Rt(t.getSeriesOptionsProxy(()=>this.seriesType))),this.addManagedListeners(s,{chartSeriesChartTypeChanged:this.refreshWidgets.bind(this)}),this.refreshWidgets()}refreshWidgets(){const{chartController:e}=this.options;this.destroyActivePanels(),e.getChartProxy().getChart().waitForUpdate().then(()=>{if(this.isAlive()){e.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect());for(const i of this.seriesWidgetMappings[this.seriesType]??[]){const r=this.widgetFuncs[i]();let a;if(Array.isArray(r)){const n=this.createBean(r[0]);a=n,r[1](n)}else a=this.createBean(r);this.seriesGroup.addItem(a),this.activePanels.push(a)}}}).catch(s=>t5(105,{e:s}))}initSeriesSelect(){const e=this.createBean(new co(this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesType",this.getSeriesSelectOptions(),`${this.seriesType}`,t=>{this.seriesType=t,this.refreshWidgets()})));this.seriesGroup.addItem(e),this.activePanels.push(e)}initLineColor(){return new Ep(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor"))}initStrokeWidth(e,t){return new ue(this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:"strokeWidth",e,10))}initLineDash(e){return new ue(this.chartMenuUtils.getDefaultSliderParams(e?`${e}.lineDash`:"lineDash","lineDash",30,!0))}initOpacity(e,t){const s=this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:e,e,1);return s.step=.05,new ue(s)}initDropOff(){return[new n5({tag:"dropOff",cssIdentifier:"charts-format-sub-level",title:this.translate("dropOff"),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils}),s=>{for(const i of[this.initStrokeWidth("strokeWidth","dropOff"),this.initLineDash("dropOff"),this.initOpacity("strokeOpacity","dropOff"),this.initOpacity("fillOpacity","dropOff")]){const r=s.createManagedBean(i);s.addItem(r),this.activePanels.push(r)}}]}initLabels(){const e=yp(this.seriesType),t=e?"calloutLabel":"label",s=e?"calloutLabels":"labels",i=this.chartMenuUtils.getDefaultFontPanelParams(t,s);return[new ct(i),n=>{if(e){const o=n.createManagedBean(new l5(this.chartMenuUtils));n.addItem(o),this.activePanels.push(o)}if(this.seriesType==="range-bar"){const o=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],l=n.createManagedBean(new co(this.chartMenuUtils.getDefaultSelectParams("label.placement","labelPlacement",o)));n.addItem(l),this.activePanels.push(l);const c=n.createManagedBean(new ue(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));n.addItem(c),this.activePanels.push(c)}}]}initSectorLabels(){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels");return[new ct(e),i=>{const r=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);r.step=.05;const a=i.createManagedBean(new ue(r));i.addItem(a)}]}initStageLabels(){return new ct(this.chartMenuUtils.getDefaultFontPanelParams("stageLabel",Mr))}initBins(){const e=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),t=this.chartMenuUtils.getChartOptions(),s=(t.getValue("bins")??t.getValue("calculatedBins",!0)).length;return e.value=`${s}`,e.maxValue=Math.max(s,20),new ue(e)}initShape(){return new co(this.chartMenuUtils.getDefaultSelectParams("shape","shape",Zp(this.chartTranslation)))}initSize(e,t){return new ue(this.chartMenuUtils.getDefaultSliderParams(e,t,60))}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(t=>({value:t,text:this.translate(t)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.options.chartController.getActiveSeriesChartTypes().map(e=>z(e.chartType))}translate(e){return this.chartTranslation.translate(e)}destroyActivePanels(){for(const e of this.activePanels)s5(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}};import{Component as L5,RefPlaceholder as k5}from"ag-grid-community";import{AgInputTextField as G5,Component as O5}from"ag-grid-community";var ti=class extends O5{constructor(e,t,s){super("<div></div>"),this.chartMenuUtils=e,this.name=t,this.key=s,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.initFontPanel()}hasTitle(){const e=this.chartOptions.getValue(this.key);return e?.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslation.translate(this.name),enabled:e,suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils,keyMapper:s=>`${this.key}.${s}`,onEnableChange:s=>this.onEnableChange(s)};this.fontPanel=this.createManagedBean(new ct(t)),this.fontPanel.addItem(this.createBean(new G5(this.getTextInputParams())),!0),this.fontPanel.addItem(this.createBean(new ue(this.getSpacingSliderParams()))),this.getGui().appendChild(this.fontPanel.getGui())}getTextInputParams(){return this.chartMenuUtils.addValueParams(`${this.key}.text`,{label:this.chartTranslation.translate("title"),labelAlignment:"top"})}getSpacingSliderParams(){return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`,"spacing",100)}onEnableChange(e){this.chartOptions.setValue(`${this.key}.enabled`,e)}},_5=class extends ti{wireBeans(e){super.wireBeans(e),this.chartMenuSvc=e.chartMenuSvc}postConstruct(){this.titlePlaceholder=this.chartTranslation.translate("titlePlaceholder"),super.postConstruct(),this.addManagedEventListeners({chartTitleEdit:()=>{this.fontPanel.setEnabled(this.hasTitle())}})}getTextInputParams(){const e=super.getTextInputParams();return this.shouldOverrideTextWithPlaceholder(e.value)&&(e.value=this.titlePlaceholder),e}getSpacingSliderParams(){const e=super.getSpacingSliderParams();return e.value="10",e}onEnableChange(e){if(this.chartMenuSvc.doesChartToolbarExist()){const s=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?s-20:s+20)}this.chartOptions.setValue(`${this.key}.enabled`,e);const t=this.chartOptions.getValue(`${this.key}.text`);e&&this.shouldOverrideTextWithPlaceholder(t)&&this.chartOptions.setValue(`${this.key}.text`,this.titlePlaceholder)}shouldOverrideTextWithPlaceholder(e){return e==="Title"||e?.trim().length===0}},N5=class extends L5{constructor(e){super(),this.options=e,this.titleGroup=k5}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t,chartOptionsService:s,seriesType:i,isExpandedOnInit:r=!1,registerGroupComponent:a}=this.options,n=[];if(ot(i)&&i!=="pyramid"){const l=c=>this.createManagedBean(new Rt(s.getCartesianAxisThemeOverridesProxy(c)));n.push(this.createManagedBean(new ti(l("xAxis"),"horizontalAxisTitle","title"))),n.push(this.createManagedBean(new ti(l("yAxis"),"verticalAxisTitle","title")))}else Qn(i)&&n.push(this.createManagedBean(new ti(t,"polarAxisTitle","title")));const o={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartTitles"),expanded:r,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new _5(e,"chartTitle","title")),this.createManagedBean(new ti(e,"chartSubtitle","subtitle")),...n]};this.setTemplate(`<div>
|
||
<ag-group-component data-ref="titleGroup"></ag-group-component>
|
||
</div>`,[H],{titleGroup:o}),a(this.titleGroup)}},B5={groups:[{type:"chart"},{type:"titles"},{type:"legend"},{type:"series"},{type:"axis"}]},Jp=["axis","horizontalAxis","verticalAxis"],V5=class extends pz{constructor(e){super('<div class="ag-chart-format-wrapper"></div>'),this.chartMenuContext=e}postConstruct(){this.groupExpansionFeature=this.createManagedBean(new Yz(this.getGui())),this.chartPanelFeature=this.createManagedBean(new Ip(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(t))),this.chartPanelFeature.refreshPanels()}createPanels(e){let t=!1;this.getFormatPanelDef().groups?.forEach(({type:s,isOpen:i=!1})=>{if(!this.isGroupPanelShownInSeries(s,e))return;i&&(t&&Yp(145,{group:s}),t=!0);const r=n=>this.groupExpansionFeature.addGroupComponent(n),a={...this.chartMenuContext,isExpandedOnInit:i,seriesType:e,registerGroupComponent:r};switch(s){case"chart":this.chartPanelFeature.addComponent(new $z(a));break;case"titles":this.chartPanelFeature.addComponent(new N5(a));break;case"legend":this.chartPanelFeature.addComponent(new Jz(a,this.chartMenuContext));break;case"axis":Qn(e)?this.chartPanelFeature.addComponent(new Nz(a)):ot(e)&&(this.chartPanelFeature.addComponent(new Ar("xAxis",a)),this.chartPanelFeature.addComponent(new Ar("yAxis",a)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new Ar("xAxis",a));break;case"verticalAxis":this.chartPanelFeature.addComponent(new Ar("yAxis",a));break;case"series":this.chartPanelFeature.addComponent(new D5(a));break;default:Yp(147,{group:s})}})}getFormatPanelDef(){const e=this.gos.get("chartToolPanelsDef")?.formatPanel;return e||B5}isGroupPanelShownInSeries(e,t){const s=["chart","titles","legend","series"].includes(e)||ot(t)&&Jp.includes(e)||Qn(t)&&e==="axis",i=Jn(t)&&e==="legend"||Jn(t)&&Jp.includes(e);return s&&!i}};import{Component as H5,RefPlaceholder as si,_areEqual as z5,_clearElement as Qp,_createIconNoSpan as eg,_getAbsoluteWidth as U5,_radioCssClass as tg,_setDisplayed as W5}from"ag-grid-community";import{Component as K5,KeyCode as sg,_setAriaLabel as $5,_warn as ig}from"ag-grid-community";import{Component as j5,_error as Y5}from"ag-grid-community";var q5="ag-chart-mini-thumbnail-canvas",At=class extends j5{constructor(e,t,s){super(),this.agChartsExports=t,this.tooltipName=s,this.size=58,this.padding=5;const{_Scene:i}=t;this.root=new i.Group;const r=new i.Scene({width:this.size,height:this.size});r.canvas.element.classList.add(q5),r.setRoot(this.root),r.setContainer(e),this.scene=r}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.scene.canvas.element.title=this.chartTranslation.translate(this.tooltipName);try{this.scene.render()}catch(e){Y5(108,{e})}}};import{_last as rg}from"ag-grid-community";function ii(e){const{stacked:t,size:s,padding:i,xScalePadding:r,xScaleDomain:a,yScaleDomain:n,agChartsExports:{_Scene:o}}=e,l=new o.CategoryScale;l.domain=a,l.range=[i,s-i],l.paddingInner=r,l.paddingOuter=r;const c=new o.LinearScale;c.domain=n,c.range=[s-i,i];const d=(u,h,p)=>u.map((g,f)=>{const m=p.convert(g),C=new o.Rect;return C.x=h.convert(f),C.y=m,C.width=h.bandwidth,C.height=p.convert(0)-m,C.strokeWidth=0,C.crisp=!0,C});return t?e.data.map(u=>d(u,l,c)):d(e.data,l,c)}function X5(e,t,s,i){const r=[],a=[];for(const l of t)for(const[c,d]of l)r.push(c),a.push(d);const n=new e.LinearScale;n.domain=[Math.min(...r),Math.max(...r)],n.range=[i,s-i];const o=new e.LinearScale;return o.domain=[Math.min(...a),Math.max(...a)],o.range=[s-i,i],{xScale:n,yScale:o}}function ag(e,t,s,i){const r=[0,t[0].length-1],a=t.reduce((l,c)=>{for(const d of c)d<l[0]&&(l[0]=d),d>l[1]&&(l[1]=d);return l},[1/0,-1/0]);a[0]--,a[a.length-1]++;const n=new e.LinearScale;n.domain=r,n.range=[i,s-i];const o=new e.LinearScale;return o.domain=a,o.range=[s-i,i],{xScale:n,yScale:o}}function ng(e,t,s){return e.map(i=>i.map((r,a)=>[a>0?"lineTo":"moveTo",t.convert(a),s.convert(r)]))}function Z5(e,t,s){return e.map(([i,r],a)=>[a>0?"lineTo":"moveTo",t.convert(i),s.convert(r)])}function J5(e){const t=e[0],s=e[1],i=rg(e);return(s[1]!==i[1]||s[2]!==i[2])&&e.push([t[0],s[1],s[2]]),e}function og(e,t){const s=new e.Path;return t.forEach(([i,r,a])=>s.path[i](r,a)),s}function Q5(e,t,s){return e.map((i,r,a)=>{const o=[...s?eU(a,r,t):lg(i,t)].reverse().map(([d,u,h])=>["lineTo",u,h]),l=i[0],c=rg(o);return(l[1]!==c[1]||l[2]!==c[2])&&o.push(["lineTo",l[1],l[2]]),[...i,...o]})}function eU(e,t,s){return t===0?lg(e[t],s):[...e[t-1]]}function lg(e,t){return e.map(([s,i])=>[s,i,t.convert(0)])}function cg(e,t){const s=og(e,t);return s.fill=void 0,s.lineCap="round",s.strokeWidth=3,s}function tU({_Scene:e},t,s,i,r){const{xScale:a,yScale:n}=X5(e,s,i,r),d=s.map(h=>Z5(h,a,n)).map(h=>J5(h)).map(h=>cg(e,h)).reduce((h,p)=>h.concat(p),[]),u=new e.Group;return u.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),u.append(d),t.append(u),d}function uo({_Scene:e},t,s,i,r){const{xScale:a,yScale:n}=ag(e,s,i,r),l=ng(s,a,n).map(d=>cg(e,d)),c=new e.Group;return c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),c.append(l),t.append(c),l}function sU(e,t,s,i,r,a=!1){const{xScale:n,yScale:o}=ag(e,s,i,r),l=Q5(ng(s,n,o),o,a),c=new e.Group;c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2));const d=l.map(u=>og(e,u));return c.append(d),t.append(c),d}function dg(e){return e.map((t,s,i)=>t.map((r,a)=>i.slice(0,s+1).reduce((n,o)=>n+o[a],0)))}function ug(e){const t=e.map((s,i)=>e.reduce((r,a)=>Math.max(r,a[i]),0));return e.map(s=>s.map((i,r)=>i/t[r]*19))}function hg(e,t,s,i,r,a,n=0){const{_Scene:o}=e,l=new o.LinearScale;l.domain=[0,7],l.range=[-Math.PI,Math.PI].map(g=>g+Math.PI/2);const c=new o.LinearScale;c.domain=[0,10],c.range=[r,a];const d=[],u=i/2,h=s.map(g=>{const f=new o.Path;return f.strokeWidth=1,f.strokeOpacity=.5,f.lineCap="round",f.fill=void 0,f.fillOpacity=.8,g.forEach((m,C)=>{const v=l.convert(C),S=r+a-c.convert(m),b=S*Math.cos(v)+u,y=S*Math.sin(v)+u;if(f.path[C>0?"lineTo":"moveTo"](b,y),n>0){const w=new o.Marker({shape:"circle"});w.x=b,w.y=y,w.size=n,d.push(w)}}),f.path.closePath(),f}),p=new o.Group;return p.append([...h,...d]),t.append(p),{paths:h,markers:d}}function Tr(e){let[t,s]=[1/0,-1/0];return{processedData:e.reduce((r,a,n)=>{const o=n>0?r[n-1]:void 0;r[n]??(r[n]=[]);const l=r[n];return a.forEach((c,d)=>{o&&(c+=o[d]),l[d]=c,l[d]<t&&(t=l[d]),l[d]>s&&(s=l[d])}),r},[]),min:t,max:s}}var iU=[[[13,16],[13,12],[3,12],[3,16]],[[12,11],[12,7],[4,7],[4,11]],[[10.125,6],[10.125,1.5],[5.875,1.5],[5.875,6]]],ho=class extends At{constructor(e,t,s,i,r,a="funnelTooltip",n=iU){super(e,t,a),this.shapes=tU(t,this.root,n,this.size,this.padding),this.updateColors(s,i)}updateColors(e,t){for(const s of this.shapes)s.fill=e[0],s.stroke=t[0],s.strokeWidth=0}},rU={chartType:"funnel",miniChart:ho},aU=[[[13,16],[10.75,11.5],[5.25,11.5],[3,16]],[[10.75,11.5],[8.875,6],[7.125,6],[5.25,11.5]],[[8.875,6],[8.875,1.5],[7.125,1.5],[7.125,6]]],nU=class extends ho{constructor(e,t,s,i,r,a="coneFunnelTooltip"){super(e,t,s,i,r,a,aU)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[0],s.fillOpacity=1-i*.2,s.stroke=t[0],s.strokeWidth=0})}},oU={chartType:"coneFunnel",miniChart:nU},lU=[[[8,16],[10,12],[6,12]],[[10.5,11],[12.5,7],[3.5,7],[5.5,11]],[[13,6],[15.5,1.5],[.5,1.5],[3,6]]],cU=class extends ho{constructor(e,t,s,i,r,a="pyramidTooltip"){super(e,t,s,i,r,a,lU)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=0})}},dU={chartType:"pyramid",miniChart:cU},de=class extends At{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.axisOvershoot=3}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=new e.Line;i.x1=s,i.y1=s,i.x2=s,i.y2=t-s+this.axisOvershoot,i.stroke=this.stroke;const r=new e.Line;r.x1=s-this.axisOvershoot+1,r.y1=t-s,r.x2=t-s+1,r.y2=t-s,r.stroke=this.stroke;const a=this.root;a.append(i),a.append(r),super.postConstruct()}},uU=class extends de{constructor(e,t,s,i){super(e,t,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:r,columnData:a,size:n,padding:o}=this;this.columns=ii({stacked:!1,root:r,data:a,size:n,padding:o,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3,agChartsExports:t}),r.append(this.columns),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},hU={chartType:"groupedColumn",miniChart:uU};import{_flatten as pU}from"ag-grid-community";var gU=[[8,12,16],[6,9,12],[2,3,4]],pg=class extends de{constructor(e,t,s,i,r,a=gU,n=[0,16],o="stackedColumnTooltip"){super(e,t,o);const{root:l,size:c,padding:d}=this;this.stackedColumns=ii({stacked:!0,root:l,data:a,size:c,padding:d,xScaleDomain:[0,1,2],yScaleDomain:n,xScalePadding:.3,agChartsExports:t}),l.append(pU(this.stackedColumns)),this.updateColors(s,i)}updateColors(e,t){this.stackedColumns.forEach((s,i)=>{for(const r of s)r.fill=e[i],r.stroke=t[i]})}},fU={chartType:"stackedColumn",miniChart:pg},mU=[[10,10,10],[6,7,8],[2,4,6]],CU=class extends pg{constructor(e,t,s,i,r){super(e,t,s,i,r,mU,[0,10],"normalizedColumnTooltip")}},vU={chartType:"normalizedColumn",miniChart:CU},SU=class extends de{constructor(e,t,s,i){super(e,t,"groupedBarTooltip");const{_Scene:r}=t,a=this.padding,n=this.size,o=[2,3,4],l=new r.CategoryScale;l.domain=[0,1,2],l.range=[a,n-a],l.paddingInner=.3,l.paddingOuter=.3;const c=new r.LinearScale;c.domain=[0,4],c.range=[n-a,a];const d=c.convert(0),u=l.bandwidth;this.bars=o.map((h,p)=>{const g=new r.Rect;return g.x=a,g.y=l.convert(p),g.width=d-c.convert(h),g.height=u,g.strokeWidth=0,g.crisp=!0,g}),this.updateColors(s,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},bU={chartType:"groupedBar",miniChart:SU};import{_flatten as yU}from"ag-grid-community";var wU=[[8,12,16],[6,9,12],[2,3,4]],gg=class extends de{constructor(e,t,s,i,r,a=wU,n=[0,16],o="stackedBarTooltip"){super(e,t,o);const{_Scene:l}=t,c=this.size,d=this.padding,u=new l.CategoryScale;u.domain=[0,1,2],u.range=[d,c-d],u.paddingInner=.3,u.paddingOuter=.3;const h=new l.LinearScale;h.domain=n,h.range=[c-d,d];const p=h.convert(0),g=u.bandwidth;this.bars=a.map(f=>f.map((m,C)=>{const v=new l.Rect;return v.x=d,v.y=u.convert(C),v.width=p-h.convert(m),v.height=g,v.strokeWidth=0,v.crisp=!0,v})),this.updateColors(s,i),this.root.append(yU(this.bars))}updateColors(e,t){this.bars.forEach((s,i)=>s.forEach(r=>{r.fill=e[i],r.stroke=t[i]}))}},xU={chartType:"stackedBar",miniChart:gg},FU=[[10,10,10],[6,7,8],[2,4,6]],RU=class extends gg{constructor(e,t,s,i,r){super(e,t,s,i,r,FU,[0,10],"normalizedBarTooltip")}},AU={chartType:"normalizedBar",miniChart:RU},fg=class extends At{constructor(e,t,s,i,r,a=.6,n="donutTooltip"){super(e,t,n);const{size:o,padding:l,agChartsExports:{_Scene:c}}=this,d=(o-l*2)/2,u=d+l,h=c.toRadians,p=[[h(-90),h(30)],[h(30),h(120)],[h(120),h(180)],[h(180),h(210)],[h(210),h(240)],[h(240),h(270)]];this.sectors=p.map(([g,f])=>{const m=new c.Sector;return m.centerX=u,m.centerY=u,m.innerRadius=d*a,m.outerRadius=d,m.startAngle=g,m.endAngle=f,m.stroke=void 0,m.strokeWidth=0,m.inset=.75,m}),this.updateColors(s,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((s,i)=>{s.fill=e[i%e.length],s.stroke=t[i%t.length]})}},mg={chartType:"donut",miniChart:fg},MU=class extends fg{constructor(e,t,s,i,r){super(e,t,s,i,r,0,"pieTooltip")}},TU={chartType:"pie",miniChart:MU},po=[[1,3,5],[2,6,4],[5,3,1]],go=class extends de{constructor(e,t,s,i,r,a=po,n="lineTooltip"){super(e,t,n);const{size:o,padding:l,root:c}=this;this.lines=uo(t,c,a,o,l),this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{s.stroke=e[i]})}},PU={chartType:"line",miniChart:go},Cg=dg(po),IU=class extends go{constructor(e,t,s,i,r,a=Cg,n="stackedLineTooltip"){super(e,t,s,i,r,a,n)}},EU={chartType:"stackedLine",miniChart:IU},DU=ug(Cg),LU=class extends go{constructor(e,t,s,i,r,a=DU,n="normalizedLineTooltip"){super(e,t,s,i,r,a,n)}},kU={chartType:"normalizedLine",miniChart:LU},GU=class extends de{constructor(e,t,s,i){super(e,t,"scatterTooltip");const{size:r,padding:a,agChartsExports:{_Scene:n}}=this,o=[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]],l=new n.LinearScale;l.domain=[-.5,4],l.range=[a*2,r-a];const c=new n.LinearScale;c.domain=[-.5,3.5],c.range=[r-a,a];const d=[];o.forEach(h=>{h.forEach(([p,g])=>{const f=new n.Arc;f.strokeWidth=0,f.centerX=l.convert(p),f.centerY=c.convert(g),f.radius=2.5,d.push(f)})}),this.points=d,this.updateColors(s,i);const u=new n.Group;u.setClipRect(new n.BBox(a,a,r-a*2,r-a*2)),u.append(this.points),this.root.append(u)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},OU={chartType:"scatter",miniChart:GU},_U=class extends de{constructor(e,t,s,i){super(e,t,"bubbleTooltip");const{size:r,padding:a,agChartsExports:{_Scene:n}}=this,o=[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]],l=new n.LinearScale;l.domain=[0,1],l.range=[a*2,r-a];const c=new n.LinearScale;c.domain=[0,1],c.range=[r-a,a];const d=[];o.forEach(h=>{h.forEach(([p,g,f])=>{const m=new n.Arc;m.strokeWidth=0,m.centerX=l.convert(p),m.centerY=c.convert(g),m.radius=f,m.fillOpacity=.7,d.push(m)})}),this.points=d,this.updateColors(s,i);const u=new n.Group;u.setClipRect(new n.BBox(a,a,r-a*2,r-a*2)),u.append(this.points),this.root.append(u)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},NU={chartType:"bubble",miniChart:_U},vg=po,Sg=class extends de{constructor(e,t,s,i,r,a=vg,n="groupedAreaTooltip",o=!1){super(e,t,n),this.areas=sU(t._Scene,this.root,a,this.size,this.padding,o),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=1,s.strokeOpacity=.75,s.fillOpacity=.7})}},BU={chartType:"area",miniChart:Sg},bg=dg(vg),yg=class extends Sg{constructor(e,t,s,i,r,a=bg,n="stackedAreaTooltip"){super(e,t,s,i,r,a,n,!0)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},VU={chartType:"stackedArea",miniChart:yg},HU=ug(bg),zU=class extends yg{constructor(e,t,s,i,r,a=HU,n="normalizedAreaTooltip"){super(e,t,s,i,r,a,n)}},UU={chartType:"normalizedArea",miniChart:zU},WU=class extends de{constructor(e,t,s,i){super(e,t,"histogramTooltip");const{padding:r,size:a,agChartsExports:{_Scene:n}}=this,o=[2,5,11,13,10,6,1],l=new n.LinearScale;l.domain=[0,o.length],l.range=[r,a-r];const c=new n.LinearScale;c.domain=[0,o.reduce((u,h)=>Math.max(u,h),0)],c.range=[a-r,r];const d=c.convert(0);this.bars=o.map((u,h)=>{const p=c.convert(u),g=l.convert(h),f=l.convert(h+1),m=new n.Rect;return m.x=g,m.y=p,m.width=f-g,m.height=d-p,m.strokeWidth=1,m.strokeOpacity=.75,m.crisp=!0,m}),this.updateColors(s,i),this.root.append(this.bars)}updateColors([e],[t]){for(const s of this.bars)s.fill=e,s.stroke=t}},KU={chartType:"histogram",miniChart:WU},cs=class extends At{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=s*2,r=(t-i)/2,a=this.showAngleAxisLines?[r,r*.8,r*.6,r*.4]:[],n=new e.Line;n.x1=t/2,n.y1=s,n.x2=t/2,n.y2=t-s-r-a[a.length-1],n.stroke=this.stroke,n.strokeOpacity=.5,n.fill=void 0,n.visible=this.showRadiusAxisLine;const o=s+r;this.gridLines=a.map((c,d)=>{const u=new e.Path;return u.path.arc(o,o,c,0,2*Math.PI),u.strokeWidth=1,u.stroke=this.stroke,u.strokeOpacity=d===0?.5:.2,u.fill=void 0,u});const l=this.root;l.append(n),this.gridLines.length>0&&l.append(this.gridLines),super.postConstruct()}},$U=class extends cs{constructor(e,t,s,i){super(e,t,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:r,size:a,data:n,agChartsExports:{_Scene:o}}=this,l=(a-r*2)/2,d=l*.4,u=new o.CategoryScale;u.domain=n[0].map((C,v)=>v),u.range=[0,2*Math.PI],u.paddingInner=0,u.paddingOuter=0;const h=u.bandwidth*.7,{processedData:p,max:g}=Tr(n),f=new o.LinearScale;f.domain=[0,g],f.range=[d,l];const m=this.size/2;this.series=p.map((C,v)=>{const b=v===0?void 0:p[v-1],y=new o.TranslatableGroup({zIndex:1e6}),w=C.map((M,T)=>{const F=b?.[T],I=f.convert(M),E=f.convert(F??0),P=u.convert(T),N=P+h,k=o.getRadialColumnWidth(P,N,l,.5,.5),A=new o.RadialColumnShape;return A.columnWidth=k,A.innerRadius=E,A.outerRadius=I,A.startAngle=P,A.endAngle=N,A.isBeveled=!0,A.axisInnerRadius=d,A.axisOuterRadius=l,A.stroke=void 0,A.strokeWidth=0,A});return y.append(w),y.translationX=m,y.translationY=m,y}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},jU={chartType:"radialColumn",miniChart:$U},YU=class extends cs{constructor(e,t,s,i){super(e,t,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const{size:r,padding:a,data:n,agChartsExports:{_Scene:o}}=this,l=(r-a)/2,d=l*.4,u=new o.CategoryScale;u.domain=n[0].map((S,b)=>b),u.range=[d,l],u.paddingInner=.5,u.paddingOuter=0;const h=u.bandwidth,{processedData:p,max:g}=Tr(n),f=new o.LinearScale;f.domain=[0,Math.ceil(g*1.5)];const m=3/2*Math.PI,C=m+2*Math.PI;f.range=[m,C];const v=r/2;this.series=p.map((S,b)=>{const y=b<0?void 0:p[b-1],w=new o.Group({zIndex:1e6}),M=S.map((T,F)=>{const I=y?.[F]??0,E=u.convert(F),P=E-h,N=f.convert(I),k=f.convert(T),A=new o.Sector;return A.centerX=v,A.centerY=v,A.innerRadius=P,A.outerRadius=E,A.startAngle=N,A.endAngle=k,A.stroke=void 0,A.strokeWidth=0,A});return w.append(M),w}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},qU={chartType:"radialBar",miniChart:YU},XU=class extends cs{constructor(e,t,s,i){super(e,t,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const{size:r,padding:a,root:n,data:o}=this,l=(r-a*2)/2,c=0,{paths:d,markers:u}=hg(t,n,o,r,l,c,this.markerSize);this.lines=d,this.markers=u,this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{const r=this.data[i].length;s.stroke=e[i];const a=i*r,n=a+r,o=this.markers.slice(a,n);for(const l of o)l.stroke=t[i],l.fill=e[i]})}},ZU={chartType:"radarLine",miniChart:XU},JU=class extends cs{constructor(e,t,s,i){super(e,t,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]];const{size:r,padding:a,root:n,data:o}=this;this.showRadiusAxisLine=!1;const l=(r-a*2)/2,c=l-r*.3;this.areas=hg(t,n,o,r,l,c).paths,this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},QU={chartType:"radarArea",miniChart:JU},eW=class extends cs{constructor(e,t,s,i){super(e,t,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const{size:r,padding:a,data:n,agChartsExports:{_Scene:o}}=this,l=(r-a*2)/2,c=new o.CategoryScale;c.domain=n[0].map((f,m)=>m),c.range=[-Math.PI,Math.PI],c.paddingInner=0,c.paddingOuter=0;const d=c.bandwidth*.7,{processedData:u,max:h}=Tr(n),p=new o.LinearScale;p.domain=[0,h],p.range=[0,l];const g=r/2;this.series=u.map((f,m)=>{const C=m<0?void 0:u[m-1],v=new o.Group({zIndex:1e6}),S=f.map((b,y)=>{const w=C?.[y],M=p.convert(b),T=p.convert(w??0),F=c.convert(y),I=F+d,E=new o.Sector;return E.centerX=g,E.centerY=g,E.innerRadius=T,E.outerRadius=M,E.startAngle=F,E.endAngle=I,E.stroke=void 0,E.strokeWidth=0,E});return v.append(S),v}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},tW={chartType:"nightingale",miniChart:eW},sW=class extends de{constructor(e,t,s,i){super(e,t,"rangeBarTooltip");const r=[3,3.5,3];this.bars=this.createRangeBar(this.root,r,this.size,this.padding,"vertical"),this.updateColors(s,i)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}createRangeBar(e,t,s,i,r){const a=r==="horizontal",n=2*i,{_Scene:o}=this.agChartsExports,l=new o.CategoryScale;l.domain=t.map((g,f)=>f),l.range=[i,s-i],l.paddingInner=.3,l.paddingOuter=.3;const c=.7,d=1.3,u=new o.LinearScale;u.domain=[t.reduce((g,f)=>Math.min(g,f),1/0)*c,t.reduce((g,f)=>Math.max(g,f),0)*d],u.range=[n,s-n];const h=l.bandwidth,p=t.map((g,f)=>{const[m,C]=[g*c,g*d],v=l.convert(f),S=u.convert(m),b=u.convert(C)-S,y=new o.Rect;return y.x=a?S:v,y.y=a?v:S,y.width=a?b:h,y.height=a?h:b,y.strokeWidth=0,y.crisp=!0,y});return e.append(p),p}},iW={chartType:"rangeBar",miniChart:sW},rW=class extends de{constructor(e,t,s,i){super(e,t,"rangeAreaTooltip");const r=4,a=[fo({offset:.375*r,length:r,pattern:{low:3,high:5,period:r}}),fo({offset:.375*r,length:r,pattern:{low:2.25,high:4.25,period:r}}),fo({offset:.75*r,length:r,pattern:{low:2.5,high:4.5,period:r}})],n=1.75,o=a.map(d=>d.map(([u,h])=>({x:u,low:h-.5*n,high:h+.5*n}))),{lines:l,areas:c}=this.createRangeArea(this.root,o,this.size,this.padding);this.lines=l,this.areas=c,this.updateColors(s,i)}updateColors(e,t){e=xg(e,1,2),t=xg(t,1,2),this.lines.forEach(([s,i],r)=>{s.fill=void 0,s.stroke=t[r],i.fill=void 0,i.stroke=t[r]}),this.areas.forEach((s,i)=>{s.fill=e[i]})}createRangeArea(e,t,s,i){const r=t.reduce((f,m)=>m.reduce((C,{x:v})=>Math.min(C,v),f),1/0),a=t.reduce((f,m)=>m.reduce((C,{x:v})=>Math.max(C,v),f),-1/0),n=t.reduce((f,m)=>m.reduce((C,{low:v})=>Math.min(C,v),f),1/0),o=t.reduce((f,m)=>m.reduce((C,{high:v})=>Math.max(C,v),f),-1/0),{_Scene:l}=this.agChartsExports,c=new l.LinearScale;c.domain=[r,a],c.range=[i,s-i];const d=2*i,u=new l.LinearScale;u.domain=[n,o],u.range=[s-d,d];const h=[],p=[];return t.map(f=>{const m=new l.Path,C=new l.Path,v=new l.Path;return h.push([m,C]),p.push(v),m.strokeWidth=0,C.strokeWidth=0,v.strokeWidth=0,v.fillOpacity=.8,m.path.clear(),C.path.clear(),v.path.clear(),f.map((S,b)=>{const{x:y,low:w,high:M}=S,T=c.convert(y),F=u.convert(w),I=u.convert(M),E=b>0?"lineTo":"moveTo";return m.path[E](T,I),C.path[E](T,F),v.path[E](T,I),[T,F]})}).forEach((f,m)=>{const C=f.length-1,v=p[m];for(let S=C;S>=0;S--){const[b,y]=f[S];v.path.lineTo(b,y)}}),e.append(p.concat(...h)),{lines:h,areas:p}}};function fo(e){const{offset:t,length:s,pattern:i}=e,r=o(t,s,i),a=0,n=s;return(r.length===0||r[0][0]!==a)&&r.unshift(l(a,t,i)),r[r.length-1][0]!==n&&r.push(l(n,t,i)),r;function o(d,u,h){const{period:p}=h,g=d/p,m=[0,.5].map(v=>v-g).map(wg).sort((v,S)=>v-S);return Array.from({length:Math.floor(m.length*(p/u))},(v,S)=>m[S%m.length]+Math.floor(S/m.length)).map(v=>v*p).map(v=>l(v,d,h))}function l(d,u,h){return[d,c(u+d,h)]}function c(d,u){const{low:h,high:p,period:g}=u,f=wg(d/g),m=f>.5?1-2*(f-.5):2*f;return h+(p-h)*m}}function wg(e){const t=e%1;return t<0?t+1:t}function xg(e,t,s){const i=[...e],r=i[t];return i[t]=i[s],i[s]=r,i}var aW={chartType:"rangeArea",miniChart:rW},nW=class extends de{constructor(e,t,s,i,r){super(e,t,"boxPlotTooltip");const{size:a,padding:n,agChartsExports:{_Scene:o}}=this,l=[11,11.5,10.5],c=1.2,d=1.1,u=.9,h=.8,p=new o.LinearScale;p.domain=[l.reduce((C,v)=>Math.min(C,v),1/0)*h,l.reduce((C,v)=>Math.max(C,v),0)*c],p.range=[a-1.5*n,n];const g=new o.CategoryScale;g.domain=l.map((C,v)=>v),g.range=[n,a-n],g.paddingInner=.4,g.paddingOuter=.2;const f=Math.round(g.bandwidth),m=Math.round(g.bandwidth/2);this.boxPlotGroups=l.map((C,v)=>{const[S,b,y,w]=[C*h,C*u,C*d,C*c],M=Math.round(p.convert(y)),T=Math.round(g.convert(v)),F=Math.round(T+f),I=Math.round(p.convert(b)),E=Math.round(p.convert(S)),P=Math.round(p.convert(C)),N=Math.round(p.convert(w)),k=T+m,A=new o.Group,L=new o.Rect,_=new o.Line,j=new o.Line,W=new o.Line,Z=new o.Line,Ce=new o.Line;return L.x=T,L.y=M,L.width=f,L.height=I-M,L.strokeWidth=1,L.strokeOpacity=.75,L.crisp=!0,this.setLineProperties(_,T,F,P,P),this.setLineProperties(j,k,k,N,M),this.setLineProperties(W,k,k,E,I),this.setLineProperties(Z,T,F,N,N),this.setLineProperties(Ce,T,F,E,E),A.append([L,_,j,W,Z,Ce]),A}),this.updateColors(s,i,r),this.root.append(this.boxPlotGroups)}updateColors(e,t,s){const{_Theme:i}=this.agChartsExports;this.boxPlotGroups.forEach((r,a)=>{for(const n of r.children()){const o=e[a%e.length];n.fill=s?o:i.resolveOperation({$mix:[o,{$ref:"backgroundColor"},.7]}),n.stroke=t[a%t.length]}})}setLineProperties(e,t,s,i,r){e.x1=t,e.x2=s,e.y1=i,e.y2=r,e.strokeOpacity=.75}},oW={chartType:"boxPlot",miniChart:nW},lW=class extends At{constructor(e,t,s,i,r){super(e,t,"treemapTooltip");const{size:a,padding:n,agChartsExports:{_Scene:o}}=this,l=[[1,1],[3,2,1]],d=l.length%2===0?.3:.2,u=[n,a-n],h=l.length,p=h*(h+1)/2,g=d/(h-1),f=u[1]-u[0],m=f-d;let C=u[0];this.rects=l.reduce((S,b,y)=>{S??(S=[]);const w=(h-y)/p,M=m*w,T=b.length,F=b.reduce((k,A)=>k+A,0),I=d/(T-1||1),E=T>1?f-d:f;let P=u[0];const N=b.map(k=>{const A=new o.Rect,L=E*k/F;return A.x=C,A.y=P,A.width=M,A.height=L,A.strokeWidth=.75,A.crisp=!0,P+=L+I,A});return C+=M+g,S.push(...N),S},[]),this.updateColors(s,i,r);const v=new o.Group;v.setClipRect(new o.BBox(n,n,a-n,a-n)),v.append(this.rects),this.root.append(v)}updateColors(e,t,s){const{_Theme:i}=this.agChartsExports;this.rects.forEach((r,a)=>{r.fill=e[a%t.length],r.stroke=s?t[a%t.length]:i.resolveOperation({$ref:"backgroundColor"})})}},cW={chartType:"treemap",miniChart:lW},dW=class extends cs{constructor(e,t,s,i){super(e,t,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:r,size:a,padding:n,angleOffset:o,innerRadiusRatio:l,agChartsExports:{_Scene:c}}=this,d=(a-n*2)/2,u=[o+0,o+2*Math.PI],h=Math.abs(u[1]-u[0]),p=[d*l,d],g=Math.abs(p[1]-p[0]);let f=0;const m=(y,w)=>{for(const M of y){const T=w+1;f=Math.max(f,T),m(M,T)}};m(r,0);const C=g/f,v=this.size/2,S=u[0];this.series=[];const b=(y,w,M,T,F)=>{if(!Array.isArray(y))return;const E=w+1;let P=M;y.forEach((N,k,A)=>{let L=F;L||(L=new c.Group,this.series.push(L));const _=p[0]+w*C,j=p[0]+E*C,W=1/A.length,Z=P,Ce=Z+T*W,O=new c.Sector;O.centerX=v,O.centerY=v,O.innerRadius=_,O.outerRadius=j,O.startAngle=Z,O.endAngle=Ce,O.stroke=void 0,O.strokeWidth=0,O.inset=.75,P=Ce,L.append(O),b(N,E,Z,Math.abs(Ce-Z),L)})};b(r,0,S,h),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},uW={chartType:"sunburst",miniChart:dW},hW=class extends At{constructor(e,t,s,i,r){super(e,t,"heatmapTooltip");const{size:a,padding:n,agChartsExports:{_Scene:o}}=this,l=3,c=Array.from({length:l},(m,C)=>Array.from({length:l},(v,S)=>S)),d=c.map((m,C)=>C),u=new o.CategoryScale;u.domain=d,u.range=[n,a-n],u.paddingInner=.01,u.paddingOuter=.1;const h=new o.CategoryScale;h.domain=d,h.range=[n,a-n],h.paddingInner=.01,h.paddingOuter=.1;const p=u.bandwidth??0,g=h.bandwidth??0;this.rects=c.reduce((m,C,v)=>{m??(m=[]);const S=C.map((b,y)=>{const w=new o.Rect;return w.x=u.convert(v),w.y=h.convert(y),w.width=p,w.height=g,w.strokeWidth=0,w.crisp=!0,w});return m.push(...S),m},[]),this.updateColors(s,i,r);const f=new o.Group;f.setClipRect(new o.BBox(n,n,a-n,a-n)),f.append(this.rects),this.root.append(f)}updateColors(e,t,s){const{_Theme:i,_Util:r}=this.agChartsExports,a=s?[e[0],e[1]]:i.resolveOperation({$palette:"divergingColors"}),n=s?t[0]:i.resolveOperation({$ref:"backgroundColor"}),o=r.interpolateColor(a[0],a[1]);this.rects.forEach((l,c)=>{l.fill=o(c*.2),l.stroke=n})}},pW={chartType:"heatmap",miniChart:hW},gW=class extends de{constructor(e,t,s,i,r){super(e,t,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(s,i,r)}updateColors(e,t,s){const{data:i,agChartsExports:{_Theme:r}}=this,a={fill:s?e[0]:r.resolveOperation({$palette:"altUp.fill"}),stroke:s?t[0]:r.resolveOperation({$palette:"altUp.stroke"})},n={fill:s?e[1]:r.resolveOperation({$palette:"altDown.fill"}),stroke:s?t[1]:r.resolveOperation({$palette:"altDown.stroke"})};this.bars.forEach((o,l)=>{const c=i[l]>=0;o.fill=c?a.fill:n.fill,o.stroke=c?a.stroke:n.stroke})}createWaterfall(e,t,s,i,r){const a=2*i,{processedData:n,min:o,max:l}=Tr(t.map(S=>[S])),c=n.reduce((S,b)=>S.concat(b),[]),{_Scene:d}=this.agChartsExports,u=new d.LinearScale;u.domain=[Math.min(o,0),l],u.range=[s-a,a];const h=new d.CategoryScale;h.domain=t.map((S,b)=>b),h.range=[i,s-i],h.paddingInner=.2,h.paddingOuter=.3;const p=h.bandwidth,g=new d.Path;g.stroke="#575757",g.strokeWidth=0;const f=Math.floor(g.strokeWidth)%2/2,m=g.path;m.clear();const C=r==="horizontal",v=c.map((S,b)=>{const y=b>0?c[b-1]:0,M=t[b]>0,T=Math.round(u.convert(S)),F=Math.round(u.convert(y)),I=(M?T:F)-f,E=(M?F:T)+f,P=Math.abs(E-I),N=h.convert(b),k=new d.Rect;k.x=C?I:N,k.y=C?N:I,k.width=C?P:p,k.height=C?p:P,k.strokeWidth=0,k.crisp=!0;const A=T+f,L=F+f;if(b>0){const W=C?L:k.x,Z=C?k.y:L;m.lineTo(W,Z)}const _=C?A:k.x,j=C?k.y:A;return m.moveTo(_,j),k});return e.append([g,...v]),{bars:v}}},fW={chartType:"waterfall",miniChart:gW},mW=class extends de{constructor(e,t,s,i){super(e,t,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:a,lineData:n,size:o,padding:l}=this;this.columns=ii({stacked:!1,root:r,data:a,size:o,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=uo(t,r,n,o,l),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}},CW={chartType:"columnLineCombo",miniChart:mW},vW=class extends de{constructor(e,t,s,i){super(e,t,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:r,columnData:a,areaData:n,size:o,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=ii({stacked:!1,root:r,data:a,size:o,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5,agChartsExports:t});const d=new c.CategoryScale;d.range=[l,o-l],d.domain=[0,1,2,3,4],d.paddingInner=1,d.paddingOuter=0;const u=new c.LinearScale;u.range=[o-l,l],u.domain=[0,6];const h=[],p=u.convert(0),g=d.convert(0);n.forEach((C,v)=>{const S=h[v]||(h[v]=[]);C.forEach((y,w)=>{const M=y,T=w,F=d.convert(T),I=u.convert(M);S[w]={x:F,y:I}});const b=d.convert(C.length-1);h[v].push({x:b,y:p},{x:g,y:p})}),this.areas=h.map(C=>{const v=new c.Path;v.strokeWidth=0,v.fillOpacity=.8;const S=v.path;return C.forEach((b,y)=>S[y>0?"lineTo":"moveTo"](b.x,b.y)),v});const f=new c.Group;f.setClipRect(new c.BBox(l,l,o-l*2,o-l*2));const m=new c.Group;m.setClipRect(new c.BBox(l,l,o-l*2,o-l*2)),f.append(this.areas),m.append(this.columns),r.append(f),r.append(m),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.columns.forEach((s,i)=>{s.fill=e[i+1],s.stroke=t[i+1]})}},SW={chartType:"areaColumnCombo",miniChart:vW},bW=class extends At{constructor(e,t,s,i){super(e,t,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:a,lineData:n,size:o,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=ii({stacked:!1,root:r,data:a,size:o,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=uo(this.agChartsExports,r,n,o,l);const d="grey",u=3,h=new c.Line;h.x1=l,h.y1=l,h.x2=l,h.y2=o-l+u,h.stroke=d;const p=new c.Line;p.x1=l-u+1,p.y1=o-l,p.x2=o-l+1,p.y2=o-l,p.stroke=d;const g=new c.Path;this.buildPenIconPath(g),g.fill="whitesmoke",g.stroke="darkslategrey",g.strokeWidth=1,r.append([p,h,g]),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}},yW={chartType:"customCombo",miniChart:bW},Fg={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:hU},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:fU},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:vU}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:bU},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:xU},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:AU}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:TU},donut:{range:!0,pivot:!0,enterprise:!1,icon:mg},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:mg}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:PU},stackedLine:{range:!0,pivot:!0,enterprise:!1,icon:EU},normalizedLine:{range:!0,pivot:!0,enterprise:!1,icon:kU}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:OU},bubble:{range:!0,pivot:!0,enterprise:!1,icon:NU}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:BU},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:VU},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:UU}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:ZU},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:QU},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:tW},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:jU},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:qU}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:oW},histogram:{range:!0,pivot:!1,enterprise:!1,icon:KU},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:iW},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:aW}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:cW},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:uW}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:pW},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:fW}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:CW},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:SW},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:yW}},funnelGroup:{funnel:{range:!0,pivot:!1,enterprise:!0,icon:rU},coneFunnel:{range:!0,pivot:!1,enterprise:!0,icon:oU},pyramid:{range:!0,pivot:!1,enterprise:!0,icon:dU}}},wW={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line","stackedLine","normalizedLine"],areaGroup:["area","stackedArea","normalizedArea"],scatterGroup:["scatter","bubble"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],funnelGroup:["funnel","coneFunnel","pyramid"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},xW=class extends K5{constructor(e,t,s,i,r=wW){super('<div class="ag-chart-settings-mini-wrapper"></div>'),this.wrappers=new Map,this.chartController=e,this.fills=t,this.strokes=s,this.isCustomTheme=i,this.chartGroups={...r}}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(a=>a!=="customCombo"));const e=this.getGui(),t=this.chartController.isEnterprise(),s=this.chartController.isPivotChart(),i=!s,r=Object.keys(this.chartGroups).map(a=>{const n=a in Fg?Fg[a]:void 0;if(!n)return ig(148,{group:a}),null;const l=(this.chartGroups[a]??[]).map(c=>{const d=c in n?n[c]:void 0;return d?!t&&d.enterprise?null:i&&d.range||s&&d.pivot?d:null:(ig(149,{group:a,chartType:c}),null)}).filter(c=>c!=null);return l.length===0?null:{label:this.chartTranslation.translate(a),items:l}}).filter(a=>a!=null);for(const{label:a,items:n}of r){const o=this.createBean(new Ae({title:a,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal",suppressKeyboardNavigation:!0}));for(const l of n){const{miniChart:c,chartType:d}=l.icon,u=document.createElement("div");u.classList.add("ag-chart-mini-thumbnail"),u.setAttribute("tabindex","0"),u.setAttribute("role","button");const h=d,p=()=>{this.chartController.setChartType(h),this.updateSelectedMiniChart()};this.addManagedListeners(u,{click:p,keydown:g=>{(g.key==sg.ENTER||g.key===sg.SPACE)&&(g.preventDefault(),p())}}),this.wrappers.set(h,u),this.createBean(new c(u,this.beans.agChartsExports,this.fills,this.strokes,this.isCustomTheme)),o.addItem(u)}e.appendChild(o.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();this.wrappers.forEach((t,s)=>{const i=s===e;t.classList.toggle("ag-selected",i);const r=this.chartTranslation.translate(to(s)),a=i?`${r}. ${this.chartTranslation.translate("ariaChartSelected")}`:r;$5(t,a)})}destroy(){this.wrappers.clear(),super.destroy()}},FW=class extends H5{constructor(e){super(`<div class="ag-chart-settings-wrapper">
|
||
<div data-ref="eMiniChartsContainer" class="ag-chart-settings-mini-charts-container ag-scrollable-container"></div>
|
||
<div data-ref="eNavBar" class="ag-chart-settings-nav-bar">
|
||
<div data-ref="ePrevBtn" class="ag-chart-settings-prev">
|
||
<button type="button" class="ag-button ag-chart-settings-prev-button"></button>
|
||
</div>
|
||
<div data-ref="eCardSelector" class="ag-chart-settings-card-selector"></div>
|
||
<div data-ref="eNextBtn" class="ag-chart-settings-next">
|
||
<button type="button" class="ag-button ag-chart-settings-next-button"></button>
|
||
</div>
|
||
</div>
|
||
</div>`),this.chartController=e,this.eMiniChartsContainer=si,this.eNavBar=si,this.eCardSelector=si,this.ePrevBtn=si,this.eNextBtn=si,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes();const e=this.gos.get("enableRtl");this.ePrevBtn.insertAdjacentElement("afterbegin",eg(e?"chartsThemeNext":"chartsThemePrevious",this.beans)),this.eNextBtn.insertAdjacentElement("afterbegin",eg(e?"chartsThemePrevious":"chartsThemeNext",this.beans)),this.addManagedElementListeners(this.ePrevBtn,{click:()=>this.setActivePalette(this.getPrev(),"left")}),this.addManagedElementListeners(this.eNextBtn,{click:()=>this.setActivePalette(this.getNext(),"right")});const t=()=>this.resetPalettes(!0);this.addManagedListeners(this.chartController,{chartTypeChanged:t,chartApiUpdate:t}),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=i=>!i.getGui().classList.contains("ag-hidden"),s=this.miniChartsContainers.find(e).getGui().querySelector(".ag-selected");if(s){const i=s.offsetParent;i&&this.eMiniChartsContainer.scrollTo(0,i.offsetTop)}},250)}resetPalettes(e){const t=this.chartController.getPalettes(),s=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(z5(t,this.palettes)&&!e||this.isAnimating)return;this.palettes=t,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(r=>r===this.chartController.getChartThemeName()),this.cardItems=[],Qp(this.eCardSelector),this.destroyMiniCharts();const{themes:i}=this;this.palettes.forEach((r,a)=>{const n=this.activePaletteIndex===a,{fills:o=[],strokes:l=[]}=r,c=i[a],d=!so(c,this.beans.agChartsExports._Theme),u=this.createBean(new xW(this.chartController,o,l,d,s));this.miniChartsContainers.push(u),this.eMiniChartsContainer.appendChild(u.getGui()),this.addCardLink(a),n?u.updateSelectedMiniChart():u.setDisplayed(!1)}),W5(this.eNavBar,this.palettes.length>1),tg(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedElementListeners(t,{click:()=>{this.setActivePalette(e,e<this.activePaletteIndex?"left":"right")}}),this.eCardSelector.appendChild(t),this.cardItems.push(t)}getPrev(){let e=this.activePaletteIndex-1;return e<0&&(e=this.palettes.length-1),e}getNext(){let e=this.activePaletteIndex+1;return e>=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;tg(this.cardItems[e],"ag-selected","ag-not-selected");const s=this.miniChartsContainers[this.activePaletteIndex],i=s.getGui(),r=this.miniChartsContainers[e],a=r.getGui();s.updateSelectedMiniChart(),r.updateSelectedMiniChart();const n=t==="left"?-1:1,o=a.style.left=`${U5(this.getGui())*n}px`;this.activePaletteIndex=e,this.isAnimating=!0;const l="ag-animating";r.setDisplayed(!0),s.addCss(l),r.addCss(l),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{i.style.left=`${-parseFloat(o)}px`,a.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,s.removeCss(l),r.removeCss(l),s.setDisplayed(!1)},300)}destroyMiniCharts(){Qp(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}},RW="data",AW="format",MW=class extends E3{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){for(const e of this.panels){const t=e.replace("chart","").toLowerCase(),s=this.createPanel(t),i=this.createTab(e,t,s);this.tabs.push(i),this.addDestroyFunc(()=>this.destroyBean(s))}this.tabbedLayout=new Qr({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!0,closeButtonAriaLabel:this.chartTranslation.translate("ariaChartMenuClose"),onCloseClicked:()=>{this.eventSource?.focus({preventScroll:!0}),this.dispatchLocalEvent({type:"closed"})}}),this.createBean(this.tabbedLayout)}createTab(e,t,s){const i=Wp({tag:"div",cls:`ag-chart-tab ag-chart-${t}`});this.createBean(s),i.appendChild(s.getGui());const r=this.chartTranslation.translate(t);return{title:Wp({tag:"div",children:r}),titleLabel:r,bodyPromise:I3.resolve(i),getScrollableContainer:()=>i.querySelector(".ag-scrollable-container")||i,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout?.getGui()}showMenu(e,t){this.eventSource=e,t||this.tabbedLayout?.focusHeader(!0)}destroy(){this.parentComponent?.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(e){switch(e){case RW:return new hz(this.chartMenuContext);case AW:return new V5(this.chartMenuContext);default:return new FW(this.chartMenuContext.chartController)}}},TW=class extends w3{constructor(e,t,s){super('<div class="ag-chart-menu-wrapper"></div>'),this.eChartContainer=e,this.eMenuPanelContainer=t,this.chartMenuContext=s,this.buttons={chartLink:{iconName:"linked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"chartsDownload",callback:()=>this.chartMenuSvc.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"chartsMenu",callback:i=>this.showMenuList(i)}},this.panels=[],this.menuVisible=!1,this.chartController=s.chartController}wireBeans(e){this.chartMenuSvc=e.chartMenuSvc,this.chartMenuListFactory=e.chartMenuListFactory}postConstruct(){this.chartToolbar=this.createManagedBean(new P3),this.getGui().appendChild(this.chartToolbar.getGui()),this.refreshToolbarAndPanels(),this.addManagedEventListeners({chartCreated:e=>{e.chartId===this.chartController.getChartId()&&this.gos.get("chartToolPanelsDef")?.defaultToolPanel&&this.showMenu({panel:this.defaultPanel,suppressFocus:!0})}}),this.addManagedListeners(this.chartController,{chartLinkedChanged:this.refreshToolbarAndPanels.bind(this)}),this.refreshMenuClasses(),this.addManagedListeners(this.chartController,{chartApiUpdate:this.refreshToolbarAndPanels.bind(this)})}isVisible(){return this.menuVisible}getExtraPaddingDirections(){return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))?["top"]:[]}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t}=this.chartMenuSvc.getChartToolPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=this.chartMenuSvc.getChartToolbarOptions()}updateToolbar(){const e=this.chartToolbarOptions.map(t=>{const{iconName:s,callback:i}=this.buttons[t];return{buttonName:t,iconName:s,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.menuPanel=this.createBean(new Yr({height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return t.setParentComponent(this),this.eMenuPanelContainer.appendChild(t.getGui()),this.tabbedMenu=this.createBean(new MW(this.panels,this.chartMenuContext)),this.addManagedListeners(this.tabbedMenu,{closed:()=>{this.hideMenu()}}),this.addManagedListeners(t,{destroyed:()=>this.destroyBean(this.tabbedMenu)}),new y3(s=>{window.setTimeout(()=>{t.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),s(t)},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}showMenu(e){const{panel:t,eventSource:s,suppressFocus:i}=e??{};if(this.menuPanel&&!t)this.showContainer(s,i);else{const r=t||this.defaultPanel;let a=this.panels.indexOf(r);a<0&&(x3(143,{panel:t}),a=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(a),this.showContainer(s,i)):this.createMenuPanel(a).then(()=>this.showContainer(s,i))}}hideMenu(){this.menuVisible=!1,this.refreshMenuClasses()}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible)}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel?.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu?.isAlive()&&this.destroyBean(this.tabbedMenu)}};import{BeanStub as PW,_error as IW}from"ag-grid-community";var Rg=["number","category","time","grouped-category"],EW=["angle-category","angle-number","radius-category","radius-number"],DW=[...Rg,...EW],LW=class extends PW{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisOptions(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisOptions(e,t),clearValue:(t,s)=>this.clearCartesianAxisOptions(e,t,s)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,t==="*"?null:t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t==="*"?null:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,s)=>this.getSeriesOption(e(),t,s),setValue:(t,s)=>this.setSeriesOptions(e(),[{expression:t,value:s}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,s,i){const r=this.getRetainedChartThemeOverrideKeys(s,i),a=this.getRetainedChartAxisThemeOverrideKeys(null,s,i),n=this.createChartOptions();for(const o of r){const l=this.retrieveChartOptionsThemeOverride(e,s,o);l!==void 0&&this.assignChartOptionsThemeOverride(n,i,o,l)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:a,existingChartOptions:e,targetChartOptions:n,existingChartType:s,targetChartType:i}),n.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:s,existingChartOptions:i,targetChartOptions:r,existingChartType:a,targetChartType:n}=e;for(const{expression:o,targetAxisTypes:l}of s)for(const c of t.map(d=>d.type)){const d=this.retrieveChartOptionsThemeOverride(i,a,["axes",c,o].join("."));if(d!==void 0)for(const u of l)this.assignChartOptionsThemeOverride(r,n,["axes",u,o].join("."),d)}}getRetainedChartThemeOverrideKeys(e,t){const s=["animation"],i=["zoom","navigator"],r=((a,n)=>{const o=new Array;return ot(z(a))&&ot(z(n))&&o.push(...i),o})(e,t);return[...s,...r]}getRetainedChartAxisThemeOverrideKeys(e,t,s){return ot(z(t))&&ot(z(s))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(r=>({expression:r,targetAxisTypes:Rg})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t=e==="xAxis"?["",".top",".bottom"]:e==="yAxis"?["",".left",".right"]:["",".left",".right",".top",".bottom"],s=["crosshair"],i=new Array;for(const r of s)for(const a of t)i.push(`${r}${a}`);return i}getChartOption(e){return nt(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),s=this.createChartOptions();for(const{expression:i,value:r}of e)this.assignChartOptionsThemeOverride(s,t,i,r);this.applyChartOptions(s)}applyChartOptions(e,t){if(Object.keys(e).length===0)return;this.updateChart(e),!t?.silent&&this.raiseChartOptionsChangedEvent()}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(s=>IW(108,{e:s}))}getAxisProperty(e){return nt(this.getChart().axes?.x,e,void 0)}setAxisThemeOverrides(e){const t=this.getChart(),s=this.getChartType(),i=this.createChartOptions();for(const{expression:r,value:a}of e){const n=Object.values(t.axes??{}).filter(o=>{const l=r.split(".");let c=o;for(const d of l){if(!(d in c))return!1;c=c[d]}return!0});if(n)for(const o of n)this.isValidAxisType(o)&&this.assignChartAxisThemeOverride(i,s,o.type,null,r,a)}this.applyChartOptions(i)}getCartesianAxisProperty(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);return nt(i,t,void 0)}getCartesianAxisThemeOverride(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),a=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(a,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),a=this.createChartOptions();for(const{expression:n,value:o}of t)this.assignChartAxisThemeOverride(a,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],n,o);this.applyChartOptions(a)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,s=>{const i=e==="yAxis"?"y":"x";for(const{expression:r,value:a}of t)this.assignChartOption(s,`axes.${i}.${r}`,a)})}clearCartesianAxisOptions(e,t,s){this.updateCartesianAxisOptions(e,i=>{const r=e==="yAxis"?"y":"x";this.clearChartOption(i,`axes.${r}.${t}`,s)})}updateCartesianAxisOptions(e,t){const s=this.getChart().getOptions(),i="axes"in s?s.axes:void 0;if(!s||!i)return;const r=this.getChartAxes(),a=this.getCartesianAxis(r,e);if(!a)return;const n=this.createChartOptions();n.axes=i,t(n,a,s),this.applyChartOptions(n)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(s,i,r)=>{const a=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[i],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,a,a),existingChartOptions:r,targetChartOptions:s,existingChartType:a,targetChartType:a}),this.assignChartOption(s,"axes.x.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return e[0].direction==="x"?e[0]:e[1];case"yAxis":return e[1].direction==="y"?e[1]:e[0]}}getSeriesOption(e,t,s){const i=this.getChart().series.find(r=>kW(e,r));return nt(s?i:i?.properties.toJson(),t,void 0)}setSeriesOptions(e,t){const s=this.createChartOptions();for(const{expression:i,value:r}of t)this.assignChartOptionsSeriesThemeOverride(s,e,`series.${i}`,r);this.applyChartOptions(s)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){const e=this.getChart();return Object.values(e.axes??{})}retrieveChartAxisThemeOverride(e,t,s,i,r){if(i)for(const a of i){const n=this.retrieveChartOptionsThemeOverride(e,t,["axes",s,a,...r?[r]:[]].join("."));if(n!==void 0)return n}else return this.retrieveChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."))}assignChartAxisThemeOverride(e,t,s,i,r,a){if(i)for(const n of i)this.assignChartOptionsThemeOverride(e,t,["axes",s,n,...r?[r]:[]].join("."),a);else this.assignChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."),a)}isValidAxisType(e){return DW.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),t.updateDelta(e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,s){const i=this.getChartThemeOverridesSeriesTypeKeys(t);for(const r of i){const a=this.retrieveChartOptionsSeriesThemeOverride(e,r,s);if(a!==void 0)return a}}assignChartOptionsThemeOverride(e,t,s,i){const r=this.getChartThemeOverridesSeriesTypeKeys(t);for(const a of r)this.assignChartOptionsSeriesThemeOverride(e,a,s,i)}retrieveChartOptionsSeriesThemeOverride(e,t,s){return this.retrieveChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,s,i){this.assignChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."),i)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return nt(e,t,void 0)}assignChartOption(e,t,s){Z2(e,t,s)}clearChartOption(e,t,s){const i=nt(e,t,void 0);i&&delete i[s]}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions})}};function kW(e,t){return tH(e)&&t.type===e}var GW=class extends U4{constructor(e){super(`
|
||
<div style="height: 100%; width: 100%;">
|
||
<div class="ag-chart" data-ref="eWrapper">
|
||
<div data-ref="eChartContainer" class="ag-chart-components-wrapper ag-chart-menu-hidden">
|
||
<div data-ref="eChart" class="ag-chart-canvas-wrapper"></div>
|
||
<div data-ref="eEmpty" class="ag-chart-empty-text ag-unselectable"></div>
|
||
</div>
|
||
<div data-ref="eMenuContainer" class="ag-chart-docked-container"></div>
|
||
</div>
|
||
</div>
|
||
`),this.eChart=Zs,this.eWrapper=Zs,this.eChartContainer=Zs,this.eMenuContainer=Zs,this.eEmpty=Zs,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){const e={...this.params,chartType:qs(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get("enableRtl");this.eWrapper.classList.add(t?"ag-rtl":"ag-ltr");const s=this.createBean(new jH(e));this.chartController=this.createManagedBean(new h3(s)),this.chartOptionsService=this.createManagedBean(new LW(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({stylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));const t=(r,a)=>{const n=this.params.crossFilteringContext;n.lastSelectedChartId=a?"":this.chartController.getChartId(),a&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(r,a)},s=this.chartController.getChartType(),i={agChartsExports:this.beans.agChartsExports,chartType:s,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),styleNonce:this.gos.get("styleNonce"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>this.chartMenu?.getExtraPaddingDirections()??[],apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:t,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:r=>this.chartTranslation.translate(r),context:W4(this.gos,{})};if(this.params.chartOptionsToRestore=void 0,this.chartType=s,this.chartProxy=this.createChartProxy(i),!this.chartProxy){Op(138,{chartType:i.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new Rt(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new Rt(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(e){const{chartType:t}=e;switch(t){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new f3(e);case"pie":case"donut":case"doughnut":return new b3(e);case"area":case"stackedArea":case"normalizedArea":return new p3(e);case"line":case"stackedLine":case"normalizedLine":return new m3(e);case"scatter":case"bubble":return new C3(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new v3(e)}const s=this.enterpriseChartProxyFactory?.createChartProxy(e);if(!s)throw kp(251,{chartType:t});return s}addDialog(){const e=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:s}=this.getBestDialogSize(),i=this.params.focusDialogOnOpen?()=>setTimeout(()=>j4(this.getGui())):void 0;this.chartDialog=new Fi({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:s,component:this,centered:!0,closable:!0,afterGuiAttached:i,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();const r=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(r?this.focusSvc.setFocusedCell({...r,forceBrowserFocus:!0}):$4(this.beans))})})}getBestDialogSize(){const e=this.popupSvc.getPopupParent(),t=q4(e)*.75,s=Y4(e)*.75,i=.553,r=this.chartProxy.getChart();let a=this.params.insideDialog?850:r.width,n=this.params.insideDialog?470:r.height;return(a>t||n>s)&&(a=Math.min(a,t),n=Math.round(a*i),n>s&&(n=s,a=Math.min(a,Math.round(n/i)))),{width:a,height:n}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new TW(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e?.chartId&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),s=t||this.chartEmpty?(r=>{const a=this.chartType,n=r,o=this.chartProxy.getChart(),l=o?.getOptions(),c=Object.values(o?.axes??{});return this.chartOptionsService.getPersistedChartThemeOverrides(l,c,a,n??a)})(t):void 0;t&&this.createChart(),s&&e?.chartThemeOverrides&&X4(s,e.chartThemeOverrides);const i=s??e?.chartThemeOverrides;this.updateChart(i),e?.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,s=this.chartController.getSelectedValueColState(),i=this.chartController.getChartData(),r=this.handleEmptyChart(i,s.length);if(this.chartEmpty=r,r){e&&this.chartController.updateThemeOverrides(e);return}const a=this.chartController.getChartUpdateParams(e);t.update(a),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){const[t,s]=[this.chartController.getChartType(),e?.chartType],i=s?qs(s):void 0;return this.chartType!==t?i??t:i&&t!==i?i:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const s=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),i=this.chartController.getChartType();let r=1;this.chartController.isActiveXYChart()?r=i==="bubble"?3:2:Ft(z(i))&&(r=0);const a=t<r||e.length===0;if(this.eChart){const n=s||a;Gp(this.eChart,!n),Gp(this.eEmpty,n)}return s?(this.eEmpty.textContent=this.chartTranslation.translate("pivotChartRequiresPivotMode"),!0):a?(this.eEmpty.textContent=this.chartTranslation.translate("noDataToChart"),!0):!1}downloadChart(e,t,s){this.chartProxy.downloadChart(e,t,s)}openChartToolPanel(e){const t=e&&yr[e];this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setMaximized(e){this.chartDialog?.setMaximized(e)}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||this.chartController.setChartRange(!0)}getThemeName(){const e=this.gos.get("chartThemes")||Up;if(e.length===0)throw new Error(kp(254));const{chartThemeName:t}=this.params;return e.includes(t)?t:e[0]}getAllKeysInObjects(e){const t={};for(const s of e.filter(i=>i!=null))for(const i of Object.keys(s))t[i]=null;return Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");if(t)for(const s of this.getAllKeysInObjects([t]))e.includes(s)||Op(139,{customThemeName:s})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,s=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:s})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog?.isAlive()&&this.destroyBean(this.chartDialog),this.onDestroyColorSchemeChangeListener?.();const e=this.getGui();K4(e),Z4(e),this.raiseChartDestroyedEvent()}};import{_errMsg as OW}from"ag-grid-community";var ri=!1;function _W(e){const t=e.version;return e.version==null&&(e.version=QW(e)),e=te("23.0.0",e,NW),e=te("24.0.0",e,BW),e=te("25.1.0",e,VW),e=te("26.0.0",e,HW),e=te("26.1.0",e,zW),e=te("26.2.0",e,UW),e=te("28.0.0",e,WW),e=te("28.2.0",e,KW),e=te("29.0.0",e,$W),e=te("29.1.0",e,Ag),e=te("29.2.0",e,Mg),e=te("30.0.0",e,jW),e=te("31.0.0",e,YW),e=te("32.0.0",e,qW),e=te("33.0.0",e,XW),e=te("34.0.0",e,ZW),e=JW(e),e=te(D,e,s=>s),ri&&t!==e.version&&console.log("AG Grid: ChartModel migration complete",{model:e}),e}function NW(e){return e=se("chartOptions.legend.item.marker.type","shape",e),e=se("chartOptions.seriesDefaults.marker.type","shape",e),e=se("chartOptions.legend.padding","spacing",e),e}function BW(e){e=U("chartOptions.seriesDefaults.marker.minSize",e);const{chartType:t,chartPalette:s,chartOptions:{xAxis:i,yAxis:r,...a},...n}=e,l=dH(t)?.map((d,u)=>({type:d,...u===0?i:r}));return{chartType:t,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[s]??"ag-default",chartOptions:{...a,axes:l,xAxis:i,yAxis:r},...n}}function VW(e){return e=se("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e),e}function HW(e){return e=Ue("chartOptions.seriesDefaults.highlightStyle",e,({dimOpacity:s,...i})=>({...i,...s!=null?{series:{dimOpacity:s}}:{}})),e=U("chart",e),e=U("chartOptions.seriesDefaults.tooltipClass",e),e=U("chartOptions.seriesDefaults.tooltipTracking",e),e=Pg("chartOptions.axes[].label.rotation",0,e),e=Pg("chartOptions.axes[].label.rotation",335,e),e}function zW(e){const t=({item:s,series:i,...r})=>({item:{...r,...s},...i?{series:i}:{}});return e=Ue("chartOptions.seriesDefaults.highlightStyle",e,t),e=Ue("chartOptions.series[].highlightStyle",e,t),e}function UW(e){e=Pr("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=Pr("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=Pr("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e),e=U("chartOptions.seriesDefaults.fill",e),e=U("chartOptions.seriesDefaults.stroke",e),e=U("chartOptions.seriesDefaults.callout.colors",e),e=U("chartOptions.xAxis",e),e=U("chartOptions.yAxis",e);const{chartType:t,chartOptions:{axes:s,series:i,seriesDefaults:r,...a},...n}=e,o=qs(t),l=z(o),c=[l],d={};if(!yp(l)){const h={top:{},bottom:{},left:{},right:{}},p=s.map(({type:g,...f})=>({[g]:{...h,...f}})).reduce(Dg,{});for(const g of xp.filter(f=>p[f]==null))p[g]={...h};d.axes=p}const u=c.map(h=>({[h]:{...d,series:r,...a}})).reduce(Dg,{});return e={...n,chartType:o,chartOptions:u},e}function WW(e){return e=U("chartOptions.*.title.padding",e),e=U("chartOptions.*.subtitle.padding",e),e=U("chartOptions.*.axes.*.title.padding",e),e=mo("chartOptions.*.axes.*.title.enabled",!1,e),e}function KW(e){return e=se("chartOptions.pie.series.callout","calloutLine",e),e=se("chartOptions.pie.series.label","calloutLabel",e),e=se("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=se("chartOptions.pie.series.labelName","sectorLabelName",e),e=se("chartOptions.donut.series.callout","calloutLine",e),e=se("chartOptions.donut.series.label","calloutLabel",e),e=se("chartOptions.donut.series.labelKey","sectorLabelKey",e),e=se("chartOptions.donut.series.labelName","sectorLabelName",e),e}function $W(e){return e=ai("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=ai("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=ai("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=ai("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),e=ai("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e),e=Pr("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e),e}function Ag(e){return e=U("chartOptions.axes[].tick.count",e),e}function Mg(e){return e=Ue("chartOptions.*.tooltip",e,({tracking:s,...i})=>{const r={...i};return s===!1?(r.position??(r.position={type:"pointer"}),r.range??(r.range="nearest")):s===!0&&(r.position??(r.position={type:"node"}),r.range??(r.range="nearest")),r}),e}function jW(e){return e=se("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=se("chartOptions.pie.series.labelName","sectorLabelName",e),e=Ag(e),e=Mg(e),e=U("chartOptions.*.series.flipXY",e),e=Ig("chartOptions.common.legend.enabled",!0,e),e=mo("chartOptions.common.legend.position","right",e),e}function YW(e){const t={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},s=se("chartOptions.column","bar",e),i=t[s.chartThemeName]||s.chartThemeName;return{...s,chartThemeName:i}}function qW(e){return e=ye("chartOptions.*.autoSize",!0,e,(t,s)=>{t[s]===!0||t[s]===!1&&(t.minHeight=600,t.minWidth=300),delete t[s]}),e}function XW(e){return e=U("chartOptions.*.axes.category.label.format",e),e=U("chartOptions.*.axes.category.crosshair.label.format",e),e=U("chartOptions.*.axes.angle-category.label.format",e),e=U("chartOptions.*.axes.radius-category.label.format",e),e=se("chartOptions.*.axes.*.label.padding","spacing",e),e=se("chartOptions.*.navigator.miniChart.label.padding","spacing",e),e=U("chartOptions.*.axes.*.crossLines.label.className",e),e=ye("chartOptions.*.axes.*.crossLines.label.position",!0,e,(t,s)=>{typeof t[s]=="string"&&(t[s]=t[s].replace(/([A-Z])/,"-$1").toLowerCase())}),e=U("chartOptions.bullet",e),e=Eg("chartOptions.bar.series.label.placement",e,{inside:"inside-center",outside:"inside-end"}),e=Eg("chartOptions.waterfall.series.item.*.label.placement",e,{inside:"inside-center",start:"outside-start",end:"outside-end"}),e=U("chartOptions.*.navigator.min",e),e=U("chartOptions.*.navigator.max",e),e=U("chartOptions.*.zoom.ratioX",e),e=U("chartOptions.*.zoom.ratioY",e),e=U("chartOptions.*.zoom.rangeX",e),e=U("chartOptions.*.zoom.rangeY",e),e}function ZW(e){return ye("chartOptions.series[].highlightStyle",!0,e,(s,i)=>{const r=s[i];if(r==null)return;const a={};if(r.item&&(a.highlightedItem=r.item),r.series){const{dimOpacity:n,...o}=r.series;n!=null&&(a.unhighlightedSeries={opacity:n}),Object.keys(o).length>0&&(a.highlightedSeries=o)}delete s[i],s.highlight=a}),e}function JW(e){return e=U("chartOptions.*.width",e),e=U("chartOptions.*.height",e),e=mo("chartOptions.*.axes.category.label.autoRotate",!0,e),e}function QW(e){const t=e;if(e.version!=null)return e.version;const s=(c,...d)=>Object.keys(c||{}).some(u=>d.includes(u)),i=t.chartOptions,r=s(i,"seriesDefaults")?i?.seriesDefaults:i?.[Object.keys(i)[0]],a={"27.0.0":s(t,"seriesChartTypes"),"26.2.0":!s(i,"seriesDefaults"),"26.1.0":s(r?.highlightStyle,"item"),"26.0.0":s(r?.highlightStyle,"series"),"25.1.0":s(r?.label,"minAngle"),"25.0.0":s(t,"modelType","aggFunc","unlinkChart","suppressChartRanges")||s(r,"lineDash","lineDashOffset"),"24.0.0":s(t,"chartThemeName","chart")||s(i,"series"),"23.2.0":s(i,"navigator"),"23.0.0":s(i?.legend?.item?.marker,"shape"),"22.1.0":s(t,"chartPalette","chartType")},n="27.1.0",o=Object.entries(a).filter(([c,d])=>d);ri&&console.log("AG Grid: ChartModel migration",{heuristicVersionCandidates:o});const[l=n]=o[0];return ri&&console.log("AG Grid: ChartModel migration",{heuristicVersion:l}),l}function te(e,t,s){if(Tg(e)>Tg(t.version)){ri&&console.log("AG Grid: ChartModel migration",{migratingTo:e});const i=s(t);return i.version=e,ri&&console.log("AG Grid: ChartModel migration",{migratedTo:e,result:i}),i}return t}function e6(e){const t=e.includes("-beta")?e.replace(/-beta.*/,""):e,s=typeof t=="string"?t.split(".").map(i=>Number(i)):[];if(s.length!==3||s.some(i=>isNaN(i)))throw new Error(OW(253,{version:t}));return{major:s[0],minor:s[1],patch:s[2]}}function Tg(e){const{major:t,minor:s,patch:i}=e6(e);return t*1e4+s*100+i}function Pg(e,t,s){return ye(e,!0,s,(i,r)=>{i[r]===t&&delete i[r]})}function mo(e,t,s){return ye(e,!1,s,(i,r)=>{i[r]==null&&(i[r]=t)})}function Ig(e,t,s){typeof e=="string"&&(e=e.split("."));const i=e[0];return e.length>1&&(s[i]=Ig(e.slice(1),t,s[i]??{})),Object.keys(s).includes(i)||(s[i]=t),s}function Pr(e,t,s){let i,r=!1;return s=ye(e,!0,s,(a,n)=>{r=!0,i=a[n],delete a[n]}),r?ye(t,!1,s,(a,n)=>{a[n]=i}):s}function ai(e,t,s){let i,r=!1;return s=ye(e,!0,s,(a,n)=>{r=!0,i=a[n],delete a[n]}),r?ye(t,!1,s,(a,n)=>{a[n]===void 0&&(a[n]=i)}):s}function se(e,t,s){return ye(e,!0,s,(i,r)=>{i[t]=i[r],delete i[r]})}function U(e,t){return ye(e,!0,t,(s,i)=>delete s[i])}function ye(e,t,s,i){const r=e instanceof Array?e:e.split("."),a=r.slice(0,r.length-1),n=r[r.length-1];return Ue(a,s,o=>{const l=Object.keys(o).includes(n);if(t&&!l)return o;const c={...o};return i(c,n),c})}function Ue(e,t,s){const i=e instanceof Array?e:e.split(".");if(t={...t},i.length===0)return s(t);if(i[0].startsWith("{")){const r=i[0].substring(1,i[0].lastIndexOf("}")).split(",");for(const a of r)t[a]!=null&&(t[a]=Ue(i.slice(1),t[a],s))}else if(i[0].endsWith("[]")){const r=i[0].substring(0,e[0].indexOf("["));t[r]instanceof Array&&(t[r]=t[r].map(a=>Ue(i.slice(1),a,s)))}else if(i[0]==="*")for(const r of Object.keys(t))t[r]=Ue(i.slice(1),t[r],s);else t[i[0]]!=null&&(t[i[0]]=Ue(i.slice(1),t[i[0]],s));return t}function Eg(e,t,s){return ye(e,!0,t,(i,r)=>{typeof i[r]=="string"&&(i[r]=s[r]??r)})}var Dg=(e,t)=>({...e,...t}),t6=class extends H4{constructor(){super(...arguments),this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){wr(124);return}const t=[...this.activeChartComps].find(s=>s.getChartId()===e.chartId);if(!t){wr(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){const e=[],t=s=>({...s,version:D});for(const s of this.activeChartComps)e.push(t(s.getChartModel()));return e}getChartRef(e){let t;for(const s of this.activeCharts)s.chartId===e&&(t=s);return t}getChartComp(e){let t;for(const s of this.activeChartComps)s.getChartId()===e&&(t=s);return t}getChartImageDataURL(e){let t;for(const s of this.activeChartComps)s.getChartId()===e.chartId&&(t=s.getChartImageDataURL(e.fileFormat));return t}downloadChart(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.openChartToolPanel(e.panel)}closeChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e)?.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn",t){const s=this.getSelectedRange();return this.createChart({cellRange:s,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){wr(126);return}e.version!==D&&(e=_W(e));let s,i,r,a;if(e.modelType==="pivot"?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),s=this.createCellRange(void 0,!0),i=!0,r=!0):(s=this.createCellRange(e.cellRange),a=e.chartPalette,r=e.suppressChartRanges),!!s)return this.createChart({...e,cellRange:s,pivotChart:i,suppressChartRanges:r,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:a})}createRangeChart(e,t){const s=this.createCellRange(e.cellRange);if(s)return this.createChart({...e,cellRange:s,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const s=this.createCellRange(void 0,!0);if(s)return this.createChart({...e,cellRange:s,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){const s=this.createCellRange(e.cellRange);if(!s)return;const r=typeof e.suppressChartRanges<"u"&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:s,suppressChartRanges:r,crossFiltering:!0,crossFilteringSort:e.sort,focusDialogOnOpen:!t})}createChart(e){const t=l3(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;const{chartType:s,chartContainer:i}=e,r=this.gos.getCallback("createChartContainer"),a={...e,chartId:this.generateId(),chartType:qs(s),insideDialog:!(i||r),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>{for(const l of this.activeChartComps)l.crossFilteringReset()}},n=new GW(a);this.createBean(n);const o=this.createChartRef(n);return i?i.appendChild(o.chartElement):r?r(o):n.addEventListener("destroyed",()=>{this.activeChartComps.delete(n),this.activeCharts.delete(o)}),o}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{z4(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId,setMaximized:e.setMaximized.bind(e)};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){const e=this.rangeSvc?.getCellRanges();if(!e||e.length===0)return{columns:[]};const t=new Set;let s=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(const{startRow:a,endRow:n,columns:o}of e){if(!(a&&n))continue;for(const h of o)t.add(h);let{rowIndex:l,rowPinned:c}=a,{rowIndex:d,rowPinned:u}=n;if(c==="top"){if(u==="top")continue;l=0}if(u==="bottom"){if(c==="bottom")continue;d=this.beans.pageBounds.getLastRow()}l!==void 0&&(s=Math.min(s,l)),d!==void 0&&(i=Math.max(i,d))}if(s===Number.MAX_VALUE||i===-Number.MAX_VALUE)return{columns:[]};const r=Array.from(t);return{columns:r,startColumn:r[0],startRow:{rowIndex:s,rowPinned:void 0},endRow:{rowIndex:i,rowPinned:void 0}}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){const s=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(r=>r.getColId())}:e,i=s&&this.rangeSvc?.createPartialCellRangeFromRangeParams(s,!0);return i||wr(127,{allRange:t}),i}destroy(){for(const e of this.activeCharts)e.destroyChart();super.destroy()}};function s6(e){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartModels())}function i6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartRef(t))}function r6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartImageDataURL(t))}function a6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.downloadChart(t))}function n6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.openChartToolPanel(t))}function o6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.closeChartToolPanel(t.chartId))}function l6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createRangeChart(t,!0))}function c6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createPivotChart(t,!0))}function d6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createCrossFilterChart(t,!0))}function u6(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.updateChart(t))}function h6(e,t,s){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.restoreChart(t,s))}var p6=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative}.ag-chart-tabbed-menu-body:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:solid var(--ag-border-width) var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-card-item:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative}.ag-chart-settings-next:focus-within,.ag-chart-settings-prev:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:solid var(--ag-border-width) var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:calc(var(--ag-border-width) + 1px);padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:solid var(--ag-border-width) var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8}.ag-chart-menu-icon:hover{opacity:1}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}.ag-label{display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:solid var(--ag-border-width) var(--ag-border-color)}.ag-chart-data-wrapper,.ag-chart-format-wrapper{margin:0;padding:0}.ag-group{.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{border-top:none;display:grid;font-weight:500;grid-template-columns:60px 1fr 60px 1fr 60px;row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;margin:0;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}&.ag-charts-data-group,&.ag-charts-format-top-level-group{border-top:solid var(--ag-border-width) var(--ag-border-color)}.ag-charts-data-group-container,.ag-charts-format-top-level-group-container,.ag-charts-settings-group-container{margin:0;padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-item,.ag-charts-format-sub-level-no-header-group-item,.ag-charts-format-top-level-group-item{margin-bottom:var(--ag-widget-vertical-spacing)}&.ag-charts-format-sub-level-group,&.ag-charts-format-top-level-group,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group-item{margin:0;padding:0}.ag-charts-advanced-settings-top-level-group-container{margin:0}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-color,.ag-spectrum-fill{border-radius:var(--ag-border-radius)}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:var(--ag-color-picker-thumb-border-width) solid #fff;border-radius:var(--ag-color-picker-thumb-size);box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:var(--ag-color-picker-thumb-size);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{cursor:pointer;height:var(--ag-color-picker-track-size);margin-bottom:10px;position:relative}.ag-spectrum-slider,.ag-spectrum-tool{border-radius:var(--ag-color-picker-thumb-size)}.ag-spectrum-slider{border:var(--ag-color-picker-thumb-border-width) solid #fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:var(--ag-color-picker-thumb-size);margin-top:calc(var(--ag-color-picker-track-size)/2*-1 + var(--ag-color-picker-thumb-size)/2*-1);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin:10px var(--ag-spacing) 2px}.ag-recent-color{border:solid var(--ag-border-width) var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding:10px 0 0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:var(--ag-color-picker-track-border-radius)}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:var(--ag-color-picker-color-border-radius)}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:solid var(--ag-border-width) var(--ag-border-color);height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-ltr) .ag-color-input .ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-rtl) .ag-color-input .ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-color-input) .ag-color-input-color{position:absolute}:where(.ag-ltr) :where(.ag-color-input) .ag-color-input-color{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-color-input) .ag-color-input-color{margin-right:var(--ag-spacing)}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,Lg=28,kg=6;function Co(e){return e?.match(/\d+\.\d+\.\d+/)}function g6({gridMajorVersion:e,chartsMajorVersion:t}){const s=parseInt(e,10),i=parseInt(t,10),r=s-Lg,a=i-kg,n=r>=0;return r===a&&n}function f6(e){if(!e||!Co(e))return;const[t,s]=e.split(".")||[],i=`${t}.${s}.x`,a=parseInt(t,10)-Lg+kg;if(a<0)return;const o=`${a}.${s}.x`;return{gridMajorMinor:i,chartsMajorMinor:o}}function Ir({type:e,gridVersion:t,chartsVersion:s}){const i="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return i;const r=f6(t);if(!r)return i;const{gridMajorMinor:a,chartsMajorMinor:n}=r;return e==="incompatible"?`AG Grid version ${t} and AG Charts version ${s} is not supported. AG Grid version ${a} should be used with AG Chart ${n}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e==="invalidCharts"?`AG Grid version ${a} should be used with AG Chart ${n} not ${s}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:i}function m6({gridVersion:e,chartsVersion:t}){if(!Co(t))return{isValid:!1,message:Ir({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!Co(e))return{isValid:!1,message:Ir({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[s,i]=e.split(".")||[],[r,a,n]=t.split(".")||[],o=g6({gridMajorVersion:s,chartsMajorVersion:r});return o&&i===a||n.includes("beta")?{isValid:!0}:!o||i!==a?{isValid:!1,message:Ir({type:"incompatible",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:Ir({type:"invalid",gridVersion:e,chartsVersion:t})}}var C6={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},v6={getChartModels:s6,getChartRef:i6,getChartImageDataURL:r6,downloadChart:a6,openChartToolPanel:n6,closeChartToolPanel:o6,createRangeChart:l6,createPivotChart:c6,createCrossFilterChart:d6,updateChart:u6,restoreChart:h6},vo=[sr,B,K2,W2,Di],Gg="IntegratedCharts",S6={moduleName:"GridCharts",version:D,dependsOn:vo,validate:()=>({isValid:!1,message:`AG Grid: As of v33, the "GridChartsModule" has been deprecated. Please use "IntegratedChartsModule.with(...)" instead.
|
||
${Cp(257)}`})},Og={moduleName:Gg,version:D,dependsOn:vo,validate:()=>({isValid:!1,message:Cp(257)}),with:e=>{if(e.setup(),e.setGridContext?.(!0),e.isEnterprise&&e.setLicenseKey){const t={setLicenseKey:e.setLicenseKey};ds.setChartsLicenseManager(t)}return{moduleName:Gg,version:D,icons:C6,apiFunctions:v6,dependsOn:vo,css:[p6],validate:()=>m6({gridVersion:D,chartsVersion:e.VERSION}),beans:[j2.bind(null,e),t6,V4,E4,M4,_4,XH,v4]}}};import{AllCommunityModule as b6}from"ag-grid-community";var _g=[b6,du,Bc,gd,Mu,Tu,Lu,Ga,Oa,sr,Zc,dn,an,su,iu,fh,mh,np,od,bd,jl,Rs,hd,nu,eh,ih,fp,mp,Jl],Ng="AllEnterprise",y6={with:e=>({moduleName:Ng,version:D,dependsOn:[..._g,Og.with(e),cp.with(e)]}),moduleName:Ng,version:D,dependsOn:_g};export*from"ag-grid-community";export{jl as AdvancedFilterModule,Xa as AggregationModule,Jl as AiToolkitModule,y6 as AllEnterpriseModule,mp as BatchEditModule,sr as CellSelectionModule,du as ClipboardModule,Ga as ColumnMenuModule,Bc as ColumnsToolPanelModule,Oa as ContextMenuModule,gd as ExcelExportModule,Mu as FiltersToolPanelModule,fp as FindModule,np as FormulaModule,S6 as GridChartsModule,iu as GroupFilterModule,Og as IntegratedChartsModule,kr as LicenseManager,Lu as MasterDetailModule,NT as MenuModule,bd as MultiFilterModule,Tu as NewFiltersToolPanelModule,eh as PivotModule,V1 as RangeSelectionModule,Zc as RichSelectModule,an as RowGroupingModule,su as RowGroupingPanelModule,dn as RowNumbersModule,mh as ServerSideRowModelApiModule,fh as ServerSideRowModelModule,od as SetFilterModule,Rs as SideBarModule,cp as SparklinesModule,hd as StatusBarModule,ih as TreeDataModule,nu as ViewportRowModelModule,Xr as _AgColorPicker,GS as _AgColorPickerSelector,il as _AgContextMenuService,qr as _AgDialog,Ae as _AgGroupComponent,H as _AgGroupComponentSelector,qo as _AgInputRange,Xo as _AgInputRangeSelector,Si as _AgMenuItemComponent,rl as _AgMenuItemRenderer,bi as _AgMenuList,Yr as _AgPanel,ue as _AgSlider,le as _AgSliderSelector,Qr as _AgTabbedLayout,$o as _AgVirtualList,Yo as _AgVirtualListDragFeature,qv as exportMultipleSheetsAsExcel,Kr as getMultipleSheetsAsExcel};
|