UNPKG

@ag-grid-enterprise/core

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

34 lines 106 kB
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==s&&__defProp(e,n,{get:()=>t[n],enumerable:!(i=__getOwnPropDesc(t,n))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{AgDialog:()=>AgDialog,AgGroupComponent:()=>AgGroupComponent,AgGroupComponentSelector:()=>AgGroupComponentSelector,AgMenuItemComponent:()=>AgMenuItemComponent,AgMenuItemRenderer:()=>AgMenuItemRenderer,AgMenuList:()=>AgMenuList,AgMenuPanel:()=>AgMenuPanel,AgPanel:()=>AgPanel,AgRichSelect:()=>AgRichSelect,EnterpriseCoreModule:()=>EnterpriseCoreModule,GroupCellRenderer:()=>GroupCellRenderer,GroupCellRendererCtrl:()=>GroupCellRendererCtrl,LicenseManager:()=>GridLicenseManager,PillDragComp:()=>PillDragComp,PillDropZonePanel:()=>PillDropZonePanel,TabbedLayout:()=>TabbedLayout,VirtualList:()=>VirtualList,VirtualListDragFeature:()=>VirtualListDragFeature}),module.exports=__toCommonJS(main_exports);var import_core5=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_core=require("@ag-grid-community/core"),MD5=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],n=e[2],o=e[3];s=this.ff(s,i,n,o,t[0],7,-680876936),o=this.ff(o,s,i,n,t[1],12,-389564586),n=this.ff(n,o,s,i,t[2],17,606105819),i=this.ff(i,n,o,s,t[3],22,-1044525330),s=this.ff(s,i,n,o,t[4],7,-176418897),o=this.ff(o,s,i,n,t[5],12,1200080426),n=this.ff(n,o,s,i,t[6],17,-1473231341),i=this.ff(i,n,o,s,t[7],22,-45705983),s=this.ff(s,i,n,o,t[8],7,1770035416),o=this.ff(o,s,i,n,t[9],12,-1958414417),n=this.ff(n,o,s,i,t[10],17,-42063),i=this.ff(i,n,o,s,t[11],22,-1990404162),s=this.ff(s,i,n,o,t[12],7,1804603682),o=this.ff(o,s,i,n,t[13],12,-40341101),n=this.ff(n,o,s,i,t[14],17,-1502002290),i=this.ff(i,n,o,s,t[15],22,1236535329),s=this.gg(s,i,n,o,t[1],5,-165796510),o=this.gg(o,s,i,n,t[6],9,-1069501632),n=this.gg(n,o,s,i,t[11],14,643717713),i=this.gg(i,n,o,s,t[0],20,-373897302),s=this.gg(s,i,n,o,t[5],5,-701558691),o=this.gg(o,s,i,n,t[10],9,38016083),n=this.gg(n,o,s,i,t[15],14,-660478335),i=this.gg(i,n,o,s,t[4],20,-405537848),s=this.gg(s,i,n,o,t[9],5,568446438),o=this.gg(o,s,i,n,t[14],9,-1019803690),n=this.gg(n,o,s,i,t[3],14,-187363961),i=this.gg(i,n,o,s,t[8],20,1163531501),s=this.gg(s,i,n,o,t[13],5,-1444681467),o=this.gg(o,s,i,n,t[2],9,-51403784),n=this.gg(n,o,s,i,t[7],14,1735328473),i=this.gg(i,n,o,s,t[12],20,-1926607734),s=this.hh(s,i,n,o,t[5],4,-378558),o=this.hh(o,s,i,n,t[8],11,-2022574463),n=this.hh(n,o,s,i,t[11],16,1839030562),i=this.hh(i,n,o,s,t[14],23,-35309556),s=this.hh(s,i,n,o,t[1],4,-1530992060),o=this.hh(o,s,i,n,t[4],11,1272893353),n=this.hh(n,o,s,i,t[7],16,-155497632),i=this.hh(i,n,o,s,t[10],23,-1094730640),s=this.hh(s,i,n,o,t[13],4,681279174),o=this.hh(o,s,i,n,t[0],11,-358537222),n=this.hh(n,o,s,i,t[3],16,-722521979),i=this.hh(i,n,o,s,t[6],23,76029189),s=this.hh(s,i,n,o,t[9],4,-640364487),o=this.hh(o,s,i,n,t[12],11,-421815835),n=this.hh(n,o,s,i,t[15],16,530742520),i=this.hh(i,n,o,s,t[2],23,-995338651),s=this.ii(s,i,n,o,t[0],6,-198630844),o=this.ii(o,s,i,n,t[7],10,1126891415),n=this.ii(n,o,s,i,t[14],15,-1416354905),i=this.ii(i,n,o,s,t[5],21,-57434055),s=this.ii(s,i,n,o,t[12],6,1700485571),o=this.ii(o,s,i,n,t[3],10,-1894986606),n=this.ii(n,o,s,i,t[10],15,-1051523),i=this.ii(i,n,o,s,t[1],21,-2054922799),s=this.ii(s,i,n,o,t[8],6,1873313359),o=this.ii(o,s,i,n,t[15],10,-30611744),n=this.ii(n,o,s,i,t[6],15,-1560198380),i=this.ii(i,n,o,s,t[13],21,1309151649),s=this.ii(s,i,n,o,t[4],6,-145523070),o=this.ii(o,s,i,n,t[11],10,-1120210379),n=this.ii(n,o,s,i,t[2],15,718787259),i=this.ii(i,n,o,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,s,i,n,o){return t=this.add32(this.add32(t,e),this.add32(i,o)),this.add32(t<<n|t>>>32-n,s)}ff(e,t,s,i,n,o,a){return this.cmn(t&s|~t&i,e,t,n,o,a)}gg(e,t,s,i,n,o,a){return this.cmn(t&i|s&~i,e,t,n,o,a)}hh(e,t,s,i,n,o,a){return this.cmn(t^s^i,e,t,n,o,a)}ii(e,t,s,i,n,o,a){return this.cmn(s^(t|~i),e,t,n,o,a)}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 n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)n[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(n[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(s,n),i=0;i<16;i++)n[i]=0;return n[14]=t*8,this.md5cycle(s,n),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}},LICENSE_TYPES={"01":"GRID","02":"CHARTS","0102":"BOTH"},LICENSING_HELP_URL="https://ag-grid.com/licensing/",_LicenseManager=class p{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new MD5,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(p.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 n=p.getGridReleaseDate(),o=p.formatDate(n);this.outputExpiredKey(t.expiry,o,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(p.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,n=s.substring(i),o=s.substring(0,i),[a,r,h]=p.extractBracketedInformation(s);return{md5:n,license:o,version:a,isTrial:r,type:h}}getLicenseDetails(t){const s=p.chartsLicenseManager?"BOTH":"GRID";if((0,import_core._missingOrEmpty)(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=p.getGridReleaseDate(),{md5:n,license:o,version:a,isTrial:r,type:h}=p.extractLicenseComponents(t);let l=n===this.md5.md5(o)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,c,d,u=null,g=!1,m;function f(){c=u<new Date,d=void 0}if(l&&(u=p.extractExpiry(o),l=!isNaN(u.getTime()),l))switch(d=i>u,a){case"legacy":case"2":{r&&f();break}case"3":(0,import_core._missingOrEmpty)(h)?l=!1:(m=h,h!==LICENSE_TYPES["01"]&&h!==LICENSE_TYPES["0102"]||s==="BOTH"&&m!=="BOTH"?(l=!1,g=!0):r&&f())}return l?{licenseKey:t,valid:l,expiry:p.formatDate(u),expired:d,version:a,isTrial:r,trialExpired:c,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:m}:{licenseKey:t,valid:l,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:m}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!(0,import_core._missingOrEmpty)(this.watermarkMessage)}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.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),n=t.getMonth(),o=t.getFullYear();return i+" "+s[n]+" "+o}static getGridReleaseDate(){return new Date(parseInt(p.decode(p.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",n,o,a,r,h,l,c,d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)r=s.indexOf(u.charAt(d++)),h=s.indexOf(u.charAt(d++)),l=s.indexOf(u.charAt(d++)),c=s.indexOf(u.charAt(d++)),n=r<<2|h>>4,o=(h&15)<<4|l>>2,a=(l&3)<<6|c,i=i+String.fromCharCode(n),l!=64&&(i=i+String.fromCharCode(o)),c!=64&&(i=i+String.fromCharCode(a));return i=p.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 n=t.charCodeAt(i);n<128?s+=String.fromCharCode(n):n>127&&n<2048?(s+=String.fromCharCode(n>>6|192),s+=String.fromCharCode(n&63|128)):(s+=String.fromCharCode(n>>12|224),s+=String.fromCharCode(n>>6&63|128),s+=String.fromCharCode(n&63|128))}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t}static setLicenseKey(t){this.licenseKey=t,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const s=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(r=>r==="TRIAL").length===1,n=s.filter(r=>r.indexOf("v")===0)[0],o=n?n.replace("v",""):"legacy",a=LICENSE_TYPES[s.filter(r=>LICENSE_TYPES[r])[0]];return[o,i,a]}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 ${LICENSING_HELP_URL}.`," ","*"),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 ${LICENSING_HELP_URL}.`," ","*"),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,n){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${s}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};_LicenseManager.RELEASE_INFORMATION="MTczMTQzMDQwMzMxOQ==";var LicenseManager=_LicenseManager,import_core2=require("@ag-grid-community/core"),AgWatermark=class extends import_core2.Component{constructor(){super(`<div class="ag-watermark"> <div data-ref="eLicenseTextRef" class="ag-watermark-text"></div> </div>`),this.eLicenseTextRef=import_core2.RefPlaceholder}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},AgWatermarkSelector={selector:"AG-WATERMARK",component:AgWatermark},GridLicenseManager=class extends import_core3.BeanStub{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new LicenseManager((0,import_core3._getDocument)(this.gos)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new LicenseManager(null).getLicenseDetails(e)}getWatermarkSelector(){return AgWatermarkSelector}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){LicenseManager.setLicenseKey(e)}static setChartsLicenseManager(e){LicenseManager.setChartsLicenseManager(e)}},VERSION="32.3.4",import_core4=require("@ag-grid-community/core"),AgMenuItemRenderer=class extends import_core4.Component{constructor(){super(),this.setTemplate("<div></div>")}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=(0,import_core4._loadTemplate)(`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`),{checked:t,icon:s}=this.params;t?e.appendChild((0,import_core4._createIconNoSpan)("check",this.gos)):s&&((0,import_core4._isNodeOrElement)(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:(0,import_core4._warnOnce)("menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=(0,import_core4._loadTemplate)(`<span data-ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=(0,import_core4._loadTemplate)(`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=(0,import_core4._loadTemplate)(`<span data-ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"smallLeft":"smallRight";(0,import_core4._setAriaExpanded)(t,!1),e.appendChild((0,import_core4._createIconNoSpan)(s,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},EnterpriseCoreModule=(0,import_core5._defineModule)({version:VERSION,moduleName:import_core5.ModuleNames.EnterpriseCoreModule,beans:[GridLicenseManager],userComponents:[{name:"agMenuItem",classImp:AgMenuItemRenderer}]}),import_core6=require("@ag-grid-community/core");function getAgGroupComponentTemplate(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return` <div class="ag-group ag-${t}-group" role="presentation"> <div data-ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar"> <ag-checkbox data-ref="cbGroupEnabled"></ag-checkbox> </div> <div data-ref="eContainer" class="ag-group-container ag-group-container-${s} ag-${t}-group-container"></div> </div> `}var AgGroupComponent=class extends import_core6.Component{constructor(e={}){super(getAgGroupComponentTemplate(e),[import_core6.AgCheckboxSelector]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=import_core6.RefPlaceholder,this.cbGroupEnabled=import_core6.RefPlaceholder,this.eContainer=import_core6.RefPlaceholder;const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:n,suppressToggleExpandOnEnableChange:o,useToggle:a}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=a??!1,this.alignItems=e.alignItems||"center",this.expanded=n??!0,i!=null&&(this.suppressEnabledCheckbox=i),o!=null&&(this.suppressToggleExpandOnEnableChange=o)}postConstruct(){if(this.setupTitleBar(),this.items.length){const n=this.items;this.items=[],this.addItems(n)}const e=this.localeService.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(),(0,import_core6._setDisplayed)(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(n=>{this.setEnabled(n,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(n)}),t!=null&&this.onEnableChange(t),s!=null&&this.onExpandedChange(s)}refreshChildDisplay(){(0,import_core6._setDisplayed)(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(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(),(0,import_core6._setDisplayed)(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){e.forEach(t=>this.addItem(t))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const s=this.eContainer,i=e instanceof import_core6.Component?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(s.insertAdjacentElement("afterbegin",i),this.items.unshift(i)):(s.appendChild(i),this.items.push(i))}hideItem(e,t){const s=this.items[t];(0,import_core6._setDisplayed)(s,!e)}getItemIndex(e){const t=e instanceof import_core6.Component?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?.addCssClass(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 DefaultTitleBar(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 import_core6.AgToggleButton({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:t=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCssClass("ag-group-title-bar"),e.addCssClass(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},TITLE_BAR_DISABLED_CLASS="ag-disabled-group-title-bar";function getDefaultTitleBarTemplate(e){const t=e.cssIdentifier??"default",s=e.suppressKeyboardNavigation?"presentation":"role";return` <div class="ag-group-title-bar ag-${t}-group-title-bar ag-unselectable" role="${s}"> <span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" data-ref="eGroupOpenedIcon" role="presentation"></span> <span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" data-ref="eGroupClosedIcon" role="presentation"></span> <span data-ref="eTitle" class="ag-group-title ag-${t}-group-title"></span> </div> `}var DefaultTitleBar=class extends import_core6.Component{constructor(e={}){super(getDefaultTitleBarTemplate(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=import_core6.RefPlaceholder,this.eGroupClosedIcon=import_core6.RefPlaceholder,this.eTitle=import_core6.RefPlaceholder;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(){this.eGroupClosedIcon.appendChild((0,import_core6._createIcon)("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild((0,import_core6._createIcon)("columnSelectOpen",this.gos,null)),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case import_core6.KeyCode.ENTER:case import_core6.KeyCode.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case import_core6.KeyCode.RIGHT:case import_core6.KeyCode.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===import_core6.KeyCode.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||(0,import_core6._setAriaExpanded)(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;(0,import_core6._setDisplayed)(this.eGroupOpenedIcon,t&&e),(0,import_core6._setDisplayed)(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??"",(0,import_core6._setDisplayed)(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains(TITLE_BAR_DISABLED_CLASS);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(TITLE_BAR_DISABLED_CLASS),t.removeAttribute("tabindex")):(t.classList.remove(TITLE_BAR_DISABLED_CLASS),typeof this.title=="string"&&!this.suppressKeyboardNavigation?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}},AgGroupComponentSelector={selector:"AG-GROUP-COMPONENT",component:AgGroupComponent},import_core13=require("@ag-grid-community/core"),import_core9=require("@ag-grid-community/core"),import_core7=require("@ag-grid-community/core"),import_core8=require("@ag-grid-community/core"),AgPill=class extends import_core8.Component{constructor(e){super(` <div class="ag-pill" role="option"> <span class="ag-pill-text" data-ref="eText"></span> <span class="ag-button ag-pill-button" data-ref="eButton" role="presentation"></span> </div> `),this.config=e,this.eText=import_core7.RefPlaceholder,this.eButton=import_core7.RefPlaceholder}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}},AgPillContainer=class extends import_core9.Component{constructor(){super(` <div class="ag-pill-container" role="listbox"></div> `),this.pills=[]}wireBeans(e){this.focusService=e.focusService}init(e){this.params=e,this.refresh()}refresh(){this.clearPills();const{params:e,onPillKeyDown:t}=this,s=e.getValue();if(!Array.isArray(s))return;const i=s.length;for(let n=0;n<i;n++){const o=s[n],a=this.createBean(new AgPill({onButtonClick:()=>this.onPillButtonClick(a),onKeyDown:t.bind(this)})),r=a.getGui();(0,import_core9._setAriaPosInSet)(r,n+1),(0,import_core9._setAriaSetSize)(r,i),e.onPillMouseDown&&a.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&a.addGuiEventListener("focus",e.announceItemFocus),a.setText(o),a.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(r),this.pills.push(a)}}onNavigationKeyDown(e){const{key:t}=e;if(!this.pills.length||t!==import_core9.KeyCode.LEFT&&t!==import_core9.KeyCode.RIGHT)return;e.preventDefault();const s=(0,import_core9._getActiveDomElement)(this.gos),i=this.getGui(),{params:n,focusService:o}=this;if(i.contains(s)){const a=o.findNextFocusableElement(i,!1,t===import_core9.KeyCode.LEFT);a?a.focus():n.eWrapper&&n.eWrapper.focus()}else{const a=o.findFocusableElements(i);a.length>0&&a[t===import_core9.KeyCode.RIGHT?0:a.length-1].focus()}}clearPills(){const e=this.getGui();e.contains((0,import_core9._getActiveDomElement)(this.gos))&&this.params.eWrapper&&this.params.eWrapper.focus(),(0,import_core9._clearElement)(e),this.destroyBeans(this.pills),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t!==import_core9.KeyCode.DELETE&&t!==import_core9.KeyCode.BACKSPACE)return;e.preventDefault();const s=(0,import_core9._getDocument)(this.gos),i=this.pills.findIndex(o=>o.getGui().contains(s.activeElement));if(i===-1)return;const n=this.pills[i];n&&this.deletePill(n,i)}deletePill(e,t){const s=e.getText(),i=(this.params.getValue()||[]).filter(n=>n!==s);if(this.params.setValue(i),!i.length&&this.params.eWrapper)this.params.eWrapper.focus();else if(t!=null){const n=this.pills[Math.min(t,this.pills.length-1)];n&&n.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},import_core12=require("@ag-grid-community/core"),import_core10=require("@ag-grid-community/core"),RichSelectRow=class extends import_core10.Component{constructor(e){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e}wireBeans(e){this.userComponentFactory=e.userComponentFactory}setState(e){let t="";const{params:s}=this;s.valueFormatter&&(t=s.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!(0,import_core10._exists)(t))return;let s=(0,import_core10._exists)(e);if(s){const i=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){const n=i+e.length,o=(0,import_core10._escapeString)(t.slice(0,i),!0),a=(0,import_core10._escapeString)(t.slice(i,n),!0),r=(0,import_core10._escapeString)(t.slice(n));this.renderValueWithoutRenderer(`${o}<span class="ag-rich-select-row-text-highlight">${a}</span>${r}`)}else s=!1}s||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();(0,import_core10._setAriaSelected)(t.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}getValue(){return this.value}toggleHighlighted(e){this.addOrRemoveCssClass("ag-rich-select-row-highlighted",e)}populateWithoutRenderer(e,t){const s=(0,import_core10._getDocument)(this.gos),i=this.getGui(),n=s.createElement("span");n.style.overflow="hidden",n.style.textOverflow="ellipsis";const o=(0,import_core10._escapeString)((0,import_core10._exists)(t)?t:e,!0);this.parsedValue=(0,import_core10._exists)(o)?o:null,i.appendChild(n),this.renderValueWithoutRenderer(o),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>n.scrollWidth>n.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=(0,import_core10._exists)(e)?e:"&nbsp;")}populateWithRenderer(e,t){let s,i;if(this.params.cellRenderer){const n=this.getParentComponent()?.getParentComponent();i=this.userComponentFactory.getEditorRendererDetails(this.params,{value:e,valueFormatted:t,getValue:()=>n?.getValue(),setValue:o=>{n?.setValue(o,!0)},setTooltip:(o,a)=>{this.setTooltip({newTooltipText:o,shouldDisplayTooltip:a})}})}return i&&(s=i.newAgStackInstance()),s&&(0,import_core10._bindCellRendererToHtmlElement)(s,this.getGui()),s?(s.then(n=>{this.addDestroyFunc(()=>{this.destroyBean(n)})}),!0):!1}},import_core11=require("@ag-grid-community/core");function getVirtualListTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation"> <div class="ag-virtual-list-container ag-${e}-virtual-list-container" data-ref="eContainer"></div> </div>`}var VirtualList=class extends import_core11.TabGuardComp{constructor(e){super(getVirtualListTemplate(e?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=import_core11.RefPlaceholder,this.awaitStableCallbacks=[];const{cssIdentifier:t="default",ariaRole:s="listbox",listName:i}=e||{};this.cssIdentifier=t,this.ariaRole=s,this.listName=i}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.animationFrameService=e.animationFrameService,this.environment=e.environment}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.setAriaProperties(),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanged.bind(this)})}onGridStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}setAriaProperties(){const t=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;(0,import_core11._setAriaRole)(s,this.ariaRole),(0,import_core11._setAriaLabel)(s,t)}addResizeObserver(){const e=()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()),t=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=(0,import_core11._getAriaPosInSet)(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case import_core11.KeyCode.UP:case import_core11.KeyCode.DOWN:this.navigate(e.key===import_core11.KeyCode.UP)&&e.preventDefault();break;case import_core11.KeyCode.PAGE_HOME:case import_core11.KeyCode.PAGE_END:case import_core11.KeyCode.PAGE_UP:case import_core11.KeyCode.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){(0,import_core11._stopPropagationForAgGrid)(e),this.forceFocusOutOfContainer(e.shiftKey)}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?!1:(this.focusRow(t),!0)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const i=this.model.getRowCount()-1;let n=-1;return e===import_core11.KeyCode.PAGE_HOME?n=0:e===import_core11.KeyCode.PAGE_END?n=i:e===import_core11.KeyCode.PAGE_DOWN?n=Math.min(t+this.pageSize,i):e===import_core11.KeyCode.PAGE_UP&&(n=Math.max(t-this.pageSize,0)),n===-1?null:(s?this.focusRow(n):this.ensureIndexVisible(n),n)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{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.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return(0,import_core11._warnOnce)("invalid row index for ensureIndexVisible: ",e),!1;const i=e*this.rowHeight,n=i+this.rowHeight,o=this.getGui(),a=o.scrollTop,r=o.offsetHeight,h=a+r,l=t?0:this.rowHeight,c=a>i+l,d=h<n-l;if(c)return o.scrollTop=i,!0;if(d){const u=n-r;return o.scrollTop=u,!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.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();(0,import_core11._waitUntil)(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{const s=this.awaitStableCallbacks;this.awaitStableCallbacks=[],s.forEach(i=>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,n=Math.floor(s/this.rowHeight),o=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(n,o,e)}ensureRowsRendered(e,t,s){this.renderedRows.forEach((i,n)=>{(n<e||n>t)&&n!==this.lastFocusedRowIndex&&this.removeRow(n)}),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=document.createElement("div");s.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),(0,import_core11._setAriaRole)(s,this.ariaRole==="tree"?"treeitem":"option"),(0,import_core11._setAriaSetSize)(s,this.model.getRowCount()),(0,import_core11._setAriaPosInSet)(s,e+1),s.setAttribute("tabindex","-1"),s.style.height=`${this.rowHeight}px`,s.style.top=`${this.rowHeight*e}px`;const i=this.componentCreator(t,s);i.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),s.appendChild(i.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(e,{rowComponent:i,eDiv:s,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),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())}},LIST_COMPONENT_NAME="ag-rich-select-list",ROW_COMPONENT_NAME="ag-rich-select-row",AgRichSelectList=class extends VirtualList{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.params=e,this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct(),this.createLoadingElement();const{cellRowHeight:e,pickerAriaLabelKey:t,pickerAriaLabelValue:s}=this.params;e&&this.setRowHeight(e);const i=this.getGui(),n=this.getAriaElement();this.addManagedListeners(i,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this)}),i.classList.add(LIST_COMPONENT_NAME);const o=`${LIST_COMPONENT_NAME}-${this.getCompId()}`;n.setAttribute("id",o);const r=this.localeService.getLocaleTextFunc()(t,s);(0,import_core12._setAriaLabel)(n,r),(0,import_core12._setAriaControls)(this.richSelectWrapper,n)}navigateToPage(e){const t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&this.animationFrameService.requestAnimationFrame(()=>{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){this.animationFrameService.requestAnimationFrame(()=>{if(!this.currentList||!this.isAlive())return;const s=this.currentList.length,i=this.lastRowHovered,n=e===import_core12.KeyCode.DOWN?1:-1,o=Math.min(Math.max(i===-1?0:i+n,0),s-1);this.highlightIndex(o),t()})}selectValue(e){if(!this.currentList)return this.eLoading&&this.appendChild(this.eLoading),!1;if(this.eLoading?.offsetParent&&this.eLoading.parentElement?.removeChild(this.eLoading),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.selectedItems.has(i)||this.selectedItems.add(i)}this.refreshSelectedItems()}getCurrentList(){return this.currentList}setCurrentList(e){this.currentList=e,this.setModel({getRowCount:()=>e.length,getRow:t=>e[t],areRowsEqual:(t,s)=>t===s})}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 n=e===i;if(s.toggleHighlighted(n),n){const o=`${ROW_COMPONENT_NAME}-${s.getCompId()}`;(0,import_core12._setAriaActiveDescendant)(this.richSelectWrapper,o),this.richSelectWrapper.setAttribute("data-active-option",o)}}))}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 s=[];for(let i=0;i<e.length;i++){const n=t.indexOf(e[i]);n>=0&&s.push(n)}return s}toggleListItemSelection(e){this.selectedItems.has(e)?this.selectedItems.delete(e):this.selectedItems.add(e),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{const t=this.selectedItems.has(e.getValue());e.updateSelected(t)})}createLoadingElement(){const e=(0,import_core12._getDocument)(this.gos),t=this.localeService.getLocaleTextFunc(),s=e.createElement("div");s.classList.add("ag-loading-text"),s.innerText=t("loadingOoo","Loading..."),this.eLoading=s}createRowComponent(e,t){const s=new RichSelectRow(this.params);t.setAttribute("id",`${ROW_COMPONENT_NAME}-${s.getCompId()}`),s.setParentComponent(this),this.createBean(s),s.setState(e);const{highlightMatch:i,searchType:n="fuzzy"}=this.params;return i&&n!=="fuzzy"&&s.highlightString(this.getSearchString()),s}getRowForMouseEvent(e){const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),n=e.clientY-s.top+i;return Math.floor(n/this.getRowHeight())}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)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.eLoading=void 0}},AgRichSelect=class extends import_core13.AgPickerField{constructor(e){super({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:e?.template??` <div class="ag-picker-field" role="presentation"> <div data-ref="eLabel"></div> <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed"> <span data-ref="eDisplayField" class="ag-picker-field-display"></span> <ag-input-text-field data-ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field> <span data-ref="eDeselect" class="ag-rich-select-deselect-button ag-picker-field-icon" role="presentation"></span> <span data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></span> </div> </div>`,agComponents:[import_core13.AgInputTextFieldSelector],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.searchStringCreator=null,this.eInput=import_core13.RefPlaceholder,this.eDeselect=import_core13.RefPlaceholder,this.skipWrapperAnnouncement=!1;const{value:t,valueList:s,searchStringCreator:i}=e||{};t!==void 0&&(this.value=t),s!=null&&(this.values=s),i&&(this.searchStringCreator=i)}wireBeans(e){super.wireBeans(e),this.userComponentFactory=e.userComponentFactory,this.ariaAnnouncementService=e.ariaAnnouncementService}postConstruct(){super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild((0,import_core13._createIconNoSpan)("cancel",this.gos));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=(0,import_core13._debounce)(this.clearSearchString,i),this.renderSelectedValue(),e&&this.eInput.onValueChange(n=>this.searchTextFromString(n)),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,localeService:s}=this;e.tabIndex=t.get("tabIndex");const i=s.getLocaleTextFunc();this.ariaDeleteSelection=i("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=i("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=i("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new AgRichSelectList(this.config,this.eWrapper,()=>this.searchString)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(){const{value:e,eDisplayField:t,config:s}=this,{allowTyping:i,cellRenderer:n,initialInputValue:o,multiSelect:a,suppressDeselectAll:r,suppressMultiSelectPillRenderer:h}=s,l=this.config.valueFormatter?this.config.valueFormatter(e):e;if(i){this.eInput.setValue(o??l);return}if(a&&!r){const u=e==null||Array.isArray(e)&&e.length===0;this.eDeselect.classList.toggle("ag-hidden",u)}let c;if(a&&!h){this.createOrUpdatePillContainer(t);return}n&&(c=this.userComponentFactory.getEditorRendererDetails(s,{value:e,valueFormatted:l,getValue:()=>this.getValue(),setValue:u=>{this.setValue(u,!0)},setTooltip:(u,g)=>{this.setTooltip({newTooltipText:u,shouldDisplayTooltip:g})}}));let d;if(c&&(d=c.newAgStackInstance()),d)(0,import_core13._clearElement)(t),(0,import_core13._bindCellRendererToHtmlElement)(d,t),d.then(u=>{this.addDestroyFunc(()=>this.destroyBean(u))});else{if((0,import_core13._exists)(this.value))t.innerText=l,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:u}=s;(0,import_core13._exists)(u)?(t.innerHTML=`${(0,import_core13._escapeString)(u)}`,t.classList.add("ag-display-as-placeholder")):(0,import_core13._clearElement)(t)}this.setTooltip({newTooltipText:l??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:s}=e;!this.listComponent||this.listComponent.getCurrentList()===t||(this.listComponent.setCurrentList(t),s&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&(this.listComponent.selectValue(this.value)||this.listComponent.refresh())),this.alignPickerToComponent()))}showPicker(){super.showPicker();const{listComponent:e,value:t}=this;if(!e)return;let s=null;this.value!=null&&(e.selectValue(this.value),s=e.getIndicesForValues(Array.isArray(t)?t:[t])[0]),s!=null?e.highlightIndex(s):e.refresh(),this.displayOrHidePicker()}beforeHidePicker(){super.beforeHidePicker()}createOrUpdatePillContainer(e){if(!this.pillContainer){const t=this.pillContainer=this.createBean(new AgPillContainer);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),(0,import_core13._clearElement)(e),e.appendChild(t.getGui()),t.init({eWrapper:this.eWrapper,onPillMouseDown:s=>{s.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(this.ariaDeleteSelection)},getValue:()=>this.getValue(),setValue:s=>this.setValue(s,!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:n}=t;if(s){const o=e.getFocusableElement();o.focus(),o.select()}else i&&!n&&!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===import_core13.KeyCode.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!(0,import_core13._isEventFromPrintableCharacter)(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()}buildSearchStrings(e){const{valueFormatter:t=i=>i}=this.config;let s;return typeof e[0]=="number"||typeof e[0]=="string"?s=e.map(i=>t(i)):typeof e[0]=="object"&&this.searchStringCreator&&(s=this.searchStringCreator(e)),s}filterListModel(e){const{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;const{values:e}=this,t=this.buildSearchStrings(e);if(!t){this.listComponent.highlightIndex(-1);return}const{suggestions:s,filteredValues:i}=this.getSuggestionsAndFilteredValues(this.searchString,t),{filterList:n,highlightMatch:o,searchType:a="fuzzy"}=this.config,r=i.length,h=!!(n&&this.searchString!=="");if(this.filterListModel(h?i:e),s.length){const l=h?0:t.indexOf(s[0]);this.listComponent?.highlightIndex(l)}else if(this.listComponent?.highlightIndex(-1),!h||r)this.listComponent?.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const l=this.listComponent?.getAriaElement();l&&(0,import_core13._setAriaActiveDescendant)(l,null)}o&&a!=="fuzzy"&&this.listComponent?.highlightFilterMatch(this.searchString),this.displayOrHidePicker()}getSuggestionsAndFilteredValues(e,t){let s=[];const i=[];if(!e.length)return{suggestions:s,filteredValues:i};const{searchType:n="fuzzy",filterList:o}=this.config;if(n==="fuzzy"){const a=(0,import_