@fluid-topics/ft-search-context 1.0.7 → 1.0.8

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.
@@ -2,6 +2,6 @@
2
2
  `,n={setRequestQuery:(t,s)=>{t.request.query=s.payload},setRequestContentLocale:(t,s)=>{t.request.contentLocale=s.payload},setPageSize:(t,s)=>{t.request.paging.perPage=s.payload},setPageNumber:(t,s)=>{t.request.paging.page=s.payload},setRequestSort:(t,s)=>{t.request.sort=s.payload},setRequestFilters:(t,s)=>{t.request.filters=s.payload},setRequestFacets:(t,s)=>{t.request.facets=s.payload},setResults:(t,s)=>{t.results=s.payload},setFacets:(t,s)=>{t.facets=s.payload},setLocales:(t,s)=>{t.locales=s.payload},setPaging:(t,s)=>{t.paging=s.payload},setLiveQuery:(t,s)=>{t.liveQuery=s.payload},setSuggestResults:(t,s)=>{t.suggestResults=s.payload}},h=e.css`
3
3
  `,o=s.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,s)=>{t.baseUrl=s.payload},setApiIntegrationIdentifier:(t,s)=>{t.apiIntegrationIdentifier=s.payload},setUiLocale:(t,s)=>{t.uiLocale=s.payload},setAvailableUiLocales:(t,s)=>{t.availableUiLocales=s.payload},setEditorMode:(t,s)=>{t.editorMode=s.payload},setNoCustom:(t,s)=>{t.noCustom=s.payload},setNoCustomComponent:(t,s)=>{t.noCustomComponent=s.payload},setSession:(t,s)=>{t.session=s.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class r{static build(t){const{baseUrl:s,apiIntegrationIdentifier:e}=o.getState(),i=null!=t?t:e;if(s&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(s,i,!0)}static get(t){var s;return null!=t?r.build(t):null!==(s=r.API)&&void 0!==s?s:r.API=r.build()}static await(t){return new Promise((s=>{let e=r.get(t);if(e)s(e);else{const i=o.subscribe((()=>{e=r.get(t),e&&(i(),s(e))}))}}))}}var l;const c=Symbol("clearAfterUnitTest");class u{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new s.CacheRegistry,this.listeners={},this.currentUiLocale="",this[l]=()=>{this.defaultMessages={},this.cache=new s.CacheRegistry,this.listeners={}},this.currentUiLocale=o.getState().uiLocale,o.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=o.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const s=t.name.toLowerCase();this.cache.setFinal(s,t),this.notify(s)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var i;if(t=t.toLowerCase(),Object.keys(e).length>0){const a={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};s.deepEqual(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var a,n,h;t=t.toLowerCase(),this.fetchContext(t);const o=null!==(n=null===(a=this.cache.getNow(t))||void 0===a?void 0:a.messages)&&void 0!==n?n:{};return new s.ParametrizedLabelResolver(null!==(h=this.defaultMessages[t])&&void 0!==h?h:{},o).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,s){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(s),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(s)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>s.delay(0).then((()=>t())).catch((()=>null)))))}}l=c,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new u((async(t,s)=>(await r.await()).getFluidTopicsMessageContext(t,s)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new u((async(t,s)=>(await r.await()).getCustomMessageContext(t,s))));const d=window.FluidTopicsI18nService;var v=function(t,s,e,i){for(var a,n=arguments.length,h=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,o=t.length-1;o>=0;o--)(a=t[o])&&(h=(n<3?a(h):n>3?a(s,e,h):a(s,e))||h);return n>3&&h&&Object.defineProperty(s,e,h),h};class w extends s.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>r.get(),this.cache=new s.CacheRegistry,this.cleanSessionDebouncer=new s.Debouncer}render(){return e.html`
4
4
  <slot></slot>
5
- `}updated(t){super.updated(t),t.has("baseUrl")&&o.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&o.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&o.actions.setNoCustom(this.noCustom),t.has("editorMode")&&o.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.setSession(this.session),t.has("availableUiLocales")&&o.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>d.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const s=await t.getCurrentSession();return s.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),s.idleTimeoutInMillis),s}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}w.elementDefinitions={},w.styles=h,v([i.property()],w.prototype,"baseUrl",void 0),v([i.property()],w.prototype,"apiIntegrationIdentifier",void 0),v([i.property()],w.prototype,"uiLocale",void 0),v([s.jsonProperty([])],w.prototype,"availableUiLocales",void 0),v([i.property({type:Boolean})],w.prototype,"editorMode",void 0),v([i.property({type:Boolean})],w.prototype,"noCustom",void 0),v([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],w.prototype,"noCustomComponent",void 0),v([i.property({type:Boolean})],w.prototype,"withManualResources",void 0),v([s.jsonProperty([])],w.prototype,"messageContexts",void 0),v([s.jsonProperty(void 0)],w.prototype,"session",void 0),v([i.property({type:Object})],w.prototype,"apiProvider",void 0),s.customElement("ft-app-context")(w);class g{static async build(){return new g(await r.await())}constructor(t){this.api=t,this.cache=new s.CacheRegistry,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.cache.get(`search-${this.hash(t)}`,(()=>this.api.search(t)),18e4)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}hash(t){return JSON.stringify(t).split("").reduce(((t,s)=>(t<<5)-t+s.charCodeAt(0)|0),0)}}class f{static build(t){return new f((t=>s.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},results:[],facets:[],paging:{totalResultsCount:0,totalClustersCount:0,isLastPage:!1},liveQuery:"",suggestResults:[]},reducers:n}))(t.trim()||"context"),g.build)}constructor(t,e){this.store=t,this.serviceProvider=e,this.searchDebouncer=new s.Debouncer(10),this.suggestDebouncer=new s.Debouncer(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){for(;null==this.service;)await s.delay(5);return this.service}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let s=this.store.getState().locales,e=this.store.getState().request.contentLocale;if(t!=e){if(s){const i=t=>s.some((s=>s.lang===t));i(t)||(t=i(e)?e:s[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.store.actions.setPageNumber(1),this.launchSearch()}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,s){let e=this.facetIds.filter((s=>s!=t));s&&e.push(s),this.facetIds=e,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let s=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(s)}setFilter(t,s){let e=this.store.getState().request.filters,i={key:t,values:s,negative:!1},a=[...e.filter((s=>s.key!==t)),i];this.setFilters(a)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async launchSearch(){await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){try{let t=await this.service.launchSearch(this.store.getState().request);if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.isLastPage});else{let s=this.store.getState().results.concat(t.results);this.store.actions.setResults(s),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.isLastPage})}}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},s=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(s.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var p=function(t,s,e,i){for(var a,n=arguments.length,h=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,o=t.length-1;o>=0;o--)(a=t[o])&&(h=(n<3?a(h):n>3?a(s,e,h):a(s,e))||h);return n>3&&h&&Object.defineProperty(s,e,h),h};class b extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const y=Symbol("registerInterval");class C extends(function(t){var s;class e extends t{constructor(){super(...arguments),this[s]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[y]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[y]):this.dispatchEvent(new b)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return s=y,p([i.state()],e.prototype,"stateManager",void 0),e}(s.FtLitElementRedux)){}var m=function(t,s,e,i){for(var a,n=arguments.length,h=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,o=t.length-1;o>=0;o--)(a=t[o])&&(h=(n<3?a(h):n>3?a(s,e,h):a(s,e))||h);return n>3&&h&&Object.defineProperty(s,e,h),h};class S extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class L extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class x extends s.FtLitElementRedux{get stateManager(){return null==this._stateManager&&(this._stateManager=f.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.contentLocale="en-US",this.pageSize=20,this.filters=[],this.sort=[],this.addStore(o)}render(){return e.html`
5
+ `}updated(t){super.updated(t),t.has("baseUrl")&&o.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&o.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&o.actions.setNoCustom(this.noCustom),t.has("editorMode")&&o.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.setSession(this.session),t.has("availableUiLocales")&&o.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>d.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const s=await t.getCurrentSession();return s.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),s.idleTimeoutInMillis),s}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}w.elementDefinitions={},w.styles=h,v([i.property()],w.prototype,"baseUrl",void 0),v([i.property()],w.prototype,"apiIntegrationIdentifier",void 0),v([i.property()],w.prototype,"uiLocale",void 0),v([s.jsonProperty([])],w.prototype,"availableUiLocales",void 0),v([i.property({type:Boolean})],w.prototype,"editorMode",void 0),v([i.property({type:Boolean})],w.prototype,"noCustom",void 0),v([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],w.prototype,"noCustomComponent",void 0),v([i.property({type:Boolean})],w.prototype,"withManualResources",void 0),v([s.jsonProperty([])],w.prototype,"messageContexts",void 0),v([s.jsonProperty(void 0)],w.prototype,"session",void 0),v([i.property({type:Object})],w.prototype,"apiProvider",void 0),s.customElement("ft-app-context")(w);class f{static async build(){return new f(await r.await())}constructor(t){this.api=t,this.cache=new s.CacheRegistry,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.cache.get(`search-${this.hash(t)}`,(()=>this.api.search(t)),18e4)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}hash(t){return JSON.stringify(t).split("").reduce(((t,s)=>(t<<5)-t+s.charCodeAt(0)|0),0)}}class g{static build(t){return new g((t=>s.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:n}))(t.trim()||"context"),f.build)}constructor(t,e){this.store=t,this.serviceProvider=e,this.searchDebouncer=new s.Debouncer(10),this.suggestDebouncer=new s.Debouncer(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){for(;null==this.service;)await s.delay(5);return this.service}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let s=this.store.getState().locales,e=this.store.getState().request.contentLocale;if(t!=e){if(s){const i=t=>s.some((s=>s.lang===t));i(t)||(t=i(e)?e:s[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.store.actions.setPageNumber(1),this.launchSearch()}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,s){let e=this.facetIds.filter((s=>s!=t));s&&e.push(s),this.facetIds=e,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let s=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(s)}setFilter(t,s){let e=this.store.getState().request.filters,i={key:t,values:s,negative:!1},a=[...e.filter((s=>s.key!==t)),i];this.setFilters(a)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async launchSearch(){return await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t;try{let s=await this.service.launchSearch(this.store.getState().request);if(s.paging.currentPage<=1)this.store.actions.setResults(s.results),this.store.actions.setFacets(s.facets);else{let e=(null!==(t=this.store.getState().results)&&void 0!==t?t:[]).concat(s.results);this.store.actions.setResults(e)}this.store.actions.setPaging(s.paging)}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},s=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(s.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var p=function(t,s,e,i){for(var a,n=arguments.length,h=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,o=t.length-1;o>=0;o--)(a=t[o])&&(h=(n<3?a(h):n>3?a(s,e,h):a(s,e))||h);return n>3&&h&&Object.defineProperty(s,e,h),h};class b extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const y=Symbol("registerInterval");class m extends(function(t){var s;class e extends t{constructor(){super(...arguments),this[s]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[y]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[y]):this.dispatchEvent(new b)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return s=y,p([i.state()],e.prototype,"stateManager",void 0),e}(s.FtLitElementRedux)){}var S=function(t,s,e,i){for(var a,n=arguments.length,h=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,o=t.length-1;o>=0;o--)(a=t[o])&&(h=(n<3?a(h):n>3?a(s,e,h):a(s,e))||h);return n>3&&h&&Object.defineProperty(s,e,h),h};class C extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class L extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class x extends s.FtLitElementRedux{get stateManager(){return null==this._stateManager&&(this._stateManager=g.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.contentLocale="en-US",this.pageSize=20,this.filters=[],this.sort=[],this.addStore(o)}render(){return e.html`
6
6
  <slot @register-ft-search-component=${this.registerComponent}></slot>
