@genesislcap/foundation-rapid-cdn 15.110.2 → 15.110.4
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.
|
@@ -223,7 +223,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
223
223
|
`:`,`;var o=JSON.stringify(n);u+=i?s+o+`: `:o+`:`,u+=a(r,s)}}),u+=i?`
|
|
224
224
|
`+r+`}`:`}`,u}function c(e,t){return t!==void 0&&typeof t!=`function`&&Yp(t)!==`symbol`}}function Dre(e){if(typeof e==`number`)return` `.repeat(e);if(typeof e==`string`&&e!==``)return e}let Ore=N.createInterface();function kre(e){return Number.isSafeInteger(+e)?Number(e):Hf(e)?BigInt.asIntN(64,e):parseFloat(e)}let Are={parse:e=>Sp(e,null,kre),stringify:e=>Xp(e)},Zp=class{constructor(e=Are){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?typeof e==`string`?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};Zp=q([id(0,Lt(Ore))],Zp);let Qp=N.createInterface(e=>e.singleton(Zp));function $p(e){return typeof e==`function`}function em(e){var t=e(function(e){Error.call(e),e.stack=(/* @__PURE__ */ Error()).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var tm=em(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
225
225
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
226
|
-
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function nm(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var rm=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=od(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if($p(c))try{c()}catch(e){i=e instanceof tm?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=od(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{om(f)}catch(e){i=i??[],e instanceof tm?i=cd(cd([],sd(i)),sd(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new tm(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)om(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&nm(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&nm(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),im=rm.EMPTY;function am(e){return e instanceof rm||e&&`closed`in e&&$p(e.remove)&&$p(e.add)&&$p(e.unsubscribe)}function om(e){$p(e)?e():e.unsubscribe()}var sm={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},cm={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=cm.delegate;return i?.setTimeout?i.setTimeout.apply(i,cd([e,t],sd(n))):setTimeout.apply(void 0,cd([e,t],sd(n)))},clearTimeout:function(e){return(cm.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function lm(e){cm.setTimeout(function(){var t=sm.onUnhandledError;if(t)t(e);else throw e})}function um(){}var jre=(function(){return dm(`C`,void 0,void 0)})();function Mre(e){return dm(`E`,void 0,e)}function Nre(e){return dm(`N`,e,void 0)}function dm(e,t,n){return{kind:e,value:t,error:n}}var fm=null;function pm(e){if(sm.useDeprecatedSynchronousErrorHandling){var t=!fm;if(t&&(fm={errorThrown:!1,error:null}),e(),t){var n=fm,r=n.errorThrown,i=n.error;if(fm=null,r)throw i}}else e()}function Pre(e){sm.useDeprecatedSynchronousErrorHandling&&fm&&(fm.errorThrown=!0,fm.error=e)}var mm=function(e){td(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,am(t)&&t.add(n)):n.destination=Rre,n}return t.create=function(e,t,n){return new gm(e,t,n)},t.prototype.next=function(e){this.isStopped?vm(Nre(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?vm(Mre(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?vm(jre,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(rm),Fre=Function.prototype.bind;function hm(e,t){return Fre.call(e,t)}var Ire=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){_m(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){_m(e)}else _m(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){_m(e)}},e}(),gm=function(e){td(t,e);function t(t,n,r){var i=e.call(this)||this,a;if($p(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&sm.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&hm(t.next,o),error:t.error&&hm(t.error,o),complete:t.complete&&hm(t.complete,o)}):a=t}return i.destination=new Ire(a),i}return t}(mm);function _m(e){sm.useDeprecatedSynchronousErrorHandling?Pre(e):lm(e)}function Lre(e){throw e}function vm(e,t){var n=sm.onStoppedNotification;n&&cm.setTimeout(function(){return n(e,t)})}var Rre={closed:!0,next:um,error:Lre,complete:um},ym=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function bm(e){return e}function zre(e){return e.length===0?bm:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var xm=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Vre(e)?e:new gm(e,t,n);return pm(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Sm(t),new t(function(t,r){var i=new gm({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[ym]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zre(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=Sm(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Sm(e){return e??sm.Promise??Promise}function Bre(e){return e&&$p(e.next)&&$p(e.error)&&$p(e.complete)}function Vre(e){return e&&e instanceof mm||Bre(e)&&am(e)}function Cm(e){return $p(e?.lift)}function wm(e){return function(t){if(Cm(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Tm(e,t,n,r,i){return new Hre(e,t,n,r,i)}var Hre=function(e){td(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(mm);function Ure(){return wm(function(e,t){var n=null;e._refCount++;var r=Tm(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){n=null;return}var r=e._connection,i=n;n=null,r&&(!i||r===i)&&r.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}(function(e){td(t,e);function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Cm(t)&&(r.lift=t.lift),r}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new rm;var n=this.getSubject();t.add(this.source.subscribe(Tm(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=rm.EMPTY)}return t},t.prototype.refCount=function(){return Ure()(this)},t})(xm);var Em={now:function(){return(Em.delegate||performance).now()},delegate:void 0},Dm={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=Dm.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(t){n=void 0,e(t)});return new rm(function(){return n?.(i)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Dm.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,cd([],sd(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Dm.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,cd([],sd(e)))},delegate:void 0};function Wre(e){return new xm(function(t){var n=e||Em,r=n.now(),i=0,a=function(){t.closed||(i=Dm.requestAnimationFrame(function(o){i=0;var s=n.now();t.next({timestamp:e?s:o,elapsed:s-r}),a()}))};return a(),function(){i&&Dm.cancelAnimationFrame(i)}})}Wre();var Gre=em(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Om=function(e){td(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new km(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Gre},t.prototype.next=function(e){var t=this;pm(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=od(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;pm(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;pm(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?im:(this.currentObservers=null,a.push(e),new rm(function(){t.currentObservers=null,nm(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new xm;return e.source=this,e},t.create=function(e,t){return new km(e,t)},t}(xm),km=function(e){td(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??im},t}(Om),Am=function(e){td(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Om),jm={now:function(){return(jm.delegate||Date).now()},delegate:void 0},Mm=function(e){td(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=jm);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(Om);(function(e){td(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},t})(Om);var Kre=function(e){td(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(rm),Nm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Nm.delegate;return i?.setInterval?i.setInterval.apply(i,cd([e,t],sd(n))):setInterval.apply(void 0,cd([e,t],sd(n)))},clearInterval:function(e){return(Nm.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Pm=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),Nm.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&Nm.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return/* @__PURE__ */ Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||/* @__PURE__ */ Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nm(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Kre),qre=1,Fm,Im={};function Lm(e){return e in Im&&(delete Im[e],!0)}var Rm={setImmediate:function(e){var t=qre++;return Im[t]=!0,Fm||(Fm=Promise.resolve()),Fm.then(function(){return Lm(t)&&e()}),t},clearImmediate:function(e){Lm(e)}},Jre=Rm.setImmediate,Yre=Rm.clearImmediate,zm={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(zm.delegate?.setImmediate||Jre).apply(void 0,cd([],sd(e)))},clearImmediate:function(e){return(zm.delegate?.clearImmediate||Yre)(e)},delegate:void 0},Xre=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=zm.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&i[i.length-1]?.id!==n&&(zm.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(Pm),Bm=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=jm.now,e}(),Vm=function(e){td(t,e);function t(t,n){n===void 0&&(n=Bm.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(Bm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Vm))(Xre);var Hm=new Vm(Pm),Zre=Hm,Qre=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(Pm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Vm))(Qre);var $re=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Dm.requestAnimationFrame(function(){return t.flush(void 0)})))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&n===t._scheduled&&i[i.length-1]?.id!==n&&(Dm.cancelAnimationFrame(n),t._scheduled=void 0)},t}(Pm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Vm))($re),function(e){td(t,e);function t(t,n){t===void 0&&(t=eie),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},t.frameTimeFactor=10,t}(Vm);var eie=function(e){td(t,e);function t(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t.prototype.schedule=function(n,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return rm.EMPTY},t.prototype.requestAsyncId=function(e,n,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},t.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Pm),Um=new xm(function(e){return e.complete()});function Wm(e){return e&&$p(e.schedule)}function Gm(e){return e[e.length-1]}function tie(e){return $p(Gm(e))?e.pop():void 0}function Km(e){return Wm(Gm(e))?e.pop():void 0}var qm=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Jm(e){return $p(e?.then)}function Ym(e){return $p(e[ym])}function Xm(e){return Symbol.asyncIterator&&$p(e?.[Symbol.asyncIterator])}function Zm(e){return/* @__PURE__ */ TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function nie(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Qm=nie();function $m(e){return $p(e?.[Qm])}function eh(e){return Jne(this,arguments,function(){var t,n,r,i;return ad(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ld(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,ld(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ld(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function th(e){return $p(e?.getReader)}function nh(e){if(e instanceof xm)return e;if(e!=null){if(Ym(e))return rie(e);if(qm(e))return iie(e);if(Jm(e))return aie(e);if(Xm(e))return rh(e);if($m(e))return oie(e);if(th(e))return sie(e)}throw Zm(e)}function rie(e){return new xm(function(t){var n=e[ym]();if($p(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function iie(e){return new xm(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function aie(e){return new xm(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,lm)})}function oie(e){return new xm(function(t){var n,r;try{for(var i=od(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function rh(e){return new xm(function(t){cie(e,t).catch(function(e){return t.error(e)})})}function sie(e){return rh(eh(e))}function cie(e,t){var n,r,i,a;return J(this,void 0,void 0,function(){var o,s;return ad(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Yne(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ih(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ah(e,t){return t===void 0&&(t=0),wm(function(n,r){n.subscribe(Tm(r,function(n){return ih(r,e,function(){return r.next(n)},t)},function(){return ih(r,e,function(){return r.complete()},t)},function(n){return ih(r,e,function(){return r.error(n)},t)}))})}function oh(e,t){return t===void 0&&(t=0),wm(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function lie(e,t){return nh(e).pipe(oh(t),ah(t))}function uie(e,t){return nh(e).pipe(oh(t),ah(t))}function die(e,t){return new xm(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function fie(e,t){return new xm(function(n){var r;return ih(n,t,function(){r=e[Qm](),ih(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return $p(r?.return)&&r.return()}})}function sh(e,t){if(!e)throw Error(`Iterable cannot be null`);return new xm(function(n){ih(n,t,function(){var r=e[Symbol.asyncIterator]();ih(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function pie(e,t){return sh(eh(e),t)}function mie(e,t){if(e!=null){if(Ym(e))return lie(e,t);if(qm(e))return die(e,t);if(Jm(e))return uie(e,t);if(Xm(e))return sh(e,t);if($m(e))return fie(e,t);if(th(e))return pie(e,t)}throw Zm(e)}function ch(e,t){return t?mie(e,t):nh(e)}function lh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ch(e,Km(e))}function uh(e,t){var n=$p(e)?e:function(){return e},r=function(e){return e.error(n())};return new xm(t?function(e){return t.schedule(r,0,e)}:r)}var dh;(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(dh||(dh={})),function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return hie(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return $p(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i=t===`N`?lh(n):t===`E`?uh(function(){return r}):t===`C`?Um:0;if(!i)throw TypeError(`Unexpected notification kind `+t);return i},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e}();function hie(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}var gie=em(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function _ie(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new gm({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new gie)}});e.subscribe(a)})}em(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}}),em(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}}),em(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}});function vie(e){return e instanceof Date&&!isNaN(e)}em(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function fh(e,t){return wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){r.next(e.call(t,n,i++))}))})}var yie=Array.isArray;function bie(e,t){return yie(t)?e.apply(void 0,cd([],sd(t))):e(t)}function xie(e){return fh(function(t){return bie(e,t)})}var Sie=Array.isArray,Cie=Object.getPrototypeOf,wie=Object.prototype,Tie=Object.keys;function Eie(e){if(e.length===1){var t=e[0];if(Sie(t))return{args:t,keys:null};if(Die(t)){var n=Tie(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function Die(e){return e&&typeof e==`object`&&Cie(e)===wie}function Oie(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function kie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Km(e),r=tie(e),i=Eie(e),a=i.args,o=i.keys;if(a.length===0)return ch([],n);var s=new xm(Aie(a,n,o?function(e){return Oie(o,e)}:bm));return r?s.pipe(xie(r)):s}function Aie(e,t,n){return n===void 0&&(n=bm),function(r){ph(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){ph(t,function(){var c=ch(e[i],t),l=!1;c.subscribe(Tm(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function ph(e,t,n){e?ih(n,e,t):t()}function jie(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;nh(n(e,u++)).subscribe(Tm(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?ih(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(Tm(t,p,function(){d=!0,f()})),function(){s?.()}}function mh(e,t,n){return n===void 0&&(n=1/0),$p(t)?mh(function(n,r){return fh(function(e,i){return t(n,e,r,i)})(nh(e(n,r)))},n):(typeof t==`number`&&(n=t),wm(function(t,r){return jie(t,r,e,n)}))}function Mie(e){return e===void 0&&(e=1/0),mh(bm,e)}function Nie(){return Mie(1)}function hh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Nie()(ch(e,Km(e)))}function gh(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Zre);var r=-1;return t!=null&&(Wm(t)?n=t:r=t),new xm(function(t){var i=vie(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function Pie(e,t){return e===void 0&&(e=0),t===void 0&&(t=Hm),e<0&&(e=0),gh(e,e,t)}new xm(um),Array.isArray;function _h(e,t){return wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Fie(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(Tm(o,function(t){var n=l++;c=s?e(c,t,n):(s=!0,t),r&&o.next(c)},i&&(function(){s&&o.next(c),o.complete()})))}}function vh(e,t){return t?function(n){return n.pipe(vh(function(n,r){return nh(e(n,r)).pipe(fh(function(e,i){return t(n,e,r,i)}))}))}:wm(function(t,n){var r=0,i=null,a=!1;t.subscribe(Tm(n,function(t){i||(i=Tm(n,void 0,function(){i=null,a&&n.complete()}),nh(e(t,r++)).subscribe(i))},function(){a=!0,!i&&n.complete()}))})}function yh(e){return wm(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function Iie(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?bm:wm(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(Tm(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?gh(i):nh(i(e,n)),u=Tm(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function bh(e,t){return wm(Fie(e,t,arguments.length>=2,!0))}function xh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Km(e);return wm(function(t,r){(n?hh(e,t,n):hh(e,t)).subscribe(r)})}function Sh(e,t){return wm(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(Tm(r,function(n){i?.unsubscribe();var o=0,c=a++;nh(e(n,c)).subscribe(i=Tm(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Ch(e,t){return t===void 0&&(t=!1),wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}))})}var Lie=class{static get isMacOS(){return navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.toLowerCase().includes(`mac os`)}static get isWindows(){return navigator.platform.toLowerCase().includes(`win`)||navigator.userAgent.toLowerCase().includes(`windows`)}static get isLinux(){return navigator.platform.toLowerCase().includes(`linux`)||navigator.userAgent.toLowerCase().includes(`linux`)}static getModifierSymbols(){return this.isMacOS?{ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`}:{ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`,meta:`Win`}}static formatKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.getModifierSymbols(),o=[];t&&o.push(a.ctrl),n&&o.push(a.alt),r&&o.push(a.shift),i&&o.push(a.meta);let s=this.isMacOS?``:`+`,c=this.isMacOS?e.toUpperCase():e;return o.length>0?`${o.join(s)}${s}${c}`:c}};let wh=`foundation-shortcut-blocked`,Th=`Shortcut blocked`,Eh=`This shortcut is currently unavailable in this context.`;function Dh(e,t){let n=Object.assign(Object.assign({},e),{blockedMessage:e.blockedMessage??{title:Th,text:Eh}});t&&typeof t.dispatchEvent==`function`?t.dispatchEvent(new CustomEvent(wh,{bubbles:!0,composed:!0,detail:n})):typeof document<`u`&&document.dispatchEvent(new CustomEvent(wh,{bubbles:!0,composed:!0,detail:n}))}let Oh={designSystems:[`rapid`],customEditableSelectors:[]},kh={defaultMessage:{title:Th,text:Eh},inputMessage:{title:Th,text:`This shortcut is unavailable while typing in an input field.`},pausedMessage:{title:Th,text:`Shortcuts are paused.`},elementFocusMessage:{title:Th,text:`This shortcut is unavailable in the current focus context.`},emitPausedBlockedEvent:!0};var Rie=class{constructor(){this.shortcuts=/* @__PURE__ */ new Map,this.shortcutLookup=/* @__PURE__ */ new Map,this.keyCombinationMap=/* @__PURE__ */ new Map,this._isPausedSubject=new Am(!1),this.executionGuards=/* @__PURE__ */ new Map,this.editableContextConfig=Object.assign({},Oh),this.editableSelector=Jd(Oh.designSystems,Oh.customEditableSelectors),this.blockedMessageConfig=Object.assign({},kh)}get isPaused(){return this._isPausedSubject.value}get isPaused$(){return this._isPausedSubject.asObservable()}get isPausedSubject(){return this._isPausedSubject}registerShortcuts(e){e.forEach(e=>{this.registerShortcut(e)})}registerShortcut(e){let t=`${e.context}:${e.id}`,n=this.normalizeShortcutDefinition(e),r=this.createKeyCombinationKey(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),i=Lie.formatKeyCombination(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),a=this.keyCombinationMap.get(r);if(a){let e=[];for(let t of a){let i=this.shortcutLookup.get(t);i&&i.context===n.context&&(Id.warn(`Shortcut with key combination '${r}' already exists in context '${n.context}' (id: '${i.id}'). It will be replaced by new shortcut '${n.id}'.`),e.push(t))}e.forEach(e=>{let t=this.shortcutLookup.get(e);if(t){let n=this.shortcuts.get(t.context);n&&(n.delete(t.id),n.size===0&&this.shortcuts.delete(t.context)),this.shortcutLookup.delete(e)}a.delete(e)}),a.size===0&&this.keyCombinationMap.delete(r)}return this.shortcuts.has(n.context)||this.shortcuts.set(n.context,/* @__PURE__ */ new Map),this.shortcuts.get(n.context).set(n.id,n),this.shortcutLookup.set(t,n),this.keyCombinationMap.has(r)||this.keyCombinationMap.set(r,/* @__PURE__ */ new Set),this.keyCombinationMap.get(r).add(t),{shortcut:n,id:n.id,keyCombination:r,keyCombinationDisplay:i,disabled:()=>this.getExecutionStatus(n).disabled||!1,tooltip:()=>this.getExecutionStatus(n).tooltip}}unregisterShortcut(e,t){let n=`${e}:${t}`,r=this.shortcuts.get(e);if(r){let i=r.get(t);if(i){let a=this.normalizeShortcutDefinition(i),o=this.createKeyCombinationKey(a.key,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey);r.delete(t),r.size===0&&this.shortcuts.delete(e),this.shortcutLookup.delete(n);let s=this.keyCombinationMap.get(o);s&&(s.delete(n),s.size===0&&this.keyCombinationMap.delete(o))}}}unregisterShortcutsByContext(e){let t=this.shortcuts.get(e);t&&Array.from(t.keys()).forEach(t=>this.unregisterShortcut(e,t))}executeShortcut(e,t){this.executeShortcutByContext(this.getActiveContext(),e,t)}shouldEmitBlockedEvent(e){return e?.emitBlockedEvent!==!1}resolveBlockedMessage(e,t){return e?.blockedMessage??t}executeShortcutByContext(e,t,n){let r=this.shortcuts.get(e)?.get(t);if(this.isPaused){this.blockedMessageConfig.emitPausedBlockedEvent&&this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`paused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.pausedMessage)},n);return}if(r){if(r.elementRef&&!this.isElementFocused(r.elementRef)){this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`element-not-focused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.elementFocusMessage)},n);return}let i=this.getExecutionStatus(r);if(i.disabled){this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`disabled`,blockedMessage:this.resolveBlockedMessage(r,i.tooltip===void 0?this.blockedMessageConfig.defaultMessage:{title:this.blockedMessageConfig.defaultMessage.title,text:i.tooltip})},n);return}try{r.action()}catch(n){Id.error(`Error executing shortcut ${e}:${t}:`,n)}}}getShortcuts(){let e=[];for(let t of this.shortcuts.values())e.push(...t.values());return e}getShortcutsByContext(e){let t=this.shortcuts.get(e);return t?Array.from(t.values()):[]}findShortcutByKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.createKeyCombinationKey(e,t,n,r,i),o=this.keyCombinationMap.get(a);if(o){if(this._activeContext){let e=this.shortcuts.get(this._activeContext);if(e)for(let t of o){let[n,r]=t.split(`:`);if(n!==this._activeContext)continue;let i=e.get(r);if(i)return i}}for(let e of o){let t=this.shortcutLookup.get(e);if(t)return t}}}getContexts(){return Array.from(this.shortcuts.keys())}getShortcutsByContextMap(){return new Map(this.shortcuts)}registerContext(e){this.shortcuts.has(e)||this.shortcuts.set(e,/* @__PURE__ */ new Map)}setActiveContext(e){this.registerContext(e),this._activeContext=e}getActiveContext(){return this._activeContext}clearActiveContext(){this._activeContext=void 0}registerExecutionGuard(e,t){this.executionGuards.set(e,t)}unregisterExecutionGuard(e){this.executionGuards.delete(e)}clearExecutionGuards(){this.executionGuards.clear()}configureEditableContext(e={}){let t=(e.designSystems??Oh.designSystems).filter(e=>e===`rapid`),n=(e.customEditableSelectors??Oh.customEditableSelectors).map(e=>e?.trim()).filter(e=>!!e);this.editableContextConfig={designSystems:Array.from(new Set(e.designSystems===void 0?Oh.designSystems:t)),customEditableSelectors:Array.from(new Set(n))},this.refreshEditableSelector()}getEditableContextConfig(){return{designSystems:[...this.editableContextConfig.designSystems],customEditableSelectors:[...this.editableContextConfig.customEditableSelectors]}}getEditableSelector(){return this.editableSelector}configureBlockedMessages(e={}){let t=(e,t)=>({title:(e?.title)?.trim()??t.title,text:(e?.text)?.trim()??t.text});this.blockedMessageConfig={defaultMessage:t(e.defaultMessage,kh.defaultMessage),inputMessage:t(e.inputMessage,kh.inputMessage),pausedMessage:t(e.pausedMessage,kh.pausedMessage),elementFocusMessage:t(e.elementFocusMessage,kh.elementFocusMessage),emitPausedBlockedEvent:e.emitPausedBlockedEvent??kh.emitPausedBlockedEvent}}getBlockedMessages(){return Object.assign({},this.blockedMessageConfig)}pause(){this._isPausedSubject.next(!0)}resume(){this._isPausedSubject.next(!1)}normalizeShortcutDefinition(e){let t=Object.assign({},e);return(t.optionKey||t.altKey)&&(t.altKey=!0,t.optionKey=!0),t}createKeyCombinationKey(e,t=!1,n=!1,r=!1,i=!1){let a=[];return t&&a.push(`ctrl`),n&&a.push(`alt`),r&&a.push(`shift`),i&&a.push(`meta`),(a.length>0?`${a.join(`+`)}+${e}`:e).toLowerCase()}isElementFocused(e){return e instanceof HTMLElement&&document.activeElement===e}getExecutionStatus(e){if(this.isPaused)return{disabled:!0,tooltip:this.blockedMessageConfig.pausedMessage.text};let t=this.getExecutionGuardStatus();return t.disabled?t:e.canExecute?e.canExecute():{disabled:!1,tooltip:void 0}}getExecutionGuardStatus(){for(let e of this.executionGuards.values()){let t=e(),n=typeof t==`boolean`?{disabled:t}:t;if(n?.disabled)return{disabled:!0,tooltip:n.tooltip}}return{disabled:!1,tooltip:void 0}}refreshEditableSelector(){this.editableSelector=Jd(this.editableContextConfig.designSystems,this.editableContextConfig.customEditableSelectors)}};let zie=N.createInterface(e=>e.singleton(Rie)),Bie={Space:`space`,Enter:`enter`,Escape:`escape`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,F1:`f1`,F2:`f2`,F3:`f3`,F4:`f4`,F5:`f5`,F6:`f6`,F7:`f7`,F8:`f8`,F9:`f9`,F10:`f10`,F11:`f11`,F12:`f12`};function Vie(e){return e?e.startsWith(`Key`)?e.replace(`Key`,``).toLowerCase():e.startsWith(`Digit`)?e.replace(`Digit`,``):Bie[e]||e.toLowerCase():``}let Ah=class extends Qe{constructor(){super(...arguments),this.keyListener=null,this.isListening=!1}connectedCallback(){super.connectedCallback(),this.addKeyListener()}disconnectedCallback(){super.disconnectedCallback(),this.removeKeyListener()}addKeyListener(){this.isListening||(this.keyListener=this.handleKeyDown.bind(this),document.addEventListener(`keydown`,this.keyListener),this.isListening=!0)}removeKeyListener(){this.isListening&&this.keyListener&&(document.removeEventListener(`keydown`,this.keyListener),this.keyListener=null,this.isListening=!1)}handleKeyDown(e){let t=this.shortcutManager,n=t.getBlockedMessages(),r=t.getEditableSelector(),i=this.getEventElement(e)??this,a=e.ctrlKey||e.altKey||e.shiftKey||e.metaKey,o=Vie(e.code),s=t.findShortcutByKeyCombination(o,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey);if(s){if(tf(e,r)){a&&s.emitBlockedEvent!==!1&&Dh({shortcutId:s.id,context:s.context,reason:`editable-context`,blockedMessage:s.blockedMessage??n.inputMessage},i);return}s&&(e.preventDefault(),e.stopPropagation(),t.executeShortcut(s.id,i))}}getEventElement(e){return(e.composedPath?.call(e)??[]).find(e=>e instanceof Element)??e.target??null}};q([Ft(zie)],Ah.prototype,`shortcutManager`,void 0),Ah=q([$e({name:`foundation-shortcut-listener`})],Ah);let{create:Hie}=ri,jh=Hie(`active-color-scheme`).withDefault(e=>fs.getValueFor(e)===cs.LightMode?`light`:`dark`),Mh=class extends Qe{stylesChanged(e,t){e&&this.parentElement.$fastController.removeStyles(e),this.parentElement.$fastController.addStyles(t)}};q([C],Mh.prototype,`styles`,void 0),Mh=q([$e({name:`slotted-styles`})],Mh);var Nh;(function(e){e.Italic=`italic`,e.Normal=`normal`})(Nh||(Nh={}));var Ph;(function(e){e[e.Thin=100]=`Thin`,e[e.Light=300]=`Light`,e[e.Regular=400]=`Regular`,e[e.Medium=500]=`Medium`,e[e.Bold=700]=`Bold`,e[e.Black=900]=`Black`})(Ph||(Ph={}));var Fh,Uie=/* @__PURE__ */ new Uint8Array(16);function Wie(){if(!Fh&&(Fh=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!Fh))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return Fh(Uie)}var Gie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ih(e){return typeof e==`string`&&Gie.test(e)}for(var Lh=[],Rh=0;Rh<256;++Rh)Lh.push((Rh+256).toString(16).substr(1));function zh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Lh[e[t+0]]+Lh[e[t+1]]+Lh[e[t+2]]+Lh[e[t+3]]+`-`+Lh[e[t+4]]+Lh[e[t+5]]+`-`+Lh[e[t+6]]+Lh[e[t+7]]+`-`+Lh[e[t+8]]+Lh[e[t+9]]+`-`+Lh[e[t+10]]+Lh[e[t+11]]+Lh[e[t+12]]+Lh[e[t+13]]+Lh[e[t+14]]+Lh[e[t+15]]).toLowerCase();if(!Ih(n))throw TypeError(`Stringified UUID is invalid`);return n}function Kie(e){if(!Ih(e))throw TypeError(`Invalid UUID`);var t,n=/* @__PURE__ */ new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function qie(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var Jie=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,Yie=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function Bh(e,t,n){function r(e,r,i,a){if(typeof e==`string`&&(e=qie(e)),typeof r==`string`&&(r=Kie(r)),r.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=o[6]&15|t,o[8]=o[8]&63|128,i){a=a||0;for(var s=0;s<16;++s)i[a+s]=o[s];return i}return zh(o)}try{r.name=e}catch{}return r.DNS=Jie,r.URL=Yie,r}function Xie(e){if(typeof e==`string`){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return Zie(Qie($ie(e),e.length*8))}function Zie(e){for(var t=[],n=e.length*32,r=`0123456789abcdef`,i=0;i<n;i+=8){var a=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(a>>>4&15)+r.charAt(a&15),16);t.push(o)}return t}function Vh(e){return(e+64>>>9<<4)+14+1}function Qie(e,t){e[t>>5]|=128<<t%32,e[Vh(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a;n=Wh(n,r,i,a,e[o],7,-680876936),a=Wh(a,n,r,i,e[o+1],12,-389564586),i=Wh(i,a,n,r,e[o+2],17,606105819),r=Wh(r,i,a,n,e[o+3],22,-1044525330),n=Wh(n,r,i,a,e[o+4],7,-176418897),a=Wh(a,n,r,i,e[o+5],12,1200080426),i=Wh(i,a,n,r,e[o+6],17,-1473231341),r=Wh(r,i,a,n,e[o+7],22,-45705983),n=Wh(n,r,i,a,e[o+8],7,1770035416),a=Wh(a,n,r,i,e[o+9],12,-1958414417),i=Wh(i,a,n,r,e[o+10],17,-42063),r=Wh(r,i,a,n,e[o+11],22,-1990404162),n=Wh(n,r,i,a,e[o+12],7,1804603682),a=Wh(a,n,r,i,e[o+13],12,-40341101),i=Wh(i,a,n,r,e[o+14],17,-1502002290),r=Wh(r,i,a,n,e[o+15],22,1236535329),n=Gh(n,r,i,a,e[o+1],5,-165796510),a=Gh(a,n,r,i,e[o+6],9,-1069501632),i=Gh(i,a,n,r,e[o+11],14,643717713),r=Gh(r,i,a,n,e[o],20,-373897302),n=Gh(n,r,i,a,e[o+5],5,-701558691),a=Gh(a,n,r,i,e[o+10],9,38016083),i=Gh(i,a,n,r,e[o+15],14,-660478335),r=Gh(r,i,a,n,e[o+4],20,-405537848),n=Gh(n,r,i,a,e[o+9],5,568446438),a=Gh(a,n,r,i,e[o+14],9,-1019803690),i=Gh(i,a,n,r,e[o+3],14,-187363961),r=Gh(r,i,a,n,e[o+8],20,1163531501),n=Gh(n,r,i,a,e[o+13],5,-1444681467),a=Gh(a,n,r,i,e[o+2],9,-51403784),i=Gh(i,a,n,r,e[o+7],14,1735328473),r=Gh(r,i,a,n,e[o+12],20,-1926607734),n=Kh(n,r,i,a,e[o+5],4,-378558),a=Kh(a,n,r,i,e[o+8],11,-2022574463),i=Kh(i,a,n,r,e[o+11],16,1839030562),r=Kh(r,i,a,n,e[o+14],23,-35309556),n=Kh(n,r,i,a,e[o+1],4,-1530992060),a=Kh(a,n,r,i,e[o+4],11,1272893353),i=Kh(i,a,n,r,e[o+7],16,-155497632),r=Kh(r,i,a,n,e[o+10],23,-1094730640),n=Kh(n,r,i,a,e[o+13],4,681279174),a=Kh(a,n,r,i,e[o],11,-358537222),i=Kh(i,a,n,r,e[o+3],16,-722521979),r=Kh(r,i,a,n,e[o+6],23,76029189),n=Kh(n,r,i,a,e[o+9],4,-640364487),a=Kh(a,n,r,i,e[o+12],11,-421815835),i=Kh(i,a,n,r,e[o+15],16,530742520),r=Kh(r,i,a,n,e[o+2],23,-995338651),n=qh(n,r,i,a,e[o],6,-198630844),a=qh(a,n,r,i,e[o+7],10,1126891415),i=qh(i,a,n,r,e[o+14],15,-1416354905),r=qh(r,i,a,n,e[o+5],21,-57434055),n=qh(n,r,i,a,e[o+12],6,1700485571),a=qh(a,n,r,i,e[o+3],10,-1894986606),i=qh(i,a,n,r,e[o+10],15,-1051523),r=qh(r,i,a,n,e[o+1],21,-2054922799),n=qh(n,r,i,a,e[o+8],6,1873313359),a=qh(a,n,r,i,e[o+15],10,-30611744),i=qh(i,a,n,r,e[o+6],15,-1560198380),r=qh(r,i,a,n,e[o+13],21,1309151649),n=qh(n,r,i,a,e[o+4],6,-145523070),a=qh(a,n,r,i,e[o+11],10,-1120210379),i=qh(i,a,n,r,e[o+2],15,718787259),r=qh(r,i,a,n,e[o+9],21,-343485551),n=Hh(n,s),r=Hh(r,c),i=Hh(i,l),a=Hh(a,u)}return[n,r,i,a]}function $ie(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(Vh(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Hh(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function eae(e,t){return e<<t|e>>>32-t}function Uh(e,t,n,r,i,a){return Hh(eae(Hh(Hh(t,e),Hh(r,a)),i),n)}function Wh(e,t,n,r,i,a,o){return Uh(t&n|~t&r,e,t,i,a,o)}function Gh(e,t,n,r,i,a,o){return Uh(t&r|n&~r,e,t,i,a,o)}function Kh(e,t,n,r,i,a,o){return Uh(t^n^r,e,t,i,a,o)}function qh(e,t,n,r,i,a,o){return Uh(n^(t|~r),e,t,i,a,o)}Bh(`v3`,48,Xie);function Jh(e,t,n){e=e||{};var r=e.random||(e.rng||Wie)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return zh(r)}function tae(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Yh(e,t){return e<<t|e>>>32-t}function nae(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e==`string`){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=Array(o),c=0;c<o;++c){for(var l=/* @__PURE__ */ new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];s[c]=l}s[o-1][14]=(e.length-1)*8/2**32,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=/* @__PURE__ */ new Uint32Array(80),p=0;p<16;++p)f[p]=s[d][p];for(var m=16;m<80;++m)f[m]=Yh(f[m-3]^f[m-8]^f[m-14]^f[m-16],1);for(var h=n[0],g=n[1],_=n[2],v=n[3],y=n[4],b=0;b<80;++b){var ee=Math.floor(b/20),x=Yh(h,5)+tae(ee,g,_,v)+y+t[ee]+f[b]>>>0;y=v,v=_,_=Yh(g,30)>>>0,g=h,h=x}n[0]=n[0]+h>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+_>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}Bh(`v5`,80,nae);var rae=class{constructor(){}createId(e=!1){let t=Jh();return e&&Id.debug(`UUID.createID ${t}`),t}createRemoteId(){return J(this,arguments,void 0,function*(e=!1){let t=Jh();return e&&Id.debug(`UUID.createRemoteID ${t}`),t})}};let Xh=N.createInterface(e=>e.singleton(rae)),Zh=1e3,iae=e=>T`<div class="inactivity-overlay" style="display:${e=>e.isVisible?`display`:`none`}"><${e}-card class="dialog-card"><div class="card-body"><div class="dialog-header"><${e}-icon name="warning" class="warning-icon"></${e}-icon><h2>Session Timeout Warning</h2></div><div class="dialog-content"><p>
|
|
226
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function nm(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var rm=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=od(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if($p(c))try{c()}catch(e){i=e instanceof tm?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=od(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{om(f)}catch(e){i=i??[],e instanceof tm?i=cd(cd([],sd(i)),sd(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new tm(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)om(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&nm(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&nm(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),im=rm.EMPTY;function am(e){return e instanceof rm||e&&`closed`in e&&$p(e.remove)&&$p(e.add)&&$p(e.unsubscribe)}function om(e){$p(e)?e():e.unsubscribe()}var sm={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},cm={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=cm.delegate;return i?.setTimeout?i.setTimeout.apply(i,cd([e,t],sd(n))):setTimeout.apply(void 0,cd([e,t],sd(n)))},clearTimeout:function(e){return(cm.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function lm(e){cm.setTimeout(function(){var t=sm.onUnhandledError;if(t)t(e);else throw e})}function um(){}var jre=(function(){return dm(`C`,void 0,void 0)})();function Mre(e){return dm(`E`,void 0,e)}function Nre(e){return dm(`N`,e,void 0)}function dm(e,t,n){return{kind:e,value:t,error:n}}var fm=null;function pm(e){if(sm.useDeprecatedSynchronousErrorHandling){var t=!fm;if(t&&(fm={errorThrown:!1,error:null}),e(),t){var n=fm,r=n.errorThrown,i=n.error;if(fm=null,r)throw i}}else e()}function Pre(e){sm.useDeprecatedSynchronousErrorHandling&&fm&&(fm.errorThrown=!0,fm.error=e)}var mm=function(e){td(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,am(t)&&t.add(n)):n.destination=Rre,n}return t.create=function(e,t,n){return new gm(e,t,n)},t.prototype.next=function(e){this.isStopped?vm(Nre(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?vm(Mre(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?vm(jre,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(rm),Fre=Function.prototype.bind;function hm(e,t){return Fre.call(e,t)}var Ire=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){_m(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){_m(e)}else _m(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){_m(e)}},e}(),gm=function(e){td(t,e);function t(t,n,r){var i=e.call(this)||this,a;if($p(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&sm.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&hm(t.next,o),error:t.error&&hm(t.error,o),complete:t.complete&&hm(t.complete,o)}):a=t}return i.destination=new Ire(a),i}return t}(mm);function _m(e){sm.useDeprecatedSynchronousErrorHandling?Pre(e):lm(e)}function Lre(e){throw e}function vm(e,t){var n=sm.onStoppedNotification;n&&cm.setTimeout(function(){return n(e,t)})}var Rre={closed:!0,next:um,error:Lre,complete:um},ym=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function bm(e){return e}function zre(e){return e.length===0?bm:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var xm=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Vre(e)?e:new gm(e,t,n);return pm(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Sm(t),new t(function(t,r){var i=new gm({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[ym]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zre(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=Sm(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Sm(e){return e??sm.Promise??Promise}function Bre(e){return e&&$p(e.next)&&$p(e.error)&&$p(e.complete)}function Vre(e){return e&&e instanceof mm||Bre(e)&&am(e)}function Cm(e){return $p(e?.lift)}function wm(e){return function(t){if(Cm(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Tm(e,t,n,r,i){return new Hre(e,t,n,r,i)}var Hre=function(e){td(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(mm);function Ure(){return wm(function(e,t){var n=null;e._refCount++;var r=Tm(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){n=null;return}var r=e._connection,i=n;n=null,r&&(!i||r===i)&&r.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}(function(e){td(t,e);function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Cm(t)&&(r.lift=t.lift),r}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new rm;var n=this.getSubject();t.add(this.source.subscribe(Tm(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=rm.EMPTY)}return t},t.prototype.refCount=function(){return Ure()(this)},t})(xm);var Em={now:function(){return(Em.delegate||performance).now()},delegate:void 0},Dm={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=Dm.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(t){n=void 0,e(t)});return new rm(function(){return n?.(i)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Dm.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,cd([],sd(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Dm.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,cd([],sd(e)))},delegate:void 0};function Wre(e){return new xm(function(t){var n=e||Em,r=n.now(),i=0,a=function(){t.closed||(i=Dm.requestAnimationFrame(function(o){i=0;var s=n.now();t.next({timestamp:e?s:o,elapsed:s-r}),a()}))};return a(),function(){i&&Dm.cancelAnimationFrame(i)}})}Wre();var Gre=em(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Om=function(e){td(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new km(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Gre},t.prototype.next=function(e){var t=this;pm(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=od(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;pm(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;pm(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?im:(this.currentObservers=null,a.push(e),new rm(function(){t.currentObservers=null,nm(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new xm;return e.source=this,e},t.create=function(e,t){return new km(e,t)},t}(xm),km=function(e){td(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??im},t}(Om),Am=function(e){td(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Om),jm={now:function(){return(jm.delegate||Date).now()},delegate:void 0},Mm=function(e){td(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=jm);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(Om);(function(e){td(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},t})(Om);var Kre=function(e){td(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(rm),Nm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Nm.delegate;return i?.setInterval?i.setInterval.apply(i,cd([e,t],sd(n))):setInterval.apply(void 0,cd([e,t],sd(n)))},clearInterval:function(e){return(Nm.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Pm=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),Nm.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&Nm.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return/* @__PURE__ */ Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||/* @__PURE__ */ Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nm(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Kre),qre=1,Fm,Im={};function Lm(e){return e in Im&&(delete Im[e],!0)}var Rm={setImmediate:function(e){var t=qre++;return Im[t]=!0,Fm||(Fm=Promise.resolve()),Fm.then(function(){return Lm(t)&&e()}),t},clearImmediate:function(e){Lm(e)}},Jre=Rm.setImmediate,Yre=Rm.clearImmediate,zm={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(zm.delegate?.setImmediate||Jre).apply(void 0,cd([],sd(e)))},clearImmediate:function(e){return(zm.delegate?.clearImmediate||Yre)(e)},delegate:void 0},Xre=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=zm.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&i[i.length-1]?.id!==n&&(zm.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(Pm),Bm=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=jm.now,e}(),Vm=function(e){td(t,e);function t(t,n){n===void 0&&(n=Bm.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(Bm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Vm))(Xre);var Hm=new Vm(Pm),Zre=Hm,Qre=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(Pm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Vm))(Qre);var $re=function(e){td(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Dm.requestAnimationFrame(function(){return t.flush(void 0)})))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&n===t._scheduled&&i[i.length-1]?.id!==n&&(Dm.cancelAnimationFrame(n),t._scheduled=void 0)},t}(Pm);new(function(e){td(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Vm))($re),function(e){td(t,e);function t(t,n){t===void 0&&(t=eie),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},t.frameTimeFactor=10,t}(Vm);var eie=function(e){td(t,e);function t(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t.prototype.schedule=function(n,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return rm.EMPTY},t.prototype.requestAsyncId=function(e,n,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},t.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Pm),Um=new xm(function(e){return e.complete()});function Wm(e){return e&&$p(e.schedule)}function Gm(e){return e[e.length-1]}function tie(e){return $p(Gm(e))?e.pop():void 0}function Km(e){return Wm(Gm(e))?e.pop():void 0}var qm=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Jm(e){return $p(e?.then)}function Ym(e){return $p(e[ym])}function Xm(e){return Symbol.asyncIterator&&$p(e?.[Symbol.asyncIterator])}function Zm(e){return/* @__PURE__ */ TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function nie(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Qm=nie();function $m(e){return $p(e?.[Qm])}function eh(e){return Jne(this,arguments,function(){var t,n,r,i;return ad(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ld(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,ld(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ld(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function th(e){return $p(e?.getReader)}function nh(e){if(e instanceof xm)return e;if(e!=null){if(Ym(e))return rie(e);if(qm(e))return iie(e);if(Jm(e))return aie(e);if(Xm(e))return rh(e);if($m(e))return oie(e);if(th(e))return sie(e)}throw Zm(e)}function rie(e){return new xm(function(t){var n=e[ym]();if($p(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function iie(e){return new xm(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function aie(e){return new xm(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,lm)})}function oie(e){return new xm(function(t){var n,r;try{for(var i=od(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function rh(e){return new xm(function(t){cie(e,t).catch(function(e){return t.error(e)})})}function sie(e){return rh(eh(e))}function cie(e,t){var n,r,i,a;return J(this,void 0,void 0,function(){var o,s;return ad(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Yne(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ih(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ah(e,t){return t===void 0&&(t=0),wm(function(n,r){n.subscribe(Tm(r,function(n){return ih(r,e,function(){return r.next(n)},t)},function(){return ih(r,e,function(){return r.complete()},t)},function(n){return ih(r,e,function(){return r.error(n)},t)}))})}function oh(e,t){return t===void 0&&(t=0),wm(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function lie(e,t){return nh(e).pipe(oh(t),ah(t))}function uie(e,t){return nh(e).pipe(oh(t),ah(t))}function die(e,t){return new xm(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function fie(e,t){return new xm(function(n){var r;return ih(n,t,function(){r=e[Qm](),ih(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return $p(r?.return)&&r.return()}})}function sh(e,t){if(!e)throw Error(`Iterable cannot be null`);return new xm(function(n){ih(n,t,function(){var r=e[Symbol.asyncIterator]();ih(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function pie(e,t){return sh(eh(e),t)}function mie(e,t){if(e!=null){if(Ym(e))return lie(e,t);if(qm(e))return die(e,t);if(Jm(e))return uie(e,t);if(Xm(e))return sh(e,t);if($m(e))return fie(e,t);if(th(e))return pie(e,t)}throw Zm(e)}function ch(e,t){return t?mie(e,t):nh(e)}function lh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ch(e,Km(e))}function uh(e,t){var n=$p(e)?e:function(){return e},r=function(e){return e.error(n())};return new xm(t?function(e){return t.schedule(r,0,e)}:r)}var dh;(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(dh||(dh={})),function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return hie(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return $p(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i=t===`N`?lh(n):t===`E`?uh(function(){return r}):t===`C`?Um:0;if(!i)throw TypeError(`Unexpected notification kind `+t);return i},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e}();function hie(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}var gie=em(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function _ie(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new gm({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new gie)}});e.subscribe(a)})}em(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}}),em(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}}),em(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}});function vie(e){return e instanceof Date&&!isNaN(e)}em(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function fh(e,t){return wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){r.next(e.call(t,n,i++))}))})}var yie=Array.isArray;function bie(e,t){return yie(t)?e.apply(void 0,cd([],sd(t))):e(t)}function xie(e){return fh(function(t){return bie(e,t)})}var Sie=Array.isArray,Cie=Object.getPrototypeOf,wie=Object.prototype,Tie=Object.keys;function Eie(e){if(e.length===1){var t=e[0];if(Sie(t))return{args:t,keys:null};if(Die(t)){var n=Tie(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function Die(e){return e&&typeof e==`object`&&Cie(e)===wie}function Oie(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function kie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Km(e),r=tie(e),i=Eie(e),a=i.args,o=i.keys;if(a.length===0)return ch([],n);var s=new xm(Aie(a,n,o?function(e){return Oie(o,e)}:bm));return r?s.pipe(xie(r)):s}function Aie(e,t,n){return n===void 0&&(n=bm),function(r){ph(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){ph(t,function(){var c=ch(e[i],t),l=!1;c.subscribe(Tm(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function ph(e,t,n){e?ih(n,e,t):t()}function jie(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;nh(n(e,u++)).subscribe(Tm(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?ih(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(Tm(t,p,function(){d=!0,f()})),function(){s?.()}}function mh(e,t,n){return n===void 0&&(n=1/0),$p(t)?mh(function(n,r){return fh(function(e,i){return t(n,e,r,i)})(nh(e(n,r)))},n):(typeof t==`number`&&(n=t),wm(function(t,r){return jie(t,r,e,n)}))}function Mie(e){return e===void 0&&(e=1/0),mh(bm,e)}function Nie(){return Mie(1)}function hh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Nie()(ch(e,Km(e)))}function gh(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Zre);var r=-1;return t!=null&&(Wm(t)?n=t:r=t),new xm(function(t){var i=vie(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function Pie(e,t){return e===void 0&&(e=0),t===void 0&&(t=Hm),e<0&&(e=0),gh(e,e,t)}new xm(um),Array.isArray;function _h(e,t){return wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Fie(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(Tm(o,function(t){var n=l++;c=s?e(c,t,n):(s=!0,t),r&&o.next(c)},i&&(function(){s&&o.next(c),o.complete()})))}}function vh(e,t){return t?function(n){return n.pipe(vh(function(n,r){return nh(e(n,r)).pipe(fh(function(e,i){return t(n,e,r,i)}))}))}:wm(function(t,n){var r=0,i=null,a=!1;t.subscribe(Tm(n,function(t){i||(i=Tm(n,void 0,function(){i=null,a&&n.complete()}),nh(e(t,r++)).subscribe(i))},function(){a=!0,!i&&n.complete()}))})}function yh(e){return wm(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function Iie(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?bm:wm(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(Tm(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?gh(i):nh(i(e,n)),u=Tm(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function bh(e,t){return wm(Fie(e,t,arguments.length>=2,!0))}function xh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Km(e);return wm(function(t,r){(n?hh(e,t,n):hh(e,t)).subscribe(r)})}function Sh(e,t){return wm(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(Tm(r,function(n){i?.unsubscribe();var o=0,c=a++;nh(e(n,c)).subscribe(i=Tm(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Ch(e,t){return t===void 0&&(t=!1),wm(function(n,r){var i=0;n.subscribe(Tm(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}))})}var Lie=class{static get isMacOS(){return navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.toLowerCase().includes(`mac os`)}static get isWindows(){return navigator.platform.toLowerCase().includes(`win`)||navigator.userAgent.toLowerCase().includes(`windows`)}static get isLinux(){return navigator.platform.toLowerCase().includes(`linux`)||navigator.userAgent.toLowerCase().includes(`linux`)}static getModifierSymbols(){return this.isMacOS?{ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`}:{ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`,meta:`Win`}}static formatKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.getModifierSymbols(),o=[];t&&o.push(a.ctrl),n&&o.push(a.alt),r&&o.push(a.shift),i&&o.push(a.meta);let s=this.isMacOS?``:`+`,c=this.isMacOS?e.toUpperCase():e;return o.length>0?`${o.join(s)}${s}${c}`:c}};let wh=`foundation-shortcut-blocked`,Th=`Shortcut blocked`,Eh=`This shortcut is currently unavailable in this context.`;function Dh(e,t){let n=Object.assign(Object.assign({},e),{blockedMessage:e.blockedMessage??{title:Th,text:Eh}});t&&typeof t.dispatchEvent==`function`?t.dispatchEvent(new CustomEvent(wh,{bubbles:!0,composed:!0,detail:n})):typeof document<`u`&&document.dispatchEvent(new CustomEvent(wh,{bubbles:!0,composed:!0,detail:n}))}let Oh={designSystems:[`rapid`],customEditableSelectors:[]},kh={defaultMessage:{title:Th,text:Eh},inputMessage:{title:Th,text:`This shortcut is unavailable while typing in an input field.`},pausedMessage:{title:Th,text:`Shortcuts are paused.`},elementFocusMessage:{title:Th,text:`This shortcut is unavailable in the current focus context.`},emitPausedBlockedEvent:!0};var Rie=class{constructor(){this.shortcuts=/* @__PURE__ */ new Map,this.shortcutLookup=/* @__PURE__ */ new Map,this.keyCombinationMap=/* @__PURE__ */ new Map,this._isPausedSubject=new Am(!1),this.executionGuards=/* @__PURE__ */ new Map,this.editableContextConfig=Object.assign({},Oh),this.editableSelector=Jd(Oh.designSystems,Oh.customEditableSelectors),this.blockedMessageConfig=Object.assign({},kh)}get isPaused(){return this._isPausedSubject.value}get isPaused$(){return this._isPausedSubject.asObservable()}get isPausedSubject(){return this._isPausedSubject}registerShortcuts(e){e.forEach(e=>{this.registerShortcut(e)})}registerShortcut(e){let t=`${e.context}:${e.id}`,n=this.normalizeShortcutDefinition(e),r=this.createKeyCombinationKey(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),i=Lie.formatKeyCombination(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),a=this.keyCombinationMap.get(r);if(a){let e=[];for(let t of a){let i=this.shortcutLookup.get(t);i&&i.context===n.context&&(Id.warn(`Shortcut with key combination '${r}' already exists in context '${n.context}' (id: '${i.id}'). It will be replaced by new shortcut '${n.id}'.`),e.push(t))}e.forEach(e=>{let t=this.shortcutLookup.get(e);if(t){let n=this.shortcuts.get(t.context);n&&(n.delete(t.id),n.size===0&&this.shortcuts.delete(t.context)),this.shortcutLookup.delete(e)}a.delete(e)}),a.size===0&&this.keyCombinationMap.delete(r)}return this.shortcuts.has(n.context)||this.shortcuts.set(n.context,/* @__PURE__ */ new Map),this.shortcuts.get(n.context).set(n.id,n),this.shortcutLookup.set(t,n),this.keyCombinationMap.has(r)||this.keyCombinationMap.set(r,/* @__PURE__ */ new Set),this.keyCombinationMap.get(r).add(t),{shortcut:n,id:n.id,keyCombination:r,keyCombinationDisplay:i,disabled:()=>this.getExecutionStatus(n).disabled||!1,tooltip:()=>this.getExecutionStatus(n).tooltip}}unregisterShortcut(e,t){let n=`${e}:${t}`,r=this.shortcuts.get(e);if(r){let i=r.get(t);if(i){let a=this.normalizeShortcutDefinition(i),o=this.createKeyCombinationKey(a.key,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey);r.delete(t),r.size===0&&this.shortcuts.delete(e),this.shortcutLookup.delete(n);let s=this.keyCombinationMap.get(o);s&&(s.delete(n),s.size===0&&this.keyCombinationMap.delete(o))}}}unregisterShortcutsByContext(e){let t=this.shortcuts.get(e);t&&Array.from(t.keys()).forEach(t=>this.unregisterShortcut(e,t))}executeShortcut(e,t){this.executeShortcutByContext(this.getActiveContext(),e,t)}shouldEmitBlockedEvent(e){return e?.emitBlockedEvent!==!1}resolveBlockedMessage(e,t){return e?.blockedMessage??t}executeShortcutByContext(e,t,n){let r=this.shortcuts.get(e)?.get(t);if(this.isPaused){this.blockedMessageConfig.emitPausedBlockedEvent&&this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`paused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.pausedMessage)},n);return}if(r){if(r.elementRef&&!this.isElementFocused(r.elementRef)){this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`element-not-focused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.elementFocusMessage)},n);return}let i=this.getExecutionStatus(r);if(i.disabled){this.shouldEmitBlockedEvent(r)&&Dh({shortcutId:t,context:e,reason:`disabled`,blockedMessage:this.resolveBlockedMessage(r,i.tooltip===void 0?this.blockedMessageConfig.defaultMessage:{title:this.blockedMessageConfig.defaultMessage.title,text:i.tooltip})},n);return}try{r.action()}catch(n){Id.error(`Error executing shortcut ${e}:${t}:`,n)}}}getShortcuts(){let e=[];for(let t of this.shortcuts.values())e.push(...t.values());return e}getShortcutsByContext(e){let t=this.shortcuts.get(e);return t?Array.from(t.values()):[]}findShortcutByKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.createKeyCombinationKey(e,t,n,r,i),o=this.keyCombinationMap.get(a);if(o){if(this._activeContext){let e=this.shortcuts.get(this._activeContext);if(e)for(let t of o){let[n,r]=t.split(`:`);if(n!==this._activeContext)continue;let i=e.get(r);if(i)return i}}for(let e of o){let t=this.shortcutLookup.get(e);if(t)return t}}}getContexts(){return Array.from(this.shortcuts.keys())}getShortcutsByContextMap(){return new Map(this.shortcuts)}registerContext(e){this.shortcuts.has(e)||this.shortcuts.set(e,/* @__PURE__ */ new Map)}setActiveContext(e){this.registerContext(e),this._activeContext=e}getActiveContext(){return this._activeContext}clearActiveContext(){this._activeContext=void 0}registerExecutionGuard(e,t){this.executionGuards.set(e,t)}unregisterExecutionGuard(e){this.executionGuards.delete(e)}clearExecutionGuards(){this.executionGuards.clear()}configureEditableContext(e={}){let t=(e.designSystems??Oh.designSystems).filter(e=>e===`rapid`),n=(e.customEditableSelectors??Oh.customEditableSelectors).map(e=>e?.trim()).filter(e=>!!e);this.editableContextConfig={designSystems:Array.from(new Set(e.designSystems===void 0?Oh.designSystems:t)),customEditableSelectors:Array.from(new Set(n))},this.refreshEditableSelector()}getEditableContextConfig(){return{designSystems:[...this.editableContextConfig.designSystems],customEditableSelectors:[...this.editableContextConfig.customEditableSelectors]}}getEditableSelector(){return this.editableSelector}configureBlockedMessages(e={}){let t=(e,t)=>({title:(e?.title)?.trim()??t.title,text:(e?.text)?.trim()??t.text});this.blockedMessageConfig={defaultMessage:t(e.defaultMessage,kh.defaultMessage),inputMessage:t(e.inputMessage,kh.inputMessage),pausedMessage:t(e.pausedMessage,kh.pausedMessage),elementFocusMessage:t(e.elementFocusMessage,kh.elementFocusMessage),emitPausedBlockedEvent:e.emitPausedBlockedEvent??kh.emitPausedBlockedEvent}}getBlockedMessages(){return Object.assign({},this.blockedMessageConfig)}pause(){this._isPausedSubject.next(!0)}resume(){this._isPausedSubject.next(!1)}normalizeShortcutDefinition(e){let t=Object.assign({},e);return(t.optionKey||t.altKey)&&(t.altKey=!0,t.optionKey=!0),t}createKeyCombinationKey(e,t=!1,n=!1,r=!1,i=!1){let a=[];return t&&a.push(`ctrl`),n&&a.push(`alt`),r&&a.push(`shift`),i&&a.push(`meta`),(a.length>0?`${a.join(`+`)}+${e}`:e).toLowerCase()}isElementFocused(e){return e instanceof HTMLElement&&document.activeElement===e}getExecutionStatus(e){if(this.isPaused)return{disabled:!0,tooltip:this.blockedMessageConfig.pausedMessage.text};let t=this.getExecutionGuardStatus();return t.disabled?t:e.canExecute?e.canExecute():{disabled:!1,tooltip:void 0}}getExecutionGuardStatus(){for(let e of this.executionGuards.values()){let t=e(),n=typeof t==`boolean`?{disabled:t}:t;if(n?.disabled)return{disabled:!0,tooltip:n.tooltip}}return{disabled:!1,tooltip:void 0}}refreshEditableSelector(){this.editableSelector=Jd(this.editableContextConfig.designSystems,this.editableContextConfig.customEditableSelectors)}};let zie=N.createInterface(e=>e.singleton(Rie)),Bie={Space:`space`,Enter:`enter`,Escape:`escape`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,F1:`f1`,F2:`f2`,F3:`f3`,F4:`f4`,F5:`f5`,F6:`f6`,F7:`f7`,F8:`f8`,F9:`f9`,F10:`f10`,F11:`f11`,F12:`f12`};function Vie(e){return e?e.startsWith(`Key`)?e.replace(`Key`,``).toLowerCase():e.startsWith(`Digit`)?e.replace(`Digit`,``):Bie[e]||e.toLowerCase():``}let Ah=class extends Qe{constructor(){super(...arguments),this.keyListener=null,this.isListening=!1}connectedCallback(){super.connectedCallback(),this.addKeyListener()}disconnectedCallback(){super.disconnectedCallback(),this.removeKeyListener()}addKeyListener(){this.isListening||(this.keyListener=this.handleKeyDown.bind(this),document.addEventListener(`keydown`,this.keyListener),this.isListening=!0)}removeKeyListener(){this.isListening&&this.keyListener&&(document.removeEventListener(`keydown`,this.keyListener),this.keyListener=null,this.isListening=!1)}handleKeyDown(e){let t=this.shortcutManager,n=t.getBlockedMessages(),r=t.getEditableSelector(),i=this.getEventElement(e)??this,a=e.ctrlKey||e.altKey||e.shiftKey||e.metaKey,o=Vie(e.code),s=t.findShortcutByKeyCombination(o,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey);if(s){if(tf(e,r)){a&&s.emitBlockedEvent!==!1&&Dh({shortcutId:s.id,context:s.context,reason:`editable-context`,blockedMessage:s.blockedMessage??n.inputMessage},i);return}s&&(e.preventDefault(),e.stopPropagation(),t.executeShortcut(s.id,i))}}getEventElement(e){return(e.composedPath?.call(e)??[]).find(e=>e instanceof Element)??e.target??null}};q([Ft(zie)],Ah.prototype,`shortcutManager`,void 0),Ah=q([$e({name:`foundation-shortcut-listener`})],Ah);let{create:Hie}=ri,jh=Hie(`active-color-scheme`).withDefault(e=>fs.getValueFor(e)===cs.LightMode?`light`:`dark`),Mh=class extends Qe{stylesChanged(e,t){let n=this.parentController;n&&(e&&n.removeStyles(e),t&&n.addStyles(t))}connectedCallback(){super.connectedCallback();let e=this.parentElement;if(e){if(this.parentController){this.applyStyles();return}e.localName.includes(`-`)&&!customElements.get(e.localName)&&customElements.whenDefined(e.localName).then(()=>{this.isConnected&&this.parentElement===e&&this.applyStyles()})}}get parentController(){return this.parentElement?.$fastController}applyStyles(){var e;this.styles&&((e=this.parentController)==null||e.addStyles(this.styles))}};q([C],Mh.prototype,`styles`,void 0),Mh=q([$e({name:`slotted-styles`})],Mh);var Nh;(function(e){e.Italic=`italic`,e.Normal=`normal`})(Nh||(Nh={}));var Ph;(function(e){e[e.Thin=100]=`Thin`,e[e.Light=300]=`Light`,e[e.Regular=400]=`Regular`,e[e.Medium=500]=`Medium`,e[e.Bold=700]=`Bold`,e[e.Black=900]=`Black`})(Ph||(Ph={}));var Fh,Uie=/* @__PURE__ */ new Uint8Array(16);function Wie(){if(!Fh&&(Fh=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!Fh))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return Fh(Uie)}var Gie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ih(e){return typeof e==`string`&&Gie.test(e)}for(var Lh=[],Rh=0;Rh<256;++Rh)Lh.push((Rh+256).toString(16).substr(1));function zh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Lh[e[t+0]]+Lh[e[t+1]]+Lh[e[t+2]]+Lh[e[t+3]]+`-`+Lh[e[t+4]]+Lh[e[t+5]]+`-`+Lh[e[t+6]]+Lh[e[t+7]]+`-`+Lh[e[t+8]]+Lh[e[t+9]]+`-`+Lh[e[t+10]]+Lh[e[t+11]]+Lh[e[t+12]]+Lh[e[t+13]]+Lh[e[t+14]]+Lh[e[t+15]]).toLowerCase();if(!Ih(n))throw TypeError(`Stringified UUID is invalid`);return n}function Kie(e){if(!Ih(e))throw TypeError(`Invalid UUID`);var t,n=/* @__PURE__ */ new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function qie(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var Jie=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,Yie=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function Bh(e,t,n){function r(e,r,i,a){if(typeof e==`string`&&(e=qie(e)),typeof r==`string`&&(r=Kie(r)),r.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=o[6]&15|t,o[8]=o[8]&63|128,i){a=a||0;for(var s=0;s<16;++s)i[a+s]=o[s];return i}return zh(o)}try{r.name=e}catch{}return r.DNS=Jie,r.URL=Yie,r}function Xie(e){if(typeof e==`string`){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return Zie(Qie($ie(e),e.length*8))}function Zie(e){for(var t=[],n=e.length*32,r=`0123456789abcdef`,i=0;i<n;i+=8){var a=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(a>>>4&15)+r.charAt(a&15),16);t.push(o)}return t}function Vh(e){return(e+64>>>9<<4)+14+1}function Qie(e,t){e[t>>5]|=128<<t%32,e[Vh(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a;n=Wh(n,r,i,a,e[o],7,-680876936),a=Wh(a,n,r,i,e[o+1],12,-389564586),i=Wh(i,a,n,r,e[o+2],17,606105819),r=Wh(r,i,a,n,e[o+3],22,-1044525330),n=Wh(n,r,i,a,e[o+4],7,-176418897),a=Wh(a,n,r,i,e[o+5],12,1200080426),i=Wh(i,a,n,r,e[o+6],17,-1473231341),r=Wh(r,i,a,n,e[o+7],22,-45705983),n=Wh(n,r,i,a,e[o+8],7,1770035416),a=Wh(a,n,r,i,e[o+9],12,-1958414417),i=Wh(i,a,n,r,e[o+10],17,-42063),r=Wh(r,i,a,n,e[o+11],22,-1990404162),n=Wh(n,r,i,a,e[o+12],7,1804603682),a=Wh(a,n,r,i,e[o+13],12,-40341101),i=Wh(i,a,n,r,e[o+14],17,-1502002290),r=Wh(r,i,a,n,e[o+15],22,1236535329),n=Gh(n,r,i,a,e[o+1],5,-165796510),a=Gh(a,n,r,i,e[o+6],9,-1069501632),i=Gh(i,a,n,r,e[o+11],14,643717713),r=Gh(r,i,a,n,e[o],20,-373897302),n=Gh(n,r,i,a,e[o+5],5,-701558691),a=Gh(a,n,r,i,e[o+10],9,38016083),i=Gh(i,a,n,r,e[o+15],14,-660478335),r=Gh(r,i,a,n,e[o+4],20,-405537848),n=Gh(n,r,i,a,e[o+9],5,568446438),a=Gh(a,n,r,i,e[o+14],9,-1019803690),i=Gh(i,a,n,r,e[o+3],14,-187363961),r=Gh(r,i,a,n,e[o+8],20,1163531501),n=Gh(n,r,i,a,e[o+13],5,-1444681467),a=Gh(a,n,r,i,e[o+2],9,-51403784),i=Gh(i,a,n,r,e[o+7],14,1735328473),r=Gh(r,i,a,n,e[o+12],20,-1926607734),n=Kh(n,r,i,a,e[o+5],4,-378558),a=Kh(a,n,r,i,e[o+8],11,-2022574463),i=Kh(i,a,n,r,e[o+11],16,1839030562),r=Kh(r,i,a,n,e[o+14],23,-35309556),n=Kh(n,r,i,a,e[o+1],4,-1530992060),a=Kh(a,n,r,i,e[o+4],11,1272893353),i=Kh(i,a,n,r,e[o+7],16,-155497632),r=Kh(r,i,a,n,e[o+10],23,-1094730640),n=Kh(n,r,i,a,e[o+13],4,681279174),a=Kh(a,n,r,i,e[o],11,-358537222),i=Kh(i,a,n,r,e[o+3],16,-722521979),r=Kh(r,i,a,n,e[o+6],23,76029189),n=Kh(n,r,i,a,e[o+9],4,-640364487),a=Kh(a,n,r,i,e[o+12],11,-421815835),i=Kh(i,a,n,r,e[o+15],16,530742520),r=Kh(r,i,a,n,e[o+2],23,-995338651),n=qh(n,r,i,a,e[o],6,-198630844),a=qh(a,n,r,i,e[o+7],10,1126891415),i=qh(i,a,n,r,e[o+14],15,-1416354905),r=qh(r,i,a,n,e[o+5],21,-57434055),n=qh(n,r,i,a,e[o+12],6,1700485571),a=qh(a,n,r,i,e[o+3],10,-1894986606),i=qh(i,a,n,r,e[o+10],15,-1051523),r=qh(r,i,a,n,e[o+1],21,-2054922799),n=qh(n,r,i,a,e[o+8],6,1873313359),a=qh(a,n,r,i,e[o+15],10,-30611744),i=qh(i,a,n,r,e[o+6],15,-1560198380),r=qh(r,i,a,n,e[o+13],21,1309151649),n=qh(n,r,i,a,e[o+4],6,-145523070),a=qh(a,n,r,i,e[o+11],10,-1120210379),i=qh(i,a,n,r,e[o+2],15,718787259),r=qh(r,i,a,n,e[o+9],21,-343485551),n=Hh(n,s),r=Hh(r,c),i=Hh(i,l),a=Hh(a,u)}return[n,r,i,a]}function $ie(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(Vh(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Hh(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function eae(e,t){return e<<t|e>>>32-t}function Uh(e,t,n,r,i,a){return Hh(eae(Hh(Hh(t,e),Hh(r,a)),i),n)}function Wh(e,t,n,r,i,a,o){return Uh(t&n|~t&r,e,t,i,a,o)}function Gh(e,t,n,r,i,a,o){return Uh(t&r|n&~r,e,t,i,a,o)}function Kh(e,t,n,r,i,a,o){return Uh(t^n^r,e,t,i,a,o)}function qh(e,t,n,r,i,a,o){return Uh(n^(t|~r),e,t,i,a,o)}Bh(`v3`,48,Xie);function Jh(e,t,n){e=e||{};var r=e.random||(e.rng||Wie)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return zh(r)}function tae(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Yh(e,t){return e<<t|e>>>32-t}function nae(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e==`string`){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=Array(o),c=0;c<o;++c){for(var l=/* @__PURE__ */ new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];s[c]=l}s[o-1][14]=(e.length-1)*8/2**32,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=/* @__PURE__ */ new Uint32Array(80),p=0;p<16;++p)f[p]=s[d][p];for(var m=16;m<80;++m)f[m]=Yh(f[m-3]^f[m-8]^f[m-14]^f[m-16],1);for(var h=n[0],g=n[1],_=n[2],v=n[3],y=n[4],b=0;b<80;++b){var ee=Math.floor(b/20),x=Yh(h,5)+tae(ee,g,_,v)+y+t[ee]+f[b]>>>0;y=v,v=_,_=Yh(g,30)>>>0,g=h,h=x}n[0]=n[0]+h>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+_>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}Bh(`v5`,80,nae);var rae=class{constructor(){}createId(e=!1){let t=Jh();return e&&Id.debug(`UUID.createID ${t}`),t}createRemoteId(){return J(this,arguments,void 0,function*(e=!1){let t=Jh();return e&&Id.debug(`UUID.createRemoteID ${t}`),t})}};let Xh=N.createInterface(e=>e.singleton(rae)),Zh=1e3,iae=e=>T`<div class="inactivity-overlay" style="display:${e=>e.isVisible?`display`:`none`}"><${e}-card class="dialog-card"><div class="card-body"><div class="dialog-header"><${e}-icon name="warning" class="warning-icon"></${e}-icon><h2>Session Timeout Warning</h2></div><div class="dialog-content"><p>
|
|
227
227
|
You have been inactive for too long. You will be automatically logged out in <strong>${e=>e.remainingSeconds}</strong>
|
|
228
228
|
seconds.
|
|
229
229
|
</p><p>
|
|
@@ -254,7 +254,7 @@ function Qv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
254
254
|
✕
|
|
255
255
|
</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>`)} `,nC=T` ${e=>lse(gb(e))} `,use={contains:Db.containsIgnoreCase,equals:Db.EQ,startsWith:Db.startsWith,endsWith:Db.endsWith,greaterThan:Db.GT,lessThan:Db.LT,greaterThanOrEqual:Db.GE,lessThanOrEqual:Db.LE,notEqual:Db.NE,dateIsToday:Db.dateIsToday,dateIsAfter:Db.dateIsGreaterEqual,dateIsGreaterEqual:Db.dateIsGreaterEqual,dateIsBefore:Db.dateIsLessEqual,dateIsLessEqual:Db.dateIsLessEqual,dateIsEqual:Db.dateIsEqual,dateTimeIsAfter:Db.dateTimeIsGreaterEqual,dateTimeIsGreaterEqual:Db.dateTimeIsGreaterEqual,dateTimeIsBefore:Db.dateTimeIsLessEqual,dateTimeIsLessEqual:Db.dateTimeIsLessEqual};function dse(e){let t=use[e.operator];if(!t)throw Error(`Unknown criteria operator '${e.operator}'`);return new Mb().withField(e.field).withValue(e.value??null).withSerialiser(t).withGroup(`default`).build()}function fse(e,t){return e.length===1?e[0]:e.reduce((e,n,r)=>r===0?[n]:[...e,t,n],[])}function rC(e){let t=new jb,n=!1;for(let r of e){if(!r.clauses?.length)continue;let e=r.clauses.map(dse),i=r.logic===`or`?bb.Or():bb.And(),a=fse(e,i),o=e.length>1?{join:i}:{};r.negated?t.And([bb.Not(),a]):t.And(e.length===1?e[0]:e,o),n=!0}return n?t.build():``}let pse=[`contains`,`equals`,`startsWith`,`notEqual`],iC=[`equals`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`,`notEqual`],aC=[`dateIsToday`,`dateIsAfter`,`dateIsBefore`,`dateIsEqual`,`dateIsGreaterEqual`,`dateIsLessEqual`],oC=[`dateTimeIsAfter`,`dateTimeIsBefore`,`dateTimeIsGreaterEqual`,`dateTimeIsLessEqual`],mse={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:`≤`},hse=/* @__PURE__ */ new Set([`DATE`,`LOCALDATE`]),gse=/* @__PURE__ */ new Set([`DATETIME`,`NANO_TIMESTAMP`,`LOCALDATETIME`,`TIMESTAMP`]),sC=/* @__PURE__ */ new Set([`INT`,`INTEGER`,`LONG`,`SHORT`,`DOUBLE`,`BIGDECIMAL`,`DECIMAL`]);function cC(e){return(e||``).toUpperCase().trim().split(`(`)[0].trim()}function _se(e){let t=cC(e);return hse.has(t)?aC:gse.has(t)?oC:sC.has(t)?iC:pse}function vse(e){return sC.has(cC(e))}function yse(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 bse(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e):typeof e==`string`&&!Number.isNaN(Number(e))}function xse(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(!_se(c).includes(a)){r.push({field:e,operator:a,value:o,message:`Operator '${a}' is not allowed for field type ${c}`});continue}if((aC.includes(a)||oC.includes(a))&&a!==`dateIsToday`&&!yse(o)){r.push({field:e,operator:a,value:o,message:`Invalid date/datetime value; use yyyyMMdd, yyyy-MM-dd, or epoch`});continue}if(vse(c)&&iC.includes(a)&&!bse(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 Sse(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}=xse(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 lC=Ad(`foundation-notifications`),uC=null,dC=/* @__PURE__ */ new Map,fC=e=>`${e?.title??`Error`}: ${e?.body??`Something went wrong`}`,Cse=e=>e?.logLevel||e?.config?.logLevel||vd.debug,pC=e=>{lC.log({message:fC(e),level:Cse(e)})},mC=(e,t)=>{let n=document.querySelector(`#${e}`);if(!n){if(dC.has(e))n=dC.get(e);else{let t=Ld(document).find(t=>t.id===e);t&&(n=t,dC.set(e,t))}}if(!n){n=document.createElement(`div`),n.setAttribute(`id`,e),n.style.zIndex=`9999`;let{element:t,prefix:r}=Bd(document.body,`rapid`);if(t)t.appendChild(n),uC=t;else if(uC)uC.appendChild(n);else{let e=document.createElement(`${r}-design-system-provider`);e.appendChild(n),document.body.appendChild(e),uC=e}}return n},wse=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 Tse()},Tse=()=>{let e=document.createElement(`div`);return e.setAttribute(`id`,`banner-anchor`),e.style.position=`relative`,document.body.insertBefore(e,document.body.firstChild),e},Ese=e=>{pC(e),alert(fC(e))},Dse=(e,t,n)=>{pC(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-banner`),a=wse(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},Ose=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},kse=(e,t,n)=>{pC(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-dialog`);(n?Ose(n):mC(`dialog-container`,t)).appendChild(i),i.notification=e,i.show()};var hC;(function(e){e.NOTIFICATION_EVENT=`notification-event`})(hC||(hC={}));var gC;(function(e){e.Top=`top`,e.Bottom=`bottom`})(gC||(gC={}));var _C;(function(e){e.Left=`left`,e.Right=`right`})(_C||(_C={}));let vC=`12px`,Ase=(e,t,n)=>{e.style.position=`fixed`,e.style.top=t===gC.Top?vC:``,e.style.bottom=t===gC.Bottom?vC:``,e.style.left=n===_C.Left?vC:``,e.style.right=n===_C.Right?vC:``},jse=(e,t)=>{pC(e);let n=t.split(`-`)[0],r=document.createElement(`${n}-snackbar`),i=e.config?.snackbar?.verticalEdge??gC.Bottom,a=e.config?.snackbar?.horizontalEdge??_C.Left,o=mC(`snack-container-${i}-${a}`,t);o&&Ase(o,i,a),o.appendChild(r),r.notification=e},Mse=e=>Ld(document.body).find(t=>t.tagName.toLowerCase()===`notify-container`&&t.position===e);function Nse(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 yC=(e,t,n)=>{var r,i;pC(e);let a=t.split(`-`)[0],o=e?.config?.toast?.position||`top-right`,s=n??Mse(o)??mC(`notify-container`,t);s&&s.tagName.toLowerCase()!==`notify-container`&&Nse(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)},bC=(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)),yC(r,t,n)},Pse=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}`,Fse=e=>T`<div class="header ${e=>pn([`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=>pn([`collapse`,e.stackCollapsed])}" name="chevron-up"></${e}-icon></${e}-button>`)} ${A(e=>e.allowCloseAll,T`<${e}-button @click=${e=>e.handleCloseAll()}>
|
|
256
256
|
Close All <${e}-icon name="xmark"></${e}-icon></${e}-button>`)}</div></div>`,Ise=T` ${A(e=>e.allowCloseAll||e.allowManualCollapse,T` ${e=>Fse(e.designSystemPrefix)} `)}<div class="toast-container"><slot ${xt(`slottedNodes`)}@click="${e=>e.handleContainerClick()}"></slot></div>`,xC=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(Vf.shared.pathName)},this.slottedNodes=[]}connectedCallback(){super.connectedCallback(),(this.position===`bottom-left`||this.position===`bottom-right`)&&lC.error(`NotifyContainer doesn't currently support bottom corner placements`),S.getNotifier(Vf.shared).subscribe(this.routeSubscriber,`pathName`),this.checkRoute(Vf.shared.pathName),this.mutationObserver=new MutationObserver(e=>this.handleMutation(e)),this.mutationObserver.observe(this,{childList:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),S.getNotifier(Vf.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],xC.prototype,`position`,void 0),q([D({attribute:`stack-threshold`})],xC.prototype,`stackThreshold`,void 0),q([D({attribute:`allow-manual-collapse`,mode:`boolean`})],xC.prototype,`allowManualCollapse`,void 0),q([D({attribute:`allow-close-all`,mode:`boolean`})],xC.prototype,`allowCloseAll`,void 0),q([D({attribute:`design-system-prefix`})],xC.prototype,`designSystemPrefix`,void 0),q([D({attribute:`show-count`,mode:`boolean`})],xC.prototype,`showCount`,void 0),q([D({attribute:`stack-collapsed`,mode:`boolean`})],xC.prototype,`stackCollapsed`,void 0),q([D({attribute:`notification-interval`})],xC.prototype,`notificationInterval`,void 0),q([C],xC.prototype,`sortFn`,void 0),q([C],xC.prototype,`slottedNodes`,void 0),xC=q([$e({name:`notify-container`,template:Ise,styles:Pse})],xC);let SC={alert:Ese,toast:yC,dialog:kse,snackbar:jse,banner:Dse},CC=(e,t,n)=>{Object.keys(e?.config||{}).forEach(r=>{SC[r]&&SC[r](e,t,n)})};function Lse(e){return e.length===0?``:e.length===1?e[0].message:e.map(e=>e.message).join(`; `)}function wC(e,t,n){t?.trim()&&CC({title:e,body:t,config:{toast:{autoClose:!0,closeTimeout:4e3,type:`error`}}},n)}var TC=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 Zb()}get criteriaChips(){return this.activeGroups.flatMap((e,t)=>e.clauses.map((e,n)=>({groupIndex:t,clauseIndex:n,fieldLabel:this.getFieldLabel(e.field),operatorLabel:mse[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=rC(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){wC(`AI criteria search`,`AI provider not configured`,gb(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)){wC(`AI criteria search`,`AI could not interpret the criteria`,gb(this)),this.isInterpreting=!1;return}let{valid:i,invalid:a}=Sse(r.groups,this.fieldMetadata);if(a.length>0&&(wC(`Criteria validation error`,Lse(a),gb(this)),this.$emit(`validation-errors`,a)),i.length>0){let e=[...this.activeGroups,...i],t=rC(e);this.lastValidCriteria=t,this.activeGroups=e,this.inputValue=``,this.showingChips=!0,this.$emit(`criteria-changed`,t)}}catch(e){wC(`AI criteria search`,e instanceof Error?e.message:`Interpretation failed`,gb(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=Qb((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([QS],TC.prototype,`providerRegistry`,void 0),q([D],TC.prototype,`placeholder`,void 0),q([D({mode:`boolean`})],TC.prototype,`disabled`,void 0),q([C],TC.prototype,`inputValue`,void 0),q([C],TC.prototype,`isInterpreting`,void 0),q([C],TC.prototype,`lastValidCriteria`,void 0),q([C],TC.prototype,`activeGroups`,void 0),q([C],TC.prototype,`showingChips`,void 0),q([C],TC.prototype,`fieldMetadata`,void 0),q([C],TC.prototype,`isRecording`,void 0),q([w],TC.prototype,`speechAvailable`,null),q([w],TC.prototype,`criteriaChips`,null);let EC={};TC.compose(Object.assign({baseName:`ai-criteria-search`,template:nC,styles:tC,shadowOptions:void 0},EC));let DC=(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%}`,Rse=e=>T` ${A(()=>Yb(),T`<div class="ai-indicator-container" part="ai-indicator-container"><div class=${e=>pn(`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()}}>
|
|
257
|
-
Install model </${e}-button>`)}</div>`)}</div>`)} `,OC=T` ${e=>Rse(gb(e))} `;var kC=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){mb(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([QS],kC.prototype,`providerRegistry`,void 0),q([C],kC.prototype,`status`,void 0),q([C],kC.prototype,`open`,void 0),q([C],kC.prototype,`state`,void 0),q([C],kC.prototype,`isInstalling`,void 0),q([w],kC.prototype,`chromeStatusLabel`,null),q([w],kC.prototype,`canInstall`,null),q([w],kC.prototype,`isDownloading`,null),kC.compose({baseName:`ai-indicator`,template:OC,styles:DC});let AC=(e,t)=>Un(e,t),jC=(e,t)=>O` ${Il(e,t)}`;var MC=class extends Ll{};let NC={delegatesFocus:!0,mode:`open`},PC={};MC.compose(Object.assign({baseName:`anchor`,template:AC,styles:jC,shadowOptions:NC},PC));let FC=(e,t)=>qn(e,t),IC=(e,t)=>O` ${Rl(e,t)}`;var LC=class extends Yn{};let RC={delegatesFocus:!0,mode:`open`},zC={};LC.compose(Object.assign({baseName:`anchored-region`,template:FC,styles:IC,shadowOptions:RC},zC));let BC=(e,t)=>tr(e,t),zse=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,VC=(e,t)=>O` ${zl(e,t)}`;var HC=class extends Bl{};let UC={delegatesFocus:!0,mode:`open`},WC={media:zse};HC.compose(Object.assign({baseName:`avatar`,template:BC,styles:VC,shadowOptions:UC},WC));let GC=(e,t)=>rr(e,t),KC=(e,t)=>O` ${Vl(e,t)}`;var qC=class extends ir{};let JC={};qC.compose(Object.assign({baseName:`badge`,template:GC,styles:KC,shadowOptions:void 0},JC));let YC=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}`,Bse=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>`,XC=T` ${e=>Bse(gb(e))} `,ZC={mode:`open`,delegatesFocus:!0};var QC=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){fb.error(e)}})}};q([C],QC.prototype,`dismissAnimation`,void 0),q([C],QC.prototype,`notification`,void 0),QC.compose({baseName:`banner`,styles:YC,template:XC,shadowOptions:ZC});let $C=(e,t)=>sr(e,t),ew=(e,t)=>O` ${Ul(e,t)}`;var tw=class extends cr{};tw.compose(Object.assign({baseName:`breadcrumb`,template:$C,styles:ew,shadowOptions:void 0},{}));let nw=(e,t)=>ar(e,t),rw=(e,t)=>O` ${Hl(e,t)}`;var iw=class extends or{};let aw={separator:`/`};iw.compose(Object.assign({baseName:`breadcrumb-item`,template:nw,styles:rw,shadowOptions:void 0},aw));let ow=(e,t)=>lr(e,t),sw=(e,t)=>O` ${Wl(e,t)}`;var cw=class extends Gl{};let lw={delegatesFocus:!0,mode:`open`},uw={};cw.compose(Object.assign({baseName:`button`,template:ow,styles:sw,shadowOptions:lw},uw));let dw=()=>O` ${Kl}`,fw=(e,t)=>jr(e,t);var pw=class extends xr{};let mw={delegatesFocus:!0,mode:`open`},hw={};pw.compose(Object.assign({baseName:`calendar`,template:fw,styles:dw,shadowOptions:mw},hw));let gw=(e,t)=>Mr(e,t),_w=(e,t)=>O` ${ql(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var vw=class extends Jl{};let yw={};vw.compose(Object.assign({baseName:`card`,template:gw,styles:_w,shadowOptions:void 0},yw));var bw;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(bw||(bw={}));var xw=/* @__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 Sw=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 Cw;let ww=Cw=class extends pb{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=Cw.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.select instanceof $l,r=this.options?.find(e=>String(n?e.label:e.value)===String(t)),i=!r&&this.allowCustomOptions&&n?{label:t,value:t}:r??null;this.select.$emit(`value-change`,i)}}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??`${gb(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:Cw.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||fb.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!==rg.DATASERVER}catch(e){fb.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){fb.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-Cw.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===rg.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 $l&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){let e=yield this.datasource.init(this.datasourceOptions(),!0);if(this.isConnected){if(!e){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}Ib(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 Cw||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 $l&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof $l&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof $l&&!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 $l?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof $l&&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){fb.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){fb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){fb.debug(`handleStreamUpdates - Method not implemented.`)}};ww.defaultPageSize=20,ww.scrollLoadThresholdPx=32,q([By],ww.prototype,`resources`,void 0),q([D({attribute:`label-field`})],ww.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],ww.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],ww.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],ww.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],ww.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],ww.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],ww.prototype,`pageSize`,void 0),q([C],ww.prototype,`labelFormatter`,void 0),q([C],ww.prototype,`labelRowFormatter`,void 0),q([C],ww.prototype,`initialSelectedValue`,void 0),ww=Cw=q([$e({name:`options-datasource`})],ww);let Tw=class extends pb{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||fb.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){fb.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){fb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){fb.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],Tw.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],Tw.prototype,`labelField`,void 0),Tw=q([$e({name:`multiselect-datasource`})],Tw);let Ew=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>pn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:ga})}></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=${lf(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=>pn([`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=>pn(`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=>pn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:ga})}></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 Tw})}></slot>`,Vse=T` ${Ew()} `,Dw={};var Ow=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=bw.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,xw.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===bw.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?bw.ABOVE:bw.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===bw.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===bw.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.trim().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.updateSelection(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.updateSelection(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=>{if(!t)return!1;let n=typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t);return n==null||typeof n==`object`?!1:String(n).toLowerCase()===e})}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(!t)return!1;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label!=null&&typeof t.label!=`object`&&typeof t.label!=`function`?String(t.label).toLowerCase():``,r=t=>Object.values(t).some(t=>t==null||typeof t==`function`?!1:typeof t==`object`?r(t):String(t).toLowerCase().includes(e)),i=t.value!=null&&typeof t.value==`object`?r(t.value):t.value!=null&&typeof t.value!=`function`&&String(t.value).toLowerCase().includes(e);return n.includes(e)||i})}updateSelection(e){this.selectedOptions=e,this.$emit(`selectionChange`,this.selectedOptions)}addOption(){let e=this.filterSearchValue.trim();if(!e||this.options.some(t=>this.optionValueGetter(t)===e))return;let t={value:e,label:e};this.$emit(`optionCreated`,t)!==!1&&(this.options=[t,...this.options],this.setFilter(),this.updateSelection([...this.selectedOptions,e]))}asyncSetFilter(){this.slottedDatasource.length>0?Fb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,fb.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){mb(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.updateSelection([]),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],Ow.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Ow.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Ow.prototype,`all`,void 0),q([D({mode:`boolean`})],Ow.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],Ow.prototype,`search`,void 0),q([D({mode:`boolean`})],Ow.prototype,`disabled`,void 0),q([D({mode:`boolean`})],Ow.prototype,`creatable`,void 0),q([D({mode:`boolean`})],Ow.prototype,`async`,void 0),q([D],Ow.prototype,`debounce`,void 0),q([D({mode:`boolean`})],Ow.prototype,`resizable`,void 0),q([D],Ow.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],Ow.prototype,`filterByContains`,void 0),q([C],Ow.prototype,`defaultSlottedNodes`,void 0),q([C],Ow.prototype,`slottedDatasource`,void 0),q([C],Ow.prototype,`valueFormatter`,void 0),q([C],Ow.prototype,`loading`,void 0),q([C],Ow.prototype,`filterSearchValue`,void 0),q([C],Ow.prototype,`open`,void 0),q([C],Ow.prototype,`options`,void 0),q([C],Ow.prototype,`selectedOptions`,void 0),q([C],Ow.prototype,`filteredAvailableOptions`,void 0),q([C],Ow.prototype,`scrollContainer`,void 0),q([D],Ow.prototype,`position`,void 0),q([C],Ow.prototype,`onAllSelectedCallback`,void 0),q([C],Ow.prototype,`itemRenderer`,void 0),q([w],Ow.prototype,`getDisplayValue`,null),q([w],Ow.prototype,`getPlaceholder`,null),q([w],Ow.prototype,`isAllOptionsDisabled`,null),q([w],Ow.prototype,`areAllOptionsSelected`,null),q([w],Ow.prototype,`showCreatable`,null),q([C],Ow.prototype,`optionsHeaderSlottedNodes`,void 0),Ow.compose(Object.assign({baseName:`multiselect`,template:Vse,styles:Sw,shadowOptions:void 0},Dw));let kw=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=>pn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:ga})}></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=${lf(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>`,Hse=T` ${Aw()} `,jw={};var Mw=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=bw.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===bw.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?bw.BELOW:bw.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?bw.ABOVE:bw.BELOW}}e===bw.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===bw.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.filterSearchValue.toLowerCase(),t=this.options.filter(t=>{if(!t)return!1;let n=t.description,r=t.label??t.value;return!!(n!=null&&String(n).toLowerCase().includes(e)||r!=null&&String(r).toLowerCase().includes(e))});this.filteredAvailableOptions=this.sortFilteredOptions(t)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){mb(e,this)&&(this.open=!1)}};q([D],Mw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Mw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Mw.prototype,`search`,void 0),q([D({mode:`boolean`})],Mw.prototype,`disabled`,void 0),q([C],Mw.prototype,`defaultSlottedNodes`,void 0),q([C],Mw.prototype,`valueFormatter`,void 0),q([C],Mw.prototype,`filterSearchValue`,void 0),q([C],Mw.prototype,`open`,void 0),q([C],Mw.prototype,`options`,void 0),q([C],Mw.prototype,`selectedOptions`,void 0),q([C],Mw.prototype,`filteredAvailableOptions`,void 0),q([C],Mw.prototype,`position`,void 0),q([w],Mw.prototype,`getPlaceholder`,null),Mw.compose(Object.assign({baseName:`categorized-multiselect`,template:Hse,styles:kw,shadowOptions:void 0},jw));let Nw=(e,t)=>Pr(e,t),Pw=(e,t)=>O` ${Yl(e,t)}`;var Fw=class extends Fr{};let Iw={checkedIndicator:`
|
|
257
|
+
Install model </${e}-button>`)}</div>`)}</div>`)} `,OC=T` ${e=>Rse(gb(e))} `;var kC=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){mb(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([QS],kC.prototype,`providerRegistry`,void 0),q([C],kC.prototype,`status`,void 0),q([C],kC.prototype,`open`,void 0),q([C],kC.prototype,`state`,void 0),q([C],kC.prototype,`isInstalling`,void 0),q([w],kC.prototype,`chromeStatusLabel`,null),q([w],kC.prototype,`canInstall`,null),q([w],kC.prototype,`isDownloading`,null),kC.compose({baseName:`ai-indicator`,template:OC,styles:DC});let AC=(e,t)=>Un(e,t),jC=(e,t)=>O` ${Il(e,t)}`;var MC=class extends Ll{};let NC={delegatesFocus:!0,mode:`open`},PC={};MC.compose(Object.assign({baseName:`anchor`,template:AC,styles:jC,shadowOptions:NC},PC));let FC=(e,t)=>qn(e,t),IC=(e,t)=>O` ${Rl(e,t)}`;var LC=class extends Yn{};let RC={delegatesFocus:!0,mode:`open`},zC={};LC.compose(Object.assign({baseName:`anchored-region`,template:FC,styles:IC,shadowOptions:RC},zC));let BC=(e,t)=>tr(e,t),zse=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,VC=(e,t)=>O` ${zl(e,t)}`;var HC=class extends Bl{};let UC={delegatesFocus:!0,mode:`open`},WC={media:zse};HC.compose(Object.assign({baseName:`avatar`,template:BC,styles:VC,shadowOptions:UC},WC));let GC=(e,t)=>rr(e,t),KC=(e,t)=>O` ${Vl(e,t)}`;var qC=class extends ir{};let JC={};qC.compose(Object.assign({baseName:`badge`,template:GC,styles:KC,shadowOptions:void 0},JC));let YC=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}`,Bse=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>`,XC=T` ${e=>Bse(gb(e))} `,ZC={mode:`open`,delegatesFocus:!0};var QC=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){fb.error(e)}})}};q([C],QC.prototype,`dismissAnimation`,void 0),q([C],QC.prototype,`notification`,void 0),QC.compose({baseName:`banner`,styles:YC,template:XC,shadowOptions:ZC});let $C=(e,t)=>sr(e,t),ew=(e,t)=>O` ${Ul(e,t)}`;var tw=class extends cr{};tw.compose(Object.assign({baseName:`breadcrumb`,template:$C,styles:ew,shadowOptions:void 0},{}));let nw=(e,t)=>ar(e,t),rw=(e,t)=>O` ${Hl(e,t)}`;var iw=class extends or{};let aw={separator:`/`};iw.compose(Object.assign({baseName:`breadcrumb-item`,template:nw,styles:rw,shadowOptions:void 0},aw));let ow=(e,t)=>lr(e,t),sw=(e,t)=>O` ${Wl(e,t)}`;var cw=class extends Gl{};let lw={delegatesFocus:!0,mode:`open`},uw={};cw.compose(Object.assign({baseName:`button`,template:ow,styles:sw,shadowOptions:lw},uw));let dw=()=>O` ${Kl}`,fw=(e,t)=>jr(e,t);var pw=class extends xr{};let mw={delegatesFocus:!0,mode:`open`},hw={};pw.compose(Object.assign({baseName:`calendar`,template:fw,styles:dw,shadowOptions:mw},hw));let gw=(e,t)=>Mr(e,t),_w=(e,t)=>O` ${ql(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var vw=class extends Jl{};let yw={};vw.compose(Object.assign({baseName:`card`,template:gw,styles:_w,shadowOptions:void 0},yw));var bw;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(bw||(bw={}));var xw=/* @__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 Sw=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 Cw;let ww=Cw=class extends pb{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=Cw.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.initialValueLookup=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.restoreCriteriaAfterInitialValueLookup(),this.infiniteScroll&&(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.select instanceof $l,r=this.options?.find(e=>String(n?e.label:e.value)===String(t)),i=!r&&this.allowCustomOptions&&n?{label:t,value:t}:r??null;this.select.$emit(`value-change`,i)}}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??`${gb(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:Cw.defaultPageSize,yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||fb.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)}restoreCriteriaAfterInitialValueLookup(){let e=this.initialValueLookup;this.initialValueLookup=null,e&&this.criteria===e.criteria&&(this.criteria=e.restoreTo)}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!==rg.DATASERVER}catch(e){fb.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){fb.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-Cw.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===rg.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 $l&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){let e=yield this.datasource.init(this.datasourceOptions(),!0);if(!this.isConnected)return;if(!e){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}let t=this.criteriaBeforeInitialValueLookup();Ib(this,this.initialSelectedValue),this.initialValueLookup={criteria:this.criteria,restoreTo:t}})}criteriaBeforeInitialValueLookup(){let e=this.initialValueLookup;return e&&this.criteria===e.criteria?e.restoreTo:this.criteria}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 Cw||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 $l&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof $l&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof $l&&!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 $l?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof $l&&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){fb.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){fb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){fb.debug(`handleStreamUpdates - Method not implemented.`)}};ww.defaultPageSize=20,ww.scrollLoadThresholdPx=32,q([By],ww.prototype,`resources`,void 0),q([D({attribute:`label-field`})],ww.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],ww.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],ww.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],ww.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],ww.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],ww.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],ww.prototype,`pageSize`,void 0),q([C],ww.prototype,`labelFormatter`,void 0),q([C],ww.prototype,`labelRowFormatter`,void 0),q([C],ww.prototype,`initialSelectedValue`,void 0),ww=Cw=q([$e({name:`options-datasource`})],ww);let Tw=class extends pb{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||fb.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){fb.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){fb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){fb.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],Tw.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],Tw.prototype,`labelField`,void 0),Tw=q([$e({name:`multiselect-datasource`})],Tw);let Ew=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>pn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${xt({property:`defaultSlottedNodes`,filter:ga})}></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=${lf(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=>pn([`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=>pn(`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=>pn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${xt({property:`optionsHeaderSlottedNodes`,filter:ga})}></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 Tw})}></slot>`,Vse=T` ${Ew()} `,Dw={};var Ow=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=bw.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,xw.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===bw.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?bw.ABOVE:bw.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===bw.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===bw.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.trim().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.updateSelection(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.updateSelection(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=>{if(!t)return!1;let n=typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t);return n==null||typeof n==`object`?!1:String(n).toLowerCase()===e})}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(!t)return!1;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label!=null&&typeof t.label!=`object`&&typeof t.label!=`function`?String(t.label).toLowerCase():``,r=t=>Object.values(t).some(t=>t==null||typeof t==`function`?!1:typeof t==`object`?r(t):String(t).toLowerCase().includes(e)),i=t.value!=null&&typeof t.value==`object`?r(t.value):t.value!=null&&typeof t.value!=`function`&&String(t.value).toLowerCase().includes(e);return n.includes(e)||i})}updateSelection(e){this.selectedOptions=e,this.$emit(`selectionChange`,this.selectedOptions)}addOption(){let e=this.filterSearchValue.trim();if(!e||this.options.some(t=>this.optionValueGetter(t)===e))return;let t={value:e,label:e};this.$emit(`optionCreated`,t)!==!1&&(this.options=[t,...this.options],this.setFilter(),this.updateSelection([...this.selectedOptions,e]))}asyncSetFilter(){this.slottedDatasource.length>0?Fb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,fb.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){mb(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.updateSelection([]),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};q([D],Ow.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Ow.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Ow.prototype,`all`,void 0),q([D({mode:`boolean`})],Ow.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],Ow.prototype,`search`,void 0),q([D({mode:`boolean`})],Ow.prototype,`disabled`,void 0),q([D({mode:`boolean`})],Ow.prototype,`creatable`,void 0),q([D({mode:`boolean`})],Ow.prototype,`async`,void 0),q([D],Ow.prototype,`debounce`,void 0),q([D({mode:`boolean`})],Ow.prototype,`resizable`,void 0),q([D],Ow.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],Ow.prototype,`filterByContains`,void 0),q([C],Ow.prototype,`defaultSlottedNodes`,void 0),q([C],Ow.prototype,`slottedDatasource`,void 0),q([C],Ow.prototype,`valueFormatter`,void 0),q([C],Ow.prototype,`loading`,void 0),q([C],Ow.prototype,`filterSearchValue`,void 0),q([C],Ow.prototype,`open`,void 0),q([C],Ow.prototype,`options`,void 0),q([C],Ow.prototype,`selectedOptions`,void 0),q([C],Ow.prototype,`filteredAvailableOptions`,void 0),q([C],Ow.prototype,`scrollContainer`,void 0),q([D],Ow.prototype,`position`,void 0),q([C],Ow.prototype,`onAllSelectedCallback`,void 0),q([C],Ow.prototype,`itemRenderer`,void 0),q([w],Ow.prototype,`getDisplayValue`,null),q([w],Ow.prototype,`getPlaceholder`,null),q([w],Ow.prototype,`isAllOptionsDisabled`,null),q([w],Ow.prototype,`areAllOptionsSelected`,null),q([w],Ow.prototype,`showCreatable`,null),q([C],Ow.prototype,`optionsHeaderSlottedNodes`,void 0),Ow.compose(Object.assign({baseName:`multiselect`,template:Vse,styles:Sw,shadowOptions:void 0},Dw));let kw=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=>pn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${xt({property:`defaultSlottedNodes`,filter:ga})}></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=${lf(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>`,Hse=T` ${Aw()} `,jw={};var Mw=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=bw.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===bw.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?bw.BELOW:bw.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?bw.ABOVE:bw.BELOW}}e===bw.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===bw.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.filterSearchValue.toLowerCase(),t=this.options.filter(t=>{if(!t)return!1;let n=t.description,r=t.label??t.value;return!!(n!=null&&String(n).toLowerCase().includes(e)||r!=null&&String(r).toLowerCase().includes(e))});this.filteredAvailableOptions=this.sortFilteredOptions(t)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){mb(e,this)&&(this.open=!1)}};q([D],Mw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Mw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Mw.prototype,`search`,void 0),q([D({mode:`boolean`})],Mw.prototype,`disabled`,void 0),q([C],Mw.prototype,`defaultSlottedNodes`,void 0),q([C],Mw.prototype,`valueFormatter`,void 0),q([C],Mw.prototype,`filterSearchValue`,void 0),q([C],Mw.prototype,`open`,void 0),q([C],Mw.prototype,`options`,void 0),q([C],Mw.prototype,`selectedOptions`,void 0),q([C],Mw.prototype,`filteredAvailableOptions`,void 0),q([C],Mw.prototype,`position`,void 0),q([w],Mw.prototype,`getPlaceholder`,null),Mw.compose(Object.assign({baseName:`categorized-multiselect`,template:Hse,styles:kw,shadowOptions:void 0},jw));let Nw=(e,t)=>Pr(e,t),Pw=(e,t)=>O` ${Yl(e,t)}`;var Fw=class extends Fr{};let Iw={checkedIndicator:`
|
|
258
258
|
<svg
|
|
259
259
|
aria-hidden="true"
|
|
260
260
|
part="checked-indicator"
|
|
@@ -223,7 +223,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
223
223
|
`:`,`;var o=JSON.stringify(n);u+=i?s+o+`: `:o+`:`,u+=a(r,s)}}),u+=i?`
|
|
224
224
|
`+r+`}`:`}`,u}function c(e,t){return t!==void 0&&typeof t!=`function`&&Jp(t)!==`symbol`}}function Ore(e){if(typeof e==`number`)return` `.repeat(e);if(typeof e==`string`&&e!==``)return e}let kre=N.createInterface();function Are(e){return Number.isSafeInteger(+e)?Number(e):Vf(e)?BigInt.asIntN(64,e):parseFloat(e)}let jre={parse:e=>xp(e,null,Are),stringify:e=>Yp(e)},Xp=class{constructor(e=jre){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?typeof e==`string`?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};Xp=q([rd(0,It(kre))],Xp);let Zp=N.createInterface(e=>e.singleton(Xp));function Qp(e){return typeof e==`function`}function $p(e){var t=e(function(e){Error.call(e),e.stack=(/* @__PURE__ */ Error()).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var em=$p(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
225
225
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
226
|
-
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function tm(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var nm=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=ad(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Qp(c))try{c()}catch(e){i=e instanceof em?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ad(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{am(f)}catch(e){i=i??[],e instanceof em?i=sd(sd([],od(i)),od(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new em(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)am(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&tm(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&tm(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),rm=nm.EMPTY;function im(e){return e instanceof nm||e&&`closed`in e&&Qp(e.remove)&&Qp(e.add)&&Qp(e.unsubscribe)}function am(e){Qp(e)?e():e.unsubscribe()}var om={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},sm={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=sm.delegate;return i?.setTimeout?i.setTimeout.apply(i,sd([e,t],od(n))):setTimeout.apply(void 0,sd([e,t],od(n)))},clearTimeout:function(e){return(sm.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function cm(e){sm.setTimeout(function(){var t=om.onUnhandledError;if(t)t(e);else throw e})}function lm(){}var Mre=(function(){return um(`C`,void 0,void 0)})();function Nre(e){return um(`E`,void 0,e)}function Pre(e){return um(`N`,e,void 0)}function um(e,t,n){return{kind:e,value:t,error:n}}var dm=null;function fm(e){if(om.useDeprecatedSynchronousErrorHandling){var t=!dm;if(t&&(dm={errorThrown:!1,error:null}),e(),t){var n=dm,r=n.errorThrown,i=n.error;if(dm=null,r)throw i}}else e()}function Fre(e){om.useDeprecatedSynchronousErrorHandling&&dm&&(dm.errorThrown=!0,dm.error=e)}var pm=function(e){ed(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,im(t)&&t.add(n)):n.destination=zre,n}return t.create=function(e,t,n){return new hm(e,t,n)},t.prototype.next=function(e){this.isStopped?_m(Pre(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_m(Nre(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_m(Mre,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(nm),Ire=Function.prototype.bind;function mm(e,t){return Ire.call(e,t)}var Lre=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){gm(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){gm(e)}else gm(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){gm(e)}},e}(),hm=function(e){ed(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Qp(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&om.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&mm(t.next,o),error:t.error&&mm(t.error,o),complete:t.complete&&mm(t.complete,o)}):a=t}return i.destination=new Lre(a),i}return t}(pm);function gm(e){om.useDeprecatedSynchronousErrorHandling?Fre(e):cm(e)}function Rre(e){throw e}function _m(e,t){var n=om.onStoppedNotification;n&&sm.setTimeout(function(){return n(e,t)})}var zre={closed:!0,next:lm,error:Rre,complete:lm},vm=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function ym(e){return e}function Bre(e){return e.length===0?ym:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var bm=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Hre(e)?e:new hm(e,t,n);return fm(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=xm(t),new t(function(t,r){var i=new hm({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[vm]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Bre(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=xm(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function xm(e){return e??om.Promise??Promise}function Vre(e){return e&&Qp(e.next)&&Qp(e.error)&&Qp(e.complete)}function Hre(e){return e&&e instanceof pm||Vre(e)&&im(e)}function Sm(e){return Qp(e?.lift)}function Cm(e){return function(t){if(Sm(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function wm(e,t,n,r,i){return new Ure(e,t,n,r,i)}var Ure=function(e){ed(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(pm);function Wre(){return Cm(function(e,t){var n=null;e._refCount++;var r=wm(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){n=null;return}var r=e._connection,i=n;n=null,r&&(!i||r===i)&&r.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}(function(e){ed(t,e);function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Sm(t)&&(r.lift=t.lift),r}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new nm;var n=this.getSubject();t.add(this.source.subscribe(wm(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=nm.EMPTY)}return t},t.prototype.refCount=function(){return Wre()(this)},t})(bm);var Tm={now:function(){return(Tm.delegate||performance).now()},delegate:void 0},Em={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=Em.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(t){n=void 0,e(t)});return new nm(function(){return n?.(i)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Em.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,sd([],od(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Em.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,sd([],od(e)))},delegate:void 0};function Gre(e){return new bm(function(t){var n=e||Tm,r=n.now(),i=0,a=function(){t.closed||(i=Em.requestAnimationFrame(function(o){i=0;var s=n.now();t.next({timestamp:e?s:o,elapsed:s-r}),a()}))};return a(),function(){i&&Em.cancelAnimationFrame(i)}})}Gre();var Kre=$p(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Dm=function(e){ed(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Om(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Kre},t.prototype.next=function(e){var t=this;fm(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=ad(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;fm(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;fm(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?rm:(this.currentObservers=null,a.push(e),new nm(function(){t.currentObservers=null,tm(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new bm;return e.source=this,e},t.create=function(e,t){return new Om(e,t)},t}(bm),Om=function(e){ed(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??rm},t}(Dm),km=function(e){ed(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Dm),Am={now:function(){return(Am.delegate||Date).now()},delegate:void 0},jm=function(e){ed(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Am);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(Dm);(function(e){ed(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},t})(Dm);var qre=function(e){ed(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(nm),Mm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Mm.delegate;return i?.setInterval?i.setInterval.apply(i,sd([e,t],od(n))):setInterval.apply(void 0,sd([e,t],od(n)))},clearInterval:function(e){return(Mm.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Nm=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),Mm.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&Mm.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return/* @__PURE__ */ Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||/* @__PURE__ */ Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,tm(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(qre),Jre=1,Pm,Fm={};function Im(e){return e in Fm&&(delete Fm[e],!0)}var Lm={setImmediate:function(e){var t=Jre++;return Fm[t]=!0,Pm||(Pm=Promise.resolve()),Pm.then(function(){return Im(t)&&e()}),t},clearImmediate:function(e){Im(e)}},Yre=Lm.setImmediate,Xre=Lm.clearImmediate,Rm={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Rm.delegate?.setImmediate||Yre).apply(void 0,sd([],od(e)))},clearImmediate:function(e){return(Rm.delegate?.clearImmediate||Xre)(e)},delegate:void 0},Zre=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Rm.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&i[i.length-1]?.id!==n&&(Rm.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(Nm),zm=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Am.now,e}(),Bm=function(e){ed(t,e);function t(t,n){n===void 0&&(n=zm.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(zm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Bm))(Zre);var Vm=new Bm(Nm),Qre=Vm,$re=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(Nm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Bm))($re);var eie=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Em.requestAnimationFrame(function(){return t.flush(void 0)})))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&n===t._scheduled&&i[i.length-1]?.id!==n&&(Em.cancelAnimationFrame(n),t._scheduled=void 0)},t}(Nm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Bm))(eie),function(e){ed(t,e);function t(t,n){t===void 0&&(t=tie),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},t.frameTimeFactor=10,t}(Bm);var tie=function(e){ed(t,e);function t(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t.prototype.schedule=function(n,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return nm.EMPTY},t.prototype.requestAsyncId=function(e,n,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},t.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Nm),Hm=new bm(function(e){return e.complete()});function Um(e){return e&&Qp(e.schedule)}function Wm(e){return e[e.length-1]}function nie(e){return Qp(Wm(e))?e.pop():void 0}function Gm(e){return Um(Wm(e))?e.pop():void 0}var Km=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function qm(e){return Qp(e?.then)}function Jm(e){return Qp(e[vm])}function Ym(e){return Symbol.asyncIterator&&Qp(e?.[Symbol.asyncIterator])}function Xm(e){return/* @__PURE__ */ TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function rie(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Zm=rie();function Qm(e){return Qp(e?.[Zm])}function $m(e){return Yne(this,arguments,function(){var t,n,r,i;return id(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,cd(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,cd(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,cd(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function eh(e){return Qp(e?.getReader)}function th(e){if(e instanceof bm)return e;if(e!=null){if(Jm(e))return iie(e);if(Km(e))return aie(e);if(qm(e))return oie(e);if(Ym(e))return nh(e);if(Qm(e))return sie(e);if(eh(e))return cie(e)}throw Xm(e)}function iie(e){return new bm(function(t){var n=e[vm]();if(Qp(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function aie(e){return new bm(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function oie(e){return new bm(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,cm)})}function sie(e){return new bm(function(t){var n,r;try{for(var i=ad(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function nh(e){return new bm(function(t){lie(e,t).catch(function(e){return t.error(e)})})}function cie(e){return nh($m(e))}function lie(e,t){var n,r,i,a;return J(this,void 0,void 0,function(){var o,s;return id(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Xne(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function rh(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ih(e,t){return t===void 0&&(t=0),Cm(function(n,r){n.subscribe(wm(r,function(n){return rh(r,e,function(){return r.next(n)},t)},function(){return rh(r,e,function(){return r.complete()},t)},function(n){return rh(r,e,function(){return r.error(n)},t)}))})}function ah(e,t){return t===void 0&&(t=0),Cm(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function uie(e,t){return th(e).pipe(ah(t),ih(t))}function die(e,t){return th(e).pipe(ah(t),ih(t))}function fie(e,t){return new bm(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function pie(e,t){return new bm(function(n){var r;return rh(n,t,function(){r=e[Zm](),rh(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return Qp(r?.return)&&r.return()}})}function oh(e,t){if(!e)throw Error(`Iterable cannot be null`);return new bm(function(n){rh(n,t,function(){var r=e[Symbol.asyncIterator]();rh(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function mie(e,t){return oh($m(e),t)}function hie(e,t){if(e!=null){if(Jm(e))return uie(e,t);if(Km(e))return fie(e,t);if(qm(e))return die(e,t);if(Ym(e))return oh(e,t);if(Qm(e))return pie(e,t);if(eh(e))return mie(e,t)}throw Xm(e)}function sh(e,t){return t?hie(e,t):th(e)}function ch(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return sh(e,Gm(e))}function lh(e,t){var n=Qp(e)?e:function(){return e},r=function(e){return e.error(n())};return new bm(t?function(e){return t.schedule(r,0,e)}:r)}var uh;(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(uh||(uh={})),function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return gie(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return Qp(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i=t===`N`?ch(n):t===`E`?lh(function(){return r}):t===`C`?Hm:0;if(!i)throw TypeError(`Unexpected notification kind `+t);return i},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e}();function gie(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}var _ie=$p(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function vie(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new hm({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new _ie)}});e.subscribe(a)})}$p(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}}),$p(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}}),$p(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}});function yie(e){return e instanceof Date&&!isNaN(e)}$p(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function dh(e,t){return Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){r.next(e.call(t,n,i++))}))})}var bie=Array.isArray;function xie(e,t){return bie(t)?e.apply(void 0,sd([],od(t))):e(t)}function Sie(e){return dh(function(t){return xie(e,t)})}var Cie=Array.isArray,wie=Object.getPrototypeOf,Tie=Object.prototype,Eie=Object.keys;function Die(e){if(e.length===1){var t=e[0];if(Cie(t))return{args:t,keys:null};if(Oie(t)){var n=Eie(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function Oie(e){return e&&typeof e==`object`&&wie(e)===Tie}function kie(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function Aie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Gm(e),r=nie(e),i=Die(e),a=i.args,o=i.keys;if(a.length===0)return sh([],n);var s=new bm(jie(a,n,o?function(e){return kie(o,e)}:ym));return r?s.pipe(Sie(r)):s}function jie(e,t,n){return n===void 0&&(n=ym),function(r){fh(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){fh(t,function(){var c=sh(e[i],t),l=!1;c.subscribe(wm(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function fh(e,t,n){e?rh(n,e,t):t()}function Mie(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;th(n(e,u++)).subscribe(wm(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?rh(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(wm(t,p,function(){d=!0,f()})),function(){s?.()}}function ph(e,t,n){return n===void 0&&(n=1/0),Qp(t)?ph(function(n,r){return dh(function(e,i){return t(n,e,r,i)})(th(e(n,r)))},n):(typeof t==`number`&&(n=t),Cm(function(t,r){return Mie(t,r,e,n)}))}function Nie(e){return e===void 0&&(e=1/0),ph(ym,e)}function Pie(){return Nie(1)}function mh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pie()(sh(e,Gm(e)))}function hh(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Qre);var r=-1;return t!=null&&(Um(t)?n=t:r=t),new bm(function(t){var i=yie(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function Fie(e,t){return e===void 0&&(e=0),t===void 0&&(t=Vm),e<0&&(e=0),hh(e,e,t)}new bm(lm),Array.isArray;function gh(e,t){return Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Iie(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(wm(o,function(t){var n=l++;c=s?e(c,t,n):(s=!0,t),r&&o.next(c)},i&&(function(){s&&o.next(c),o.complete()})))}}function _h(e,t){return t?function(n){return n.pipe(_h(function(n,r){return th(e(n,r)).pipe(dh(function(e,i){return t(n,e,r,i)}))}))}:Cm(function(t,n){var r=0,i=null,a=!1;t.subscribe(wm(n,function(t){i||(i=wm(n,void 0,function(){i=null,a&&n.complete()}),th(e(t,r++)).subscribe(i))},function(){a=!0,!i&&n.complete()}))})}function vh(e){return Cm(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function Lie(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?ym:Cm(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(wm(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?hh(i):th(i(e,n)),u=wm(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function yh(e,t){return Cm(Iie(e,t,arguments.length>=2,!0))}function bh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Gm(e);return Cm(function(t,r){(n?mh(e,t,n):mh(e,t)).subscribe(r)})}function xh(e,t){return Cm(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(wm(r,function(n){i?.unsubscribe();var o=0,c=a++;th(e(n,c)).subscribe(i=wm(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Sh(e,t){return t===void 0&&(t=!1),Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}))})}var Rie=class{static get isMacOS(){return navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.toLowerCase().includes(`mac os`)}static get isWindows(){return navigator.platform.toLowerCase().includes(`win`)||navigator.userAgent.toLowerCase().includes(`windows`)}static get isLinux(){return navigator.platform.toLowerCase().includes(`linux`)||navigator.userAgent.toLowerCase().includes(`linux`)}static getModifierSymbols(){return this.isMacOS?{ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`}:{ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`,meta:`Win`}}static formatKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.getModifierSymbols(),o=[];t&&o.push(a.ctrl),n&&o.push(a.alt),r&&o.push(a.shift),i&&o.push(a.meta);let s=this.isMacOS?``:`+`,c=this.isMacOS?e.toUpperCase():e;return o.length>0?`${o.join(s)}${s}${c}`:c}};let Ch=`foundation-shortcut-blocked`,wh=`Shortcut blocked`,Th=`This shortcut is currently unavailable in this context.`;function Eh(e,t){let n=Object.assign(Object.assign({},e),{blockedMessage:e.blockedMessage??{title:wh,text:Th}});t&&typeof t.dispatchEvent==`function`?t.dispatchEvent(new CustomEvent(Ch,{bubbles:!0,composed:!0,detail:n})):typeof document<`u`&&document.dispatchEvent(new CustomEvent(Ch,{bubbles:!0,composed:!0,detail:n}))}let Dh={designSystems:[`rapid`],customEditableSelectors:[]},Oh={defaultMessage:{title:wh,text:Th},inputMessage:{title:wh,text:`This shortcut is unavailable while typing in an input field.`},pausedMessage:{title:wh,text:`Shortcuts are paused.`},elementFocusMessage:{title:wh,text:`This shortcut is unavailable in the current focus context.`},emitPausedBlockedEvent:!0};var zie=class{constructor(){this.shortcuts=/* @__PURE__ */ new Map,this.shortcutLookup=/* @__PURE__ */ new Map,this.keyCombinationMap=/* @__PURE__ */ new Map,this._isPausedSubject=new km(!1),this.executionGuards=/* @__PURE__ */ new Map,this.editableContextConfig=Object.assign({},Dh),this.editableSelector=qd(Dh.designSystems,Dh.customEditableSelectors),this.blockedMessageConfig=Object.assign({},Oh)}get isPaused(){return this._isPausedSubject.value}get isPaused$(){return this._isPausedSubject.asObservable()}get isPausedSubject(){return this._isPausedSubject}registerShortcuts(e){e.forEach(e=>{this.registerShortcut(e)})}registerShortcut(e){let t=`${e.context}:${e.id}`,n=this.normalizeShortcutDefinition(e),r=this.createKeyCombinationKey(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),i=Rie.formatKeyCombination(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),a=this.keyCombinationMap.get(r);if(a){let e=[];for(let t of a){let i=this.shortcutLookup.get(t);i&&i.context===n.context&&(Fd.warn(`Shortcut with key combination '${r}' already exists in context '${n.context}' (id: '${i.id}'). It will be replaced by new shortcut '${n.id}'.`),e.push(t))}e.forEach(e=>{let t=this.shortcutLookup.get(e);if(t){let n=this.shortcuts.get(t.context);n&&(n.delete(t.id),n.size===0&&this.shortcuts.delete(t.context)),this.shortcutLookup.delete(e)}a.delete(e)}),a.size===0&&this.keyCombinationMap.delete(r)}return this.shortcuts.has(n.context)||this.shortcuts.set(n.context,/* @__PURE__ */ new Map),this.shortcuts.get(n.context).set(n.id,n),this.shortcutLookup.set(t,n),this.keyCombinationMap.has(r)||this.keyCombinationMap.set(r,/* @__PURE__ */ new Set),this.keyCombinationMap.get(r).add(t),{shortcut:n,id:n.id,keyCombination:r,keyCombinationDisplay:i,disabled:()=>this.getExecutionStatus(n).disabled||!1,tooltip:()=>this.getExecutionStatus(n).tooltip}}unregisterShortcut(e,t){let n=`${e}:${t}`,r=this.shortcuts.get(e);if(r){let i=r.get(t);if(i){let a=this.normalizeShortcutDefinition(i),o=this.createKeyCombinationKey(a.key,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey);r.delete(t),r.size===0&&this.shortcuts.delete(e),this.shortcutLookup.delete(n);let s=this.keyCombinationMap.get(o);s&&(s.delete(n),s.size===0&&this.keyCombinationMap.delete(o))}}}unregisterShortcutsByContext(e){let t=this.shortcuts.get(e);t&&Array.from(t.keys()).forEach(t=>this.unregisterShortcut(e,t))}executeShortcut(e,t){this.executeShortcutByContext(this.getActiveContext(),e,t)}shouldEmitBlockedEvent(e){return e?.emitBlockedEvent!==!1}resolveBlockedMessage(e,t){return e?.blockedMessage??t}executeShortcutByContext(e,t,n){let r=this.shortcuts.get(e)?.get(t);if(this.isPaused){this.blockedMessageConfig.emitPausedBlockedEvent&&this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`paused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.pausedMessage)},n);return}if(r){if(r.elementRef&&!this.isElementFocused(r.elementRef)){this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`element-not-focused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.elementFocusMessage)},n);return}let i=this.getExecutionStatus(r);if(i.disabled){this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`disabled`,blockedMessage:this.resolveBlockedMessage(r,i.tooltip===void 0?this.blockedMessageConfig.defaultMessage:{title:this.blockedMessageConfig.defaultMessage.title,text:i.tooltip})},n);return}try{r.action()}catch(n){Fd.error(`Error executing shortcut ${e}:${t}:`,n)}}}getShortcuts(){let e=[];for(let t of this.shortcuts.values())e.push(...t.values());return e}getShortcutsByContext(e){let t=this.shortcuts.get(e);return t?Array.from(t.values()):[]}findShortcutByKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.createKeyCombinationKey(e,t,n,r,i),o=this.keyCombinationMap.get(a);if(o){if(this._activeContext){let e=this.shortcuts.get(this._activeContext);if(e)for(let t of o){let[n,r]=t.split(`:`);if(n!==this._activeContext)continue;let i=e.get(r);if(i)return i}}for(let e of o){let t=this.shortcutLookup.get(e);if(t)return t}}}getContexts(){return Array.from(this.shortcuts.keys())}getShortcutsByContextMap(){return new Map(this.shortcuts)}registerContext(e){this.shortcuts.has(e)||this.shortcuts.set(e,/* @__PURE__ */ new Map)}setActiveContext(e){this.registerContext(e),this._activeContext=e}getActiveContext(){return this._activeContext}clearActiveContext(){this._activeContext=void 0}registerExecutionGuard(e,t){this.executionGuards.set(e,t)}unregisterExecutionGuard(e){this.executionGuards.delete(e)}clearExecutionGuards(){this.executionGuards.clear()}configureEditableContext(e={}){let t=(e.designSystems??Dh.designSystems).filter(e=>e===`rapid`),n=(e.customEditableSelectors??Dh.customEditableSelectors).map(e=>e?.trim()).filter(e=>!!e);this.editableContextConfig={designSystems:Array.from(new Set(e.designSystems===void 0?Dh.designSystems:t)),customEditableSelectors:Array.from(new Set(n))},this.refreshEditableSelector()}getEditableContextConfig(){return{designSystems:[...this.editableContextConfig.designSystems],customEditableSelectors:[...this.editableContextConfig.customEditableSelectors]}}getEditableSelector(){return this.editableSelector}configureBlockedMessages(e={}){let t=(e,t)=>({title:(e?.title)?.trim()??t.title,text:(e?.text)?.trim()??t.text});this.blockedMessageConfig={defaultMessage:t(e.defaultMessage,Oh.defaultMessage),inputMessage:t(e.inputMessage,Oh.inputMessage),pausedMessage:t(e.pausedMessage,Oh.pausedMessage),elementFocusMessage:t(e.elementFocusMessage,Oh.elementFocusMessage),emitPausedBlockedEvent:e.emitPausedBlockedEvent??Oh.emitPausedBlockedEvent}}getBlockedMessages(){return Object.assign({},this.blockedMessageConfig)}pause(){this._isPausedSubject.next(!0)}resume(){this._isPausedSubject.next(!1)}normalizeShortcutDefinition(e){let t=Object.assign({},e);return(t.optionKey||t.altKey)&&(t.altKey=!0,t.optionKey=!0),t}createKeyCombinationKey(e,t=!1,n=!1,r=!1,i=!1){let a=[];return t&&a.push(`ctrl`),n&&a.push(`alt`),r&&a.push(`shift`),i&&a.push(`meta`),(a.length>0?`${a.join(`+`)}+${e}`:e).toLowerCase()}isElementFocused(e){return e instanceof HTMLElement&&document.activeElement===e}getExecutionStatus(e){if(this.isPaused)return{disabled:!0,tooltip:this.blockedMessageConfig.pausedMessage.text};let t=this.getExecutionGuardStatus();return t.disabled?t:e.canExecute?e.canExecute():{disabled:!1,tooltip:void 0}}getExecutionGuardStatus(){for(let e of this.executionGuards.values()){let t=e(),n=typeof t==`boolean`?{disabled:t}:t;if(n?.disabled)return{disabled:!0,tooltip:n.tooltip}}return{disabled:!1,tooltip:void 0}}refreshEditableSelector(){this.editableSelector=qd(this.editableContextConfig.designSystems,this.editableContextConfig.customEditableSelectors)}};let Bie=N.createInterface(e=>e.singleton(zie)),Vie={Space:`space`,Enter:`enter`,Escape:`escape`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,F1:`f1`,F2:`f2`,F3:`f3`,F4:`f4`,F5:`f5`,F6:`f6`,F7:`f7`,F8:`f8`,F9:`f9`,F10:`f10`,F11:`f11`,F12:`f12`};function Hie(e){return e?e.startsWith(`Key`)?e.replace(`Key`,``).toLowerCase():e.startsWith(`Digit`)?e.replace(`Digit`,``):Vie[e]||e.toLowerCase():``}let kh=class extends Qe{constructor(){super(...arguments),this.keyListener=null,this.isListening=!1}connectedCallback(){super.connectedCallback(),this.addKeyListener()}disconnectedCallback(){super.disconnectedCallback(),this.removeKeyListener()}addKeyListener(){this.isListening||(this.keyListener=this.handleKeyDown.bind(this),document.addEventListener(`keydown`,this.keyListener),this.isListening=!0)}removeKeyListener(){this.isListening&&this.keyListener&&(document.removeEventListener(`keydown`,this.keyListener),this.keyListener=null,this.isListening=!1)}handleKeyDown(e){let t=this.shortcutManager,n=t.getBlockedMessages(),r=t.getEditableSelector(),i=this.getEventElement(e)??this,a=e.ctrlKey||e.altKey||e.shiftKey||e.metaKey,o=Hie(e.code),s=t.findShortcutByKeyCombination(o,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey);if(s){if(ef(e,r)){a&&s.emitBlockedEvent!==!1&&Eh({shortcutId:s.id,context:s.context,reason:`editable-context`,blockedMessage:s.blockedMessage??n.inputMessage},i);return}s&&(e.preventDefault(),e.stopPropagation(),t.executeShortcut(s.id,i))}}getEventElement(e){return(e.composedPath?.call(e)??[]).find(e=>e instanceof Element)??e.target??null}};q([Pt(Bie)],kh.prototype,`shortcutManager`,void 0),kh=q([$e({name:`foundation-shortcut-listener`})],kh);let{create:Uie}=ni,Ah=Uie(`active-color-scheme`).withDefault(e=>ds.getValueFor(e)===ss.LightMode?`light`:`dark`),jh=class extends Qe{stylesChanged(e,t){e&&this.parentElement.$fastController.removeStyles(e),this.parentElement.$fastController.addStyles(t)}};q([C],jh.prototype,`styles`,void 0),jh=q([$e({name:`slotted-styles`})],jh);var Mh;(function(e){e.Italic=`italic`,e.Normal=`normal`})(Mh||(Mh={}));var Nh;(function(e){e[e.Thin=100]=`Thin`,e[e.Light=300]=`Light`,e[e.Regular=400]=`Regular`,e[e.Medium=500]=`Medium`,e[e.Bold=700]=`Bold`,e[e.Black=900]=`Black`})(Nh||(Nh={}));var Ph,Wie=/* @__PURE__ */ new Uint8Array(16);function Gie(){if(!Ph&&(Ph=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!Ph))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return Ph(Wie)}var Kie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Fh(e){return typeof e==`string`&&Kie.test(e)}for(var Ih=[],Lh=0;Lh<256;++Lh)Ih.push((Lh+256).toString(16).substr(1));function Rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Ih[e[t+0]]+Ih[e[t+1]]+Ih[e[t+2]]+Ih[e[t+3]]+`-`+Ih[e[t+4]]+Ih[e[t+5]]+`-`+Ih[e[t+6]]+Ih[e[t+7]]+`-`+Ih[e[t+8]]+Ih[e[t+9]]+`-`+Ih[e[t+10]]+Ih[e[t+11]]+Ih[e[t+12]]+Ih[e[t+13]]+Ih[e[t+14]]+Ih[e[t+15]]).toLowerCase();if(!Fh(n))throw TypeError(`Stringified UUID is invalid`);return n}function qie(e){if(!Fh(e))throw TypeError(`Invalid UUID`);var t,n=/* @__PURE__ */ new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function Jie(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var Yie=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,Xie=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function zh(e,t,n){function r(e,r,i,a){if(typeof e==`string`&&(e=Jie(e)),typeof r==`string`&&(r=qie(r)),r.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=o[6]&15|t,o[8]=o[8]&63|128,i){a=a||0;for(var s=0;s<16;++s)i[a+s]=o[s];return i}return Rh(o)}try{r.name=e}catch{}return r.DNS=Yie,r.URL=Xie,r}function Zie(e){if(typeof e==`string`){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return Qie($ie(eae(e),e.length*8))}function Qie(e){for(var t=[],n=e.length*32,r=`0123456789abcdef`,i=0;i<n;i+=8){var a=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(a>>>4&15)+r.charAt(a&15),16);t.push(o)}return t}function Bh(e){return(e+64>>>9<<4)+14+1}function $ie(e,t){e[t>>5]|=128<<t%32,e[Bh(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a;n=Uh(n,r,i,a,e[o],7,-680876936),a=Uh(a,n,r,i,e[o+1],12,-389564586),i=Uh(i,a,n,r,e[o+2],17,606105819),r=Uh(r,i,a,n,e[o+3],22,-1044525330),n=Uh(n,r,i,a,e[o+4],7,-176418897),a=Uh(a,n,r,i,e[o+5],12,1200080426),i=Uh(i,a,n,r,e[o+6],17,-1473231341),r=Uh(r,i,a,n,e[o+7],22,-45705983),n=Uh(n,r,i,a,e[o+8],7,1770035416),a=Uh(a,n,r,i,e[o+9],12,-1958414417),i=Uh(i,a,n,r,e[o+10],17,-42063),r=Uh(r,i,a,n,e[o+11],22,-1990404162),n=Uh(n,r,i,a,e[o+12],7,1804603682),a=Uh(a,n,r,i,e[o+13],12,-40341101),i=Uh(i,a,n,r,e[o+14],17,-1502002290),r=Uh(r,i,a,n,e[o+15],22,1236535329),n=Wh(n,r,i,a,e[o+1],5,-165796510),a=Wh(a,n,r,i,e[o+6],9,-1069501632),i=Wh(i,a,n,r,e[o+11],14,643717713),r=Wh(r,i,a,n,e[o],20,-373897302),n=Wh(n,r,i,a,e[o+5],5,-701558691),a=Wh(a,n,r,i,e[o+10],9,38016083),i=Wh(i,a,n,r,e[o+15],14,-660478335),r=Wh(r,i,a,n,e[o+4],20,-405537848),n=Wh(n,r,i,a,e[o+9],5,568446438),a=Wh(a,n,r,i,e[o+14],9,-1019803690),i=Wh(i,a,n,r,e[o+3],14,-187363961),r=Wh(r,i,a,n,e[o+8],20,1163531501),n=Wh(n,r,i,a,e[o+13],5,-1444681467),a=Wh(a,n,r,i,e[o+2],9,-51403784),i=Wh(i,a,n,r,e[o+7],14,1735328473),r=Wh(r,i,a,n,e[o+12],20,-1926607734),n=Gh(n,r,i,a,e[o+5],4,-378558),a=Gh(a,n,r,i,e[o+8],11,-2022574463),i=Gh(i,a,n,r,e[o+11],16,1839030562),r=Gh(r,i,a,n,e[o+14],23,-35309556),n=Gh(n,r,i,a,e[o+1],4,-1530992060),a=Gh(a,n,r,i,e[o+4],11,1272893353),i=Gh(i,a,n,r,e[o+7],16,-155497632),r=Gh(r,i,a,n,e[o+10],23,-1094730640),n=Gh(n,r,i,a,e[o+13],4,681279174),a=Gh(a,n,r,i,e[o],11,-358537222),i=Gh(i,a,n,r,e[o+3],16,-722521979),r=Gh(r,i,a,n,e[o+6],23,76029189),n=Gh(n,r,i,a,e[o+9],4,-640364487),a=Gh(a,n,r,i,e[o+12],11,-421815835),i=Gh(i,a,n,r,e[o+15],16,530742520),r=Gh(r,i,a,n,e[o+2],23,-995338651),n=Kh(n,r,i,a,e[o],6,-198630844),a=Kh(a,n,r,i,e[o+7],10,1126891415),i=Kh(i,a,n,r,e[o+14],15,-1416354905),r=Kh(r,i,a,n,e[o+5],21,-57434055),n=Kh(n,r,i,a,e[o+12],6,1700485571),a=Kh(a,n,r,i,e[o+3],10,-1894986606),i=Kh(i,a,n,r,e[o+10],15,-1051523),r=Kh(r,i,a,n,e[o+1],21,-2054922799),n=Kh(n,r,i,a,e[o+8],6,1873313359),a=Kh(a,n,r,i,e[o+15],10,-30611744),i=Kh(i,a,n,r,e[o+6],15,-1560198380),r=Kh(r,i,a,n,e[o+13],21,1309151649),n=Kh(n,r,i,a,e[o+4],6,-145523070),a=Kh(a,n,r,i,e[o+11],10,-1120210379),i=Kh(i,a,n,r,e[o+2],15,718787259),r=Kh(r,i,a,n,e[o+9],21,-343485551),n=Vh(n,s),r=Vh(r,c),i=Vh(i,l),a=Vh(a,u)}return[n,r,i,a]}function eae(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(Bh(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Vh(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function tae(e,t){return e<<t|e>>>32-t}function Hh(e,t,n,r,i,a){return Vh(tae(Vh(Vh(t,e),Vh(r,a)),i),n)}function Uh(e,t,n,r,i,a,o){return Hh(t&n|~t&r,e,t,i,a,o)}function Wh(e,t,n,r,i,a,o){return Hh(t&r|n&~r,e,t,i,a,o)}function Gh(e,t,n,r,i,a,o){return Hh(t^n^r,e,t,i,a,o)}function Kh(e,t,n,r,i,a,o){return Hh(n^(t|~r),e,t,i,a,o)}zh(`v3`,48,Zie);function qh(e,t,n){e=e||{};var r=e.random||(e.rng||Gie)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Rh(r)}function nae(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Jh(e,t){return e<<t|e>>>32-t}function rae(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e==`string`){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=Array(o),c=0;c<o;++c){for(var l=/* @__PURE__ */ new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];s[c]=l}s[o-1][14]=(e.length-1)*8/2**32,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=/* @__PURE__ */ new Uint32Array(80),p=0;p<16;++p)f[p]=s[d][p];for(var m=16;m<80;++m)f[m]=Jh(f[m-3]^f[m-8]^f[m-14]^f[m-16],1);for(var h=n[0],g=n[1],_=n[2],v=n[3],y=n[4],b=0;b<80;++b){var ee=Math.floor(b/20),x=Jh(h,5)+nae(ee,g,_,v)+y+t[ee]+f[b]>>>0;y=v,v=_,_=Jh(g,30)>>>0,g=h,h=x}n[0]=n[0]+h>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+_>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}zh(`v5`,80,rae);var iae=class{constructor(){}createId(e=!1){let t=qh();return e&&Fd.debug(`UUID.createID ${t}`),t}createRemoteId(){return J(this,arguments,void 0,function*(e=!1){let t=qh();return e&&Fd.debug(`UUID.createRemoteID ${t}`),t})}};let Yh=N.createInterface(e=>e.singleton(iae)),Xh=1e3,aae=e=>T`<div class="inactivity-overlay" style="display:${e=>e.isVisible?`display`:`none`}"><${e}-card class="dialog-card"><div class="card-body"><div class="dialog-header"><${e}-icon name="warning" class="warning-icon"></${e}-icon><h2>Session Timeout Warning</h2></div><div class="dialog-content"><p>
|
|
226
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function tm(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var nm=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=ad(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Qp(c))try{c()}catch(e){i=e instanceof em?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ad(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{am(f)}catch(e){i=i??[],e instanceof em?i=sd(sd([],od(i)),od(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new em(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)am(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&tm(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&tm(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),rm=nm.EMPTY;function im(e){return e instanceof nm||e&&`closed`in e&&Qp(e.remove)&&Qp(e.add)&&Qp(e.unsubscribe)}function am(e){Qp(e)?e():e.unsubscribe()}var om={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},sm={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=sm.delegate;return i?.setTimeout?i.setTimeout.apply(i,sd([e,t],od(n))):setTimeout.apply(void 0,sd([e,t],od(n)))},clearTimeout:function(e){return(sm.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function cm(e){sm.setTimeout(function(){var t=om.onUnhandledError;if(t)t(e);else throw e})}function lm(){}var Mre=(function(){return um(`C`,void 0,void 0)})();function Nre(e){return um(`E`,void 0,e)}function Pre(e){return um(`N`,e,void 0)}function um(e,t,n){return{kind:e,value:t,error:n}}var dm=null;function fm(e){if(om.useDeprecatedSynchronousErrorHandling){var t=!dm;if(t&&(dm={errorThrown:!1,error:null}),e(),t){var n=dm,r=n.errorThrown,i=n.error;if(dm=null,r)throw i}}else e()}function Fre(e){om.useDeprecatedSynchronousErrorHandling&&dm&&(dm.errorThrown=!0,dm.error=e)}var pm=function(e){ed(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,im(t)&&t.add(n)):n.destination=zre,n}return t.create=function(e,t,n){return new hm(e,t,n)},t.prototype.next=function(e){this.isStopped?_m(Pre(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_m(Nre(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_m(Mre,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(nm),Ire=Function.prototype.bind;function mm(e,t){return Ire.call(e,t)}var Lre=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){gm(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){gm(e)}else gm(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){gm(e)}},e}(),hm=function(e){ed(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Qp(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&om.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&mm(t.next,o),error:t.error&&mm(t.error,o),complete:t.complete&&mm(t.complete,o)}):a=t}return i.destination=new Lre(a),i}return t}(pm);function gm(e){om.useDeprecatedSynchronousErrorHandling?Fre(e):cm(e)}function Rre(e){throw e}function _m(e,t){var n=om.onStoppedNotification;n&&sm.setTimeout(function(){return n(e,t)})}var zre={closed:!0,next:lm,error:Rre,complete:lm},vm=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function ym(e){return e}function Bre(e){return e.length===0?ym:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var bm=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Hre(e)?e:new hm(e,t,n);return fm(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=xm(t),new t(function(t,r){var i=new hm({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[vm]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Bre(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=xm(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function xm(e){return e??om.Promise??Promise}function Vre(e){return e&&Qp(e.next)&&Qp(e.error)&&Qp(e.complete)}function Hre(e){return e&&e instanceof pm||Vre(e)&&im(e)}function Sm(e){return Qp(e?.lift)}function Cm(e){return function(t){if(Sm(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function wm(e,t,n,r,i){return new Ure(e,t,n,r,i)}var Ure=function(e){ed(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(pm);function Wre(){return Cm(function(e,t){var n=null;e._refCount++;var r=wm(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){n=null;return}var r=e._connection,i=n;n=null,r&&(!i||r===i)&&r.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}(function(e){ed(t,e);function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Sm(t)&&(r.lift=t.lift),r}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new nm;var n=this.getSubject();t.add(this.source.subscribe(wm(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=nm.EMPTY)}return t},t.prototype.refCount=function(){return Wre()(this)},t})(bm);var Tm={now:function(){return(Tm.delegate||performance).now()},delegate:void 0},Em={schedule:function(e){var t=requestAnimationFrame,n=cancelAnimationFrame,r=Em.delegate;r&&(t=r.requestAnimationFrame,n=r.cancelAnimationFrame);var i=t(function(t){n=void 0,e(t)});return new nm(function(){return n?.(i)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Em.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,sd([],od(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Em.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,sd([],od(e)))},delegate:void 0};function Gre(e){return new bm(function(t){var n=e||Tm,r=n.now(),i=0,a=function(){t.closed||(i=Em.requestAnimationFrame(function(o){i=0;var s=n.now();t.next({timestamp:e?s:o,elapsed:s-r}),a()}))};return a(),function(){i&&Em.cancelAnimationFrame(i)}})}Gre();var Kre=$p(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Dm=function(e){ed(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Om(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Kre},t.prototype.next=function(e){var t=this;fm(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=ad(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;fm(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;fm(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?rm:(this.currentObservers=null,a.push(e),new nm(function(){t.currentObservers=null,tm(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new bm;return e.source=this,e},t.create=function(e,t){return new Om(e,t)},t}(bm),Om=function(e){ed(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??rm},t}(Dm),km=function(e){ed(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Dm),Am={now:function(){return(Am.delegate||Date).now()},delegate:void 0},jm=function(e){ed(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Am);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(Dm);(function(e){ed(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},t})(Dm);var qre=function(e){ed(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(nm),Mm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Mm.delegate;return i?.setInterval?i.setInterval.apply(i,sd([e,t],od(n))):setInterval.apply(void 0,sd([e,t],od(n)))},clearInterval:function(e){return(Mm.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Nm=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),Mm.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&Mm.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return/* @__PURE__ */ Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||/* @__PURE__ */ Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,tm(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(qre),Jre=1,Pm,Fm={};function Im(e){return e in Fm&&(delete Fm[e],!0)}var Lm={setImmediate:function(e){var t=Jre++;return Fm[t]=!0,Pm||(Pm=Promise.resolve()),Pm.then(function(){return Im(t)&&e()}),t},clearImmediate:function(e){Im(e)}},Yre=Lm.setImmediate,Xre=Lm.clearImmediate,Rm={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Rm.delegate?.setImmediate||Yre).apply(void 0,sd([],od(e)))},clearImmediate:function(e){return(Rm.delegate?.clearImmediate||Xre)(e)},delegate:void 0},Zre=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Rm.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&i[i.length-1]?.id!==n&&(Rm.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(Nm),zm=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Am.now,e}(),Bm=function(e){ed(t,e);function t(t,n){n===void 0&&(n=zm.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(zm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Bm))(Zre);var Vm=new Bm(Nm),Qre=Vm,$re=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(Nm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Bm))($re);var eie=function(e){ed(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!==null&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=Em.requestAnimationFrame(function(){return t.flush(void 0)})))},t.prototype.recycleAsyncId=function(t,n,r){if(r===void 0&&(r=0),r==null?this.delay>0:r>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var i=t.actions;n!=null&&n===t._scheduled&&i[i.length-1]?.id!==n&&(Em.cancelAnimationFrame(n),t._scheduled=void 0)},t}(Nm);new(function(e){ed(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e=e||n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(Bm))(eie),function(e){ed(t,e);function t(t,n){t===void 0&&(t=tie),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},t.frameTimeFactor=10,t}(Bm);var tie=function(e){ed(t,e);function t(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t.prototype.schedule=function(n,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return nm.EMPTY},t.prototype.requestAsyncId=function(e,n,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},t.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Nm),Hm=new bm(function(e){return e.complete()});function Um(e){return e&&Qp(e.schedule)}function Wm(e){return e[e.length-1]}function nie(e){return Qp(Wm(e))?e.pop():void 0}function Gm(e){return Um(Wm(e))?e.pop():void 0}var Km=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function qm(e){return Qp(e?.then)}function Jm(e){return Qp(e[vm])}function Ym(e){return Symbol.asyncIterator&&Qp(e?.[Symbol.asyncIterator])}function Xm(e){return/* @__PURE__ */ TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function rie(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Zm=rie();function Qm(e){return Qp(e?.[Zm])}function $m(e){return Yne(this,arguments,function(){var t,n,r,i;return id(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,cd(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,cd(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,cd(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function eh(e){return Qp(e?.getReader)}function th(e){if(e instanceof bm)return e;if(e!=null){if(Jm(e))return iie(e);if(Km(e))return aie(e);if(qm(e))return oie(e);if(Ym(e))return nh(e);if(Qm(e))return sie(e);if(eh(e))return cie(e)}throw Xm(e)}function iie(e){return new bm(function(t){var n=e[vm]();if(Qp(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function aie(e){return new bm(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function oie(e){return new bm(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,cm)})}function sie(e){return new bm(function(t){var n,r;try{for(var i=ad(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function nh(e){return new bm(function(t){lie(e,t).catch(function(e){return t.error(e)})})}function cie(e){return nh($m(e))}function lie(e,t){var n,r,i,a;return J(this,void 0,void 0,function(){var o,s;return id(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Xne(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function rh(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ih(e,t){return t===void 0&&(t=0),Cm(function(n,r){n.subscribe(wm(r,function(n){return rh(r,e,function(){return r.next(n)},t)},function(){return rh(r,e,function(){return r.complete()},t)},function(n){return rh(r,e,function(){return r.error(n)},t)}))})}function ah(e,t){return t===void 0&&(t=0),Cm(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function uie(e,t){return th(e).pipe(ah(t),ih(t))}function die(e,t){return th(e).pipe(ah(t),ih(t))}function fie(e,t){return new bm(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function pie(e,t){return new bm(function(n){var r;return rh(n,t,function(){r=e[Zm](),rh(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return Qp(r?.return)&&r.return()}})}function oh(e,t){if(!e)throw Error(`Iterable cannot be null`);return new bm(function(n){rh(n,t,function(){var r=e[Symbol.asyncIterator]();rh(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function mie(e,t){return oh($m(e),t)}function hie(e,t){if(e!=null){if(Jm(e))return uie(e,t);if(Km(e))return fie(e,t);if(qm(e))return die(e,t);if(Ym(e))return oh(e,t);if(Qm(e))return pie(e,t);if(eh(e))return mie(e,t)}throw Xm(e)}function sh(e,t){return t?hie(e,t):th(e)}function ch(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return sh(e,Gm(e))}function lh(e,t){var n=Qp(e)?e:function(){return e},r=function(e){return e.error(n())};return new bm(t?function(e){return t.schedule(r,0,e)}:r)}var uh;(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(uh||(uh={})),function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return gie(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return Qp(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i=t===`N`?ch(n):t===`E`?lh(function(){return r}):t===`C`?Hm:0;if(!i)throw TypeError(`Unexpected notification kind `+t);return i},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e}();function gie(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}var _ie=$p(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function vie(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new hm({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new _ie)}});e.subscribe(a)})}$p(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}}),$p(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}}),$p(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}});function yie(e){return e instanceof Date&&!isNaN(e)}$p(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function dh(e,t){return Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){r.next(e.call(t,n,i++))}))})}var bie=Array.isArray;function xie(e,t){return bie(t)?e.apply(void 0,sd([],od(t))):e(t)}function Sie(e){return dh(function(t){return xie(e,t)})}var Cie=Array.isArray,wie=Object.getPrototypeOf,Tie=Object.prototype,Eie=Object.keys;function Die(e){if(e.length===1){var t=e[0];if(Cie(t))return{args:t,keys:null};if(Oie(t)){var n=Eie(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function Oie(e){return e&&typeof e==`object`&&wie(e)===Tie}function kie(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function Aie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Gm(e),r=nie(e),i=Die(e),a=i.args,o=i.keys;if(a.length===0)return sh([],n);var s=new bm(jie(a,n,o?function(e){return kie(o,e)}:ym));return r?s.pipe(Sie(r)):s}function jie(e,t,n){return n===void 0&&(n=ym),function(r){fh(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){fh(t,function(){var c=sh(e[i],t),l=!1;c.subscribe(wm(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function fh(e,t,n){e?rh(n,e,t):t()}function Mie(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;th(n(e,u++)).subscribe(wm(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?rh(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(wm(t,p,function(){d=!0,f()})),function(){s?.()}}function ph(e,t,n){return n===void 0&&(n=1/0),Qp(t)?ph(function(n,r){return dh(function(e,i){return t(n,e,r,i)})(th(e(n,r)))},n):(typeof t==`number`&&(n=t),Cm(function(t,r){return Mie(t,r,e,n)}))}function Nie(e){return e===void 0&&(e=1/0),ph(ym,e)}function Pie(){return Nie(1)}function mh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pie()(sh(e,Gm(e)))}function hh(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Qre);var r=-1;return t!=null&&(Um(t)?n=t:r=t),new bm(function(t){var i=yie(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function Fie(e,t){return e===void 0&&(e=0),t===void 0&&(t=Vm),e<0&&(e=0),hh(e,e,t)}new bm(lm),Array.isArray;function gh(e,t){return Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Iie(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(wm(o,function(t){var n=l++;c=s?e(c,t,n):(s=!0,t),r&&o.next(c)},i&&(function(){s&&o.next(c),o.complete()})))}}function _h(e,t){return t?function(n){return n.pipe(_h(function(n,r){return th(e(n,r)).pipe(dh(function(e,i){return t(n,e,r,i)}))}))}:Cm(function(t,n){var r=0,i=null,a=!1;t.subscribe(wm(n,function(t){i||(i=wm(n,void 0,function(){i=null,a&&n.complete()}),th(e(t,r++)).subscribe(i))},function(){a=!0,!i&&n.complete()}))})}function vh(e){return Cm(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function Lie(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?ym:Cm(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(wm(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?hh(i):th(i(e,n)),u=wm(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function yh(e,t){return Cm(Iie(e,t,arguments.length>=2,!0))}function bh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Gm(e);return Cm(function(t,r){(n?mh(e,t,n):mh(e,t)).subscribe(r)})}function xh(e,t){return Cm(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(wm(r,function(n){i?.unsubscribe();var o=0,c=a++;th(e(n,c)).subscribe(i=wm(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Sh(e,t){return t===void 0&&(t=!1),Cm(function(n,r){var i=0;n.subscribe(wm(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}))})}var Rie=class{static get isMacOS(){return navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.toLowerCase().includes(`mac os`)}static get isWindows(){return navigator.platform.toLowerCase().includes(`win`)||navigator.userAgent.toLowerCase().includes(`windows`)}static get isLinux(){return navigator.platform.toLowerCase().includes(`linux`)||navigator.userAgent.toLowerCase().includes(`linux`)}static getModifierSymbols(){return this.isMacOS?{ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`}:{ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`,meta:`Win`}}static formatKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.getModifierSymbols(),o=[];t&&o.push(a.ctrl),n&&o.push(a.alt),r&&o.push(a.shift),i&&o.push(a.meta);let s=this.isMacOS?``:`+`,c=this.isMacOS?e.toUpperCase():e;return o.length>0?`${o.join(s)}${s}${c}`:c}};let Ch=`foundation-shortcut-blocked`,wh=`Shortcut blocked`,Th=`This shortcut is currently unavailable in this context.`;function Eh(e,t){let n=Object.assign(Object.assign({},e),{blockedMessage:e.blockedMessage??{title:wh,text:Th}});t&&typeof t.dispatchEvent==`function`?t.dispatchEvent(new CustomEvent(Ch,{bubbles:!0,composed:!0,detail:n})):typeof document<`u`&&document.dispatchEvent(new CustomEvent(Ch,{bubbles:!0,composed:!0,detail:n}))}let Dh={designSystems:[`rapid`],customEditableSelectors:[]},Oh={defaultMessage:{title:wh,text:Th},inputMessage:{title:wh,text:`This shortcut is unavailable while typing in an input field.`},pausedMessage:{title:wh,text:`Shortcuts are paused.`},elementFocusMessage:{title:wh,text:`This shortcut is unavailable in the current focus context.`},emitPausedBlockedEvent:!0};var zie=class{constructor(){this.shortcuts=/* @__PURE__ */ new Map,this.shortcutLookup=/* @__PURE__ */ new Map,this.keyCombinationMap=/* @__PURE__ */ new Map,this._isPausedSubject=new km(!1),this.executionGuards=/* @__PURE__ */ new Map,this.editableContextConfig=Object.assign({},Dh),this.editableSelector=qd(Dh.designSystems,Dh.customEditableSelectors),this.blockedMessageConfig=Object.assign({},Oh)}get isPaused(){return this._isPausedSubject.value}get isPaused$(){return this._isPausedSubject.asObservable()}get isPausedSubject(){return this._isPausedSubject}registerShortcuts(e){e.forEach(e=>{this.registerShortcut(e)})}registerShortcut(e){let t=`${e.context}:${e.id}`,n=this.normalizeShortcutDefinition(e),r=this.createKeyCombinationKey(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),i=Rie.formatKeyCombination(n.key,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey),a=this.keyCombinationMap.get(r);if(a){let e=[];for(let t of a){let i=this.shortcutLookup.get(t);i&&i.context===n.context&&(Fd.warn(`Shortcut with key combination '${r}' already exists in context '${n.context}' (id: '${i.id}'). It will be replaced by new shortcut '${n.id}'.`),e.push(t))}e.forEach(e=>{let t=this.shortcutLookup.get(e);if(t){let n=this.shortcuts.get(t.context);n&&(n.delete(t.id),n.size===0&&this.shortcuts.delete(t.context)),this.shortcutLookup.delete(e)}a.delete(e)}),a.size===0&&this.keyCombinationMap.delete(r)}return this.shortcuts.has(n.context)||this.shortcuts.set(n.context,/* @__PURE__ */ new Map),this.shortcuts.get(n.context).set(n.id,n),this.shortcutLookup.set(t,n),this.keyCombinationMap.has(r)||this.keyCombinationMap.set(r,/* @__PURE__ */ new Set),this.keyCombinationMap.get(r).add(t),{shortcut:n,id:n.id,keyCombination:r,keyCombinationDisplay:i,disabled:()=>this.getExecutionStatus(n).disabled||!1,tooltip:()=>this.getExecutionStatus(n).tooltip}}unregisterShortcut(e,t){let n=`${e}:${t}`,r=this.shortcuts.get(e);if(r){let i=r.get(t);if(i){let a=this.normalizeShortcutDefinition(i),o=this.createKeyCombinationKey(a.key,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey);r.delete(t),r.size===0&&this.shortcuts.delete(e),this.shortcutLookup.delete(n);let s=this.keyCombinationMap.get(o);s&&(s.delete(n),s.size===0&&this.keyCombinationMap.delete(o))}}}unregisterShortcutsByContext(e){let t=this.shortcuts.get(e);t&&Array.from(t.keys()).forEach(t=>this.unregisterShortcut(e,t))}executeShortcut(e,t){this.executeShortcutByContext(this.getActiveContext(),e,t)}shouldEmitBlockedEvent(e){return e?.emitBlockedEvent!==!1}resolveBlockedMessage(e,t){return e?.blockedMessage??t}executeShortcutByContext(e,t,n){let r=this.shortcuts.get(e)?.get(t);if(this.isPaused){this.blockedMessageConfig.emitPausedBlockedEvent&&this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`paused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.pausedMessage)},n);return}if(r){if(r.elementRef&&!this.isElementFocused(r.elementRef)){this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`element-not-focused`,blockedMessage:this.resolveBlockedMessage(r,this.blockedMessageConfig.elementFocusMessage)},n);return}let i=this.getExecutionStatus(r);if(i.disabled){this.shouldEmitBlockedEvent(r)&&Eh({shortcutId:t,context:e,reason:`disabled`,blockedMessage:this.resolveBlockedMessage(r,i.tooltip===void 0?this.blockedMessageConfig.defaultMessage:{title:this.blockedMessageConfig.defaultMessage.title,text:i.tooltip})},n);return}try{r.action()}catch(n){Fd.error(`Error executing shortcut ${e}:${t}:`,n)}}}getShortcuts(){let e=[];for(let t of this.shortcuts.values())e.push(...t.values());return e}getShortcutsByContext(e){let t=this.shortcuts.get(e);return t?Array.from(t.values()):[]}findShortcutByKeyCombination(e,t=!1,n=!1,r=!1,i=!1){let a=this.createKeyCombinationKey(e,t,n,r,i),o=this.keyCombinationMap.get(a);if(o){if(this._activeContext){let e=this.shortcuts.get(this._activeContext);if(e)for(let t of o){let[n,r]=t.split(`:`);if(n!==this._activeContext)continue;let i=e.get(r);if(i)return i}}for(let e of o){let t=this.shortcutLookup.get(e);if(t)return t}}}getContexts(){return Array.from(this.shortcuts.keys())}getShortcutsByContextMap(){return new Map(this.shortcuts)}registerContext(e){this.shortcuts.has(e)||this.shortcuts.set(e,/* @__PURE__ */ new Map)}setActiveContext(e){this.registerContext(e),this._activeContext=e}getActiveContext(){return this._activeContext}clearActiveContext(){this._activeContext=void 0}registerExecutionGuard(e,t){this.executionGuards.set(e,t)}unregisterExecutionGuard(e){this.executionGuards.delete(e)}clearExecutionGuards(){this.executionGuards.clear()}configureEditableContext(e={}){let t=(e.designSystems??Dh.designSystems).filter(e=>e===`rapid`),n=(e.customEditableSelectors??Dh.customEditableSelectors).map(e=>e?.trim()).filter(e=>!!e);this.editableContextConfig={designSystems:Array.from(new Set(e.designSystems===void 0?Dh.designSystems:t)),customEditableSelectors:Array.from(new Set(n))},this.refreshEditableSelector()}getEditableContextConfig(){return{designSystems:[...this.editableContextConfig.designSystems],customEditableSelectors:[...this.editableContextConfig.customEditableSelectors]}}getEditableSelector(){return this.editableSelector}configureBlockedMessages(e={}){let t=(e,t)=>({title:(e?.title)?.trim()??t.title,text:(e?.text)?.trim()??t.text});this.blockedMessageConfig={defaultMessage:t(e.defaultMessage,Oh.defaultMessage),inputMessage:t(e.inputMessage,Oh.inputMessage),pausedMessage:t(e.pausedMessage,Oh.pausedMessage),elementFocusMessage:t(e.elementFocusMessage,Oh.elementFocusMessage),emitPausedBlockedEvent:e.emitPausedBlockedEvent??Oh.emitPausedBlockedEvent}}getBlockedMessages(){return Object.assign({},this.blockedMessageConfig)}pause(){this._isPausedSubject.next(!0)}resume(){this._isPausedSubject.next(!1)}normalizeShortcutDefinition(e){let t=Object.assign({},e);return(t.optionKey||t.altKey)&&(t.altKey=!0,t.optionKey=!0),t}createKeyCombinationKey(e,t=!1,n=!1,r=!1,i=!1){let a=[];return t&&a.push(`ctrl`),n&&a.push(`alt`),r&&a.push(`shift`),i&&a.push(`meta`),(a.length>0?`${a.join(`+`)}+${e}`:e).toLowerCase()}isElementFocused(e){return e instanceof HTMLElement&&document.activeElement===e}getExecutionStatus(e){if(this.isPaused)return{disabled:!0,tooltip:this.blockedMessageConfig.pausedMessage.text};let t=this.getExecutionGuardStatus();return t.disabled?t:e.canExecute?e.canExecute():{disabled:!1,tooltip:void 0}}getExecutionGuardStatus(){for(let e of this.executionGuards.values()){let t=e(),n=typeof t==`boolean`?{disabled:t}:t;if(n?.disabled)return{disabled:!0,tooltip:n.tooltip}}return{disabled:!1,tooltip:void 0}}refreshEditableSelector(){this.editableSelector=qd(this.editableContextConfig.designSystems,this.editableContextConfig.customEditableSelectors)}};let Bie=N.createInterface(e=>e.singleton(zie)),Vie={Space:`space`,Enter:`enter`,Escape:`escape`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,F1:`f1`,F2:`f2`,F3:`f3`,F4:`f4`,F5:`f5`,F6:`f6`,F7:`f7`,F8:`f8`,F9:`f9`,F10:`f10`,F11:`f11`,F12:`f12`};function Hie(e){return e?e.startsWith(`Key`)?e.replace(`Key`,``).toLowerCase():e.startsWith(`Digit`)?e.replace(`Digit`,``):Vie[e]||e.toLowerCase():``}let kh=class extends Qe{constructor(){super(...arguments),this.keyListener=null,this.isListening=!1}connectedCallback(){super.connectedCallback(),this.addKeyListener()}disconnectedCallback(){super.disconnectedCallback(),this.removeKeyListener()}addKeyListener(){this.isListening||(this.keyListener=this.handleKeyDown.bind(this),document.addEventListener(`keydown`,this.keyListener),this.isListening=!0)}removeKeyListener(){this.isListening&&this.keyListener&&(document.removeEventListener(`keydown`,this.keyListener),this.keyListener=null,this.isListening=!1)}handleKeyDown(e){let t=this.shortcutManager,n=t.getBlockedMessages(),r=t.getEditableSelector(),i=this.getEventElement(e)??this,a=e.ctrlKey||e.altKey||e.shiftKey||e.metaKey,o=Hie(e.code),s=t.findShortcutByKeyCombination(o,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey);if(s){if(ef(e,r)){a&&s.emitBlockedEvent!==!1&&Eh({shortcutId:s.id,context:s.context,reason:`editable-context`,blockedMessage:s.blockedMessage??n.inputMessage},i);return}s&&(e.preventDefault(),e.stopPropagation(),t.executeShortcut(s.id,i))}}getEventElement(e){return(e.composedPath?.call(e)??[]).find(e=>e instanceof Element)??e.target??null}};q([Pt(Bie)],kh.prototype,`shortcutManager`,void 0),kh=q([$e({name:`foundation-shortcut-listener`})],kh);let{create:Uie}=ni,Ah=Uie(`active-color-scheme`).withDefault(e=>ds.getValueFor(e)===ss.LightMode?`light`:`dark`),jh=class extends Qe{stylesChanged(e,t){let n=this.parentController;n&&(e&&n.removeStyles(e),t&&n.addStyles(t))}connectedCallback(){super.connectedCallback();let e=this.parentElement;if(e){if(this.parentController){this.applyStyles();return}e.localName.includes(`-`)&&!customElements.get(e.localName)&&customElements.whenDefined(e.localName).then(()=>{this.isConnected&&this.parentElement===e&&this.applyStyles()})}}get parentController(){return this.parentElement?.$fastController}applyStyles(){var e;this.styles&&((e=this.parentController)==null||e.addStyles(this.styles))}};q([C],jh.prototype,`styles`,void 0),jh=q([$e({name:`slotted-styles`})],jh);var Mh;(function(e){e.Italic=`italic`,e.Normal=`normal`})(Mh||(Mh={}));var Nh;(function(e){e[e.Thin=100]=`Thin`,e[e.Light=300]=`Light`,e[e.Regular=400]=`Regular`,e[e.Medium=500]=`Medium`,e[e.Bold=700]=`Bold`,e[e.Black=900]=`Black`})(Nh||(Nh={}));var Ph,Wie=/* @__PURE__ */ new Uint8Array(16);function Gie(){if(!Ph&&(Ph=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!Ph))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return Ph(Wie)}var Kie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Fh(e){return typeof e==`string`&&Kie.test(e)}for(var Ih=[],Lh=0;Lh<256;++Lh)Ih.push((Lh+256).toString(16).substr(1));function Rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Ih[e[t+0]]+Ih[e[t+1]]+Ih[e[t+2]]+Ih[e[t+3]]+`-`+Ih[e[t+4]]+Ih[e[t+5]]+`-`+Ih[e[t+6]]+Ih[e[t+7]]+`-`+Ih[e[t+8]]+Ih[e[t+9]]+`-`+Ih[e[t+10]]+Ih[e[t+11]]+Ih[e[t+12]]+Ih[e[t+13]]+Ih[e[t+14]]+Ih[e[t+15]]).toLowerCase();if(!Fh(n))throw TypeError(`Stringified UUID is invalid`);return n}function qie(e){if(!Fh(e))throw TypeError(`Invalid UUID`);var t,n=/* @__PURE__ */ new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function Jie(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var Yie=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,Xie=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function zh(e,t,n){function r(e,r,i,a){if(typeof e==`string`&&(e=Jie(e)),typeof r==`string`&&(r=qie(r)),r.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=o[6]&15|t,o[8]=o[8]&63|128,i){a=a||0;for(var s=0;s<16;++s)i[a+s]=o[s];return i}return Rh(o)}try{r.name=e}catch{}return r.DNS=Yie,r.URL=Xie,r}function Zie(e){if(typeof e==`string`){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return Qie($ie(eae(e),e.length*8))}function Qie(e){for(var t=[],n=e.length*32,r=`0123456789abcdef`,i=0;i<n;i+=8){var a=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(a>>>4&15)+r.charAt(a&15),16);t.push(o)}return t}function Bh(e){return(e+64>>>9<<4)+14+1}function $ie(e,t){e[t>>5]|=128<<t%32,e[Bh(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a;n=Uh(n,r,i,a,e[o],7,-680876936),a=Uh(a,n,r,i,e[o+1],12,-389564586),i=Uh(i,a,n,r,e[o+2],17,606105819),r=Uh(r,i,a,n,e[o+3],22,-1044525330),n=Uh(n,r,i,a,e[o+4],7,-176418897),a=Uh(a,n,r,i,e[o+5],12,1200080426),i=Uh(i,a,n,r,e[o+6],17,-1473231341),r=Uh(r,i,a,n,e[o+7],22,-45705983),n=Uh(n,r,i,a,e[o+8],7,1770035416),a=Uh(a,n,r,i,e[o+9],12,-1958414417),i=Uh(i,a,n,r,e[o+10],17,-42063),r=Uh(r,i,a,n,e[o+11],22,-1990404162),n=Uh(n,r,i,a,e[o+12],7,1804603682),a=Uh(a,n,r,i,e[o+13],12,-40341101),i=Uh(i,a,n,r,e[o+14],17,-1502002290),r=Uh(r,i,a,n,e[o+15],22,1236535329),n=Wh(n,r,i,a,e[o+1],5,-165796510),a=Wh(a,n,r,i,e[o+6],9,-1069501632),i=Wh(i,a,n,r,e[o+11],14,643717713),r=Wh(r,i,a,n,e[o],20,-373897302),n=Wh(n,r,i,a,e[o+5],5,-701558691),a=Wh(a,n,r,i,e[o+10],9,38016083),i=Wh(i,a,n,r,e[o+15],14,-660478335),r=Wh(r,i,a,n,e[o+4],20,-405537848),n=Wh(n,r,i,a,e[o+9],5,568446438),a=Wh(a,n,r,i,e[o+14],9,-1019803690),i=Wh(i,a,n,r,e[o+3],14,-187363961),r=Wh(r,i,a,n,e[o+8],20,1163531501),n=Wh(n,r,i,a,e[o+13],5,-1444681467),a=Wh(a,n,r,i,e[o+2],9,-51403784),i=Wh(i,a,n,r,e[o+7],14,1735328473),r=Wh(r,i,a,n,e[o+12],20,-1926607734),n=Gh(n,r,i,a,e[o+5],4,-378558),a=Gh(a,n,r,i,e[o+8],11,-2022574463),i=Gh(i,a,n,r,e[o+11],16,1839030562),r=Gh(r,i,a,n,e[o+14],23,-35309556),n=Gh(n,r,i,a,e[o+1],4,-1530992060),a=Gh(a,n,r,i,e[o+4],11,1272893353),i=Gh(i,a,n,r,e[o+7],16,-155497632),r=Gh(r,i,a,n,e[o+10],23,-1094730640),n=Gh(n,r,i,a,e[o+13],4,681279174),a=Gh(a,n,r,i,e[o],11,-358537222),i=Gh(i,a,n,r,e[o+3],16,-722521979),r=Gh(r,i,a,n,e[o+6],23,76029189),n=Gh(n,r,i,a,e[o+9],4,-640364487),a=Gh(a,n,r,i,e[o+12],11,-421815835),i=Gh(i,a,n,r,e[o+15],16,530742520),r=Gh(r,i,a,n,e[o+2],23,-995338651),n=Kh(n,r,i,a,e[o],6,-198630844),a=Kh(a,n,r,i,e[o+7],10,1126891415),i=Kh(i,a,n,r,e[o+14],15,-1416354905),r=Kh(r,i,a,n,e[o+5],21,-57434055),n=Kh(n,r,i,a,e[o+12],6,1700485571),a=Kh(a,n,r,i,e[o+3],10,-1894986606),i=Kh(i,a,n,r,e[o+10],15,-1051523),r=Kh(r,i,a,n,e[o+1],21,-2054922799),n=Kh(n,r,i,a,e[o+8],6,1873313359),a=Kh(a,n,r,i,e[o+15],10,-30611744),i=Kh(i,a,n,r,e[o+6],15,-1560198380),r=Kh(r,i,a,n,e[o+13],21,1309151649),n=Kh(n,r,i,a,e[o+4],6,-145523070),a=Kh(a,n,r,i,e[o+11],10,-1120210379),i=Kh(i,a,n,r,e[o+2],15,718787259),r=Kh(r,i,a,n,e[o+9],21,-343485551),n=Vh(n,s),r=Vh(r,c),i=Vh(i,l),a=Vh(a,u)}return[n,r,i,a]}function eae(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(Bh(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Vh(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function tae(e,t){return e<<t|e>>>32-t}function Hh(e,t,n,r,i,a){return Vh(tae(Vh(Vh(t,e),Vh(r,a)),i),n)}function Uh(e,t,n,r,i,a,o){return Hh(t&n|~t&r,e,t,i,a,o)}function Wh(e,t,n,r,i,a,o){return Hh(t&r|n&~r,e,t,i,a,o)}function Gh(e,t,n,r,i,a,o){return Hh(t^n^r,e,t,i,a,o)}function Kh(e,t,n,r,i,a,o){return Hh(n^(t|~r),e,t,i,a,o)}zh(`v3`,48,Zie);function qh(e,t,n){e=e||{};var r=e.random||(e.rng||Gie)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Rh(r)}function nae(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Jh(e,t){return e<<t|e>>>32-t}function rae(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e==`string`){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=Array(o),c=0;c<o;++c){for(var l=/* @__PURE__ */ new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];s[c]=l}s[o-1][14]=(e.length-1)*8/2**32,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=/* @__PURE__ */ new Uint32Array(80),p=0;p<16;++p)f[p]=s[d][p];for(var m=16;m<80;++m)f[m]=Jh(f[m-3]^f[m-8]^f[m-14]^f[m-16],1);for(var h=n[0],g=n[1],_=n[2],v=n[3],y=n[4],b=0;b<80;++b){var ee=Math.floor(b/20),x=Jh(h,5)+nae(ee,g,_,v)+y+t[ee]+f[b]>>>0;y=v,v=_,_=Jh(g,30)>>>0,g=h,h=x}n[0]=n[0]+h>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+_>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}zh(`v5`,80,rae);var iae=class{constructor(){}createId(e=!1){let t=qh();return e&&Fd.debug(`UUID.createID ${t}`),t}createRemoteId(){return J(this,arguments,void 0,function*(e=!1){let t=qh();return e&&Fd.debug(`UUID.createRemoteID ${t}`),t})}};let Yh=N.createInterface(e=>e.singleton(iae)),Xh=1e3,aae=e=>T`<div class="inactivity-overlay" style="display:${e=>e.isVisible?`display`:`none`}"><${e}-card class="dialog-card"><div class="card-body"><div class="dialog-header"><${e}-icon name="warning" class="warning-icon"></${e}-icon><h2>Session Timeout Warning</h2></div><div class="dialog-content"><p>
|
|
227
227
|
You have been inactive for too long. You will be automatically logged out in <strong>${e=>e.remainingSeconds}</strong>
|
|
228
228
|
seconds.
|
|
229
229
|
</p><p>
|
|
@@ -254,7 +254,7 @@ function ty(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
254
254
|
✕
|
|
255
255
|
</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>`)} `,iC=T` ${e=>sse(yb(e))} `,cse={contains:Ab.containsIgnoreCase,equals:Ab.EQ,startsWith:Ab.startsWith,endsWith:Ab.endsWith,greaterThan:Ab.GT,lessThan:Ab.LT,greaterThanOrEqual:Ab.GE,lessThanOrEqual:Ab.LE,notEqual:Ab.NE,dateIsToday:Ab.dateIsToday,dateIsAfter:Ab.dateIsGreaterEqual,dateIsGreaterEqual:Ab.dateIsGreaterEqual,dateIsBefore:Ab.dateIsLessEqual,dateIsLessEqual:Ab.dateIsLessEqual,dateIsEqual:Ab.dateIsEqual,dateTimeIsAfter:Ab.dateTimeIsGreaterEqual,dateTimeIsGreaterEqual:Ab.dateTimeIsGreaterEqual,dateTimeIsBefore:Ab.dateTimeIsLessEqual,dateTimeIsLessEqual:Ab.dateTimeIsLessEqual};function lse(e){let t=cse[e.operator];if(!t)throw Error(`Unknown criteria operator '${e.operator}'`);return new Fb().withField(e.field).withValue(e.value??null).withSerialiser(t).withGroup(`default`).build()}function use(e,t){return e.length===1?e[0]:e.reduce((e,n,r)=>r===0?[n]:[...e,t,n],[])}function aC(e){let t=new Pb,n=!1;for(let r of e){if(!r.clauses?.length)continue;let e=r.clauses.map(lse),i=r.logic===`or`?Cb.Or():Cb.And(),a=use(e,i),o=e.length>1?{join:i}:{};r.negated?t.And([Cb.Not(),a]):t.And(e.length===1?e[0]:e,o),n=!0}return n?t.build():``}let dse=[`contains`,`equals`,`startsWith`,`notEqual`],oC=[`equals`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`,`notEqual`],sC=[`dateIsToday`,`dateIsAfter`,`dateIsBefore`,`dateIsEqual`,`dateIsGreaterEqual`,`dateIsLessEqual`],cC=[`dateTimeIsAfter`,`dateTimeIsBefore`,`dateTimeIsGreaterEqual`,`dateTimeIsLessEqual`],fse={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:`≤`},pse=/* @__PURE__ */ new Set([`DATE`,`LOCALDATE`]),mse=/* @__PURE__ */ new Set([`DATETIME`,`NANO_TIMESTAMP`,`LOCALDATETIME`,`TIMESTAMP`]),lC=/* @__PURE__ */ new Set([`INT`,`INTEGER`,`LONG`,`SHORT`,`DOUBLE`,`BIGDECIMAL`,`DECIMAL`]);function uC(e){return(e||``).toUpperCase().trim().split(`(`)[0].trim()}function hse(e){let t=uC(e);return pse.has(t)?sC:mse.has(t)?cC:lC.has(t)?oC:dse}function gse(e){return lC.has(uC(e))}function _se(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 vse(e){return e==null?!1:typeof e==`number`?!Number.isNaN(e):typeof e==`string`&&!Number.isNaN(Number(e))}function yse(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(!hse(c).includes(a)){r.push({field:e,operator:a,value:o,message:`Operator '${a}' is not allowed for field type ${c}`});continue}if((sC.includes(a)||cC.includes(a))&&a!==`dateIsToday`&&!_se(o)){r.push({field:e,operator:a,value:o,message:`Invalid date/datetime value; use yyyyMMdd, yyyy-MM-dd, or epoch`});continue}if(gse(c)&&oC.includes(a)&&!vse(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 bse(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}=yse(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 dC=kd(`foundation-notifications`),fC=null,pC=/* @__PURE__ */ new Map,mC=e=>`${e?.title??`Error`}: ${e?.body??`Something went wrong`}`,xse=e=>e?.logLevel||e?.config?.logLevel||_d.debug,hC=e=>{dC.log({message:mC(e),level:xse(e)})},gC=(e,t)=>{let n=document.querySelector(`#${e}`);if(!n){if(pC.has(e))n=pC.get(e);else{let t=Id(document).find(t=>t.id===e);t&&(n=t,pC.set(e,t))}}if(!n){n=document.createElement(`div`),n.setAttribute(`id`,e),n.style.zIndex=`9999`;let{element:t,prefix:r}=zd(document.body,`rapid`);if(t)t.appendChild(n),fC=t;else if(fC)fC.appendChild(n);else{let e=document.createElement(`${r}-design-system-provider`);e.appendChild(n),document.body.appendChild(e),fC=e}}return n},Sse=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 Cse()},Cse=()=>{let e=document.createElement(`div`);return e.setAttribute(`id`,`banner-anchor`),e.style.position=`relative`,document.body.insertBefore(e,document.body.firstChild),e},wse=e=>{hC(e),alert(mC(e))},Tse=(e,t,n)=>{hC(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-banner`),a=Sse(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},Ese=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},Dse=(e,t,n)=>{hC(e);let r=t.split(`-`)[0],i=document.createElement(`${r}-dialog`);(n?Ese(n):gC(`dialog-container`,t)).appendChild(i),i.notification=e,i.show()};var _C;(function(e){e.NOTIFICATION_EVENT=`notification-event`})(_C||(_C={}));var vC;(function(e){e.Top=`top`,e.Bottom=`bottom`})(vC||(vC={}));var yC;(function(e){e.Left=`left`,e.Right=`right`})(yC||(yC={}));let bC=`12px`,Ose=(e,t,n)=>{e.style.position=`fixed`,e.style.top=t===vC.Top?bC:``,e.style.bottom=t===vC.Bottom?bC:``,e.style.left=n===yC.Left?bC:``,e.style.right=n===yC.Right?bC:``},kse=(e,t)=>{hC(e);let n=t.split(`-`)[0],r=document.createElement(`${n}-snackbar`),i=e.config?.snackbar?.verticalEdge??vC.Bottom,a=e.config?.snackbar?.horizontalEdge??yC.Left,o=gC(`snack-container-${i}-${a}`,t);o&&Ose(o,i,a),o.appendChild(r),r.notification=e},Ase=e=>Id(document.body).find(t=>t.tagName.toLowerCase()===`notify-container`&&t.position===e);function jse(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 xC=(e,t,n)=>{var r,i;hC(e);let a=t.split(`-`)[0],o=e?.config?.toast?.position||`top-right`,s=n??Ase(o)??gC(`notify-container`,t);s&&s.tagName.toLowerCase()!==`notify-container`&&jse(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)},SC=(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)),xC(r,t,n)},Mse=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}`,Nse=e=>T`<div class="header ${e=>fn([`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=>fn([`collapse`,e.stackCollapsed])}" name="chevron-up"></${e}-icon></${e}-button>`)} ${A(e=>e.allowCloseAll,T`<${e}-button @click=${e=>e.handleCloseAll()}>
|
|
256
256
|
Close All <${e}-icon name="xmark"></${e}-icon></${e}-button>`)}</div></div>`,Pse=T` ${A(e=>e.allowCloseAll||e.allowManualCollapse,T` ${e=>Nse(e.designSystemPrefix)} `)}<div class="toast-container"><slot ${bt(`slottedNodes`)}@click="${e=>e.handleContainerClick()}"></slot></div>`,CC=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(Bf.shared.pathName)},this.slottedNodes=[]}connectedCallback(){super.connectedCallback(),(this.position===`bottom-left`||this.position===`bottom-right`)&&dC.error(`NotifyContainer doesn't currently support bottom corner placements`),S.getNotifier(Bf.shared).subscribe(this.routeSubscriber,`pathName`),this.checkRoute(Bf.shared.pathName),this.mutationObserver=new MutationObserver(e=>this.handleMutation(e)),this.mutationObserver.observe(this,{childList:!0})}disconnectedCallback(){var e;super.disconnectedCallback(),S.getNotifier(Bf.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],CC.prototype,`position`,void 0),q([D({attribute:`stack-threshold`})],CC.prototype,`stackThreshold`,void 0),q([D({attribute:`allow-manual-collapse`,mode:`boolean`})],CC.prototype,`allowManualCollapse`,void 0),q([D({attribute:`allow-close-all`,mode:`boolean`})],CC.prototype,`allowCloseAll`,void 0),q([D({attribute:`design-system-prefix`})],CC.prototype,`designSystemPrefix`,void 0),q([D({attribute:`show-count`,mode:`boolean`})],CC.prototype,`showCount`,void 0),q([D({attribute:`stack-collapsed`,mode:`boolean`})],CC.prototype,`stackCollapsed`,void 0),q([D({attribute:`notification-interval`})],CC.prototype,`notificationInterval`,void 0),q([C],CC.prototype,`sortFn`,void 0),q([C],CC.prototype,`slottedNodes`,void 0),CC=q([$e({name:`notify-container`,template:Pse,styles:Mse})],CC);let wC={alert:wse,toast:xC,dialog:Dse,snackbar:kse,banner:Tse},TC=(e,t,n)=>{Object.keys(e?.config||{}).forEach(r=>{wC[r]&&wC[r](e,t,n)})};function Fse(e){return e.length===0?``:e.length===1?e[0].message:e.map(e=>e.message).join(`; `)}function EC(e,t,n){t?.trim()&&TC({title:e,body:t,config:{toast:{autoClose:!0,closeTimeout:4e3,type:`error`}}},n)}var DC=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 ex()}get criteriaChips(){return this.activeGroups.flatMap((e,t)=>e.clauses.map((e,n)=>({groupIndex:t,clauseIndex:n,fieldLabel:this.getFieldLabel(e.field),operatorLabel:fse[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=aC(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){EC(`AI criteria search`,`AI provider not configured`,yb(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)){EC(`AI criteria search`,`AI could not interpret the criteria`,yb(this)),this.isInterpreting=!1;return}let{valid:i,invalid:a}=bse(r.groups,this.fieldMetadata);if(a.length>0&&(EC(`Criteria validation error`,Fse(a),yb(this)),this.$emit(`validation-errors`,a)),i.length>0){let e=[...this.activeGroups,...i],t=aC(e);this.lastValidCriteria=t,this.activeGroups=e,this.inputValue=``,this.showingChips=!0,this.$emit(`criteria-changed`,t)}}catch(e){EC(`AI criteria search`,e instanceof Error?e.message:`Interpretation failed`,yb(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=tx((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([eC],DC.prototype,`providerRegistry`,void 0),q([D],DC.prototype,`placeholder`,void 0),q([D({mode:`boolean`})],DC.prototype,`disabled`,void 0),q([C],DC.prototype,`inputValue`,void 0),q([C],DC.prototype,`isInterpreting`,void 0),q([C],DC.prototype,`lastValidCriteria`,void 0),q([C],DC.prototype,`activeGroups`,void 0),q([C],DC.prototype,`showingChips`,void 0),q([C],DC.prototype,`fieldMetadata`,void 0),q([C],DC.prototype,`isRecording`,void 0),q([w],DC.prototype,`speechAvailable`,null),q([w],DC.prototype,`criteriaChips`,null);let OC={};DC.compose(Object.assign({baseName:`ai-criteria-search`,template:iC,styles:rC,shadowOptions:void 0},OC));let kC=(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%}`,Ise=e=>T` ${A(()=>Qb(),T`<div class="ai-indicator-container" part="ai-indicator-container"><div class=${e=>fn(`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()}}>
|
|
257
|
-
Install model </${e}-button>`)}</div>`)}</div>`)} `,AC=T` ${e=>Ise(yb(e))} `;var jC=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){_b(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([eC],jC.prototype,`providerRegistry`,void 0),q([C],jC.prototype,`status`,void 0),q([C],jC.prototype,`open`,void 0),q([C],jC.prototype,`state`,void 0),q([C],jC.prototype,`isInstalling`,void 0),q([w],jC.prototype,`chromeStatusLabel`,null),q([w],jC.prototype,`canInstall`,null),q([w],jC.prototype,`isDownloading`,null),jC.compose({baseName:`ai-indicator`,template:AC,styles:kC});let MC=(e,t)=>Hn(e,t),NC=(e,t)=>O` ${Fl(e,t)}`;var PC=class extends Il{};let FC={delegatesFocus:!0,mode:`open`},IC={};PC.compose(Object.assign({baseName:`anchor`,template:MC,styles:NC,shadowOptions:FC},IC));let LC=(e,t)=>Kn(e,t),RC=(e,t)=>O` ${Ll(e,t)}`;var zC=class extends Jn{};let BC={delegatesFocus:!0,mode:`open`},VC={};zC.compose(Object.assign({baseName:`anchored-region`,template:LC,styles:RC,shadowOptions:BC},VC));let HC=(e,t)=>er(e,t),Lse=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,UC=(e,t)=>O` ${Rl(e,t)}`;var WC=class extends zl{};let GC={delegatesFocus:!0,mode:`open`},KC={media:Lse};WC.compose(Object.assign({baseName:`avatar`,template:HC,styles:UC,shadowOptions:GC},KC));let qC=(e,t)=>nr(e,t),JC=(e,t)=>O` ${Bl(e,t)}`;var YC=class extends rr{};let XC={};YC.compose(Object.assign({baseName:`badge`,template:qC,styles:JC,shadowOptions:void 0},XC));let ZC=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}`,Rse=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>`,QC=T` ${e=>Rse(yb(e))} `,$C={mode:`open`,delegatesFocus:!0};var ew=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){hb.error(e)}})}};q([C],ew.prototype,`dismissAnimation`,void 0),q([C],ew.prototype,`notification`,void 0),ew.compose({baseName:`banner`,styles:ZC,template:QC,shadowOptions:$C});let tw=(e,t)=>or(e,t),nw=(e,t)=>O` ${Hl(e,t)}`;var rw=class extends sr{};rw.compose(Object.assign({baseName:`breadcrumb`,template:tw,styles:nw,shadowOptions:void 0},{}));let iw=(e,t)=>ir(e,t),aw=(e,t)=>O` ${Vl(e,t)}`;var ow=class extends ar{};let sw={separator:`/`};ow.compose(Object.assign({baseName:`breadcrumb-item`,template:iw,styles:aw,shadowOptions:void 0},sw));let cw=(e,t)=>cr(e,t),lw=(e,t)=>O` ${Ul(e,t)}`;var uw=class extends Wl{};let dw={delegatesFocus:!0,mode:`open`},fw={};uw.compose(Object.assign({baseName:`button`,template:cw,styles:lw,shadowOptions:dw},fw));let pw=()=>O` ${Gl}`,mw=(e,t)=>Ar(e,t);var hw=class extends br{};let gw={delegatesFocus:!0,mode:`open`},_w={};hw.compose(Object.assign({baseName:`calendar`,template:mw,styles:pw,shadowOptions:gw},_w));let vw=(e,t)=>jr(e,t),yw=(e,t)=>O` ${Kl(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var bw=class extends ql{};let xw={};bw.compose(Object.assign({baseName:`card`,template:vw,styles:yw,shadowOptions:void 0},xw));var Sw;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(Sw||(Sw={}));var Cw=/* @__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 ww=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 Tw;let Ew=Tw=class extends gb{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=Tw.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.select instanceof Ql,r=this.options?.find(e=>String(n?e.label:e.value)===String(t)),i=!r&&this.allowCustomOptions&&n?{label:t,value:t}:r??null;this.select.$emit(`value-change`,i)}}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??`${yb(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:Tw.defaultPageSize,this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||hb.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!==ng.DATASERVER}catch(e){hb.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){hb.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-Tw.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===ng.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 Ql&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){let e=yield this.datasource.init(this.datasourceOptions(),!0);if(this.isConnected){if(!e){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}zb(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 Tw||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 Ql&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof Ql&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof Ql&&!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 Ql?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof Ql&&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){hb.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){hb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){hb.debug(`handleStreamUpdates - Method not implemented.`)}};Ew.defaultPageSize=20,Ew.scrollLoadThresholdPx=32,q([Uy],Ew.prototype,`resources`,void 0),q([D({attribute:`label-field`})],Ew.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],Ew.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],Ew.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],Ew.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],Ew.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],Ew.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],Ew.prototype,`pageSize`,void 0),q([C],Ew.prototype,`labelFormatter`,void 0),q([C],Ew.prototype,`labelRowFormatter`,void 0),q([C],Ew.prototype,`initialSelectedValue`,void 0),Ew=Tw=q([$e({name:`options-datasource`})],Ew);let Dw=class extends gb{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||hb.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){hb.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){hb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){hb.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],Dw.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],Dw.prototype,`labelField`,void 0),Dw=q([$e({name:`multiselect-datasource`})],Dw);let Ow=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>fn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${bt({property:`defaultSlottedNodes`,filter:ha})}></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=${cf(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=>fn([`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=>fn(`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=>fn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${bt({property:`optionsHeaderSlottedNodes`,filter:ha})}></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 ${bt({property:`slottedDatasource`,filter:e=>e instanceof Dw})}></slot>`,zse=T` ${Ow()} `,kw={};var Aw=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=Sw.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,Cw.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===Sw.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?Sw.ABOVE:Sw.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===Sw.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===Sw.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.trim().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.updateSelection(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.updateSelection(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=>{if(!t)return!1;let n=typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t);return n==null||typeof n==`object`?!1:String(n).toLowerCase()===e})}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(!t)return!1;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label!=null&&typeof t.label!=`object`&&typeof t.label!=`function`?String(t.label).toLowerCase():``,r=t=>Object.values(t).some(t=>t==null||typeof t==`function`?!1:typeof t==`object`?r(t):String(t).toLowerCase().includes(e)),i=t.value!=null&&typeof t.value==`object`?r(t.value):t.value!=null&&typeof t.value!=`function`&&String(t.value).toLowerCase().includes(e);return n.includes(e)||i})}updateSelection(e){this.selectedOptions=e,this.$emit(`selectionChange`,this.selectedOptions)}addOption(){let e=this.filterSearchValue.trim();if(!e||this.options.some(t=>this.optionValueGetter(t)===e))return;let t={value:e,label:e};this.$emit(`optionCreated`,t)!==!1&&(this.options=[t,...this.options],this.setFilter(),this.updateSelection([...this.selectedOptions,e]))}asyncSetFilter(){this.slottedDatasource.length>0?Rb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,hb.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){_b(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.updateSelection([]),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};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,`all`,void 0),q([D({mode:`boolean`})],Aw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],Aw.prototype,`search`,void 0),q([D({mode:`boolean`})],Aw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],Aw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],Aw.prototype,`async`,void 0),q([D],Aw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],Aw.prototype,`resizable`,void 0),q([D],Aw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],Aw.prototype,`filterByContains`,void 0),q([C],Aw.prototype,`defaultSlottedNodes`,void 0),q([C],Aw.prototype,`slottedDatasource`,void 0),q([C],Aw.prototype,`valueFormatter`,void 0),q([C],Aw.prototype,`loading`,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,`scrollContainer`,void 0),q([D],Aw.prototype,`position`,void 0),q([C],Aw.prototype,`onAllSelectedCallback`,void 0),q([C],Aw.prototype,`itemRenderer`,void 0),q([w],Aw.prototype,`getDisplayValue`,null),q([w],Aw.prototype,`getPlaceholder`,null),q([w],Aw.prototype,`isAllOptionsDisabled`,null),q([w],Aw.prototype,`areAllOptionsSelected`,null),q([w],Aw.prototype,`showCreatable`,null),q([C],Aw.prototype,`optionsHeaderSlottedNodes`,void 0),Aw.compose(Object.assign({baseName:`multiselect`,template:zse,styles:ww,shadowOptions:void 0},kw));let jw=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}`,Mw=(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=>fn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${bt({property:`defaultSlottedNodes`,filter:ha})}></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=${cf(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>`,Bse=T` ${Mw()} `,Nw={};var Pw=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=Sw.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===Sw.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?Sw.BELOW:Sw.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?Sw.ABOVE:Sw.BELOW}}e===Sw.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===Sw.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.filterSearchValue.toLowerCase(),t=this.options.filter(t=>{if(!t)return!1;let n=t.description,r=t.label??t.value;return!!(n!=null&&String(n).toLowerCase().includes(e)||r!=null&&String(r).toLowerCase().includes(e))});this.filteredAvailableOptions=this.sortFilteredOptions(t)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){_b(e,this)&&(this.open=!1)}};q([D],Pw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Pw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Pw.prototype,`search`,void 0),q([D({mode:`boolean`})],Pw.prototype,`disabled`,void 0),q([C],Pw.prototype,`defaultSlottedNodes`,void 0),q([C],Pw.prototype,`valueFormatter`,void 0),q([C],Pw.prototype,`filterSearchValue`,void 0),q([C],Pw.prototype,`open`,void 0),q([C],Pw.prototype,`options`,void 0),q([C],Pw.prototype,`selectedOptions`,void 0),q([C],Pw.prototype,`filteredAvailableOptions`,void 0),q([C],Pw.prototype,`position`,void 0),q([w],Pw.prototype,`getPlaceholder`,null),Pw.compose(Object.assign({baseName:`categorized-multiselect`,template:Bse,styles:jw,shadowOptions:void 0},Nw));let Fw=(e,t)=>Nr(e,t),Iw=(e,t)=>O` ${Jl(e,t)}`;var Lw=class extends Pr{};let Rw={checkedIndicator:`
|
|
257
|
+
Install model </${e}-button>`)}</div>`)}</div>`)} `,AC=T` ${e=>Ise(yb(e))} `;var jC=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){_b(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([eC],jC.prototype,`providerRegistry`,void 0),q([C],jC.prototype,`status`,void 0),q([C],jC.prototype,`open`,void 0),q([C],jC.prototype,`state`,void 0),q([C],jC.prototype,`isInstalling`,void 0),q([w],jC.prototype,`chromeStatusLabel`,null),q([w],jC.prototype,`canInstall`,null),q([w],jC.prototype,`isDownloading`,null),jC.compose({baseName:`ai-indicator`,template:AC,styles:kC});let MC=(e,t)=>Hn(e,t),NC=(e,t)=>O` ${Fl(e,t)}`;var PC=class extends Il{};let FC={delegatesFocus:!0,mode:`open`},IC={};PC.compose(Object.assign({baseName:`anchor`,template:MC,styles:NC,shadowOptions:FC},IC));let LC=(e,t)=>Kn(e,t),RC=(e,t)=>O` ${Ll(e,t)}`;var zC=class extends Jn{};let BC={delegatesFocus:!0,mode:`open`},VC={};zC.compose(Object.assign({baseName:`anchored-region`,template:LC,styles:RC,shadowOptions:BC},VC));let HC=(e,t)=>er(e,t),Lse=T` ${A(e=>e.imgSrc,T`<img src="${e=>e.imgSrc}" alt="${e=>e.alt}" slot="media" class="media" part="media" />`)} `,UC=(e,t)=>O` ${Rl(e,t)}`;var WC=class extends zl{};let GC={delegatesFocus:!0,mode:`open`},KC={media:Lse};WC.compose(Object.assign({baseName:`avatar`,template:HC,styles:UC,shadowOptions:GC},KC));let qC=(e,t)=>nr(e,t),JC=(e,t)=>O` ${Bl(e,t)}`;var YC=class extends rr{};let XC={};YC.compose(Object.assign({baseName:`badge`,template:qC,styles:JC,shadowOptions:void 0},XC));let ZC=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}`,Rse=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>`,QC=T` ${e=>Rse(yb(e))} `,$C={mode:`open`,delegatesFocus:!0};var ew=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){hb.error(e)}})}};q([C],ew.prototype,`dismissAnimation`,void 0),q([C],ew.prototype,`notification`,void 0),ew.compose({baseName:`banner`,styles:ZC,template:QC,shadowOptions:$C});let tw=(e,t)=>or(e,t),nw=(e,t)=>O` ${Hl(e,t)}`;var rw=class extends sr{};rw.compose(Object.assign({baseName:`breadcrumb`,template:tw,styles:nw,shadowOptions:void 0},{}));let iw=(e,t)=>ir(e,t),aw=(e,t)=>O` ${Vl(e,t)}`;var ow=class extends ar{};let sw={separator:`/`};ow.compose(Object.assign({baseName:`breadcrumb-item`,template:iw,styles:aw,shadowOptions:void 0},sw));let cw=(e,t)=>cr(e,t),lw=(e,t)=>O` ${Ul(e,t)}`;var uw=class extends Wl{};let dw={delegatesFocus:!0,mode:`open`},fw={};uw.compose(Object.assign({baseName:`button`,template:cw,styles:lw,shadowOptions:dw},fw));let pw=()=>O` ${Gl}`,mw=(e,t)=>Ar(e,t);var hw=class extends br{};let gw={delegatesFocus:!0,mode:`open`},_w={};hw.compose(Object.assign({baseName:`calendar`,template:mw,styles:pw,shadowOptions:gw},_w));let vw=(e,t)=>jr(e,t),yw=(e,t)=>O` ${Kl(e,t)} :host{background-color: var(--fui-card-fill-color);color: var(--fui-card-foreground-color)}`;var bw=class extends ql{};let xw={};bw.compose(Object.assign({baseName:`card`,template:vw,styles:yw,shadowOptions:void 0},xw));var Sw;(function(e){e.BELOW=`below`,e.ABOVE=`above`})(Sw||(Sw={}));var Cw=/* @__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 ww=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 Tw;let Ew=Tw=class extends gb{constructor(){super(...arguments),this.emptyDataLabel=`No matching records`,this.allowCustomOptions=!1,this.infiniteScroll=!1,this.pageSize=Tw.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.initialValueLookup=null,this.selectOpenChangeHandler=e=>{e.detail?.open&&(this.restoreCriteriaAfterInitialValueLookup(),this.infiniteScroll&&(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.select instanceof Ql,r=this.options?.find(e=>String(n?e.label:e.value)===String(t)),i=!r&&this.allowCustomOptions&&n?{label:t,value:t}:r??null;this.select.$emit(`value-change`,i)}}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??`${yb(this.select)}-option`,this.select.addEventListener(`change`,this.selectChangeHandler),this.select.addEventListener(`open-change`,this.selectOpenChangeHandler),this.resizeObserver=new ResizeObserver(this.resizeObserverCallback),this.infiniteScroll){if(this.isSnapshot=!0,this.maxRows=this.pageSize>0?this.pageSize:Tw.defaultPageSize,yield this.applyInfiniteScrollFetchMode(),!this.isConnected)return;x.queueUpdate(()=>this.attachListboxScrollListener())}this.fetchData(),this.valueField||hb.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)}restoreCriteriaAfterInitialValueLookup(){let e=this.initialValueLookup;this.initialValueLookup=null,e&&this.criteria===e.criteria&&(this.criteria=e.restoreTo)}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!==ng.DATASERVER}catch(e){hb.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){hb.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-Tw.scrollLoadThresholdPx}loadNextPage(){return J(this,void 0,void 0,function*(){if(this.loadingMoreRows||!this.canRequestMoreRows())return;this.loadingMoreRows=!0;let e=this.datasource.resourceType===ng.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 Ql&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData())}asyncModeIntialization(){return J(this,void 0,void 0,function*(){let e=yield this.datasource.init(this.datasourceOptions(),!0);if(!this.isConnected)return;if(!e){this.handleError({message:`Genesis Datasource async mode initialization failed for ${this.resourceName}`,loggerType:`error`});return}let t=this.criteriaBeforeInitialValueLookup();zb(this,this.initialSelectedValue),this.initialValueLookup={criteria:this.criteria,restoreTo:t}})}criteriaBeforeInitialValueLookup(){let e=this.initialValueLookup;return e&&this.criteria===e.criteria?e.restoreTo:this.criteria}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 Tw||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 Ql&&!this.select.async&&e){this.resetCombobox();let e=this.getInitialLabel();x.queueUpdate(()=>{this.select.value=String(e),e&&this.select instanceof Ql&&this.select.async&&this.selectChangeHandler({target:{value:e}})}),this.initalSelectedValueInitialized=!0}}else if(this.allowCustomOptions&&this.initialSelectedValue&&(!this.initalSelectedValueInitialized||this.select instanceof Ql&&!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 Ql?String(t?t.label:e):t?String(t.label):``}resetCombobox(){this.select&&this.select instanceof Ql&&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){hb.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){hb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){hb.debug(`handleStreamUpdates - Method not implemented.`)}};Ew.defaultPageSize=20,Ew.scrollLoadThresholdPx=32,q([Uy],Ew.prototype,`resources`,void 0),q([D({attribute:`label-field`})],Ew.prototype,`labelField`,void 0),q([D({attribute:`option-element`})],Ew.prototype,`optionElement`,void 0),q([D({attribute:`value-field`})],Ew.prototype,`valueField`,void 0),q([D({attribute:`empty-data-label`})],Ew.prototype,`emptyDataLabel`,void 0),q([D({mode:`boolean`,attribute:`allow-custom-options`})],Ew.prototype,`allowCustomOptions`,void 0),q([D({mode:`boolean`,attribute:`infinite-scroll`})],Ew.prototype,`infiniteScroll`,void 0),q([D({attribute:`page-size`,converter:E})],Ew.prototype,`pageSize`,void 0),q([C],Ew.prototype,`labelFormatter`,void 0),q([C],Ew.prototype,`labelRowFormatter`,void 0),q([C],Ew.prototype,`initialSelectedValue`,void 0),Ew=Tw=q([$e({name:`options-datasource`})],Ew);let Dw=class extends gb{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||hb.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){hb.debug(`handleStreamInserts - Method not implemented.`)}handleStreamDeletes(e){hb.debug(`handleStreamDeletes - Method not implemented.`)}handleStreamUpdates(e){hb.debug(`handleStreamUpdates - Method not implemented.`)}};q([D({attribute:`value-field`})],Dw.prototype,`valueField`,void 0),q([D({attribute:`label-field`})],Dw.prototype,`labelField`,void 0),Dw=q([$e({name:`multiselect-datasource`})],Dw);let Ow=(e=`foundation`)=>T`<label part="label" for="display-field" class=${e=>fn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot name="label" ${bt({property:`defaultSlottedNodes`,filter:ha})}></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=${cf(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=>fn([`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=>fn(`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=>fn(`options-header-item`,[`options-header-item-hidden`,!e.optionsHeaderSlottedNodes?.length])}><slot name="options-header" ${bt({property:`optionsHeaderSlottedNodes`,filter:ha})}></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 ${bt({property:`slottedDatasource`,filter:e=>e instanceof Dw})}></slot>`,zse=T` ${Ow()} `,kw={};var Aw=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=Sw.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,Cw.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===Sw.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?Sw.ABOVE:Sw.BELOW}this.multiselectDropdown.classList.toggle(`position-above`,e===Sw.ABOVE),this.multiselectDropdown.classList.toggle(`position-below`,e===Sw.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.trim().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.updateSelection(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.updateSelection(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=>{if(!t)return!1;let n=typeof t==`string`?t:this.optionLabelGetter(t)??this.optionValueGetter(t);return n==null||typeof n==`object`?!1:String(n).toLowerCase()===e})}setFilter(){let e=this.filterSearchValue.toLowerCase();this.filteredAvailableOptions=this.options.filter(t=>{if(!e)return!0;if(!t)return!1;if(typeof t==`string`)return t.toLowerCase().includes(e);let n=t.label!=null&&typeof t.label!=`object`&&typeof t.label!=`function`?String(t.label).toLowerCase():``,r=t=>Object.values(t).some(t=>t==null||typeof t==`function`?!1:typeof t==`object`?r(t):String(t).toLowerCase().includes(e)),i=t.value!=null&&typeof t.value==`object`?r(t.value):t.value!=null&&typeof t.value!=`function`&&String(t.value).toLowerCase().includes(e);return n.includes(e)||i})}updateSelection(e){this.selectedOptions=e,this.$emit(`selectionChange`,this.selectedOptions)}addOption(){let e=this.filterSearchValue.trim();if(!e||this.options.some(t=>this.optionValueGetter(t)===e))return;let t={value:e,label:e};this.$emit(`optionCreated`,t)!==!1&&(this.options=[t,...this.options],this.setFilter(),this.updateSelection([...this.selectedOptions,e]))}asyncSetFilter(){this.slottedDatasource.length>0?Rb(this.slottedDatasource[0],this.filterSearchValue):(this.loading=!1,hb.warn(`Multiselect-datasource is not connected. Please add a datasource to use this functionality.`))}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){_b(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.updateSelection([]),n&&(this.filterSearchValue=``,this.setFilter(),this.filterSearchInput&&(this.filterSearchInput.value=``)),this.$emit(`clear`,{clearSelectedValues:t,clearFilterText:n})}};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,`all`,void 0),q([D({mode:`boolean`})],Aw.prototype,`allSelected`,void 0),q([D({mode:`boolean`})],Aw.prototype,`search`,void 0),q([D({mode:`boolean`})],Aw.prototype,`disabled`,void 0),q([D({mode:`boolean`})],Aw.prototype,`creatable`,void 0),q([D({mode:`boolean`})],Aw.prototype,`async`,void 0),q([D],Aw.prototype,`debounce`,void 0),q([D({mode:`boolean`})],Aw.prototype,`resizable`,void 0),q([D],Aw.prototype,`tabindex`,void 0),q([D({mode:`boolean`,attribute:`filter-by-contains`})],Aw.prototype,`filterByContains`,void 0),q([C],Aw.prototype,`defaultSlottedNodes`,void 0),q([C],Aw.prototype,`slottedDatasource`,void 0),q([C],Aw.prototype,`valueFormatter`,void 0),q([C],Aw.prototype,`loading`,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,`scrollContainer`,void 0),q([D],Aw.prototype,`position`,void 0),q([C],Aw.prototype,`onAllSelectedCallback`,void 0),q([C],Aw.prototype,`itemRenderer`,void 0),q([w],Aw.prototype,`getDisplayValue`,null),q([w],Aw.prototype,`getPlaceholder`,null),q([w],Aw.prototype,`isAllOptionsDisabled`,null),q([w],Aw.prototype,`areAllOptionsSelected`,null),q([w],Aw.prototype,`showCreatable`,null),q([C],Aw.prototype,`optionsHeaderSlottedNodes`,void 0),Aw.compose(Object.assign({baseName:`multiselect`,template:zse,styles:ww,shadowOptions:void 0},kw));let jw=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}`,Mw=(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=>fn(`label`,[`label-hidden`,!e.defaultSlottedNodes?.length])}><slot ${bt({property:`defaultSlottedNodes`,filter:ha})}></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=${cf(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>`,Bse=T` ${Mw()} `,Nw={};var Pw=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=Sw.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===Sw.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?Sw.BELOW:Sw.ABOVE}else{let t=this.getBoundingClientRect(),n=window.innerHeight,r=t.top,i=n-t.bottom;e=i<t.height&&r>i?Sw.ABOVE:Sw.BELOW}}e===Sw.ABOVE?(this.optionsElement.classList.add(`position-above`),this.optionsElement.classList.remove(`position-below`)):e===Sw.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.filterSearchValue.toLowerCase(),t=this.options.filter(t=>{if(!t)return!1;let n=t.description,r=t.label??t.value;return!!(n!=null&&String(n).toLowerCase().includes(e)||r!=null&&String(r).toLowerCase().includes(e))});this.filteredAvailableOptions=this.sortFilteredOptions(t)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){_b(e,this)&&(this.open=!1)}};q([D],Pw.prototype,`name`,void 0),q([D({mode:`boolean`,attribute:`auto-position`})],Pw.prototype,`autoPosition`,void 0),q([D({mode:`boolean`})],Pw.prototype,`search`,void 0),q([D({mode:`boolean`})],Pw.prototype,`disabled`,void 0),q([C],Pw.prototype,`defaultSlottedNodes`,void 0),q([C],Pw.prototype,`valueFormatter`,void 0),q([C],Pw.prototype,`filterSearchValue`,void 0),q([C],Pw.prototype,`open`,void 0),q([C],Pw.prototype,`options`,void 0),q([C],Pw.prototype,`selectedOptions`,void 0),q([C],Pw.prototype,`filteredAvailableOptions`,void 0),q([C],Pw.prototype,`position`,void 0),q([w],Pw.prototype,`getPlaceholder`,null),Pw.compose(Object.assign({baseName:`categorized-multiselect`,template:Bse,styles:jw,shadowOptions:void 0},Nw));let Fw=(e,t)=>Nr(e,t),Iw=(e,t)=>O` ${Jl(e,t)}`;var Lw=class extends Pr{};let Rw={checkedIndicator:`
|
|
258
258
|
<svg
|
|
259
259
|
aria-hidden="true"
|
|
260
260
|
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.110.
|
|
4
|
+
"version": "15.110.4",
|
|
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.110.
|
|
27
|
+
"@genesislcap/genx": "15.110.4",
|
|
28
28
|
"rolldown": "~1.2.9"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@genesislcap/rapid-design-system": "15.110.
|
|
31
|
+
"@genesislcap/rapid-design-system": "15.110.4"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|