@fluid-topics/ft-search-period-filter 1.3.11 → 1.3.13

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.
@@ -1834,7 +1834,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
1834
1834
  `;var Xo=b(L());var Fc=b(L());var Kl=b($()),ge=b(Z()),qe=b(L());var ul=b($());var pl=ul.css`
1835
1835
  `;var Eo=b(L()),_d="ft-app-info",Xt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Xt.eventName="authentication-change";var kd={session:(t,e)=>{(0,Eo.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new Xt(e.payload)),0))}},I=Eo.FtReduxStore.get({name:_d,reducers:kd,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Fn=b(L());var Qt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=I.getState(),a=e??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let a=I.subscribe(()=>{n=t.get(e),n&&(a(),o(n))})}})}};var Ao=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Qt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Qt.await()}};var He=class extends Ao{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[u])=>c.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Fn.CacheRegistry,this.cache=e?a.commonCache:new Fn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var wo=class extends He{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Mn=class{addCommand(e,o=!1){I.commands.add(e,o)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Mn;var st=b(L());var fl,Pd=Symbol("clearAfterUnitTest"),Ro=class extends He{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[fl]=()=>{this.defaultMessages={},this.cache=new st.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};(0,st.deepEqual)(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new st.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(a){!(a instanceof st.CanceledPromiseError)&&o&&console.error(a)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(o=>(0,st.delay)(0).then(()=>o()).catch(()=>null)))}};fl=Pd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ro{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ro{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Er=window.FluidTopicsI18nService,To=window.FluidTopicsCustomI18nService;var hl=b(L()),Un=class{highlightHtml(e,o,n){(0,hl.highlightHtml)(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Un;var Bd=b(ml(),1);var gl;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(gl||(gl={}));var bl;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(bl||(bl={}));var xl;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE"})(xl||(xl={}));var vl;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE"})(vl||(vl={}));var Sl;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Sl||(Sl={}));var Ol;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ol||(Ol={}));var Cl;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Cl||(Cl={}));var El;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(El||(El={}));var Al;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT"})(Al||(Al={}));var wl;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(wl||(wl={}));var Rl;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Rl||(Rl={}));var Tl;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Tl||(Tl={}));var Ll;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ll||(Ll={}));var Nl;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Nl||(Nl={}));var Il;(function(t){t.ASC="ASC",t.DESC="DESC"})(Il||(Il={}));var _l;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(_l||(_l={}));var Hn;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Hn||(Hn={}));var kl;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"})(kl||(kl={}));var Pl;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Pl||(Pl={}));var Dl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Dl||(Dl={}));var Io;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Io||(Io={}));var Bl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(Bl||(Bl={}));var Wn;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Wn||(Wn={}));var se;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(se||(se={}));var Jt;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(Jt||(Jt={}));var $l;(function(t){t.VALID="VALID",t.INVALID="INVALID"})($l||($l={}));var Fl;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Fl||(Fl={}));var Ml;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Ml||(Ml={}));var Dd={[se.PERSONAL_BOOK_SHARE_USER]:[se.PERSONAL_BOOK_USER],[se.HTML_EXPORT_USER]:[se.PERSONAL_BOOK_USER],[se.PDF_EXPORT_USER]:[se.PERSONAL_BOOK_USER],[se.KHUB_ADMIN]:[se.CONTENT_PUBLISHER],[se.ADMIN]:[se.KHUB_ADMIN,se.USERS_ADMIN,se.PORTAL_ADMIN],[se.GENERATIVE_AI_EXPORT_USER]:[se.GENERATIVE_AI_USER]};function Ul(t,e){return t===e||(Dd[t]??[]).some(o=>Ul(o,e))}function Hl(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>Ul(n,e))}var _o=class extends He{async listMySearches(){let{session:e}=I.getState();return Hl(e,se.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Wl=b(L());var zn=class{isDate(e){var o,n,a,i;return(i=(a=((n=(o=I.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,o){var n,a,i;return Wl.DateFormatter.format(e,(n=o?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new zn;var zl=b(L());var Zr=class{static get(e,o){var n,a,i,s;let c=I.getState(),{lang:u,region:p}=(a=(n=c.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new zl.SearchPlaceConverter(c.baseUrl,(s=(i=window.FluidTopicsClientConfiguration)===null||i===void 0?void 0:i.predefinedSorts)!==null&&s!==void 0?s:{},e??20,c.searchInAllLanguagesAllowed,o??`${u}-${p}`)}};var Gn=class{urlToSearchRequest(e){return Zr.get().parse(e)}searchRequestToUrl(e){return Zr.get().serialize(e)}};window.FluidTopicsUrlService=new Gn;var It=b(L());var er=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};er.eventName="change";var jn=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},Gl=new jn;var ko=class t extends It.WithEventBus{static build(){return new t(window.history,Gl,()=>window.location,!1)}constructor(e,o,n,a){var i,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,It.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new er(this.currentItem())),0)}installProxies(){let e=o=>(n,a,[i,s,c])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[p,s,c]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(er.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(er.eventName,e)}currentItem(){return(0,It.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,It.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,It.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=ko.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var jl=I;function Vl(t,e){var o;return jl.getState().authenticationRequired&&!(!((o=jl.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var le=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},K=class extends qe.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Qt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new qe.CacheRegistry,this.cleanSessionDebouncer=new qe.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Kl.html`
1836
1836
  <slot></slot>