7
- `}updated(t){super.updated(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new L(this.request))}registerComponent(t){t.stopPropagation();const s=t.composedPath()[0];this.register(s)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new S(t))}}x.elementDefinitions={},x.styles=a,m([i.property()],x.prototype,"query",void 0),m([i.property()],x.prototype,"contentLocale",void 0),m([i.property({type:Number})],x.prototype,"pageSize",void 0),m([s.jsonProperty([])],x.prototype,"filters",void 0),m([s.jsonProperty([])],x.prototype,"sort",void 0),m([s.redux({store:"search"})],x.prototype,"request",void 0),m([s.redux({store:o.name})],x.prototype,"session",void 0),s.customElement("ft-search-context")(x),t.FtSearchContext=x,t.FtSearchContextCssVariables={},t.LoadErrorEvent=S,t.SearchRequestChangeEvent=L,t.styles=a}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
7
+ `}updated(t){super.updated(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new L(this.request))}registerComponent(t){t.stopPropagation();const s=t.composedPath()[0];this.register(s)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new C(t))}}x.elementDefinitions={},x.styles=a,S([i.property()],x.prototype,"query",void 0),S([i.property()],x.prototype,"contentLocale",void 0),S([i.property({type:Number})],x.prototype,"pageSize",void 0),S([s.jsonProperty([])],x.prototype,"filters",void 0),S([s.jsonProperty([])],x.prototype,"sort",void 0),S([s.redux({store:"search"})],x.prototype,"request",void 0),S([s.redux({store:o.name})],x.prototype,"session",void 0),s.customElement("ft-search-context")(x),t.FtSearchContext=x,t.FtSearchContextCssVariables={},t.LoadErrorEvent=C,t.SearchRequestChangeEvent=L,t.styles=a}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
@@ -39,7 +39,7 @@ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.cust
39
39
  * @license
40
40
  * Copyright 2017 Google LLC
41
41
  * SPDX-License-Identifier: BSD-3-Clause
