@genesislcap/foundation-rapid-cdn 15.79.1 → 15.79.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -250,7 +250,7 @@ function bv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
250
250
|
✕
|
|
251
251
|
</button></span>`)}</div>`)}<${e}-button class="criteria-toggle-button" appearance="outline" title=${e=>e.showingChips?`Add more criteria`:`View active filters`}?disabled=${e=>e.activeGroups.length===0||e.isInterpreting}@click=${e=>e.toggleCriteriaView()}><${e}-icon name="pen" size="sm"></${e}-icon></${e}-button><${e}-button class="criteria-clear-button" appearance="outline" title="Clear all filters" ?disabled=${e=>e.activeGroups.length===0||e.isInterpreting}@click=${e=>e.clearChips()}><${e}-icon name="trash-alt" size="sm"></${e}-icon></${e}-button>${A(e=>e.speechAvailable,T`<${e}-button class="mic-button" appearance="${e=>e.isRecording?`accent`:`outline`}" ?disabled=${e=>e.disabled||e.isInterpreting}@click=${e=>e.toggleSpeechInput()}title=${e=>e.isRecording?`Stop recording`:`Start voice input`}><${e}-icon class="mic-icon" name="microphone" size="lg" variant="solid"></${e}-icon></${e}-button>`)}</div></div>`)} `,kS=T` ${e=>xae(Ly(e))} `,Sae={contains:Jy.containsIgnoreCase,equals:Jy.EQ,startsWith:Jy.startsWith,endsWith:Jy.endsWith,greaterThan:Jy.GT,lessThan:Jy.LT,greaterThanOrEqual:Jy.GE,lessThanOrEqual:Jy.LE,notEqual:Jy.NE,dateIsToday:Jy.dateIsToday,dateIsAfter:Jy.dateIsGreaterEqual,dateIsGreaterEqual:Jy.dateIsGreaterEqual,dateIsBefore:Jy.dateIsLessEqual,dateIsLessEqual:Jy.dateIsLessEqual,dateIsEqual:Jy.dateIsEqual,dateTimeIsAfter:Jy.dateTimeIsGreaterEqual,dateTimeIsGreaterEqual:Jy.dateTimeIsGreaterEqual,dateTimeIsBefore:Jy.dateTimeIsLessEqual,dateTimeIsLessEqual:Jy.dateTimeIsLessEqual};function Cae(e){let t=Sae[e.operator];if(!t)throw Error(`Unknown criteria operator '${e.operator}'`);return new $y().withField(e.field).withValue(e.value??null).withSerialiser(t).withGroup(`default`).build()}function wae(e,t){return e.length===1?e[0]:e.reduce((e,n,r)=>r===0?[n]:[...e,t,n],[])}function AS(e){let t=new Qy,n=!1;for(let r of e){if(!r.clauses?.length)continue;let e=r.clauses.map(Cae),i=r.logic===`or`?Vy.Or():Vy.And(),a=wae(e,i),o=e.length>1?{join:i}:{};r.negated?t.And([Vy.Not(),a]):t.And(e.length===1?e[0]:e,o),n=!0}return n?t.build():``}let Tae=[`contains`,`equals`,`startsWith`,`notEqual`],jS=[`equals`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`,`notEqual`],MS=[`dateIsToday`,`dateIsAfter`,`dateIsBefore`,`dateIsEqual`,`dateIsGreaterEqual`,`dateIsLessEqual`],NS=[`dateTimeIsAfter`,`dateTimeIsBefore`,`dateTimeIsGreaterEqual`,`dateTimeIsLessEqual`],Eae={contains:`contains`,equals:`=`,startsWith:`starts with`,endsWith:`ends with`,notEqual:`≠`,greaterThan:`>`,lessThan:`<`,greaterThanOrEqual:`≥`,lessThanOrEqual:`≤`,dateIsToday:`is today`,dateIsAfter:`after`,dateIsBefore:`before`,dateIsEqual:`=`,dateIsGreaterEqual:`≥`,dateIsLessEqual:`≤`,dateTimeIsAfter:`after`,dateTimeIsBefore:`before`,dateTimeIsGreaterEqual:`≥`,dateTimeIsLessEqual:`≤`},Dae=/* @__PURE__ */ new Set([`DATE`,`LOCALDATE`]),Oae=/* @__PURE__ */ new Set([`DATETIME`,`NANO_TIMESTAMP`,`LOCALDATETIME`,`TIMESTAMP`]),PS=/* @__PURE__ */ new Set([`INT`,`INTEGER`,`LONG`,`SHORT`,`DOUBLE`,`BIGDECIMAL`,`DECIMAL`]);function FS(e){return(e||``).toUpperCase().trim().split(`(`)[0].trim()}function kae(e){let t=FS(e);return Dae.has(t)?MS:Oae.has(t)?NS:PS.has(t)?jS:Tae}function Aae(e){return PS.has(FS(e))}function jae(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e)&&e>0:typeof e==`string`?/^\d{8}$/.test(e)||/^\d{4}-\d{2}-\d{2}$/.test(e)||/^\d{8}-\d{2}:\d{2}(:\d{2})?$/.test(e):!1}function Mae(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e):typeof e==`string`&&!Number.isNaN(Number(e))}function Nae(e,t){let n=[],r=[],i=/* @__PURE__ */ new Map;Array.isArray(t)&&t.length>0&&(typeof t[0]==`string`?t.forEach(e=>i.set(e,void 0)):t.forEach(e=>i.set(e.NAME,e)));for(let t of e){let{field:e,operator:a,value:o}=t;if(!e||typeof e!=`string`){r.push({field:String(e),message:`Field name is required`});continue}let s=i.get(e),c=s&&`TYPE`in s?s.TYPE:`STRING`;if(!kae(c).includes(a)){r.push({field:e,operator:a,value:o,message:`Operator '${a}' is not allowed for field type ${c}`});continue}if((MS.includes(a)||NS.includes(a))&&a!==`dateIsToday`&&!jae(o)){r.push({field:e,operator:a,value:o,message:`Invalid date/datetime value; use yyyyMMdd, yyyy-MM-dd, or epoch`});continue}if(Aae(c)&&jS.includes(a)&&!Mae(o)){r.push({field:e,operator:a,value:o,message:`Invalid numeric value`});continue}if(i.size>0&&!i.has(e)){r.push({field:e,operator:a,value:o,message:`Unknown field '${e}'`});continue}n.push(t)}return{valid:n,invalid:r}}function Pae(e,t){let n=[],r=[];for(let i of e){if(!i?.clauses||!Array.isArray(i.clauses)){r.push({field:``,message:`Group must have a clauses array`});continue}let{valid:e,invalid:a}=Nae(i.clauses,t);r.push(...a),e.length>0&&n.push({logic:i.logic??`and`,negated:i.negated,clauses:e})}return{valid:n,invalid:r}}let IS=Kd(`foundation-notifications`),LS=null,RS=/* @__PURE__ */ new Map,zS=e=>`${e?.title??`Error`}: ${e?.body??`Something went wrong`}`,Fae=e=>e?.logLevel||e?.config?.logLevel||Td.debug,BS=e=>{IS.log({message:zS(e),level:Fae(e)})},VS=(e,t)=>{let n=document.querySelector(`#${e}`);if(!n){if(RS.has(e))n=RS.get(e);else{let t=sf(document).find(t=>t.id===e);t&&(n=t,RS.set(e,t))}}if(!n){n=document.createElement(`div`),n.setAttribute(`id`,e),n.style.zIndex=`9999`;let{element:t,prefix:r}=uf(document.body,`rapid`);if(t)t.appendChild(n),LS=t;else if(LS)LS.appendChild(n);else{let e=document.createElement(`${r}-design-system-provider`);e.appendChild(n),document.body.appendChild(e),LS=e}}return n},Iae=e=>{for(;e&&!(e instanceof ShadowRoot);){let t=(e?.getRootNode())?.getElementById(`banner-anchor`);if(t)return t.style.position=`relative`,t;e=e?.getRootNode()?.host}return Lae()},Lae=()=>{let e=document.createElement(`div`);return e.setAttribute(`id`,`banner-anchor`),e.style.position=`relative`,document.body.insertBefore(e,document.body.firstChild),e},Rae=e=>{BS(e),alert(zS(e))},zae=(e,t,n)=>{BS(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-banner`),a=Iae(n);a?.children?.length>0&&(i.style.position=`absolute`,i.style.top=`0`,i.style.left=`0`,i.style.width=`100%`),a.appendChild(i),i.notification=e},Bae=e=>{let t=e.querySelector(`#dialog-container`);return t||(t=document.createElement(`div`),t.setAttribute(`id`,`dialog-container`),t.style.position=`relative`,e.appendChild(t)),t},Vae=(e,t,n)=>{BS(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-dialog`);(n?Bae(n):VS(`dialog-container`,t)).appendChild(i),i.notification=e,i.show()};var HS;(function(e){e.NOTIFICATION_EVENT=`notification-event`})(HS||(HS={}));var US;(function(e){e.Top=`top`,e.Bottom=`bottom`})(US||(US={}));var WS;(function(e){e.Left=`left`,e.Right=`right`})(WS||(WS={}));let GS=`12px`,Hae=(e,t,n)=>{e.style.position=`fixed`,e.style.top=t===US.Top?GS:``,e.style.bottom=t===US.Bottom?GS:``,e.style.left=n===WS.Left?GS:``,e.style.right=n===WS.Right?GS:``},Uae=(e,t)=>{BS(e);let n=t.split(`-`)[0],r=document.createElement(`${n}-snackbar`),i=e.config?.snackbar?.verticalEdge??US.Bottom,a=e.config?.snackbar?.horizontalEdge??WS.Left,o=VS(`snack-container-${i}-${a}`,t);o&&Hae(o,i,a),o.appendChild(r),r.notification=e},Wae=e=>sf(document.body).find(t=>t.tagName.toLowerCase()===`notify-container`&&t.position===e);function Gae(e,t){switch(t.style.position=`fixed`,e?.config?.toast?.position){case`top-left`:t.style.top=`var(--nav-height, 0)`,t.style.left=`0`;break;case`bottom-left`:t.style.bottom=`0`,t.style.left=`0`;break;case`bottom-right`:t.style.bottom=`0`,t.style.right=`0`;break;default:t.style.top=`var(--nav-height, 0)`,t.style.right=`0`}}let KS=(e,t,n)=>{var r,i;BS(e);let a=t.split(`-`)[0],o=e?.config?.toast?.position||`top-right`,s=n??Wae(o)??VS(`notify-container`,t);s&&s.tagName.toLowerCase()!==`notify-container`&&Gae(e,s);let c=document.createElement(`${a}-toast`),l=document.createElement(`div`);l.setAttribute(`slot`,`top`),l.textContent=e.title;let u=document.createElement(`div`);u.setAttribute(`slot`,`content`),u.textContent=e?.body||``;let d=document.createElement(`div`);d.setAttribute(`slot`,`date`),d.textContent=(e?.createdAt)?.toLocaleTimeString()||``;let f;e?.config?.toast?.buttons&&e?.config?.toast?.buttons?.length&&(f=document.createElement(`div`),f.setAttribute(`slot`,`bottom`),e.config.toast.buttons.forEach(t=>{let n=document.createElement(`${a}-button`);n.textContent=t.placeholder||`example placeholder`,n.addEventListener(`click`,()=>{let{details:r}=e.config.toast;if(t.action)return t.action({details:r,buttonElement:n,toastElement:c})}),t.appearance&&n.setAttribute(`appearance`,t.appearance),f.appendChild(n)})),c.setAttribute(`notify`,e?.config?.toast?.type||``),e.iconName&&c.setAttribute(`notification-icon`,e.iconName),(r=e?.config?.toast)!=null&&r.autoClose&&c.setAttribute(`auto-close`,`${e?.config?.toast?.autoClose}`),(i=e?.config?.toast)!=null&&i.closeTimeout&&c.setAttribute(`close-timeout`,`${e?.config?.toast?.closeTimeout}`),c.appendChild(l),c.appendChild(u),c.appendChild(d),f&&c.appendChild(f),s.prepend(c)},qS=(e,t,n)=>{if(!e.title)throw Error(`Title is required`);if(!e.body)throw Error(`Missing required param 'body'`);let r={title:e.title,body:e.body,iconName:e.iconName},i={};e.createdAt&&(r=Object.assign({createdAt:e.createdAt},r)),e.logLevel!=null&&(r=Object.assign({logLevel:e.logLevel},r)),e.toast&&(i=Object.assign({toast:e.toast},i),r=Object.assign({config:i},r)),KS(r,t,n)},Kae=O` :host{position: fixed;z-index: 9999;display: flex;flex-direction: column;gap: 4px;box-sizing: border-box;pointer-events: none;/* Allow clicks to pass through empty space */ width: 415px}.toast-container{padding: 0 8px 12px 12px;position: relative}/* Expanded / List State: Allow scrolling if too many items */ :host(:not([stack-collapsed])){max-height: calc(100% - var(--nav-height));overflow: hidden;pointer-events: auto;/* Enable pointer events for scrolling */ slot{display: block;height: calc(100vh - var(--nav-height) - 54px);position: relative}.toast-container{flex: 1;height: 100%;overflow: hidden auto;scrollbar-color: var(--neutral-layer-3) transparent;&:hover{scrollbar-color: var(--neutral-layer-4) transparent}}}.header{display: flex;gap: 12px;pointer-events: none;margin: 5px 24px;justify-content: space-between;visibility: hidden;align-items: center;box-sizing: border-box;.header-title{text-shadow: 0 0 10px #000}.notification-header-buttons{display: flex;gap: 4px;rapid-icon{color: var(--neutral-foreground-hint);margin-left: 4px;display: inline-flex;font-size: 14px;&.chevron-up.collapse{transform: rotate(180deg);transition: transform 0.3s ease}}}--base-height-multiplier: 8;*[appearance='neutral']{font-size: 11px;cursor: pointer;background: var(--neutral-fill-rest)}}.header.visible{visibility: visible;pointer-events: auto;/* Enable clicks on header buttons */}:host([position$='left']) .header{justify-content: space-between}:host([position^='bottom']) .header{margin-bottom: 0;margin-top: 4px}/* Ensure children (toasts) are clickable */ ::slotted(*){pointer-events: auto}:host([position='top-right']){top: var(--nav-height, 0);right: 0}:host([position='top-left']){top: var(--nav-height, 0);left: 0}:host([position='bottom-right']){bottom: 0;right: 0;flex-direction: column-reverse}:host([position='bottom-left']){bottom: 0;left: 0;flex-direction: column-reverse}/* Stacked / Collapsed State */ :host([stack-collapsed]){height: min-content;/* Host allows pointer events so they can reach the slot */ pointer-events: auto;cursor: pointer}/* Apply the grid layout to the slot itself so it acts as the container and click target */ :host([stack-collapsed]) slot{display: grid;grid-template-columns: auto;grid-template-rows: auto;place-items: end center;/* Default to bottom-up stacking */ /* The slot catches the click */ pointer-events: auto}/* Rotate when the collapse class is present */ :host([stack-collapsed][position^='top']) slot{align-items: start}:host([stack-collapsed][position$='right']) slot{justify-items: end}:host([stack-collapsed][position$='left']) slot{justify-items: start}:host([stack-collapsed]) ::slotted(*){grid-area: 1 / 1;transition: transform 0.3s ease, top 0.3s ease, opacity 0.3s ease;opacity: 0%;pointer-events: none !important;/* Disable interaction with toasts in collapsed state */ transform: scale(0.9);top: 0 !important}/* Show and offset the top 3 items in the stack */ :host([stack-collapsed]) ::slotted([data-stack-index='0']){opacity: 100%;pointer-events: auto;transform: translateY(0) scale(1);z-index: 3;position: relative !important}:host([stack-collapsed]) ::slotted([data-stack-index='1']){opacity: 100%;transform: translateY(var(--stack-offset-y, 8px)) scale(0.95);z-index: 2;position: relative !important}:host([stack-collapsed]) ::slotted([data-stack-index='2']){opacity: 100%;transform: translateY(var(--stack-offset-y-2, 16px)) scale(0.9);z-index: 1;position: relative !important}/* Adjust offset direction based on position */ :host([stack-collapsed][position^='top']){--stack-offset-y: 8px;--stack-offset-y-2: 16px}:host([stack-collapsed][position^='bottom']){--stack-offset-y: -8px;--stack-offset-y-2: -16px}`,qae=e=>T`<div class="header ${e=>dn([`visible`,e.slottedNodes.length>1])}">${A(e=>e.showCount,T`<span class="header-title">${e=>e.slottedNodes.length}Notifications</span>`)}<div class="notification-header-buttons">${A(e=>e.allowManualCollapse,T`<${e}-button @click=${e=>e.handleToggleCollapse()}>${e=>e.stackCollapsed?`Expand`:`Collapse`}<${e}-icon class="chevron-up ${e=>dn([`collapse`,e.stackCollapsed])}" name="chevron-up"></${e}-icon></${e}-button>`)} ${A(e=>e.allowCloseAll,T`<${e}-button @click=${e=>e.handleCloseAll()}>
|
|
252
252
|
Close All <${e}-icon name="xmark"></${e}-icon></${e}-button>`)}</div></div>`,Jae=T` ${A(e=>e.allowCloseAll||e.allowManualCollapse,T` ${e=>qae(e.designSystemPrefix)} `)}<div class="toast-container"><slot ${xt(`slottedNodes`)}@click="${e=>e.handleContainerClick()}"></slot></div>`,JS=class extends Qe{constructor(){super(...arguments),this.position=`top-right`,this.stackThreshold=5,this.allowManualCollapse=!0,this.allowCloseAll=!0,this.designSystemPrefix=`rapid`,this.showCount=!0,this.stackCollapsed=!1,this.notificationInterval=0,this.manuallyExpanded=!1,this.pendingQueue=[],this.queueTimer=null,this.queuedNodes=/* @__PURE__ */ new Set,this.mutationObserver=null,this.knownNodes=/* @__PURE__ */ new Set,this.peekingNode=null,this.peekTimer=null,this.routeSubscriber={handleChange:()=>this.checkRoute(up.shared.pathName)},this.slottedNodes=[]}connectedCallback(){super.connectedCallback(),(this.position===`bottom-left`||this.position===`bottom-right`)&&IS.error(`NotifyContainer doesn't currently support bottom corner placements`),S.getNotifier(up.shared).subscribe(this.routeSubscriber,`pathName`),this.checkRoute(up.shared.pathName),this.mutationObserver=new MutationObserver(e=>this.handleMutation(e)),this.mutationObserver.observe(this,{childList:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),S.getNotifier(up.shared).unsubscribe(this.routeSubscriber,`pathName`),(e=this.mutationObserver)==null||e.disconnect(),this.mutationObserver=null}checkRoute(e){(e.includes(`/login`)||e.includes(`/logout`))&&(this.pendingQueue=[],this.queuedNodes.clear(),clearTimeout(this.queueTimer),this.queueTimer=null,this.handleCloseAll())}slottedNodesChanged(){if(!this.manuallyExpanded&&!this.stackCollapsed&&this.slottedNodes.length>this.stackThreshold&&(this.stackCollapsed=!0),this.stackCollapsed&&this.slottedNodes.length<=1&&(this.stackCollapsed=!1,this.manuallyExpanded=!1,this.cancelPeek()),this.stackCollapsed){let e=this.slottedNodes.filter(e=>e instanceof HTMLElement&&!this.knownNodes.has(e)).shift();e&&this.maybePeek(e)}this.knownNodes=new Set(this.slottedNodes),this.applySort()}handleContainerClick(){this.stackCollapsed&&(this.stackCollapsed=!1,this.manuallyExpanded=!0,this.cancelPeek())}handleToggleCollapse(){this.stackCollapsed=!this.stackCollapsed,this.manuallyExpanded=!this.stackCollapsed,this.stackCollapsed||this.cancelPeek()}handleCloseAll(){for(this.cancelPeek();this.firstChild;)this.removeChild(this.firstChild);this.stackCollapsed=!1,this.manuallyExpanded=!1}notificationIntervalChanged(e,t){!t&&this.pendingQueue&&this.flushQueue()}handleMutation(e){this.notificationInterval&&(e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(this.queuedNodes.has(e)?this.queuedNodes.delete(e):(this.removeChild(e),this.pendingQueue.push(e)))})}),this.queueTimer||this.processQueue())}processQueue(){if(!this.pendingQueue.length){this.queueTimer=null;return}let e=this.pendingQueue.shift();this.queuedNodes.add(e),this.prepend(e),this.queueTimer=setTimeout(()=>{this.queueTimer=null,this.processQueue()},this.notificationInterval)}flushQueue(){for(clearTimeout(this.queueTimer),this.queueTimer=null;this.pendingQueue.length;){let e=this.pendingQueue.shift();this.queuedNodes.add(e),this.prepend(e)}}sortFnChanged(){this.applySort()}applySort(){let e=this.slottedNodes.filter(e=>e instanceof HTMLElement);if(!e.length)return;let t=this.sortFn&&e.length>1?[...e].sort(this.sortFn):e;this.peekingNode&&t.includes(this.peekingNode)?this.handlePosition([this.peekingNode,...t.filter(e=>e!==this.peekingNode)]):this.handlePosition(t)}maybePeek(e){let t=this.slottedNodes.filter(e=>e instanceof HTMLElement);if((this.sortFn&&t.length>1?[...t].sort(this.sortFn):t).indexOf(e)===0)return;this.cancelPeek(),this.peekingNode=e;let n=this.notificationInterval?this.notificationInterval/2:1500;this.peekTimer=setTimeout(()=>{this.peekingNode=null,this.peekTimer=null,this.applySort()},n)}cancelPeek(){clearTimeout(this.peekTimer),this.peekTimer=null,this.peekingNode=null}handlePosition(e){if(!e.length)return;e.forEach((t,n)=>{t.style.position=`absolute`,t.style.transition=`all 0.3s ease-in`,t.style.right=`0px`,t.style.zIndex=(e.length-n).toString(),t.dataset.stackIndex=n.toString()});let t=e.map(e=>e.offsetHeight);e.reduce((e,n,r)=>(n.style.top=`${e}px`,e+t[r]),0)}};q([D],JS.prototype,`position`,void 0),q([D({attribute:`stack-threshold`})],JS.prototype,`stackThreshold`,void 0),q([D({attribute:`allow-manual-collapse`,mode:`boolean`})],JS.prototype,`allowManualCollapse`,void 0),q([D({attribute:`allow-close-all`,mode:`boolean`})],JS.prototype,`allowCloseAll`,void 0),q([D({attribute:`design-system-prefix`})],JS.prototype,`designSystemPrefix`,void 0),q([D({attribute:`show-count`,mode:`boolean`})],JS.prototype,`showCount`,void 0),q([D({attribute:`stack-collapsed`,mode:`boolean`})],JS.prototype,`stackCollapsed`,void 0),q([D({attribute:`notification-interval`})],JS.prototype,`notificationInterval`,void 0),q([C],JS.prototype,`sortFn`,void 0),q([C],JS.prototype,`slottedNodes`,void 0),JS=q([$e({name:`notify-container`,template:Jae,styles:Kae})],JS);let YS={alert:Rae,toast:KS,dialog:Vae,snackbar:Uae,banner:zae},XS=(e,t,n)=>{Object.keys(e?.config||{}).forEach(r=>{YS[r]&&YS[r](e,t,n)})};function Yae(e){return e.length===0?``:e.length===1?e[0].message:e.map(e=>e.message).join(`; `)}function ZS(e,t,n){t?.trim()&&XS({title:e,body:t,config:{toast:{autoClose:!0,closeTimeout:4e3,type:`error`}}},n)}var QS=class extends P{constructor(){super(...arguments),this.placeholder=`Describe your search criteria in natural language...`,this.inputValue=``,this.isInterpreting=!1,this.lastValidCriteria=null,this.activeGroups=[],this.showingChips=!1,this.fieldMetadata=[],this.isRecording=!1,this.stopRecording=null,this.speechApplyDebounceTimer=null}get speechAvailable(){return vb()}get criteriaChips(){return this.activeGroups.flatMap((e,t)=>e.clauses.map((e,n)=>({groupIndex:t,clauseIndex:n,fieldLabel:this.getFieldLabel(e.field),operatorLabel:Eae[e.operator]??e.operator,valueLabel:e.operator===`dateIsToday`?``:String(e.value??``)})))}getFieldLabel(e){if(!Array.isArray(this.fieldMetadata)||this.fieldMetadata.length===0||typeof this.fieldMetadata[0]==`string`)return e;let t=this.fieldMetadata.find(t=>t.NAME===e);return t?.UI_LABEL??t?.NAME??e}toggleCriteriaView(){this.showingChips?(this.inputValue=``,this.showingChips=!1):this.showingChips=!0}removeChip(e,t){var n;let r=this.activeGroups.map(e=>Object.assign(Object.assign({},e),{clauses:[...e.clauses]}));(n=r[e])==null||n.clauses.splice(t,1);let i=r.filter(e=>e.clauses.length>0);if(this.activeGroups=i,i.length===0)this.showingChips=!1,this.lastValidCriteria=null,this.$emit(`criteria-changed`,null);else{let e=AS(i);this.lastValidCriteria=e,this.$emit(`criteria-changed`,e)}}clearChips(){this.activeGroups=[],this.showingChips=!1,this.lastValidCriteria=null,this.$emit(`criteria-changed`,null)}handleSubmit(){return J(this,void 0,void 0,function*(){let e=this.inputValue?.trim();if(!e||this.isInterpreting)return;let t=this.providerRegistry?.default();if(!t?.interpretCriteria){ZS(`AI criteria search`,`AI provider not configured`,Ly(this));return}this.isInterpreting=!0;try{let n=Array.isArray(this.fieldMetadata)?this.fieldMetadata:[],r=yield t.interpretCriteria(e,{fields:n});if(!(r?.groups)?.some(e=>e.clauses?.length)){ZS(`AI criteria search`,`AI could not interpret the criteria`,Ly(this)),this.isInterpreting=!1;return}let{valid:i,invalid:a}=Pae(r.groups,this.fieldMetadata);if(a.length>0&&(ZS(`Criteria validation error`,Yae(a),Ly(this)),this.$emit(`validation-errors`,a)),i.length>0){let e=[...this.activeGroups,...i],t=AS(e);this.lastValidCriteria=t,this.activeGroups=e,this.inputValue=``,this.showingChips=!0,this.$emit(`criteria-changed`,t)}}catch(e){ZS(`AI criteria search`,e instanceof Error?e.message:`Interpretation failed`,Ly(this))}finally{this.isInterpreting=!1}})}handleBlur(){this.isRecording||(this.inputValue?.trim()?this.handleSubmit():this.activeGroups.length>0&&(this.showingChips=!0))}clear(){this.inputValue=``,this.lastValidCriteria=null,this.activeGroups=[],this.showingChips=!1,this.$emit(`criteria-changed`,null)}toggleSpeechInput(){if(this.isRecording&&this.stopRecording){this.clearSpeechApplyDebounce(),this.stopRecording(),this.stopRecording=null,this.isRecording=!1;return}this.inputValue=``,this.showingChips=!1,this.stopRecording=yb((e,t)=>{this.inputValue=e,t&&e?.trim()&&(this.clearSpeechApplyDebounce(),this.stopRecording&&(this.stopRecording(),this.stopRecording=null,this.isRecording=!1),this.speechApplyDebounceTimer=setTimeout(()=>{this.speechApplyDebounceTimer=null,this.handleSubmit()},700))},()=>{this.clearSpeechApplyDebounce(),this.isRecording=!1,this.stopRecording=null}),this.stopRecording&&(this.isRecording=!0)}clearSpeechApplyDebounce(){this.speechApplyDebounceTimer&&(clearTimeout(this.speechApplyDebounceTimer),this.speechApplyDebounceTimer=null)}};q([TS],QS.prototype,`providerRegistry`,void 0),q([D],QS.prototype,`placeholder`,void 0),q([D({mode:`boolean`})],QS.prototype,`disabled`,void 0),q([C],QS.prototype,`inputValue`,void 0),q([C],QS.prototype,`isInterpreting`,void 0),q([C],QS.prototype,`lastValidCriteria`,void 0),q([C],QS.prototype,`activeGroups`,void 0),q([C],QS.prototype,`showingChips`,void 0),q([C],QS.prototype,`fieldMetadata`,void 0),q([C],QS.prototype,`isRecording`,void 0),q([w],QS.prototype,`speechAvailable`,null),q([w],QS.prototype,`criteriaChips`,null);let $S={};QS.compose(Object.assign({baseName:`ai-criteria-search`,template:kS,styles:OS,shadowOptions:void 0},$S));let eC=(e,t)=>O` :host{display: flex;justify-content: center;align-items: center;width: 100%;margin: calc(var(--design-unit) * 2px) 0;position: relative;/* Same as connection indicator */ --green: 50 164 49;--trafic-light-green: rgb(var(--green));--red: 187 30 16;--trafic-light-red: rgb(var(--red));--amber: 230 160 20;--trafic-light-amber: rgb(var(--amber))}.ai-indicator-container{display: flex;flex-direction: column;align-items: center;position: relative}.ai-indicator-badge{display: inline-flex;align-items: center;gap: calc(var(--design-unit) * 1.4px);font-size: 12px;line-height: 1;font-weight: 600;text-transform: uppercase;height: calc(var(--design-unit) * 6px);padding: calc(var(--design-unit) * 0.5px) calc(var(--design-unit) * 2px);border-radius: calc(var(--design-unit) * 1px);cursor: pointer;color: #fff}.ai-indicator-badge:hover{opacity: 90%}.ai-indicator-badge.green{background: var(--trafic-light-green)}.ai-indicator-badge.amber{background: var(--trafic-light-amber)}.ai-indicator-badge.red{background: var(--trafic-light-red)}.ai-indicator-badge .ai-indicator-icon{flex-shrink: 0;color: inherit}.ai-indicator-badge.pulsing{animation: ai-indicator-pulse 1.5s ease-in-out infinite}@keyframes ai-indicator-pulse{0%, 100%{opacity: 100%}50%{opacity: 50%}}.ai-indicator-dropdown{position: absolute;top: 100%;right: 0;margin-top: calc(var(--design-unit) * 2px);min-width: 200px;padding: calc(var(--design-unit) * 4px);background: var(--neutral-layer-floating, #fff);border: 1px solid var(--neutral-stroke-rest, #e0e0e0);border-radius: calc(var(--design-unit) * 2px);box-shadow: 0 calc(var(--design-unit) * 1px) calc(var(--design-unit) * 4px) rgb(0 0 0 / 12%);z-index: 1000}.ai-indicator-info{display: flex;flex-direction: column;gap: 0;margin: 0;padding: 0}.ai-indicator-info .info-row{display: grid;grid-template-columns: 72px 1fr;gap: calc(var(--design-unit) * 4px);align-items: baseline;padding: calc(var(--design-unit) * 1.5px) 0;border-bottom: 1px solid var(--neutral-stroke-subtle, #eee)}.ai-indicator-info .info-row:last-child{border-bottom: none}.ai-indicator-info .info-label{margin: 0;font-size: var(--type-ramp-base-font-size);font-weight: 500;color: var(--neutral-foreground-hint, #666)}.ai-indicator-info .info-value{margin: 0;font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-rest, #333);text-transform: capitalize;word-break: break-word}.install-button{margin-top: calc(var(--design-unit) * 3px);width: 100%}`,Xae=e=>T` ${A(()=>gb(),T`<div class="ai-indicator-container" part="ai-indicator-container"><div class=${e=>dn(`ai-indicator-badge`,[`green`,e.state===`available`||e.state===`server`],[`amber`,e.state===`downloading`||e.state===`downloadable`],[`red`,e.state===`unavailable`||e.state===`none`],[`pulsing`,e.state===`downloading`||e.isInstalling])}data-test-id="ai-indicator-badge" part="ai-indicator-badge" role="button" tabindex="0" aria-label="AI status" aria-haspopup="true" aria-expanded="${e=>e.open}" @click=${e=>e.toggleDropdown()}@keydown=${(e,t)=>{let n=t.event;(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e.toggleDropdown())}}><${e}-icon class="ai-indicator-icon" name="wand-magic-sparkles" size="xs" variant="solid" part="ai-indicator-icon"></${e}-icon><span class="ai-indicator-text" data-test-id="ai-indicator-text" part="ai-indicator-text">AI</span></div>${A(e=>e.open,T`<div class="ai-indicator-dropdown" part="ai-indicator-dropdown"><dl class="ai-indicator-info"><div class="info-row"><dt class="info-label">Provider</dt><dd class="info-value">${e=>e.status?.provider??`none`}</dd></div><div class="info-row"><dt class="info-label">Model</dt><dd class="info-value">${e=>e.status?.model||`—`}</dd></div>${A(e=>e.chromeStatusLabel,T`<div class="info-row"><dt class="info-label">Status</dt><dd class="info-value">${e=>e.chromeStatusLabel}</dd></div>`)}</dl>${A(e=>e.canInstall,T`<${e}-button class="install-button" appearance="accent" @click=${(e,t)=>{t.event.preventDefault(),e.onInstall()}}>
|
|
253
|
-
Install model </${e}-button>`)}</div>`)}</div>`)} `,tC=T` ${e=>Xae(Ly(e))} `;var nC=class extends P{constructor(){super(...arguments),this.status=null,this.open=!1,this.state=`none`,this.isInstalling=!1,this.pollTimer=null,this.clickOutside=e=>this.handleClickOutside(e)}get aiProvider(){return this.providerRegistry?.default()}get chromeStatusLabel(){if(this.status?.provider!==`chrome`)return null;let e=this.status?.chromeAvailability;return e===`available`?`Installed`:e===`downloading`||this.isInstalling?`Downloading…`:e===`downloadable`?`Downloadable`:e===`unavailable`?`Unavailable`:null}get canInstall(){return!!this.aiProvider?.triggerDownload&&this.status?.provider===`chrome`&&this.status?.chromeAvailability===`downloadable`&&!this.isInstalling}get isDownloading(){return this.status?.chromeAvailability===`downloading`||this.isInstalling}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),yield this.refreshStatus(),this.maybeStartPolling()})}disconnectedCallback(){this.stopPolling(),document.removeEventListener(`mousedown`,this.clickOutside)}openChanged(){this.open?(document.addEventListener(`mousedown`,this.clickOutside),this.refreshStatus()):document.removeEventListener(`mousedown`,this.clickOutside)}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}toggleDropdown(){this.open=!this.open}refreshStatus(){return J(this,void 0,void 0,function*(){if(!this.aiProvider?.getStatus){this.status=null,this.state=`none`;return}try{let e=yield this.aiProvider.getStatus();this.status=e,this.state=this.deriveState(e),this.state===`available`&&(this.isInstalling=!1)}catch{this.status=null,this.state=`none`,this.isInstalling=!1}})}deriveState(e){if(!e||e.provider===`none`)return`none`;if(e.provider===`chrome`){let t=e.chromeAvailability;return t===`available`?`available`:t===`downloading`?`downloading`:t===`downloadable`?`downloadable`:`unavailable`}return`server`}maybeStartPolling(){this.status?.chromeAvailability===`downloading`||this.isInstalling?this.startPolling():this.stopPolling()}startPolling(){this.pollTimer||(this.pollTimer=setInterval(()=>{this.refreshStatus().then(()=>{this.maybeStartPolling()})},2500))}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}onInstall(){return J(this,void 0,void 0,function*(){if(this.canInstall&&this.aiProvider?.triggerDownload){this.isInstalling=!0;try{yield this.aiProvider.triggerDownload(),this.startPolling()}catch{this.isInstalling=!1}finally{yield this.refreshStatus()}}})}};q([TS],nC.prototype,`providerRegistry`,void 0),q([C],nC.prototype,`status`,void 0),q([C],nC.prototype,`open`,void 0),q([C],nC.prototype,`state`,void 0),q([C],nC.prototype,`isInstalling`,void 0),q([w],nC.prototype,`chromeStatusLabel`,null),q([w],nC.prototype,`canInstall`,null),q([w],nC.prototype,`isDownloading`,null),nC.compose({baseName:`ai-indicator`,template:tC,styles:eC});let rC=(e,t)=>Vn(e,t),iC=(e,t)=>O` ${Ul(e,t)}`;var aC=class extends Wl{};let oC={delegatesFocus:!0,mode:`open`},sC={};aC.compose(Object.assign({baseName:`anchor`,template:rC,styles:iC,shadowOptions:oC},sC));let cC=(e,t)=>Gn(e,t),lC=(e,t)=>O` ${Gl(e,t)}`;var uC=class extends qn{};let dC={delegatesFocus:!0,mode:`open`},fC={};uC.compose(Object.assign({baseName:`anchored-region`,template:cC,styles:lC,shadowOptions:dC},fC));let pC=(e,t)=>tr(e,t),Zae=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,mC=(e,t)=>O` ${Kl(e,t)}`;var hC=class extends ql{};let gC={delegatesFocus:!0,mode:`open`},_C={media:Zae};hC.compose(Object.assign({baseName:`avatar`,template:pC,styles:mC,shadowOptions:gC},_C));let vC=(e,t)=>rr(e,t),yC=(e,t)=>O` ${Jl(e,t)}`;var bC=class extends ir{};let xC={};bC.compose(Object.assign({baseName:`badge`,template:vC,styles:yC,shadowOptions:void 0},xC));let SC=O` @keyframes delete-animate{from{height: 100px;opacity: 100%}to{height: 0;opacity: 0%}}@keyframes append-animate{from{height: 0;opacity: 0%}to{height: var(--banner-height);opacity: 100%}}:host{--banner-width: 100%;--banner-height: 65px;--flow: row}@media screen and (max-width: 640px){:host{--flow: column;--banner-height: 100px}}.banner{animation: append-animate 0.3s linear;width: var(--banner-width);height: var(--banner-height);background-color: var(--fill-color);display: flex;flex-direction: var(--flow);padding: 5px 8px;box-sizing: border-box;overflow: hidden}.banner-delete{animation: delete-animate 0.3s linear;opacity: 0%}.content{display: flex;align-items: center;flex: 2;font-size: 12px;overflow: hidden;white-space: pre-line}.action{display: flex;flex-direction: row-reverse;align-items: center;gap: 10px;flex: 1;overflow: hidden}`,Qae=e=>T`<div role="alert" aria-live="polite" class="banner ${e=>e.dismissAnimation}" ${k(`banner`)}><div part="content" class="content"><slot name="content">${A(e=>e.notification,T`<div><div>${e=>e.notification?.body||`Place holder for notification message`}</div></div>`)}</slot></div><div part="action" class="action"><slot name="action" class="action">${A(e=>e.notification,T`<${e}-button slot="action" appearance="lightweight" @click=${e=>e.dismiss()}>${e=>e.notification?.config?.banner?.dismissingAction?.label||`Ignore`}</${e}-button>`)} ${j(e=>(e.notification?.config)?.banner.confirmingActions,T`<${e}-button slot="action" appearance="lightweight" @click=${(e,t)=>{var n;e?.action(),(n=t.parent)==null||n.dismissNotification()}}>${e=>e.label}</${e}-button>`)}</slot></div></div>`,CC=T` ${e=>Qae(Ly(e))} `,wC={mode:`open`,delegatesFocus:!0};var TC=class extends P{constructor(){super(...arguments),this.dismissAnimation=``}connectedCallback(){super.connectedCallback()}dismiss(){return this.dismissAnimation=`banner-delete`,new Promise(e=>{this.banner.onanimationend=()=>{this.remove(),e()}})}dismissNotification(){return J(this,void 0,void 0,function*(){try{yield this.dismiss(),this.remove()}catch(e){Ny.error(e)}})}};q([C],TC.prototype,`dismissAnimation`,void 0),q([C],TC.prototype,`notification`,void 0),TC.compose({baseName:`banner`,styles:SC,template:CC,shadowOptions:wC});let EC=(e,t)=>sr(e,t),DC=(e,t)=>O` ${Xl(e,t)}`;var OC=class extends cr{};OC.compose(Object.assign({baseName:`breadcrumb`,template:EC,styles:DC,shadowOptions:void 0},{}));let kC=(e,t)=>ar(e,t),AC=(e,t)=>O` ${Yl(e,t)}`;var jC=class extends or{};let MC={separator:`/`};jC.compose(Object.assign({baseName:`breadcrumb-item`,template:kC,styles:AC,shadowOptions:void 0},MC));let NC=(e,t)=>lr(e,t),PC=(e,t)=>O` ${Zl(e,t)}`;var FC=class extends Ql{};let IC={delegatesFocus:!0,mode:`open`},LC={};FC.compose(Object.assign({baseName:`button`,template:NC,styles:PC,shadowOptions:IC},LC));let RC=()=>O` ${$l}`,zC=(e,t)=>Ar(e,t);var BC=class extends br{};let VC={delegatesFocus:!0,mode:`open`},HC={};BC.compose(Object.assign({baseName:`calendar`,template:zC,styles:RC,shadowOptions:VC},HC));let UC=(e,t)=>jr(e,t),WC=(e,t)=>O` ${eu(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var GC=class extends tu{};let KC={};GC.compose(Object.assign({baseName:`card`,template:UC,styles:WC,shadowOptions:void 0},KC));var qC;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(qC||(qC={}));var JC=/* @__PURE__ */ u((/* @__PURE__ */ s(((e,t)=>{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(x,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function ee(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function x(){var e=m();if(ee(e))return te(e);s=setTimeout(x,b(e))}function te(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function ne(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function S(){return s===void 0?o:te(m())}function C(){var e=m(),n=ee(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(x,t),_(c)}return s===void 0&&(s=setTimeout(x,t)),o}return C.cancel=ne,C.flush=S,C}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h})))());let YC=O` :host{--scrollbar-width: 12px;--scrollbar-thumb-width: 8px}.root{position: relative;width: inherit;min-width: 250px}.control{cursor: pointer;position: relative;display: flex;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}#display-field{width: 100%;cursor: pointer;color: var(--neutral-foreground-rest);min-height: 40px;padding: 0 calc(var(--design-unit) * 2.25px);border-width: 0;background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px)}#display-field[disabled]{cursor: not-allowed;opacity: 30%}#display-field:focus{outline: 1px solid var(--accent-fill-rest);background: var(--neutral-fill-input-rest);border-style: none;box-shadow: none}#display-field:hover:not(:focus):not([disabled]){outline: 1px solid var(--neutral-stroke-hover)}button{pointer-events: none}.indicator{position: absolute;left: calc(100% - 26px);padding: 0;cursor: pointer}#arrow-icon{width: 16px;fill: white;transform: rotate(0deg);transition: transform 0.2s linear 0s}#arrow-icon.flipped{transform: rotate(180deg)}.disabled-svg{pointer-events: none;opacity: 30%}.position-above{bottom: 100%}::-webkit-scrollbar{width: var(--scrollbar-width)}::-webkit-scrollbar-track{background: var(--neutral-layer-4)}::-webkit-scrollbar-thumb{width: var(--scrollbar-thumb-width);border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-layer-2);border: 3px solid var(--neutral-layer-4)}::-webkit-scrollbar-corner{background: var(--neutral-layer-4)}.multiselect-dropdown{display: flex;flex-direction: column;position: absolute;height: max-content;overflow: hidden;margin-top: calc(var(--design-unit) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;z-index: 999}.multiselect-dropdown:not(.is-resizing){transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s}.checkbox-container{display: flex;flex-direction: column;list-style: none;overflow-y: auto;height: 100%}.is-resizing .checkbox-container{overflow-y: hidden}.checkbox-container foundation-checkbox[disabled]{cursor: not-allowed}.visible{visibility: visible;max-height: var(--custom-max-height, ${`230`}px);overflow: hidden}::slotted(foundation-checkbox), foundation-checkbox{border-bottom: 1px solid var(--neutral-layer-4);padding: 5px 0 5px 5px;margin: 0}::slotted(foundation-checkbox:hover), foundation-checkbox:hover{background-color: var(--neutral-layer-3);cursor: pointer}::slotted(foundation-checkbox)::part(label), foundation-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}ol, li{margin: 0;padding: 0}.checkbox{width: 100%}.select-all{width: 100%;margin-left: 0;margin-right: 0}.display-value{position: absolute;right: 40px;color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font)}.options-header-item-hidden{display: none}.resize-button{position: absolute;bottom: 0;right: 0;width: 12px;height: 12px;cursor: nw-resize;background: linear-gradient( -45deg, transparent 30%, var(--neutral-foreground-rest) 30%, var(--neutral-foreground-rest) 40%, transparent 40%, transparent 60%, var(--neutral-foreground-rest) 60%, var(--neutral-foreground-rest) 70%, transparent 70% );z-index: 1000;opacity: 60%;transition: opacity 0.2s ease}.resize-button:hover{opacity: 100%}.multiselect-dropdown.resizable{resize: none;overflow: hidden}`;var XC;let ZC=XC=class extends Py{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=XC.defaultPageSize,this.initalSelectedValueInitialized=!1,this.isSnapshot=!0,this.baseCriteria=``,this.listboxElement=null,this.loadingMoreRows=!1,this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.listboxElement||this.attachListboxScrollListener(),this.topUpVisibleListbox())},this.listboxScrollHandler=()=>{let e=this.listboxElement;e&&this.isNearListboxBottom(e)&&this.loadNextPage()},this.resizeObserverCallback=e=>{e.forEach(e=>{this.checkOverflow(e.target)})},this.selectChangeHandler=e=>{let t=e.target.value,n=this.options?.find(e=>String(e.label)===t);!n&&this.allowCustomOptions&&this.select instanceof ou?this.select.$emit(`value-change`,{label:t,value:t}):this.select.$emit(`value-change`,n)}}initialSelectedValueChanged(e,t){if(t!==e){if(!t){this.select&&(this.initalSelectedValueInitialized=!1,this.clearData(),this.resetCombobox(),this.fetchData());return}this.select&&this.getDisplayForValue(t)===String(this.select.value||``)||(this.initalSelectedValueInitialized=!1,this.clearData(),this.fetchData())}}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){if(e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=this.optionElement??`${Ly(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:XC.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||Ny.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")`)})}disconnectedCallback(){var e;super.disconnectedCallback(),this.resizeObserver.disconnect(),(e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=null,this.select.removeEventListener(`open-change`,this.selectOpenChangeHandler),this.select.removeEventListener(`change`,this.selectChangeHandler)}applyInfiniteScrollFetchMode(){return J(this,void 0,void 0,function*(){if(this.resourceName&&this.connect.isConnected)try{let e=yield this.resources.getResourceTypeFor(this.resourceName);this.isSnapshot=e!==_g.DATASERVER}catch(e){Ny.warn(`Unable to determine the resource type for ${this.resourceName}`,e)}})}attachListboxScrollListener(){var e;if(this.isConnected){if((e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=this.select?.scrollableListbox??this.select?.listbox??(this.select?.shadowRoot)?.querySelector(`.listbox`),!this.listboxElement){Ny.warn(`Unable to locate listbox element, infinite scroll will not be available.`);return}this.listboxElement.addEventListener(`scroll`,this.listboxScrollHandler)}}isNearListboxBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-XC.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===_g.REQUEST_SERVER;try{yield this.requestMoreRows()}catch{this.loadingMoreRows=!1;return}e&&(this.loadingMoreRows=!1)})}topUpVisibleListbox(){this.infiniteScroll&&requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this.listboxElement;e&&e.clientHeight!==0&&this.isNearListboxBottom(e)&&e.scrollHeight!==this.lastTopUpScrollHeight&&(this.lastTopUpScrollHeight=e.scrollHeight,this.loadNextPage())})}fetchData(){this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof ou&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){if(!(yield this.datasource.init(this.datasourceOptions(),!0))){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}rb(this,this.initialSelectedValue)})}clearData(){this.rowsSyncedWithStream.clear(),this.options=[],this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.loadingMoreRows=!1,this.select&&(Array.from(this.select.children).forEach(e=>{e instanceof XC||this.select.removeChild(e)}),this.select.value=``,this.select.initialValue=``)}checkOverflow(e){let t=e.shadowRoot.querySelector(`.content`);t&&(t.scrollWidth>t.clientWidth?e.setAttribute(`title`,e.textContent):e.removeAttribute(`title`))}rowToOption(e){return{value:e[this.valueField],label:this.labelRowFormatter?this.labelRowFormatter(e):this.labelFormatter?this.labelFormatter(e[this.labelField]):this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}}renderListboxOptions(e){e.forEach(({value:e,label:t})=>{let n=document.createElement(this.optionElement);n.textContent=t||e,n.value=e,this.select.appendChild(n),this.resizeObserver.observe(n)})}removeEmptyDataOption(){this.emptyDataOption&&(this.emptyDataOption.remove(),this.emptyDataOption=null)}syncComponentData(e){this.loadingMoreRows=!1;let t=e??Array.from(this.rowsSyncedWithStream.values());if(t.length>0){this.removeEmptyDataOption(),this.options=t.map(e=>this.rowToOption(e));let e=this.renderedOptionsCount===0;if(this.renderListboxOptions(this.options.slice(this.renderedOptionsCount)),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox(),!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof ou&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async)&&(this.resetCombobox(),x.queueUpdate(()=>{this.select.value=String(this.initialSelectedValue)}),this.initalSelectedValueInitialized=!0),this.select&&!this.emptyDataOption){let e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value=``,e.disabled=!0,this.select.appendChild(e),this.emptyDataOption=e}}getInitialLabel(){return this.getDisplayForValue(this.initialSelectedValue)}getDisplayForValue(e){if(e==null||e!==0&&!e)return``;let t=this.options?.find(t=>t.value===e);return this.allowCustomOptions&&this.select instanceof ou?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof ou&&this.select.resetCombobox()}handleStreamInserts(e){if(this.loadingMoreRows=!1,!e?.length)return;this.removeEmptyDataOption();let t=new Set((this.options??[]).map(e=>String(e.value))),n=e.filter(e=>!t.has(String(e[this.valueField])));if(!n.length){Ny.warn(`Infinite scroll for ${this.resourceName} received a page of options that were all already loaded, so paging has stopped. Request Server resources only honour OFFSET when declared with criteriaOnlyRequest; otherwise every page returns the same rows. Also set a stable order-by so pages cannot overlap.`),this.moreRowsAvailable=!1;return}let r=n.map(e=>this.rowToOption(e));this.options=[...this.options??[],...r],this.renderListboxOptions(r),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox()}handleStreamDeletes(e){Ny.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Ny.debug(`handleStreamUpdates - Method not implemented.`)}};ZC.defaultPageSize=20,ZC.scrollLoadThresholdPx=32,q([cy],ZC.prototype,`resources`,void 0),q([D({attribute:`label-field`})],ZC.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],ZC.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],ZC.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],ZC.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],ZC.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],ZC.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],ZC.prototype,`pageSize`,void 0),q([C],ZC.prototype,`labelFormatter`,void 0),q([C],ZC.prototype,`labelRowFormatter`,void 0),q([C],ZC.prototype,`initialSelectedValue`,void 0),ZC=XC=q([$e({name:`options-datasource`})],ZC);let QC=class extends Py{constructor(){super(...arguments),this.isSnapshot=!0,this.baseCriteria=``}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||Ny.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")`)})}clearData(){this.select.options=[]}syncComponentData(e){let t=(e??Array.from(this.rowsSyncedWithStream.values())).map(e=>({value:e[this.valueField],label:this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}));this.select?.async&&(this.select.loading=!1),this.select.options=t}handleStreamInserts(e){Ny.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){Ny.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Ny.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],QC.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],QC.prototype,`labelField`,void 0),QC=q([$e({name:`multiselect-datasource`})],QC);let $C=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><div class="root" part="root" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control"><input id="display-field" part="filter-search" role="combobox" aria-haspopup="listbox" aria-controls="checkbox-container" aria-expanded=${e=>e.open?`true`:`false`}tabindex="${e=>e.tabindex}" ?readonly=${e=>!e.search}@click=${e=>e.toggle()}?disabled="${e=>e.disabled}" ${k(`filterSearchInput`)}value=${Mf(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getDisplayValue}" autocomplete="off" @input=${(e,t)=>e.inputHandler()}@change=${(e,t)=>e.changeHandler(t.event)}/><div part="indicator" class="indicator" @click=${e=>!e.disabled&&e.toggle()}><svg viewBox="0 0 12 7" ${k(`arrowIcon`)}id="arrow-icon" class="${e=>dn([`disabled-svg`,e.disabled])}" xmlns="http://www.w3.org/2000/svg"><path d="${`M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z`}" /></svg></div>${A(e=>e.filterSearchValue&&e.selectedOptions.length,T`<div class="display-value">${e=>e.getDisplayValue}</div>`)}</div>${A(e=>e.loading,T`<${e}-progress slot="indicator"></${e}-progress>`)}<section class=${e=>dn(`multiselect-dropdown`,[`resizable`,e.resizable])} ${k(`multiselectDropdown`)}part="multiselect-dropdown">${A(e=>e.resizable,T`<div class="resize-button" @mousedown=${(e,t)=>e.handleResizeStart(t.event)}></div>`)} ${A(e=>e.all,T`<${e}-button class="select-all" @click=${e=>e.selectCheckboxAll()}?disabled="${(e,t)=>e.isAllOptionsDisabled}">${e=>e.areAllOptionsSelected?`Deselect All`:`Select All`} ${e=>e.name}</${e}-button>`)}<ol id="checkbox-container" class="checkbox-container options" aria-multiselectable="true" part="options-ol"><li part="options-header-item" class=${e=>dn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:va})}></slot></li>${j(e=>e.filteredAvailableOptions,T`<li role="option" value=${(e,t)=>t.parent.getItemLabel(e)}part="option"><${e}-checkbox part="checkbox" class="checkbox" exportparts="label:checkbox-label" @keydown=${(e,t)=>t.parent.checkboxKeyDown(e,t.event)}@click=${(e,t)=>t.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parent.isOptionDisabled(e)}">${(e,t)=>{var n;return((n=t.parent)?.itemRenderer)?.call(n,e,t.parent)}}</${e}-checkbox></li>`)}</ol>${A(e=>e.showCreatable,T`<${e}-button @click=${e=>e.addOption()}>Create "${e=>e.filterSearchValue}"</${e}-button>`)}</section></div><slot ${xt({property:`slottedDatasource`,filter:e=>e instanceof QC})}></slot>`,$ae=T` ${$C()} `,ew={};var tw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.resizable=!1,this.filterByContains=!1,this.filterSearchValue=``,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=qC.BELOW,this.itemRenderer=this.defaultItemRenderer,this.initialisedOptions=!1,this.isResizing=!1,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.handleResizeStart=e=>{this.resizable&&this.multiselectDropdown&&(e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.startX=e.clientX,this.startY=e.clientY,this.startWidth=this.multiselectDropdown.offsetWidth,this.startHeight=this.multiselectDropdown.offsetHeight,this.multiselectDropdown.classList.add(`is-resizing`),document.addEventListener(`mousemove`,this.handleResizeMove),document.addEventListener(`mouseup`,this.handleResizeEnd))},this.handleResizeMove=e=>{if(!this.isResizing||!this.multiselectDropdown)return;e.preventDefault();let t=e.clientX-this.startX,n=e.clientY-this.startY,r=Math.max(250,this.startWidth+t),i=Math.max(100,this.startHeight+n);this.multiselectDropdown&&(this.multiselectDropdown.style.width=`${r}px`,this.multiselectDropdown.style.maxHeight=`${i}px`)},this.handleResizeEnd=()=>{this.isResizing=!1,document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd),this.multiselectDropdown&&(this.multiselectDropdown.classList.remove(`is-resizing`),this.multiselectDropdown.style.setProperty(`--custom-max-height`,this.multiselectDropdown.style.maxHeight),this.multiselectDropdown.style.removeProperty(`max-height`))}}debounceChanged(e,t){this.debouncedInputHandler=(0,JC.default)(this.asyncSetFilter,t)}openChanged(e,t){var n,r,i,a;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.arrowIcon)==null||n.classList.add(`flipped`),(r=this.multiselectDropdown)==null||r.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(i=this.arrowIcon)==null||i.classList.remove(`flipped`),(a=this.multiselectDropdown)==null||a.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===qC.ABOVE&&((e=this.multiselectDropdown)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside),document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd)}defaultItemRenderer(e,t){return T` ${typeof e==`string`?T`<span part="option-label">${()=>t.getItemLabel(e)}</span>`:T`<span data-option-label-text=${()=>e.optionLabelText}style=${()=>e.labelStyle}part="option-label">${()=>t.getItemLabel(e)}</span>`} `}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map(e=>this.optionValueGetter(e))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){if(this.$fastController.isConnected){this.initialisedOptions=!0;return}}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<230&&r>i?qC.ABOVE:qC.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===qC.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===qC.BELOW)}optionValueGetter(e){return typeof e==`string`?e:e.value}optionLabelGetter(e){return typeof e==`string`?e:e.label}getItemLabel(e){let t;return e?(t=typeof e==`string`?e:this.optionLabelGetter(e)||this.optionValueGetter(e)||``,this.valueFormatter?this.valueFormatter(t):t):``}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getDisplayValue(){let e=``;switch(this.selectedOptions.length){case 0:e=this.getPlaceholder;break;case 1:{let t=this.options.find(e=>this.optionValueGetter(e)===this.selectedOptions[0]);e=this.getItemLabel(t);break}case this.options.length:e=`All ${this.name}`.trim();break;default:e=`${this.selectedOptions.length} Selected`}return e}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get areAllOptionsSelected(){let e=this.getEnabledOptionsCount();return e>0&&this.selectedOptions.length===e}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&this.findExactMatchOptions().length===0}isOptionSelected(e){let t=this.optionValueGetter(e);return this.selectedOptions.some(n=>{if(typeof e==`object`&&typeof e.value==`object`)try{return JSON.stringify(n)===JSON.stringify(t)}catch{return n===t}return n===t})}selectCheckboxOne(e){let t=this.optionValueGetter(e);this.selectedOptions=this.selectedOptions.includes(t)?this.selectedOptions.filter(e=>e!==t):[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}checkboxKeyDown(e,t){return t.key===` `&&(t.preventDefault(),this.selectCheckboxOne(e)),!0}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){let e=this.selectedOptions.length===this.getEnabledOptionsCount();this.selectedOptions=e?[]:this.options.filter(e=>!this.isOptionDisabled(e)).map(e=>this.optionValueGetter(e)),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit(`selectionChange`,this.selectedOptions)}inputHandler(){this.open||(this.open=!0),this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){let e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter(t=>((typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t))?.toLowerCase()??``)===e)}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label.toLowerCase(),r=typeof t.value==`object`?(t=>Object.values(t).some(t=>t.toLowerCase().includes(e)))(t.value):String(t.value).toLowerCase().includes(e);return n.includes(e)||r})}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){this.slottedDatasource.length>0?nb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,Ny.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Escape`:if(this.open){this.open=!1;break}break;case`ArrowUp`:case`ArrowDown`:if(!this.open){this.open=!0;break}break;default:return!0}}clear(e={}){let{clearSelectedValues:t=!0,clearFilterText:n=!0}=e;t&&(this.selectedOptions=[],this.$emit(`selectionChange`,this.selectedOptions)),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],tw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],tw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],tw.prototype,`all`,void 0),q([D({mode:`boolean`})],tw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],tw.prototype,`search`,void 0),q([D({mode:`boolean`})],tw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],tw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],tw.prototype,`async`,void 0),q([D],tw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],tw.prototype,`resizable`,void 0),q([D],tw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],tw.prototype,`filterByContains`,void 0),q([C],tw.prototype,`defaultSlottedNodes`,void 0),q([C],tw.prototype,`slottedDatasource`,void 0),q([C],tw.prototype,`valueFormatter`,void 0),q([C],tw.prototype,`loading`,void 0),q([C],tw.prototype,`filterSearchValue`,void 0),q([C],tw.prototype,`open`,void 0),q([C],tw.prototype,`options`,void 0),q([C],tw.prototype,`selectedOptions`,void 0),q([C],tw.prototype,`filteredAvailableOptions`,void 0),q([C],tw.prototype,`scrollContainer`,void 0),q([D],tw.prototype,`position`,void 0),q([C],tw.prototype,`onAllSelectedCallback`,void 0),q([C],tw.prototype,`itemRenderer`,void 0),q([w],tw.prototype,`getDisplayValue`,null),q([w],tw.prototype,`getPlaceholder`,null),q([w],tw.prototype,`isAllOptionsDisabled`,null),q([w],tw.prototype,`areAllOptionsSelected`,null),q([w],tw.prototype,`showCreatable`,null),q([C],tw.prototype,`optionsHeaderSlottedNodes`,void 0),tw.compose(Object.assign({baseName:`multiselect`,template:$ae,styles:YC,shadowOptions:void 0},ew));let nw=O` .root{position: relative;width: 100%;min-width: 250px}.control-button{display: flex;justify-content: center;min-width: 31px;width: 31px;height: 31px;margin-left: calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}.control{cursor: pointer;position: relative;display: flex;justify-content: end;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}.control:hover .control-button, .control:hover .label{color: var(--neutral-foreground-rest)}button{pointer-events: none}.options{display: flex;flex-direction: column;position: absolute;height: max-content;overflow-y: hidden;margin-top: 5px;padding: calc((var(--design-unit) + 3) * 2px) calc((var(--design-unit) + 3) * 1px);border: 1px solid rgba(46 51 57 / 100%);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s;z-index: 999}.option-content{display: flex;align-items: center;gap: calc(var(--design-unit) * 4px);width: 100%}.icon-container{display: flex;align-items: center;justify-content: center;width: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px + 4px );height: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px );border-radius: calc((var(--control-corner-radius) - 1) * 2px);background: var(--neutral-layer-2);box-sizing: border-box;box-shadow: 0 0 5px 0 rgba(0 0 0 / 35%);flex-shrink: 0}.text-content{display: flex;flex-direction: column;flex: 1}.svg-icon{height: 2em}.position-above{bottom: 100%}.checkbox-container{display: flex;flex-direction: column;overflow-y: scroll;scrollbar-width: thin;scrollbar-color: rgb(46 48 53) rgb(31 33 38)}span{border-bottom: calc(var(--stroke-width) * 1px) solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 2) * 2px) calc((var(--design-unit) + 3) * 1px);font-size: calc((var(--type-ramp-base-font-size) - 1px));color: var(--neutral-foreground-hint)}.multiselect-checkbox{min-width: fit-content;flex-direction: row-reverse;justify-content: space-between;align-items: flex-start;border-bottom: 1px solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) 0;margin: 0}.multiselect-checkbox:hover{background-color: rgb(45 47 51);cursor: pointer}.multiselect-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis}.multiselect-checkbox::part(control){min-width: calc( ((var(--base-height-multiplier) + var(--density)) * var(--design-unit) / 2 + var(--design-unit)) * 1px )}.checkbox-container .multiselect-checkbox[disabled]{cursor: not-allowed}.description{text-wrap: wrap;font-size: calc((var(--type-ramp-base-font-size) - 1px));margin: calc((var(--design-unit) + 3) * 1px) 0}#filter-search{padding: 5px}::-webkit-scrollbar{width: 12px}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: rgb(46 48 53);border: 3px solid rgb(31 33 38)}.visible{visibility: visible;max-height: ${`450`}px}`,rw=(e=`foundation`)=>T`<div class="root" part="root"><div class="control" part="control" @click=${e=>!e.disabled&&e.toggle()}><label part="label" for="control" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><${e}-button class="control-button" part="control-button"><slot name="button-content"><${e}-icon name="plus" variant="solid" size="lg"></${e}-icon></slot></${e}-button></div><div ${k(`optionsElement`)}class="options" part="options">${A(e=>e.search,T`<${e}-text-field id="filter-search" part="filter-search" value=${Mf(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getPlaceholder}" @input=${(e,t)=>e.setFilter()}@change=${(e,t)=>e.changeHandler(t.event)}></${e}-text-field>`)}<div class="checkbox-container" part="checkbox-container">${j(e=>e.filteredAvailableOptions,T`<span>${e=>e.type}</span>${j(e=>e.options,T`<${e}-checkbox class="multiselect-checkbox" part="multiselect-checkbox" @click=${(e,t)=>t.parentContext.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parentContext.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parentContext.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parentContext.parent.isOptionDisabled(e)}"><div class="option-content">${A(e=>e.icon||e.svg,T`<div class="icon-container">${A(e=>e.icon,T`<${e}-icon style="color:${e=>e.iconColor||`#fff`}" name="${e=>e.icon}" size="xl"></${e}-icon>`)} ${A(e=>e.svg,T`<img class="svg-icon" src="${e=>e.svg}" alt="${e=>e.label}" />`)}</div>`)}<div class="text-content"><div class="option-label">${(e,t)=>t.parentContext.parent.getItemLabel(e)}</div>${A(e=>e.description,T`<p class="description">${e=>e.description}</p>`)}</div></div></${e}-checkbox>`)} `)}</div></div></div>`,eoe=T` ${rw()} `,iw={};var aw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.search=!0,this.disabled=!1,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.position=qC.BELOW}openChanged(e,t){var n,r;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.optionsElement)==null||n.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(r=this.optionsElement)==null||r.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===qC.ABOVE&&((e=this.optionsElement)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}sortFilteredOptions(e){let t=(e??this.options).reduce((e,t)=>{let n=t.type||`Other`;return e[n]?e[n].options.push(t):e[n]={type:n,options:[t]},e},{});return Object.values(t)}optionsChanged(){this.filteredAvailableOptions=this.sortFilteredOptions()}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains(`content-wrapper`);)t=t.parentElement;if(t){let n=t.getBoundingClientRect(),r=this.getBoundingClientRect(),i=n.top+n.height/2;e=r.top<i?qC.BELOW:qC.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?qC.ABOVE:qC.BELOW}}e===qC.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===qC.BELOW&&(this.optionsElement.classList.add(`position-below`),this.optionsElement.classList.remove(`position-above`))}optionGetter(e){return e.value}getItemLabel(e){let t;if(e)t=e.label||e.value||``;else return``;return this.valueFormatter?this.valueFormatter(t):t}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){let t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}setFilter(){let e=this.options.filter(e=>{let t=e.description,n=e.label??e.value;if(t?.toLowerCase().includes(this.filterSearchValue.toLowerCase())||n.toLowerCase().includes(this.filterSearchValue.toLowerCase()))return e});this.filteredAvailableOptions=this.sortFilteredOptions(e)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}};q([D],aw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],aw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],aw.prototype,`search`,void 0),q([D({mode:`boolean`})],aw.prototype,`disabled`,void 0),q([C],aw.prototype,`defaultSlottedNodes`,void 0),q([C],aw.prototype,`valueFormatter`,void 0),q([C],aw.prototype,`filterSearchValue`,void 0),q([C],aw.prototype,`open`,void 0),q([C],aw.prototype,`options`,void 0),q([C],aw.prototype,`selectedOptions`,void 0),q([C],aw.prototype,`filteredAvailableOptions`,void 0),q([C],aw.prototype,`position`,void 0),q([w],aw.prototype,`getPlaceholder`,null),aw.compose(Object.assign({baseName:`categorized-multiselect`,template:eoe,styles:nw,shadowOptions:void 0},iw));let ow=(e,t)=>Nr(e,t),sw=(e,t)=>O` ${nu(e,t)}`;var cw=class extends Pr{};let lw={checkedIndicator:`
|
|
253
|
+
Install model </${e}-button>`)}</div>`)}</div>`)} `,tC=T` ${e=>Xae(Ly(e))} `;var nC=class extends P{constructor(){super(...arguments),this.status=null,this.open=!1,this.state=`none`,this.isInstalling=!1,this.pollTimer=null,this.clickOutside=e=>this.handleClickOutside(e)}get aiProvider(){return this.providerRegistry?.default()}get chromeStatusLabel(){if(this.status?.provider!==`chrome`)return null;let e=this.status?.chromeAvailability;return e===`available`?`Installed`:e===`downloading`||this.isInstalling?`Downloading…`:e===`downloadable`?`Downloadable`:e===`unavailable`?`Unavailable`:null}get canInstall(){return!!this.aiProvider?.triggerDownload&&this.status?.provider===`chrome`&&this.status?.chromeAvailability===`downloadable`&&!this.isInstalling}get isDownloading(){return this.status?.chromeAvailability===`downloading`||this.isInstalling}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),yield this.refreshStatus(),this.maybeStartPolling()})}disconnectedCallback(){this.stopPolling(),document.removeEventListener(`mousedown`,this.clickOutside)}openChanged(){this.open?(document.addEventListener(`mousedown`,this.clickOutside),this.refreshStatus()):document.removeEventListener(`mousedown`,this.clickOutside)}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}toggleDropdown(){this.open=!this.open}refreshStatus(){return J(this,void 0,void 0,function*(){if(!this.aiProvider?.getStatus){this.status=null,this.state=`none`;return}try{let e=yield this.aiProvider.getStatus();this.status=e,this.state=this.deriveState(e),this.state===`available`&&(this.isInstalling=!1)}catch{this.status=null,this.state=`none`,this.isInstalling=!1}})}deriveState(e){if(!e||e.provider===`none`)return`none`;if(e.provider===`chrome`){let t=e.chromeAvailability;return t===`available`?`available`:t===`downloading`?`downloading`:t===`downloadable`?`downloadable`:`unavailable`}return`server`}maybeStartPolling(){this.status?.chromeAvailability===`downloading`||this.isInstalling?this.startPolling():this.stopPolling()}startPolling(){this.pollTimer||(this.pollTimer=setInterval(()=>{this.refreshStatus().then(()=>{this.maybeStartPolling()})},2500))}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}onInstall(){return J(this,void 0,void 0,function*(){if(this.canInstall&&this.aiProvider?.triggerDownload){this.isInstalling=!0;try{yield this.aiProvider.triggerDownload(),this.startPolling()}catch{this.isInstalling=!1}finally{yield this.refreshStatus()}}})}};q([TS],nC.prototype,`providerRegistry`,void 0),q([C],nC.prototype,`status`,void 0),q([C],nC.prototype,`open`,void 0),q([C],nC.prototype,`state`,void 0),q([C],nC.prototype,`isInstalling`,void 0),q([w],nC.prototype,`chromeStatusLabel`,null),q([w],nC.prototype,`canInstall`,null),q([w],nC.prototype,`isDownloading`,null),nC.compose({baseName:`ai-indicator`,template:tC,styles:eC});let rC=(e,t)=>Vn(e,t),iC=(e,t)=>O` ${Ul(e,t)}`;var aC=class extends Wl{};let oC={delegatesFocus:!0,mode:`open`},sC={};aC.compose(Object.assign({baseName:`anchor`,template:rC,styles:iC,shadowOptions:oC},sC));let cC=(e,t)=>Gn(e,t),lC=(e,t)=>O` ${Gl(e,t)}`;var uC=class extends qn{};let dC={delegatesFocus:!0,mode:`open`},fC={};uC.compose(Object.assign({baseName:`anchored-region`,template:cC,styles:lC,shadowOptions:dC},fC));let pC=(e,t)=>tr(e,t),Zae=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,mC=(e,t)=>O` ${Kl(e,t)}`;var hC=class extends ql{};let gC={delegatesFocus:!0,mode:`open`},_C={media:Zae};hC.compose(Object.assign({baseName:`avatar`,template:pC,styles:mC,shadowOptions:gC},_C));let vC=(e,t)=>rr(e,t),yC=(e,t)=>O` ${Jl(e,t)}`;var bC=class extends ir{};let xC={};bC.compose(Object.assign({baseName:`badge`,template:vC,styles:yC,shadowOptions:void 0},xC));let SC=O` @keyframes delete-animate{from{height: 100px;opacity: 100%}to{height: 0;opacity: 0%}}@keyframes append-animate{from{height: 0;opacity: 0%}to{height: var(--banner-height);opacity: 100%}}:host{--banner-width: 100%;--banner-height: 65px;--flow: row}@media screen and (max-width: 640px){:host{--flow: column;--banner-height: 100px}}.banner{animation: append-animate 0.3s linear;width: var(--banner-width);height: var(--banner-height);background-color: var(--fill-color);display: flex;flex-direction: var(--flow);padding: 5px 8px;box-sizing: border-box;overflow: hidden}.banner-delete{animation: delete-animate 0.3s linear;opacity: 0%}.content{display: flex;align-items: center;flex: 2;font-size: 12px;overflow: hidden;white-space: pre-line}.action{display: flex;flex-direction: row-reverse;align-items: center;gap: 10px;flex: 1;overflow: hidden}`,Qae=e=>T`<div role="alert" aria-live="polite" class="banner ${e=>e.dismissAnimation}" ${k(`banner`)}><div part="content" class="content"><slot name="content">${A(e=>e.notification,T`<div><div>${e=>e.notification?.body||`Place holder for notification message`}</div></div>`)}</slot></div><div part="action" class="action"><slot name="action" class="action">${A(e=>e.notification,T`<${e}-button slot="action" appearance="lightweight" @click=${e=>e.dismiss()}>${e=>e.notification?.config?.banner?.dismissingAction?.label||`Ignore`}</${e}-button>`)} ${j(e=>(e.notification?.config)?.banner.confirmingActions,T`<${e}-button slot="action" appearance="lightweight" @click=${(e,t)=>{var n;e?.action(),(n=t.parent)==null||n.dismissNotification()}}>${e=>e.label}</${e}-button>`)}</slot></div></div>`,CC=T` ${e=>Qae(Ly(e))} `,wC={mode:`open`,delegatesFocus:!0};var TC=class extends P{constructor(){super(...arguments),this.dismissAnimation=``}connectedCallback(){super.connectedCallback()}dismiss(){return this.dismissAnimation=`banner-delete`,new Promise(e=>{this.banner.onanimationend=()=>{this.remove(),e()}})}dismissNotification(){return J(this,void 0,void 0,function*(){try{yield this.dismiss(),this.remove()}catch(e){Ny.error(e)}})}};q([C],TC.prototype,`dismissAnimation`,void 0),q([C],TC.prototype,`notification`,void 0),TC.compose({baseName:`banner`,styles:SC,template:CC,shadowOptions:wC});let EC=(e,t)=>sr(e,t),DC=(e,t)=>O` ${Xl(e,t)}`;var OC=class extends cr{};OC.compose(Object.assign({baseName:`breadcrumb`,template:EC,styles:DC,shadowOptions:void 0},{}));let kC=(e,t)=>ar(e,t),AC=(e,t)=>O` ${Yl(e,t)}`;var jC=class extends or{};let MC={separator:`/`};jC.compose(Object.assign({baseName:`breadcrumb-item`,template:kC,styles:AC,shadowOptions:void 0},MC));let NC=(e,t)=>lr(e,t),PC=(e,t)=>O` ${Zl(e,t)}`;var FC=class extends Ql{};let IC={delegatesFocus:!0,mode:`open`},LC={};FC.compose(Object.assign({baseName:`button`,template:NC,styles:PC,shadowOptions:IC},LC));let RC=()=>O` ${$l}`,zC=(e,t)=>Ar(e,t);var BC=class extends br{};let VC={delegatesFocus:!0,mode:`open`},HC={};BC.compose(Object.assign({baseName:`calendar`,template:zC,styles:RC,shadowOptions:VC},HC));let UC=(e,t)=>jr(e,t),WC=(e,t)=>O` ${eu(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var GC=class extends tu{};let KC={};GC.compose(Object.assign({baseName:`card`,template:UC,styles:WC,shadowOptions:void 0},KC));var qC;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(qC||(qC={}));var JC=/* @__PURE__ */ u((/* @__PURE__ */ s(((e,t)=>{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(x,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function ee(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function x(){var e=m();if(ee(e))return te(e);s=setTimeout(x,b(e))}function te(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function ne(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function S(){return s===void 0?o:te(m())}function C(){var e=m(),n=ee(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(x,t),_(c)}return s===void 0&&(s=setTimeout(x,t)),o}return C.cancel=ne,C.flush=S,C}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h})))());let YC=O` :host{--scrollbar-width: 12px;--scrollbar-thumb-width: 8px}.root{position: relative;width: inherit;min-width: 250px}.control{cursor: pointer;position: relative;display: flex;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}#display-field{width: 100%;cursor: pointer;color: var(--neutral-foreground-rest);min-height: 40px;padding: 0 calc(var(--design-unit) * 2.25px);border-width: 0;background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px)}#display-field[disabled]{cursor: not-allowed;opacity: 30%}#display-field:focus{outline: 1px solid var(--accent-fill-rest);background: var(--neutral-fill-input-rest);border-style: none;box-shadow: none}#display-field:hover:not(:focus):not([disabled]){outline: 1px solid var(--neutral-stroke-hover)}button{pointer-events: none}.indicator{position: absolute;left: calc(100% - 26px);padding: 0;cursor: pointer}#arrow-icon{width: 16px;fill: white;transform: rotate(0deg);transition: transform 0.2s linear 0s}#arrow-icon.flipped{transform: rotate(180deg)}.disabled-svg{pointer-events: none;opacity: 30%}.position-above{bottom: 100%}::-webkit-scrollbar{width: var(--scrollbar-width)}::-webkit-scrollbar-track{background: var(--neutral-layer-4)}::-webkit-scrollbar-thumb{width: var(--scrollbar-thumb-width);border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-layer-2);border: 3px solid var(--neutral-layer-4)}::-webkit-scrollbar-corner{background: var(--neutral-layer-4)}.multiselect-dropdown{display: flex;flex-direction: column;position: absolute;height: max-content;overflow: hidden;margin-top: calc(var(--design-unit) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;z-index: 999}.multiselect-dropdown:not(.is-resizing){transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s}.checkbox-container{display: flex;flex-direction: column;list-style: none;overflow-y: auto;height: 100%}.is-resizing .checkbox-container{overflow-y: hidden}.checkbox-container foundation-checkbox[disabled]{cursor: not-allowed}.visible{visibility: visible;max-height: var(--custom-max-height, ${`230`}px);overflow: hidden}::slotted(foundation-checkbox), foundation-checkbox{border-bottom: 1px solid var(--neutral-layer-4);padding: 5px 0 5px 5px;margin: 0}::slotted(foundation-checkbox:hover), foundation-checkbox:hover{background-color: var(--neutral-layer-3);cursor: pointer}::slotted(foundation-checkbox)::part(label), foundation-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}ol, li{margin: 0;padding: 0}.checkbox{width: 100%}.select-all{width: 100%;margin-left: 0;margin-right: 0}.display-value{position: absolute;right: 40px;color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font)}.options-header-item-hidden{display: none}.resize-button{position: absolute;bottom: 0;right: 0;width: 12px;height: 12px;cursor: nw-resize;background: linear-gradient( -45deg, transparent 30%, var(--neutral-foreground-rest) 30%, var(--neutral-foreground-rest) 40%, transparent 40%, transparent 60%, var(--neutral-foreground-rest) 60%, var(--neutral-foreground-rest) 70%, transparent 70% );z-index: 1000;opacity: 60%;transition: opacity 0.2s ease}.resize-button:hover{opacity: 100%}.multiselect-dropdown.resizable{resize: none;overflow: hidden}`;var XC;let ZC=XC=class extends Py{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=XC.defaultPageSize,this.initalSelectedValueInitialized=!1,this.isSnapshot=!0,this.baseCriteria=``,this.listboxElement=null,this.loadingMoreRows=!1,this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.listboxElement||this.attachListboxScrollListener(),this.topUpVisibleListbox())},this.listboxScrollHandler=()=>{let e=this.listboxElement;e&&this.isNearListboxBottom(e)&&this.loadNextPage()},this.resizeObserverCallback=e=>{e.forEach(e=>{this.checkOverflow(e.target)})},this.selectChangeHandler=e=>{let t=e.target.value,n=this.options?.find(e=>String(e.label)===t);!n&&this.allowCustomOptions&&this.select instanceof ou?this.select.$emit(`value-change`,{label:t,value:t}):this.select.$emit(`value-change`,n)}}initialSelectedValueChanged(e,t){if(t!==e){if(!t){this.select&&(this.initalSelectedValueInitialized=!1,this.clearData(),this.resetCombobox(),this.fetchData());return}this.select&&this.getDisplayForValue(t)===String(this.select.value||``)||(this.initalSelectedValueInitialized=!1,this.clearData(),this.fetchData())}}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){if(e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=this.optionElement??`${Ly(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:XC.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||Ny.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")`)})}disconnectedCallback(){var e;super.disconnectedCallback(),this.resizeObserver.disconnect(),(e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=null,this.select.removeEventListener(`open-change`,this.selectOpenChangeHandler),this.select.removeEventListener(`change`,this.selectChangeHandler)}applyInfiniteScrollFetchMode(){return J(this,void 0,void 0,function*(){if(this.resourceName&&this.connect.isConnected)try{let e=yield this.resources.getResourceTypeFor(this.resourceName);this.isSnapshot=e!==_g.DATASERVER}catch(e){Ny.warn(`Unable to determine the resource type for ${this.resourceName}`,e)}})}attachListboxScrollListener(){var e;if(this.isConnected){if((e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=this.select?.scrollableListbox??this.select?.listbox??(this.select?.shadowRoot)?.querySelector(`.listbox`),!this.listboxElement){Ny.warn(`Unable to locate listbox element, infinite scroll will not be available.`);return}this.listboxElement.addEventListener(`scroll`,this.listboxScrollHandler)}}isNearListboxBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-XC.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===_g.REQUEST_SERVER;try{yield this.requestMoreRows()}catch{this.loadingMoreRows=!1;return}e&&(this.loadingMoreRows=!1)})}topUpVisibleListbox(){this.infiniteScroll&&requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this.listboxElement;e&&e.clientHeight!==0&&this.isNearListboxBottom(e)&&e.scrollHeight!==this.lastTopUpScrollHeight&&(this.lastTopUpScrollHeight=e.scrollHeight,this.loadNextPage())})}fetchData(){this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof ou&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){if(!(yield this.datasource.init(this.datasourceOptions(),!0))){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}rb(this,this.initialSelectedValue)})}clearData(){this.rowsSyncedWithStream.clear(),this.options=[],this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.loadingMoreRows=!1,this.select&&(Array.from(this.select.children).forEach(e=>{e instanceof XC||this.select.removeChild(e)}),this.select.value=``,this.select.initialValue=``)}checkOverflow(e){let t=e.shadowRoot.querySelector(`.content`);t&&(t.scrollWidth>t.clientWidth?e.setAttribute(`title`,e.textContent):e.removeAttribute(`title`))}rowToOption(e){return{value:e[this.valueField],label:this.labelRowFormatter?this.labelRowFormatter(e):this.labelFormatter?this.labelFormatter(e[this.labelField]):this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}}renderListboxOptions(e){e.forEach(({value:e,label:t})=>{let n=document.createElement(this.optionElement);n.textContent=t||e,n.value=e,this.select.appendChild(n),this.resizeObserver.observe(n)})}removeEmptyDataOption(){this.emptyDataOption&&(this.emptyDataOption.remove(),this.emptyDataOption=null)}syncComponentData(e){this.loadingMoreRows=!1;let t=e??Array.from(this.rowsSyncedWithStream.values());if(t.length>0){this.removeEmptyDataOption(),this.options=t.map(e=>this.rowToOption(e));let e=this.renderedOptionsCount===0;if(this.renderListboxOptions(this.options.slice(this.renderedOptionsCount)),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox(),!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof ou&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async)&&(this.resetCombobox(),x.queueUpdate(()=>{this.select.value=String(this.initialSelectedValue)}),this.initalSelectedValueInitialized=!0),this.select&&!this.emptyDataOption){let e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value=``,e.disabled=!0,this.select.appendChild(e),this.emptyDataOption=e}}getInitialLabel(){return this.getDisplayForValue(this.initialSelectedValue)}getDisplayForValue(e){if(e==null||e!==0&&!e)return``;let t=this.options?.find(t=>t.value===e);return this.allowCustomOptions&&this.select instanceof ou?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof ou&&this.select.resetCombobox()}handleStreamInserts(e){if(this.loadingMoreRows=!1,!e?.length)return;this.removeEmptyDataOption();let t=new Set((this.options??[]).map(e=>String(e.value))),n=e.filter(e=>!t.has(String(e[this.valueField])));if(!n.length){Ny.warn(`Infinite scroll for ${this.resourceName} received a page of options that were all already loaded, so paging has stopped. Request Server resources only honour OFFSET when declared with criteriaOnlyRequest; otherwise every page returns the same rows. Also set a stable order-by so pages cannot overlap.`),this.moreRowsAvailable=!1;return}let r=n.map(e=>this.rowToOption(e));this.options=[...this.options??[],...r],this.renderListboxOptions(r),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox()}handleStreamDeletes(e){Ny.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Ny.debug(`handleStreamUpdates - Method not implemented.`)}};ZC.defaultPageSize=20,ZC.scrollLoadThresholdPx=32,q([cy],ZC.prototype,`resources`,void 0),q([D({attribute:`label-field`})],ZC.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],ZC.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],ZC.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],ZC.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],ZC.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],ZC.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],ZC.prototype,`pageSize`,void 0),q([C],ZC.prototype,`labelFormatter`,void 0),q([C],ZC.prototype,`labelRowFormatter`,void 0),q([C],ZC.prototype,`initialSelectedValue`,void 0),ZC=XC=q([$e({name:`options-datasource`})],ZC);let QC=class extends Py{constructor(){super(...arguments),this.isSnapshot=!0,this.baseCriteria=``}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||Ny.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")`)})}clearData(){this.select.options=[]}syncComponentData(e){let t=(e??Array.from(this.rowsSyncedWithStream.values())).map(e=>({value:e[this.valueField],label:this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}));this.select?.async&&(this.select.loading=!1),this.select.options=t}handleStreamInserts(e){Ny.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){Ny.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Ny.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],QC.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],QC.prototype,`labelField`,void 0),QC=q([$e({name:`multiselect-datasource`})],QC);let $C=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><div class="root" part="root" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control"><input id="display-field" part="filter-search" role="combobox" aria-haspopup="listbox" aria-controls="checkbox-container" aria-expanded=${e=>e.open?`true`:`false`}tabindex="${e=>e.tabindex}" ?readonly=${e=>!e.search}@click=${e=>e.toggle()}?disabled="${e=>e.disabled}" ${k(`filterSearchInput`)}value=${Mf(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getDisplayValue}" autocomplete="off" @input=${(e,t)=>e.inputHandler()}@change=${(e,t)=>e.changeHandler(t.event)}/><div part="indicator" class="indicator" @click=${e=>!e.disabled&&e.toggle()}><svg viewBox="0 0 12 7" ${k(`arrowIcon`)}id="arrow-icon" class="${e=>dn([`disabled-svg`,e.disabled])}" xmlns="http://www.w3.org/2000/svg"><path d="${`M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z`}" /></svg></div>${A(e=>e.filterSearchValue&&e.selectedOptions.length,T`<div class="display-value">${e=>e.getDisplayValue}</div>`)}</div>${A(e=>e.loading,T`<${e}-progress slot="indicator"></${e}-progress>`)}<section class=${e=>dn(`multiselect-dropdown`,[`resizable`,e.resizable])} ${k(`multiselectDropdown`)}part="multiselect-dropdown">${A(e=>e.resizable,T`<div class="resize-button" @mousedown=${(e,t)=>e.handleResizeStart(t.event)}></div>`)} ${A(e=>e.all,T`<${e}-button class="select-all" @click=${e=>e.selectCheckboxAll()}?disabled="${(e,t)=>e.isAllOptionsDisabled}">${e=>e.areAllOptionsSelected?`Deselect All`:`Select All`} ${e=>e.name}</${e}-button>`)}<ol id="checkbox-container" class="checkbox-container options" aria-multiselectable="true" part="options-ol"><li part="options-header-item" class=${e=>dn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:va})}></slot></li>${j(e=>e.filteredAvailableOptions,T`<li role="option" value=${(e,t)=>t.parent.getItemLabel(e)}part="option"><${e}-checkbox part="checkbox" class="checkbox" exportparts="label:checkbox-label" @keydown=${(e,t)=>t.parent.checkboxKeyDown(e,t.event)}@click=${(e,t)=>t.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parent.isOptionDisabled(e)}">${(e,t)=>{var n;return((n=t.parent)?.itemRenderer)?.call(n,e,t.parent)}}</${e}-checkbox></li>`)}</ol>${A(e=>e.showCreatable,T`<${e}-button @click=${e=>e.addOption()}>Create "${e=>e.filterSearchValue}"</${e}-button>`)}</section></div><slot ${xt({property:`slottedDatasource`,filter:e=>e instanceof QC})}></slot>`,$ae=T` ${$C()} `,ew={};var tw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.resizable=!1,this.filterByContains=!1,this.filterSearchValue=``,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=qC.BELOW,this.itemRenderer=this.defaultItemRenderer,this.initialisedOptions=!1,this.isResizing=!1,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.handleResizeStart=e=>{this.resizable&&this.multiselectDropdown&&(e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.startX=e.clientX,this.startY=e.clientY,this.startWidth=this.multiselectDropdown.offsetWidth,this.startHeight=this.multiselectDropdown.offsetHeight,this.multiselectDropdown.classList.add(`is-resizing`),document.addEventListener(`mousemove`,this.handleResizeMove),document.addEventListener(`mouseup`,this.handleResizeEnd))},this.handleResizeMove=e=>{if(!this.isResizing||!this.multiselectDropdown)return;e.preventDefault();let t=e.clientX-this.startX,n=e.clientY-this.startY,r=Math.max(250,this.startWidth+t),i=Math.max(100,this.startHeight+n);this.multiselectDropdown&&(this.multiselectDropdown.style.width=`${r}px`,this.multiselectDropdown.style.maxHeight=`${i}px`)},this.handleResizeEnd=()=>{this.isResizing=!1,document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd),this.multiselectDropdown&&(this.multiselectDropdown.classList.remove(`is-resizing`),this.multiselectDropdown.style.setProperty(`--custom-max-height`,this.multiselectDropdown.style.maxHeight),this.multiselectDropdown.style.removeProperty(`max-height`))}}debounceChanged(e,t){this.debouncedInputHandler=(0,JC.default)(this.asyncSetFilter,t)}openChanged(e,t){var n,r,i,a;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.arrowIcon)==null||n.classList.add(`flipped`),(r=this.multiselectDropdown)==null||r.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(i=this.arrowIcon)==null||i.classList.remove(`flipped`),(a=this.multiselectDropdown)==null||a.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===qC.ABOVE&&((e=this.multiselectDropdown)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside),document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd)}defaultItemRenderer(e,t){return T` ${typeof e==`string`?T`<span part="option-label">${()=>t.getItemLabel(e)}</span>`:T`<span data-option-label-text=${()=>e.optionLabelText}style=${()=>e.labelStyle}part="option-label">${()=>t.getItemLabel(e)}</span>`} `}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map(e=>this.optionValueGetter(e))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){if(this.$fastController.isConnected){this.initialisedOptions=!0;return}}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<230&&r>i?qC.ABOVE:qC.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===qC.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===qC.BELOW)}optionValueGetter(e){return typeof e==`string`?e:e.value}optionLabelGetter(e){return typeof e==`string`?e:e.label}getItemLabel(e){let t;return e?(t=typeof e==`string`?e:this.optionLabelGetter(e)||this.optionValueGetter(e)||``,this.valueFormatter?this.valueFormatter(t):t):``}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getDisplayValue(){let e=this.selectedOptions.length;if(e===0)return this.getPlaceholder;if(e===1){let e=this.options.find(e=>this.isOptionSelected(e));if(e)return this.getItemLabel(e);let[t]=this.selectedOptions;return typeof t==`string`?this.getItemLabel(t):`1 Selected`}return e===this.options.length&&this.options.every(e=>this.isOptionSelected(e))?`All ${this.name}`.trim():`${e} Selected`}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get areAllOptionsSelected(){let e=this.options.filter(e=>!this.isOptionDisabled(e));return e.length>0&&e.every(e=>this.isOptionSelected(e))}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&this.findExactMatchOptions().length===0}isOptionSelected(e){let t=this.optionValueGetter(e);return this.selectedOptions.some(n=>{if(typeof e==`object`&&typeof e.value==`object`)try{return JSON.stringify(n)===JSON.stringify(t)}catch{return n===t}return n===t})}selectCheckboxOne(e){let t=this.optionValueGetter(e);this.selectedOptions=this.selectedOptions.includes(t)?this.selectedOptions.filter(e=>e!==t):[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}checkboxKeyDown(e,t){return t.key===` `&&(t.preventDefault(),this.selectCheckboxOne(e)),!0}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){let e=this.areAllOptionsSelected;this.selectedOptions=e?[]:this.options.filter(e=>!this.isOptionDisabled(e)).map(e=>this.optionValueGetter(e)),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit(`selectionChange`,this.selectedOptions)}inputHandler(){this.open||(this.open=!0),this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){let e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter(t=>((typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t))?.toLowerCase()??``)===e)}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label.toLowerCase(),r=typeof t.value==`object`?(t=>Object.values(t).some(t=>t.toLowerCase().includes(e)))(t.value):String(t.value).toLowerCase().includes(e);return n.includes(e)||r})}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){this.slottedDatasource.length>0?nb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,Ny.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Escape`:if(this.open){this.open=!1;break}break;case`ArrowUp`:case`ArrowDown`:if(!this.open){this.open=!0;break}break;default:return!0}}clear(e={}){let{clearSelectedValues:t=!0,clearFilterText:n=!0}=e;t&&(this.selectedOptions=[],this.$emit(`selectionChange`,this.selectedOptions)),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],tw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],tw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],tw.prototype,`all`,void 0),q([D({mode:`boolean`})],tw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],tw.prototype,`search`,void 0),q([D({mode:`boolean`})],tw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],tw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],tw.prototype,`async`,void 0),q([D],tw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],tw.prototype,`resizable`,void 0),q([D],tw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],tw.prototype,`filterByContains`,void 0),q([C],tw.prototype,`defaultSlottedNodes`,void 0),q([C],tw.prototype,`slottedDatasource`,void 0),q([C],tw.prototype,`valueFormatter`,void 0),q([C],tw.prototype,`loading`,void 0),q([C],tw.prototype,`filterSearchValue`,void 0),q([C],tw.prototype,`open`,void 0),q([C],tw.prototype,`options`,void 0),q([C],tw.prototype,`selectedOptions`,void 0),q([C],tw.prototype,`filteredAvailableOptions`,void 0),q([C],tw.prototype,`scrollContainer`,void 0),q([D],tw.prototype,`position`,void 0),q([C],tw.prototype,`onAllSelectedCallback`,void 0),q([C],tw.prototype,`itemRenderer`,void 0),q([w],tw.prototype,`getDisplayValue`,null),q([w],tw.prototype,`getPlaceholder`,null),q([w],tw.prototype,`isAllOptionsDisabled`,null),q([w],tw.prototype,`areAllOptionsSelected`,null),q([w],tw.prototype,`showCreatable`,null),q([C],tw.prototype,`optionsHeaderSlottedNodes`,void 0),tw.compose(Object.assign({baseName:`multiselect`,template:$ae,styles:YC,shadowOptions:void 0},ew));let nw=O` .root{position: relative;width: 100%;min-width: 250px}.control-button{display: flex;justify-content: center;min-width: 31px;width: 31px;height: 31px;margin-left: calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}.control{cursor: pointer;position: relative;display: flex;justify-content: end;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}.control:hover .control-button, .control:hover .label{color: var(--neutral-foreground-rest)}button{pointer-events: none}.options{display: flex;flex-direction: column;position: absolute;height: max-content;overflow-y: hidden;margin-top: 5px;padding: calc((var(--design-unit) + 3) * 2px) calc((var(--design-unit) + 3) * 1px);border: 1px solid rgba(46 51 57 / 100%);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s;z-index: 999}.option-content{display: flex;align-items: center;gap: calc(var(--design-unit) * 4px);width: 100%}.icon-container{display: flex;align-items: center;justify-content: center;width: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px + 4px );height: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px );border-radius: calc((var(--control-corner-radius) - 1) * 2px);background: var(--neutral-layer-2);box-sizing: border-box;box-shadow: 0 0 5px 0 rgba(0 0 0 / 35%);flex-shrink: 0}.text-content{display: flex;flex-direction: column;flex: 1}.svg-icon{height: 2em}.position-above{bottom: 100%}.checkbox-container{display: flex;flex-direction: column;overflow-y: scroll;scrollbar-width: thin;scrollbar-color: rgb(46 48 53) rgb(31 33 38)}span{border-bottom: calc(var(--stroke-width) * 1px) solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 2) * 2px) calc((var(--design-unit) + 3) * 1px);font-size: calc((var(--type-ramp-base-font-size) - 1px));color: var(--neutral-foreground-hint)}.multiselect-checkbox{min-width: fit-content;flex-direction: row-reverse;justify-content: space-between;align-items: flex-start;border-bottom: 1px solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) 0;margin: 0}.multiselect-checkbox:hover{background-color: rgb(45 47 51);cursor: pointer}.multiselect-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis}.multiselect-checkbox::part(control){min-width: calc( ((var(--base-height-multiplier) + var(--density)) * var(--design-unit) / 2 + var(--design-unit)) * 1px )}.checkbox-container .multiselect-checkbox[disabled]{cursor: not-allowed}.description{text-wrap: wrap;font-size: calc((var(--type-ramp-base-font-size) - 1px));margin: calc((var(--design-unit) + 3) * 1px) 0}#filter-search{padding: 5px}::-webkit-scrollbar{width: 12px}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: rgb(46 48 53);border: 3px solid rgb(31 33 38)}.visible{visibility: visible;max-height: ${`450`}px}`,rw=(e=`foundation`)=>T`<div class="root" part="root"><div class="control" part="control" @click=${e=>!e.disabled&&e.toggle()}><label part="label" for="control" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><${e}-button class="control-button" part="control-button"><slot name="button-content"><${e}-icon name="plus" variant="solid" size="lg"></${e}-icon></slot></${e}-button></div><div ${k(`optionsElement`)}class="options" part="options">${A(e=>e.search,T`<${e}-text-field id="filter-search" part="filter-search" value=${Mf(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getPlaceholder}" @input=${(e,t)=>e.setFilter()}@change=${(e,t)=>e.changeHandler(t.event)}></${e}-text-field>`)}<div class="checkbox-container" part="checkbox-container">${j(e=>e.filteredAvailableOptions,T`<span>${e=>e.type}</span>${j(e=>e.options,T`<${e}-checkbox class="multiselect-checkbox" part="multiselect-checkbox" @click=${(e,t)=>t.parentContext.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parentContext.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parentContext.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parentContext.parent.isOptionDisabled(e)}"><div class="option-content">${A(e=>e.icon||e.svg,T`<div class="icon-container">${A(e=>e.icon,T`<${e}-icon style="color:${e=>e.iconColor||`#fff`}" name="${e=>e.icon}" size="xl"></${e}-icon>`)} ${A(e=>e.svg,T`<img class="svg-icon" src="${e=>e.svg}" alt="${e=>e.label}" />`)}</div>`)}<div class="text-content"><div class="option-label">${(e,t)=>t.parentContext.parent.getItemLabel(e)}</div>${A(e=>e.description,T`<p class="description">${e=>e.description}</p>`)}</div></div></${e}-checkbox>`)} `)}</div></div></div>`,eoe=T` ${rw()} `,iw={};var aw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.search=!0,this.disabled=!1,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.position=qC.BELOW}openChanged(e,t){var n,r;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.optionsElement)==null||n.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(r=this.optionsElement)==null||r.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===qC.ABOVE&&((e=this.optionsElement)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}sortFilteredOptions(e){let t=(e??this.options).reduce((e,t)=>{let n=t.type||`Other`;return e[n]?e[n].options.push(t):e[n]={type:n,options:[t]},e},{});return Object.values(t)}optionsChanged(){this.filteredAvailableOptions=this.sortFilteredOptions()}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains(`content-wrapper`);)t=t.parentElement;if(t){let n=t.getBoundingClientRect(),r=this.getBoundingClientRect(),i=n.top+n.height/2;e=r.top<i?qC.BELOW:qC.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?qC.ABOVE:qC.BELOW}}e===qC.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===qC.BELOW&&(this.optionsElement.classList.add(`position-below`),this.optionsElement.classList.remove(`position-above`))}optionGetter(e){return e.value}getItemLabel(e){let t;if(e)t=e.label||e.value||``;else return``;return this.valueFormatter?this.valueFormatter(t):t}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){let t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}setFilter(){let e=this.options.filter(e=>{let t=e.description,n=e.label??e.value;if(t?.toLowerCase().includes(this.filterSearchValue.toLowerCase())||n.toLowerCase().includes(this.filterSearchValue.toLowerCase()))return e});this.filteredAvailableOptions=this.sortFilteredOptions(e)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Fy(e,this)&&(this.open=!1)}};q([D],aw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],aw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],aw.prototype,`search`,void 0),q([D({mode:`boolean`})],aw.prototype,`disabled`,void 0),q([C],aw.prototype,`defaultSlottedNodes`,void 0),q([C],aw.prototype,`valueFormatter`,void 0),q([C],aw.prototype,`filterSearchValue`,void 0),q([C],aw.prototype,`open`,void 0),q([C],aw.prototype,`options`,void 0),q([C],aw.prototype,`selectedOptions`,void 0),q([C],aw.prototype,`filteredAvailableOptions`,void 0),q([C],aw.prototype,`position`,void 0),q([w],aw.prototype,`getPlaceholder`,null),aw.compose(Object.assign({baseName:`categorized-multiselect`,template:eoe,styles:nw,shadowOptions:void 0},iw));let ow=(e,t)=>Nr(e,t),sw=(e,t)=>O` ${nu(e,t)}`;var cw=class extends Pr{};let lw={checkedIndicator:`
|
|
254
254
|
<svg
|
|
255
255
|
aria-hidden="true"
|
|
256
256
|
part="checked-indicator"
|
|
@@ -250,7 +250,7 @@ function Sv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
250
250
|
✕
|
|
251
251
|
</button></span>`)}</div>`)}<${e}-button class="criteria-toggle-button" appearance="outline" title=${e=>e.showingChips?`Add more criteria`:`View active filters`}?disabled=${e=>e.activeGroups.length===0||e.isInterpreting}@click=${e=>e.toggleCriteriaView()}><${e}-icon name="pen" size="sm"></${e}-icon></${e}-button><${e}-button class="criteria-clear-button" appearance="outline" title="Clear all filters" ?disabled=${e=>e.activeGroups.length===0||e.isInterpreting}@click=${e=>e.clearChips()}><${e}-icon name="trash-alt" size="sm"></${e}-icon></${e}-button>${A(e=>e.speechAvailable,T`<${e}-button class="mic-button" appearance="${e=>e.isRecording?`accent`:`outline`}" ?disabled=${e=>e.disabled||e.isInterpreting}@click=${e=>e.toggleSpeechInput()}title=${e=>e.isRecording?`Stop recording`:`Start voice input`}><${e}-icon class="mic-icon" name="microphone" size="lg" variant="solid"></${e}-icon></${e}-button>`)}</div></div>`)} `,jS=T` ${e=>yae(zy(e))} `,bae={contains:Xy.containsIgnoreCase,equals:Xy.EQ,startsWith:Xy.startsWith,endsWith:Xy.endsWith,greaterThan:Xy.GT,lessThan:Xy.LT,greaterThanOrEqual:Xy.GE,lessThanOrEqual:Xy.LE,notEqual:Xy.NE,dateIsToday:Xy.dateIsToday,dateIsAfter:Xy.dateIsGreaterEqual,dateIsGreaterEqual:Xy.dateIsGreaterEqual,dateIsBefore:Xy.dateIsLessEqual,dateIsLessEqual:Xy.dateIsLessEqual,dateIsEqual:Xy.dateIsEqual,dateTimeIsAfter:Xy.dateTimeIsGreaterEqual,dateTimeIsGreaterEqual:Xy.dateTimeIsGreaterEqual,dateTimeIsBefore:Xy.dateTimeIsLessEqual,dateTimeIsLessEqual:Xy.dateTimeIsLessEqual};function xae(e){let t=bae[e.operator];if(!t)throw Error(`Unknown criteria operator '${e.operator}'`);return new tb().withField(e.field).withValue(e.value??null).withSerialiser(t).withGroup(`default`).build()}function Sae(e,t){return e.length===1?e[0]:e.reduce((e,n,r)=>r===0?[n]:[...e,t,n],[])}function MS(e){let t=new eb,n=!1;for(let r of e){if(!r.clauses?.length)continue;let e=r.clauses.map(xae),i=r.logic===`or`?Uy.Or():Uy.And(),a=Sae(e,i),o=e.length>1?{join:i}:{};r.negated?t.And([Uy.Not(),a]):t.And(e.length===1?e[0]:e,o),n=!0}return n?t.build():``}let Cae=[`contains`,`equals`,`startsWith`,`notEqual`],NS=[`equals`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`,`notEqual`],PS=[`dateIsToday`,`dateIsAfter`,`dateIsBefore`,`dateIsEqual`,`dateIsGreaterEqual`,`dateIsLessEqual`],FS=[`dateTimeIsAfter`,`dateTimeIsBefore`,`dateTimeIsGreaterEqual`,`dateTimeIsLessEqual`],wae={contains:`contains`,equals:`=`,startsWith:`starts with`,endsWith:`ends with`,notEqual:`≠`,greaterThan:`>`,lessThan:`<`,greaterThanOrEqual:`≥`,lessThanOrEqual:`≤`,dateIsToday:`is today`,dateIsAfter:`after`,dateIsBefore:`before`,dateIsEqual:`=`,dateIsGreaterEqual:`≥`,dateIsLessEqual:`≤`,dateTimeIsAfter:`after`,dateTimeIsBefore:`before`,dateTimeIsGreaterEqual:`≥`,dateTimeIsLessEqual:`≤`},Tae=/* @__PURE__ */ new Set([`DATE`,`LOCALDATE`]),Eae=/* @__PURE__ */ new Set([`DATETIME`,`NANO_TIMESTAMP`,`LOCALDATETIME`,`TIMESTAMP`]),IS=/* @__PURE__ */ new Set([`INT`,`INTEGER`,`LONG`,`SHORT`,`DOUBLE`,`BIGDECIMAL`,`DECIMAL`]);function LS(e){return(e||``).toUpperCase().trim().split(`(`)[0].trim()}function Dae(e){let t=LS(e);return Tae.has(t)?PS:Eae.has(t)?FS:IS.has(t)?NS:Cae}function Oae(e){return IS.has(LS(e))}function kae(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e)&&e>0:typeof e==`string`?/^\d{8}$/.test(e)||/^\d{4}-\d{2}-\d{2}$/.test(e)||/^\d{8}-\d{2}:\d{2}(:\d{2})?$/.test(e):!1}function Aae(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e):typeof e==`string`&&!Number.isNaN(Number(e))}function jae(e,t){let n=[],r=[],i=/* @__PURE__ */ new Map;Array.isArray(t)&&t.length>0&&(typeof t[0]==`string`?t.forEach(e=>i.set(e,void 0)):t.forEach(e=>i.set(e.NAME,e)));for(let t of e){let{field:e,operator:a,value:o}=t;if(!e||typeof e!=`string`){r.push({field:String(e),message:`Field name is required`});continue}let s=i.get(e),c=s&&`TYPE`in s?s.TYPE:`STRING`;if(!Dae(c).includes(a)){r.push({field:e,operator:a,value:o,message:`Operator '${a}' is not allowed for field type ${c}`});continue}if((PS.includes(a)||FS.includes(a))&&a!==`dateIsToday`&&!kae(o)){r.push({field:e,operator:a,value:o,message:`Invalid date/datetime value; use yyyyMMdd, yyyy-MM-dd, or epoch`});continue}if(Oae(c)&&NS.includes(a)&&!Aae(o)){r.push({field:e,operator:a,value:o,message:`Invalid numeric value`});continue}if(i.size>0&&!i.has(e)){r.push({field:e,operator:a,value:o,message:`Unknown field '${e}'`});continue}n.push(t)}return{valid:n,invalid:r}}function Mae(e,t){let n=[],r=[];for(let i of e){if(!i?.clauses||!Array.isArray(i.clauses)){r.push({field:``,message:`Group must have a clauses array`});continue}let{valid:e,invalid:a}=jae(i.clauses,t);r.push(...a),e.length>0&&n.push({logic:i.logic??`and`,negated:i.negated,clauses:e})}return{valid:n,invalid:r}}let RS=Yd(`foundation-notifications`),zS=null,BS=/* @__PURE__ */ new Map,VS=e=>`${e?.title??`Error`}: ${e?.body??`Something went wrong`}`,Nae=e=>e?.logLevel||e?.config?.logLevel||Td.debug,HS=e=>{RS.log({message:VS(e),level:Nae(e)})},US=(e,t)=>{let n=document.querySelector(`#${e}`);if(!n){if(BS.has(e))n=BS.get(e);else{let t=uf(document).find(t=>t.id===e);t&&(n=t,BS.set(e,t))}}if(!n){n=document.createElement(`div`),n.setAttribute(`id`,e),n.style.zIndex=`9999`;let{element:t,prefix:r}=pf(document.body,`rapid`);if(t)t.appendChild(n),zS=t;else if(zS)zS.appendChild(n);else{let e=document.createElement(`${r}-design-system-provider`);e.appendChild(n),document.body.appendChild(e),zS=e}}return n},Pae=e=>{for(;e&&!(e instanceof ShadowRoot);){let t=(e?.getRootNode())?.getElementById(`banner-anchor`);if(t)return t.style.position=`relative`,t;e=e?.getRootNode()?.host}return Fae()},Fae=()=>{let e=document.createElement(`div`);return e.setAttribute(`id`,`banner-anchor`),e.style.position=`relative`,document.body.insertBefore(e,document.body.firstChild),e},Iae=e=>{HS(e),alert(VS(e))},Lae=(e,t,n)=>{HS(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-banner`),a=Pae(n);a?.children?.length>0&&(i.style.position=`absolute`,i.style.top=`0`,i.style.left=`0`,i.style.width=`100%`),a.appendChild(i),i.notification=e},Rae=e=>{let t=e.querySelector(`#dialog-container`);return t||(t=document.createElement(`div`),t.setAttribute(`id`,`dialog-container`),t.style.position=`relative`,e.appendChild(t)),t},zae=(e,t,n)=>{HS(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-dialog`);(n?Rae(n):US(`dialog-container`,t)).appendChild(i),i.notification=e,i.show()};var WS;(function(e){e.NOTIFICATION_EVENT=`notification-event`})(WS||(WS={}));var GS;(function(e){e.Top=`top`,e.Bottom=`bottom`})(GS||(GS={}));var KS;(function(e){e.Left=`left`,e.Right=`right`})(KS||(KS={}));let qS=`12px`,Bae=(e,t,n)=>{e.style.position=`fixed`,e.style.top=t===GS.Top?qS:``,e.style.bottom=t===GS.Bottom?qS:``,e.style.left=n===KS.Left?qS:``,e.style.right=n===KS.Right?qS:``},Vae=(e,t)=>{HS(e);let n=t.split(`-`)[0],r=document.createElement(`${n}-snackbar`),i=e.config?.snackbar?.verticalEdge??GS.Bottom,a=e.config?.snackbar?.horizontalEdge??KS.Left,o=US(`snack-container-${i}-${a}`,t);o&&Bae(o,i,a),o.appendChild(r),r.notification=e},Hae=e=>uf(document.body).find(t=>t.tagName.toLowerCase()===`notify-container`&&t.position===e);function Uae(e,t){switch(t.style.position=`fixed`,e?.config?.toast?.position){case`top-left`:t.style.top=`var(--nav-height, 0)`,t.style.left=`0`;break;case`bottom-left`:t.style.bottom=`0`,t.style.left=`0`;break;case`bottom-right`:t.style.bottom=`0`,t.style.right=`0`;break;default:t.style.top=`var(--nav-height, 0)`,t.style.right=`0`}}let JS=(e,t,n)=>{var r,i;HS(e);let a=t.split(`-`)[0],o=e?.config?.toast?.position||`top-right`,s=n??Hae(o)??US(`notify-container`,t);s&&s.tagName.toLowerCase()!==`notify-container`&&Uae(e,s);let c=document.createElement(`${a}-toast`),l=document.createElement(`div`);l.setAttribute(`slot`,`top`),l.textContent=e.title;let u=document.createElement(`div`);u.setAttribute(`slot`,`content`),u.textContent=e?.body||``;let d=document.createElement(`div`);d.setAttribute(`slot`,`date`),d.textContent=(e?.createdAt)?.toLocaleTimeString()||``;let f;e?.config?.toast?.buttons&&e?.config?.toast?.buttons?.length&&(f=document.createElement(`div`),f.setAttribute(`slot`,`bottom`),e.config.toast.buttons.forEach(t=>{let n=document.createElement(`${a}-button`);n.textContent=t.placeholder||`example placeholder`,n.addEventListener(`click`,()=>{let{details:r}=e.config.toast;if(t.action)return t.action({details:r,buttonElement:n,toastElement:c})}),t.appearance&&n.setAttribute(`appearance`,t.appearance),f.appendChild(n)})),c.setAttribute(`notify`,e?.config?.toast?.type||``),e.iconName&&c.setAttribute(`notification-icon`,e.iconName),(r=e?.config?.toast)!=null&&r.autoClose&&c.setAttribute(`auto-close`,`${e?.config?.toast?.autoClose}`),(i=e?.config?.toast)!=null&&i.closeTimeout&&c.setAttribute(`close-timeout`,`${e?.config?.toast?.closeTimeout}`),c.appendChild(l),c.appendChild(u),c.appendChild(d),f&&c.appendChild(f),s.prepend(c)},YS=(e,t,n)=>{if(!e.title)throw Error(`Title is required`);if(!e.body)throw Error(`Missing required param 'body'`);let r={title:e.title,body:e.body,iconName:e.iconName},i={};e.createdAt&&(r=Object.assign({createdAt:e.createdAt},r)),e.logLevel!=null&&(r=Object.assign({logLevel:e.logLevel},r)),e.toast&&(i=Object.assign({toast:e.toast},i),r=Object.assign({config:i},r)),JS(r,t,n)},Wae=O` :host{position: fixed;z-index: 9999;display: flex;flex-direction: column;gap: 4px;box-sizing: border-box;pointer-events: none;/* Allow clicks to pass through empty space */ width: 415px}.toast-container{padding: 0 8px 12px 12px;position: relative}/* Expanded / List State: Allow scrolling if too many items */ :host(:not([stack-collapsed])){max-height: calc(100% - var(--nav-height));overflow: hidden;pointer-events: auto;/* Enable pointer events for scrolling */ slot{display: block;height: calc(100vh - var(--nav-height) - 54px);position: relative}.toast-container{flex: 1;height: 100%;overflow: hidden auto;scrollbar-color: var(--neutral-layer-3) transparent;&:hover{scrollbar-color: var(--neutral-layer-4) transparent}}}.header{display: flex;gap: 12px;pointer-events: none;margin: 5px 24px;justify-content: space-between;visibility: hidden;align-items: center;box-sizing: border-box;.header-title{text-shadow: 0 0 10px #000}.notification-header-buttons{display: flex;gap: 4px;rapid-icon{color: var(--neutral-foreground-hint);margin-left: 4px;display: inline-flex;font-size: 14px;&.chevron-up.collapse{transform: rotate(180deg);transition: transform 0.3s ease}}}--base-height-multiplier: 8;*[appearance='neutral']{font-size: 11px;cursor: pointer;background: var(--neutral-fill-rest)}}.header.visible{visibility: visible;pointer-events: auto;/* Enable clicks on header buttons */}:host([position$='left']) .header{justify-content: space-between}:host([position^='bottom']) .header{margin-bottom: 0;margin-top: 4px}/* Ensure children (toasts) are clickable */ ::slotted(*){pointer-events: auto}:host([position='top-right']){top: var(--nav-height, 0);right: 0}:host([position='top-left']){top: var(--nav-height, 0);left: 0}:host([position='bottom-right']){bottom: 0;right: 0;flex-direction: column-reverse}:host([position='bottom-left']){bottom: 0;left: 0;flex-direction: column-reverse}/* Stacked / Collapsed State */ :host([stack-collapsed]){height: min-content;/* Host allows pointer events so they can reach the slot */ pointer-events: auto;cursor: pointer}/* Apply the grid layout to the slot itself so it acts as the container and click target */ :host([stack-collapsed]) slot{display: grid;grid-template-columns: auto;grid-template-rows: auto;place-items: end center;/* Default to bottom-up stacking */ /* The slot catches the click */ pointer-events: auto}/* Rotate when the collapse class is present */ :host([stack-collapsed][position^='top']) slot{align-items: start}:host([stack-collapsed][position$='right']) slot{justify-items: end}:host([stack-collapsed][position$='left']) slot{justify-items: start}:host([stack-collapsed]) ::slotted(*){grid-area: 1 / 1;transition: transform 0.3s ease, top 0.3s ease, opacity 0.3s ease;opacity: 0%;pointer-events: none !important;/* Disable interaction with toasts in collapsed state */ transform: scale(0.9);top: 0 !important}/* Show and offset the top 3 items in the stack */ :host([stack-collapsed]) ::slotted([data-stack-index='0']){opacity: 100%;pointer-events: auto;transform: translateY(0) scale(1);z-index: 3;position: relative !important}:host([stack-collapsed]) ::slotted([data-stack-index='1']){opacity: 100%;transform: translateY(var(--stack-offset-y, 8px)) scale(0.95);z-index: 2;position: relative !important}:host([stack-collapsed]) ::slotted([data-stack-index='2']){opacity: 100%;transform: translateY(var(--stack-offset-y-2, 16px)) scale(0.9);z-index: 1;position: relative !important}/* Adjust offset direction based on position */ :host([stack-collapsed][position^='top']){--stack-offset-y: 8px;--stack-offset-y-2: 16px}:host([stack-collapsed][position^='bottom']){--stack-offset-y: -8px;--stack-offset-y-2: -16px}`,Gae=e=>T`<div class="header ${e=>dn([`visible`,e.slottedNodes.length>1])}">${A(e=>e.showCount,T`<span class="header-title">${e=>e.slottedNodes.length}Notifications</span>`)}<div class="notification-header-buttons">${A(e=>e.allowManualCollapse,T`<${e}-button @click=${e=>e.handleToggleCollapse()}>${e=>e.stackCollapsed?`Expand`:`Collapse`}<${e}-icon class="chevron-up ${e=>dn([`collapse`,e.stackCollapsed])}" name="chevron-up"></${e}-icon></${e}-button>`)} ${A(e=>e.allowCloseAll,T`<${e}-button @click=${e=>e.handleCloseAll()}>
|
|
252
252
|
Close All <${e}-icon name="xmark"></${e}-icon></${e}-button>`)}</div></div>`,Kae=T` ${A(e=>e.allowCloseAll||e.allowManualCollapse,T` ${e=>Gae(e.designSystemPrefix)} `)}<div class="toast-container"><slot ${xt(`slottedNodes`)}@click="${e=>e.handleContainerClick()}"></slot></div>`,XS=class extends Qe{constructor(){super(...arguments),this.position=`top-right`,this.stackThreshold=5,this.allowManualCollapse=!0,this.allowCloseAll=!0,this.designSystemPrefix=`rapid`,this.showCount=!0,this.stackCollapsed=!1,this.notificationInterval=0,this.manuallyExpanded=!1,this.pendingQueue=[],this.queueTimer=null,this.queuedNodes=/* @__PURE__ */ new Set,this.mutationObserver=null,this.knownNodes=/* @__PURE__ */ new Set,this.peekingNode=null,this.peekTimer=null,this.routeSubscriber={handleChange:()=>this.checkRoute(pp.shared.pathName)},this.slottedNodes=[]}connectedCallback(){super.connectedCallback(),(this.position===`bottom-left`||this.position===`bottom-right`)&&RS.error(`NotifyContainer doesn't currently support bottom corner placements`),S.getNotifier(pp.shared).subscribe(this.routeSubscriber,`pathName`),this.checkRoute(pp.shared.pathName),this.mutationObserver=new MutationObserver(e=>this.handleMutation(e)),this.mutationObserver.observe(this,{childList:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),S.getNotifier(pp.shared).unsubscribe(this.routeSubscriber,`pathName`),(e=this.mutationObserver)==null||e.disconnect(),this.mutationObserver=null}checkRoute(e){(e.includes(`/login`)||e.includes(`/logout`))&&(this.pendingQueue=[],this.queuedNodes.clear(),clearTimeout(this.queueTimer),this.queueTimer=null,this.handleCloseAll())}slottedNodesChanged(){if(!this.manuallyExpanded&&!this.stackCollapsed&&this.slottedNodes.length>this.stackThreshold&&(this.stackCollapsed=!0),this.stackCollapsed&&this.slottedNodes.length<=1&&(this.stackCollapsed=!1,this.manuallyExpanded=!1,this.cancelPeek()),this.stackCollapsed){let e=this.slottedNodes.filter(e=>e instanceof HTMLElement&&!this.knownNodes.has(e)).shift();e&&this.maybePeek(e)}this.knownNodes=new Set(this.slottedNodes),this.applySort()}handleContainerClick(){this.stackCollapsed&&(this.stackCollapsed=!1,this.manuallyExpanded=!0,this.cancelPeek())}handleToggleCollapse(){this.stackCollapsed=!this.stackCollapsed,this.manuallyExpanded=!this.stackCollapsed,this.stackCollapsed||this.cancelPeek()}handleCloseAll(){for(this.cancelPeek();this.firstChild;)this.removeChild(this.firstChild);this.stackCollapsed=!1,this.manuallyExpanded=!1}notificationIntervalChanged(e,t){!t&&this.pendingQueue&&this.flushQueue()}handleMutation(e){this.notificationInterval&&(e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof HTMLElement&&(this.queuedNodes.has(e)?this.queuedNodes.delete(e):(this.removeChild(e),this.pendingQueue.push(e)))})}),this.queueTimer||this.processQueue())}processQueue(){if(!this.pendingQueue.length){this.queueTimer=null;return}let e=this.pendingQueue.shift();this.queuedNodes.add(e),this.prepend(e),this.queueTimer=setTimeout(()=>{this.queueTimer=null,this.processQueue()},this.notificationInterval)}flushQueue(){for(clearTimeout(this.queueTimer),this.queueTimer=null;this.pendingQueue.length;){let e=this.pendingQueue.shift();this.queuedNodes.add(e),this.prepend(e)}}sortFnChanged(){this.applySort()}applySort(){let e=this.slottedNodes.filter(e=>e instanceof HTMLElement);if(!e.length)return;let t=this.sortFn&&e.length>1?[...e].sort(this.sortFn):e;this.peekingNode&&t.includes(this.peekingNode)?this.handlePosition([this.peekingNode,...t.filter(e=>e!==this.peekingNode)]):this.handlePosition(t)}maybePeek(e){let t=this.slottedNodes.filter(e=>e instanceof HTMLElement);if((this.sortFn&&t.length>1?[...t].sort(this.sortFn):t).indexOf(e)===0)return;this.cancelPeek(),this.peekingNode=e;let n=this.notificationInterval?this.notificationInterval/2:1500;this.peekTimer=setTimeout(()=>{this.peekingNode=null,this.peekTimer=null,this.applySort()},n)}cancelPeek(){clearTimeout(this.peekTimer),this.peekTimer=null,this.peekingNode=null}handlePosition(e){if(!e.length)return;e.forEach((t,n)=>{t.style.position=`absolute`,t.style.transition=`all 0.3s ease-in`,t.style.right=`0px`,t.style.zIndex=(e.length-n).toString(),t.dataset.stackIndex=n.toString()});let t=e.map(e=>e.offsetHeight);e.reduce((e,n,r)=>(n.style.top=`${e}px`,e+t[r]),0)}};q([D],XS.prototype,`position`,void 0),q([D({attribute:`stack-threshold`})],XS.prototype,`stackThreshold`,void 0),q([D({attribute:`allow-manual-collapse`,mode:`boolean`})],XS.prototype,`allowManualCollapse`,void 0),q([D({attribute:`allow-close-all`,mode:`boolean`})],XS.prototype,`allowCloseAll`,void 0),q([D({attribute:`design-system-prefix`})],XS.prototype,`designSystemPrefix`,void 0),q([D({attribute:`show-count`,mode:`boolean`})],XS.prototype,`showCount`,void 0),q([D({attribute:`stack-collapsed`,mode:`boolean`})],XS.prototype,`stackCollapsed`,void 0),q([D({attribute:`notification-interval`})],XS.prototype,`notificationInterval`,void 0),q([C],XS.prototype,`sortFn`,void 0),q([C],XS.prototype,`slottedNodes`,void 0),XS=q([$e({name:`notify-container`,template:Kae,styles:Wae})],XS);let ZS={alert:Iae,toast:JS,dialog:zae,snackbar:Vae,banner:Lae},QS=(e,t,n)=>{Object.keys(e?.config||{}).forEach(r=>{ZS[r]&&ZS[r](e,t,n)})};function qae(e){return e.length===0?``:e.length===1?e[0].message:e.map(e=>e.message).join(`; `)}function $S(e,t,n){t?.trim()&&QS({title:e,body:t,config:{toast:{autoClose:!0,closeTimeout:4e3,type:`error`}}},n)}var eC=class extends P{constructor(){super(...arguments),this.placeholder=`Describe your search criteria in natural language...`,this.inputValue=``,this.isInterpreting=!1,this.lastValidCriteria=null,this.activeGroups=[],this.showingChips=!1,this.fieldMetadata=[],this.isRecording=!1,this.stopRecording=null,this.speechApplyDebounceTimer=null}get speechAvailable(){return bb()}get criteriaChips(){return this.activeGroups.flatMap((e,t)=>e.clauses.map((e,n)=>({groupIndex:t,clauseIndex:n,fieldLabel:this.getFieldLabel(e.field),operatorLabel:wae[e.operator]??e.operator,valueLabel:e.operator===`dateIsToday`?``:String(e.value??``)})))}getFieldLabel(e){if(!Array.isArray(this.fieldMetadata)||this.fieldMetadata.length===0||typeof this.fieldMetadata[0]==`string`)return e;let t=this.fieldMetadata.find(t=>t.NAME===e);return t?.UI_LABEL??t?.NAME??e}toggleCriteriaView(){this.showingChips?(this.inputValue=``,this.showingChips=!1):this.showingChips=!0}removeChip(e,t){var n;let r=this.activeGroups.map(e=>Object.assign(Object.assign({},e),{clauses:[...e.clauses]}));(n=r[e])==null||n.clauses.splice(t,1);let i=r.filter(e=>e.clauses.length>0);if(this.activeGroups=i,i.length===0)this.showingChips=!1,this.lastValidCriteria=null,this.$emit(`criteria-changed`,null);else{let e=MS(i);this.lastValidCriteria=e,this.$emit(`criteria-changed`,e)}}clearChips(){this.activeGroups=[],this.showingChips=!1,this.lastValidCriteria=null,this.$emit(`criteria-changed`,null)}handleSubmit(){return J(this,void 0,void 0,function*(){let e=this.inputValue?.trim();if(!e||this.isInterpreting)return;let t=this.providerRegistry?.default();if(!t?.interpretCriteria){$S(`AI criteria search`,`AI provider not configured`,zy(this));return}this.isInterpreting=!0;try{let n=Array.isArray(this.fieldMetadata)?this.fieldMetadata:[],r=yield t.interpretCriteria(e,{fields:n});if(!(r?.groups)?.some(e=>e.clauses?.length)){$S(`AI criteria search`,`AI could not interpret the criteria`,zy(this)),this.isInterpreting=!1;return}let{valid:i,invalid:a}=Mae(r.groups,this.fieldMetadata);if(a.length>0&&($S(`Criteria validation error`,qae(a),zy(this)),this.$emit(`validation-errors`,a)),i.length>0){let e=[...this.activeGroups,...i],t=MS(e);this.lastValidCriteria=t,this.activeGroups=e,this.inputValue=``,this.showingChips=!0,this.$emit(`criteria-changed`,t)}}catch(e){$S(`AI criteria search`,e instanceof Error?e.message:`Interpretation failed`,zy(this))}finally{this.isInterpreting=!1}})}handleBlur(){this.isRecording||(this.inputValue?.trim()?this.handleSubmit():this.activeGroups.length>0&&(this.showingChips=!0))}clear(){this.inputValue=``,this.lastValidCriteria=null,this.activeGroups=[],this.showingChips=!1,this.$emit(`criteria-changed`,null)}toggleSpeechInput(){if(this.isRecording&&this.stopRecording){this.clearSpeechApplyDebounce(),this.stopRecording(),this.stopRecording=null,this.isRecording=!1;return}this.inputValue=``,this.showingChips=!1,this.stopRecording=xb((e,t)=>{this.inputValue=e,t&&e?.trim()&&(this.clearSpeechApplyDebounce(),this.stopRecording&&(this.stopRecording(),this.stopRecording=null,this.isRecording=!1),this.speechApplyDebounceTimer=setTimeout(()=>{this.speechApplyDebounceTimer=null,this.handleSubmit()},700))},()=>{this.clearSpeechApplyDebounce(),this.isRecording=!1,this.stopRecording=null}),this.stopRecording&&(this.isRecording=!0)}clearSpeechApplyDebounce(){this.speechApplyDebounceTimer&&(clearTimeout(this.speechApplyDebounceTimer),this.speechApplyDebounceTimer=null)}};q([DS],eC.prototype,`providerRegistry`,void 0),q([D],eC.prototype,`placeholder`,void 0),q([D({mode:`boolean`})],eC.prototype,`disabled`,void 0),q([C],eC.prototype,`inputValue`,void 0),q([C],eC.prototype,`isInterpreting`,void 0),q([C],eC.prototype,`lastValidCriteria`,void 0),q([C],eC.prototype,`activeGroups`,void 0),q([C],eC.prototype,`showingChips`,void 0),q([C],eC.prototype,`fieldMetadata`,void 0),q([C],eC.prototype,`isRecording`,void 0),q([w],eC.prototype,`speechAvailable`,null),q([w],eC.prototype,`criteriaChips`,null);let tC={};eC.compose(Object.assign({baseName:`ai-criteria-search`,template:jS,styles:AS,shadowOptions:void 0},tC));let nC=(e,t)=>O` :host{display: flex;justify-content: center;align-items: center;width: 100%;margin: calc(var(--design-unit) * 2px) 0;position: relative;/* Same as connection indicator */ --green: 50 164 49;--trafic-light-green: rgb(var(--green));--red: 187 30 16;--trafic-light-red: rgb(var(--red));--amber: 230 160 20;--trafic-light-amber: rgb(var(--amber))}.ai-indicator-container{display: flex;flex-direction: column;align-items: center;position: relative}.ai-indicator-badge{display: inline-flex;align-items: center;gap: calc(var(--design-unit) * 1.4px);font-size: 12px;line-height: 1;font-weight: 600;text-transform: uppercase;height: calc(var(--design-unit) * 6px);padding: calc(var(--design-unit) * 0.5px) calc(var(--design-unit) * 2px);border-radius: calc(var(--design-unit) * 1px);cursor: pointer;color: #fff}.ai-indicator-badge:hover{opacity: 90%}.ai-indicator-badge.green{background: var(--trafic-light-green)}.ai-indicator-badge.amber{background: var(--trafic-light-amber)}.ai-indicator-badge.red{background: var(--trafic-light-red)}.ai-indicator-badge .ai-indicator-icon{flex-shrink: 0;color: inherit}.ai-indicator-badge.pulsing{animation: ai-indicator-pulse 1.5s ease-in-out infinite}@keyframes ai-indicator-pulse{0%, 100%{opacity: 100%}50%{opacity: 50%}}.ai-indicator-dropdown{position: absolute;top: 100%;right: 0;margin-top: calc(var(--design-unit) * 2px);min-width: 200px;padding: calc(var(--design-unit) * 4px);background: var(--neutral-layer-floating, #fff);border: 1px solid var(--neutral-stroke-rest, #e0e0e0);border-radius: calc(var(--design-unit) * 2px);box-shadow: 0 calc(var(--design-unit) * 1px) calc(var(--design-unit) * 4px) rgb(0 0 0 / 12%);z-index: 1000}.ai-indicator-info{display: flex;flex-direction: column;gap: 0;margin: 0;padding: 0}.ai-indicator-info .info-row{display: grid;grid-template-columns: 72px 1fr;gap: calc(var(--design-unit) * 4px);align-items: baseline;padding: calc(var(--design-unit) * 1.5px) 0;border-bottom: 1px solid var(--neutral-stroke-subtle, #eee)}.ai-indicator-info .info-row:last-child{border-bottom: none}.ai-indicator-info .info-label{margin: 0;font-size: var(--type-ramp-base-font-size);font-weight: 500;color: var(--neutral-foreground-hint, #666)}.ai-indicator-info .info-value{margin: 0;font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-rest, #333);text-transform: capitalize;word-break: break-word}.install-button{margin-top: calc(var(--design-unit) * 3px);width: 100%}`,Jae=e=>T` ${A(()=>vb(),T`<div class="ai-indicator-container" part="ai-indicator-container"><div class=${e=>dn(`ai-indicator-badge`,[`green`,e.state===`available`||e.state===`server`],[`amber`,e.state===`downloading`||e.state===`downloadable`],[`red`,e.state===`unavailable`||e.state===`none`],[`pulsing`,e.state===`downloading`||e.isInstalling])}data-test-id="ai-indicator-badge" part="ai-indicator-badge" role="button" tabindex="0" aria-label="AI status" aria-haspopup="true" aria-expanded="${e=>e.open}" @click=${e=>e.toggleDropdown()}@keydown=${(e,t)=>{let n=t.event;(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e.toggleDropdown())}}><${e}-icon class="ai-indicator-icon" name="wand-magic-sparkles" size="xs" variant="solid" part="ai-indicator-icon"></${e}-icon><span class="ai-indicator-text" data-test-id="ai-indicator-text" part="ai-indicator-text">AI</span></div>${A(e=>e.open,T`<div class="ai-indicator-dropdown" part="ai-indicator-dropdown"><dl class="ai-indicator-info"><div class="info-row"><dt class="info-label">Provider</dt><dd class="info-value">${e=>e.status?.provider??`none`}</dd></div><div class="info-row"><dt class="info-label">Model</dt><dd class="info-value">${e=>e.status?.model||`—`}</dd></div>${A(e=>e.chromeStatusLabel,T`<div class="info-row"><dt class="info-label">Status</dt><dd class="info-value">${e=>e.chromeStatusLabel}</dd></div>`)}</dl>${A(e=>e.canInstall,T`<${e}-button class="install-button" appearance="accent" @click=${(e,t)=>{t.event.preventDefault(),e.onInstall()}}>
|
|
253
|
-
Install model </${e}-button>`)}</div>`)}</div>`)} `,rC=T` ${e=>Jae(zy(e))} `;var iC=class extends P{constructor(){super(...arguments),this.status=null,this.open=!1,this.state=`none`,this.isInstalling=!1,this.pollTimer=null,this.clickOutside=e=>this.handleClickOutside(e)}get aiProvider(){return this.providerRegistry?.default()}get chromeStatusLabel(){if(this.status?.provider!==`chrome`)return null;let e=this.status?.chromeAvailability;return e===`available`?`Installed`:e===`downloading`||this.isInstalling?`Downloading…`:e===`downloadable`?`Downloadable`:e===`unavailable`?`Unavailable`:null}get canInstall(){return!!this.aiProvider?.triggerDownload&&this.status?.provider===`chrome`&&this.status?.chromeAvailability===`downloadable`&&!this.isInstalling}get isDownloading(){return this.status?.chromeAvailability===`downloading`||this.isInstalling}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),yield this.refreshStatus(),this.maybeStartPolling()})}disconnectedCallback(){this.stopPolling(),document.removeEventListener(`mousedown`,this.clickOutside)}openChanged(){this.open?(document.addEventListener(`mousedown`,this.clickOutside),this.refreshStatus()):document.removeEventListener(`mousedown`,this.clickOutside)}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}toggleDropdown(){this.open=!this.open}refreshStatus(){return J(this,void 0,void 0,function*(){if(!this.aiProvider?.getStatus){this.status=null,this.state=`none`;return}try{let e=yield this.aiProvider.getStatus();this.status=e,this.state=this.deriveState(e),this.state===`available`&&(this.isInstalling=!1)}catch{this.status=null,this.state=`none`,this.isInstalling=!1}})}deriveState(e){if(!e||e.provider===`none`)return`none`;if(e.provider===`chrome`){let t=e.chromeAvailability;return t===`available`?`available`:t===`downloading`?`downloading`:t===`downloadable`?`downloadable`:`unavailable`}return`server`}maybeStartPolling(){this.status?.chromeAvailability===`downloading`||this.isInstalling?this.startPolling():this.stopPolling()}startPolling(){this.pollTimer||(this.pollTimer=setInterval(()=>{this.refreshStatus().then(()=>{this.maybeStartPolling()})},2500))}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}onInstall(){return J(this,void 0,void 0,function*(){if(this.canInstall&&this.aiProvider?.triggerDownload){this.isInstalling=!0;try{yield this.aiProvider.triggerDownload(),this.startPolling()}catch{this.isInstalling=!1}finally{yield this.refreshStatus()}}})}};q([DS],iC.prototype,`providerRegistry`,void 0),q([C],iC.prototype,`status`,void 0),q([C],iC.prototype,`open`,void 0),q([C],iC.prototype,`state`,void 0),q([C],iC.prototype,`isInstalling`,void 0),q([w],iC.prototype,`chromeStatusLabel`,null),q([w],iC.prototype,`canInstall`,null),q([w],iC.prototype,`isDownloading`,null),iC.compose({baseName:`ai-indicator`,template:rC,styles:nC});let aC=(e,t)=>Vn(e,t),oC=(e,t)=>O` ${Ul(e,t)}`;var sC=class extends Wl{};let cC={delegatesFocus:!0,mode:`open`},lC={};sC.compose(Object.assign({baseName:`anchor`,template:aC,styles:oC,shadowOptions:cC},lC));let uC=(e,t)=>Gn(e,t),dC=(e,t)=>O` ${Gl(e,t)}`;var fC=class extends qn{};let pC={delegatesFocus:!0,mode:`open`},mC={};fC.compose(Object.assign({baseName:`anchored-region`,template:uC,styles:dC,shadowOptions:pC},mC));let hC=(e,t)=>tr(e,t),Yae=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,gC=(e,t)=>O` ${Kl(e,t)}`;var _C=class extends ql{};let vC={delegatesFocus:!0,mode:`open`},yC={media:Yae};_C.compose(Object.assign({baseName:`avatar`,template:hC,styles:gC,shadowOptions:vC},yC));let bC=(e,t)=>rr(e,t),xC=(e,t)=>O` ${Jl(e,t)}`;var SC=class extends ir{};let CC={};SC.compose(Object.assign({baseName:`badge`,template:bC,styles:xC,shadowOptions:void 0},CC));let wC=O` @keyframes delete-animate{from{height: 100px;opacity: 100%}to{height: 0;opacity: 0%}}@keyframes append-animate{from{height: 0;opacity: 0%}to{height: var(--banner-height);opacity: 100%}}:host{--banner-width: 100%;--banner-height: 65px;--flow: row}@media screen and (max-width: 640px){:host{--flow: column;--banner-height: 100px}}.banner{animation: append-animate 0.3s linear;width: var(--banner-width);height: var(--banner-height);background-color: var(--fill-color);display: flex;flex-direction: var(--flow);padding: 5px 8px;box-sizing: border-box;overflow: hidden}.banner-delete{animation: delete-animate 0.3s linear;opacity: 0%}.content{display: flex;align-items: center;flex: 2;font-size: 12px;overflow: hidden;white-space: pre-line}.action{display: flex;flex-direction: row-reverse;align-items: center;gap: 10px;flex: 1;overflow: hidden}`,Xae=e=>T`<div role="alert" aria-live="polite" class="banner ${e=>e.dismissAnimation}" ${k(`banner`)}><div part="content" class="content"><slot name="content">${A(e=>e.notification,T`<div><div>${e=>e.notification?.body||`Place holder for notification message`}</div></div>`)}</slot></div><div part="action" class="action"><slot name="action" class="action">${A(e=>e.notification,T`<${e}-button slot="action" appearance="lightweight" @click=${e=>e.dismiss()}>${e=>e.notification?.config?.banner?.dismissingAction?.label||`Ignore`}</${e}-button>`)} ${j(e=>(e.notification?.config)?.banner.confirmingActions,T`<${e}-button slot="action" appearance="lightweight" @click=${(e,t)=>{var n;e?.action(),(n=t.parent)==null||n.dismissNotification()}}>${e=>e.label}</${e}-button>`)}</slot></div></div>`,TC=T` ${e=>Xae(zy(e))} `,EC={mode:`open`,delegatesFocus:!0};var DC=class extends P{constructor(){super(...arguments),this.dismissAnimation=``}connectedCallback(){super.connectedCallback()}dismiss(){return this.dismissAnimation=`banner-delete`,new Promise(e=>{this.banner.onanimationend=()=>{this.remove(),e()}})}dismissNotification(){return J(this,void 0,void 0,function*(){try{yield this.dismiss(),this.remove()}catch(e){Fy.error(e)}})}};q([C],DC.prototype,`dismissAnimation`,void 0),q([C],DC.prototype,`notification`,void 0),DC.compose({baseName:`banner`,styles:wC,template:TC,shadowOptions:EC});let OC=(e,t)=>sr(e,t),kC=(e,t)=>O` ${Xl(e,t)}`;var AC=class extends cr{};AC.compose(Object.assign({baseName:`breadcrumb`,template:OC,styles:kC,shadowOptions:void 0},{}));let jC=(e,t)=>ar(e,t),MC=(e,t)=>O` ${Yl(e,t)}`;var NC=class extends or{};let PC={separator:`/`};NC.compose(Object.assign({baseName:`breadcrumb-item`,template:jC,styles:MC,shadowOptions:void 0},PC));let FC=(e,t)=>lr(e,t),IC=(e,t)=>O` ${Zl(e,t)}`;var LC=class extends Ql{};let RC={delegatesFocus:!0,mode:`open`},zC={};LC.compose(Object.assign({baseName:`button`,template:FC,styles:IC,shadowOptions:RC},zC));let BC=()=>O` ${$l}`,VC=(e,t)=>Ar(e,t);var HC=class extends br{};let UC={delegatesFocus:!0,mode:`open`},WC={};HC.compose(Object.assign({baseName:`calendar`,template:VC,styles:BC,shadowOptions:UC},WC));let GC=(e,t)=>jr(e,t),KC=(e,t)=>O` ${eu(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var qC=class extends tu{};let JC={};qC.compose(Object.assign({baseName:`card`,template:GC,styles:KC,shadowOptions:void 0},JC));var YC;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(YC||(YC={}));var XC=/* @__PURE__ */ u((/* @__PURE__ */ s(((e,t)=>{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(x,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function ee(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function x(){var e=m();if(ee(e))return te(e);s=setTimeout(x,b(e))}function te(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function ne(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function S(){return s===void 0?o:te(m())}function C(){var e=m(),n=ee(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(x,t),_(c)}return s===void 0&&(s=setTimeout(x,t)),o}return C.cancel=ne,C.flush=S,C}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h})))());let ZC=O` :host{--scrollbar-width: 12px;--scrollbar-thumb-width: 8px}.root{position: relative;width: inherit;min-width: 250px}.control{cursor: pointer;position: relative;display: flex;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}#display-field{width: 100%;cursor: pointer;color: var(--neutral-foreground-rest);min-height: 40px;padding: 0 calc(var(--design-unit) * 2.25px);border-width: 0;background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px)}#display-field[disabled]{cursor: not-allowed;opacity: 30%}#display-field:focus{outline: 1px solid var(--accent-fill-rest);background: var(--neutral-fill-input-rest);border-style: none;box-shadow: none}#display-field:hover:not(:focus):not([disabled]){outline: 1px solid var(--neutral-stroke-hover)}button{pointer-events: none}.indicator{position: absolute;left: calc(100% - 26px);padding: 0;cursor: pointer}#arrow-icon{width: 16px;fill: white;transform: rotate(0deg);transition: transform 0.2s linear 0s}#arrow-icon.flipped{transform: rotate(180deg)}.disabled-svg{pointer-events: none;opacity: 30%}.position-above{bottom: 100%}::-webkit-scrollbar{width: var(--scrollbar-width)}::-webkit-scrollbar-track{background: var(--neutral-layer-4)}::-webkit-scrollbar-thumb{width: var(--scrollbar-thumb-width);border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-layer-2);border: 3px solid var(--neutral-layer-4)}::-webkit-scrollbar-corner{background: var(--neutral-layer-4)}.multiselect-dropdown{display: flex;flex-direction: column;position: absolute;height: max-content;overflow: hidden;margin-top: calc(var(--design-unit) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;z-index: 999}.multiselect-dropdown:not(.is-resizing){transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s}.checkbox-container{display: flex;flex-direction: column;list-style: none;overflow-y: auto;height: 100%}.is-resizing .checkbox-container{overflow-y: hidden}.checkbox-container foundation-checkbox[disabled]{cursor: not-allowed}.visible{visibility: visible;max-height: var(--custom-max-height, ${`230`}px);overflow: hidden}::slotted(foundation-checkbox), foundation-checkbox{border-bottom: 1px solid var(--neutral-layer-4);padding: 5px 0 5px 5px;margin: 0}::slotted(foundation-checkbox:hover), foundation-checkbox:hover{background-color: var(--neutral-layer-3);cursor: pointer}::slotted(foundation-checkbox)::part(label), foundation-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}ol, li{margin: 0;padding: 0}.checkbox{width: 100%}.select-all{width: 100%;margin-left: 0;margin-right: 0}.display-value{position: absolute;right: 40px;color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font)}.options-header-item-hidden{display: none}.resize-button{position: absolute;bottom: 0;right: 0;width: 12px;height: 12px;cursor: nw-resize;background: linear-gradient( -45deg, transparent 30%, var(--neutral-foreground-rest) 30%, var(--neutral-foreground-rest) 40%, transparent 40%, transparent 60%, var(--neutral-foreground-rest) 60%, var(--neutral-foreground-rest) 70%, transparent 70% );z-index: 1000;opacity: 60%;transition: opacity 0.2s ease}.resize-button:hover{opacity: 100%}.multiselect-dropdown.resizable{resize: none;overflow: hidden}`;var QC;let $C=QC=class extends Iy{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=QC.defaultPageSize,this.initalSelectedValueInitialized=!1,this.isSnapshot=!0,this.baseCriteria=``,this.listboxElement=null,this.loadingMoreRows=!1,this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.listboxElement||this.attachListboxScrollListener(),this.topUpVisibleListbox())},this.listboxScrollHandler=()=>{let e=this.listboxElement;e&&this.isNearListboxBottom(e)&&this.loadNextPage()},this.resizeObserverCallback=e=>{e.forEach(e=>{this.checkOverflow(e.target)})},this.selectChangeHandler=e=>{let t=e.target.value,n=this.options?.find(e=>String(e.label)===t);!n&&this.allowCustomOptions&&this.select instanceof ou?this.select.$emit(`value-change`,{label:t,value:t}):this.select.$emit(`value-change`,n)}}initialSelectedValueChanged(e,t){if(t!==e){if(!t){this.select&&(this.initalSelectedValueInitialized=!1,this.clearData(),this.resetCombobox(),this.fetchData());return}this.select&&this.getDisplayForValue(t)===String(this.select.value||``)||(this.initalSelectedValueInitialized=!1,this.clearData(),this.fetchData())}}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){if(e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=this.optionElement??`${zy(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:QC.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||Fy.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")`)})}disconnectedCallback(){var e;super.disconnectedCallback(),this.resizeObserver.disconnect(),(e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=null,this.select.removeEventListener(`open-change`,this.selectOpenChangeHandler),this.select.removeEventListener(`change`,this.selectChangeHandler)}applyInfiniteScrollFetchMode(){return J(this,void 0,void 0,function*(){if(this.resourceName&&this.connect.isConnected)try{let e=yield this.resources.getResourceTypeFor(this.resourceName);this.isSnapshot=e!==vg.DATASERVER}catch(e){Fy.warn(`Unable to determine the resource type for ${this.resourceName}`,e)}})}attachListboxScrollListener(){var e;if(this.isConnected){if((e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=this.select?.scrollableListbox??this.select?.listbox??(this.select?.shadowRoot)?.querySelector(`.listbox`),!this.listboxElement){Fy.warn(`Unable to locate listbox element, infinite scroll will not be available.`);return}this.listboxElement.addEventListener(`scroll`,this.listboxScrollHandler)}}isNearListboxBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-QC.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===vg.REQUEST_SERVER;try{yield this.requestMoreRows()}catch{this.loadingMoreRows=!1;return}e&&(this.loadingMoreRows=!1)})}topUpVisibleListbox(){this.infiniteScroll&&requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this.listboxElement;e&&e.clientHeight!==0&&this.isNearListboxBottom(e)&&e.scrollHeight!==this.lastTopUpScrollHeight&&(this.lastTopUpScrollHeight=e.scrollHeight,this.loadNextPage())})}fetchData(){this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof ou&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){if(!(yield this.datasource.init(this.datasourceOptions(),!0))){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}ab(this,this.initialSelectedValue)})}clearData(){this.rowsSyncedWithStream.clear(),this.options=[],this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.loadingMoreRows=!1,this.select&&(Array.from(this.select.children).forEach(e=>{e instanceof QC||this.select.removeChild(e)}),this.select.value=``,this.select.initialValue=``)}checkOverflow(e){let t=e.shadowRoot.querySelector(`.content`);t&&(t.scrollWidth>t.clientWidth?e.setAttribute(`title`,e.textContent):e.removeAttribute(`title`))}rowToOption(e){return{value:e[this.valueField],label:this.labelRowFormatter?this.labelRowFormatter(e):this.labelFormatter?this.labelFormatter(e[this.labelField]):this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}}renderListboxOptions(e){e.forEach(({value:e,label:t})=>{let n=document.createElement(this.optionElement);n.textContent=t||e,n.value=e,this.select.appendChild(n),this.resizeObserver.observe(n)})}removeEmptyDataOption(){this.emptyDataOption&&(this.emptyDataOption.remove(),this.emptyDataOption=null)}syncComponentData(e){this.loadingMoreRows=!1;let t=e??Array.from(this.rowsSyncedWithStream.values());if(t.length>0){this.removeEmptyDataOption(),this.options=t.map(e=>this.rowToOption(e));let e=this.renderedOptionsCount===0;if(this.renderListboxOptions(this.options.slice(this.renderedOptionsCount)),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox(),!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof ou&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async)&&(this.resetCombobox(),x.queueUpdate(()=>{this.select.value=String(this.initialSelectedValue)}),this.initalSelectedValueInitialized=!0),this.select&&!this.emptyDataOption){let e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value=``,e.disabled=!0,this.select.appendChild(e),this.emptyDataOption=e}}getInitialLabel(){return this.getDisplayForValue(this.initialSelectedValue)}getDisplayForValue(e){if(e==null||e!==0&&!e)return``;let t=this.options?.find(t=>t.value===e);return this.allowCustomOptions&&this.select instanceof ou?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof ou&&this.select.resetCombobox()}handleStreamInserts(e){if(this.loadingMoreRows=!1,!e?.length)return;this.removeEmptyDataOption();let t=new Set((this.options??[]).map(e=>String(e.value))),n=e.filter(e=>!t.has(String(e[this.valueField])));if(!n.length){Fy.warn(`Infinite scroll for ${this.resourceName} received a page of options that were all already loaded, so paging has stopped. Request Server resources only honour OFFSET when declared with criteriaOnlyRequest; otherwise every page returns the same rows. Also set a stable order-by so pages cannot overlap.`),this.moreRowsAvailable=!1;return}let r=n.map(e=>this.rowToOption(e));this.options=[...this.options??[],...r],this.renderListboxOptions(r),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox()}handleStreamDeletes(e){Fy.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Fy.debug(`handleStreamUpdates - Method not implemented.`)}};$C.defaultPageSize=20,$C.scrollLoadThresholdPx=32,q([uy],$C.prototype,`resources`,void 0),q([D({attribute:`label-field`})],$C.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],$C.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],$C.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],$C.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],$C.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],$C.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],$C.prototype,`pageSize`,void 0),q([C],$C.prototype,`labelFormatter`,void 0),q([C],$C.prototype,`labelRowFormatter`,void 0),q([C],$C.prototype,`initialSelectedValue`,void 0),$C=QC=q([$e({name:`options-datasource`})],$C);let ew=class extends Iy{constructor(){super(...arguments),this.isSnapshot=!0,this.baseCriteria=``}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||Fy.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")`)})}clearData(){this.select.options=[]}syncComponentData(e){let t=(e??Array.from(this.rowsSyncedWithStream.values())).map(e=>({value:e[this.valueField],label:this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}));this.select?.async&&(this.select.loading=!1),this.select.options=t}handleStreamInserts(e){Fy.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){Fy.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Fy.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],ew.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],ew.prototype,`labelField`,void 0),ew=q([$e({name:`multiselect-datasource`})],ew);let tw=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><div class="root" part="root" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control"><input id="display-field" part="filter-search" role="combobox" aria-haspopup="listbox" aria-controls="checkbox-container" aria-expanded=${e=>e.open?`true`:`false`}tabindex="${e=>e.tabindex}" ?readonly=${e=>!e.search}@click=${e=>e.toggle()}?disabled="${e=>e.disabled}" ${k(`filterSearchInput`)}value=${Ff(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getDisplayValue}" autocomplete="off" @input=${(e,t)=>e.inputHandler()}@change=${(e,t)=>e.changeHandler(t.event)}/><div part="indicator" class="indicator" @click=${e=>!e.disabled&&e.toggle()}><svg viewBox="0 0 12 7" ${k(`arrowIcon`)}id="arrow-icon" class="${e=>dn([`disabled-svg`,e.disabled])}" xmlns="http://www.w3.org/2000/svg"><path d="${`M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z`}" /></svg></div>${A(e=>e.filterSearchValue&&e.selectedOptions.length,T`<div class="display-value">${e=>e.getDisplayValue}</div>`)}</div>${A(e=>e.loading,T`<${e}-progress slot="indicator"></${e}-progress>`)}<section class=${e=>dn(`multiselect-dropdown`,[`resizable`,e.resizable])} ${k(`multiselectDropdown`)}part="multiselect-dropdown">${A(e=>e.resizable,T`<div class="resize-button" @mousedown=${(e,t)=>e.handleResizeStart(t.event)}></div>`)} ${A(e=>e.all,T`<${e}-button class="select-all" @click=${e=>e.selectCheckboxAll()}?disabled="${(e,t)=>e.isAllOptionsDisabled}">${e=>e.areAllOptionsSelected?`Deselect All`:`Select All`} ${e=>e.name}</${e}-button>`)}<ol id="checkbox-container" class="checkbox-container options" aria-multiselectable="true" part="options-ol"><li part="options-header-item" class=${e=>dn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:va})}></slot></li>${j(e=>e.filteredAvailableOptions,T`<li role="option" value=${(e,t)=>t.parent.getItemLabel(e)}part="option"><${e}-checkbox part="checkbox" class="checkbox" exportparts="label:checkbox-label" @keydown=${(e,t)=>t.parent.checkboxKeyDown(e,t.event)}@click=${(e,t)=>t.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parent.isOptionDisabled(e)}">${(e,t)=>{var n;return((n=t.parent)?.itemRenderer)?.call(n,e,t.parent)}}</${e}-checkbox></li>`)}</ol>${A(e=>e.showCreatable,T`<${e}-button @click=${e=>e.addOption()}>Create "${e=>e.filterSearchValue}"</${e}-button>`)}</section></div><slot ${xt({property:`slottedDatasource`,filter:e=>e instanceof ew})}></slot>`,Zae=T` ${tw()} `,nw={};var rw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.resizable=!1,this.filterByContains=!1,this.filterSearchValue=``,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=YC.BELOW,this.itemRenderer=this.defaultItemRenderer,this.initialisedOptions=!1,this.isResizing=!1,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.handleResizeStart=e=>{this.resizable&&this.multiselectDropdown&&(e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.startX=e.clientX,this.startY=e.clientY,this.startWidth=this.multiselectDropdown.offsetWidth,this.startHeight=this.multiselectDropdown.offsetHeight,this.multiselectDropdown.classList.add(`is-resizing`),document.addEventListener(`mousemove`,this.handleResizeMove),document.addEventListener(`mouseup`,this.handleResizeEnd))},this.handleResizeMove=e=>{if(!this.isResizing||!this.multiselectDropdown)return;e.preventDefault();let t=e.clientX-this.startX,n=e.clientY-this.startY,r=Math.max(250,this.startWidth+t),i=Math.max(100,this.startHeight+n);this.multiselectDropdown&&(this.multiselectDropdown.style.width=`${r}px`,this.multiselectDropdown.style.maxHeight=`${i}px`)},this.handleResizeEnd=()=>{this.isResizing=!1,document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd),this.multiselectDropdown&&(this.multiselectDropdown.classList.remove(`is-resizing`),this.multiselectDropdown.style.setProperty(`--custom-max-height`,this.multiselectDropdown.style.maxHeight),this.multiselectDropdown.style.removeProperty(`max-height`))}}debounceChanged(e,t){this.debouncedInputHandler=(0,XC.default)(this.asyncSetFilter,t)}openChanged(e,t){var n,r,i,a;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.arrowIcon)==null||n.classList.add(`flipped`),(r=this.multiselectDropdown)==null||r.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(i=this.arrowIcon)==null||i.classList.remove(`flipped`),(a=this.multiselectDropdown)==null||a.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===YC.ABOVE&&((e=this.multiselectDropdown)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside),document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd)}defaultItemRenderer(e,t){return T` ${typeof e==`string`?T`<span part="option-label">${()=>t.getItemLabel(e)}</span>`:T`<span data-option-label-text=${()=>e.optionLabelText}style=${()=>e.labelStyle}part="option-label">${()=>t.getItemLabel(e)}</span>`} `}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map(e=>this.optionValueGetter(e))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){if(this.$fastController.isConnected){this.initialisedOptions=!0;return}}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<230&&r>i?YC.ABOVE:YC.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===YC.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===YC.BELOW)}optionValueGetter(e){return typeof e==`string`?e:e.value}optionLabelGetter(e){return typeof e==`string`?e:e.label}getItemLabel(e){let t;return e?(t=typeof e==`string`?e:this.optionLabelGetter(e)||this.optionValueGetter(e)||``,this.valueFormatter?this.valueFormatter(t):t):``}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getDisplayValue(){let e=``;switch(this.selectedOptions.length){case 0:e=this.getPlaceholder;break;case 1:{let t=this.options.find(e=>this.optionValueGetter(e)===this.selectedOptions[0]);e=this.getItemLabel(t);break}case this.options.length:e=`All ${this.name}`.trim();break;default:e=`${this.selectedOptions.length} Selected`}return e}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get areAllOptionsSelected(){let e=this.getEnabledOptionsCount();return e>0&&this.selectedOptions.length===e}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&this.findExactMatchOptions().length===0}isOptionSelected(e){let t=this.optionValueGetter(e);return this.selectedOptions.some(n=>{if(typeof e==`object`&&typeof e.value==`object`)try{return JSON.stringify(n)===JSON.stringify(t)}catch{return n===t}return n===t})}selectCheckboxOne(e){let t=this.optionValueGetter(e);this.selectedOptions=this.selectedOptions.includes(t)?this.selectedOptions.filter(e=>e!==t):[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}checkboxKeyDown(e,t){return t.key===` `&&(t.preventDefault(),this.selectCheckboxOne(e)),!0}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){let e=this.selectedOptions.length===this.getEnabledOptionsCount();this.selectedOptions=e?[]:this.options.filter(e=>!this.isOptionDisabled(e)).map(e=>this.optionValueGetter(e)),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit(`selectionChange`,this.selectedOptions)}inputHandler(){this.open||(this.open=!0),this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){let e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter(t=>((typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t))?.toLowerCase()??``)===e)}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label.toLowerCase(),r=typeof t.value==`object`?(t=>Object.values(t).some(t=>t.toLowerCase().includes(e)))(t.value):String(t.value).toLowerCase().includes(e);return n.includes(e)||r})}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){this.slottedDatasource.length>0?ib(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,Fy.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Escape`:if(this.open){this.open=!1;break}break;case`ArrowUp`:case`ArrowDown`:if(!this.open){this.open=!0;break}break;default:return!0}}clear(e={}){let{clearSelectedValues:t=!0,clearFilterText:n=!0}=e;t&&(this.selectedOptions=[],this.$emit(`selectionChange`,this.selectedOptions)),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],rw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],rw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],rw.prototype,`all`,void 0),q([D({mode:`boolean`})],rw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],rw.prototype,`search`,void 0),q([D({mode:`boolean`})],rw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],rw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],rw.prototype,`async`,void 0),q([D],rw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],rw.prototype,`resizable`,void 0),q([D],rw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],rw.prototype,`filterByContains`,void 0),q([C],rw.prototype,`defaultSlottedNodes`,void 0),q([C],rw.prototype,`slottedDatasource`,void 0),q([C],rw.prototype,`valueFormatter`,void 0),q([C],rw.prototype,`loading`,void 0),q([C],rw.prototype,`filterSearchValue`,void 0),q([C],rw.prototype,`open`,void 0),q([C],rw.prototype,`options`,void 0),q([C],rw.prototype,`selectedOptions`,void 0),q([C],rw.prototype,`filteredAvailableOptions`,void 0),q([C],rw.prototype,`scrollContainer`,void 0),q([D],rw.prototype,`position`,void 0),q([C],rw.prototype,`onAllSelectedCallback`,void 0),q([C],rw.prototype,`itemRenderer`,void 0),q([w],rw.prototype,`getDisplayValue`,null),q([w],rw.prototype,`getPlaceholder`,null),q([w],rw.prototype,`isAllOptionsDisabled`,null),q([w],rw.prototype,`areAllOptionsSelected`,null),q([w],rw.prototype,`showCreatable`,null),q([C],rw.prototype,`optionsHeaderSlottedNodes`,void 0),rw.compose(Object.assign({baseName:`multiselect`,template:Zae,styles:ZC,shadowOptions:void 0},nw));let iw=O` .root{position: relative;width: 100%;min-width: 250px}.control-button{display: flex;justify-content: center;min-width: 31px;width: 31px;height: 31px;margin-left: calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}.control{cursor: pointer;position: relative;display: flex;justify-content: end;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}.control:hover .control-button, .control:hover .label{color: var(--neutral-foreground-rest)}button{pointer-events: none}.options{display: flex;flex-direction: column;position: absolute;height: max-content;overflow-y: hidden;margin-top: 5px;padding: calc((var(--design-unit) + 3) * 2px) calc((var(--design-unit) + 3) * 1px);border: 1px solid rgba(46 51 57 / 100%);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s;z-index: 999}.option-content{display: flex;align-items: center;gap: calc(var(--design-unit) * 4px);width: 100%}.icon-container{display: flex;align-items: center;justify-content: center;width: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px + 4px );height: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px );border-radius: calc((var(--control-corner-radius) - 1) * 2px);background: var(--neutral-layer-2);box-sizing: border-box;box-shadow: 0 0 5px 0 rgba(0 0 0 / 35%);flex-shrink: 0}.text-content{display: flex;flex-direction: column;flex: 1}.svg-icon{height: 2em}.position-above{bottom: 100%}.checkbox-container{display: flex;flex-direction: column;overflow-y: scroll;scrollbar-width: thin;scrollbar-color: rgb(46 48 53) rgb(31 33 38)}span{border-bottom: calc(var(--stroke-width) * 1px) solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 2) * 2px) calc((var(--design-unit) + 3) * 1px);font-size: calc((var(--type-ramp-base-font-size) - 1px));color: var(--neutral-foreground-hint)}.multiselect-checkbox{min-width: fit-content;flex-direction: row-reverse;justify-content: space-between;align-items: flex-start;border-bottom: 1px solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) 0;margin: 0}.multiselect-checkbox:hover{background-color: rgb(45 47 51);cursor: pointer}.multiselect-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis}.multiselect-checkbox::part(control){min-width: calc( ((var(--base-height-multiplier) + var(--density)) * var(--design-unit) / 2 + var(--design-unit)) * 1px )}.checkbox-container .multiselect-checkbox[disabled]{cursor: not-allowed}.description{text-wrap: wrap;font-size: calc((var(--type-ramp-base-font-size) - 1px));margin: calc((var(--design-unit) + 3) * 1px) 0}#filter-search{padding: 5px}::-webkit-scrollbar{width: 12px}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: rgb(46 48 53);border: 3px solid rgb(31 33 38)}.visible{visibility: visible;max-height: ${`450`}px}`,aw=(e=`foundation`)=>T`<div class="root" part="root"><div class="control" part="control" @click=${e=>!e.disabled&&e.toggle()}><label part="label" for="control" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><${e}-button class="control-button" part="control-button"><slot name="button-content"><${e}-icon name="plus" variant="solid" size="lg"></${e}-icon></slot></${e}-button></div><div ${k(`optionsElement`)}class="options" part="options">${A(e=>e.search,T`<${e}-text-field id="filter-search" part="filter-search" value=${Ff(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getPlaceholder}" @input=${(e,t)=>e.setFilter()}@change=${(e,t)=>e.changeHandler(t.event)}></${e}-text-field>`)}<div class="checkbox-container" part="checkbox-container">${j(e=>e.filteredAvailableOptions,T`<span>${e=>e.type}</span>${j(e=>e.options,T`<${e}-checkbox class="multiselect-checkbox" part="multiselect-checkbox" @click=${(e,t)=>t.parentContext.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parentContext.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parentContext.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parentContext.parent.isOptionDisabled(e)}"><div class="option-content">${A(e=>e.icon||e.svg,T`<div class="icon-container">${A(e=>e.icon,T`<${e}-icon style="color:${e=>e.iconColor||`#fff`}" name="${e=>e.icon}" size="xl"></${e}-icon>`)} ${A(e=>e.svg,T`<img class="svg-icon" src="${e=>e.svg}" alt="${e=>e.label}" />`)}</div>`)}<div class="text-content"><div class="option-label">${(e,t)=>t.parentContext.parent.getItemLabel(e)}</div>${A(e=>e.description,T`<p class="description">${e=>e.description}</p>`)}</div></div></${e}-checkbox>`)} `)}</div></div></div>`,Qae=T` ${aw()} `,ow={};var sw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.search=!0,this.disabled=!1,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.position=YC.BELOW}openChanged(e,t){var n,r;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.optionsElement)==null||n.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(r=this.optionsElement)==null||r.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===YC.ABOVE&&((e=this.optionsElement)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}sortFilteredOptions(e){let t=(e??this.options).reduce((e,t)=>{let n=t.type||`Other`;return e[n]?e[n].options.push(t):e[n]={type:n,options:[t]},e},{});return Object.values(t)}optionsChanged(){this.filteredAvailableOptions=this.sortFilteredOptions()}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains(`content-wrapper`);)t=t.parentElement;if(t){let n=t.getBoundingClientRect(),r=this.getBoundingClientRect(),i=n.top+n.height/2;e=r.top<i?YC.BELOW:YC.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?YC.ABOVE:YC.BELOW}}e===YC.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===YC.BELOW&&(this.optionsElement.classList.add(`position-below`),this.optionsElement.classList.remove(`position-above`))}optionGetter(e){return e.value}getItemLabel(e){let t;if(e)t=e.label||e.value||``;else return``;return this.valueFormatter?this.valueFormatter(t):t}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){let t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}setFilter(){let e=this.options.filter(e=>{let t=e.description,n=e.label??e.value;if(t?.toLowerCase().includes(this.filterSearchValue.toLowerCase())||n.toLowerCase().includes(this.filterSearchValue.toLowerCase()))return e});this.filteredAvailableOptions=this.sortFilteredOptions(e)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}};q([D],sw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],sw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],sw.prototype,`search`,void 0),q([D({mode:`boolean`})],sw.prototype,`disabled`,void 0),q([C],sw.prototype,`defaultSlottedNodes`,void 0),q([C],sw.prototype,`valueFormatter`,void 0),q([C],sw.prototype,`filterSearchValue`,void 0),q([C],sw.prototype,`open`,void 0),q([C],sw.prototype,`options`,void 0),q([C],sw.prototype,`selectedOptions`,void 0),q([C],sw.prototype,`filteredAvailableOptions`,void 0),q([C],sw.prototype,`position`,void 0),q([w],sw.prototype,`getPlaceholder`,null),sw.compose(Object.assign({baseName:`categorized-multiselect`,template:Qae,styles:iw,shadowOptions:void 0},ow));let cw=(e,t)=>Nr(e,t),lw=(e,t)=>O` ${nu(e,t)}`;var uw=class extends Pr{};let dw={checkedIndicator:`
|
|
253
|
+
Install model </${e}-button>`)}</div>`)}</div>`)} `,rC=T` ${e=>Jae(zy(e))} `;var iC=class extends P{constructor(){super(...arguments),this.status=null,this.open=!1,this.state=`none`,this.isInstalling=!1,this.pollTimer=null,this.clickOutside=e=>this.handleClickOutside(e)}get aiProvider(){return this.providerRegistry?.default()}get chromeStatusLabel(){if(this.status?.provider!==`chrome`)return null;let e=this.status?.chromeAvailability;return e===`available`?`Installed`:e===`downloading`||this.isInstalling?`Downloading…`:e===`downloadable`?`Downloadable`:e===`unavailable`?`Unavailable`:null}get canInstall(){return!!this.aiProvider?.triggerDownload&&this.status?.provider===`chrome`&&this.status?.chromeAvailability===`downloadable`&&!this.isInstalling}get isDownloading(){return this.status?.chromeAvailability===`downloading`||this.isInstalling}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),yield this.refreshStatus(),this.maybeStartPolling()})}disconnectedCallback(){this.stopPolling(),document.removeEventListener(`mousedown`,this.clickOutside)}openChanged(){this.open?(document.addEventListener(`mousedown`,this.clickOutside),this.refreshStatus()):document.removeEventListener(`mousedown`,this.clickOutside)}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}toggleDropdown(){this.open=!this.open}refreshStatus(){return J(this,void 0,void 0,function*(){if(!this.aiProvider?.getStatus){this.status=null,this.state=`none`;return}try{let e=yield this.aiProvider.getStatus();this.status=e,this.state=this.deriveState(e),this.state===`available`&&(this.isInstalling=!1)}catch{this.status=null,this.state=`none`,this.isInstalling=!1}})}deriveState(e){if(!e||e.provider===`none`)return`none`;if(e.provider===`chrome`){let t=e.chromeAvailability;return t===`available`?`available`:t===`downloading`?`downloading`:t===`downloadable`?`downloadable`:`unavailable`}return`server`}maybeStartPolling(){this.status?.chromeAvailability===`downloading`||this.isInstalling?this.startPolling():this.stopPolling()}startPolling(){this.pollTimer||(this.pollTimer=setInterval(()=>{this.refreshStatus().then(()=>{this.maybeStartPolling()})},2500))}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}onInstall(){return J(this,void 0,void 0,function*(){if(this.canInstall&&this.aiProvider?.triggerDownload){this.isInstalling=!0;try{yield this.aiProvider.triggerDownload(),this.startPolling()}catch{this.isInstalling=!1}finally{yield this.refreshStatus()}}})}};q([DS],iC.prototype,`providerRegistry`,void 0),q([C],iC.prototype,`status`,void 0),q([C],iC.prototype,`open`,void 0),q([C],iC.prototype,`state`,void 0),q([C],iC.prototype,`isInstalling`,void 0),q([w],iC.prototype,`chromeStatusLabel`,null),q([w],iC.prototype,`canInstall`,null),q([w],iC.prototype,`isDownloading`,null),iC.compose({baseName:`ai-indicator`,template:rC,styles:nC});let aC=(e,t)=>Vn(e,t),oC=(e,t)=>O` ${Ul(e,t)}`;var sC=class extends Wl{};let cC={delegatesFocus:!0,mode:`open`},lC={};sC.compose(Object.assign({baseName:`anchor`,template:aC,styles:oC,shadowOptions:cC},lC));let uC=(e,t)=>Gn(e,t),dC=(e,t)=>O` ${Gl(e,t)}`;var fC=class extends qn{};let pC={delegatesFocus:!0,mode:`open`},mC={};fC.compose(Object.assign({baseName:`anchored-region`,template:uC,styles:dC,shadowOptions:pC},mC));let hC=(e,t)=>tr(e,t),Yae=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,gC=(e,t)=>O` ${Kl(e,t)}`;var _C=class extends ql{};let vC={delegatesFocus:!0,mode:`open`},yC={media:Yae};_C.compose(Object.assign({baseName:`avatar`,template:hC,styles:gC,shadowOptions:vC},yC));let bC=(e,t)=>rr(e,t),xC=(e,t)=>O` ${Jl(e,t)}`;var SC=class extends ir{};let CC={};SC.compose(Object.assign({baseName:`badge`,template:bC,styles:xC,shadowOptions:void 0},CC));let wC=O` @keyframes delete-animate{from{height: 100px;opacity: 100%}to{height: 0;opacity: 0%}}@keyframes append-animate{from{height: 0;opacity: 0%}to{height: var(--banner-height);opacity: 100%}}:host{--banner-width: 100%;--banner-height: 65px;--flow: row}@media screen and (max-width: 640px){:host{--flow: column;--banner-height: 100px}}.banner{animation: append-animate 0.3s linear;width: var(--banner-width);height: var(--banner-height);background-color: var(--fill-color);display: flex;flex-direction: var(--flow);padding: 5px 8px;box-sizing: border-box;overflow: hidden}.banner-delete{animation: delete-animate 0.3s linear;opacity: 0%}.content{display: flex;align-items: center;flex: 2;font-size: 12px;overflow: hidden;white-space: pre-line}.action{display: flex;flex-direction: row-reverse;align-items: center;gap: 10px;flex: 1;overflow: hidden}`,Xae=e=>T`<div role="alert" aria-live="polite" class="banner ${e=>e.dismissAnimation}" ${k(`banner`)}><div part="content" class="content"><slot name="content">${A(e=>e.notification,T`<div><div>${e=>e.notification?.body||`Place holder for notification message`}</div></div>`)}</slot></div><div part="action" class="action"><slot name="action" class="action">${A(e=>e.notification,T`<${e}-button slot="action" appearance="lightweight" @click=${e=>e.dismiss()}>${e=>e.notification?.config?.banner?.dismissingAction?.label||`Ignore`}</${e}-button>`)} ${j(e=>(e.notification?.config)?.banner.confirmingActions,T`<${e}-button slot="action" appearance="lightweight" @click=${(e,t)=>{var n;e?.action(),(n=t.parent)==null||n.dismissNotification()}}>${e=>e.label}</${e}-button>`)}</slot></div></div>`,TC=T` ${e=>Xae(zy(e))} `,EC={mode:`open`,delegatesFocus:!0};var DC=class extends P{constructor(){super(...arguments),this.dismissAnimation=``}connectedCallback(){super.connectedCallback()}dismiss(){return this.dismissAnimation=`banner-delete`,new Promise(e=>{this.banner.onanimationend=()=>{this.remove(),e()}})}dismissNotification(){return J(this,void 0,void 0,function*(){try{yield this.dismiss(),this.remove()}catch(e){Fy.error(e)}})}};q([C],DC.prototype,`dismissAnimation`,void 0),q([C],DC.prototype,`notification`,void 0),DC.compose({baseName:`banner`,styles:wC,template:TC,shadowOptions:EC});let OC=(e,t)=>sr(e,t),kC=(e,t)=>O` ${Xl(e,t)}`;var AC=class extends cr{};AC.compose(Object.assign({baseName:`breadcrumb`,template:OC,styles:kC,shadowOptions:void 0},{}));let jC=(e,t)=>ar(e,t),MC=(e,t)=>O` ${Yl(e,t)}`;var NC=class extends or{};let PC={separator:`/`};NC.compose(Object.assign({baseName:`breadcrumb-item`,template:jC,styles:MC,shadowOptions:void 0},PC));let FC=(e,t)=>lr(e,t),IC=(e,t)=>O` ${Zl(e,t)}`;var LC=class extends Ql{};let RC={delegatesFocus:!0,mode:`open`},zC={};LC.compose(Object.assign({baseName:`button`,template:FC,styles:IC,shadowOptions:RC},zC));let BC=()=>O` ${$l}`,VC=(e,t)=>Ar(e,t);var HC=class extends br{};let UC={delegatesFocus:!0,mode:`open`},WC={};HC.compose(Object.assign({baseName:`calendar`,template:VC,styles:BC,shadowOptions:UC},WC));let GC=(e,t)=>jr(e,t),KC=(e,t)=>O` ${eu(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var qC=class extends tu{};let JC={};qC.compose(Object.assign({baseName:`card`,template:GC,styles:KC,shadowOptions:void 0},JC));var YC;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(YC||(YC={}));var XC=/* @__PURE__ */ u((/* @__PURE__ */ s(((e,t)=>{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(x,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function ee(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function x(){var e=m();if(ee(e))return te(e);s=setTimeout(x,b(e))}function te(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function ne(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function S(){return s===void 0?o:te(m())}function C(){var e=m(),n=ee(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(x,t),_(c)}return s===void 0&&(s=setTimeout(x,t)),o}return C.cancel=ne,C.flush=S,C}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h})))());let ZC=O` :host{--scrollbar-width: 12px;--scrollbar-thumb-width: 8px}.root{position: relative;width: inherit;min-width: 250px}.control{cursor: pointer;position: relative;display: flex;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}#display-field{width: 100%;cursor: pointer;color: var(--neutral-foreground-rest);min-height: 40px;padding: 0 calc(var(--design-unit) * 2.25px);border-width: 0;background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px)}#display-field[disabled]{cursor: not-allowed;opacity: 30%}#display-field:focus{outline: 1px solid var(--accent-fill-rest);background: var(--neutral-fill-input-rest);border-style: none;box-shadow: none}#display-field:hover:not(:focus):not([disabled]){outline: 1px solid var(--neutral-stroke-hover)}button{pointer-events: none}.indicator{position: absolute;left: calc(100% - 26px);padding: 0;cursor: pointer}#arrow-icon{width: 16px;fill: white;transform: rotate(0deg);transition: transform 0.2s linear 0s}#arrow-icon.flipped{transform: rotate(180deg)}.disabled-svg{pointer-events: none;opacity: 30%}.position-above{bottom: 100%}::-webkit-scrollbar{width: var(--scrollbar-width)}::-webkit-scrollbar-track{background: var(--neutral-layer-4)}::-webkit-scrollbar-thumb{width: var(--scrollbar-thumb-width);border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-layer-2);border: 3px solid var(--neutral-layer-4)}::-webkit-scrollbar-corner{background: var(--neutral-layer-4)}.multiselect-dropdown{display: flex;flex-direction: column;position: absolute;height: max-content;overflow: hidden;margin-top: calc(var(--design-unit) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;z-index: 999}.multiselect-dropdown:not(.is-resizing){transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s}.checkbox-container{display: flex;flex-direction: column;list-style: none;overflow-y: auto;height: 100%}.is-resizing .checkbox-container{overflow-y: hidden}.checkbox-container foundation-checkbox[disabled]{cursor: not-allowed}.visible{visibility: visible;max-height: var(--custom-max-height, ${`230`}px);overflow: hidden}::slotted(foundation-checkbox), foundation-checkbox{border-bottom: 1px solid var(--neutral-layer-4);padding: 5px 0 5px 5px;margin: 0}::slotted(foundation-checkbox:hover), foundation-checkbox:hover{background-color: var(--neutral-layer-3);cursor: pointer}::slotted(foundation-checkbox)::part(label), foundation-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}ol, li{margin: 0;padding: 0}.checkbox{width: 100%}.select-all{width: 100%;margin-left: 0;margin-right: 0}.display-value{position: absolute;right: 40px;color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font)}.options-header-item-hidden{display: none}.resize-button{position: absolute;bottom: 0;right: 0;width: 12px;height: 12px;cursor: nw-resize;background: linear-gradient( -45deg, transparent 30%, var(--neutral-foreground-rest) 30%, var(--neutral-foreground-rest) 40%, transparent 40%, transparent 60%, var(--neutral-foreground-rest) 60%, var(--neutral-foreground-rest) 70%, transparent 70% );z-index: 1000;opacity: 60%;transition: opacity 0.2s ease}.resize-button:hover{opacity: 100%}.multiselect-dropdown.resizable{resize: none;overflow: hidden}`;var QC;let $C=QC=class extends Iy{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=QC.defaultPageSize,this.initalSelectedValueInitialized=!1,this.isSnapshot=!0,this.baseCriteria=``,this.listboxElement=null,this.loadingMoreRows=!1,this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.listboxElement||this.attachListboxScrollListener(),this.topUpVisibleListbox())},this.listboxScrollHandler=()=>{let e=this.listboxElement;e&&this.isNearListboxBottom(e)&&this.loadNextPage()},this.resizeObserverCallback=e=>{e.forEach(e=>{this.checkOverflow(e.target)})},this.selectChangeHandler=e=>{let t=e.target.value,n=this.options?.find(e=>String(e.label)===t);!n&&this.allowCustomOptions&&this.select instanceof ou?this.select.$emit(`value-change`,{label:t,value:t}):this.select.$emit(`value-change`,n)}}initialSelectedValueChanged(e,t){if(t!==e){if(!t){this.select&&(this.initalSelectedValueInitialized=!1,this.clearData(),this.resetCombobox(),this.fetchData());return}this.select&&this.getDisplayForValue(t)===String(this.select.value||``)||(this.initalSelectedValueInitialized=!1,this.clearData(),this.fetchData())}}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){if(e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=this.optionElement??`${zy(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:QC.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||Fy.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")`)})}disconnectedCallback(){var e;super.disconnectedCallback(),this.resizeObserver.disconnect(),(e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=null,this.select.removeEventListener(`open-change`,this.selectOpenChangeHandler),this.select.removeEventListener(`change`,this.selectChangeHandler)}applyInfiniteScrollFetchMode(){return J(this,void 0,void 0,function*(){if(this.resourceName&&this.connect.isConnected)try{let e=yield this.resources.getResourceTypeFor(this.resourceName);this.isSnapshot=e!==vg.DATASERVER}catch(e){Fy.warn(`Unable to determine the resource type for ${this.resourceName}`,e)}})}attachListboxScrollListener(){var e;if(this.isConnected){if((e=this.listboxElement)==null||e.removeEventListener(`scroll`,this.listboxScrollHandler),this.listboxElement=this.select?.scrollableListbox??this.select?.listbox??(this.select?.shadowRoot)?.querySelector(`.listbox`),!this.listboxElement){Fy.warn(`Unable to locate listbox element, infinite scroll will not be available.`);return}this.listboxElement.addEventListener(`scroll`,this.listboxScrollHandler)}}isNearListboxBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-QC.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===vg.REQUEST_SERVER;try{yield this.requestMoreRows()}catch{this.loadingMoreRows=!1;return}e&&(this.loadingMoreRows=!1)})}topUpVisibleListbox(){this.infiniteScroll&&requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this.listboxElement;e&&e.clientHeight!==0&&this.isNearListboxBottom(e)&&e.scrollHeight!==this.lastTopUpScrollHeight&&(this.lastTopUpScrollHeight=e.scrollHeight,this.loadNextPage())})}fetchData(){this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof ou&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){if(!(yield this.datasource.init(this.datasourceOptions(),!0))){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}ab(this,this.initialSelectedValue)})}clearData(){this.rowsSyncedWithStream.clear(),this.options=[],this.renderedOptionsCount=0,this.lastTopUpScrollHeight=-1,this.emptyDataOption=null,this.loadingMoreRows=!1,this.select&&(Array.from(this.select.children).forEach(e=>{e instanceof QC||this.select.removeChild(e)}),this.select.value=``,this.select.initialValue=``)}checkOverflow(e){let t=e.shadowRoot.querySelector(`.content`);t&&(t.scrollWidth>t.clientWidth?e.setAttribute(`title`,e.textContent):e.removeAttribute(`title`))}rowToOption(e){return{value:e[this.valueField],label:this.labelRowFormatter?this.labelRowFormatter(e):this.labelFormatter?this.labelFormatter(e[this.labelField]):this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}}renderListboxOptions(e){e.forEach(({value:e,label:t})=>{let n=document.createElement(this.optionElement);n.textContent=t||e,n.value=e,this.select.appendChild(n),this.resizeObserver.observe(n)})}removeEmptyDataOption(){this.emptyDataOption&&(this.emptyDataOption.remove(),this.emptyDataOption=null)}syncComponentData(e){this.loadingMoreRows=!1;let t=e??Array.from(this.rowsSyncedWithStream.values());if(t.length>0){this.removeEmptyDataOption(),this.options=t.map(e=>this.rowToOption(e));let e=this.renderedOptionsCount===0;if(this.renderListboxOptions(this.options.slice(this.renderedOptionsCount)),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox(),!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof ou&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof ou&&!this.select.async)&&(this.resetCombobox(),x.queueUpdate(()=>{this.select.value=String(this.initialSelectedValue)}),this.initalSelectedValueInitialized=!0),this.select&&!this.emptyDataOption){let e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value=``,e.disabled=!0,this.select.appendChild(e),this.emptyDataOption=e}}getInitialLabel(){return this.getDisplayForValue(this.initialSelectedValue)}getDisplayForValue(e){if(e==null||e!==0&&!e)return``;let t=this.options?.find(t=>t.value===e);return this.allowCustomOptions&&this.select instanceof ou?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof ou&&this.select.resetCombobox()}handleStreamInserts(e){if(this.loadingMoreRows=!1,!e?.length)return;this.removeEmptyDataOption();let t=new Set((this.options??[]).map(e=>String(e.value))),n=e.filter(e=>!t.has(String(e[this.valueField])));if(!n.length){Fy.warn(`Infinite scroll for ${this.resourceName} received a page of options that were all already loaded, so paging has stopped. Request Server resources only honour OFFSET when declared with criteriaOnlyRequest; otherwise every page returns the same rows. Also set a stable order-by so pages cannot overlap.`),this.moreRowsAvailable=!1;return}let r=n.map(e=>this.rowToOption(e));this.options=[...this.options??[],...r],this.renderListboxOptions(r),this.renderedOptionsCount=this.options.length,this.nextRequestOffset=Math.max(this.nextRequestOffset,this.renderedOptionsCount),this.topUpVisibleListbox()}handleStreamDeletes(e){Fy.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Fy.debug(`handleStreamUpdates - Method not implemented.`)}};$C.defaultPageSize=20,$C.scrollLoadThresholdPx=32,q([uy],$C.prototype,`resources`,void 0),q([D({attribute:`label-field`})],$C.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],$C.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],$C.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],$C.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],$C.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],$C.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],$C.prototype,`pageSize`,void 0),q([C],$C.prototype,`labelFormatter`,void 0),q([C],$C.prototype,`labelRowFormatter`,void 0),q([C],$C.prototype,`initialSelectedValue`,void 0),$C=QC=q([$e({name:`options-datasource`})],$C);let ew=class extends Iy{constructor(){super(...arguments),this.isSnapshot=!0,this.baseCriteria=``}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.baseCriteria=this.criteria,this.fields=this.labelField?this.valueField?.concat(` `,this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||Fy.warn(`Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")`)})}clearData(){this.select.options=[]}syncComponentData(e){let t=(e??Array.from(this.rowsSyncedWithStream.values())).map(e=>({value:e[this.valueField],label:this.getDefaultLabelFormat(e[this.labelField],this.getFieldMetadata(this.labelField)?.type)}));this.select?.async&&(this.select.loading=!1),this.select.options=t}handleStreamInserts(e){Fy.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){Fy.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){Fy.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],ew.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],ew.prototype,`labelField`,void 0),ew=q([$e({name:`multiselect-datasource`})],ew);let tw=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><div class="root" part="root" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control"><input id="display-field" part="filter-search" role="combobox" aria-haspopup="listbox" aria-controls="checkbox-container" aria-expanded=${e=>e.open?`true`:`false`}tabindex="${e=>e.tabindex}" ?readonly=${e=>!e.search}@click=${e=>e.toggle()}?disabled="${e=>e.disabled}" ${k(`filterSearchInput`)}value=${Ff(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getDisplayValue}" autocomplete="off" @input=${(e,t)=>e.inputHandler()}@change=${(e,t)=>e.changeHandler(t.event)}/><div part="indicator" class="indicator" @click=${e=>!e.disabled&&e.toggle()}><svg viewBox="0 0 12 7" ${k(`arrowIcon`)}id="arrow-icon" class="${e=>dn([`disabled-svg`,e.disabled])}" xmlns="http://www.w3.org/2000/svg"><path d="${`M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z`}" /></svg></div>${A(e=>e.filterSearchValue&&e.selectedOptions.length,T`<div class="display-value">${e=>e.getDisplayValue}</div>`)}</div>${A(e=>e.loading,T`<${e}-progress slot="indicator"></${e}-progress>`)}<section class=${e=>dn(`multiselect-dropdown`,[`resizable`,e.resizable])} ${k(`multiselectDropdown`)}part="multiselect-dropdown">${A(e=>e.resizable,T`<div class="resize-button" @mousedown=${(e,t)=>e.handleResizeStart(t.event)}></div>`)} ${A(e=>e.all,T`<${e}-button class="select-all" @click=${e=>e.selectCheckboxAll()}?disabled="${(e,t)=>e.isAllOptionsDisabled}">${e=>e.areAllOptionsSelected?`Deselect All`:`Select All`} ${e=>e.name}</${e}-button>`)}<ol id="checkbox-container" class="checkbox-container options" aria-multiselectable="true" part="options-ol"><li part="options-header-item" class=${e=>dn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:va})}></slot></li>${j(e=>e.filteredAvailableOptions,T`<li role="option" value=${(e,t)=>t.parent.getItemLabel(e)}part="option"><${e}-checkbox part="checkbox" class="checkbox" exportparts="label:checkbox-label" @keydown=${(e,t)=>t.parent.checkboxKeyDown(e,t.event)}@click=${(e,t)=>t.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parent.isOptionDisabled(e)}">${(e,t)=>{var n;return((n=t.parent)?.itemRenderer)?.call(n,e,t.parent)}}</${e}-checkbox></li>`)}</ol>${A(e=>e.showCreatable,T`<${e}-button @click=${e=>e.addOption()}>Create "${e=>e.filterSearchValue}"</${e}-button>`)}</section></div><slot ${xt({property:`slottedDatasource`,filter:e=>e instanceof ew})}></slot>`,Zae=T` ${tw()} `,nw={};var rw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.resizable=!1,this.filterByContains=!1,this.filterSearchValue=``,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=YC.BELOW,this.itemRenderer=this.defaultItemRenderer,this.initialisedOptions=!1,this.isResizing=!1,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.handleResizeStart=e=>{this.resizable&&this.multiselectDropdown&&(e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.startX=e.clientX,this.startY=e.clientY,this.startWidth=this.multiselectDropdown.offsetWidth,this.startHeight=this.multiselectDropdown.offsetHeight,this.multiselectDropdown.classList.add(`is-resizing`),document.addEventListener(`mousemove`,this.handleResizeMove),document.addEventListener(`mouseup`,this.handleResizeEnd))},this.handleResizeMove=e=>{if(!this.isResizing||!this.multiselectDropdown)return;e.preventDefault();let t=e.clientX-this.startX,n=e.clientY-this.startY,r=Math.max(250,this.startWidth+t),i=Math.max(100,this.startHeight+n);this.multiselectDropdown&&(this.multiselectDropdown.style.width=`${r}px`,this.multiselectDropdown.style.maxHeight=`${i}px`)},this.handleResizeEnd=()=>{this.isResizing=!1,document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd),this.multiselectDropdown&&(this.multiselectDropdown.classList.remove(`is-resizing`),this.multiselectDropdown.style.setProperty(`--custom-max-height`,this.multiselectDropdown.style.maxHeight),this.multiselectDropdown.style.removeProperty(`max-height`))}}debounceChanged(e,t){this.debouncedInputHandler=(0,XC.default)(this.asyncSetFilter,t)}openChanged(e,t){var n,r,i,a;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.arrowIcon)==null||n.classList.add(`flipped`),(r=this.multiselectDropdown)==null||r.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(i=this.arrowIcon)==null||i.classList.remove(`flipped`),(a=this.multiselectDropdown)==null||a.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===YC.ABOVE&&((e=this.multiselectDropdown)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside),document.removeEventListener(`mousemove`,this.handleResizeMove),document.removeEventListener(`mouseup`,this.handleResizeEnd)}defaultItemRenderer(e,t){return T` ${typeof e==`string`?T`<span part="option-label">${()=>t.getItemLabel(e)}</span>`:T`<span data-option-label-text=${()=>e.optionLabelText}style=${()=>e.labelStyle}part="option-label">${()=>t.getItemLabel(e)}</span>`} `}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map(e=>this.optionValueGetter(e))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){if(this.$fastController.isConnected){this.initialisedOptions=!0;return}}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<230&&r>i?YC.ABOVE:YC.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===YC.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===YC.BELOW)}optionValueGetter(e){return typeof e==`string`?e:e.value}optionLabelGetter(e){return typeof e==`string`?e:e.label}getItemLabel(e){let t;return e?(t=typeof e==`string`?e:this.optionLabelGetter(e)||this.optionValueGetter(e)||``,this.valueFormatter?this.valueFormatter(t):t):``}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getDisplayValue(){let e=this.selectedOptions.length;if(e===0)return this.getPlaceholder;if(e===1){let e=this.options.find(e=>this.isOptionSelected(e));if(e)return this.getItemLabel(e);let[t]=this.selectedOptions;return typeof t==`string`?this.getItemLabel(t):`1 Selected`}return e===this.options.length&&this.options.every(e=>this.isOptionSelected(e))?`All ${this.name}`.trim():`${e} Selected`}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get areAllOptionsSelected(){let e=this.options.filter(e=>!this.isOptionDisabled(e));return e.length>0&&e.every(e=>this.isOptionSelected(e))}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&this.findExactMatchOptions().length===0}isOptionSelected(e){let t=this.optionValueGetter(e);return this.selectedOptions.some(n=>{if(typeof e==`object`&&typeof e.value==`object`)try{return JSON.stringify(n)===JSON.stringify(t)}catch{return n===t}return n===t})}selectCheckboxOne(e){let t=this.optionValueGetter(e);this.selectedOptions=this.selectedOptions.includes(t)?this.selectedOptions.filter(e=>e!==t):[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}checkboxKeyDown(e,t){return t.key===` `&&(t.preventDefault(),this.selectCheckboxOne(e)),!0}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){let e=this.areAllOptionsSelected;this.selectedOptions=e?[]:this.options.filter(e=>!this.isOptionDisabled(e)).map(e=>this.optionValueGetter(e)),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit(`selectionChange`,this.selectedOptions)}inputHandler(){this.open||(this.open=!0),this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){let e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter(t=>((typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t))?.toLowerCase()??``)===e)}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label.toLowerCase(),r=typeof t.value==`object`?(t=>Object.values(t).some(t=>t.toLowerCase().includes(e)))(t.value):String(t.value).toLowerCase().includes(e);return n.includes(e)||r})}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){this.slottedDatasource.length>0?ib(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,Fy.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Escape`:if(this.open){this.open=!1;break}break;case`ArrowUp`:case`ArrowDown`:if(!this.open){this.open=!0;break}break;default:return!0}}clear(e={}){let{clearSelectedValues:t=!0,clearFilterText:n=!0}=e;t&&(this.selectedOptions=[],this.$emit(`selectionChange`,this.selectedOptions)),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],rw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],rw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],rw.prototype,`all`,void 0),q([D({mode:`boolean`})],rw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],rw.prototype,`search`,void 0),q([D({mode:`boolean`})],rw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],rw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],rw.prototype,`async`,void 0),q([D],rw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],rw.prototype,`resizable`,void 0),q([D],rw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],rw.prototype,`filterByContains`,void 0),q([C],rw.prototype,`defaultSlottedNodes`,void 0),q([C],rw.prototype,`slottedDatasource`,void 0),q([C],rw.prototype,`valueFormatter`,void 0),q([C],rw.prototype,`loading`,void 0),q([C],rw.prototype,`filterSearchValue`,void 0),q([C],rw.prototype,`open`,void 0),q([C],rw.prototype,`options`,void 0),q([C],rw.prototype,`selectedOptions`,void 0),q([C],rw.prototype,`filteredAvailableOptions`,void 0),q([C],rw.prototype,`scrollContainer`,void 0),q([D],rw.prototype,`position`,void 0),q([C],rw.prototype,`onAllSelectedCallback`,void 0),q([C],rw.prototype,`itemRenderer`,void 0),q([w],rw.prototype,`getDisplayValue`,null),q([w],rw.prototype,`getPlaceholder`,null),q([w],rw.prototype,`isAllOptionsDisabled`,null),q([w],rw.prototype,`areAllOptionsSelected`,null),q([w],rw.prototype,`showCreatable`,null),q([C],rw.prototype,`optionsHeaderSlottedNodes`,void 0),rw.compose(Object.assign({baseName:`multiselect`,template:Zae,styles:ZC,shadowOptions:void 0},nw));let iw=O` .root{position: relative;width: 100%;min-width: 250px}.control-button{display: flex;justify-content: center;min-width: 31px;width: 31px;height: 31px;margin-left: calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}.control{cursor: pointer;position: relative;display: flex;justify-content: end;align-items: center;width: 100%;border-radius: calc(var(--control-corner-radius) * 1px)}.label{display: block;cursor: pointer;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{display: none}.control:hover .control-button, .control:hover .label{color: var(--neutral-foreground-rest)}button{pointer-events: none}.options{display: flex;flex-direction: column;position: absolute;height: max-content;overflow-y: hidden;margin-top: 5px;padding: calc((var(--design-unit) + 3) * 2px) calc((var(--design-unit) + 3) * 1px);border: 1px solid rgba(46 51 57 / 100%);border-radius: 4px;background: var(--neutral-fill-input-rest);width: 100%;max-height: 0;visibility: hidden;transition: max-height 0.4s ease 0s, visibility 0.4s ease 0s;z-index: 999}.option-content{display: flex;align-items: center;gap: calc(var(--design-unit) * 4px);width: 100%}.icon-container{display: flex;align-items: center;justify-content: center;width: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px + 4px );height: calc( ((var(--base-height-multiplier) * var(--design-unit)) + (var(--design-unit) * 2)) * 1px );border-radius: calc((var(--control-corner-radius) - 1) * 2px);background: var(--neutral-layer-2);box-sizing: border-box;box-shadow: 0 0 5px 0 rgba(0 0 0 / 35%);flex-shrink: 0}.text-content{display: flex;flex-direction: column;flex: 1}.svg-icon{height: 2em}.position-above{bottom: 100%}.checkbox-container{display: flex;flex-direction: column;overflow-y: scroll;scrollbar-width: thin;scrollbar-color: rgb(46 48 53) rgb(31 33 38)}span{border-bottom: calc(var(--stroke-width) * 1px) solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 2) * 2px) calc((var(--design-unit) + 3) * 1px);font-size: calc((var(--type-ramp-base-font-size) - 1px));color: var(--neutral-foreground-hint)}.multiselect-checkbox{min-width: fit-content;flex-direction: row-reverse;justify-content: space-between;align-items: flex-start;border-bottom: 1px solid;border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);padding: calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px) 0;margin: 0}.multiselect-checkbox:hover{background-color: rgb(45 47 51);cursor: pointer}.multiselect-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis}.multiselect-checkbox::part(control){min-width: calc( ((var(--base-height-multiplier) + var(--density)) * var(--design-unit) / 2 + var(--design-unit)) * 1px )}.checkbox-container .multiselect-checkbox[disabled]{cursor: not-allowed}.description{text-wrap: wrap;font-size: calc((var(--type-ramp-base-font-size) - 1px));margin: calc((var(--design-unit) + 3) * 1px) 0}#filter-search{padding: 5px}::-webkit-scrollbar{width: 12px}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: rgb(46 48 53);border: 3px solid rgb(31 33 38)}.visible{visibility: visible;max-height: ${`450`}px}`,aw=(e=`foundation`)=>T`<div class="root" part="root"><div class="control" part="control" @click=${e=>!e.disabled&&e.toggle()}><label part="label" for="control" class=${e=>dn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:va})}></slot></label><${e}-button class="control-button" part="control-button"><slot name="button-content"><${e}-icon name="plus" variant="solid" size="lg"></${e}-icon></slot></${e}-button></div><div ${k(`optionsElement`)}class="options" part="options">${A(e=>e.search,T`<${e}-text-field id="filter-search" part="filter-search" value=${Ff(e=>e.filterSearchValue,`string`,`input`)}placeholder="${e=>e.getPlaceholder}" @input=${(e,t)=>e.setFilter()}@change=${(e,t)=>e.changeHandler(t.event)}></${e}-text-field>`)}<div class="checkbox-container" part="checkbox-container">${j(e=>e.filteredAvailableOptions,T`<span>${e=>e.type}</span>${j(e=>e.options,T`<${e}-checkbox class="multiselect-checkbox" part="multiselect-checkbox" @click=${(e,t)=>t.parentContext.parent.selectCheckboxOne(e)}@change=${(e,t)=>t.parentContext.parent.changeHandler(t.event)}?current-checked="${(e,t)=>t.parentContext.parent.isOptionSelected(e)}" ?disabled="${(e,t)=>t.parentContext.parent.isOptionDisabled(e)}"><div class="option-content">${A(e=>e.icon||e.svg,T`<div class="icon-container">${A(e=>e.icon,T`<${e}-icon style="color:${e=>e.iconColor||`#fff`}" name="${e=>e.icon}" size="xl"></${e}-icon>`)} ${A(e=>e.svg,T`<img class="svg-icon" src="${e=>e.svg}" alt="${e=>e.label}" />`)}</div>`)}<div class="text-content"><div class="option-label">${(e,t)=>t.parentContext.parent.getItemLabel(e)}</div>${A(e=>e.description,T`<p class="description">${e=>e.description}</p>`)}</div></div></${e}-checkbox>`)} `)}</div></div></div>`,Qae=T` ${aw()} `,ow={};var sw=class extends P{constructor(){super(...arguments),this.name=``,this.autoPosition=!0,this.search=!0,this.disabled=!1,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.position=YC.BELOW}openChanged(e,t){var n,r;t?(document.addEventListener(`mousedown`,this.clickOutside),(n=this.optionsElement)==null||n.classList.add(`visible`)):(document.removeEventListener(`mousedown`,this.clickOutside),(r=this.optionsElement)==null||r.classList.remove(`visible`))}connectedCallback(){var e;super.connectedCallback(),this.position===YC.ABOVE&&((e=this.optionsElement)==null||e.classList.add(`position-above`))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`mousedown`,this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}sortFilteredOptions(e){let t=(e??this.options).reduce((e,t)=>{let n=t.type||`Other`;return e[n]?e[n].options.push(t):e[n]={type:n,options:[t]},e},{});return Object.values(t)}optionsChanged(){this.filteredAvailableOptions=this.sortFilteredOptions()}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains(`content-wrapper`);)t=t.parentElement;if(t){let n=t.getBoundingClientRect(),r=this.getBoundingClientRect(),i=n.top+n.height/2;e=r.top<i?YC.BELOW:YC.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?YC.ABOVE:YC.BELOW}}e===YC.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===YC.BELOW&&(this.optionsElement.classList.add(`position-below`),this.optionsElement.classList.remove(`position-above`))}optionGetter(e){return e.value}getItemLabel(e){let t;if(e)t=e.label||e.value||``;else return``;return this.valueFormatter?this.valueFormatter(t):t}isOptionDisabled(e){return!e||typeof e==`string`?!1:e.disabled||!1}get getPlaceholder(){return`Search ${this.name}`.trim().concat(`...`)}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){let t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit(`selectionChange`,this.selectedOptions)}setFilter(){let e=this.options.filter(e=>{let t=e.description,n=e.label??e.value;if(t?.toLowerCase().includes(this.filterSearchValue.toLowerCase())||n.toLowerCase().includes(this.filterSearchValue.toLowerCase()))return e});this.filteredAvailableOptions=this.sortFilteredOptions(e)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){Ly(e,this)&&(this.open=!1)}};q([D],sw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],sw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],sw.prototype,`search`,void 0),q([D({mode:`boolean`})],sw.prototype,`disabled`,void 0),q([C],sw.prototype,`defaultSlottedNodes`,void 0),q([C],sw.prototype,`valueFormatter`,void 0),q([C],sw.prototype,`filterSearchValue`,void 0),q([C],sw.prototype,`open`,void 0),q([C],sw.prototype,`options`,void 0),q([C],sw.prototype,`selectedOptions`,void 0),q([C],sw.prototype,`filteredAvailableOptions`,void 0),q([C],sw.prototype,`position`,void 0),q([w],sw.prototype,`getPlaceholder`,null),sw.compose(Object.assign({baseName:`categorized-multiselect`,template:Qae,styles:iw,shadowOptions:void 0},ow));let cw=(e,t)=>Nr(e,t),lw=(e,t)=>O` ${nu(e,t)}`;var uw=class extends Pr{};let dw={checkedIndicator:`
|
|
254
254
|
<svg
|
|
255
255
|
aria-hidden="true"
|
|
256
256
|
part="checked-indicator"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-rapid-cdn",
|
|
3
3
|
"description": "Side-effecting CDN bundle that auto-registers the Rapid Design System. Intended for AI/prototyping tools (e.g. Claude Artifacts), not for production apps.",
|
|
4
|
-
"version": "15.79.
|
|
4
|
+
"version": "15.79.2",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"unpkg": "dist/foundation-rapid-cdn.iife.min.js",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@babel/generator": "^7.29.0",
|
|
25
25
|
"@babel/parser": "^7.29.0",
|
|
26
26
|
"@babel/traverse": "^7.29.0",
|
|
27
|
-
"@genesislcap/genx": "15.79.
|
|
27
|
+
"@genesislcap/genx": "15.79.2",
|
|
28
28
|
"rolldown": "~1.2.9"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@genesislcap/rapid-design-system": "15.79.
|
|
31
|
+
"@genesislcap/rapid-design-system": "15.79.2"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|