@fluid-topics/ft-modal 1.2.25 → 1.2.26

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.
@@ -1127,7 +1127,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1127
1127
  `;var Yo=S(k());var Cc=S(k());var ki=S(D()),at=S(V()),xt=S(k());var Ri=S(D());var Li=Ri.css`
1128
1128
  `;var Ao=S(k()),sl="ft-app-info",Ar=class extends CustomEvent{constructor(o){super("authentication-change",{detail:o})}},dl={session:(e,o)=>{(0,Ao.deepEqual)(e.session,o.payload)||(e.session=o.payload,setTimeout(()=>L.dispatchEvent(new Ar(o.payload)),0))}},L=Ao.FtReduxStore.get({name:sl,reducers:dl,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var Vt=S(k());var Rr=S(k());var de=class e{static get(o){let{baseUrl:r,apiIntegrationIdentifier:n}=L.getState(),a=o??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(o){return new Promise(r=>{let n=e.get(o);if(n)r(n);else{let a=L.subscribe(()=>{n=e.get(o),n&&(a(),r(n))})}})}};var Zt=class{constructor(o=!0,r){var n;this.overrideApi=r;let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Rr.CacheRegistry,this.cache=o?a.commonCache:new Rr.CacheRegistry}get api(){var o;return(o=this.overrideApi)!==null&&o!==void 0?o:de.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):de.await()}clearCache(){this.cache.clearAll()}};var Pi,fl=Symbol("clearAfterUnitTest"),Ro=class extends Zt{constructor(o){super(),this.messageContextProvider=o,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Pi]=()=>{this.defaultMessages={},this.cache=new Vt.CacheRegistry,this.listeners={}},this.currentUiLocale=L.getState().uiLocale,L.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:o}=L.getState();this.currentUiLocale!==o&&(this.currentUiLocale=o,this.cache.clearAll(),this.notifyAll())}addContext(o){let r=o.name.toLowerCase();this.cache.setFinal(r,o),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(o,r){var n;if(o=o.toLowerCase(),Object.keys(r).length>0){let a={...(n=this.defaultMessages[o])!==null&&n!==void 0?n:{},...r};(0,Vt.deepEqual)(this.defaultMessages[o],a)||(this.defaultMessages[o]=a,await this.notify(o))}await this.fetchContext(o)}resolveContext(o){var r,n;return this.fetchContext(o),(n=(r=this.cache.getNow(o))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(o,r){let n=o.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(o,r,...n){var a;let i=o.toLowerCase(),l=this.resolveContext(i);return new Vt.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},l).resolve(r,...n)}async fetchContext(o){if(!this.cache.has(o))try{await this.cache.get(o,()=>this.messageContextProvider(this.currentUiLocale,o)),await this.notify(o)}catch(r){console.error(r)}}subscribe(o,r){var n;return o=o.toLowerCase(),this.listeners[o]=(n=this.listeners[o])!==null&&n!==void 0?n:new Set,this.listeners[o].add(r),()=>{var a;return(a=this.listeners[o])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(o=>this.notify(o)))}async notify(o){this.listeners[o]!=null&&await Promise.all([...this.listeners[o].values()].map(r=>(0,Vt.delay)(0).then(()=>r()).catch(()=>null)))}};Pi=fl;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ro{constructor(){super(async(e,o)=>(await this.awaitApi).getFluidTopicsMessageContext(e,o))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ro{constructor(){super(async(e,o)=>(await this.awaitApi).getCustomMessageContext(e,o))}});var fe=window.FluidTopicsI18nService,Ii=window.FluidTopicsCustomI18nService;var X=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},H=class extends xt.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>de.get(),this.messageContexts=[],this.cache=new xt.CacheRegistry,this.cleanSessionDebouncer=new xt.Debouncer}render(){return ki.html`
1129
1129
  <slot></slot>