42
- */;var O;const S=window,j=S.trustedTypes,E=j?j.emptyScript:"",C=S.reactiveElementPolyfillSupport,R={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},N=(t,e)=>e!==t&&(e==e||t==t),M={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:N};let A=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const i=this._$Ep(n,e);void 0!==i&&(this._$Ev.set(i,n),t.push(i))})),t}static createProperty(t,e=M){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||M}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(x(t))}else void 0!==t&&e.push(x(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return g(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=M){var i;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:R).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:R;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let i=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||N)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
42
+ */;var O;const S=window,j=S.trustedTypes,E=j?j.emptyScript:"",C=S.reactiveElementPolyfillSupport,N={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},R=(t,e)=>e!==t&&(e==e||t==t),M={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:R};let A=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const i=this._$Ep(n,e);void 0!==i&&(this._$Ev.set(i,n),t.push(i))})),t}static createProperty(t,e=M){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||M}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(x(t))}else void 0!==t&&e.push(x(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return g(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=M){var i;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:N).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:N;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let i=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||R)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
@@ -83,10 +83,10 @@ var dt,vt;let pt=class extends A{constructor(){super(...arguments),this.renderOp
83
83
  display: inline-block;
84
84
  width: 0;
85
85
  }
86
- `;class Et{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var n,i;t=this.resolvePluralKey(t,e);let r=null!==(i=null!==(n=this.labels[t])&&void 0!==n?n:this.defaultLabels[t])&&void 0!==i?i:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,n)=>this.formatValue(t,n))))),r}resolvePluralKey(t,e){for(let n of e)if("number"==typeof n){const e=`${String(t)}[\\=${n}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const n=n=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(n):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(n):t.toLocaleString(n);try{return n(document.documentElement.lang)}catch(t){return n()}}}function Ct(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(t){return!!t&&!!t[de]}function Nt(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ve}(t)||Array.isArray(t)||!!t[fe]||!!(null===(e=t.constructor)||void 0===e?void 0:e[fe])||Pt(t)||$t(t))}function Mt(t,e,n){void 0===n&&(n=!1),0===At(t)?(n?Object.keys:pe)(t).forEach((function(i){n&&"symbol"==typeof i||e(i,t[i],t)})):t.forEach((function(n,i){return e(i,n,t)}))}function At(t){var e=t[de];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Pt(t)?2:$t(t)?3:0}function Ut(t,e){return 2===At(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function kt(t,e,n){var i=At(t);2===i?t.set(e,n):3===i?t.add(n):t[e]=n}function Lt(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Pt(t){return ae&&t instanceof Map}function $t(t){return ce&&t instanceof Set}function Ft(t){return t.o||t.t}function It(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=be(t);delete e[de];for(var n=pe(e),i=0;i<n.length;i++){var r=n[i],o=e[r];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function _t(t,e){return void 0===e&&(e=!1),Bt(t)||Rt(t)||!Nt(t)||(At(t)>1&&(t.set=t.add=t.clear=t.delete=Tt),Object.freeze(t),e&&Mt(t,(function(t,e){return _t(e,!0)}),!0)),t}function Tt(){Ct(2)}function Bt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function Wt(t){var e=ye[t];return e||Ct(18,t),e}function qt(){return se}function Kt(t,e){e&&(Wt("Patches"),t.u=[],t.s=[],t.v=e)}function Dt(t){zt(t),t.p.forEach(Vt),t.p=null}function zt(t){t===se&&(se=t.l)}function Ht(t){return se={p:[],l:se,h:t,m:!0,_:0}}function Vt(t){var e=t[de];0===e.i||1===e.i?e.j():e.g=!0}function Jt(t,e){e._=e.p.length;var n=e.p[0],i=void 0!==t&&t!==n;return e.h.O||Wt("ES5").S(e,t,i),i?(n[de].P&&(Dt(e),Ct(4)),Nt(t)&&(t=Zt(e,t),e.l||Xt(e,t)),e.u&&Wt("Patches").M(n[de].t,t,e.u,e.s)):t=Zt(e,n,[]),Dt(e),e.u&&e.v(e.u,e.s),t!==he?t:void 0}function Zt(t,e,n){if(Bt(e))return e;var i=e[de];if(!i)return Mt(e,(function(r,o){return Qt(t,i,e,r,o,n)}),!0),e;if(i.A!==t)return e;if(!i.P)return Xt(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=4===i.i||5===i.i?i.o=It(i.k):i.o,o=r,s=!1;3===i.i&&(o=new Set(r),r.clear(),s=!0),Mt(o,(function(e,o){return Qt(t,i,r,e,o,n,s)})),Xt(t,r,!1),n&&t.u&&Wt("Patches").N(i,n,t.u,t.s)}return i.o}function Qt(t,e,n,i,r,o,s){if(Rt(r)){var u=Zt(t,r,o&&e&&3!==e.i&&!Ut(e.R,i)?o.concat(i):void 0);if(kt(n,i,u),!Rt(u))return;t.m=!1}else s&&n.add(r);if(Nt(r)&&!Bt(r)){if(!t.h.D&&t._<1)return;Zt(t,r),e&&e.A.l||Xt(t,r)}}function Xt(t,e,n){void 0===n&&(n=!1),!t.l&&t.h.D&&t.m&&_t(e,n)}function Gt(t,e){var n=t[de];return(n?Ft(n):t)[e]}function Yt(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function te(t){t.P||(t.P=!0,t.l&&te(t.l))}function ee(t){t.o||(t.o=It(t.t))}function ne(t,e,n){var i=Pt(e)?Wt("MapSet").F(e,n):$t(e)?Wt("MapSet").T(e,n):t.O?function(t,e){var n=Array.isArray(t),i={i:n?1:0,A:e?e.A:qt(),P:!1,I:!1,R:{},l:e,t,k:null,o:null,j:null,C:!1},r=i,o=we;n&&(r=[i],o=me);var s=Proxy.revocable(r,o),u=s.revoke,a=s.proxy;return i.k=a,i.j=u,a}(e,n):Wt("ES5").J(e,n);return(n?n.A:qt()).p.push(i),i}function ie(t){return Rt(t)||Ct(22,t),function t(e){if(!Nt(e))return e;var n,i=e[de],r=At(e);if(i){if(!i.P&&(i.i<4||!Wt("ES5").K(i)))return i.t;i.I=!0,n=re(e,r),i.I=!1}else n=re(e,r);return Mt(n,(function(e,r){i&&function(t,e){return 2===At(t)?t.get(e):t[e]}(i.t,e)===r||kt(n,e,t(r))})),3===r?new Set(n):n}(t)}function re(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return It(t)}var oe,se,ue="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),ae="undefined"!=typeof Map,ce="undefined"!=typeof Set,le="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,he=ue?Symbol.for("immer-nothing"):((oe={})["immer-nothing"]=!0,oe),fe=ue?Symbol.for("immer-draftable"):"__$immer_draftable",de=ue?Symbol.for("immer-state"):"__$immer_state",ve=""+Object.prototype.constructor,pe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,be=Object.getOwnPropertyDescriptors||function(t){var e={};return pe(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)})),e},ye={},we={get:function(t,e){if(e===de)return t;var n=Ft(t);if(!Ut(n,e))return function(t,e,n){var i,r=Yt(e,n);return r?"value"in r?r.value:null===(i=r.get)||void 0===i?void 0:i.call(t.k):void 0}(t,n,e);var i=n[e];return t.I||!Nt(i)?i:i===Gt(t.t,e)?(ee(t),t.o[e]=ne(t.A.h,i,t)):i},has:function(t,e){return e in Ft(t)},ownKeys:function(t){return Reflect.ownKeys(Ft(t))},set:function(t,e,n){var i=Yt(Ft(t),e);if(null==i?void 0:i.set)return i.set.call(t.k,n),!0;if(!t.P){var r=Gt(Ft(t),e),o=null==r?void 0:r[de];if(o&&o.t===n)return t.o[e]=n,t.R[e]=!1,!0;if(Lt(n,r)&&(void 0!==n||Ut(t.t,e)))return!0;ee(t),te(t)}return t.o[e]===n&&(void 0!==n||e in t.o)||Number.isNaN(n)&&Number.isNaN(t.o[e])||(t.o[e]=n,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==Gt(t.t,e)||e in t.t?(t.R[e]=!1,ee(t),te(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=Ft(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:i.enumerable,value:n[e]}:i},defineProperty:function(){Ct(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Ct(12)}},me={};Mt(we,(function(t,e){me[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),me.deleteProperty=function(t,e){return me.set.call(this,t,e,void 0)},me.set=function(t,e,n){return we.set.call(this,t[0],e,n,t[0])};var ge=function(){function t(t){var e=this;this.O=le,this.D=!0,this.produce=function(t,n,i){if("function"==typeof t&&"function"!=typeof n){var r=n;n=t;var o=e;return function(t){var e=this;void 0===t&&(t=r);for(var i=arguments.length,s=Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return o.produce(t,(function(t){var i;return(i=n).call.apply(i,[e,t].concat(s))}))}}var s;if("function"!=typeof n&&Ct(6),void 0!==i&&"function"!=typeof i&&Ct(7),Nt(t)){var u=Ht(e),a=ne(e,t,void 0),c=!0;try{s=n(a),c=!1}finally{c?Dt(u):zt(u)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Kt(u,i),Jt(t,u)}),(function(t){throw Dt(u),t})):(Kt(u,i),Jt(s,u))}if(!t||"object"!=typeof t){if(void 0===(s=n(t))&&(s=t),s===he&&(s=void 0),e.D&&_t(s,!0),i){var l=[],h=[];Wt("Patches").M(t,s,l,h),i(l,h)}return s}Ct(21,t)},this.produceWithPatches=function(t,n){if("function"==typeof t)return function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(r))}))};var i,r,o=e.produce(t,n,(function(t,e){i=t,r=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,i,r]})):[o,i,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){Nt(t)||Ct(8),Rt(t)&&(t=ie(t));var e=Ht(this),n=ne(this,t,void 0);return n[de].C=!0,zt(e),n},e.finishDraft=function(t,e){var n=(t&&t[de]).A;return Kt(n,e),Jt(void 0,n)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!le&&Ct(20),this.O=t},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var i=e[n];if(0===i.path.length&&"replace"===i.op){t=i.value;break}}n>-1&&(e=e.slice(n+1));var r=Wt("Patches").$;return Rt(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),xe=new ge,Oe=xe.produce;function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function je(t){var e=function(t,e){if("object"!==Se(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Se(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Se(e)?e:String(e)}function Ee(t,e,n){return(e=je(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Re(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(n),!0).forEach((function(e){Ee(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ne(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}xe.produceWithPatches.bind(xe),xe.setAutoFreeze.bind(xe),xe.setUseProxies.bind(xe),xe.applyPatches.bind(xe),xe.createDraft.bind(xe),xe.finishDraft.bind(xe);var Me="function"==typeof Symbol&&Symbol.observable||"@@observable",Ae=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ue={INIT:"@@redux/INIT"+Ae(),REPLACE:"@@redux/REPLACE"+Ae(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ae()}};function ke(t,e,n){var i;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Ne(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Ne(1));return n(ke)(t,e)}if("function"!=typeof t)throw new Error(Ne(2));var r=t,o=e,s=[],u=s,a=!1;function c(){u===s&&(u=s.slice())}function l(){if(a)throw new Error(Ne(3));return o}function h(t){if("function"!=typeof t)throw new Error(Ne(4));if(a)throw new Error(Ne(5));var e=!0;return c(),u.push(t),function(){if(e){if(a)throw new Error(Ne(6));e=!1,c();var n=u.indexOf(t);u.splice(n,1),s=null}}}function f(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(Ne(7));if(void 0===t.type)throw new Error(Ne(8));if(a)throw new Error(Ne(9));try{a=!0,o=r(o,t)}finally{a=!1}for(var e=s=u,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:Ue.INIT}),(i={dispatch:f,subscribe:h,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error(Ne(10));r=t,f({type:Ue.REPLACE})}})[Me]=function(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Ne(11));function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[Me]=function(){return this},t},i}function Le(t){for(var e=Object.keys(t),n={},i=0;i<e.length;i++){var r=e[i];"function"==typeof t[r]&&(n[r]=t[r])}var o,s=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:Ue.INIT}))throw new Error(Ne(12));if(void 0===n(void 0,{type:Ue.PROBE_UNKNOWN_ACTION()}))throw new Error(Ne(13))}))}(n)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var i=!1,r={},u=0;u<s.length;u++){var a=s[u],c=n[a],l=t[a],h=c(l,e);if(void 0===h)throw e&&e.type,new Error(Ne(14));r[a]=h,i=i||h!==l}return(i=i||s.length!==Object.keys(t).length)?r:t}}function Pe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function $e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),i=function(){throw new Error(Ne(15))},r={getState:n.getState,dispatch:function(){return i.apply(void 0,arguments)}},o=e.map((function(t){return t(r)}));return i=Pe.apply(void 0,o)(n.dispatch),Re(Re({},n),{},{dispatch:i})}}}function Fe(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}var Ie=Fe();Ie.withExtraArgument=Fe;var _e,Te=Ie,Be=(_e=function(t,e){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_e(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_e(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),We=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},qe=function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t},Ke=Object.defineProperty,De=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ze=function(t,e,n){return e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Qe=function(t,e){for(var n in e||(e={}))Ve.call(e,n)&&Ze(t,n,e[n]);if(He)for(var i=0,r=He(e);i<r.length;i++){n=r[i];Je.call(e,n)&&Ze(t,n,e[n])}return t},Xe=function(t,e){return De(t,ze(e))},Ge="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Pe:Pe.apply(null,arguments)};var Ye=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Be(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,qe([void 0],t[0].concat(this)))):new(e.bind.apply(e,qe([void 0],t.concat(this))))},e}(Array),tn=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Be(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,qe([void 0],t[0].concat(this)))):new(e.bind.apply(e,qe([void 0],t.concat(this))))},e}(Array);function en(t){return Nt(t)?Oe(t,(function(){})):t}function nn(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e;t.immutableCheck,t.serializableCheck;var i=new Ye;n&&(!function(t){return"boolean"==typeof t}(n)?i.push(Te.withExtraArgument(n.extraArgument)):i.push(Te));return i}(t)}}function rn(t){var e,n=nn(),i=t||{},r=i.reducer,o=void 0===r?void 0:r,s=i.middleware,u=void 0===s?n():s,a=i.devTools,c=void 0===a||a,l=i.preloadedState,h=void 0===l?void 0:l,f=i.enhancers,d=void 0===f?void 0:f;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=Le(o)}var v=u;"function"==typeof v&&(v=v(n));var p=$e.apply(void 0,v),b=Pe;c&&(b=Ge(Qe({trace:!1},"object"==typeof c&&c)));var y=new tn(p),w=y;return Array.isArray(d)?w=qe([p],d):"function"==typeof d&&(w=d(y)),ke(e,h,b.apply(void 0,w))}function on(t,e){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var r=e.apply(void 0,n);if(!r)throw new Error("prepareAction did not return an object");return Qe(Qe({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:n[0]}}return n.toString=function(){return""+t},n.type=t,n.match=function(e){return e.type===t},n}function sn(t){var e,n={},i=[],r={addCase:function(t,e){var i="string"==typeof t?t:t.type;if(i in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[i]=e,r},addMatcher:function(t,e){return i.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[n,i,e]}function un(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,i="function"==typeof t.initialState?t.initialState:en(t.initialState),r=t.reducers||{},o=Object.keys(r),s={},u={},a={};function c(){var e="function"==typeof t.extraReducers?sn(t.extraReducers):[t.extraReducers],n=e[0],r=void 0===n?{}:n,o=e[1],s=void 0===o?[]:o,a=e[2],c=void 0===a?void 0:a,l=Qe(Qe({},r),u);return function(t,e,n,i){void 0===n&&(n=[]);var r,o="function"==typeof e?sn(e):[e,n,i],s=o[0],u=o[1],a=o[2];if(function(t){return"function"==typeof t}(t))r=function(){return en(t())};else{var c=en(t);r=function(){return c}}function l(t,e){void 0===t&&(t=r());var n=qe([s[e.type]],u.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return!!t})).length&&(n=[a]),n.reduce((function(t,n){if(n){var i;if(Rt(t))return void 0===(i=n(t,e))?t:i;if(Nt(t))return Oe(t,(function(t){return n(t,e)}));if(void 0===(i=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return t}),t)}return l.getInitialState=r,l}(i,(function(t){for(var e in l)t.addCase(e,l[e]);for(var n=0,i=s;n<i.length;n++){var r=i[n];t.addMatcher(r.matcher,r.reducer)}c&&t.addDefaultCase(c)}))}return o.forEach((function(t){var n,i,o=r[t],c=e+"/"+t;"reducer"in o?(n=o.reducer,i=o.prepare):n=o,s[t]=n,u[c]=n,a[t]=i?on(c,i):on(c)})),{name:e,reducer:function(t,e){return n||(n=c()),n(t,e)},actions:a,caseReducers:s,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}var an=["name","message","stack","code"],cn=function(t,e){this.payload=t,this.meta=e},ln=function(t,e){this.payload=t,this.meta=e},hn=function(t){if("object"==typeof t&&null!==t){for(var e={},n=0,i=an;n<i.length;n++){var r=i[n];"string"==typeof t[r]&&(e[r]=t[r])}return e}return{message:String(t)}};function fn(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,n){var i=on(t+"/fulfilled",(function(t,e,n,i){return{payload:t,meta:Xe(Qe({},i||{}),{arg:n,requestId:e,requestStatus:"fulfilled"})}})),r=on(t+"/pending",(function(t,e,n){return{payload:void 0,meta:Xe(Qe({},n||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),o=on(t+"/rejected",(function(t,e,i,r,o){return{payload:r,error:(n&&n.serializeError||hn)(t||"Rejected"),meta:Xe(Qe({},o||{}),{arg:i,requestId:e,rejectedWithValue:!!r,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),s="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(u,a,c){var l,h=(null==n?void 0:n.idGenerator)?n.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",n=t;n--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),f=new s;function d(t){l=t,f.abort()}var v=function(){return s=this,v=null,p=function(){var s,v,p,b,y,w;return We(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),b=null==(s=null==n?void 0:n.condition)?void 0:s.call(n,t,{getState:a,extra:c}),null===(g=b)||"object"!=typeof g||"function"!=typeof g.then?[3,2]:[4,b];case 1:b=m.sent(),m.label=2;case 2:if(!1===b||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return y=new Promise((function(t,e){return f.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:l||"Aborted"})}))})),u(r(h,t,null==(v=null==n?void 0:n.getPendingMeta)?void 0:v.call(n,{requestId:h,arg:t},{getState:a,extra:c}))),[4,Promise.race([y,Promise.resolve(e(t,{dispatch:u,getState:a,extra:c,requestId:h,signal:f.signal,abort:d,rejectWithValue:function(t,e){return new cn(t,e)},fulfillWithValue:function(t,e){return new ln(t,e)}})).then((function(e){if(e instanceof cn)throw e;return e instanceof ln?i(e.payload,h,t,e.meta):i(e,h,t)}))])];case 3:return p=m.sent(),[3,5];case 4:return w=m.sent(),p=w instanceof cn?o(null,h,t,w.payload,w.meta):o(w,h,t),[3,5];case 5:return n&&!n.dispatchConditionRejection&&o.match(p)&&p.meta.condition||u(p),[2,p]}var g}))},new Promise((function(t,e){var n=function(t){try{r(p.next(t))}catch(t){e(t)}},i=function(t){try{r(p.throw(t))}catch(t){e(t)}},r=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(n,i)};r((p=p.apply(s,v)).next())}));var s,v,p}();return Object.assign(v,{abort:d,requestId:h,arg:t,unwrap:function(){return v.then(fn)}})}}),{pending:r,rejected:o,fulfilled:i,typePrefix:t})}t.withTypes=function(){return t}}();var dn,vn,pn="listenerMiddleware";on(pn+"/add"),on(pn+"/removeAll"),on(pn+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var n=r[t];return n?n.enumerable=e:r[t]=n={configurable:!0,enumerable:e,get:function(){var e=this[de];return we.get(e,t)},set:function(e){var n=this[de];we.set(n,t,e)}},n}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][de];if(!r.P)switch(r.i){case 5:i(r)&&te(r);break;case 4:n(r)&&te(r)}}}function n(t){for(var e=t.t,n=t.k,i=pe(n),r=i.length-1;r>=0;r--){var o=i[r];if(o!==de){var s=e[o];if(void 0===s&&!Ut(e,o))return!0;var u=n[o],a=u&&u[de];if(a?a.t!==s:!Lt(u,s))return!0}}var c=!!e[de];return i.length!==pe(e).length+(c?0:1)}function i(t){var e=t.k;if(e.length!==t.t.length)return!0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);if(n&&!n.get)return!0;for(var i=0;i<e.length;i++)if(!e.hasOwnProperty(i))return!0;return!1}var r={};!function(t,e){ye[t]||(ye[t]=e)}("ES5",{J:function(e,n){var i=Array.isArray(e),r=function(e,n){if(e){for(var i=Array(n.length),r=0;r<n.length;r++)Object.defineProperty(i,""+r,t(r,!0));return i}var o=be(n);delete o[de];for(var s=pe(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,e||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(i,e),o={i:i?5:4,A:n?n.A:qt(),P:!1,I:!1,R:{},l:n,t:e,k:r,o:null,g:!1,C:!1};return Object.defineProperty(r,de,{value:o,writable:!0}),r},S:function(t,n,r){r?Rt(n)&&n[de].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[de];if(n){var r=n.t,o=n.k,s=n.R,u=n.i;if(4===u)Mt(o,(function(e){e!==de&&(void 0!==r[e]||Ut(r,e)?s[e]||t(o[e]):(s[e]=!0,te(n)))})),Mt(r,(function(t){void 0!==o[t]||Ut(o,t)||(s[t]=!1,te(n))}));else if(5===u){if(i(n)&&(te(n),s.length=!0),o.length<r.length)for(var a=o.length;a<r.length;a++)s[a]=!1;else for(var c=r.length;c<o.length;c++)s[c]=!0;for(var l=Math.min(o.length,r.length),h=0;h<l;h++)o.hasOwnProperty(h)||(s[h]=!0),void 0===s[h]&&t(o[h])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?n(t):i(t)}})}();const bn=t=>{const e=null!=t?t:{};return(t,n)=>{var i;const r={hasChanged:(t,e)=>!c(t,e),attribute:!1,...e};s(r)(t,n);const o=t;o.reduxProperties=o.reduxProperties||new Map,o.reduxProperties.set(n,{selector:null!==(i=e.selector)&&void 0!==i?i:t=>t[n],store:e.store})}},yn=Symbol("internalStoresUnsubscribers"),wn=Symbol("internalStores");class mn extends jt{constructor(){super(...arguments),this[dn]=new Map,this[vn]=new Map}getUnnamedStore(){if(this[wn].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[wn].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[wn].get(t)}addStore(t,e){e=null!=e?e:t.name,this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[wn].delete(e)}setupStore(t,e){this[wn].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[wn].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const n=this.constructor.getPropertyOptions(e);if(!(null==n?void 0:n.attribute)||!this.hasAttribute("string"==typeof(null==n?void 0:n.attribute)?n.attribute:e)){const n=this.getStore(t.store);n&&(this[e]=t.selector(n.getState(),this))}}))}subscribeToStore(t,e){this[yn].set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this[yn]).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this[yn].has(t)&&this[yn].get(t)(),this[yn].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}dn=yn,vn=wn;class gn{static get(t){window.ftReduxStores||(window.ftReduxStores={});const e="string"==typeof t?t:t.name,n="string"==typeof t?void 0:t,i=window.ftReduxStores[e];if(function(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}(i))return i;if(null==n)return;const r=un(n),o=rn({reducer:r.reducer});return window.ftReduxStores[n.name]=new gn(r,o)}constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,n)=>{const i=t[e];if(i)return(...t)=>{const e=i(...t);return this.reduxStore.dispatch(e),e}}})}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(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}var xn,On;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(On=null===(xn=window.safari)||void 0===xn?void 0:xn.pushNotification)||void 0===On||On.toString());const Sn=m`
87
- `,jn={setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}},En=m`
88
- `,Cn=gn.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Rn{static build(t){const{baseUrl:e,apiIntegrationIdentifier:n}=Cn.getState(),i=null!=t?t:n;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?Rn.build(t):null!==(e=Rn.API)&&void 0!==e?e:Rn.API=Rn.build()}static await(t){return new Promise((e=>{let n=Rn.get(t);if(n)e(n);else{const i=Cn.subscribe((()=>{n=Rn.get(t),n&&(i(),e(n))}))}}))}}var Nn;const Mn=Symbol("clearAfterUnitTest");class An{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i,this.listeners={},this.currentUiLocale="",this[Nn]=()=>{this.defaultMessages={},this.cache=new i,this.listeners={}},this.currentUiLocale=Cn.getState().uiLocale,Cn.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Cn.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var n;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},...e};c(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...n){var i,r,o;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new Et(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},s).resolve(e,...n)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var n;return t=t.toLowerCase(),this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,this.listeners[t].add(e),()=>{var n;return null===(n=this.listeners[t])||void 0===n?void 0:n.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>f(0).then((()=>t())).catch((()=>null)))))}}Nn=Mn,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new An((async(t,e)=>(await Rn.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new An((async(t,e)=>(await Rn.await()).getCustomMessageContext(t,e))));const Un=window.FluidTopicsI18nService;var kn=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class Ln extends jt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Rn.get(),this.cache=new i,this.cleanSessionDebouncer=new r}render(){return X`
86
+ `;class Et{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var n,i;t=this.resolvePluralKey(t,e);let r=null!==(i=null!==(n=this.labels[t])&&void 0!==n?n:this.defaultLabels[t])&&void 0!==i?i:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,n)=>this.formatValue(t,n))))),r}resolvePluralKey(t,e){for(let n of e)if("number"==typeof n){const e=`${String(t)}[\\=${n}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const n=n=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(n):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(n):t.toLocaleString(n);try{return n(document.documentElement.lang)}catch(t){return n()}}}function Ct(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Nt(t){return!!t&&!!t[de]}function Rt(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ve}(t)||Array.isArray(t)||!!t[fe]||!!(null===(e=t.constructor)||void 0===e?void 0:e[fe])||Pt(t)||$t(t))}function Mt(t,e,n){void 0===n&&(n=!1),0===At(t)?(n?Object.keys:pe)(t).forEach((function(i){n&&"symbol"==typeof i||e(i,t[i],t)})):t.forEach((function(n,i){return e(i,n,t)}))}function At(t){var e=t[de];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Pt(t)?2:$t(t)?3:0}function Ut(t,e){return 2===At(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function kt(t,e,n){var i=At(t);2===i?t.set(e,n):3===i?t.add(n):t[e]=n}function Lt(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Pt(t){return ae&&t instanceof Map}function $t(t){return ce&&t instanceof Set}function Ft(t){return t.o||t.t}function It(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=be(t);delete e[de];for(var n=pe(e),i=0;i<n.length;i++){var r=n[i],o=e[r];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function _t(t,e){return void 0===e&&(e=!1),Bt(t)||Nt(t)||!Rt(t)||(At(t)>1&&(t.set=t.add=t.clear=t.delete=Tt),Object.freeze(t),e&&Mt(t,(function(t,e){return _t(e,!0)}),!0)),t}function Tt(){Ct(2)}function Bt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function Wt(t){var e=ye[t];return e||Ct(18,t),e}function qt(){return se}function Kt(t,e){e&&(Wt("Patches"),t.u=[],t.s=[],t.v=e)}function Dt(t){zt(t),t.p.forEach(Vt),t.p=null}function zt(t){t===se&&(se=t.l)}function Ht(t){return se={p:[],l:se,h:t,m:!0,_:0}}function Vt(t){var e=t[de];0===e.i||1===e.i?e.j():e.g=!0}function Jt(t,e){e._=e.p.length;var n=e.p[0],i=void 0!==t&&t!==n;return e.h.O||Wt("ES5").S(e,t,i),i?(n[de].P&&(Dt(e),Ct(4)),Rt(t)&&(t=Zt(e,t),e.l||Xt(e,t)),e.u&&Wt("Patches").M(n[de].t,t,e.u,e.s)):t=Zt(e,n,[]),Dt(e),e.u&&e.v(e.u,e.s),t!==he?t:void 0}function Zt(t,e,n){if(Bt(e))return e;var i=e[de];if(!i)return Mt(e,(function(r,o){return Qt(t,i,e,r,o,n)}),!0),e;if(i.A!==t)return e;if(!i.P)return Xt(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=4===i.i||5===i.i?i.o=It(i.k):i.o,o=r,s=!1;3===i.i&&(o=new Set(r),r.clear(),s=!0),Mt(o,(function(e,o){return Qt(t,i,r,e,o,n,s)})),Xt(t,r,!1),n&&t.u&&Wt("Patches").N(i,n,t.u,t.s)}return i.o}function Qt(t,e,n,i,r,o,s){if(Nt(r)){var u=Zt(t,r,o&&e&&3!==e.i&&!Ut(e.R,i)?o.concat(i):void 0);if(kt(n,i,u),!Nt(u))return;t.m=!1}else s&&n.add(r);if(Rt(r)&&!Bt(r)){if(!t.h.D&&t._<1)return;Zt(t,r),e&&e.A.l||Xt(t,r)}}function Xt(t,e,n){void 0===n&&(n=!1),!t.l&&t.h.D&&t.m&&_t(e,n)}function Gt(t,e){var n=t[de];return(n?Ft(n):t)[e]}function Yt(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function te(t){t.P||(t.P=!0,t.l&&te(t.l))}function ee(t){t.o||(t.o=It(t.t))}function ne(t,e,n){var i=Pt(e)?Wt("MapSet").F(e,n):$t(e)?Wt("MapSet").T(e,n):t.O?function(t,e){var n=Array.isArray(t),i={i:n?1:0,A:e?e.A:qt(),P:!1,I:!1,R:{},l:e,t,k:null,o:null,j:null,C:!1},r=i,o=we;n&&(r=[i],o=me);var s=Proxy.revocable(r,o),u=s.revoke,a=s.proxy;return i.k=a,i.j=u,a}(e,n):Wt("ES5").J(e,n);return(n?n.A:qt()).p.push(i),i}function ie(t){return Nt(t)||Ct(22,t),function t(e){if(!Rt(e))return e;var n,i=e[de],r=At(e);if(i){if(!i.P&&(i.i<4||!Wt("ES5").K(i)))return i.t;i.I=!0,n=re(e,r),i.I=!1}else n=re(e,r);return Mt(n,(function(e,r){i&&function(t,e){return 2===At(t)?t.get(e):t[e]}(i.t,e)===r||kt(n,e,t(r))})),3===r?new Set(n):n}(t)}function re(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return It(t)}var oe,se,ue="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),ae="undefined"!=typeof Map,ce="undefined"!=typeof Set,le="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,he=ue?Symbol.for("immer-nothing"):((oe={})["immer-nothing"]=!0,oe),fe=ue?Symbol.for("immer-draftable"):"__$immer_draftable",de=ue?Symbol.for("immer-state"):"__$immer_state",ve=""+Object.prototype.constructor,pe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,be=Object.getOwnPropertyDescriptors||function(t){var e={};return pe(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)})),e},ye={},we={get:function(t,e){if(e===de)return t;var n=Ft(t);if(!Ut(n,e))return function(t,e,n){var i,r=Yt(e,n);return r?"value"in r?r.value:null===(i=r.get)||void 0===i?void 0:i.call(t.k):void 0}(t,n,e);var i=n[e];return t.I||!Rt(i)?i:i===Gt(t.t,e)?(ee(t),t.o[e]=ne(t.A.h,i,t)):i},has:function(t,e){return e in Ft(t)},ownKeys:function(t){return Reflect.ownKeys(Ft(t))},set:function(t,e,n){var i=Yt(Ft(t),e);if(null==i?void 0:i.set)return i.set.call(t.k,n),!0;if(!t.P){var r=Gt(Ft(t),e),o=null==r?void 0:r[de];if(o&&o.t===n)return t.o[e]=n,t.R[e]=!1,!0;if(Lt(n,r)&&(void 0!==n||Ut(t.t,e)))return!0;ee(t),te(t)}return t.o[e]===n&&(void 0!==n||e in t.o)||Number.isNaN(n)&&Number.isNaN(t.o[e])||(t.o[e]=n,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==Gt(t.t,e)||e in t.t?(t.R[e]=!1,ee(t),te(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=Ft(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:i.enumerable,value:n[e]}:i},defineProperty:function(){Ct(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Ct(12)}},me={};Mt(we,(function(t,e){me[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),me.deleteProperty=function(t,e){return me.set.call(this,t,e,void 0)},me.set=function(t,e,n){return we.set.call(this,t[0],e,n,t[0])};var ge=function(){function t(t){var e=this;this.O=le,this.D=!0,this.produce=function(t,n,i){if("function"==typeof t&&"function"!=typeof n){var r=n;n=t;var o=e;return function(t){var e=this;void 0===t&&(t=r);for(var i=arguments.length,s=Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return o.produce(t,(function(t){var i;return(i=n).call.apply(i,[e,t].concat(s))}))}}var s;if("function"!=typeof n&&Ct(6),void 0!==i&&"function"!=typeof i&&Ct(7),Rt(t)){var u=Ht(e),a=ne(e,t,void 0),c=!0;try{s=n(a),c=!1}finally{c?Dt(u):zt(u)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Kt(u,i),Jt(t,u)}),(function(t){throw Dt(u),t})):(Kt(u,i),Jt(s,u))}if(!t||"object"!=typeof t){if(void 0===(s=n(t))&&(s=t),s===he&&(s=void 0),e.D&&_t(s,!0),i){var l=[],h=[];Wt("Patches").M(t,s,l,h),i(l,h)}return s}Ct(21,t)},this.produceWithPatches=function(t,n){if("function"==typeof t)return function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(r))}))};var i,r,o=e.produce(t,n,(function(t,e){i=t,r=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,i,r]})):[o,i,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){Rt(t)||Ct(8),Nt(t)&&(t=ie(t));var e=Ht(this),n=ne(this,t,void 0);return n[de].C=!0,zt(e),n},e.finishDraft=function(t,e){var n=(t&&t[de]).A;return Kt(n,e),Jt(void 0,n)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!le&&Ct(20),this.O=t},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var i=e[n];if(0===i.path.length&&"replace"===i.op){t=i.value;break}}n>-1&&(e=e.slice(n+1));var r=Wt("Patches").$;return Nt(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),xe=new ge,Oe=xe.produce;function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function je(t){var e=function(t,e){if("object"!==Se(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Se(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Se(e)?e:String(e)}function Ee(t,e,n){return(e=je(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(n),!0).forEach((function(e){Ee(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Re(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}xe.produceWithPatches.bind(xe),xe.setAutoFreeze.bind(xe),xe.setUseProxies.bind(xe),xe.applyPatches.bind(xe),xe.createDraft.bind(xe),xe.finishDraft.bind(xe);var Me="function"==typeof Symbol&&Symbol.observable||"@@observable",Ae=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ue={INIT:"@@redux/INIT"+Ae(),REPLACE:"@@redux/REPLACE"+Ae(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ae()}};function ke(t,e,n){var i;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Re(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Re(1));return n(ke)(t,e)}if("function"!=typeof t)throw new Error(Re(2));var r=t,o=e,s=[],u=s,a=!1;function c(){u===s&&(u=s.slice())}function l(){if(a)throw new Error(Re(3));return o}function h(t){if("function"!=typeof t)throw new Error(Re(4));if(a)throw new Error(Re(5));var e=!0;return c(),u.push(t),function(){if(e){if(a)throw new Error(Re(6));e=!1,c();var n=u.indexOf(t);u.splice(n,1),s=null}}}function f(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(Re(7));if(void 0===t.type)throw new Error(Re(8));if(a)throw new Error(Re(9));try{a=!0,o=r(o,t)}finally{a=!1}for(var e=s=u,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:Ue.INIT}),(i={dispatch:f,subscribe:h,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error(Re(10));r=t,f({type:Ue.REPLACE})}})[Me]=function(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Re(11));function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[Me]=function(){return this},t},i}function Le(t){for(var e=Object.keys(t),n={},i=0;i<e.length;i++){var r=e[i];"function"==typeof t[r]&&(n[r]=t[r])}var o,s=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:Ue.INIT}))throw new Error(Re(12));if(void 0===n(void 0,{type:Ue.PROBE_UNKNOWN_ACTION()}))throw new Error(Re(13))}))}(n)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var i=!1,r={},u=0;u<s.length;u++){var a=s[u],c=n[a],l=t[a],h=c(l,e);if(void 0===h)throw e&&e.type,new Error(Re(14));r[a]=h,i=i||h!==l}return(i=i||s.length!==Object.keys(t).length)?r:t}}function Pe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function $e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),i=function(){throw new Error(Re(15))},r={getState:n.getState,dispatch:function(){return i.apply(void 0,arguments)}},o=e.map((function(t){return t(r)}));return i=Pe.apply(void 0,o)(n.dispatch),Ne(Ne({},n),{},{dispatch:i})}}}function Fe(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}var Ie=Fe();Ie.withExtraArgument=Fe;var _e,Te=Ie,Be=(_e=function(t,e){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_e(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_e(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),We=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},qe=function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t},Ke=Object.defineProperty,De=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ze=function(t,e,n){return e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Qe=function(t,e){for(var n in e||(e={}))Ve.call(e,n)&&Ze(t,n,e[n]);if(He)for(var i=0,r=He(e);i<r.length;i++){n=r[i];Je.call(e,n)&&Ze(t,n,e[n])}return t},Xe=function(t,e){return De(t,ze(e))},Ge="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Pe:Pe.apply(null,arguments)};var Ye=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Be(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,qe([void 0],t[0].concat(this)))):new(e.bind.apply(e,qe([void 0],t.concat(this))))},e}(Array),tn=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Be(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,qe([void 0],t[0].concat(this)))):new(e.bind.apply(e,qe([void 0],t.concat(this))))},e}(Array);function en(t){return Rt(t)?Oe(t,(function(){})):t}function nn(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e;t.immutableCheck,t.serializableCheck;var i=new Ye;n&&(!function(t){return"boolean"==typeof t}(n)?i.push(Te.withExtraArgument(n.extraArgument)):i.push(Te));return i}(t)}}function rn(t){var e,n=nn(),i=t||{},r=i.reducer,o=void 0===r?void 0:r,s=i.middleware,u=void 0===s?n():s,a=i.devTools,c=void 0===a||a,l=i.preloadedState,h=void 0===l?void 0:l,f=i.enhancers,d=void 0===f?void 0:f;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=Le(o)}var v=u;"function"==typeof v&&(v=v(n));var p=$e.apply(void 0,v),b=Pe;c&&(b=Ge(Qe({trace:!1},"object"==typeof c&&c)));var y=new tn(p),w=y;return Array.isArray(d)?w=qe([p],d):"function"==typeof d&&(w=d(y)),ke(e,h,b.apply(void 0,w))}function on(t,e){function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var r=e.apply(void 0,n);if(!r)throw new Error("prepareAction did not return an object");return Qe(Qe({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:n[0]}}return n.toString=function(){return""+t},n.type=t,n.match=function(e){return e.type===t},n}function sn(t){var e,n={},i=[],r={addCase:function(t,e){var i="string"==typeof t?t:t.type;if(i in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[i]=e,r},addMatcher:function(t,e){return i.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[n,i,e]}function un(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,i="function"==typeof t.initialState?t.initialState:en(t.initialState),r=t.reducers||{},o=Object.keys(r),s={},u={},a={};function c(){var e="function"==typeof t.extraReducers?sn(t.extraReducers):[t.extraReducers],n=e[0],r=void 0===n?{}:n,o=e[1],s=void 0===o?[]:o,a=e[2],c=void 0===a?void 0:a,l=Qe(Qe({},r),u);return function(t,e,n,i){void 0===n&&(n=[]);var r,o="function"==typeof e?sn(e):[e,n,i],s=o[0],u=o[1],a=o[2];if(function(t){return"function"==typeof t}(t))r=function(){return en(t())};else{var c=en(t);r=function(){return c}}function l(t,e){void 0===t&&(t=r());var n=qe([s[e.type]],u.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return!!t})).length&&(n=[a]),n.reduce((function(t,n){if(n){var i;if(Nt(t))return void 0===(i=n(t,e))?t:i;if(Rt(t))return Oe(t,(function(t){return n(t,e)}));if(void 0===(i=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return t}),t)}return l.getInitialState=r,l}(i,(function(t){for(var e in l)t.addCase(e,l[e]);for(var n=0,i=s;n<i.length;n++){var r=i[n];t.addMatcher(r.matcher,r.reducer)}c&&t.addDefaultCase(c)}))}return o.forEach((function(t){var n,i,o=r[t],c=e+"/"+t;"reducer"in o?(n=o.reducer,i=o.prepare):n=o,s[t]=n,u[c]=n,a[t]=i?on(c,i):on(c)})),{name:e,reducer:function(t,e){return n||(n=c()),n(t,e)},actions:a,caseReducers:s,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}var an=["name","message","stack","code"],cn=function(t,e){this.payload=t,this.meta=e},ln=function(t,e){this.payload=t,this.meta=e},hn=function(t){if("object"==typeof t&&null!==t){for(var e={},n=0,i=an;n<i.length;n++){var r=i[n];"string"==typeof t[r]&&(e[r]=t[r])}return e}return{message:String(t)}};function fn(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,n){var i=on(t+"/fulfilled",(function(t,e,n,i){return{payload:t,meta:Xe(Qe({},i||{}),{arg:n,requestId:e,requestStatus:"fulfilled"})}})),r=on(t+"/pending",(function(t,e,n){return{payload:void 0,meta:Xe(Qe({},n||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),o=on(t+"/rejected",(function(t,e,i,r,o){return{payload:r,error:(n&&n.serializeError||hn)(t||"Rejected"),meta:Xe(Qe({},o||{}),{arg:i,requestId:e,rejectedWithValue:!!r,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),s="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(u,a,c){var l,h=(null==n?void 0:n.idGenerator)?n.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",n=t;n--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),f=new s;function d(t){l=t,f.abort()}var v=function(){return s=this,v=null,p=function(){var s,v,p,b,y,w;return We(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),b=null==(s=null==n?void 0:n.condition)?void 0:s.call(n,t,{getState:a,extra:c}),null===(g=b)||"object"!=typeof g||"function"!=typeof g.then?[3,2]:[4,b];case 1:b=m.sent(),m.label=2;case 2:if(!1===b||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return y=new Promise((function(t,e){return f.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:l||"Aborted"})}))})),u(r(h,t,null==(v=null==n?void 0:n.getPendingMeta)?void 0:v.call(n,{requestId:h,arg:t},{getState:a,extra:c}))),[4,Promise.race([y,Promise.resolve(e(t,{dispatch:u,getState:a,extra:c,requestId:h,signal:f.signal,abort:d,rejectWithValue:function(t,e){return new cn(t,e)},fulfillWithValue:function(t,e){return new ln(t,e)}})).then((function(e){if(e instanceof cn)throw e;return e instanceof ln?i(e.payload,h,t,e.meta):i(e,h,t)}))])];case 3:return p=m.sent(),[3,5];case 4:return w=m.sent(),p=w instanceof cn?o(null,h,t,w.payload,w.meta):o(w,h,t),[3,5];case 5:return n&&!n.dispatchConditionRejection&&o.match(p)&&p.meta.condition||u(p),[2,p]}var g}))},new Promise((function(t,e){var n=function(t){try{r(p.next(t))}catch(t){e(t)}},i=function(t){try{r(p.throw(t))}catch(t){e(t)}},r=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(n,i)};r((p=p.apply(s,v)).next())}));var s,v,p}();return Object.assign(v,{abort:d,requestId:h,arg:t,unwrap:function(){return v.then(fn)}})}}),{pending:r,rejected:o,fulfilled:i,typePrefix:t})}t.withTypes=function(){return t}}();var dn,vn,pn="listenerMiddleware";on(pn+"/add"),on(pn+"/removeAll"),on(pn+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var n=r[t];return n?n.enumerable=e:r[t]=n={configurable:!0,enumerable:e,get:function(){var e=this[de];return we.get(e,t)},set:function(e){var n=this[de];we.set(n,t,e)}},n}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][de];if(!r.P)switch(r.i){case 5:i(r)&&te(r);break;case 4:n(r)&&te(r)}}}function n(t){for(var e=t.t,n=t.k,i=pe(n),r=i.length-1;r>=0;r--){var o=i[r];if(o!==de){var s=e[o];if(void 0===s&&!Ut(e,o))return!0;var u=n[o],a=u&&u[de];if(a?a.t!==s:!Lt(u,s))return!0}}var c=!!e[de];return i.length!==pe(e).length+(c?0:1)}function i(t){var e=t.k;if(e.length!==t.t.length)return!0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);if(n&&!n.get)return!0;for(var i=0;i<e.length;i++)if(!e.hasOwnProperty(i))return!0;return!1}var r={};!function(t,e){ye[t]||(ye[t]=e)}("ES5",{J:function(e,n){var i=Array.isArray(e),r=function(e,n){if(e){for(var i=Array(n.length),r=0;r<n.length;r++)Object.defineProperty(i,""+r,t(r,!0));return i}var o=be(n);delete o[de];for(var s=pe(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,e||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(i,e),o={i:i?5:4,A:n?n.A:qt(),P:!1,I:!1,R:{},l:n,t:e,k:r,o:null,g:!1,C:!1};return Object.defineProperty(r,de,{value:o,writable:!0}),r},S:function(t,n,r){r?Nt(n)&&n[de].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[de];if(n){var r=n.t,o=n.k,s=n.R,u=n.i;if(4===u)Mt(o,(function(e){e!==de&&(void 0!==r[e]||Ut(r,e)?s[e]||t(o[e]):(s[e]=!0,te(n)))})),Mt(r,(function(t){void 0!==o[t]||Ut(o,t)||(s[t]=!1,te(n))}));else if(5===u){if(i(n)&&(te(n),s.length=!0),o.length<r.length)for(var a=o.length;a<r.length;a++)s[a]=!1;else for(var c=r.length;c<o.length;c++)s[c]=!0;for(var l=Math.min(o.length,r.length),h=0;h<l;h++)o.hasOwnProperty(h)||(s[h]=!0),void 0===s[h]&&t(o[h])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?n(t):i(t)}})}();const bn=t=>{const e=null!=t?t:{};return(t,n)=>{var i;const r={hasChanged:(t,e)=>!c(t,e),attribute:!1,...e};s(r)(t,n);const o=t;o.reduxProperties=o.reduxProperties||new Map,o.reduxProperties.set(n,{selector:null!==(i=e.selector)&&void 0!==i?i:t=>t[n],store:e.store})}},yn=Symbol("internalStoresUnsubscribers"),wn=Symbol("internalStores");class mn extends jt{constructor(){super(...arguments),this[dn]=new Map,this[vn]=new Map}getUnnamedStore(){if(this[wn].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[wn].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[wn].get(t)}addStore(t,e){e=null!=e?e:gn(t)?t.name:void 0,this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[wn].delete(e)}setupStore(t,e){this[wn].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[wn].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const n=this.constructor.getPropertyOptions(e);if(!(null==n?void 0:n.attribute)||!this.hasAttribute("string"==typeof(null==n?void 0:n.attribute)?n.attribute:e)){const n=this.getStore(t.store);n&&(this[e]=t.selector(n.getState(),this))}}))}subscribeToStore(t,e){this[yn].set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this[yn]).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this[yn].has(t)&&this[yn].get(t)(),this[yn].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}function gn(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}dn=yn,vn=wn;class xn{static get(t){window.ftReduxStores||(window.ftReduxStores={});const e="string"==typeof t?t:t.name,n="string"==typeof t?void 0:t,i=window.ftReduxStores[e];if(gn(i))return i;if(null==n)return;const r=un(n),o=rn({reducer:r.reducer});return window.ftReduxStores[n.name]=new xn(r,o)}constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,n)=>{const i=t[e];if(i)return(...t)=>{const e=i(...t);return this.reduxStore.dispatch(e),e}}})}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(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}var On,Sn;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Sn=null===(On=window.safari)||void 0===On?void 0:On.pushNotification)||void 0===Sn||Sn.toString());const jn=m`
87
+ `,En={setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}},Cn=m`
88
+ `,Nn=xn.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Rn{static build(t){const{baseUrl:e,apiIntegrationIdentifier:n}=Nn.getState(),i=null!=t?t:n;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?Rn.build(t):null!==(e=Rn.API)&&void 0!==e?e:Rn.API=Rn.build()}static await(t){return new Promise((e=>{let n=Rn.get(t);if(n)e(n);else{const i=Nn.subscribe((()=>{n=Rn.get(t),n&&(i(),e(n))}))}}))}}var Mn;const An=Symbol("clearAfterUnitTest");class Un{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i,this.listeners={},this.currentUiLocale="",this[Mn]=()=>{this.defaultMessages={},this.cache=new i,this.listeners={}},this.currentUiLocale=Nn.getState().uiLocale,Nn.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Nn.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var n;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},...e};c(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...n){var i,r,o;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new Et(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},s).resolve(e,...n)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var n;return t=t.toLowerCase(),this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,this.listeners[t].add(e),()=>{var n;return null===(n=this.listeners[t])||void 0===n?void 0:n.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>f(0).then((()=>t())).catch((()=>null)))))}}Mn=An,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Un((async(t,e)=>(await Rn.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Un((async(t,e)=>(await Rn.await()).getCustomMessageContext(t,e))));const kn=window.FluidTopicsI18nService;var Ln=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class Pn extends jt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Rn.get(),this.cache=new i,this.cleanSessionDebouncer=new r}render(){return X`
89
89
  <slot></slot>
90
- `}updated(t){super.updated(t),t.has("baseUrl")&&Cn.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Cn.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Cn.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Cn.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Cn.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Cn.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Cn.actions.setSession(this.session),t.has("availableUiLocales")&&Cn.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Un.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Ln.elementDefinitions={},Ln.styles=En,kn([s()],Ln.prototype,"baseUrl",void 0),kn([s()],Ln.prototype,"apiIntegrationIdentifier",void 0),kn([s()],Ln.prototype,"uiLocale",void 0),kn([h([])],Ln.prototype,"availableUiLocales",void 0),kn([s({type:Boolean})],Ln.prototype,"editorMode",void 0),kn([s({type:Boolean})],Ln.prototype,"noCustom",void 0),kn([s({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ln.prototype,"noCustomComponent",void 0),kn([s({type:Boolean})],Ln.prototype,"withManualResources",void 0),kn([h([])],Ln.prototype,"messageContexts",void 0),kn([h(void 0)],Ln.prototype,"session",void 0),kn([s({type:Object})],Ln.prototype,"apiProvider",void 0),l("ft-app-context")(Ln);class Pn{static async build(){return new Pn(await Rn.await())}constructor(t){this.api=t,this.cache=new i,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.cache.get(`search-${this.hash(t)}`,(()=>this.api.search(t)),18e4)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}hash(t){return JSON.stringify(t).split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)|0),0)}}class $n{static build(t){return new $n((t=>gn.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},results:[],facets:[],paging:{totalResultsCount:0,totalClustersCount:0,isLastPage:!1},liveQuery:"",suggestResults:[]},reducers:jn}))(t.trim()||"context"),Pn.build)}constructor(t,e){this.store=t,this.serviceProvider=e,this.searchDebouncer=new r(10),this.suggestDebouncer=new r(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){for(;null==this.service;)await f(5);return this.service}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,n=this.store.getState().request.contentLocale;if(t!=n){if(e){const i=t=>e.some((e=>e.lang===t));i(t)||(t=i(n)?n:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.store.actions.setPageNumber(1),this.launchSearch()}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let n=this.facetIds.filter((e=>e!=t));e&&n.push(e),this.facetIds=n,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let n=this.store.getState().request.filters,i={key:t,values:e,negative:!1},r=[...n.filter((e=>e.key!==t)),i];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async launchSearch(){await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){try{let t=await this.service.launchSearch(this.store.getState().request);if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.isLastPage});else{let e=this.store.getState().results.concat(t.results);this.store.actions.setResults(e),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.isLastPage})}}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},e=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(e.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var Fn=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class In extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const _n=Symbol("registerInterval");class Tn extends(function(t){var e;class n extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[_n]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[_n]):this.dispatchEvent(new In)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=_n,Fn([u()],n.prototype,"stateManager",void 0),n}(mn)){}var Bn=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class Wn extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class qn extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Kn extends mn{get stateManager(){return null==this._stateManager&&(this._stateManager=$n.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.contentLocale="en-US",this.pageSize=20,this.filters=[],this.sort=[],this.addStore(Cn)}render(){return X`
90
+ `}updated(t){super.updated(t),t.has("baseUrl")&&Nn.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Nn.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Nn.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Nn.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Nn.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Nn.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Nn.actions.setSession(this.session),t.has("availableUiLocales")&&Nn.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>kn.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Pn.elementDefinitions={},Pn.styles=Cn,Ln([s()],Pn.prototype,"baseUrl",void 0),Ln([s()],Pn.prototype,"apiIntegrationIdentifier",void 0),Ln([s()],Pn.prototype,"uiLocale",void 0),Ln([h([])],Pn.prototype,"availableUiLocales",void 0),Ln([s({type:Boolean})],Pn.prototype,"editorMode",void 0),Ln([s({type:Boolean})],Pn.prototype,"noCustom",void 0),Ln([s({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Pn.prototype,"noCustomComponent",void 0),Ln([s({type:Boolean})],Pn.prototype,"withManualResources",void 0),Ln([h([])],Pn.prototype,"messageContexts",void 0),Ln([h(void 0)],Pn.prototype,"session",void 0),Ln([s({type:Object})],Pn.prototype,"apiProvider",void 0),l("ft-app-context")(Pn);class $n{static async build(){return new $n(await Rn.await())}constructor(t){this.api=t,this.cache=new i,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.cache.get(`search-${this.hash(t)}`,(()=>this.api.search(t)),18e4)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}hash(t){return JSON.stringify(t).split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)|0),0)}}class Fn{static build(t){return new Fn((t=>xn.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:En}))(t.trim()||"context"),$n.build)}constructor(t,e){this.store=t,this.serviceProvider=e,this.searchDebouncer=new r(10),this.suggestDebouncer=new r(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){for(;null==this.service;)await f(5);return this.service}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,n=this.store.getState().request.contentLocale;if(t!=n){if(e){const i=t=>e.some((e=>e.lang===t));i(t)||(t=i(n)?n:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.store.actions.setPageNumber(1),this.launchSearch()}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let n=this.facetIds.filter((e=>e!=t));e&&n.push(e),this.facetIds=n,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let n=this.store.getState().request.filters,i={key:t,values:e,negative:!1},r=[...n.filter((e=>e.key!==t)),i];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async launchSearch(){return await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t;try{let e=await this.service.launchSearch(this.store.getState().request);if(e.paging.currentPage<=1)this.store.actions.setResults(e.results),this.store.actions.setFacets(e.facets);else{let n=(null!==(t=this.store.getState().results)&&void 0!==t?t:[]).concat(e.results);this.store.actions.setResults(n)}this.store.actions.setPaging(e.paging)}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},e=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(e.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var In=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class _n extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Tn=Symbol("registerInterval");class Bn extends(function(t){var e;class n extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Tn]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Tn]):this.dispatchEvent(new _n)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Tn,In([u()],n.prototype,"stateManager",void 0),n}(mn)){}var Wn=function(t,e,n,i){for(var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class qn extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class Kn extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Dn extends mn{get stateManager(){return null==this._stateManager&&(this._stateManager=Fn.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.contentLocale="en-US",this.pageSize=20,this.filters=[],this.sort=[],this.addStore(Nn)}render(){return X`
91
91
  <slot @register-ft-search-component=${this.registerComponent}></slot>
92
- `}updated(t){super.updated(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new qn(this.request))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Wn(t))}}Kn.elementDefinitions={},Kn.styles=Sn,Bn([s()],Kn.prototype,"query",void 0),Bn([s()],Kn.prototype,"contentLocale",void 0),Bn([s({type:Number})],Kn.prototype,"pageSize",void 0),Bn([h([])],Kn.prototype,"filters",void 0),Bn([h([])],Kn.prototype,"sort",void 0),Bn([bn({store:"search"})],Kn.prototype,"request",void 0),Bn([bn({store:Cn.name})],Kn.prototype,"session",void 0),l("ft-search-context")(Kn),t.FtSearchContext=Kn,t.FtSearchContextCssVariables={},t.LoadErrorEvent=Wn,t.SearchRequestChangeEvent=qn,t.styles=Sn}({});
92
+ `}updated(t){super.updated(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Kn(this.request))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new qn(t))}}Dn.elementDefinitions={},Dn.styles=jn,Wn([s()],Dn.prototype,"query",void 0),Wn([s()],Dn.prototype,"contentLocale",void 0),Wn([s({type:Number})],Dn.prototype,"pageSize",void 0),Wn([h([])],Dn.prototype,"filters",void 0),Wn([h([])],Dn.prototype,"sort",void 0),Wn([bn({store:"search"})],Dn.prototype,"request",void 0),Wn([bn({store:Nn.name})],Dn.prototype,"session",void 0),l("ft-search-context")(Dn),t.FtSearchContext=Dn,t.FtSearchContextCssVariables={},t.LoadErrorEvent=qn,t.SearchRequestChangeEvent=Kn,t.styles=jn}({});
@@ -10,7 +10,7 @@ export declare class FtSearchStateManager {
10
10
  service?: FtSearchService;
11
11
  errorHandler?: (e: Error) => void;
12
12
  constructor(store: FtReduxStore<FtSearchPageState, FtSearchPageStateReducers>, serviceProvider: () => Promise<FtSearchService>);
13
- initService(): Promise<void>;
13
+ initService(): Promise<boolean>;
14
14
  awaitService(): Promise<FtSearchService>;
15
15
  setQuery(query: string): void;
16
16
  setContentLocale(contentLocale?: string): string | undefined;
@@ -25,7 +25,7 @@ export declare class FtSearchStateManager {
25
25
  setFilter(key: string, values: string[]): void;
26
26
  setLiveQuery(query: string): void;
27
27
  private searchDebouncer;
28
- launchSearch(): Promise<void>;
28
+ launchSearch(): Promise<boolean>;
29
29
  private suggestDebouncer;
30
30
  launchSuggest(): Promise<void>;
31
31
  private fetchSearchData;
@@ -94,33 +94,25 @@ export class FtSearchStateManager {
94
94
  }
95
95
  async launchSearch() {
96
96
  await this.awaitService();
97
- this.searchDebouncer.run(() => this.fetchSearchData());
97
+ return this.searchDebouncer.run(() => this.fetchSearchData());
98
98
  }
99
99
  async launchSuggest() {
100
100
  await this.awaitService();
101
101
  this.suggestDebouncer.run(() => this.fetchSuggestData());
102
102
  }
103
103
  async fetchSearchData() {
104
+ var _a;
104
105
  try {
105
106
  let results = await this.service.launchSearch(this.store.getState().request);
106
107
  if (results.paging.currentPage <= 1) {
107
108
  this.store.actions.setResults(results.results);
108
109
  this.store.actions.setFacets(results.facets);
109
- this.store.actions.setPaging({
110
- totalResultsCount: results.paging.totalResultsCount,
111
- totalClustersCount: results.paging.totalClustersCount,
112
- isLastPage: results.paging.isLastPage,
113
- });
114
110
  }
115
111
  else {
116
- let newResults = this.store.getState().results.concat(results.results);
112
+ let newResults = ((_a = this.store.getState().results) !== null && _a !== void 0 ? _a : []).concat(results.results);
117
113
  this.store.actions.setResults(newResults);
118
- this.store.actions.setPaging({
119
- totalResultsCount: results.paging.totalResultsCount,
120
- totalClustersCount: results.paging.totalClustersCount,
121
- isLastPage: results.paging.isLastPage,
122
- });
123
114
  }
115
+ this.store.actions.setPaging(results.paging);
124
116
  }
125
117
  catch (e) {
126
118
  if (this.errorHandler) {
@@ -1,14 +1,10 @@
1
- import { FtSearchFacet, FtSearchLocale, FtSearchRequest, FtSearchResultCluster, FtSuggestResult } from "@fluid-topics/public-api";
1
+ import { FtSearchFacet, FtSearchLocale, FtSearchRequest, FtSearchResultCluster, FtSearchResultsPageInfo, FtSuggestResult } from "@fluid-topics/public-api";
2
2
  export interface FtSearchPageState {
3
3
  locales?: Array<FtSearchLocale>;
4
4
  request: FtSearchRequest;
5
- results: Array<FtSearchResultCluster>;
6
- facets: Array<FtSearchFacet>;
7
- paging: {
8
- totalResultsCount: number;
9
- totalClustersCount: number;
10
- isLastPage: boolean;
11
- };
5
+ results?: Array<FtSearchResultCluster>;
6
+ facets?: Array<FtSearchFacet>;
7
+ paging?: FtSearchResultsPageInfo;
12
8
  liveQuery: string;
13
- suggestResults: Array<FtSuggestResult>;
9
+ suggestResults?: Array<FtSuggestResult>;
14
10
  }
@@ -53,15 +53,7 @@ export const createSearchPageStore = (id) => FtReduxStore.get({
53
53
  perPage: 20,
54
54
  },
55
55
  },
56
- results: [],
57
- facets: [],
58
- paging: {
59
- totalResultsCount: 0,
60
- totalClustersCount: 0,
61
- isLastPage: false,
62
- },
63
56
  liveQuery: "",
64
- suggestResults: [],
65
57
  },
66
58
  reducers: searchPageStateReducers
67
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-context",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Context block for integrated search components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,8 +19,8 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "1.0.7",
23
- "@fluid-topics/ft-wc-utils": "1.0.7",
22
+ "@fluid-topics/ft-app-context": "1.0.8",
23
+ "@fluid-topics/ft-wc-utils": "1.0.8",
24
24
  "lit": "2.7.2"
25
25
  },
26
26
  "devDependencies": {
@@ -29,5 +29,5 @@
29
29
  "peerDependencies": {
30
30
  "@fluid-topics/public-api": "1.0.34"
31
31
  },
32
- "gitHead": "4f7f68b0b32e1a397650061e8baee05e5aaa3526"
32
+ "gitHead": "b55ea6fbe362f72c42f5c26f705fde8e39261001"
33
33
  }