1837
- `}connectedCallback(){super.connectedCallback(),I.addEventListener(Xt.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(Xt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,c,u;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Er.addContext(p)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),I.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((u=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Vl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=pl;le([(0,ge.property)()],K.prototype,"baseUrl",void 0);le([(0,ge.property)()],K.prototype,"apiIntegrationIdentifier",void 0);le([(0,ge.property)()],K.prototype,"apiIntegrationAppVersion",void 0);le([(0,ge.property)()],K.prototype,"uiLocale",void 0);le([(0,qe.jsonProperty)(null)],K.prototype,"availableUiLocales",void 0);le([(0,qe.jsonProperty)(null)],K.prototype,"metadataConfiguration",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"editorMode",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"noCustom",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);le([(0,ge.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomComponent",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"withManualResources",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"navigatorOnline",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"forcedOffline",void 0);le([(0,ge.property)({type:Object})],K.prototype,"apiProvider",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"authenticationRequired",void 0);le([(0,qe.jsonProperty)([])],K.prototype,"messageContexts",void 0);le([(0,qe.jsonProperty)(void 0)],K.prototype,"session",void 0);le([(0,ge.state)()],K.prototype,"localesConfiguration",void 0);le([(0,ge.state)()],K.prototype,"availableContentLocales",void 0);var Eu=b(Z());function $d(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var o,n,a;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!Po(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!Po(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let i=s=>Object.keys(s).filter(c=>s[c]!=null);if(a=i(t),o=a.length,o!==i(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,a[n]))return!1;for(n=o;n--!==0;){let s=a[n];if(!Po(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Po(t,e){try{return $d(t,e)}catch{return!1}}function Do(t,e){return!Po(t,e)}var Fd=b(Z(),1);var Bo=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var wr=b(Z(),1);var Zl=b(Z(),1);function ql(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,Zl.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Do,...e??{}})}var $o=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let n=[...this.callbacks];this.callbacks=[];let a=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(c){a(c);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Xl=b($(),1);var Fo=globalThis,Md=Fo.ShadowRoot&&(Fo.ShadyCSS===void 0||Fo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e0=Symbol();var Yl=(t,e)=>{if(Md)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),a=Fo.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var Mo=class extends Xl.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([a,i])=>e.registry.define(a,i)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Yl(n,e.elementStyles),n}};function Ql(t,e,...o){var n;let a=t.querySelector(e);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var qr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},rc,Jl=Symbol("constructorPrototype"),ec=Symbol("constructorName"),oc=Symbol("exportpartsDebouncer"),tc=Symbol("dynamicDependenciesLoaded"),bt=class extends Mo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[rc]=new $o(5),this[ec]=this.constructor.name,this[Jl]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[ec]&&Object.setPrototypeOf(this,this[Jl])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let e=this.constructor;e[tc]||(e[tc]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=Ql(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var e,o,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[oc].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var o,n,a,i,s,c;let u=g=>g!=null&&g.trim().length>0,p=e.filter(u).map(g=>g.trim());if(p.length===0){this.removeAttribute("exportparts");return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],v=(c=(s=g.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(C=>C.split(":")[1]))!==null&&c!==void 0?c:[];new Array(...S,...v).filter(u).map(C=>C.trim()).forEach(C=>m.add(C))}if(m.size===0){this.removeAttribute("exportparts");return}let h=[...m.values()].flatMap(g=>p.map(S=>`${g}:${S}--${g}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};rc=oc;qr([(0,wr.property)()],bt.prototype,"exportpartsPrefix",void 0);qr([ql([])],bt.prototype,"exportpartsPrefixes",void 0);qr([(0,wr.property)()],bt.prototype,"customStylesheet",void 0);qr([(0,wr.property)()],bt.prototype,"elementToFocus",void 0);qr([(0,wr.state)()],bt.prototype,"useAdoptedStyleSheets",void 0);function Uo(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Yr=Symbol("internalReduxEventsUnsubscribers"),_t=Symbol("internalStoresUnsubscribers"),tr=Symbol("internalStores");function Ud(t){var e,o,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[tr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[tr].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[tr].get(s)}addStore(s,c){var u;c=(u=c??s.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(c),this[tr].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[tr].delete(c)}setupStores(){this.unsubscribeFromStores(),this[tr].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let u=this.constructor.getPropertyOptions(c);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:c)){let p=this.getStore(s.store);p&&(s.store?this[_t].has(s.store):this[_t].size>0)&&(this[c]=s.selector(p.getState(),this))}})}subscribeToStore(s,c){var u;this[_t].set(s,c.subscribe(()=>this.updateFromStores())),this[Yr].set(s,[]),Uo(c)&&c.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,m)=>{if(typeof this[m]=="function"&&(!p.store||c.name===p.store)){let h=g=>this[m](g);c.addEventListener(p.eventName,h),this[Yr].get(s).push(()=>c.removeEventListener(p.eventName,h))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[_t].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[_t].has(s)&&this[_t].get(s)(),this[_t].delete(s),(c=this[Yr].get(s))===null||c===void 0||c.forEach(u=>u()),this[Yr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=_t,o=tr,n=Yr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}var nc=class extends Ud(bt){};function We(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function xt(t){return!!t&&!!t[Q]}function Ye(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Zd}(t)||Array.isArray(t)||!!t[uc]||!!(!((e=t.constructor)===null||e===void 0)&&e[uc])||ea(t)||ta(t))}function rr(t,e,o){o===void 0&&(o=!1),Lr(t)===0?(o?Object.keys:Tr)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Lr(t){var e=t[Q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ea(t)?2:ta(t)?3:0}function Rr(t,e){return Lr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Hd(t,e){return Lr(t)===2?t.get(e):t[e]}function pc(t,e,o){var n=Lr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function fc(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ea(t){return Vd&&t instanceof Map}function ta(t){return Kd&&t instanceof Set}function kt(t){return t.o||t.t}function ra(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=mc(t);delete e[Q];for(var o=Tr(e),n=0;n<o.length;n++){var a=o[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function oa(t,e){return e===void 0&&(e=!1),na(t)||xt(t)||!Ye(t)||(Lr(t)>1&&(t.set=t.add=t.clear=t.delete=Wd),Object.freeze(t),e&&rr(t,function(o,n){return oa(n,!0)},!0)),t}function Wd(){We(2)}function na(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function lt(t){var e=Jn[t];return e||We(18,t),e}function zd(t,e){Jn[t]||(Jn[t]=e)}function Yn(){return Qr}function Vn(t,e){e&&(lt("Patches"),t.u=[],t.s=[],t.v=e)}function Ho(t){Xn(t),t.p.forEach(Gd),t.p=null}function Xn(t){t===Qr&&(Qr=t.l)}function ac(t){return Qr={p:[],l:Qr,h:t,m:!0,_:0}}function Gd(t){var e=t[Q];e.i===0||e.i===1?e.j():e.g=!0}function Kn(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||lt("ES5").S(e,t,n),n?(o[Q].P&&(Ho(e),We(4)),Ye(t)&&(t=Wo(e,t),e.l||zo(e,t)),e.u&&lt("Patches").M(o[Q].t,t,e.u,e.s)):t=Wo(e,o,[]),Ho(e),e.u&&e.v(e.u,e.s),t!==yc?t:void 0}function Wo(t,e,o){if(na(e))return e;var n=e[Q];if(!n)return rr(e,function(c,u){return ic(t,n,e,c,u,o)},!0),e;if(n.A!==t)return e;if(!n.P)return zo(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ra(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),rr(i,function(c,u){return ic(t,n,a,c,u,o,s)}),zo(t,a,!1),o&&t.u&&lt("Patches").N(n,o,t.u,t.s)}return n.o}function ic(t,e,o,n,a,i,s){if(xt(a)){var c=Wo(t,a,i&&e&&e.i!==3&&!Rr(e.R,n)?i.concat(n):void 0);if(pc(o,n,c),!xt(c))return;t.m=!1}else s&&o.add(a);if(Ye(a)&&!na(a)){if(!t.h.D&&t._<1)return;Wo(t,a),e&&e.A.l||zo(t,a)}}function zo(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&oa(e,o)}function Zn(t,e){var o=t[Q];return(o?kt(o):t)[e]}function sc(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function Pt(t){t.P||(t.P=!0,t.l&&Pt(t.l))}function qn(t){t.o||(t.o=ra(t.t))}function Qn(t,e,o){var n=ea(e)?lt("MapSet").F(e,o):ta(e)?lt("MapSet").T(e,o):t.O?function(a,i){var s=Array.isArray(a),c={i:s?1:0,A:i?i.A:Yn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=c,p=Jr;s&&(u=[c],p=Xr);var m=Proxy.revocable(u,p),h=m.revoke,g=m.proxy;return c.k=g,c.j=h,g}(e,o):lt("ES5").J(e,o);return(o?o.A:Yn()).p.push(n),n}function jd(t){return xt(t)||We(22,t),function e(o){if(!Ye(o))return o;var n,a=o[Q],i=Lr(o);if(a){if(!a.P&&(a.i<4||!lt("ES5").K(a)))return a.t;a.I=!0,n=lc(o,i),a.I=!1}else n=lc(o,i);return rr(n,function(s,c){a&&Hd(a.t,s)===c||pc(n,s,e(c))}),i===3?new Set(n):n}(t)}function lc(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return ra(t)}function hc(){function t(s,c){var u=i[s];return u?u.enumerable=c:i[s]=u={configurable:!0,enumerable:c,get:function(){var p=this[Q];return Jr.get(p,s)},set:function(p){var m=this[Q];Jr.set(m,s,p)}},u}function e(s){for(var c=s.length-1;c>=0;c--){var u=s[c][Q];if(!u.P)switch(u.i){case 5:n(u)&&Pt(u);break;case 4:o(u)&&Pt(u)}}}function o(s){for(var c=s.t,u=s.k,p=Tr(u),m=p.length-1;m>=0;m--){var h=p[m];if(h!==Q){var g=c[h];if(g===void 0&&!Rr(c,h))return!0;var S=u[h],v=S&&S[Q];if(v?v.t!==g:!fc(S,g))return!0}}var C=!!c[Q];return p.length!==Tr(c).length+(C?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var u=Object.getOwnPropertyDescriptor(c,c.length-1);if(u&&!u.get)return!0;for(var p=0;p<c.length;p++)if(!c.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&We(3,JSON.stringify(kt(s)))}var i={};zd("ES5",{J:function(s,c){var u=Array.isArray(s),p=function(h,g){if(h){for(var S=Array(g.length),v=0;v<g.length;v++)Object.defineProperty(S,""+v,t(v,!0));return S}var C=mc(g);delete C[Q];for(var _=Tr(C),T=0;T<_.length;T++){var N=_[T];C[N]=t(N,h||!!C[N].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(u,s),m={i:u?5:4,A:c?c.A:Yn(),P:!1,I:!1,R:{},l:c,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,Q,{value:m,writable:!0}),p},S:function(s,c,u){u?xt(c)&&c[Q].A===s&&e(s.p):(s.u&&function p(m){if(m&&typeof m=="object"){var h=m[Q];if(h){var g=h.t,S=h.k,v=h.R,C=h.i;if(C===4)rr(S,function(B){B!==Q&&(g[B]!==void 0||Rr(g,B)?v[B]||p(S[B]):(v[B]=!0,Pt(h)))}),rr(g,function(B){S[B]!==void 0||Rr(S,B)||(v[B]=!1,Pt(h))});else if(C===5){if(n(h)&&(Pt(h),v.length=!0),S.length<g.length)for(var _=S.length;_<g.length;_++)v[_]=!1;else for(var T=g.length;T<S.length;T++)v[T]=!0;for(var N=Math.min(S.length,g.length),P=0;P<N;P++)S.hasOwnProperty(P)||(v[P]=!0),v[P]===void 0&&p(S[P])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var cc,Qr,aa=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Vd=typeof Map<"u",Kd=typeof Set<"u",dc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",yc=aa?Symbol.for("immer-nothing"):((cc={})["immer-nothing"]=!0,cc),uc=aa?Symbol.for("immer-draftable"):"__$immer_draftable",Q=aa?Symbol.for("immer-state"):"__$immer_state";var Zd=""+Object.prototype.constructor,Tr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,mc=Object.getOwnPropertyDescriptors||function(t){var e={};return Tr(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},Jn={},Jr={get:function(t,e){if(e===Q)return t;var o=kt(t);if(!Rr(o,e))return function(a,i,s){var c,u=sc(i,s);return u?"value"in u?u.value:(c=u.get)===null||c===void 0?void 0:c.call(a.k):void 0}(t,o,e);var n=o[e];return t.I||!Ye(n)?n:n===Zn(t.t,e)?(qn(t),t.o[e]=Qn(t.A.h,n,t)):n},has:function(t,e){return e in kt(t)},ownKeys:function(t){return Reflect.ownKeys(kt(t))},set:function(t,e,o){var n=sc(kt(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=Zn(kt(t),e),i=a?.[Q];if(i&&i.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(fc(o,a)&&(o!==void 0||Rr(t.t,e)))return!0;qn(t),Pt(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return Zn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,qn(t),Pt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=kt(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){We(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){We(12)}},Xr={};rr(Jr,function(t,e){Xr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Xr.deleteProperty=function(t,e){return Xr.set.call(this,t,e,void 0)},Xr.set=function(t,e,o){return Jr.set.call(this,t[0],e,o,t[0])};var qd=function(){function t(o){var n=this;this.O=dc,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var c=i;i=a;var u=n;return function(C){var _=this;C===void 0&&(C=c);for(var T=arguments.length,N=Array(T>1?T-1:0),P=1;P<T;P++)N[P-1]=arguments[P];return u.produce(C,function(B){var F;return(F=i).call.apply(F,[_,B].concat(N))})}}var p;if(typeof i!="function"&&We(6),s!==void 0&&typeof s!="function"&&We(7),Ye(a)){var m=ac(n),h=Qn(n,a,void 0),g=!0;try{p=i(h),g=!1}finally{g?Ho(m):Xn(m)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(C){return Vn(m,s),Kn(C,m)},function(C){throw Ho(m),C}):(Vn(m,s),Kn(p,m))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===yc&&(p=void 0),n.D&&oa(p,!0),s){var S=[],v=[];lt("Patches").M(a,p,S,v),s(S,v)}return p}We(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(p,function(S){return a.apply(void 0,[S].concat(h))})};var s,c,u=n.produce(a,i,function(p,m){s=p,c=m});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,s,c]}):[u,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){Ye(o)||We(8),xt(o)&&(o=jd(o));var n=ac(this),a=Qn(this,o,void 0);return a[Q].C=!0,Xn(n),a},e.finishDraft=function(o,n){var a=o&&o[Q],i=a.A;return Vn(i,n),Kn(void 0,i)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!dc&&We(20),this.O=o},e.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var s=lt("Patches").$;return xt(o)?s(o,n):this.produce(o,function(c){return s(c,n)})},t}(),Me=new qd,Yd=Me.produce,h0=Me.produceWithPatches.bind(Me),y0=Me.setAutoFreeze.bind(Me),m0=Me.setUseProxies.bind(Me),g0=Me.applyPatches.bind(Me),b0=Me.createDraft.bind(Me),x0=Me.finishDraft.bind(Me),Go=Yd;function or(t){"@babel/helpers - typeof";return or=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(t)}function gc(t,e){if(or(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(or(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bc(t){var e=gc(t,"string");return or(e)=="symbol"?e:e+""}function xc(t,e,o){return(e=bc(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function vc(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function ia(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?vc(Object(o),!0).forEach(function(n){xc(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):vc(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ve(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. "}var Sc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),sa=function(){return Math.random().toString(36).substring(7).split("").join(".")},jo={INIT:"@@redux/INIT"+sa(),REPLACE:"@@redux/REPLACE"+sa(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+sa()}};function Xd(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function la(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ve(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ve(1));return o(la)(t,e)}if(typeof t!="function")throw new Error(ve(2));var a=t,i=e,s=[],c=s,u=!1;function p(){c===s&&(c=s.slice())}function m(){if(u)throw new Error(ve(3));return i}function h(C){if(typeof C!="function")throw new Error(ve(4));if(u)throw new Error(ve(5));var _=!0;return p(),c.push(C),function(){if(_){if(u)throw new Error(ve(6));_=!1,p();var N=c.indexOf(C);c.splice(N,1),s=null}}}function g(C){if(!Xd(C))throw new Error(ve(7));if(typeof C.type>"u")throw new Error(ve(8));if(u)throw new Error(ve(9));try{u=!0,i=a(i,C)}finally{u=!1}for(var _=s=c,T=0;T<_.length;T++){var N=_[T];N()}return C}function S(C){if(typeof C!="function")throw new Error(ve(10));a=C,g({type:jo.REPLACE})}function v(){var C,_=h;return C={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(ve(11));function P(){N.next&&N.next(m())}P();var B=_(P);return{unsubscribe:B}}},C[Sc]=function(){return this},C}return g({type:jo.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[Sc]=v,n}function Qd(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:jo.INIT});if(typeof n>"u")throw new Error(ve(12));if(typeof o(void 0,{type:jo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ve(13))})}function Oc(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(o[a]=t[a])}var i=Object.keys(o),s,c;try{Qd(o)}catch(u){c=u}return function(p,m){if(p===void 0&&(p={}),c)throw c;if(0)var h;for(var g=!1,S={},v=0;v<i.length;v++){var C=i[v],_=o[C],T=p[C],N=_(T,m);if(typeof N>"u"){var P=m&&m.type;throw new Error(ve(14))}S[C]=N,g=g||N!==T}return g=g||i.length!==Object.keys(p).length,g?S:p}}function Nr(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Cc(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ve(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},c=e.map(function(u){return u(s)});return i=Nr.apply(void 0,c)(a.dispatch),ia(ia({},a),{},{dispatch:i})}}}function Ec(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(c){return typeof c=="function"?c(a,i,t):s(c)}}};return e}var Ac=Ec();Ac.withExtraArgument=Ec;var ca=Ac;var Nc=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Jd=function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(p){return function(m){return u([p,m])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=p[0]&2?a.return:p[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,p[1])).done)return i;switch(a=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){o.label=p[1];break}if(p[0]===6&&o.label<i[1]){o.label=i[1],i=p;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(p);break}i[2]&&o.ops.pop(),o.trys.pop();continue}p=e.call(t,o)}catch(m){p=[6,m],a=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Ir=function(t,e){for(var o=0,n=e.length,a=t.length;o<n;o++,a++)t[a]=e[o];return t},eu=Object.defineProperty,tu=Object.defineProperties,ru=Object.getOwnPropertyDescriptors,wc=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,nu=Object.prototype.propertyIsEnumerable,Rc=function(t,e,o){return e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Dt=function(t,e){for(var o in e||(e={}))ou.call(e,o)&&Rc(t,o,e[o]);if(wc)for(var n=0,a=wc(e);n<a.length;n++){var o=a[n];nu.call(e,o)&&Rc(t,o,e[o])}return t},da=function(t,e){return tu(t,ru(e))},au=function(t,e,o){return new Promise(function(n,a){var i=function(u){try{c(o.next(u))}catch(p){a(p)}},s=function(u){try{c(o.throw(u))}catch(p){a(p)}},c=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(i,s)};c((o=o.apply(t,e)).next())})};var iu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Nr:Nr.apply(null,arguments)},$0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function su(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var lu=function(t){Nc(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Ir([void 0],o[0].concat(this)))):new(e.bind.apply(e,Ir([void 0],o.concat(this))))},e}(Array),cu=function(t){Nc(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Ir([void 0],o[0].concat(this)))):new(e.bind.apply(e,Ir([void 0],o.concat(this))))},e}(Array);function fa(t){return Ye(t)?Go(t,function(){}):t}function du(t){return typeof t=="boolean"}function uu(){return function(e){return pu(e)}}function pu(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,c=new lu;if(o&&(du(o)?c.push(ca):c.push(ca.withExtraArgument(o.extraArgument))),0){if(a)var u;if(s)var p}return c}var ua=!0;function Ic(t){var e=uu(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,s=i===void 0?e():i,c=o.devTools,u=c===void 0?!0:c,p=o.preloadedState,m=p===void 0?void 0:p,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(su(a))S=Oc(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;if(typeof v=="function"&&(v=v(e),!ua&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ua&&v.some(function(B){return typeof B!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=Cc.apply(void 0,v),_=Nr;u&&(_=iu(Dt({trace:!ua},typeof u=="object"&&u)));var T=new cu(C),N=T;Array.isArray(g)?N=Ir([C],g):typeof g=="function"&&(N=g(T));var P=_.apply(void 0,N);return la(S,m,P)}function Bt(t,e){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Dt(Dt({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function _c(t){var e={},o=[],n,a={addCase:function(i,s){var c=typeof i=="string"?i:i.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,a},addMatcher:function(i,s){return o.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,o,n]}function fu(t){return typeof t=="function"}function hu(t,e,o,n){o===void 0&&(o=[]);var a=typeof e=="function"?_c(e):[e,o,n],i=a[0],s=a[1],c=a[2],u;if(fu(t))u=function(){return fa(t())};else{var p=fa(t);u=function(){return p}}function m(h,g){h===void 0&&(h=u());var S=Ir([i[g.type]],s.filter(function(v){var C=v.matcher;return C(g)}).map(function(v){var C=v.reducer;return C}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,C){if(C)if(xt(v)){var _=v,T=C(_,g);return T===void 0?v:T}else{if(Ye(v))return Go(v,function(N){return C(N,g)});var T=C(v,g);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},h)}return m.getInitialState=u,m}function yu(t,e){return t+"/"+e}function kc(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:fa(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},c={};a.forEach(function(m){var h=n[m],g=yu(e,m),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,i[m]=S,s[g]=S,c[m]=v?Bt(g,v):Bt(g)});function u(){var m=typeof t.extraReducers=="function"?_c(t.extraReducers):[t.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],v=S===void 0?[]:S,C=m[2],_=C===void 0?void 0:C,T=Dt(Dt({},g),s);return hu(o,function(N){for(var P in T)N.addCase(P,T[P]);for(var B=0,F=v;B<F.length;B++){var we=F[B];N.addMatcher(we.matcher,we.reducer)}_&&N.addDefaultCase(_)})}var p;return{name:e,reducer:function(m,h){return p||(p=u()),p(m,h)},actions:c,caseReducers:i,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var mu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",gu=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=mu[Math.random()*64|0];return e},bu=["name","message","stack","code"],pa=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Tc=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),xu=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=bu;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},H0=function(){function t(e,o,n){var a=Bt(e+"/fulfilled",function(m,h,g,S){return{payload:m,meta:da(Dt({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=Bt(e+"/pending",function(m,h,g){return{payload:void 0,meta:da(Dt({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),s=Bt(e+"/rejected",function(m,h,g,S,v){return{payload:S,error:(n&&n.serializeError||xu)(m||"Rejected"),meta:da(Dt({},v||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,u=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function p(m){return function(h,g,S){var v=n?.idGenerator?n.idGenerator(m):gu(),C=new u,_,T=!1;function N(B){_=B,C.abort()}var P=function(){return au(this,null,function(){var B,F,we,Je,Se,et,pe;return Jd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),Je=(B=n?.condition)==null?void 0:B.call(n,m,{getState:g,extra:S}),Su(Je)?[4,Je]:[3,2];case 1:Je=y.sent(),y.label=2;case 2:if(Je===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,Se=new Promise(function(x,k){return C.signal.addEventListener("abort",function(){return k({name:"AbortError",message:_||"Aborted"})})}),h(i(v,m,(F=n?.getPendingMeta)==null?void 0:F.call(n,{requestId:v,arg:m},{getState:g,extra:S}))),[4,Promise.race([Se,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:v,signal:C.signal,abort:N,rejectWithValue:function(x,k){return new pa(x,k)},fulfillWithValue:function(x,k){return new Tc(x,k)}})).then(function(x){if(x instanceof pa)throw x;return x instanceof Tc?a(x.payload,v,m,x.meta):a(x,v,m)})])];case 3:return we=y.sent(),[3,5];case 4:return et=y.sent(),we=et instanceof pa?s(null,v,m,et.payload,et.meta):s(et,v,m),[3,5];case 5:return pe=n&&!n.dispatchConditionRejection&&s.match(we)&&we.meta.condition,pe||h(we),[2,we]}})})}();return Object.assign(P,{abort:N,requestId:v,arg:m,unwrap:function(){return P.then(vu)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function vu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Su(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Pc="listener",Dc="completed",Bc="cancelled",W0="task-"+Bc,z0="task-"+Dc,G0=Pc+"-"+Bc,j0=Pc+"-"+Dc;var ha="listenerMiddleware";var V0=Bt(ha+"/add"),K0=Bt(ha+"/removeAll"),Z0=Bt(ha+"/remove");var Lc,q0=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Lc||(Lc=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ou=function(t){return function(e){setTimeout(e,t)}},Y0=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ou(10);hc();function Cu(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}var Vo=class extends Cu(Object){};window.ftReduxStores||(window.ftReduxStores={});var $c=class t extends Vo{static get(e){var o;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Uo(i))return i;if(a==null)return;let s=kc({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),c=Ic({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:s.reducer(u,p)});return window.ftReduxStores[a.name]=new t(s,c,a.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Bo;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,c)=>{let u=s,p=i[u];return p?(...m)=>{let h=p(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[u]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites: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(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Zo=b(L());var Ko=class extends He{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var Au="ft-user-assets",wu={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Jt).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}}},ze=Zo.FtReduxStore.get({name:Au,reducers:wu,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Jt).map(t=>[t,void 0])),bookmarkByMap:{}}}}),ya=class{constructor(e=new Ko){this.assetCountsService=e,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new wo,this.savedSearchesService=new _o,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,Zo.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts())}clearUserAssetCounts(){ze.actions.clearAssetCount(),ze.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ze.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ze.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ze.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ze.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ze.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ze.getState().assetCounts.bookmarkByMap).length!==0;e===Jt.BOOKMARKS&&o&&ze.actions.clearBookmarkCountByMap(),ze.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ze.actions.bookmarks(o)}}},Ru=new ya;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ru);(0,Fc.customElement)("ft-app-context")(K);var zc=b(Z());var Tu=b(L());function Mc(t){return t.match(/^[\w-]+\.[\w-]+$/)}var Lu=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Uc=Symbol("i18nAttributes"),Hc=Symbol("i18nListAttributes"),Gc=Symbol("i18nProperties"),qo=Symbol("i18nContexts"),eo=Symbol("i18nUnsubs");function Qo(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?To:Er}i18n(i){var s;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let c=(s=i.args)!==null&&s!==void 0?s:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...c)}customI18n(i,s){if(Mc(i)){let[c,u]=i.split(".");return this.i18n({custom:!0,context:c,key:u,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,u)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let u=this,p=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,...m})}:g;(s=this[Uc])===null||s===void 0||s.forEach((m,h)=>u[h]=p(m,h,u[h])),(c=this[Hc])===null||c===void 0||c.forEach((m,h)=>{var g;return u[h]=(g=u[h])===null||g===void 0?void 0:g.map(S=>p(m,h,S))})}updateI18nProperties(i){var s;(s=this[Gc])===null||s===void 0||s.forEach((c,u)=>{i(c,u)&&(this[u]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let u=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[qo].set(u,{isCustomContext:c}),this[eo].has(u)||this[eo].set(u,this.getI18nService(c).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(c).prepareContext(u,s)}hasI18nContext(i){return this[qo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[qo].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[eo].forEach(i=>i()),this[eo].clear()}}return e=qo,o=eo,Lu([(0,zc.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var Wc=class extends Qo(Xo.FtLitElement){},Yo=class extends Qo(Xo.FtLitElementRedux){};var to=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Xe=class extends Yo{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Jo.nothing:Jo.html`
1837
+ `}connectedCallback(){super.connectedCallback(),I.addEventListener(Xt.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(Xt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,c,u;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Er.addContext(p)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),I.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((u=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Vl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};K.elementDefinitions={};K.styles=pl;le([(0,ge.property)()],K.prototype,"baseUrl",void 0);le([(0,ge.property)()],K.prototype,"apiIntegrationIdentifier",void 0);le([(0,ge.property)()],K.prototype,"apiIntegrationAppVersion",void 0);le([(0,ge.property)()],K.prototype,"uiLocale",void 0);le([(0,qe.jsonProperty)(null)],K.prototype,"availableUiLocales",void 0);le([(0,qe.jsonProperty)(null)],K.prototype,"metadataConfiguration",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"editorMode",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"noCustom",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);le([(0,ge.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomComponent",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"withManualResources",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"navigatorOnline",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"forcedOffline",void 0);le([(0,ge.property)({type:Object})],K.prototype,"apiProvider",void 0);le([(0,ge.property)({type:Boolean})],K.prototype,"authenticationRequired",void 0);le([(0,qe.jsonProperty)([])],K.prototype,"messageContexts",void 0);le([(0,qe.jsonProperty)(void 0)],K.prototype,"session",void 0);le([(0,ge.state)()],K.prototype,"localesConfiguration",void 0);le([(0,ge.state)()],K.prototype,"availableContentLocales",void 0);var Eu=b(Z());function $d(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var o,n,a;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!Po(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!Po(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let i=s=>Object.keys(s).filter(c=>s[c]!=null);if(a=i(t),o=a.length,o!==i(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,a[n]))return!1;for(n=o;n--!==0;){let s=a[n];if(!Po(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Po(t,e){try{return $d(t,e)}catch{return!1}}function Do(t,e){return!Po(t,e)}var Fd=b(Z(),1);var Bo=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var wr=b(Z(),1);var Zl=b(Z(),1);function ql(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,Zl.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Do,...e??{}})}var $o=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let n=[...this.callbacks];this.callbacks=[];let a=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(c){a(c);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Xl=b($(),1);var Fo=globalThis,Md=Fo.ShadowRoot&&(Fo.ShadyCSS===void 0||Fo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o0=Symbol();var Yl=(t,e)=>{if(Md)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),a=Fo.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var Mo=class extends Xl.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([a,i])=>e.registry.define(a,i)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Yl(n,e.elementStyles),n}};function Ql(t,e,...o){var n;let a=t.querySelector(e);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var qr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},rc,Jl=Symbol("constructorPrototype"),ec=Symbol("constructorName"),oc=Symbol("exportpartsDebouncer"),tc=Symbol("dynamicDependenciesLoaded"),bt=class extends Mo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[rc]=new $o(5),this[ec]=this.constructor.name,this[Jl]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[ec]&&Object.setPrototypeOf(this,this[Jl])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let e=this.constructor;e[tc]||(e[tc]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=Ql(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var e,o,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[oc].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var o,n,a,i,s,c;let u=g=>g!=null&&g.trim().length>0,p=e.filter(u).map(g=>g.trim());if(p.length===0){this.removeAttribute("exportparts");return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],v=(c=(s=g.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(C=>C.split(":")[1]))!==null&&c!==void 0?c:[];new Array(...S,...v).filter(u).map(C=>C.trim()).forEach(C=>m.add(C))}if(m.size===0){this.removeAttribute("exportparts");return}let h=[...m.values()].flatMap(g=>p.map(S=>`${g}:${S}--${g}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};rc=oc;qr([(0,wr.property)()],bt.prototype,"exportpartsPrefix",void 0);qr([ql([])],bt.prototype,"exportpartsPrefixes",void 0);qr([(0,wr.property)()],bt.prototype,"customStylesheet",void 0);qr([(0,wr.property)()],bt.prototype,"elementToFocus",void 0);qr([(0,wr.state)()],bt.prototype,"useAdoptedStyleSheets",void 0);function Uo(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Yr=Symbol("internalReduxEventsUnsubscribers"),_t=Symbol("internalStoresUnsubscribers"),tr=Symbol("internalStores");function Ud(t){var e,o,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[tr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[tr].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[tr].get(s)}addStore(s,c){var u;c=(u=c??s.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(c),this[tr].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[tr].delete(c)}setupStores(){this.unsubscribeFromStores(),this[tr].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let u=this.constructor.getPropertyOptions(c);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:c)){let p=this.getStore(s.store);p&&(s.store?this[_t].has(s.store):this[_t].size>0)&&(this[c]=s.selector(p.getState(),this))}})}subscribeToStore(s,c){var u;this[_t].set(s,c.subscribe(()=>this.updateFromStores())),this[Yr].set(s,[]),Uo(c)&&c.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,m)=>{if(typeof this[m]=="function"&&(!p.store||c.name===p.store)){let h=g=>this[m](g);c.addEventListener(p.eventName,h),this[Yr].get(s).push(()=>c.removeEventListener(p.eventName,h))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[_t].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[_t].has(s)&&this[_t].get(s)(),this[_t].delete(s),(c=this[Yr].get(s))===null||c===void 0||c.forEach(u=>u()),this[Yr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=_t,o=tr,n=Yr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}var nc=class extends Ud(bt){};function We(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function xt(t){return!!t&&!!t[Q]}function Ye(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Zd}(t)||Array.isArray(t)||!!t[uc]||!!(!((e=t.constructor)===null||e===void 0)&&e[uc])||ea(t)||ta(t))}function rr(t,e,o){o===void 0&&(o=!1),Lr(t)===0?(o?Object.keys:Tr)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Lr(t){var e=t[Q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ea(t)?2:ta(t)?3:0}function Rr(t,e){return Lr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Hd(t,e){return Lr(t)===2?t.get(e):t[e]}function pc(t,e,o){var n=Lr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function fc(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ea(t){return Vd&&t instanceof Map}function ta(t){return Kd&&t instanceof Set}function kt(t){return t.o||t.t}function ra(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=mc(t);delete e[Q];for(var o=Tr(e),n=0;n<o.length;n++){var a=o[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function oa(t,e){return e===void 0&&(e=!1),na(t)||xt(t)||!Ye(t)||(Lr(t)>1&&(t.set=t.add=t.clear=t.delete=Wd),Object.freeze(t),e&&rr(t,function(o,n){return oa(n,!0)},!0)),t}function Wd(){We(2)}function na(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function lt(t){var e=Jn[t];return e||We(18,t),e}function zd(t,e){Jn[t]||(Jn[t]=e)}function Yn(){return Qr}function Vn(t,e){e&&(lt("Patches"),t.u=[],t.s=[],t.v=e)}function Ho(t){Xn(t),t.p.forEach(Gd),t.p=null}function Xn(t){t===Qr&&(Qr=t.l)}function ac(t){return Qr={p:[],l:Qr,h:t,m:!0,_:0}}function Gd(t){var e=t[Q];e.i===0||e.i===1?e.j():e.g=!0}function Kn(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||lt("ES5").S(e,t,n),n?(o[Q].P&&(Ho(e),We(4)),Ye(t)&&(t=Wo(e,t),e.l||zo(e,t)),e.u&&lt("Patches").M(o[Q].t,t,e.u,e.s)):t=Wo(e,o,[]),Ho(e),e.u&&e.v(e.u,e.s),t!==yc?t:void 0}function Wo(t,e,o){if(na(e))return e;var n=e[Q];if(!n)return rr(e,function(c,u){return ic(t,n,e,c,u,o)},!0),e;if(n.A!==t)return e;if(!n.P)return zo(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ra(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),rr(i,function(c,u){return ic(t,n,a,c,u,o,s)}),zo(t,a,!1),o&&t.u&&lt("Patches").N(n,o,t.u,t.s)}return n.o}function ic(t,e,o,n,a,i,s){if(xt(a)){var c=Wo(t,a,i&&e&&e.i!==3&&!Rr(e.R,n)?i.concat(n):void 0);if(pc(o,n,c),!xt(c))return;t.m=!1}else s&&o.add(a);if(Ye(a)&&!na(a)){if(!t.h.D&&t._<1)return;Wo(t,a),e&&e.A.l||zo(t,a)}}function zo(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&oa(e,o)}function Zn(t,e){var o=t[Q];return(o?kt(o):t)[e]}function sc(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function Pt(t){t.P||(t.P=!0,t.l&&Pt(t.l))}function qn(t){t.o||(t.o=ra(t.t))}function Qn(t,e,o){var n=ea(e)?lt("MapSet").F(e,o):ta(e)?lt("MapSet").T(e,o):t.O?function(a,i){var s=Array.isArray(a),c={i:s?1:0,A:i?i.A:Yn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=c,p=Jr;s&&(u=[c],p=Xr);var m=Proxy.revocable(u,p),h=m.revoke,g=m.proxy;return c.k=g,c.j=h,g}(e,o):lt("ES5").J(e,o);return(o?o.A:Yn()).p.push(n),n}function jd(t){return xt(t)||We(22,t),function e(o){if(!Ye(o))return o;var n,a=o[Q],i=Lr(o);if(a){if(!a.P&&(a.i<4||!lt("ES5").K(a)))return a.t;a.I=!0,n=lc(o,i),a.I=!1}else n=lc(o,i);return rr(n,function(s,c){a&&Hd(a.t,s)===c||pc(n,s,e(c))}),i===3?new Set(n):n}(t)}function lc(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return ra(t)}function hc(){function t(s,c){var u=i[s];return u?u.enumerable=c:i[s]=u={configurable:!0,enumerable:c,get:function(){var p=this[Q];return Jr.get(p,s)},set:function(p){var m=this[Q];Jr.set(m,s,p)}},u}function e(s){for(var c=s.length-1;c>=0;c--){var u=s[c][Q];if(!u.P)switch(u.i){case 5:n(u)&&Pt(u);break;case 4:o(u)&&Pt(u)}}}function o(s){for(var c=s.t,u=s.k,p=Tr(u),m=p.length-1;m>=0;m--){var h=p[m];if(h!==Q){var g=c[h];if(g===void 0&&!Rr(c,h))return!0;var S=u[h],v=S&&S[Q];if(v?v.t!==g:!fc(S,g))return!0}}var C=!!c[Q];return p.length!==Tr(c).length+(C?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var u=Object.getOwnPropertyDescriptor(c,c.length-1);if(u&&!u.get)return!0;for(var p=0;p<c.length;p++)if(!c.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&We(3,JSON.stringify(kt(s)))}var i={};zd("ES5",{J:function(s,c){var u=Array.isArray(s),p=function(h,g){if(h){for(var S=Array(g.length),v=0;v<g.length;v++)Object.defineProperty(S,""+v,t(v,!0));return S}var C=mc(g);delete C[Q];for(var _=Tr(C),T=0;T<_.length;T++){var N=_[T];C[N]=t(N,h||!!C[N].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(u,s),m={i:u?5:4,A:c?c.A:Yn(),P:!1,I:!1,R:{},l:c,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,Q,{value:m,writable:!0}),p},S:function(s,c,u){u?xt(c)&&c[Q].A===s&&e(s.p):(s.u&&function p(m){if(m&&typeof m=="object"){var h=m[Q];if(h){var g=h.t,S=h.k,v=h.R,C=h.i;if(C===4)rr(S,function(B){B!==Q&&(g[B]!==void 0||Rr(g,B)?v[B]||p(S[B]):(v[B]=!0,Pt(h)))}),rr(g,function(B){S[B]!==void 0||Rr(S,B)||(v[B]=!1,Pt(h))});else if(C===5){if(n(h)&&(Pt(h),v.length=!0),S.length<g.length)for(var _=S.length;_<g.length;_++)v[_]=!1;else for(var T=g.length;T<S.length;T++)v[T]=!0;for(var N=Math.min(S.length,g.length),P=0;P<N;P++)S.hasOwnProperty(P)||(v[P]=!0),v[P]===void 0&&p(S[P])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var cc,Qr,aa=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Vd=typeof Map<"u",Kd=typeof Set<"u",dc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",yc=aa?Symbol.for("immer-nothing"):((cc={})["immer-nothing"]=!0,cc),uc=aa?Symbol.for("immer-draftable"):"__$immer_draftable",Q=aa?Symbol.for("immer-state"):"__$immer_state";var Zd=""+Object.prototype.constructor,Tr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,mc=Object.getOwnPropertyDescriptors||function(t){var e={};return Tr(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},Jn={},Jr={get:function(t,e){if(e===Q)return t;var o=kt(t);if(!Rr(o,e))return function(a,i,s){var c,u=sc(i,s);return u?"value"in u?u.value:(c=u.get)===null||c===void 0?void 0:c.call(a.k):void 0}(t,o,e);var n=o[e];return t.I||!Ye(n)?n:n===Zn(t.t,e)?(qn(t),t.o[e]=Qn(t.A.h,n,t)):n},has:function(t,e){return e in kt(t)},ownKeys:function(t){return Reflect.ownKeys(kt(t))},set:function(t,e,o){var n=sc(kt(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=Zn(kt(t),e),i=a?.[Q];if(i&&i.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(fc(o,a)&&(o!==void 0||Rr(t.t,e)))return!0;qn(t),Pt(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return Zn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,qn(t),Pt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=kt(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){We(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){We(12)}},Xr={};rr(Jr,function(t,e){Xr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Xr.deleteProperty=function(t,e){return Xr.set.call(this,t,e,void 0)},Xr.set=function(t,e,o){return Jr.set.call(this,t[0],e,o,t[0])};var qd=function(){function t(o){var n=this;this.O=dc,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var c=i;i=a;var u=n;return function(C){var _=this;C===void 0&&(C=c);for(var T=arguments.length,N=Array(T>1?T-1:0),P=1;P<T;P++)N[P-1]=arguments[P];return u.produce(C,function(B){var F;return(F=i).call.apply(F,[_,B].concat(N))})}}var p;if(typeof i!="function"&&We(6),s!==void 0&&typeof s!="function"&&We(7),Ye(a)){var m=ac(n),h=Qn(n,a,void 0),g=!0;try{p=i(h),g=!1}finally{g?Ho(m):Xn(m)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(C){return Vn(m,s),Kn(C,m)},function(C){throw Ho(m),C}):(Vn(m,s),Kn(p,m))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===yc&&(p=void 0),n.D&&oa(p,!0),s){var S=[],v=[];lt("Patches").M(a,p,S,v),s(S,v)}return p}We(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(p,function(S){return a.apply(void 0,[S].concat(h))})};var s,c,u=n.produce(a,i,function(p,m){s=p,c=m});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,s,c]}):[u,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){Ye(o)||We(8),xt(o)&&(o=jd(o));var n=ac(this),a=Qn(this,o,void 0);return a[Q].C=!0,Xn(n),a},e.finishDraft=function(o,n){var a=o&&o[Q],i=a.A;return Vn(i,n),Kn(void 0,i)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!dc&&We(20),this.O=o},e.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var s=lt("Patches").$;return xt(o)?s(o,n):this.produce(o,function(c){return s(c,n)})},t}(),Me=new qd,Yd=Me.produce,g0=Me.produceWithPatches.bind(Me),b0=Me.setAutoFreeze.bind(Me),x0=Me.setUseProxies.bind(Me),v0=Me.applyPatches.bind(Me),S0=Me.createDraft.bind(Me),O0=Me.finishDraft.bind(Me),Go=Yd;function or(t){"@babel/helpers - typeof";return or=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(t)}function gc(t,e){if(or(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(or(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bc(t){var e=gc(t,"string");return or(e)=="symbol"?e:e+""}function xc(t,e,o){return(e=bc(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function vc(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function ia(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?vc(Object(o),!0).forEach(function(n){xc(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):vc(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ve(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. "}var Sc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),sa=function(){return Math.random().toString(36).substring(7).split("").join(".")},jo={INIT:"@@redux/INIT"+sa(),REPLACE:"@@redux/REPLACE"+sa(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+sa()}};function Xd(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function la(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ve(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ve(1));return o(la)(t,e)}if(typeof t!="function")throw new Error(ve(2));var a=t,i=e,s=[],c=s,u=!1;function p(){c===s&&(c=s.slice())}function m(){if(u)throw new Error(ve(3));return i}function h(C){if(typeof C!="function")throw new Error(ve(4));if(u)throw new Error(ve(5));var _=!0;return p(),c.push(C),function(){if(_){if(u)throw new Error(ve(6));_=!1,p();var N=c.indexOf(C);c.splice(N,1),s=null}}}function g(C){if(!Xd(C))throw new Error(ve(7));if(typeof C.type>"u")throw new Error(ve(8));if(u)throw new Error(ve(9));try{u=!0,i=a(i,C)}finally{u=!1}for(var _=s=c,T=0;T<_.length;T++){var N=_[T];N()}return C}function S(C){if(typeof C!="function")throw new Error(ve(10));a=C,g({type:jo.REPLACE})}function v(){var C,_=h;return C={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(ve(11));function P(){N.next&&N.next(m())}P();var B=_(P);return{unsubscribe:B}}},C[Sc]=function(){return this},C}return g({type:jo.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[Sc]=v,n}function Qd(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:jo.INIT});if(typeof n>"u")throw new Error(ve(12));if(typeof o(void 0,{type:jo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ve(13))})}function Oc(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(o[a]=t[a])}var i=Object.keys(o),s,c;try{Qd(o)}catch(u){c=u}return function(p,m){if(p===void 0&&(p={}),c)throw c;if(0)var h;for(var g=!1,S={},v=0;v<i.length;v++){var C=i[v],_=o[C],T=p[C],N=_(T,m);if(typeof N>"u"){var P=m&&m.type;throw new Error(ve(14))}S[C]=N,g=g||N!==T}return g=g||i.length!==Object.keys(p).length,g?S:p}}function Nr(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Cc(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ve(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},c=e.map(function(u){return u(s)});return i=Nr.apply(void 0,c)(a.dispatch),ia(ia({},a),{},{dispatch:i})}}}function Ec(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(c){return typeof c=="function"?c(a,i,t):s(c)}}};return e}var Ac=Ec();Ac.withExtraArgument=Ec;var ca=Ac;var Nc=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Jd=function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(p){return function(m){return u([p,m])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=p[0]&2?a.return:p[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,p[1])).done)return i;switch(a=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){o.label=p[1];break}if(p[0]===6&&o.label<i[1]){o.label=i[1],i=p;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(p);break}i[2]&&o.ops.pop(),o.trys.pop();continue}p=e.call(t,o)}catch(m){p=[6,m],a=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Ir=function(t,e){for(var o=0,n=e.length,a=t.length;o<n;o++,a++)t[a]=e[o];return t},eu=Object.defineProperty,tu=Object.defineProperties,ru=Object.getOwnPropertyDescriptors,wc=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,nu=Object.prototype.propertyIsEnumerable,Rc=function(t,e,o){return e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Dt=function(t,e){for(var o in e||(e={}))ou.call(e,o)&&Rc(t,o,e[o]);if(wc)for(var n=0,a=wc(e);n<a.length;n++){var o=a[n];nu.call(e,o)&&Rc(t,o,e[o])}return t},da=function(t,e){return tu(t,ru(e))},au=function(t,e,o){return new Promise(function(n,a){var i=function(u){try{c(o.next(u))}catch(p){a(p)}},s=function(u){try{c(o.throw(u))}catch(p){a(p)}},c=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(i,s)};c((o=o.apply(t,e)).next())})};var iu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Nr:Nr.apply(null,arguments)},U0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function su(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var lu=function(t){Nc(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Ir([void 0],o[0].concat(this)))):new(e.bind.apply(e,Ir([void 0],o.concat(this))))},e}(Array),cu=function(t){Nc(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,Ir([void 0],o[0].concat(this)))):new(e.bind.apply(e,Ir([void 0],o.concat(this))))},e}(Array);function fa(t){return Ye(t)?Go(t,function(){}):t}function du(t){return typeof t=="boolean"}function uu(){return function(e){return pu(e)}}function pu(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,c=new lu;if(o&&(du(o)?c.push(ca):c.push(ca.withExtraArgument(o.extraArgument))),0){if(a)var u;if(s)var p}return c}var ua=!0;function Ic(t){var e=uu(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,s=i===void 0?e():i,c=o.devTools,u=c===void 0?!0:c,p=o.preloadedState,m=p===void 0?void 0:p,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(su(a))S=Oc(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;if(typeof v=="function"&&(v=v(e),!ua&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ua&&v.some(function(B){return typeof B!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=Cc.apply(void 0,v),_=Nr;u&&(_=iu(Dt({trace:!ua},typeof u=="object"&&u)));var T=new cu(C),N=T;Array.isArray(g)?N=Ir([C],g):typeof g=="function"&&(N=g(T));var P=_.apply(void 0,N);return la(S,m,P)}function Bt(t,e){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Dt(Dt({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function _c(t){var e={},o=[],n,a={addCase:function(i,s){var c=typeof i=="string"?i:i.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,a},addMatcher:function(i,s){return o.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,o,n]}function fu(t){return typeof t=="function"}function hu(t,e,o,n){o===void 0&&(o=[]);var a=typeof e=="function"?_c(e):[e,o,n],i=a[0],s=a[1],c=a[2],u;if(fu(t))u=function(){return fa(t())};else{var p=fa(t);u=function(){return p}}function m(h,g){h===void 0&&(h=u());var S=Ir([i[g.type]],s.filter(function(v){var C=v.matcher;return C(g)}).map(function(v){var C=v.reducer;return C}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,C){if(C)if(xt(v)){var _=v,T=C(_,g);return T===void 0?v:T}else{if(Ye(v))return Go(v,function(N){return C(N,g)});var T=C(v,g);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},h)}return m.getInitialState=u,m}function yu(t,e){return t+"/"+e}function kc(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:fa(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},c={};a.forEach(function(m){var h=n[m],g=yu(e,m),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,i[m]=S,s[g]=S,c[m]=v?Bt(g,v):Bt(g)});function u(){var m=typeof t.extraReducers=="function"?_c(t.extraReducers):[t.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],v=S===void 0?[]:S,C=m[2],_=C===void 0?void 0:C,T=Dt(Dt({},g),s);return hu(o,function(N){for(var P in T)N.addCase(P,T[P]);for(var B=0,F=v;B<F.length;B++){var we=F[B];N.addMatcher(we.matcher,we.reducer)}_&&N.addDefaultCase(_)})}var p;return{name:e,reducer:function(m,h){return p||(p=u()),p(m,h)},actions:c,caseReducers:i,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var mu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",gu=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=mu[Math.random()*64|0];return e},bu=["name","message","stack","code"],pa=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Tc=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),xu=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=bu;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},G0=function(){function t(e,o,n){var a=Bt(e+"/fulfilled",function(m,h,g,S){return{payload:m,meta:da(Dt({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=Bt(e+"/pending",function(m,h,g){return{payload:void 0,meta:da(Dt({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),s=Bt(e+"/rejected",function(m,h,g,S,v){return{payload:S,error:(n&&n.serializeError||xu)(m||"Rejected"),meta:da(Dt({},v||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,u=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function p(m){return function(h,g,S){var v=n?.idGenerator?n.idGenerator(m):gu(),C=new u,_,T=!1;function N(B){_=B,C.abort()}var P=function(){return au(this,null,function(){var B,F,we,Je,Se,et,pe;return Jd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),Je=(B=n?.condition)==null?void 0:B.call(n,m,{getState:g,extra:S}),Su(Je)?[4,Je]:[3,2];case 1:Je=y.sent(),y.label=2;case 2:if(Je===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,Se=new Promise(function(x,k){return C.signal.addEventListener("abort",function(){return k({name:"AbortError",message:_||"Aborted"})})}),h(i(v,m,(F=n?.getPendingMeta)==null?void 0:F.call(n,{requestId:v,arg:m},{getState:g,extra:S}))),[4,Promise.race([Se,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:v,signal:C.signal,abort:N,rejectWithValue:function(x,k){return new pa(x,k)},fulfillWithValue:function(x,k){return new Tc(x,k)}})).then(function(x){if(x instanceof pa)throw x;return x instanceof Tc?a(x.payload,v,m,x.meta):a(x,v,m)})])];case 3:return we=y.sent(),[3,5];case 4:return et=y.sent(),we=et instanceof pa?s(null,v,m,et.payload,et.meta):s(et,v,m),[3,5];case 5:return pe=n&&!n.dispatchConditionRejection&&s.match(we)&&we.meta.condition,pe||h(we),[2,we]}})})}();return Object.assign(P,{abort:N,requestId:v,arg:m,unwrap:function(){return P.then(vu)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function vu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Su(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Pc="listener",Dc="completed",Bc="cancelled",j0="task-"+Bc,V0="task-"+Dc,K0=Pc+"-"+Bc,Z0=Pc+"-"+Dc;var ha="listenerMiddleware";var q0=Bt(ha+"/add"),Y0=Bt(ha+"/removeAll"),X0=Bt(ha+"/remove");var Lc,Q0=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Lc||(Lc=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ou=function(t){return function(e){setTimeout(e,t)}},J0=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ou(10);hc();function Cu(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}var Vo=class extends Cu(Object){};window.ftReduxStores||(window.ftReduxStores={});var $c=class t extends Vo{static get(e){var o;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Uo(i))return i;if(a==null)return;let s=kc({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),c=Ic({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:s.reducer(u,p)});return window.ftReduxStores[a.name]=new t(s,c,a.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Bo;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,c)=>{let u=s,p=i[u];return p?(...m)=>{let h=p(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[u]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites: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(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Zo=b(L());var Ko=class extends He{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var Au="ft-user-assets",wu={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Jt).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}}},ze=Zo.FtReduxStore.get({name:Au,reducers:wu,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Jt).map(t=>[t,void 0])),bookmarkByMap:{}}}}),ya=class{constructor(e=new Ko){this.assetCountsService=e,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new wo,this.savedSearchesService=new _o,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,Zo.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts())}clearUserAssetCounts(){ze.actions.clearAssetCount(),ze.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ze.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ze.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ze.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ze.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ze.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ze.getState().assetCounts.bookmarkByMap).length!==0;e===Jt.BOOKMARKS&&o&&ze.actions.clearBookmarkCountByMap(),ze.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ze.actions.bookmarks(o)}}},Ru=new ya;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ru);(0,Fc.customElement)("ft-app-context")(K);var zc=b(Z());var Tu=b(L());function Mc(t){return t.match(/^[\w-]+\.[\w-]+$/)}var Lu=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Uc=Symbol("i18nAttributes"),Hc=Symbol("i18nListAttributes"),Gc=Symbol("i18nProperties"),qo=Symbol("i18nContexts"),eo=Symbol("i18nUnsubs");function Qo(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?To:Er}i18n(i){var s;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let c=(s=i.args)!==null&&s!==void 0?s:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...c)}customI18n(i,s){if(Mc(i)){let[c,u]=i.split(".");return this.i18n({custom:!0,context:c,key:u,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,u)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let u=this,p=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,...m})}:g;(s=this[Uc])===null||s===void 0||s.forEach((m,h)=>u[h]=p(m,h,u[h])),(c=this[Hc])===null||c===void 0||c.forEach((m,h)=>{var g;return u[h]=(g=u[h])===null||g===void 0?void 0:g.map(S=>p(m,h,S))})}updateI18nProperties(i){var s;(s=this[Gc])===null||s===void 0||s.forEach((c,u)=>{i(c,u)&&(this[u]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let u=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[qo].set(u,{isCustomContext:c}),this[eo].has(u)||this[eo].set(u,this.getI18nService(c).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(c).prepareContext(u,s)}hasI18nContext(i){return this[qo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[qo].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[eo].forEach(i=>i()),this[eo].clear()}}return e=qo,o=eo,Lu([(0,zc.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var Wc=class extends Qo(Xo.FtLitElement){},Yo=class extends Qo(Xo.FtLitElementRedux){};var to=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Xe=class extends Yo{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Jo.nothing:Jo.html`
1838
1838
  <span class="ft-i18n">
1839
1839
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
1840
1840
  </span>