1130
- `}update(o){var r,n,a,i,l;super.update(o),o.has("baseUrl")&&(L.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),o.has("apiIntegrationIdentifier")&&L.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),o.has("uiLocale")&&L.actions.uiLocale(this.uiLocale),o.has("metadataConfiguration")&&L.actions.metadataConfiguration(this.metadataConfiguration),o.has("noCustom")&&L.actions.noCustom(this.noCustom),o.has("editorMode")&&L.actions.editorMode(this.editorMode),o.has("noCustomComponent")&&L.actions.noCustomComponent(this.noCustomComponent),o.has("session")&&L.actions.session(this.session),o.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(d=>fe.addContext(d)),o.has("openExternalDocumentInNewTab")&&L.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),o.has("navigatorOnline")&&L.actions.navigatorOnline(this.navigatorOnline),o.has("forcedOffline")&&L.actions.forcedOffline(this.forcedOffline),o.has("localesConfiguration")&&(L.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),L.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),L.actions.searchInAllLanguagesAllowed((l=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let o=await this.apiProvider().getCurrentSession();return o.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},o.idleTimeoutInMillis),o})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};H.elementDefinitions={};H.styles=Li;X([(0,at.property)()],H.prototype,"baseUrl",void 0);X([(0,at.property)()],H.prototype,"apiIntegrationIdentifier",void 0);X([(0,at.property)()],H.prototype,"uiLocale",void 0);X([(0,xt.jsonProperty)(null)],H.prototype,"availableUiLocales",void 0);X([(0,xt.jsonProperty)(null)],H.prototype,"metadataConfiguration",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"editorMode",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"noCustom",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"openExternalDocumentInNewTab",void 0);X([(0,at.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],H.prototype,"noCustomComponent",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"withManualResources",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"navigatorOnline",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"forcedOffline",void 0);X([(0,at.property)({type:Object})],H.prototype,"apiProvider",void 0);X([(0,xt.jsonProperty)([])],H.prototype,"messageContexts",void 0);X([(0,xt.jsonProperty)(void 0)],H.prototype,"session",void 0);X([(0,at.state)()],H.prototype,"localesConfiguration",void 0);var Jl=S(V());function pl(e,o){if(e===o)return!0;if(e&&o&&typeof e=="object"&&typeof o=="object"){if(e.constructor!==o.constructor)return!1;var r,n,a;if(Array.isArray(e)){if(r=e.length,r!=o.length)return!1;for(n=r;n--!==0;)if(!Lo(e[n],o[n]))return!1;return!0}if(e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(n of e.entries())if(!o.has(n[0]))return!1;for(n of e.entries())if(!Lo(n[1],o.get(n[0])))return!1;return!0}if(e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(n of e.entries())if(!o.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===o.valueOf();if(a=Object.keys(e),r=a.length,r!==Object.keys(o).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,a[n]))return!1;for(n=r;n--!==0;){var i=a[n];if(!Lo(e[i],o[i]))return!1}return!0}return e!==e&&o!==o}function Lo(e,o){try{return pl(e,o)}catch{return!1}}function Po(e,o){return!Lo(e,o)}var ul=S(V(),1);var Io=class{constructor(){this.queue=[]}add(o,r=!1){r&&(this.queue=this.queue.filter(n=>n.type!==o.type)),this.queue.push(o)}consume(o){let r=this.queue.find(n=>n.type===o);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}};var Je=S(V(),1);var Ti=S(V(),1);function $i(e,o){let r=()=>JSON.parse(JSON.stringify(e));return(0,Ti.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Po,...o??{}})}var ko=class{constructor(o=0){this.timeout=o,this.callbacks=[]}run(o,r){return this.callbacks=[o],this.debounce(r)}queue(o,r){return this.callbacks.push(o),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(o){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),o??this.timeout),this.promise}async runCallbacks(){var o,r;let n=[...this.callbacks];this.callbacks=[];let a=(o=this.rejectPromise)!==null&&o!==void 0?o:()=>null,i=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(d){a(d);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var _i=S(D(),1);var To=window,yl=To.ShadowRoot&&(To.ShadyCSS===void 0||To.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fh=Symbol();var Bi=(e,o)=>{yl?e.adoptedStyleSheets=o.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):o.forEach(r=>{let n=document.createElement("style"),a=To.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=r.cssText,e.appendChild(n)})};var $o=class extends _i.LitElement{createRenderRoot(){let o=this.constructor;o.elementDefinitions&&!o.registry&&(o.registry=new CustomElementRegistry,Object.entries(o.elementDefinitions).forEach(([a,i])=>o.registry.define(a,i)));let r={...o.shadowRootOptions,customElements:o.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Bi(n,o.elementStyles),n}};var Bo=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},Mi,Wi=Symbol("constructorPrototype"),Di=Symbol("constructorName"),Ui=Symbol("exportpartsDebouncer"),zi=Symbol("dynamicDependenciesLoaded"),Yt=class extends $o{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Mi]=new ko(5),this[Di]=this.constructor.name,this[Wi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Di]&&Object.setPrototypeOf(this,this[Wi])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let o=this.constructor;o[zi]||(o[zi]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(o){super.updated(o),this.updateComplete.then(()=>{this.contentAvailableCallback(o),this.applyCustomStylesheet(o),this.scheduleExportpartsUpdate()})}contentAvailableCallback(o){}applyCustomStylesheet(o){var r,n,a;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(o.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var o,r,n;(!((o=this.exportpartsPrefix)===null||o===void 0)&&o.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Ui].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(o){var r,n,a,i,l,d;let p=m=>m!=null&&m.trim().length>0,f=o.filter(p).map(m=>m.trim());if(f.length===0){this.removeAttribute("exportparts");return}let y=new Set;for(let m of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let b=(i=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],g=(d=(l=m.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(v=>v.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...b,...g).filter(p).map(v=>v.trim()).forEach(v=>y.add(v))}if(y.size===0){this.removeAttribute("exportparts");return}let h=[...y.values()].flatMap(m=>f.map(b=>`${m}:${b}--${m}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};Mi=Ui;Bo([(0,Je.property)()],Yt.prototype,"exportpartsPrefix",void 0);Bo([$i([])],Yt.prototype,"exportpartsPrefixes",void 0);Bo([(0,Je.property)()],Yt.prototype,"customStylesheet",void 0);Bo([(0,Je.state)()],Yt.prototype,"useAdoptedStyleSheets",void 0);function Qe(e){var o;return(o=e?.isFtReduxStore)!==null&&o!==void 0?o:!1}var Hi,Gi,Fi,to=Symbol("internalReduxEventsUnsubscribers"),qt=Symbol("internalStoresUnsubscribers"),pe=Symbol("internalStores"),eo=class extends Yt{constructor(){super(...arguments),this[Hi]=new Map,this[Gi]=new Map,this[Fi]=new Map}get reduxConstructor(){return this.constructor}update(o){super.update(o),[...this.reduxConstructor.reduxReactiveProperties].some(r=>o.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[pe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pe].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[pe].get(o)}addStore(o,r){var n;r=(n=r??(Qe(o)?o.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[pe].set(r,o),this.subscribeToStore(r,o),this.updateFromStores()}removeStore(o){let r=typeof o=="string"?o:o.name;this.unsubscribeFromStore(r),this[pe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[pe].forEach((o,r)=>this.subscribeToStore(r,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let a=this.getStore(o.store);a&&(o.store?this[qt].has(o.store):this[qt].size>0)&&(this[r]=o.selector(a.getState(),this))}})}subscribeToStore(o,r){var n;this[qt].set(o,r.subscribe(()=>this.updateFromStores())),this[to].set(o,[]),Qe(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((a,i)=>{if(typeof this[i]=="function"&&(!a.store||r.name===a.store)){let l=d=>this[i](d);r.addEventListener(a.eventName,l),this[to].get(o).push(()=>r.removeEventListener(a.eventName,l))}})),this.onStoreAvailable(o)}unsubscribeFromStores(){this[qt].forEach((o,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(o){var r;this[qt].has(o)&&this[qt].get(o)(),this[qt].delete(o),(r=this[to].get(o))===null||r===void 0||r.forEach(n=>n()),this[to].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Hi=qt,Gi=pe,Fi=to;eo.reduxProperties=new Map;eo.reduxReactiveProperties=new Set;eo.reduxEventListeners=new Map;function mt(e){for(var o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Wt(e){return!!e&&!!e[W]}function vt(e){var o;return!!e&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Ol}(e)||Array.isArray(e)||!!e[Xi]||!!(!((o=e.constructor)===null||o===void 0)&&o[Xi])||Wr(e)||Dr(e))}function ue(e,o,r){r===void 0&&(r=!1),ke(e)===0?(r?Object.keys:Ie)(e).forEach(function(n){r&&typeof n=="symbol"||o(n,e[n],e)}):e.forEach(function(n,a){return o(a,n,e)})}function ke(e){var o=e[W];return o?o.i>3?o.i-4:o.i:Array.isArray(e)?1:Wr(e)?2:Dr(e)?3:0}function Pe(e,o){return ke(e)===2?e.has(o):Object.prototype.hasOwnProperty.call(e,o)}function hl(e,o){return ke(e)===2?e.get(o):e[o]}function Ji(e,o,r){var n=ke(e);n===2?e.set(o,r):n===3?e.add(r):e[o]=r}function Qi(e,o){return e===o?e!==0||1/e==1/o:e!=e&&o!=o}function Wr(e){return vl&&e instanceof Map}function Dr(e){return Sl&&e instanceof Set}function Xt(e){return e.o||e.t}function zr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var o=oc(e);delete o[W];for(var r=Ie(o),n=0;n<r.length;n++){var a=r[n],i=o[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),o)}function Mr(e,o){return o===void 0&&(o=!1),Ur(e)||Wt(e)||!vt(e)||(ke(e)>1&&(e.set=e.add=e.clear=e.delete=ml),Object.freeze(e),o&&ue(e,function(r,n){return Mr(n,!0)},!0)),e}function ml(){mt(2)}function Ur(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function At(e){var o=_r[e];return o||mt(18,e),o}function gl(e,o){_r[e]||(_r[e]=o)}function Tr(){return ro}function Lr(e,o){o&&(At("Patches"),e.u=[],e.s=[],e.v=o)}function _o(e){$r(e),e.p.forEach(bl),e.p=null}function $r(e){e===ro&&(ro=e.l)}function ji(e){return ro={p:[],l:ro,h:e,m:!0,_:0}}function bl(e){var o=e[W];o.i===0||o.i===1?o.j():o.g=!0}function Pr(e,o){o._=o.p.length;var r=o.p[0],n=e!==void 0&&e!==r;return o.h.O||At("ES5").S(o,e,n),n?(r[W].P&&(_o(o),mt(4)),vt(e)&&(e=Wo(o,e),o.l||Do(o,e)),o.u&&At("Patches").M(r[W].t,e,o.u,o.s)):e=Wo(o,r,[]),_o(o),o.u&&o.v(o.u,o.s),e!==ec?e:void 0}function Wo(e,o,r){if(Ur(o))return o;var n=o[W];if(!n)return ue(o,function(d,p){return Ki(e,n,o,d,p,r)},!0),o;if(n.A!==e)return o;if(!n.P)return Do(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=zr(n.k):n.o,i=a,l=!1;n.i===3&&(i=new Set(a),a.clear(),l=!0),ue(i,function(d,p){return Ki(e,n,a,d,p,r,l)}),Do(e,a,!1),r&&e.u&&At("Patches").N(n,r,e.u,e.s)}return n.o}function Ki(e,o,r,n,a,i,l){if(Wt(a)){var d=Wo(e,a,i&&o&&o.i!==3&&!Pe(o.R,n)?i.concat(n):void 0);if(Ji(r,n,d),!Wt(d))return;e.m=!1}else l&&r.add(a);if(vt(a)&&!Ur(a)){if(!e.h.D&&e._<1)return;Wo(e,a),o&&o.A.l||Do(e,a)}}function Do(e,o,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Mr(o,r)}function Ir(e,o){var r=e[W];return(r?Xt(r):e)[o]}function Zi(e,o){if(o in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,o);if(n)return n;r=Object.getPrototypeOf(r)}}function Jt(e){e.P||(e.P=!0,e.l&&Jt(e.l))}function kr(e){e.o||(e.o=zr(e.t))}function Br(e,o,r){var n=Wr(o)?At("MapSet").F(o,r):Dr(o)?At("MapSet").T(o,r):e.O?function(a,i){var l=Array.isArray(a),d={i:l?1:0,A:i?i.A:Tr(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=d,f=no;l&&(p=[d],f=oo);var y=Proxy.revocable(p,f),h=y.revoke,m=y.proxy;return d.k=m,d.j=h,m}(o,r):At("ES5").J(o,r);return(r?r.A:Tr()).p.push(n),n}function xl(e){return Wt(e)||mt(22,e),function o(r){if(!vt(r))return r;var n,a=r[W],i=ke(r);if(a){if(!a.P&&(a.i<4||!At("ES5").K(a)))return a.t;a.I=!0,n=Vi(r,i),a.I=!1}else n=Vi(r,i);return ue(n,function(l,d){a&&hl(a.t,l)===d||Ji(n,l,o(d))}),i===3?new Set(n):n}(e)}function Vi(e,o){switch(o){case 2:return new Map(e);case 3:return Array.from(e)}return zr(e)}function tc(){function e(l,d){var p=i[l];return p?p.enumerable=d:i[l]=p={configurable:!0,enumerable:d,get:function(){var f=this[W];return no.get(f,l)},set:function(f){var y=this[W];no.set(y,l,f)}},p}function o(l){for(var d=l.length-1;d>=0;d--){var p=l[d][W];if(!p.P)switch(p.i){case 5:n(p)&&Jt(p);break;case 4:r(p)&&Jt(p)}}}function r(l){for(var d=l.t,p=l.k,f=Ie(p),y=f.length-1;y>=0;y--){var h=f[y];if(h!==W){var m=d[h];if(m===void 0&&!Pe(d,h))return!0;var b=p[h],g=b&&b[W];if(g?g.t!==m:!Qi(b,m))return!0}}var v=!!d[W];return f.length!==Ie(d).length+(v?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var f=0;f<d.length;f++)if(!d.hasOwnProperty(f))return!0;return!1}function a(l){l.g&&mt(3,JSON.stringify(Xt(l)))}var i={};gl("ES5",{J:function(l,d){var p=Array.isArray(l),f=function(h,m){if(h){for(var b=Array(m.length),g=0;g<m.length;g++)Object.defineProperty(b,""+g,e(g,!0));return b}var v=oc(m);delete v[W];for(var R=Ie(v),E=0;E<R.length;E++){var N=R[E];v[N]=e(N,h||!!v[N].enumerable)}return Object.create(Object.getPrototypeOf(m),v)}(p,l),y={i:p?5:4,A:d?d.A:Tr(),P:!1,I:!1,R:{},l:d,t:l,k:f,o:null,g:!1,C:!1};return Object.defineProperty(f,W,{value:y,writable:!0}),f},S:function(l,d,p){p?Wt(d)&&d[W].A===l&&o(l.p):(l.u&&function f(y){if(y&&typeof y=="object"){var h=y[W];if(h){var m=h.t,b=h.k,g=h.R,v=h.i;if(v===4)ue(b,function(T){T!==W&&(m[T]!==void 0||Pe(m,T)?g[T]||f(b[T]):(g[T]=!0,Jt(h)))}),ue(m,function(T){b[T]!==void 0||Pe(b,T)||(g[T]=!1,Jt(h))});else if(v===5){if(n(h)&&(Jt(h),g.length=!0),b.length<m.length)for(var R=b.length;R<m.length;R++)g[R]=!1;else for(var E=m.length;E<b.length;E++)g[E]=!0;for(var N=Math.min(b.length,m.length),P=0;P<N;P++)b.hasOwnProperty(P)||(g[P]=!0),g[P]===void 0&&f(b[P])}}}}(l.p[0]),o(l.p))},K:function(l){return l.i===4?r(l):n(l)}})}var Yi,ro,Hr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",vl=typeof Map<"u",Sl=typeof Set<"u",qi=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ec=Hr?Symbol.for("immer-nothing"):((Yi={})["immer-nothing"]=!0,Yi),Xi=Hr?Symbol.for("immer-draftable"):"__$immer_draftable",W=Hr?Symbol.for("immer-state"):"__$immer_state";var Ol=""+Object.prototype.constructor,Ie=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,oc=Object.getOwnPropertyDescriptors||function(e){var o={};return Ie(e).forEach(function(r){o[r]=Object.getOwnPropertyDescriptor(e,r)}),o},_r={},no={get:function(e,o){if(o===W)return e;var r=Xt(e);if(!Pe(r,o))return function(a,i,l){var d,p=Zi(i,l);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(e,r,o);var n=r[o];return e.I||!vt(n)?n:n===Ir(e.t,o)?(kr(e),e.o[o]=Br(e.A.h,n,e)):n},has:function(e,o){return o in Xt(e)},ownKeys:function(e){return Reflect.ownKeys(Xt(e))},set:function(e,o,r){var n=Zi(Xt(e),o);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var a=Ir(Xt(e),o),i=a?.[W];if(i&&i.t===r)return e.o[o]=r,e.R[o]=!1,!0;if(Qi(r,a)&&(r!==void 0||Pe(e.t,o)))return!0;kr(e),Jt(e)}return e.o[o]===r&&(r!==void 0||o in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[o])||(e.o[o]=r,e.R[o]=!0),!0},deleteProperty:function(e,o){return Ir(e.t,o)!==void 0||o in e.t?(e.R[o]=!1,kr(e),Jt(e)):delete e.R[o],e.o&&delete e.o[o],!0},getOwnPropertyDescriptor:function(e,o){var r=Xt(e),n=Reflect.getOwnPropertyDescriptor(r,o);return n&&{writable:!0,configurable:e.i!==1||o!=="length",enumerable:n.enumerable,value:r[o]}},defineProperty:function(){mt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){mt(12)}},oo={};ue(no,function(e,o){oo[e]=function(){return arguments[0]=arguments[0][0],o.apply(this,arguments)}}),oo.deleteProperty=function(e,o){return oo.set.call(this,e,o,void 0)},oo.set=function(e,o,r){return no.set.call(this,e[0],o,r,e[0])};var Cl=function(){function e(r){var n=this;this.O=qi,this.D=!0,this.produce=function(a,i,l){if(typeof a=="function"&&typeof i!="function"){var d=i;i=a;var p=n;return function(v){var R=this;v===void 0&&(v=d);for(var E=arguments.length,N=Array(E>1?E-1:0),P=1;P<E;P++)N[P-1]=arguments[P];return p.produce(v,function(T){var $;return($=i).call.apply($,[R,T].concat(N))})}}var f;if(typeof i!="function"&&mt(6),l!==void 0&&typeof l!="function"&&mt(7),vt(a)){var y=ji(n),h=Br(n,a,void 0),m=!0;try{f=i(h),m=!1}finally{m?_o(y):$r(y)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(v){return Lr(y,l),Pr(v,y)},function(v){throw _o(y),v}):(Lr(y,l),Pr(f,y))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===ec&&(f=void 0),n.D&&Mr(f,!0),l){var b=[],g=[];At("Patches").M(a,f,b,g),l(b,g)}return f}mt(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var y=arguments.length,h=Array(y>1?y-1:0),m=1;m<y;m++)h[m-1]=arguments[m];return n.produceWithPatches(f,function(b){return a.apply(void 0,[b].concat(h))})};var l,d,p=n.produce(a,i,function(f,y){l=f,d=y});return typeof Promise<"u"&&p instanceof Promise?p.then(function(f){return[f,l,d]}):[p,l,d]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var o=e.prototype;return o.createDraft=function(r){vt(r)||mt(8),Wt(r)&&(r=xl(r));var n=ji(this),a=Br(this,r,void 0);return a[W].C=!0,$r(n),a},o.finishDraft=function(r,n){var a=r&&r[W],i=a.A;return Lr(i,n),Pr(void 0,i)},o.setAutoFreeze=function(r){this.D=r},o.setUseProxies=function(r){r&&!qi&&mt(20),this.O=r},o.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}a>-1&&(n=n.slice(a+1));var l=At("Patches").$;return Wt(r)?l(r,n):this.produce(r,function(d){return l(d,n)})},e}(),ft=new Cl,wl=ft.produce,om=ft.produceWithPatches.bind(ft),rm=ft.setAutoFreeze.bind(ft),nm=ft.setUseProxies.bind(ft),am=ft.applyPatches.bind(ft),im=ft.createDraft.bind(ft),cm=ft.finishDraft.bind(ft),zo=wl;function Qt(e){"@babel/helpers - typeof";return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Qt(e)}function Gr(e,o){if(Qt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,o||"default");if(Qt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function Fr(e){var o=Gr(e,"string");return Qt(o)==="symbol"?o:String(o)}function jr(e,o,r){return o=Fr(o),o in e?Object.defineProperty(e,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[o]=r,e}function rc(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Mo(e){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?rc(Object(r),!0).forEach(function(n){jr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var nc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Kr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Uo={INIT:"@@redux/INIT"+Kr(),REPLACE:"@@redux/REPLACE"+Kr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Kr()}};function El(e){if(typeof e!="object"||e===null)return!1;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(e)===o}function Zr(e,o,r){var n;if(typeof o=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(J(0));if(typeof o=="function"&&typeof r>"u"&&(r=o,o=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(J(1));return r(Zr)(e,o)}if(typeof e!="function")throw new Error(J(2));var a=e,i=o,l=[],d=l,p=!1;function f(){d===l&&(d=l.slice())}function y(){if(p)throw new Error(J(3));return i}function h(v){if(typeof v!="function")throw new Error(J(4));if(p)throw new Error(J(5));var R=!0;return f(),d.push(v),function(){if(R){if(p)throw new Error(J(6));R=!1,f();var N=d.indexOf(v);d.splice(N,1),l=null}}}function m(v){if(!El(v))throw new Error(J(7));if(typeof v.type>"u")throw new Error(J(8));if(p)throw new Error(J(9));try{p=!0,i=a(i,v)}finally{p=!1}for(var R=l=d,E=0;E<R.length;E++){var N=R[E];N()}return v}function b(v){if(typeof v!="function")throw new Error(J(10));a=v,m({type:Uo.REPLACE})}function g(){var v,R=h;return v={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(J(11));function P(){N.next&&N.next(y())}P();var T=R(P);return{unsubscribe:T}}},v[nc]=function(){return this},v}return m({type:Uo.INIT}),n={dispatch:m,subscribe:h,getState:y,replaceReducer:b},n[nc]=g,n}function Nl(e){Object.keys(e).forEach(function(o){var r=e[o],n=r(void 0,{type:Uo.INIT});if(typeof n>"u")throw new Error(J(12));if(typeof r(void 0,{type:Uo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(J(13))})}function ac(e){for(var o=Object.keys(e),r={},n=0;n<o.length;n++){var a=o[n];typeof e[a]=="function"&&(r[a]=e[a])}var i=Object.keys(r),l,d;try{Nl(r)}catch(p){d=p}return function(f,y){if(f===void 0&&(f={}),d)throw d;if(0)var h;for(var m=!1,b={},g=0;g<i.length;g++){var v=i[g],R=r[v],E=f[v],N=R(E,y);if(typeof N>"u"){var P=y&&y.type;throw new Error(J(14))}b[v]=N,m=m||N!==E}return m=m||i.length!==Object.keys(f).length,m?b:f}}function Te(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return o.length===0?function(n){return n}:o.length===1?o[0]:o.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function ic(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(J(15))},l={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},d=o.map(function(p){return p(l)});return i=Te.apply(void 0,d)(a.dispatch),Mo(Mo({},a),{},{dispatch:i})}}}function cc(e){var o=function(n){var a=n.dispatch,i=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,i,e):l(d)}}};return o}var lc=cc();lc.withExtraArgument=cc;var Vr=lc;var uc=function(){var e=function(o,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(o,r);function n(){this.constructor=o}o.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Al=function(e,o){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(f){return function(y){return p([f,y])}}function p(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,a=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=o.call(e,r)}catch(y){f=[6,y],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},$e=function(e,o){for(var r=0,n=o.length,a=e.length;r<n;r++,a++)e[a]=o[r];return e},Rl=Object.defineProperty,Ll=Object.defineProperties,Pl=Object.getOwnPropertyDescriptors,sc=Object.getOwnPropertySymbols,Il=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,dc=function(e,o,r){return o in e?Rl(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r},te=function(e,o){for(var r in o||(o={}))Il.call(o,r)&&dc(e,r,o[r]);if(sc)for(var n=0,a=sc(o);n<a.length;n++){var r=a[n];kl.call(o,r)&&dc(e,r,o[r])}return e},Yr=function(e,o){return Ll(e,Pl(o))},Tl=function(e,o,r){return new Promise(function(n,a){var i=function(p){try{d(r.next(p))}catch(f){a(f)}},l=function(p){try{d(r.throw(p))}catch(f){a(f)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,l)};d((r=r.apply(e,o)).next())})};var $l=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Te:Te.apply(null,arguments)},Em=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Bl(e){if(typeof e!="object"||e===null)return!1;var o=Object.getPrototypeOf(e);if(o===null)return!0;for(var r=o;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return o===r}var _l=function(e){uc(o,e);function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=e.apply(this,r)||this;return Object.setPrototypeOf(a,o.prototype),a}return Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},o.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(o.bind.apply(o,$e([void 0],r[0].concat(this)))):new(o.bind.apply(o,$e([void 0],r.concat(this))))},o}(Array),Wl=function(e){uc(o,e);function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=e.apply(this,r)||this;return Object.setPrototypeOf(a,o.prototype),a}return Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},o.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(o.bind.apply(o,$e([void 0],r[0].concat(this)))):new(o.bind.apply(o,$e([void 0],r.concat(this))))},o}(Array);function Jr(e){return vt(e)?zo(e,function(){}):e}function Dl(e){return typeof e=="boolean"}function zl(){return function(o){return Ml(o)}}function Ml(e){e===void 0&&(e={});var o=e.thunk,r=o===void 0?!0:o,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,d=new _l;if(r&&(Dl(r)?d.push(Vr):d.push(Vr.withExtraArgument(r.extraArgument))),0){if(a)var p;if(l)var f}return d}var qr=!0;function yc(e){var o=zl(),r=e||{},n=r.reducer,a=n===void 0?void 0:n,i=r.middleware,l=i===void 0?o():i,d=r.devTools,p=d===void 0?!0:d,f=r.preloadedState,y=f===void 0?void 0:f,h=r.enhancers,m=h===void 0?void 0:h,b;if(typeof a=="function")b=a;else if(Bl(a))b=ac(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=l;if(typeof g=="function"&&(g=g(o),!qr&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!qr&&g.some(function(T){return typeof T!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=ic.apply(void 0,g),R=Te;p&&(R=$l(te({trace:!qr},typeof p=="object"&&p)));var E=new Wl(v),N=E;Array.isArray(m)?N=$e([v],m):typeof m=="function"&&(N=m(E));var P=R.apply(void 0,N);return Zr(b,y,P)}function ee(e,o){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(o){var i=o.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return te(te({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function hc(e){var o={},r=[],n,a={addCase:function(i,l){var d=typeof i=="string"?i:i.type;if(d in o)throw new Error("addCase cannot be called with two reducers for the same action type");return o[d]=l,a},addMatcher:function(i,l){return r.push({matcher:i,reducer:l}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[o,r,n]}function Ul(e){return typeof e=="function"}function Hl(e,o,r,n){r===void 0&&(r=[]);var a=typeof o=="function"?hc(o):[o,r,n],i=a[0],l=a[1],d=a[2],p;if(Ul(e))p=function(){return Jr(e())};else{var f=Jr(e);p=function(){return f}}function y(h,m){h===void 0&&(h=p());var b=$e([i[m.type]],l.filter(function(g){var v=g.matcher;return v(m)}).map(function(g){var v=g.reducer;return v}));return b.filter(function(g){return!!g}).length===0&&(b=[d]),b.reduce(function(g,v){if(v)if(Wt(g)){var R=g,E=v(R,m);return E===void 0?g:E}else{if(vt(g))return zo(g,function(N){return v(N,m)});var E=v(g,m);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return g},h)}return y.getInitialState=p,y}function Gl(e,o){return e+"/"+o}function mc(e){var o=e.name;if(!o)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof e.initialState=="function"?e.initialState:Jr(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},l={},d={};a.forEach(function(y){var h=n[y],m=Gl(o,y),b,g;"reducer"in h?(b=h.reducer,g=h.prepare):b=h,i[y]=b,l[m]=b,d[y]=g?ee(m,g):ee(m)});function p(){var y=typeof e.extraReducers=="function"?hc(e.extraReducers):[e.extraReducers],h=y[0],m=h===void 0?{}:h,b=y[1],g=b===void 0?[]:b,v=y[2],R=v===void 0?void 0:v,E=te(te({},m),l);return Hl(r,function(N){for(var P in E)N.addCase(P,E[P]);for(var T=0,$=g;T<$.length;T++){var pt=$[T];N.addMatcher(pt.matcher,pt.reducer)}R&&N.addDefaultCase(R)})}var f;return{name:o,reducer:function(y,h){return f||(f=p()),f(y,h)},actions:d,caseReducers:i,getInitialState:function(){return f||(f=p()),f.getInitialState()}}}var Fl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",jl=function(e){e===void 0&&(e=21);for(var o="",r=e;r--;)o+=Fl[Math.random()*64|0];return o},Kl=["name","message","stack","code"],Xr=function(){function e(o,r){this.payload=o,this.meta=r}return e}(),fc=function(){function e(o,r){this.payload=o,this.meta=r}return e}(),Zl=function(e){if(typeof e=="object"&&e!==null){for(var o={},r=0,n=Kl;r<n.length;r++){var a=n[r];typeof e[a]=="string"&&(o[a]=e[a])}return o}return{message:String(e)}},Lm=function(){function e(o,r,n){var a=ee(o+"/fulfilled",function(y,h,m,b){return{payload:y,meta:Yr(te({},b||{}),{arg:m,requestId:h,requestStatus:"fulfilled"})}}),i=ee(o+"/pending",function(y,h,m){return{payload:void 0,meta:Yr(te({},m||{}),{arg:h,requestId:y,requestStatus:"pending"})}}),l=ee(o+"/rejected",function(y,h,m,b,g){return{payload:b,error:(n&&n.serializeError||Zl)(y||"Rejected"),meta:Yr(te({},g||{}),{arg:m,requestId:h,rejectedWithValue:!!b,requestStatus:"rejected",aborted:y?.name==="AbortError",condition:y?.name==="ConditionError"})}}),d=!1,p=typeof AbortController<"u"?AbortController:function(){function y(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return y.prototype.abort=function(){},y}();function f(y){return function(h,m,b){var g=n?.idGenerator?n.idGenerator(y):jl(),v=new p,R,E=!1;function N(T){R=T,v.abort()}var P=function(){return Tl(this,null,function(){var T,$,pt,zt,or,Mt,it;return Al(this,function(ut){switch(ut.label){case 0:return ut.trys.push([0,4,,5]),zt=(T=n?.condition)==null?void 0:T.call(n,y,{getState:m,extra:b}),Yl(zt)?[4,zt]:[3,2];case 1:zt=ut.sent(),ut.label=2;case 2:if(zt===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,or=new Promise(function(ct,oe){return v.signal.addEventListener("abort",function(){return oe({name:"AbortError",message:R||"Aborted"})})}),h(i(g,y,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:g,arg:y},{getState:m,extra:b}))),[4,Promise.race([or,Promise.resolve(r(y,{dispatch:h,getState:m,extra:b,requestId:g,signal:v.signal,abort:N,rejectWithValue:function(ct,oe){return new Xr(ct,oe)},fulfillWithValue:function(ct,oe){return new fc(ct,oe)}})).then(function(ct){if(ct instanceof Xr)throw ct;return ct instanceof fc?a(ct.payload,g,y,ct.meta):a(ct,g,y)})])];case 3:return pt=ut.sent(),[3,5];case 4:return Mt=ut.sent(),pt=Mt instanceof Xr?l(null,g,y,Mt.payload,Mt.meta):l(Mt,g,y),[3,5];case 5:return it=n&&!n.dispatchConditionRejection&&l.match(pt)&&pt.meta.condition,it||h(pt),[2,pt]}})})}();return Object.assign(P,{abort:N,requestId:g,arg:y,unwrap:function(){return P.then(Vl)}})}}return Object.assign(f,{pending:i,rejected:l,fulfilled:a,typePrefix:o})}return e.withTypes=function(){return e},e}();function Vl(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Yl(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gc="listener",bc="completed",xc="cancelled",Pm="task-"+xc,Im="task-"+bc,km=gc+"-"+xc,Tm=gc+"-"+bc;var Qr="listenerMiddleware";var $m=ee(Qr+"/add"),Bm=ee(Qr+"/removeAll"),_m=ee(Qr+"/remove");var pc,Wm=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(pc||(pc=Promise.resolve())).then(e).catch(function(o){return setTimeout(function(){throw o},0)})},ql=function(e){return function(o){setTimeout(o,e)}},Dm=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ql(10);tc();function Xl(e,o){return class extends e{constructor(){super(...arguments),this.eventBus=o??document.createElement("span")}addEventListener(r,n,a){this.eventBus.addEventListener(r,n,a)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,a){this.eventBus.removeEventListener(r,n,a)}}}var Ho=class extends Xl(Object){};window.ftReduxStores||(window.ftReduxStores={});var vc=class e extends Ho{static get(o){var r;let n=typeof o=="string"?o:o.name,a=typeof o=="string"?void 0:o,i=window.ftReduxStores[n];if(Qe(i))return i;if(a==null)return;let l=mc({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),d=yc({reducer:(p,f)=>f.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...f.overwrites}:l.reducer(p,f)});return window.ftReduxStores[a.name]=new e(l,d)}constructor(o,r){super(),this.reduxSlice=o,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Io;let n=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,i,l)=>{let d=i,p=a[d];return p?(...f)=>{let y=p(...f.map(n));return this.reduxStore.dispatch(y),y}:f=>{this.setState({[d]:n(f)})}}})}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(o){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(o).join("_"),overwrites:o})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(o){throw new Error("Not implemented yet.")}subscribe(o){return this.reduxStore.subscribe(o)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Ko=S(k());var Go=class extends Zt{async listMySearches(){let o=L.getState().session;return o?.sessionAuthenticated?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(o.profile.userId),5*60*1e3):[]}};var Fo=class extends Zt{async listMyBookmarks(){let o=L.getState().session;return o?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(o.profile.userId),5*60*1e3):[]}};var Ql="ft-user-assets",jo=Ko.FtReduxStore.get({name:Ql,initialState:{savedSearches:void 0,bookmarks:void 0}}),tn=class{constructor(){this.currentSession=L.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Fo,this.savedSearchesService=new Go,L.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var o;let{session:r}=L.getState();(0,Ko.deepEqual)((o=this.currentSession)===null||o===void 0?void 0:o.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),jo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),jo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let o=await this.savedSearchesService.listMySearches();jo.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var o;if(this.bookmarksAreUsed){let r=!((o=this.currentSession)===null||o===void 0)&&o.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;jo.actions.bookmarks(r)}}},xg=new tn;var en=class{addCommand(o,r=!1){L.commands.add(o,r)}consumeCommand(o){return L.commands.consume(o)}};window.FluidTopicsAppInfoStoreService=new en;var Sc=S(k()),on=class{highlightHtml(o,r,n){(0,Sc.highlightHtml)(o,r,n)}};window.FluidTopicsHighlightHtmlService=new on;var Oc=S(k());var rn=class{isDate(o){var r,n,a,i;return(i=(a=((n=(r=L.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(o,r){var n,a,i;return Oc.DateFormatter.format(o,(n=r?.locale)!==null&&n!==void 0?n:L.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new rn;var ts=S(k());(0,Cc.customElement)("ft-app-context")(H);var Ec=S(V()),es=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},nn=Symbol("i18nAttributes"),an=Symbol("i18nListAttributes"),Zo=Symbol("i18nProperties"),cn=Symbol("i18nManualContexts"),ao=Symbol("i18nUnsubs");function qo(e){var o,r;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map,this[r]=new Map}get i18nService(){return this.useCustomMessageContexts?Ii:fe}i18n(i,l,...d){var p;if(typeof i=="string")return this.i18nService.resolveMessage(i,l,...d);let f=(p=i.args)!==null&&p!==void 0?p:i.argsProvider?i.argsProvider(this):[];return this.i18nService.resolveMessage(i.context,i.key,...f)}onI18nUpdate(i){var l,d,p;(l=this[nn])===null||l===void 0||l.forEach((f,y)=>{let h=this.getI18nAttributeValue(y);h&&(this[y]=this.getI18nAttributeMessage(h,f,i))}),(d=this[an])===null||d===void 0||d.forEach((f,y)=>{let h=this.getI18nListAttributeValues(y);this[y]=h?.map(m=>this.getI18nAttributeMessage(m,f,i))}),(p=this[Zo])===null||p===void 0||p.forEach((f,y)=>{f.context.toLowerCase()===i.toLowerCase()&&(this[y]=this.i18n(f))}),setTimeout(()=>this.requestUpdate(),0)}buildI18nAttributeMessage(i,l){return{...i,message:this.i18n({context:i.context,key:i.key,...l})}}getI18nAttributeMessage(i,l,d){var p;let f=!d||((p=i.context)===null||p===void 0?void 0:p.toLowerCase())===d.toLowerCase();return i.context&&i.key&&f?this.buildI18nAttributeMessage(i,l):i}update(i){var l,d,p;super.update(i),(l=this[nn])===null||l===void 0||l.forEach((f,y)=>{let h=this.getI18nAttributeValue(y);h?.context&&h.key&&(i.has(y)||f.argsProvider!=null)&&(this.addI18nContextIfNeeded(h,i,y),this[y]=this.getI18nAttributeMessage(h,f))}),(d=this[an])===null||d===void 0||d.forEach((f,y)=>{let h=this.getI18nListAttributeValues(y);(i.has(y)||f.argsProvider!=null)&&(this[y]=h?.map(m=>(this.addI18nContextIfNeeded(m,i,y),this.getI18nAttributeMessage(m,f))))}),(p=this[Zo])===null||p===void 0||p.forEach((f,y)=>{f.argsProvider!=null&&(this[y]=this.i18n(f))})}getI18nAttributeValue(i){return this[i]}getI18nListAttributeValues(i){return this[i]}addI18nContextIfNeeded(i,l,d){i.context&&i.key&&l.has(d)&&this.addI18nContext(i.context)}addI18nMessagesAndSubscribe(i,l){i=i.toLowerCase(),this[ao].has(i)||this[ao].set(i,this.i18nService.subscribe(i,()=>this.onI18nUpdate(i))),this.i18nService.prepareContext(i,l??{}),this.onI18nUpdate(i)}connectedCallback(){var i,l,d,p,f,y;super.connectedCallback(),new Set([...(l=(i=this[Zo])===null||i===void 0?void 0:i.values())!==null&&l!==void 0?l:[],...[...(p=(d=this[nn])===null||d===void 0?void 0:d.keys())!==null&&p!==void 0?p:[]].map(h=>this.getI18nAttributeValue(h)),...[...(y=(f=this[an])===null||f===void 0?void 0:f.keys())!==null&&y!==void 0?y:[]].flatMap(h=>this.getI18nListAttributeValues(h))].map(h=>h?.context)).forEach(h=>h&&this.addI18nMessages(h)),this[cn].forEach((h,m)=>{this.addI18nMessages(m,h)})}addI18nMessages(i,l){this[cn].set(i,l??{}),this.addI18nMessagesAndSubscribe(i,l)}addI18nContext(i,l){this.addI18nMessages(typeof i=="string"?i:i.name,l)}disconnectedCallback(){super.disconnectedCallback(),this[ao].forEach(i=>i()),this[ao].clear()}}return o=cn,r=ao,es([(0,Ec.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var wc=class extends qo(Yo.FtLitElement){},Vo=class extends qo(Yo.FtLitElementRedux){};var io=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},St=class extends Vo{constructor(){super(),this.editorMode=!1,this.addStore(L)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Xo.nothing:Xo.html`
1130
+ `}update(o){var r,n,a,i,l;super.update(o),o.has("baseUrl")&&(L.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),o.has("apiIntegrationIdentifier")&&L.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),o.has("uiLocale")&&L.actions.uiLocale(this.uiLocale),o.has("metadataConfiguration")&&L.actions.metadataConfiguration(this.metadataConfiguration),o.has("noCustom")&&L.actions.noCustom(this.noCustom),o.has("editorMode")&&L.actions.editorMode(this.editorMode),o.has("noCustomComponent")&&L.actions.noCustomComponent(this.noCustomComponent),o.has("session")&&L.actions.session(this.session),o.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(d=>fe.addContext(d)),o.has("openExternalDocumentInNewTab")&&L.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),o.has("navigatorOnline")&&L.actions.navigatorOnline(this.navigatorOnline),o.has("forcedOffline")&&L.actions.forcedOffline(this.forcedOffline),o.has("localesConfiguration")&&(L.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),L.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),L.actions.searchInAllLanguagesAllowed((l=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let o=await this.apiProvider().getCurrentSession();return o.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},o.idleTimeoutInMillis),o})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};H.elementDefinitions={};H.styles=Li;X([(0,at.property)()],H.prototype,"baseUrl",void 0);X([(0,at.property)()],H.prototype,"apiIntegrationIdentifier",void 0);X([(0,at.property)()],H.prototype,"uiLocale",void 0);X([(0,xt.jsonProperty)(null)],H.prototype,"availableUiLocales",void 0);X([(0,xt.jsonProperty)(null)],H.prototype,"metadataConfiguration",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"editorMode",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"noCustom",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"openExternalDocumentInNewTab",void 0);X([(0,at.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],H.prototype,"noCustomComponent",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"withManualResources",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"navigatorOnline",void 0);X([(0,at.property)({type:Boolean})],H.prototype,"forcedOffline",void 0);X([(0,at.property)({type:Object})],H.prototype,"apiProvider",void 0);X([(0,xt.jsonProperty)([])],H.prototype,"messageContexts",void 0);X([(0,xt.jsonProperty)(void 0)],H.prototype,"session",void 0);X([(0,at.state)()],H.prototype,"localesConfiguration",void 0);var Jl=S(V());function pl(e,o){if(e===o)return!0;if(e&&o&&typeof e=="object"&&typeof o=="object"){if(e.constructor!==o.constructor)return!1;var r,n,a;if(Array.isArray(e)){if(r=e.length,r!=o.length)return!1;for(n=r;n--!==0;)if(!Lo(e[n],o[n]))return!1;return!0}if(e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(n of e.entries())if(!o.has(n[0]))return!1;for(n of e.entries())if(!Lo(n[1],o.get(n[0])))return!1;return!0}if(e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(n of e.entries())if(!o.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===o.valueOf();let i=l=>Object.keys(l).filter(d=>l[d]!=null);if(a=i(e),r=a.length,r!==i(o).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,a[n]))return!1;for(n=r;n--!==0;){let l=a[n];if(!Lo(e[l],o[l]))return!1}return!0}return e!==e&&o!==o||e==null&&o==null}function Lo(e,o){try{return pl(e,o)}catch{return!1}}function Po(e,o){return!Lo(e,o)}var ul=S(V(),1);var Io=class{constructor(){this.queue=[]}add(o,r=!1){r&&(this.queue=this.queue.filter(n=>n.type!==o.type)),this.queue.push(o)}consume(o){let r=this.queue.find(n=>n.type===o);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}};var Je=S(V(),1);var Ti=S(V(),1);function $i(e,o){let r=()=>JSON.parse(JSON.stringify(e));return(0,Ti.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Po,...o??{}})}var ko=class{constructor(o=0){this.timeout=o,this.callbacks=[]}run(o,r){return this.callbacks=[o],this.debounce(r)}queue(o,r){return this.callbacks.push(o),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(o){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),o??this.timeout),this.promise}async runCallbacks(){var o,r;let n=[...this.callbacks];this.callbacks=[];let a=(o=this.rejectPromise)!==null&&o!==void 0?o:()=>null,i=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(d){a(d);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var _i=S(D(),1);var To=window,yl=To.ShadowRoot&&(To.ShadyCSS===void 0||To.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fh=Symbol();var Bi=(e,o)=>{yl?e.adoptedStyleSheets=o.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):o.forEach(r=>{let n=document.createElement("style"),a=To.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=r.cssText,e.appendChild(n)})};var $o=class extends _i.LitElement{createRenderRoot(){let o=this.constructor;o.elementDefinitions&&!o.registry&&(o.registry=new CustomElementRegistry,Object.entries(o.elementDefinitions).forEach(([a,i])=>o.registry.define(a,i)));let r={...o.shadowRootOptions,customElements:o.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Bi(n,o.elementStyles),n}};var Bo=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},Mi,Wi=Symbol("constructorPrototype"),Di=Symbol("constructorName"),Ui=Symbol("exportpartsDebouncer"),zi=Symbol("dynamicDependenciesLoaded"),Yt=class extends $o{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Mi]=new ko(5),this[Di]=this.constructor.name,this[Wi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Di]&&Object.setPrototypeOf(this,this[Wi])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let o=this.constructor;o[zi]||(o[zi]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(o){super.updated(o),this.updateComplete.then(()=>{this.contentAvailableCallback(o),this.applyCustomStylesheet(o),this.scheduleExportpartsUpdate()})}contentAvailableCallback(o){}applyCustomStylesheet(o){var r,n,a;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(o.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var o,r,n;(!((o=this.exportpartsPrefix)===null||o===void 0)&&o.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Ui].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(o){var r,n,a,i,l,d;let p=m=>m!=null&&m.trim().length>0,f=o.filter(p).map(m=>m.trim());if(f.length===0){this.removeAttribute("exportparts");return}let y=new Set;for(let m of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let b=(i=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],g=(d=(l=m.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(v=>v.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...b,...g).filter(p).map(v=>v.trim()).forEach(v=>y.add(v))}if(y.size===0){this.removeAttribute("exportparts");return}let h=[...y.values()].flatMap(m=>f.map(b=>`${m}:${b}--${m}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};Mi=Ui;Bo([(0,Je.property)()],Yt.prototype,"exportpartsPrefix",void 0);Bo([$i([])],Yt.prototype,"exportpartsPrefixes",void 0);Bo([(0,Je.property)()],Yt.prototype,"customStylesheet",void 0);Bo([(0,Je.state)()],Yt.prototype,"useAdoptedStyleSheets",void 0);function Qe(e){var o;return(o=e?.isFtReduxStore)!==null&&o!==void 0?o:!1}var Hi,Gi,Fi,to=Symbol("internalReduxEventsUnsubscribers"),qt=Symbol("internalStoresUnsubscribers"),pe=Symbol("internalStores"),eo=class extends Yt{constructor(){super(...arguments),this[Hi]=new Map,this[Gi]=new Map,this[Fi]=new Map}get reduxConstructor(){return this.constructor}update(o){super.update(o),[...this.reduxConstructor.reduxReactiveProperties].some(r=>o.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[pe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pe].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[pe].get(o)}addStore(o,r){var n;r=(n=r??(Qe(o)?o.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[pe].set(r,o),this.subscribeToStore(r,o),this.updateFromStores()}removeStore(o){let r=typeof o=="string"?o:o.name;this.unsubscribeFromStore(r),this[pe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[pe].forEach((o,r)=>this.subscribeToStore(r,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let a=this.getStore(o.store);a&&(o.store?this[qt].has(o.store):this[qt].size>0)&&(this[r]=o.selector(a.getState(),this))}})}subscribeToStore(o,r){var n;this[qt].set(o,r.subscribe(()=>this.updateFromStores())),this[to].set(o,[]),Qe(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((a,i)=>{if(typeof this[i]=="function"&&(!a.store||r.name===a.store)){let l=d=>this[i](d);r.addEventListener(a.eventName,l),this[to].get(o).push(()=>r.removeEventListener(a.eventName,l))}})),this.onStoreAvailable(o)}unsubscribeFromStores(){this[qt].forEach((o,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(o){var r;this[qt].has(o)&&this[qt].get(o)(),this[qt].delete(o),(r=this[to].get(o))===null||r===void 0||r.forEach(n=>n()),this[to].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Hi=qt,Gi=pe,Fi=to;eo.reduxProperties=new Map;eo.reduxReactiveProperties=new Set;eo.reduxEventListeners=new Map;function mt(e){for(var o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Wt(e){return!!e&&!!e[W]}function vt(e){var o;return!!e&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Ol}(e)||Array.isArray(e)||!!e[Xi]||!!(!((o=e.constructor)===null||o===void 0)&&o[Xi])||Wr(e)||Dr(e))}function ue(e,o,r){r===void 0&&(r=!1),ke(e)===0?(r?Object.keys:Ie)(e).forEach(function(n){r&&typeof n=="symbol"||o(n,e[n],e)}):e.forEach(function(n,a){return o(a,n,e)})}function ke(e){var o=e[W];return o?o.i>3?o.i-4:o.i:Array.isArray(e)?1:Wr(e)?2:Dr(e)?3:0}function Pe(e,o){return ke(e)===2?e.has(o):Object.prototype.hasOwnProperty.call(e,o)}function hl(e,o){return ke(e)===2?e.get(o):e[o]}function Ji(e,o,r){var n=ke(e);n===2?e.set(o,r):n===3?e.add(r):e[o]=r}function Qi(e,o){return e===o?e!==0||1/e==1/o:e!=e&&o!=o}function Wr(e){return vl&&e instanceof Map}function Dr(e){return Sl&&e instanceof Set}function Xt(e){return e.o||e.t}function zr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var o=oc(e);delete o[W];for(var r=Ie(o),n=0;n<r.length;n++){var a=r[n],i=o[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),o)}function Mr(e,o){return o===void 0&&(o=!1),Ur(e)||Wt(e)||!vt(e)||(ke(e)>1&&(e.set=e.add=e.clear=e.delete=ml),Object.freeze(e),o&&ue(e,function(r,n){return Mr(n,!0)},!0)),e}function ml(){mt(2)}function Ur(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function At(e){var o=_r[e];return o||mt(18,e),o}function gl(e,o){_r[e]||(_r[e]=o)}function Tr(){return ro}function Lr(e,o){o&&(At("Patches"),e.u=[],e.s=[],e.v=o)}function _o(e){$r(e),e.p.forEach(bl),e.p=null}function $r(e){e===ro&&(ro=e.l)}function ji(e){return ro={p:[],l:ro,h:e,m:!0,_:0}}function bl(e){var o=e[W];o.i===0||o.i===1?o.j():o.g=!0}function Pr(e,o){o._=o.p.length;var r=o.p[0],n=e!==void 0&&e!==r;return o.h.O||At("ES5").S(o,e,n),n?(r[W].P&&(_o(o),mt(4)),vt(e)&&(e=Wo(o,e),o.l||Do(o,e)),o.u&&At("Patches").M(r[W].t,e,o.u,o.s)):e=Wo(o,r,[]),_o(o),o.u&&o.v(o.u,o.s),e!==ec?e:void 0}function Wo(e,o,r){if(Ur(o))return o;var n=o[W];if(!n)return ue(o,function(d,p){return Ki(e,n,o,d,p,r)},!0),o;if(n.A!==e)return o;if(!n.P)return Do(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=zr(n.k):n.o,i=a,l=!1;n.i===3&&(i=new Set(a),a.clear(),l=!0),ue(i,function(d,p){return Ki(e,n,a,d,p,r,l)}),Do(e,a,!1),r&&e.u&&At("Patches").N(n,r,e.u,e.s)}return n.o}function Ki(e,o,r,n,a,i,l){if(Wt(a)){var d=Wo(e,a,i&&o&&o.i!==3&&!Pe(o.R,n)?i.concat(n):void 0);if(Ji(r,n,d),!Wt(d))return;e.m=!1}else l&&r.add(a);if(vt(a)&&!Ur(a)){if(!e.h.D&&e._<1)return;Wo(e,a),o&&o.A.l||Do(e,a)}}function Do(e,o,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Mr(o,r)}function Ir(e,o){var r=e[W];return(r?Xt(r):e)[o]}function Zi(e,o){if(o in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,o);if(n)return n;r=Object.getPrototypeOf(r)}}function Jt(e){e.P||(e.P=!0,e.l&&Jt(e.l))}function kr(e){e.o||(e.o=zr(e.t))}function Br(e,o,r){var n=Wr(o)?At("MapSet").F(o,r):Dr(o)?At("MapSet").T(o,r):e.O?function(a,i){var l=Array.isArray(a),d={i:l?1:0,A:i?i.A:Tr(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=d,f=no;l&&(p=[d],f=oo);var y=Proxy.revocable(p,f),h=y.revoke,m=y.proxy;return d.k=m,d.j=h,m}(o,r):At("ES5").J(o,r);return(r?r.A:Tr()).p.push(n),n}function xl(e){return Wt(e)||mt(22,e),function o(r){if(!vt(r))return r;var n,a=r[W],i=ke(r);if(a){if(!a.P&&(a.i<4||!At("ES5").K(a)))return a.t;a.I=!0,n=Vi(r,i),a.I=!1}else n=Vi(r,i);return ue(n,function(l,d){a&&hl(a.t,l)===d||Ji(n,l,o(d))}),i===3?new Set(n):n}(e)}function Vi(e,o){switch(o){case 2:return new Map(e);case 3:return Array.from(e)}return zr(e)}function tc(){function e(l,d){var p=i[l];return p?p.enumerable=d:i[l]=p={configurable:!0,enumerable:d,get:function(){var f=this[W];return no.get(f,l)},set:function(f){var y=this[W];no.set(y,l,f)}},p}function o(l){for(var d=l.length-1;d>=0;d--){var p=l[d][W];if(!p.P)switch(p.i){case 5:n(p)&&Jt(p);break;case 4:r(p)&&Jt(p)}}}function r(l){for(var d=l.t,p=l.k,f=Ie(p),y=f.length-1;y>=0;y--){var h=f[y];if(h!==W){var m=d[h];if(m===void 0&&!Pe(d,h))return!0;var b=p[h],g=b&&b[W];if(g?g.t!==m:!Qi(b,m))return!0}}var v=!!d[W];return f.length!==Ie(d).length+(v?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var f=0;f<d.length;f++)if(!d.hasOwnProperty(f))return!0;return!1}function a(l){l.g&&mt(3,JSON.stringify(Xt(l)))}var i={};gl("ES5",{J:function(l,d){var p=Array.isArray(l),f=function(h,m){if(h){for(var b=Array(m.length),g=0;g<m.length;g++)Object.defineProperty(b,""+g,e(g,!0));return b}var v=oc(m);delete v[W];for(var R=Ie(v),E=0;E<R.length;E++){var N=R[E];v[N]=e(N,h||!!v[N].enumerable)}return Object.create(Object.getPrototypeOf(m),v)}(p,l),y={i:p?5:4,A:d?d.A:Tr(),P:!1,I:!1,R:{},l:d,t:l,k:f,o:null,g:!1,C:!1};return Object.defineProperty(f,W,{value:y,writable:!0}),f},S:function(l,d,p){p?Wt(d)&&d[W].A===l&&o(l.p):(l.u&&function f(y){if(y&&typeof y=="object"){var h=y[W];if(h){var m=h.t,b=h.k,g=h.R,v=h.i;if(v===4)ue(b,function(T){T!==W&&(m[T]!==void 0||Pe(m,T)?g[T]||f(b[T]):(g[T]=!0,Jt(h)))}),ue(m,function(T){b[T]!==void 0||Pe(b,T)||(g[T]=!1,Jt(h))});else if(v===5){if(n(h)&&(Jt(h),g.length=!0),b.length<m.length)for(var R=b.length;R<m.length;R++)g[R]=!1;else for(var E=m.length;E<b.length;E++)g[E]=!0;for(var N=Math.min(b.length,m.length),P=0;P<N;P++)b.hasOwnProperty(P)||(g[P]=!0),g[P]===void 0&&f(b[P])}}}}(l.p[0]),o(l.p))},K:function(l){return l.i===4?r(l):n(l)}})}var Yi,ro,Hr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",vl=typeof Map<"u",Sl=typeof Set<"u",qi=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ec=Hr?Symbol.for("immer-nothing"):((Yi={})["immer-nothing"]=!0,Yi),Xi=Hr?Symbol.for("immer-draftable"):"__$immer_draftable",W=Hr?Symbol.for("immer-state"):"__$immer_state";var Ol=""+Object.prototype.constructor,Ie=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,oc=Object.getOwnPropertyDescriptors||function(e){var o={};return Ie(e).forEach(function(r){o[r]=Object.getOwnPropertyDescriptor(e,r)}),o},_r={},no={get:function(e,o){if(o===W)return e;var r=Xt(e);if(!Pe(r,o))return function(a,i,l){var d,p=Zi(i,l);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(e,r,o);var n=r[o];return e.I||!vt(n)?n:n===Ir(e.t,o)?(kr(e),e.o[o]=Br(e.A.h,n,e)):n},has:function(e,o){return o in Xt(e)},ownKeys:function(e){return Reflect.ownKeys(Xt(e))},set:function(e,o,r){var n=Zi(Xt(e),o);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var a=Ir(Xt(e),o),i=a?.[W];if(i&&i.t===r)return e.o[o]=r,e.R[o]=!1,!0;if(Qi(r,a)&&(r!==void 0||Pe(e.t,o)))return!0;kr(e),Jt(e)}return e.o[o]===r&&(r!==void 0||o in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[o])||(e.o[o]=r,e.R[o]=!0),!0},deleteProperty:function(e,o){return Ir(e.t,o)!==void 0||o in e.t?(e.R[o]=!1,kr(e),Jt(e)):delete e.R[o],e.o&&delete e.o[o],!0},getOwnPropertyDescriptor:function(e,o){var r=Xt(e),n=Reflect.getOwnPropertyDescriptor(r,o);return n&&{writable:!0,configurable:e.i!==1||o!=="length",enumerable:n.enumerable,value:r[o]}},defineProperty:function(){mt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){mt(12)}},oo={};ue(no,function(e,o){oo[e]=function(){return arguments[0]=arguments[0][0],o.apply(this,arguments)}}),oo.deleteProperty=function(e,o){return oo.set.call(this,e,o,void 0)},oo.set=function(e,o,r){return no.set.call(this,e[0],o,r,e[0])};var Cl=function(){function e(r){var n=this;this.O=qi,this.D=!0,this.produce=function(a,i,l){if(typeof a=="function"&&typeof i!="function"){var d=i;i=a;var p=n;return function(v){var R=this;v===void 0&&(v=d);for(var E=arguments.length,N=Array(E>1?E-1:0),P=1;P<E;P++)N[P-1]=arguments[P];return p.produce(v,function(T){var $;return($=i).call.apply($,[R,T].concat(N))})}}var f;if(typeof i!="function"&&mt(6),l!==void 0&&typeof l!="function"&&mt(7),vt(a)){var y=ji(n),h=Br(n,a,void 0),m=!0;try{f=i(h),m=!1}finally{m?_o(y):$r(y)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(v){return Lr(y,l),Pr(v,y)},function(v){throw _o(y),v}):(Lr(y,l),Pr(f,y))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===ec&&(f=void 0),n.D&&Mr(f,!0),l){var b=[],g=[];At("Patches").M(a,f,b,g),l(b,g)}return f}mt(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var y=arguments.length,h=Array(y>1?y-1:0),m=1;m<y;m++)h[m-1]=arguments[m];return n.produceWithPatches(f,function(b){return a.apply(void 0,[b].concat(h))})};var l,d,p=n.produce(a,i,function(f,y){l=f,d=y});return typeof Promise<"u"&&p instanceof Promise?p.then(function(f){return[f,l,d]}):[p,l,d]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var o=e.prototype;return o.createDraft=function(r){vt(r)||mt(8),Wt(r)&&(r=xl(r));var n=ji(this),a=Br(this,r,void 0);return a[W].C=!0,$r(n),a},o.finishDraft=function(r,n){var a=r&&r[W],i=a.A;return Lr(i,n),Pr(void 0,i)},o.setAutoFreeze=function(r){this.D=r},o.setUseProxies=function(r){r&&!qi&&mt(20),this.O=r},o.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}a>-1&&(n=n.slice(a+1));var l=At("Patches").$;return Wt(r)?l(r,n):this.produce(r,function(d){return l(d,n)})},e}(),ft=new Cl,wl=ft.produce,om=ft.produceWithPatches.bind(ft),rm=ft.setAutoFreeze.bind(ft),nm=ft.setUseProxies.bind(ft),am=ft.applyPatches.bind(ft),im=ft.createDraft.bind(ft),cm=ft.finishDraft.bind(ft),zo=wl;function Qt(e){"@babel/helpers - typeof";return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Qt(e)}function Gr(e,o){if(Qt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,o||"default");if(Qt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function Fr(e){var o=Gr(e,"string");return Qt(o)==="symbol"?o:String(o)}function jr(e,o,r){return o=Fr(o),o in e?Object.defineProperty(e,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[o]=r,e}function rc(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Mo(e){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?rc(Object(r),!0).forEach(function(n){jr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var nc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Kr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Uo={INIT:"@@redux/INIT"+Kr(),REPLACE:"@@redux/REPLACE"+Kr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Kr()}};function El(e){if(typeof e!="object"||e===null)return!1;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(e)===o}function Zr(e,o,r){var n;if(typeof o=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(J(0));if(typeof o=="function"&&typeof r>"u"&&(r=o,o=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(J(1));return r(Zr)(e,o)}if(typeof e!="function")throw new Error(J(2));var a=e,i=o,l=[],d=l,p=!1;function f(){d===l&&(d=l.slice())}function y(){if(p)throw new Error(J(3));return i}function h(v){if(typeof v!="function")throw new Error(J(4));if(p)throw new Error(J(5));var R=!0;return f(),d.push(v),function(){if(R){if(p)throw new Error(J(6));R=!1,f();var N=d.indexOf(v);d.splice(N,1),l=null}}}function m(v){if(!El(v))throw new Error(J(7));if(typeof v.type>"u")throw new Error(J(8));if(p)throw new Error(J(9));try{p=!0,i=a(i,v)}finally{p=!1}for(var R=l=d,E=0;E<R.length;E++){var N=R[E];N()}return v}function b(v){if(typeof v!="function")throw new Error(J(10));a=v,m({type:Uo.REPLACE})}function g(){var v,R=h;return v={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(J(11));function P(){N.next&&N.next(y())}P();var T=R(P);return{unsubscribe:T}}},v[nc]=function(){return this},v}return m({type:Uo.INIT}),n={dispatch:m,subscribe:h,getState:y,replaceReducer:b},n[nc]=g,n}function Nl(e){Object.keys(e).forEach(function(o){var r=e[o],n=r(void 0,{type:Uo.INIT});if(typeof n>"u")throw new Error(J(12));if(typeof r(void 0,{type:Uo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(J(13))})}function ac(e){for(var o=Object.keys(e),r={},n=0;n<o.length;n++){var a=o[n];typeof e[a]=="function"&&(r[a]=e[a])}var i=Object.keys(r),l,d;try{Nl(r)}catch(p){d=p}return function(f,y){if(f===void 0&&(f={}),d)throw d;if(0)var h;for(var m=!1,b={},g=0;g<i.length;g++){var v=i[g],R=r[v],E=f[v],N=R(E,y);if(typeof N>"u"){var P=y&&y.type;throw new Error(J(14))}b[v]=N,m=m||N!==E}return m=m||i.length!==Object.keys(f).length,m?b:f}}function Te(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return o.length===0?function(n){return n}:o.length===1?o[0]:o.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function ic(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(J(15))},l={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},d=o.map(function(p){return p(l)});return i=Te.apply(void 0,d)(a.dispatch),Mo(Mo({},a),{},{dispatch:i})}}}function cc(e){var o=function(n){var a=n.dispatch,i=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,i,e):l(d)}}};return o}var lc=cc();lc.withExtraArgument=cc;var Vr=lc;var uc=function(){var e=function(o,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(o,r)};return function(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(o,r);function n(){this.constructor=o}o.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Al=function(e,o){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(f){return function(y){return p([f,y])}}function p(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,a=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=o.call(e,r)}catch(y){f=[6,y],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},$e=function(e,o){for(var r=0,n=o.length,a=e.length;r<n;r++,a++)e[a]=o[r];return e},Rl=Object.defineProperty,Ll=Object.defineProperties,Pl=Object.getOwnPropertyDescriptors,sc=Object.getOwnPropertySymbols,Il=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,dc=function(e,o,r){return o in e?Rl(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r},te=function(e,o){for(var r in o||(o={}))Il.call(o,r)&&dc(e,r,o[r]);if(sc)for(var n=0,a=sc(o);n<a.length;n++){var r=a[n];kl.call(o,r)&&dc(e,r,o[r])}return e},Yr=function(e,o){return Ll(e,Pl(o))},Tl=function(e,o,r){return new Promise(function(n,a){var i=function(p){try{d(r.next(p))}catch(f){a(f)}},l=function(p){try{d(r.throw(p))}catch(f){a(f)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,l)};d((r=r.apply(e,o)).next())})};var $l=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Te:Te.apply(null,arguments)},Em=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Bl(e){if(typeof e!="object"||e===null)return!1;var o=Object.getPrototypeOf(e);if(o===null)return!0;for(var r=o;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return o===r}var _l=function(e){uc(o,e);function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=e.apply(this,r)||this;return Object.setPrototypeOf(a,o.prototype),a}return Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},o.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(o.bind.apply(o,$e([void 0],r[0].concat(this)))):new(o.bind.apply(o,$e([void 0],r.concat(this))))},o}(Array),Wl=function(e){uc(o,e);function o(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=e.apply(this,r)||this;return Object.setPrototypeOf(a,o.prototype),a}return Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},o.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(o.bind.apply(o,$e([void 0],r[0].concat(this)))):new(o.bind.apply(o,$e([void 0],r.concat(this))))},o}(Array);function Jr(e){return vt(e)?zo(e,function(){}):e}function Dl(e){return typeof e=="boolean"}function zl(){return function(o){return Ml(o)}}function Ml(e){e===void 0&&(e={});var o=e.thunk,r=o===void 0?!0:o,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,l=i===void 0?!0:i,d=new _l;if(r&&(Dl(r)?d.push(Vr):d.push(Vr.withExtraArgument(r.extraArgument))),0){if(a)var p;if(l)var f}return d}var qr=!0;function yc(e){var o=zl(),r=e||{},n=r.reducer,a=n===void 0?void 0:n,i=r.middleware,l=i===void 0?o():i,d=r.devTools,p=d===void 0?!0:d,f=r.preloadedState,y=f===void 0?void 0:f,h=r.enhancers,m=h===void 0?void 0:h,b;if(typeof a=="function")b=a;else if(Bl(a))b=ac(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=l;if(typeof g=="function"&&(g=g(o),!qr&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!qr&&g.some(function(T){return typeof T!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=ic.apply(void 0,g),R=Te;p&&(R=$l(te({trace:!qr},typeof p=="object"&&p)));var E=new Wl(v),N=E;Array.isArray(m)?N=$e([v],m):typeof m=="function"&&(N=m(E));var P=R.apply(void 0,N);return Zr(b,y,P)}function ee(e,o){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(o){var i=o.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return te(te({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function hc(e){var o={},r=[],n,a={addCase:function(i,l){var d=typeof i=="string"?i:i.type;if(d in o)throw new Error("addCase cannot be called with two reducers for the same action type");return o[d]=l,a},addMatcher:function(i,l){return r.push({matcher:i,reducer:l}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[o,r,n]}function Ul(e){return typeof e=="function"}function Hl(e,o,r,n){r===void 0&&(r=[]);var a=typeof o=="function"?hc(o):[o,r,n],i=a[0],l=a[1],d=a[2],p;if(Ul(e))p=function(){return Jr(e())};else{var f=Jr(e);p=function(){return f}}function y(h,m){h===void 0&&(h=p());var b=$e([i[m.type]],l.filter(function(g){var v=g.matcher;return v(m)}).map(function(g){var v=g.reducer;return v}));return b.filter(function(g){return!!g}).length===0&&(b=[d]),b.reduce(function(g,v){if(v)if(Wt(g)){var R=g,E=v(R,m);return E===void 0?g:E}else{if(vt(g))return zo(g,function(N){return v(N,m)});var E=v(g,m);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}return g},h)}return y.getInitialState=p,y}function Gl(e,o){return e+"/"+o}function mc(e){var o=e.name;if(!o)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof e.initialState=="function"?e.initialState:Jr(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},l={},d={};a.forEach(function(y){var h=n[y],m=Gl(o,y),b,g;"reducer"in h?(b=h.reducer,g=h.prepare):b=h,i[y]=b,l[m]=b,d[y]=g?ee(m,g):ee(m)});function p(){var y=typeof e.extraReducers=="function"?hc(e.extraReducers):[e.extraReducers],h=y[0],m=h===void 0?{}:h,b=y[1],g=b===void 0?[]:b,v=y[2],R=v===void 0?void 0:v,E=te(te({},m),l);return Hl(r,function(N){for(var P in E)N.addCase(P,E[P]);for(var T=0,$=g;T<$.length;T++){var pt=$[T];N.addMatcher(pt.matcher,pt.reducer)}R&&N.addDefaultCase(R)})}var f;return{name:o,reducer:function(y,h){return f||(f=p()),f(y,h)},actions:d,caseReducers:i,getInitialState:function(){return f||(f=p()),f.getInitialState()}}}var Fl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",jl=function(e){e===void 0&&(e=21);for(var o="",r=e;r--;)o+=Fl[Math.random()*64|0];return o},Kl=["name","message","stack","code"],Xr=function(){function e(o,r){this.payload=o,this.meta=r}return e}(),fc=function(){function e(o,r){this.payload=o,this.meta=r}return e}(),Zl=function(e){if(typeof e=="object"&&e!==null){for(var o={},r=0,n=Kl;r<n.length;r++){var a=n[r];typeof e[a]=="string"&&(o[a]=e[a])}return o}return{message:String(e)}},Lm=function(){function e(o,r,n){var a=ee(o+"/fulfilled",function(y,h,m,b){return{payload:y,meta:Yr(te({},b||{}),{arg:m,requestId:h,requestStatus:"fulfilled"})}}),i=ee(o+"/pending",function(y,h,m){return{payload:void 0,meta:Yr(te({},m||{}),{arg:h,requestId:y,requestStatus:"pending"})}}),l=ee(o+"/rejected",function(y,h,m,b,g){return{payload:b,error:(n&&n.serializeError||Zl)(y||"Rejected"),meta:Yr(te({},g||{}),{arg:m,requestId:h,rejectedWithValue:!!b,requestStatus:"rejected",aborted:y?.name==="AbortError",condition:y?.name==="ConditionError"})}}),d=!1,p=typeof AbortController<"u"?AbortController:function(){function y(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return y.prototype.abort=function(){},y}();function f(y){return function(h,m,b){var g=n?.idGenerator?n.idGenerator(y):jl(),v=new p,R,E=!1;function N(T){R=T,v.abort()}var P=function(){return Tl(this,null,function(){var T,$,pt,zt,or,Mt,it;return Al(this,function(ut){switch(ut.label){case 0:return ut.trys.push([0,4,,5]),zt=(T=n?.condition)==null?void 0:T.call(n,y,{getState:m,extra:b}),Yl(zt)?[4,zt]:[3,2];case 1:zt=ut.sent(),ut.label=2;case 2:if(zt===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return E=!0,or=new Promise(function(ct,oe){return v.signal.addEventListener("abort",function(){return oe({name:"AbortError",message:R||"Aborted"})})}),h(i(g,y,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:g,arg:y},{getState:m,extra:b}))),[4,Promise.race([or,Promise.resolve(r(y,{dispatch:h,getState:m,extra:b,requestId:g,signal:v.signal,abort:N,rejectWithValue:function(ct,oe){return new Xr(ct,oe)},fulfillWithValue:function(ct,oe){return new fc(ct,oe)}})).then(function(ct){if(ct instanceof Xr)throw ct;return ct instanceof fc?a(ct.payload,g,y,ct.meta):a(ct,g,y)})])];case 3:return pt=ut.sent(),[3,5];case 4:return Mt=ut.sent(),pt=Mt instanceof Xr?l(null,g,y,Mt.payload,Mt.meta):l(Mt,g,y),[3,5];case 5:return it=n&&!n.dispatchConditionRejection&&l.match(pt)&&pt.meta.condition,it||h(pt),[2,pt]}})})}();return Object.assign(P,{abort:N,requestId:g,arg:y,unwrap:function(){return P.then(Vl)}})}}return Object.assign(f,{pending:i,rejected:l,fulfilled:a,typePrefix:o})}return e.withTypes=function(){return e},e}();function Vl(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Yl(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gc="listener",bc="completed",xc="cancelled",Pm="task-"+xc,Im="task-"+bc,km=gc+"-"+xc,Tm=gc+"-"+bc;var Qr="listenerMiddleware";var $m=ee(Qr+"/add"),Bm=ee(Qr+"/removeAll"),_m=ee(Qr+"/remove");var pc,Wm=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(pc||(pc=Promise.resolve())).then(e).catch(function(o){return setTimeout(function(){throw o},0)})},ql=function(e){return function(o){setTimeout(o,e)}},Dm=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ql(10);tc();function Xl(e,o){return class extends e{constructor(){super(...arguments),this.eventBus=o??document.createElement("span")}addEventListener(r,n,a){this.eventBus.addEventListener(r,n,a)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,a){this.eventBus.removeEventListener(r,n,a)}}}var Ho=class extends Xl(Object){};window.ftReduxStores||(window.ftReduxStores={});var vc=class e extends Ho{static get(o){var r;let n=typeof o=="string"?o:o.name,a=typeof o=="string"?void 0:o,i=window.ftReduxStores[n];if(Qe(i))return i;if(a==null)return;let l=mc({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),d=yc({reducer:(p,f)=>f.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...f.overwrites}:l.reducer(p,f)});return window.ftReduxStores[a.name]=new e(l,d)}constructor(o,r){super(),this.reduxSlice=o,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Io;let n=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,i,l)=>{let d=i,p=a[d];return p?(...f)=>{let y=p(...f.map(n));return this.reduxStore.dispatch(y),y}:f=>{this.setState({[d]:n(f)})}}})}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(o){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(o).join("_"),overwrites:o})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(o){throw new Error("Not implemented yet.")}subscribe(o){return this.reduxStore.subscribe(o)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Ko=S(k());var Go=class extends Zt{async listMySearches(){let o=L.getState().session;return o?.sessionAuthenticated?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(o.profile.userId),5*60*1e3):[]}};var Fo=class extends Zt{async listMyBookmarks(){let o=L.getState().session;return o?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(o.profile.userId),5*60*1e3):[]}};var Ql="ft-user-assets",jo=Ko.FtReduxStore.get({name:Ql,initialState:{savedSearches:void 0,bookmarks:void 0}}),tn=class{constructor(){this.currentSession=L.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Fo,this.savedSearchesService=new Go,L.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var o;let{session:r}=L.getState();(0,Ko.deepEqual)((o=this.currentSession)===null||o===void 0?void 0:o.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),jo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),jo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let o=await this.savedSearchesService.listMySearches();jo.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var o;if(this.bookmarksAreUsed){let r=!((o=this.currentSession)===null||o===void 0)&&o.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;jo.actions.bookmarks(r)}}},xg=new tn;var en=class{addCommand(o,r=!1){L.commands.add(o,r)}consumeCommand(o){return L.commands.consume(o)}};window.FluidTopicsAppInfoStoreService=new en;var Sc=S(k()),on=class{highlightHtml(o,r,n){(0,Sc.highlightHtml)(o,r,n)}};window.FluidTopicsHighlightHtmlService=new on;var Oc=S(k());var rn=class{isDate(o){var r,n,a,i;return(i=(a=((n=(r=L.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(o,r){var n,a,i;return Oc.DateFormatter.format(o,(n=r?.locale)!==null&&n!==void 0?n:L.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new rn;var ts=S(k());(0,Cc.customElement)("ft-app-context")(H);var Ec=S(V()),es=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},nn=Symbol("i18nAttributes"),an=Symbol("i18nListAttributes"),Zo=Symbol("i18nProperties"),cn=Symbol("i18nManualContexts"),ao=Symbol("i18nUnsubs");function qo(e){var o,r;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map,this[r]=new Map}get i18nService(){return this.useCustomMessageContexts?Ii:fe}i18n(i,l,...d){var p;if(typeof i=="string")return this.i18nService.resolveMessage(i,l,...d);let f=(p=i.args)!==null&&p!==void 0?p:i.argsProvider?i.argsProvider(this):[];return this.i18nService.resolveMessage(i.context,i.key,...f)}onI18nUpdate(i){var l,d,p;(l=this[nn])===null||l===void 0||l.forEach((f,y)=>{let h=this.getI18nAttributeValue(y);h&&(this[y]=this.getI18nAttributeMessage(h,f,i))}),(d=this[an])===null||d===void 0||d.forEach((f,y)=>{let h=this.getI18nListAttributeValues(y);this[y]=h?.map(m=>this.getI18nAttributeMessage(m,f,i))}),(p=this[Zo])===null||p===void 0||p.forEach((f,y)=>{f.context.toLowerCase()===i.toLowerCase()&&(this[y]=this.i18n(f))}),setTimeout(()=>this.requestUpdate(),0)}buildI18nAttributeMessage(i,l){return{...i,message:this.i18n({context:i.context,key:i.key,...l})}}getI18nAttributeMessage(i,l,d){var p;let f=!d||((p=i.context)===null||p===void 0?void 0:p.toLowerCase())===d.toLowerCase();return i.context&&i.key&&f?this.buildI18nAttributeMessage(i,l):i}update(i){var l,d,p;super.update(i),(l=this[nn])===null||l===void 0||l.forEach((f,y)=>{let h=this.getI18nAttributeValue(y);h?.context&&h.key&&(i.has(y)||f.argsProvider!=null)&&(this.addI18nContextIfNeeded(h,i,y),this[y]=this.getI18nAttributeMessage(h,f))}),(d=this[an])===null||d===void 0||d.forEach((f,y)=>{let h=this.getI18nListAttributeValues(y);(i.has(y)||f.argsProvider!=null)&&(this[y]=h?.map(m=>(this.addI18nContextIfNeeded(m,i,y),this.getI18nAttributeMessage(m,f))))}),(p=this[Zo])===null||p===void 0||p.forEach((f,y)=>{f.argsProvider!=null&&(this[y]=this.i18n(f))})}getI18nAttributeValue(i){return this[i]}getI18nListAttributeValues(i){return this[i]}addI18nContextIfNeeded(i,l,d){i.context&&i.key&&l.has(d)&&this.addI18nContext(i.context)}addI18nMessagesAndSubscribe(i,l){i=i.toLowerCase(),this[ao].has(i)||this[ao].set(i,this.i18nService.subscribe(i,()=>this.onI18nUpdate(i))),this.i18nService.prepareContext(i,l??{}),this.onI18nUpdate(i)}connectedCallback(){var i,l,d,p,f,y;super.connectedCallback(),new Set([...(l=(i=this[Zo])===null||i===void 0?void 0:i.values())!==null&&l!==void 0?l:[],...[...(p=(d=this[nn])===null||d===void 0?void 0:d.keys())!==null&&p!==void 0?p:[]].map(h=>this.getI18nAttributeValue(h)),...[...(y=(f=this[an])===null||f===void 0?void 0:f.keys())!==null&&y!==void 0?y:[]].flatMap(h=>this.getI18nListAttributeValues(h))].map(h=>h?.context)).forEach(h=>h&&this.addI18nMessages(h)),this[cn].forEach((h,m)=>{this.addI18nMessages(m,h)})}addI18nMessages(i,l){this[cn].set(i,l??{}),this.addI18nMessagesAndSubscribe(i,l)}addI18nContext(i,l){this.addI18nMessages(typeof i=="string"?i:i.name,l)}disconnectedCallback(){super.disconnectedCallback(),this[ao].forEach(i=>i()),this[ao].clear()}}return o=cn,r=ao,es([(0,Ec.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var wc=class extends qo(Yo.FtLitElement){},Vo=class extends qo(Yo.FtLitElementRedux){};var io=function(e,o,r,n){var a=arguments.length,i=a<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,o,r,n);else for(var d=e.length-1;d>=0;d--)(l=e[d])&&(i=(a<3?l(i):a>3?l(o,r,i):l(o,r))||i);return a>3&&i&&Object.defineProperty(o,r,i),i},St=class extends Vo{constructor(){super(),this.editorMode=!1,this.addStore(L)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Xo.nothing:Xo.html`
1131
1131
  <span class="ft-i18n">
1132
1132
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1133
1133
  </span>