ag-grid-charts-enterprise
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
34 lines • 921 kB
JavaScript
var Zo=Object.defineProperty,Ru=Object.getOwnPropertyDescriptor,Eu=Object.getOwnPropertyNames,Iu=Object.prototype.hasOwnProperty,Ui=(e,t)=>{for(var s in t)Zo(e,s,{get:t[s],enumerable:!0})},Jo=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Eu(t))!Iu.call(e,r)&&r!==s&&Zo(e,r,{get:()=>t[r],enumerable:!(i=Ru(t,r))||i.enumerable});return e},Hi=(e,t,s)=>(Jo(e,t,"default"),s&&Jo(s,t,"default")),Qo={};Ui(Qo,{AdvancedFilterModule:()=>ur,AgDialog:()=>Ze,AgGroupComponent:()=>pe,AgGroupComponentSelector:()=>G,AgMenuItemComponent:()=>Et,AgMenuItemRenderer:()=>ke,AgMenuList:()=>Je,AgMenuPanel:()=>Xi,AgPanel:()=>Gs,AgPrimaryCols:()=>Si,AgRichSelect:()=>Rt,ClipboardModule:()=>na,ColumnsToolPanelModule:()=>Ra,EnterpriseCoreModule:()=>H,ExcelExportModule:()=>Ha,FiltersToolPanelModule:()=>ja,GridChartsModule:()=>Qt,GroupCellRenderer:()=>ht,GroupCellRendererCtrl:()=>Lt,LicenseManager:()=>As,MasterDetailModule:()=>Ja,MenuModule:()=>ao,MultiFilter:()=>fs,MultiFilterModule:()=>co,PillDragComp:()=>Ds,PillDropZonePanel:()=>Ls,PivotDropZonePanel:()=>ss,RangeSelectionModule:()=>Ys,RichSelectModule:()=>ho,RowGroupDropZonePanel:()=>is,RowGroupingModule:()=>fi,ServerSideRowModelModule:()=>To,SetFilter:()=>Gi,SetFilterModule:()=>Go,SideBarModule:()=>os,SparklinesModule:()=>Vo,StatusBarModule:()=>Ko,TabbedLayout:()=>Ns,ToolPanelColDefService:()=>Sa,ValuesDropZonePanel:()=>Ci,ViewportRowModelModule:()=>$o,VirtualList:()=>Ge,VirtualListDragFeature:()=>Os,agCharts:()=>ui,exportMultipleSheetsAsExcel:()=>_a,getMultipleSheetsAsExcel:()=>Mi});import{ClientSideRowModelModule as Du}from"ag-grid-community";import{CommunityFeaturesModule as Lu,ModuleRegistry as ku}from"ag-grid-community";import{CsvExportModule as Gu}from"ag-grid-community";import{InfiniteRowModelModule as Ou}from"ag-grid-community";import{ModuleNames as zi,_FilterCoreModule as Bu,_defineModule as Wi}from"ag-grid-community";import{ModuleNames as Nu,_defineModule as Vu}from"ag-grid-community";import{BeanStub as _u,_getDocument as Uu}from"ag-grid-community";import{_missingOrEmpty as Ki}from"ag-grid-community";var Hu=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,o){return this.cmn(t&s|~t&i,e,t,r,a,o)}gg(e,t,s,i,r,a,o){return this.cmn(t&i|s&~i,e,t,r,a,o)}hh(e,t,s,i,r,a,o){return this.cmn(t^s^i,e,t,r,a,o)}ii(e,t,s,i,r,a,o){return this.cmn(s^(t|~i),e,t,r,a,o)}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}},Ms={"01":"GRID","02":"CHARTS","0102":"BOTH"},en="https://ag-grid.com/licensing/",tn=class ae{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new Hu,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(ae.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=ae.getGridReleaseDate(),a=ae.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(ae.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),[o,n,l]=ae.extractBracketedInformation(s);return{md5:r,license:a,version:o,isTrial:n,type:l}}getLicenseDetails(t){const s=ae.chartsLicenseManager?"BOTH":"GRID";if(Ki(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=ae.getGridReleaseDate(),{md5:r,license:a,version:o,isTrial:n,type:l}=ae.extractLicenseComponents(t);let c=r===this.md5.md5(a)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,h,d,u=null,p=!1,g;function m(){h=u<new Date,d=void 0}if(c&&(u=ae.extractExpiry(a),c=!isNaN(u.getTime()),c))switch(d=i>u,o){case"legacy":case"2":{n&&m();break}case"3":Ki(l)?c=!1:(g=l,l!==Ms["01"]&&l!==Ms["0102"]||s==="BOTH"&&g!=="BOTH"?(c=!1,p=!0):n&&m())}return c?{licenseKey:t,valid:c,expiry:ae.formatDate(u),expired:d,version:o,isTrial:n,trialExpired:h,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:t,valid:c,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!Ki(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(),r=t.getMonth(),a=t.getFullYear();return i+" "+s[r]+" "+a}static getGridReleaseDate(){return new Date(parseInt(ae.decode(ae.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",r,a,o,n,l,c,h,d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)n=s.indexOf(u.charAt(d++)),l=s.indexOf(u.charAt(d++)),c=s.indexOf(u.charAt(d++)),h=s.indexOf(u.charAt(d++)),r=n<<2|l>>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|h,i=i+String.fromCharCode(r),c!=64&&(i=i+String.fromCharCode(a)),h!=64&&(i=i+String.fromCharCode(o));return i=ae.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}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(n=>n.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(n=>n==="TRIAL").length===1,r=s.filter(n=>n.indexOf("v")===0)[0],a=r?r.replace("v",""):"legacy",o=Ms[s.filter(n=>Ms[n])[0]];return[a,i,o]}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 ${en}.`," ","*"),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 ${en}.`," ","*"),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 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"}};tn.RELEASE_INFORMATION="MTczMTQzMDQwMzMxOQ==";var Fs=tn;import{Component as zu,RefPlaceholder as Wu}from"ag-grid-community";var Ku=class extends zu{constructor(){super(`<div class="ag-watermark">
<div data-ref="eLicenseTextRef" class="ag-watermark-text"></div>
</div>`),this.eLicenseTextRef=Wu}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()}},$u={selector:"AG-WATERMARK",component:Ku},As=class extends _u{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new Fs(Uu(this.gos)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new Fs(null).getLicenseDetails(e)}getWatermarkSelector(){return $u}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Fs.setLicenseKey(e)}static setChartsLicenseManager(e){Fs.setChartsLicenseManager(e)}},ju="32.3.5";import{Component as Yu,_createIconNoSpan as sn,_isNodeOrElement as qu,_loadTemplate as Rs,_setAriaExpanded as Xu,_warnOnce as Zu}from"ag-grid-community";var ke=class extends Yu{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=Rs(`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`),{checked:t,icon:s}=this.params;t?e.appendChild(sn("check",this.gos)):s&&(qu(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:Zu("menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=Rs(`<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=Rs(`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=Rs(`<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";Xu(t,!1),e.appendChild(sn(s,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},H=Vu({version:ju,moduleName:Nu.EnterpriseCoreModule,beans:[As],userComponents:[{name:"agMenuItem",classImp:ke}]});import{AgCheckboxSelector as Ju,AgToggleButton as Qu,Component as Es,KeyCode as Ft,RefPlaceholder as nt,_createIcon as rn,_setAriaExpanded as ep,_setDisplayed as Xe}from"ag-grid-community";function tp(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 pe=class extends Es{constructor(e={}){super(tp(e),[Ju]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=nt,this.cbGroupEnabled=nt,this.eContainer=nt;const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:r,suppressToggleExpandOnEnableChange:a,useToggle:o}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=o??!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.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(),Xe(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(){Xe(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(),Xe(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 Es?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];Xe(s,!e)}getItemIndex(e){const t=e instanceof Es?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 ip(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 Qu({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}},$i="ag-disabled-group-title-bar";function sp(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 ip=class extends Es{constructor(e={}){super(sp(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=nt,this.eGroupClosedIcon=nt,this.eTitle=nt;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(rn("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(rn("columnSelectOpen",this.gos,null)),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case Ft.ENTER:case Ft.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case Ft.RIGHT:case Ft.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===Ft.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ep(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;Xe(this.eGroupOpenedIcon,t&&e),Xe(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??"",Xe(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains($i);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($i),t.removeAttribute("tabindex")):(t.classList.remove($i),typeof this.title=="string"&&!this.suppressKeyboardNavigation?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}},G={selector:"AG-GROUP-COMPONENT",component:pe};import{AgInputTextFieldSelector as rp,AgPickerField as ap,KeyCode as Y,RefPlaceholder as an,_bindCellRendererToHtmlElement as op,_clearElement as ji,_createIconNoSpan as np,_debounce as lp,_escapeString as cp,_exists as on,_fuzzySuggestions as hp,_getActiveDomElement as dp,_isEventFromPrintableCharacter as up,_isVisible as pp,_setAriaActiveDescendant as gp,_stopPropagationForAgGrid as mp}from"ag-grid-community";import{Component as fp,KeyCode as lt,_clearElement as Cp,_getActiveDomElement as nn,_getDocument as vp,_setAriaPosInSet as Sp,_setAriaSetSize as yp}from"ag-grid-community";import{RefPlaceholder as ln}from"ag-grid-community";import{Component as wp}from"ag-grid-community";var xp=class extends wp{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=ln,this.eButton=ln}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}},bp=class extends fp{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 r=0;r<i;r++){const a=s[r],o=this.createBean(new xp({onButtonClick:()=>this.onPillButtonClick(o),onKeyDown:t.bind(this)})),n=o.getGui();Sp(n,r+1),yp(n,i),e.onPillMouseDown&&o.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&o.addGuiEventListener("focus",e.announceItemFocus),o.setText(a),o.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(n),this.pills.push(o)}}onNavigationKeyDown(e){const{key:t}=e;if(!this.pills.length||t!==lt.LEFT&&t!==lt.RIGHT)return;e.preventDefault();const s=nn(this.gos),i=this.getGui(),{params:r,focusService:a}=this;if(i.contains(s)){const o=a.findNextFocusableElement(i,!1,t===lt.LEFT);o?o.focus():r.eWrapper&&r.eWrapper.focus()}else{const o=a.findFocusableElements(i);o.length>0&&o[t===lt.RIGHT?0:o.length-1].focus()}}clearPills(){const e=this.getGui();e.contains(nn(this.gos))&&this.params.eWrapper&&this.params.eWrapper.focus(),Cp(e),this.destroyBeans(this.pills),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t!==lt.DELETE&&t!==lt.BACKSPACE)return;e.preventDefault();const s=vp(this.gos),i=this.pills.findIndex(a=>a.getGui().contains(s.activeElement));if(i===-1)return;const r=this.pills[i];r&&this.deletePill(r,i)}deletePill(e,t){const s=e.getText(),i=(this.params.getValue()||[]).filter(r=>r!==s);if(this.params.setValue(i),!i.length&&this.params.eWrapper)this.params.eWrapper.focus();else if(t!=null){const r=this.pills[Math.min(t,this.pills.length-1)];r&&r.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}};import{KeyCode as Pp,_getDocument as Tp,_setAriaActiveDescendant as Mp,_setAriaControls as Fp,_setAriaLabel as Ap}from"ag-grid-community";import{Component as Rp,_bindCellRendererToHtmlElement as Ep,_escapeString as Is,_exists as At,_getDocument as Ip,_setAriaSelected as Dp}from"ag-grid-community";var Lp=class extends Rp{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||!At(t))return;let s=At(e);if(s){const i=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){const r=i+e.length,a=Is(t.slice(0,i),!0),o=Is(t.slice(i,r),!0),n=Is(t.slice(r));this.renderValueWithoutRenderer(`${a}<span class="ag-rich-select-row-text-highlight">${o}</span>${n}`)}else s=!1}s||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();Dp(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=Ip(this.gos),i=this.getGui(),r=s.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const a=Is(At(t)?t:e,!0);this.parsedValue=At(a)?a:null,i.appendChild(r),this.renderValueWithoutRenderer(a),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=At(e)?e:" ")}populateWithRenderer(e,t){let s,i;if(this.params.cellRenderer){const r=this.getParentComponent()?.getParentComponent();i=this.userComponentFactory.getEditorRendererDetails(this.params,{value:e,valueFormatted:t,getValue:()=>r?.getValue(),setValue:a=>{r?.setValue(a,!0)},setTooltip:(a,o)=>{this.setTooltip({newTooltipText:a,shouldDisplayTooltip:o})}})}return i&&(s=i.newAgStackInstance()),s&&Ep(s,this.getGui()),s?(s.then(r=>{this.addDestroyFunc(()=>{this.destroyBean(r)})}),!0):!1}};import{KeyCode as ge,RefPlaceholder as kp,TabGuardComp as Gp,_getAriaPosInSet as Op,_setAriaLabel as Bp,_setAriaPosInSet as Np,_setAriaRole as cn,_setAriaSetSize as Vp,_stopPropagationForAgGrid as _p,_waitUntil as Up,_warnOnce as Hp}from"ag-grid-community";function zp(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 Ge=class extends Gp{constructor(e){super(zp(e?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=kp,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;cn(s,this.ariaRole),Bp(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=Op(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case ge.UP:case ge.DOWN:this.navigate(e.key===ge.UP)&&e.preventDefault();break;case ge.PAGE_HOME:case ge.PAGE_END:case ge.PAGE_UP:case ge.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){_p(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 r=-1;return e===ge.PAGE_HOME?r=0:e===ge.PAGE_END?r=i:e===ge.PAGE_DOWN?r=Math.min(t+this.pageSize,i):e===ge.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),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 Hp("invalid row index for ensureIndexVisible: ",e),!1;const i=e*this.rowHeight,r=i+this.rowHeight,a=this.getGui(),o=a.scrollTop,n=a.offsetHeight,l=o+n,c=t?0:this.rowHeight,h=o>i+c,d=l<r-c;if(h)return a.scrollTop=i,!0;if(d){const u=r-n;return a.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();Up(()=>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,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=document.createElement("div");s.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),cn(s,this.ariaRole==="tree"?"treeitem":"option"),Vp(s,this.model.getRowCount()),Np(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())}},hn="ag-rich-select-list",dn="ag-rich-select-row",Wp=class extends Ge{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(),r=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(hn);const a=`${hn}-${this.getCompId()}`;r.setAttribute("id",a);const n=this.localeService.getLocaleTextFunc()(t,s);Ap(r,n),Fp(this.richSelectWrapper,r)}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,r=e===Pp.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)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 r=e===i;if(s.toggleHighlighted(r),r){const a=`${dn}-${s.getCompId()}`;Mp(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 s=[];for(let i=0;i<e.length;i++){const r=t.indexOf(e[i]);r>=0&&s.push(r)}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=Tp(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 Lp(this.params);t.setAttribute("id",`${dn}-${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){const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),r=e.clientY-s.top+i;return Math.floor(r/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}},Rt=class extends ap{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:[rp],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.searchStringCreator=null,this.eInput=an,this.eDeselect=an,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(np("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=lp(this.clearSearchString,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,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 Wp(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:r,initialInputValue:a,multiSelect:o,suppressDeselectAll:n,suppressMultiSelectPillRenderer:l}=s,c=this.config.valueFormatter?this.config.valueFormatter(e):e;if(i){this.eInput.setValue(a??c);return}if(o&&!n){const u=e==null||Array.isArray(e)&&e.length===0;this.eDeselect.classList.toggle("ag-hidden",u)}let h;if(o&&!l){this.createOrUpdatePillContainer(t);return}r&&(h=this.userComponentFactory.getEditorRendererDetails(s,{value:e,valueFormatted:c,getValue:()=>this.getValue(),setValue:u=>{this.setValue(u,!0)},setTooltip:(u,p)=>{this.setTooltip({newTooltipText:u,shouldDisplayTooltip:p})}}));let d;if(h&&(d=h.newAgStackInstance()),d)ji(t),op(d,t),d.then(u=>{this.addDestroyFunc(()=>this.destroyBean(u))});else{if(on(this.value))t.innerText=c,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:u}=s;on(u)?(t.innerHTML=`${cp(u)}`,t.classList.add("ag-display-as-placeholder")):ji(t)}this.setTooltip({newTooltipText:c??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 bp);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),ji(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: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===Y.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!up(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:r,highlightMatch:a,searchType:o="fuzzy"}=this.config,n=i.length,l=!!(r&&this.searchString!=="");if(this.filterListModel(l?i:e),s.length){const c=l?0:t.indexOf(s[0]);this.listComponent?.highlightIndex(c)}else if(this.listComponent?.highlightIndex(-1),!l||n)this.listComponent?.ensureIndexVisible(0);else if(l){this.getAriaElement().removeAttribute("data-active-option");const c=this.listComponent?.getAriaElement();c&&gp(c,null)}a&&o!=="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:r="fuzzy",filterList:a}=this.config;if(r==="fuzzy"){const o=hp({inputValue:e,allSuggestions:t,hideIrrelevant:!0,addSequentialWeight:!0});s=o.values;const n=o.indices;if(a&&n.length)for(let l=0;l<n.length;l++)i.push(this.values[n[l]])}else s=t.filter((o,n)=>{const l=o.toLocaleLowerCase(),c=this.searchString.toLocaleLowerCase(),h=r==="match"?l.startsWith(c):l.indexOf(c)!==-1;return a&&h&&i.push(this.values[n]),h});return{suggestions:s,filteredValues:i}}displayOrHidePicker(){if(!this.listComponent)return;const e=this.listComponent.getGui(),t=this.listComponent.getCurrentList(),s=t?t.length===0:!1;e.classList.toggle("ag-hidden",s)}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(),this}onNavigationKeyDown(e,t,s){e.preventDefault();const i=t===Y.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?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([t]),!0)}}onDeleteKeyDown(e){const{eWrapper:t,gos:s}=this;dp(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 this.setValue(s.getLastItemHovered(),!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:"fieldPickerValueS