@fluid-topics/ft-combobox 1.3.46 → 1.3.47

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.
@@ -2121,7 +2121,7 @@ Also for action icons.`,s.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
2121
2121
  `;var Wr=b(N());var ud=b(N());var gc=b(Z()),we=b(se()),st=b(N());var Rl=b(Z());var Tl=Rl.css`
2122
2122
  `;var Bo=b(N()),Jd="ft-app-info",nr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};nr.eventName="authentication-change";var ep={session:(t,e)=>{(0,Bo.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new nr(e.payload)),0))}},I=Bo.FtReduxStore.get({name:Jd,reducers:ep,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 Ri=b(N());var ir=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=I.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=I.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Mo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ir.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ir.await()}};var ze=class extends Mo{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([c],[p])=>c.localeCompare(p)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Ri.CacheRegistry,this.cache=e?i.commonCache:new Ri.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 Uo=class extends ze{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 Ti=class{addCommand(e,o=!1){I.commands.add(e,o)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ti;var Xe=b(N());var Ll,_r=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},tp=Symbol("clearAfterUnitTest"),Fo=class extends(0,Xe.withEventBus)(ze){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ll]=()=>{this.defaultMessages={},this.cache=new Xe.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 i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};(0,Xe.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,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 i;let a=e.toLowerCase(),l=this.resolveContext(a);return new Xe.ParametrizedLabelResolver((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},l).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(i){!(i instanceof Xe.CanceledPromiseError)&&o&&console.error(i)}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 i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new _r({loadedContexts:e})),this.dispatchEvent(new _r({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new _r({loadedContexts:[e]})),this.dispatchEvent(new _r({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,Xe.delay)(0).then(()=>n()).catch(()=>null)))}};Ll=tp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Fo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Fo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var kr=window.FluidTopicsI18nService,zo=window.FluidTopicsCustomI18nService;var Il=b(N()),Li=class{highlightHtml(e,o,n){(0,Il.highlightHtml)(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Li;var op=b(Pl(),1);var _l;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(_l||(_l={}));var kl;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(kl||(kl={}));var $l;(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",t.HTML_PACKAGE="HTML_PACKAGE"})($l||($l={}));var Dl;(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",t.HTML_PACKAGE="HTML_PACKAGE"})(Dl||(Dl={}));var Bl;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Bl||(Bl={}));var Ml;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ml||(Ml={}));var Ul;(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.CHATBOT__RATE="CHATBOT__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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",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"})(Ul||(Ul={}));var Fl;(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"})(Fl||(Fl={}));var zl;(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",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT"})(zl||(zl={}));var Hl;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Hl||(Hl={}));var Wl;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Wl||(Wl={}));var Vl;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Vl||(Vl={}));var Gl;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Gl||(Gl={}));var jl;(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"})(jl||(jl={}));var Kl;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Kl||(Kl={}));var Zl;(function(t){t.ASC="ASC",t.DESC="DESC"})(Zl||(Zl={}));var ql;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(ql||(ql={}));var Yl;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Yl||(Yl={}));var Xl;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Xl||(Xl={}));var Ql;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Ql||(Ql={}));var Jl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Jl||(Jl={}));var ec;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ec||(ec={}));var tc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(tc||(tc={}));var rc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(rc||(rc={}));var oc;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(oc||(oc={}));var be;(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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(be||(be={}));var Qe;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(Qe||(Qe={}));var nc;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(nc||(nc={}));var ic;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(ic||(ic={}));var ac;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(ac||(ac={}));var sc;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(sc||(sc={}));var lc;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(lc||(lc={}));var rp={[be.PERSONAL_BOOK_SHARE_USER]:[be.PERSONAL_BOOK_USER],[be.HTML_EXPORT_USER]:[be.PERSONAL_BOOK_USER],[be.PDF_EXPORT_USER]:[be.PERSONAL_BOOK_USER],[be.KHUB_ADMIN]:[be.CONTENT_PUBLISHER],[be.ADMIN]:[be.KHUB_ADMIN,be.USERS_ADMIN,be.PORTAL_ADMIN],[be.GENERATIVE_AI_EXPORT_USER]:[be.GENERATIVE_AI_USER]};function cc(t,e){return t===e||(rp[t]??[]).some(o=>cc(o,e))}function dc(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=>cc(n,e))}var Vo=class extends ze{async listMySearches(){let{session:e}=I.getState();return dc(e,be.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var pc=b(N());var Ii=class{isDate(e){var o,n,i,a;return(a=(i=((n=(o=I.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a;return pc.DateFormatter.format(e,(n=o?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ii;var uc=b(N());var lo=class{static get(e,o){var n,i;let a=I.getState(),{lang:l,region:c}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new uc.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,o??`${l}-${c}`)}};var Ni=class{urlToSearchRequest(e){return lo.get().parse(e)}searchRequestToUrl(e){return lo.get().serialize(e)}};window.FluidTopicsUrlService=new Ni;var zt=b(N());var ar=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ar.eventName="change";var Pi=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))}},fc=new Pi;var Go=class t extends zt.WithEventBus{static build(){return new t(window.history,fc,()=>window.location,!1)}constructor(e,o,n,i){var a,l;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(l=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&l!==void 0?l:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}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,zt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ar(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,l,c])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[u,l,c]),this.setCurrentState(u,!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(ar.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ar.eventName,e)}currentItem(){return(0,zt.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,zt.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,zt.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 i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}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 i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Go.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 hc=I;function yc(t,e){var o;return hc.getState().authenticationRequired&&!(!((o=hc.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var xe=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},oe=class extends st.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=()=>ir.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new st.CacheRegistry,this.cleanSessionDebouncer=new st.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return gc.html`
2123
2123
  <slot></slot>
2124
- `}connectedCallback(){super.connectedCallback(),I.addEventListener(nr.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(nr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,l,c,p;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(u=>kr.addContext(u)),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((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),I.actions.searchInAllLanguagesAllowed((l=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),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",()=>yc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};oe.elementDefinitions={};oe.styles=Tl;xe([(0,we.property)()],oe.prototype,"baseUrl",void 0);xe([(0,we.property)()],oe.prototype,"apiIntegrationIdentifier",void 0);xe([(0,we.property)()],oe.prototype,"apiIntegrationAppVersion",void 0);xe([(0,we.property)()],oe.prototype,"uiLocale",void 0);xe([(0,st.jsonProperty)(null)],oe.prototype,"availableUiLocales",void 0);xe([(0,st.jsonProperty)(null)],oe.prototype,"metadataConfiguration",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"editorMode",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"noCustom",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);xe([(0,we.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"withManualResources",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"navigatorOnline",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"forcedOffline",void 0);xe([(0,we.property)({type:Object})],oe.prototype,"apiProvider",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"authenticationRequired",void 0);xe([(0,st.jsonProperty)([])],oe.prototype,"messageContexts",void 0);xe([(0,st.jsonProperty)(void 0)],oe.prototype,"session",void 0);xe([(0,we.state)()],oe.prototype,"localesConfiguration",void 0);xe([(0,we.state)()],oe.prototype,"availableContentLocales",void 0);var oa=b(se());function np(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let o,n,i;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!jo(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(!jo(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 a=l=>Object.keys(l).filter(c=>l[c]!=null);if(i=a(t),o=i.length,o!==a(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=o;n--!==0;){let l=i[n];if(!jo(t[l],e[l]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function jo(t,e){try{return np(t,e)}catch{return!1}}function co(t,e){return!jo(t,e)}function Ko(t,e){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let i=e(n);return i[t]=!0,i}}var mc=b(se(),1);var _i=t=>{let e=t??{};return(o,n)=>{var i;let a={hasChanged:co,attribute:!1,...e};(0,mc.property)(a)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}};var Zo=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 sr=b(se(),1);var bc=b(se(),1);function xc(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,bc.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:co,...e??{}})}var qo=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 i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(c){i(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Sc=b(Z(),1);var Yo=globalThis,ip=Yo.ShadowRoot&&(Yo.ShadyCSS===void 0||Yo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,P0=Symbol();var vc=(t,e)=>{if(ip)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),i=Yo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,t.appendChild(n)}};var Xo=class extends Sc.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return vc(n,e.elementStyles),n}};function Cc(t,e,...o){var n;let i=t.querySelector(e);for(let a of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(a);return i}var Br=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Ac,Oc=Symbol("constructorPrototype"),Ec=Symbol("constructorName"),Rc=Symbol("exportpartsDebouncer"),wc=Symbol("dynamicDependenciesLoaded"),Dr=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Dr.eventName="exportparts-updated";var yt=class extends Xo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ac]=new qo(5),this.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[Rc].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ec]=this.constructor.name,this[Oc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ec]&&Object.setPrototypeOf(this,this[Oc])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let o=this.constructor;o[wc]||(o[wc]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Dr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Dr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new Dr)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let a=[...i??[],n];o=Cc(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,i;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}setExportpartsAttribute(e){var o,n,i,a,l,c;let p=m=>m!=null&&m.trim().length>0,u=e.filter(p).map(m=>m.trim());if(u.length===0){this.exportparts=void 0;return}let g=new Set;for(let m of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(a=(i=m.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],v=(c=(l=m.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(T=>T.split(":")[1]))!==null&&c!==void 0?c:[],O=[...S,...v].filter(p).map(T=>T.trim());for(let T of O)g.add(T)}if(g.size===0){this.exportparts=void 0;return}let h=[...g.values()].flatMap(m=>u.map(S=>`${m}:${S}--${m}`));this.exportparts=[...this.part,...h].join(", ")}};Ac=Rc;Br([(0,sr.property)()],yt.prototype,"exportpartsPrefix",void 0);Br([xc([])],yt.prototype,"exportpartsPrefixes",void 0);Br([(0,sr.property)({reflect:!0})],yt.prototype,"exportparts",void 0);Br([(0,sr.property)()],yt.prototype,"customStylesheet",void 0);Br([(0,sr.property)()],yt.prototype,"elementToFocus",void 0);Br([(0,sr.state)()],yt.prototype,"useAdoptedStyleSheets",void 0);function Qo(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var po=Symbol("internalReduxEventsUnsubscribers"),Ht=Symbol("internalStoresUnsubscribers"),lr=Symbol("internalStores"),ap=Ko(Symbol("withRedux"),function(t){var e,o,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(c=>l.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[lr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[lr].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[lr].get(l)}addStore(l,c){var p;c=(p=c??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[lr].set(c,l),this.subscribeToStore(c,l),this.updateFromStores()}removeStore(l){let c=typeof l=="string"?l:l.name;this.unsubscribeFromStore(c),this[lr].delete(c)}setupStores(){this.unsubscribeFromStores(),this[lr].forEach((l,c)=>this.subscribeToStore(c,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(l.store);u&&(l.store?this[Ht].has(l.store):this[Ht].size>0)&&(this[c]=l.selector(u.getState(),this))}})}subscribeToStore(l,c){var p;this[Ht].set(l,c.subscribe(()=>this.updateFromStores())),this[po].set(l,[]),Qo(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,g)=>{if(typeof this[g]=="function"&&(!u.store||c.name===u.store)){let h=m=>this[g](m);c.addEventListener(u.eventName,h),this[po].get(l).push(()=>c.removeEventListener(u.eventName,h))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[Ht].forEach((l,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(l){var c;this[Ht].has(l)&&this[Ht].get(l)(),this[Ht].delete(l),(c=this[po].get(l))===null||c===void 0||c.forEach(p=>p()),this[po].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ht,o=lr,n=po,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Tc=class extends ap(yt){};function Je(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 i,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Lt(t){return!!t&&!!t[ie]}function lt(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 i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===hp}(t)||Array.isArray(t)||!!t[$c]||!!(!((e=t.constructor)===null||e===void 0)&&e[$c])||Hi(t)||Wi(t))}function cr(t,e,o){o===void 0&&(o=!1),Fr(t)===0?(o?Object.keys:Ur)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Fr(t){var e=t[ie];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Hi(t)?2:Wi(t)?3:0}function Mr(t,e){return Fr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function sp(t,e){return Fr(t)===2?t.get(e):t[e]}function Dc(t,e,o){var n=Fr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Bc(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Hi(t){return up&&t instanceof Map}function Wi(t){return fp&&t instanceof Set}function Wt(t){return t.o||t.t}function Vi(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Fc(t);delete e[ie];for(var o=Ur(e),n=0;n<o.length;n++){var i=o[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Gi(t,e){return e===void 0&&(e=!1),ji(t)||Lt(t)||!lt(t)||(Fr(t)>1&&(t.set=t.add=t.clear=t.delete=lp),Object.freeze(t),e&&cr(t,function(o,n){return Gi(n,!0)},!0)),t}function lp(){Je(2)}function ji(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function gt(t){var e=zi[t];return e||Je(18,t),e}function cp(t,e){zi[t]||(zi[t]=e)}function Mi(){return fo}function ki(t,e){e&&(gt("Patches"),t.u=[],t.s=[],t.v=e)}function Jo(t){Ui(t),t.p.forEach(dp),t.p=null}function Ui(t){t===fo&&(fo=t.l)}function Lc(t){return fo={p:[],l:fo,h:t,m:!0,_:0}}function dp(t){var e=t[ie];e.i===0||e.i===1?e.j():e.g=!0}function $i(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||gt("ES5").S(e,t,n),n?(o[ie].P&&(Jo(e),Je(4)),lt(t)&&(t=en(e,t),e.l||tn(e,t)),e.u&&gt("Patches").M(o[ie].t,t,e.u,e.s)):t=en(e,o,[]),Jo(e),e.u&&e.v(e.u,e.s),t!==Uc?t:void 0}function en(t,e,o){if(ji(e))return e;var n=e[ie];if(!n)return cr(e,function(c,p){return Ic(t,n,e,c,p,o)},!0),e;if(n.A!==t)return e;if(!n.P)return tn(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Vi(n.k):n.o,a=i,l=!1;n.i===3&&(a=new Set(i),i.clear(),l=!0),cr(a,function(c,p){return Ic(t,n,i,c,p,o,l)}),tn(t,i,!1),o&&t.u&&gt("Patches").N(n,o,t.u,t.s)}return n.o}function Ic(t,e,o,n,i,a,l){if(Lt(i)){var c=en(t,i,a&&e&&e.i!==3&&!Mr(e.R,n)?a.concat(n):void 0);if(Dc(o,n,c),!Lt(c))return;t.m=!1}else l&&o.add(i);if(lt(i)&&!ji(i)){if(!t.h.D&&t._<1)return;en(t,i),e&&e.A.l||tn(t,i)}}function tn(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Gi(e,o)}function Di(t,e){var o=t[ie];return(o?Wt(o):t)[e]}function Nc(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 Vt(t){t.P||(t.P=!0,t.l&&Vt(t.l))}function Bi(t){t.o||(t.o=Vi(t.t))}function Fi(t,e,o){var n=Hi(e)?gt("MapSet").F(e,o):Wi(e)?gt("MapSet").T(e,o):t.O?function(i,a){var l=Array.isArray(i),c={i:l?1:0,A:a?a.A:Mi(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=c,u=ho;l&&(p=[c],u=uo);var g=Proxy.revocable(p,u),h=g.revoke,m=g.proxy;return c.k=m,c.j=h,m}(e,o):gt("ES5").J(e,o);return(o?o.A:Mi()).p.push(n),n}function pp(t){return Lt(t)||Je(22,t),function e(o){if(!lt(o))return o;var n,i=o[ie],a=Fr(o);if(i){if(!i.P&&(i.i<4||!gt("ES5").K(i)))return i.t;i.I=!0,n=Pc(o,a),i.I=!1}else n=Pc(o,a);return cr(n,function(l,c){i&&sp(i.t,l)===c||Dc(n,l,e(c))}),a===3?new Set(n):n}(t)}function Pc(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Vi(t)}function Mc(){function t(l,c){var p=a[l];return p?p.enumerable=c:a[l]=p={configurable:!0,enumerable:c,get:function(){var u=this[ie];return ho.get(u,l)},set:function(u){var g=this[ie];ho.set(g,l,u)}},p}function e(l){for(var c=l.length-1;c>=0;c--){var p=l[c][ie];if(!p.P)switch(p.i){case 5:n(p)&&Vt(p);break;case 4:o(p)&&Vt(p)}}}function o(l){for(var c=l.t,p=l.k,u=Ur(p),g=u.length-1;g>=0;g--){var h=u[g];if(h!==ie){var m=c[h];if(m===void 0&&!Mr(c,h))return!0;var S=p[h],v=S&&S[ie];if(v?v.t!==m:!Bc(S,m))return!0}}var O=!!c[ie];return u.length!==Ur(c).length+(O?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function i(l){l.g&&Je(3,JSON.stringify(Wt(l)))}var a={};cp("ES5",{J:function(l,c){var p=Array.isArray(l),u=function(h,m){if(h){for(var S=Array(m.length),v=0;v<m.length;v++)Object.defineProperty(S,""+v,t(v,!0));return S}var O=Fc(m);delete O[ie];for(var T=Ur(O),R=0;R<T.length;R++){var L=T[R];O[L]=t(L,h||!!O[L].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(p,l),g={i:p?5:4,A:c?c.A:Mi(),P:!1,I:!1,R:{},l:c,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,ie,{value:g,writable:!0}),u},S:function(l,c,p){p?Lt(c)&&c[ie].A===l&&e(l.p):(l.u&&function u(g){if(g&&typeof g=="object"){var h=g[ie];if(h){var m=h.t,S=h.k,v=h.R,O=h.i;if(O===4)cr(S,function(V){V!==ie&&(m[V]!==void 0||Mr(m,V)?v[V]||u(S[V]):(v[V]=!0,Vt(h)))}),cr(m,function(V){S[V]!==void 0||Mr(S,V)||(v[V]=!1,Vt(h))});else if(O===5){if(n(h)&&(Vt(h),v.length=!0),S.length<m.length)for(var T=S.length;T<m.length;T++)v[T]=!1;else for(var R=m.length;R<S.length;R++)v[R]=!0;for(var L=Math.min(S.length,m.length),U=0;U<L;U++)S.hasOwnProperty(U)||(v[U]=!0),v[U]===void 0&&u(S[U])}}}}(l.p[0]),e(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var _c,fo,Ki=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",up=typeof Map<"u",fp=typeof Set<"u",kc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Uc=Ki?Symbol.for("immer-nothing"):((_c={})["immer-nothing"]=!0,_c),$c=Ki?Symbol.for("immer-draftable"):"__$immer_draftable",ie=Ki?Symbol.for("immer-state"):"__$immer_state";var hp=""+Object.prototype.constructor,Ur=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Fc=Object.getOwnPropertyDescriptors||function(t){var e={};return Ur(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},zi={},ho={get:function(t,e){if(e===ie)return t;var o=Wt(t);if(!Mr(o,e))return function(i,a,l){var c,p=Nc(a,l);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(i.k):void 0}(t,o,e);var n=o[e];return t.I||!lt(n)?n:n===Di(t.t,e)?(Bi(t),t.o[e]=Fi(t.A.h,n,t)):n},has:function(t,e){return e in Wt(t)},ownKeys:function(t){return Reflect.ownKeys(Wt(t))},set:function(t,e,o){var n=Nc(Wt(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var i=Di(Wt(t),e),a=i?.[ie];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Bc(o,i)&&(o!==void 0||Mr(t.t,e)))return!0;Bi(t),Vt(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 Di(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Bi(t),Vt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Wt(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){Je(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Je(12)}},uo={};cr(ho,function(t,e){uo[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),uo.deleteProperty=function(t,e){return uo.set.call(this,t,e,void 0)},uo.set=function(t,e,o){return ho.set.call(this,t[0],e,o,t[0])};var yp=function(){function t(o){var n=this;this.O=kc,this.D=!0,this.produce=function(i,a,l){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var p=n;return function(O){var T=this;O===void 0&&(O=c);for(var R=arguments.length,L=Array(R>1?R-1:0),U=1;U<R;U++)L[U-1]=arguments[U];return p.produce(O,function(V){var j;return(j=a).call.apply(j,[T,V].concat(L))})}}var u;if(typeof a!="function"&&Je(6),l!==void 0&&typeof l!="function"&&Je(7),lt(i)){var g=Lc(n),h=Fi(n,i,void 0),m=!0;try{u=a(h),m=!1}finally{m?Jo(g):Ui(g)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return ki(g,l),$i(O,g)},function(O){throw Jo(g),O}):(ki(g,l),$i(u,g))}if(!i||typeof i!="object"){if((u=a(i))===void 0&&(u=i),u===Uc&&(u=void 0),n.D&&Gi(u,!0),l){var S=[],v=[];gt("Patches").M(i,u,S,v),l(S,v)}return u}Je(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(u){for(var g=arguments.length,h=Array(g>1?g-1:0),m=1;m<g;m++)h[m-1]=arguments[m];return n.produceWithPatches(u,function(S){return i.apply(void 0,[S].concat(h))})};var l,c,p=n.produce(i,a,function(u,g){l=u,c=g});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,c]}):[p,l,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){lt(o)||Je(8),Lt(o)&&(o=pp(o));var n=Lc(this),i=Fi(this,o,void 0);return i[ie].C=!0,Ui(n),i},e.finishDraft=function(o,n){var i=o&&o[ie],a=i.A;return ki(a,n),$i(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!kc&&Je(20),this.O=o},e.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}i>-1&&(n=n.slice(i+1));var l=gt("Patches").$;return Lt(o)?l(o,n):this.produce(o,function(c){return l(c,n)})},t}(),He=new yp,gp=He.produce,K0=He.produceWithPatches.bind(He),Z0=He.setAutoFreeze.bind(He),q0=He.setUseProxies.bind(He),Y0=He.applyPatches.bind(He),X0=He.createDraft.bind(He),Q0=He.finishDraft.bind(He),rn=gp;function dr(t){"@babel/helpers - typeof";return dr=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},dr(t)}function zc(t,e){if(dr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(dr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hc(t){var e=zc(t,"string");return dr(e)=="symbol"?e:e+""}function Wc(t,e,o){return(e=Hc(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(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Zi(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){Wc(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 Le(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 Gc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),qi=function(){return Math.random().toString(36).substring(7).split("").join(".")},on={INIT:"@@redux/INIT"+qi(),REPLACE:"@@redux/REPLACE"+qi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+qi()}};function mp(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 Yi(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(Le(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(Le(1));return o(Yi)(t,e)}if(typeof t!="function")throw new Error(Le(2));var i=t,a=e,l=[],c=l,p=!1;function u(){c===l&&(c=l.slice())}function g(){if(p)throw new Error(Le(3));return a}function h(O){if(typeof O!="function")throw new Error(Le(4));if(p)throw new Error(Le(5));var T=!0;return u(),c.push(O),function(){if(T){if(p)throw new Error(Le(6));T=!1,u();var L=c.indexOf(O);c.splice(L,1),l=null}}}function m(O){if(!mp(O))throw new Error(Le(7));if(typeof O.type>"u")throw new Error(Le(8));if(p)throw new Error(Le(9));try{p=!0,a=i(a,O)}finally{p=!1}for(var T=l=c,R=0;R<T.length;R++){var L=T[R];L()}return O}function S(O){if(typeof O!="function")throw new Error(Le(10));i=O,m({type:on.REPLACE})}function v(){var O,T=h;return O={subscribe:function(L){if(typeof L!="object"||L===null)throw new Error(Le(11));function U(){L.next&&L.next(g())}U();var V=T(U);return{unsubscribe:V}}},O[Gc]=function(){return this},O}return m({type:on.INIT}),n={dispatch:m,subscribe:h,getState:g,replaceReducer:S},n[Gc]=v,n}function bp(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:on.INIT});if(typeof n>"u")throw new Error(Le(12));if(typeof o(void 0,{type:on.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Le(13))})}function jc(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(o[i]=t[i])}var a=Object.keys(o),l,c;try{bp(o)}catch(p){c=p}return function(u,g){if(u===void 0&&(u={}),c)throw c;if(0)var h;for(var m=!1,S={},v=0;v<a.length;v++){var O=a[v],T=o[O],R=u[O],L=T(R,g);if(typeof L>"u"){var U=g&&g.type;throw new Error(Le(14))}S[O]=L,m=m||L!==R}return m=m||a.length!==Object.keys(u).length,m?S:u}}function zr(){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,i){return function(){return n(i.apply(void 0,arguments))}})}function Kc(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(Le(15))},l={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(l)});return a=zr.apply(void 0,c)(i.dispatch),Zi(Zi({},i),{},{dispatch:a})}}}function Zc(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(l){return function(c){return typeof c=="function"?c(i,a,t):l(c)}}};return e}var qc=Zc();qc.withExtraArgument=Zc;var Xi=qc;var ed=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},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)}}(),xp=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(u){return function(g){return p([u,g])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(g){u=[6,g],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Hr=function(t,e){for(var o=0,n=e.length,i=t.length;o<n;o++,i++)t[i]=e[o];return t},vp=Object.defineProperty,Sp=Object.defineProperties,Cp=Object.getOwnPropertyDescriptors,Yc=Object.getOwnPropertySymbols,Op=Object.prototype.hasOwnProperty,Ep=Object.prototype.propertyIsEnumerable,Xc=function(t,e,o){return e in t?vp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Gt=function(t,e){for(var o in e||(e={}))Op.call(e,o)&&Xc(t,o,e[o]);if(Yc)for(var n=0,i=Yc(e);n<i.length;n++){var o=i[n];Ep.call(e,o)&&Xc(t,o,e[o])}return t},Qi=function(t,e){return Sp(t,Cp(e))},wp=function(t,e,o){return new Promise(function(n,i){var a=function(p){try{c(o.next(p))}catch(u){i(u)}},l=function(p){try{c(o.throw(p))}catch(u){i(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,l)};c((o=o.apply(t,e)).next())})};var Ap=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zr:zr.apply(null,arguments)},gC=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Rp(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 Tp=function(t){ed(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}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,Hr([void 0],o[0].concat(this)))):new(e.bind.apply(e,Hr([void 0],o.concat(this))))},e}(Array),Lp=function(t){ed(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}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,Hr([void 0],o[0].concat(this)))):new(e.bind.apply(e,Hr([void 0],o.concat(this))))},e}(Array);function ta(t){return lt(t)?rn(t,function(){}):t}function Ip(t){return typeof t=="boolean"}function Np(){return function(e){return Pp(e)}}function Pp(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,l=a===void 0?!0:a,c=new Tp;if(o&&(Ip(o)?c.push(Xi):c.push(Xi.withExtraArgument(o.extraArgument))),0){if(i)var p;if(l)var u}return c}var Ji=!0;function td(t){var e=Np(),o=t||{},n=o.reducer,i=n===void 0?void 0:n,a=o.middleware,l=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,g=u===void 0?void 0:u,h=o.enhancers,m=h===void 0?void 0:h,S;if(typeof i=="function")S=i;else if(Rp(i))S=jc(i);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=l;if(typeof v=="function"&&(v=v(e),!Ji&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ji&&v.some(function(V){return typeof V!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Kc.apply(void 0,v),T=zr;p&&(T=Ap(Gt({trace:!Ji},typeof p=="object"&&p)));var R=new Lp(O),L=R;Array.isArray(m)?L=Hr([O],m):typeof m=="function"&&(L=m(R));var U=T.apply(void 0,L);return Yi(S,g,U)}function jt(t,e){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return Gt(Gt({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.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 rd(t){var e={},o=[],n,i={addCase:function(a,l){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=l,i},addMatcher:function(a,l){return o.push({matcher:a,reducer:l}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,o,n]}function _p(t){return typeof t=="function"}function kp(t,e,o,n){o===void 0&&(o=[]);var i=typeof e=="function"?rd(e):[e,o,n],a=i[0],l=i[1],c=i[2],p;if(_p(t))p=function(){return ta(t())};else{var u=ta(t);p=function(){return u}}function g(h,m){h===void 0&&(h=p());var S=Hr([a[m.type]],l.filter(function(v){var O=v.matcher;return O(m)}).map(function(v){var O=v.reducer;return O}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,O){if(O)if(Lt(v)){var T=v,R=O(T,m);return R===void 0?v:R}else{if(lt(v))return rn(v,function(L){return O(L,m)});var R=O(v,m);if(R===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}return v},h)}return g.getInitialState=p,g}function $p(t,e){return t+"/"+e}function od(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:ta(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},l={},c={};i.forEach(function(g){var h=n[g],m=$p(e,g),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,a[g]=S,l[m]=S,c[g]=v?jt(m,v):jt(m)});function p(){var g=typeof t.extraReducers=="function"?rd(t.extraReducers):[t.extraReducers],h=g[0],m=h===void 0?{}:h,S=g[1],v=S===void 0?[]:S,O=g[2],T=O===void 0?void 0:O,R=Gt(Gt({},m),l);return kp(o,function(L){for(var U in R)L.addCase(U,R[U]);for(var V=0,j=v;V<j.length;V++){var Pe=j[V];L.addMatcher(Pe.matcher,Pe.reducer)}T&&L.addDefaultCase(T)})}var u;return{name:e,reducer:function(g,h){return u||(u=p()),u(g,h)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Dp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Bp=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=Dp[Math.random()*64|0];return e},Mp=["name","message","stack","code"],ea=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Qc=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Up=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=Mp;o<n.length;o++){var i=n[o];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},vC=function(){function t(e,o,n){var i=jt(e+"/fulfilled",function(g,h,m,S){return{payload:g,meta:Qi(Gt({},S||{}),{arg:m,requestId:h,requestStatus:"fulfilled"})}}),a=jt(e+"/pending",function(g,h,m){return{payload:void 0,meta:Qi(Gt({},m||{}),{arg:h,requestId:g,requestStatus:"pending"})}}),l=jt(e+"/rejected",function(g,h,m,S,v){return{payload:S,error:(n&&n.serializeError||Up)(g||"Rejected"),meta:Qi(Gt({},v||{}),{arg:m,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function g(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return g.prototype.abort=function(){},g}();function u(g){return function(h,m,S){var v=n?.idGenerator?n.idGenerator(g):Bp(),O=new p,T,R=!1;function L(V){T=V,O.abort()}var U=function(){return wp(this,null,function(){var V,j,Pe,dt,Ie,pt,Ce;return xp(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),dt=(V=n?.condition)==null?void 0:V.call(n,g,{getState:m,extra:S}),zp(dt)?[4,dt]:[3,2];case 1:dt=y.sent(),y.label=2;case 2:if(dt===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return R=!0,Ie=new Promise(function(x,k){return O.signal.addEventListener("abort",function(){return k({name:"AbortError",message:T||"Aborted"})})}),h(a(v,g,(j=n?.getPendingMeta)==null?void 0:j.call(n,{requestId:v,arg:g},{getState:m,extra:S}))),[4,Promise.race([Ie,Promise.resolve(o(g,{dispatch:h,getState:m,extra:S,requestId:v,signal:O.signal,abort:L,rejectWithValue:function(x,k){return new ea(x,k)},fulfillWithValue:function(x,k){return new Qc(x,k)}})).then(function(x){if(x instanceof ea)throw x;return x instanceof Qc?i(x.payload,v,g,x.meta):i(x,v,g)})])];case 3:return Pe=y.sent(),[3,5];case 4:return pt=y.sent(),Pe=pt instanceof ea?l(null,v,g,pt.payload,pt.meta):l(pt,v,g),[3,5];case 5:return Ce=n&&!n.dispatchConditionRejection&&l.match(Pe)&&Pe.meta.condition,Ce||h(Pe),[2,Pe]}})})}();return Object.assign(U,{abort:L,requestId:v,arg:g,unwrap:function(){return U.then(Fp)}})}}return Object.assign(u,{pending:a,rejected:l,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Fp(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function zp(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var nd="listener",id="completed",ad="cancelled",SC="task-"+ad,CC="task-"+id,OC=nd+"-"+ad,EC=nd+"-"+id;var ra="listenerMiddleware";var wC=jt(ra+"/add"),AC=jt(ra+"/removeAll"),RC=jt(ra+"/remove");var Jc,TC=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Jc||(Jc=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Hp=function(t){return function(e){setTimeout(e,t)}},LC=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Hp(10);Mc();var Wp=Ko(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,i){this.eventBus.addEventListener(o,n,i)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,i){this.eventBus.removeEventListener(o,n,i)}}}),nn=class extends Wp(Object){};window.ftReduxStores||(window.ftReduxStores={});var sd=class t extends nn{static get(e){var o;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Qo(a))return a;if(i==null)return;let l=od({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),c=td({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[i.name]=new t(l,c,i.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Zo;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,l,c)=>{let p=l,u=a[p];return u?(...g)=>{let h=u(...g.map(i));return this.reduxStore.dispatch(h),h}:g=>{this.setState({[p]:i(g)})}}}),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 an=class{static format(e,o,n,i){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(e,o,n,i)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,n,i){let a=typeof e=="string"?new Date(e):e,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(a);if(!i)return l;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(a);return`${l} ${c}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var ld=b(N()),sn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},JC=(0,ld.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>an.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return sn([(0,oa.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),sn([(0,oa.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),sn([_i({store:I.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),sn([_i({store:I.name})],e.prototype,"uiLocale",void 0),e});var dn=b(N());var ln=class extends ze{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 cn=class extends ze{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var Vp="ft-user-assets",Gp={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Qe).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={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;ia(t,o,[...na(t,o),i]),cd(t,o,1,n),dd(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;ia(t,o,na(t,o).map(i=>i.id===n.id?n:i)),dd(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;ia(t,o,na(t,o).filter(a=>a.id!==i)),cd(t,o,-1,n)}},pd={[Qe.SEARCHES]:"savedSearches",[Qe.BOOKMARKS]:"bookmarks",[Qe.BOOKS]:void 0,[Qe.COLLECTIONS]:void 0},na=(t,e)=>{var o;let n=pd[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},ia=(t,e,o)=>{let n=pd[e];n&&(t[n]=o)},cd=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===Qe.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},dd=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},We=dn.FtReduxStore.get({name:Vp,reducers:Gp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Qe).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),aa=class{constructor(e=new ln,o=new cn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Uo,this.savedSearchesService=new Vo,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,dn.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),We.actions.clearAssetCount(),We.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),We.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),We.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();We.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();We.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&We.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&We.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(We.getState().assetCounts.bookmarkByMap).length!==0;e===Qe.BOOKMARKS&&o&&We.actions.clearBookmarkCountByMap(),We.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;We.actions.bookmarks(o)}}},jp=new aa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=jp);(0,ud.customElement)("ft-app-context")(oe);var yd=b(se());var sa=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},fd=new sa;var Kp=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Zp=Symbol("i18nAttributes"),qp=Symbol("i18nListAttributes"),gd=Symbol("i18nProperties"),pn=Symbol("i18nContexts"),yo=Symbol("i18nUnsubs"),fn=(0,Wr.applyMixinOnce)(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?zo:kr}i18n(a){let{context:l,key:c,message:p}=a,{custom:u,args:g,argsProvider:h}=a;if(l&&c){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let m=g??(h?h(this):[]);return this.getI18nService(u).resolveMessage(l,c,...m)}return p}async awaitI18n(a){let{context:l,custom:c}=a;return l&&await this.getI18nService(c).prepareContext(l),this.i18n(a)}customI18n(a,l){if(fd.isI18nKey(a)){let[c,p]=a.split(".");return this.i18n({custom:!0,context:c,key:p,...l})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((l,c,p)=>a.has(c)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((l,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(l=>l.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var l,c;let p=this,u=(g,h,m)=>m?.context&&m.key&&a(g,h,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...g})}:m;(l=this[Zp])===null||l===void 0||l.forEach((g,h)=>p[h]=u(g,h,p[h])),(c=this[qp])===null||c===void 0||c.forEach((g,h)=>{var m;return p[h]=(m=p[h])===null||m===void 0?void 0:m.map(S=>u(g,h,S))})}updateI18nProperties(a){var l;(l=this[gd])===null||l===void 0||l.forEach((c,p)=>{a(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(a,l,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,l,c)}addI18nContext(a,l,c){let p=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[pn].set(p,{isCustomContext:c}),this[yo].has(p)||this[yo].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,l)}hasI18nContext(a){return this[pn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[pn].forEach((a,l)=>this.addI18nContext(l,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[yo].forEach(a=>a()),this[yo].clear()}}return e=pn,o=yo,Kp([(0,yd.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),hd=class extends fn(Wr.FtLitElement){},un=class extends fn(Wr.FtLitElementRedux){};var go=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ct=class extends un{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":hn.nothing:hn.html`
2124
+ `}connectedCallback(){super.connectedCallback(),I.addEventListener(nr.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(nr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,i,a,l,c,p;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(u=>kr.addContext(u)),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((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),I.actions.searchInAllLanguagesAllowed((l=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),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",()=>yc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};oe.elementDefinitions={};oe.styles=Tl;xe([(0,we.property)()],oe.prototype,"baseUrl",void 0);xe([(0,we.property)()],oe.prototype,"apiIntegrationIdentifier",void 0);xe([(0,we.property)()],oe.prototype,"apiIntegrationAppVersion",void 0);xe([(0,we.property)()],oe.prototype,"uiLocale",void 0);xe([(0,st.jsonProperty)(null)],oe.prototype,"availableUiLocales",void 0);xe([(0,st.jsonProperty)(null)],oe.prototype,"metadataConfiguration",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"editorMode",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"noCustom",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);xe([(0,we.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"withManualResources",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"navigatorOnline",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"forcedOffline",void 0);xe([(0,we.property)({type:Object})],oe.prototype,"apiProvider",void 0);xe([(0,we.property)({type:Boolean})],oe.prototype,"authenticationRequired",void 0);xe([(0,st.jsonProperty)([])],oe.prototype,"messageContexts",void 0);xe([(0,st.jsonProperty)(void 0)],oe.prototype,"session",void 0);xe([(0,we.state)()],oe.prototype,"localesConfiguration",void 0);xe([(0,we.state)()],oe.prototype,"availableContentLocales",void 0);var oa=b(se());function np(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let o,n,i;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!jo(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(!jo(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 a=l=>Object.keys(l).filter(c=>l[c]!=null);if(i=a(t),o=i.length,o!==a(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=o;n--!==0;){let l=i[n];if(!jo(t[l],e[l]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function jo(t,e){try{return np(t,e)}catch{return!1}}function co(t,e){return!jo(t,e)}function Ko(t,e){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let i=e(n);return i[t]=!0,i}}var mc=b(se(),1);var _i=t=>{let e=t??{};return(o,n)=>{var i;let a={hasChanged:co,attribute:!1,...e};(0,mc.property)(a)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}};var Zo=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 sr=b(se(),1);var bc=b(se(),1);function xc(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,bc.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:co,...e??{}})}var qo=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 i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(c){i(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Sc=b(Z(),1);var Yo=globalThis,ip=Yo.ShadowRoot&&(Yo.ShadyCSS===void 0||Yo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,P0=Symbol();var vc=(t,e)=>{if(ip)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),i=Yo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,t.appendChild(n)}};var Xo=class extends Sc.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return vc(n,e.elementStyles),n}};function Cc(t,e,...o){var n;let i=t.querySelector(e);for(let a of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(a);return i}var Br=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Ac,Oc=Symbol("constructorPrototype"),Ec=Symbol("constructorName"),Rc=Symbol("exportpartsDebouncer"),wc=Symbol("dynamicDependenciesLoaded"),Dr=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Dr.eventName="exportparts-updated";var yt=class extends Xo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ac]=new qo(5),this.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[Rc].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ec]=this.constructor.name,this[Oc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ec]&&Object.setPrototypeOf(this,this[Oc])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let o=this.constructor;o[wc]||(o[wc]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Dr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Dr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new Dr)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let a=[...i??[],n];o=Cc(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,i;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}setExportpartsAttribute(e){var o,n,i,a,l,c;let p=m=>m!=null&&m.trim().length>0,u=e.filter(p).map(m=>m.trim());if(u.length===0){this.exportparts=void 0;return}let g=new Set;for(let m of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(a=(i=m.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],v=(c=(l=m.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(T=>T.split(":")[1]))!==null&&c!==void 0?c:[],O=[...S,...v].filter(p).map(T=>T.trim());for(let T of O)g.add(T)}if(g.size===0){this.exportparts=void 0;return}let h=[...g.values()].flatMap(m=>u.map(S=>`${m}:${S}--${m}`));this.exportparts=[...this.part,...h].join(", ")}};Ac=Rc;Br([(0,sr.property)()],yt.prototype,"exportpartsPrefix",void 0);Br([xc([])],yt.prototype,"exportpartsPrefixes",void 0);Br([(0,sr.property)({reflect:!0})],yt.prototype,"exportparts",void 0);Br([(0,sr.property)()],yt.prototype,"customStylesheet",void 0);Br([(0,sr.property)()],yt.prototype,"elementToFocus",void 0);Br([(0,sr.state)()],yt.prototype,"useAdoptedStyleSheets",void 0);function Qo(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var po=Symbol("internalReduxEventsUnsubscribers"),Ht=Symbol("internalStoresUnsubscribers"),lr=Symbol("internalStores"),ap=Ko(Symbol("withRedux"),function(t){var e,o,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(c=>l.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[lr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[lr].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[lr].get(l)}addStore(l,c){var p;c=(p=c??l.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[lr].set(c,l),this.subscribeToStore(c,l),this.updateFromStores()}removeStore(l){let c=typeof l=="string"?l:l.name;this.unsubscribeFromStore(c),this[lr].delete(c)}setupStores(){this.unsubscribeFromStores(),this[lr].forEach((l,c)=>this.subscribeToStore(c,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(l.store);u&&(l.store?this[Ht].has(l.store):this[Ht].size>0)&&(this[c]=l.selector(u.getState(),this))}})}subscribeToStore(l,c){var p;this[Ht].set(l,c.subscribe(()=>this.updateFromStores())),this[po].set(l,[]),Qo(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,g)=>{if(typeof this[g]=="function"&&(!u.store||c.name===u.store)){let h=m=>this[g](m);c.addEventListener(u.eventName,h),this[po].get(l).push(()=>c.removeEventListener(u.eventName,h))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[Ht].forEach((l,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(l){var c;this[Ht].has(l)&&this[Ht].get(l)(),this[Ht].delete(l),(c=this[po].get(l))===null||c===void 0||c.forEach(p=>p()),this[po].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ht,o=lr,n=po,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Tc=class extends ap(yt){};function Je(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 i,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Lt(t){return!!t&&!!t[ie]}function lt(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 i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===hp}(t)||Array.isArray(t)||!!t[$c]||!!(!((e=t.constructor)===null||e===void 0)&&e[$c])||Hi(t)||Wi(t))}function cr(t,e,o){o===void 0&&(o=!1),Fr(t)===0?(o?Object.keys:Ur)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Fr(t){var e=t[ie];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Hi(t)?2:Wi(t)?3:0}function Mr(t,e){return Fr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function sp(t,e){return Fr(t)===2?t.get(e):t[e]}function Dc(t,e,o){var n=Fr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Bc(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Hi(t){return up&&t instanceof Map}function Wi(t){return fp&&t instanceof Set}function Wt(t){return t.o||t.t}function Vi(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Fc(t);delete e[ie];for(var o=Ur(e),n=0;n<o.length;n++){var i=o[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Gi(t,e){return e===void 0&&(e=!1),ji(t)||Lt(t)||!lt(t)||(Fr(t)>1&&(t.set=t.add=t.clear=t.delete=lp),Object.freeze(t),e&&cr(t,function(o,n){return Gi(n,!0)},!0)),t}function lp(){Je(2)}function ji(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function gt(t){var e=zi[t];return e||Je(18,t),e}function cp(t,e){zi[t]||(zi[t]=e)}function Mi(){return fo}function ki(t,e){e&&(gt("Patches"),t.u=[],t.s=[],t.v=e)}function Jo(t){Ui(t),t.p.forEach(dp),t.p=null}function Ui(t){t===fo&&(fo=t.l)}function Lc(t){return fo={p:[],l:fo,h:t,m:!0,_:0}}function dp(t){var e=t[ie];e.i===0||e.i===1?e.j():e.g=!0}function $i(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||gt("ES5").S(e,t,n),n?(o[ie].P&&(Jo(e),Je(4)),lt(t)&&(t=en(e,t),e.l||tn(e,t)),e.u&&gt("Patches").M(o[ie].t,t,e.u,e.s)):t=en(e,o,[]),Jo(e),e.u&&e.v(e.u,e.s),t!==Uc?t:void 0}function en(t,e,o){if(ji(e))return e;var n=e[ie];if(!n)return cr(e,function(c,p){return Ic(t,n,e,c,p,o)},!0),e;if(n.A!==t)return e;if(!n.P)return tn(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Vi(n.k):n.o,a=i,l=!1;n.i===3&&(a=new Set(i),i.clear(),l=!0),cr(a,function(c,p){return Ic(t,n,i,c,p,o,l)}),tn(t,i,!1),o&&t.u&&gt("Patches").N(n,o,t.u,t.s)}return n.o}function Ic(t,e,o,n,i,a,l){if(Lt(i)){var c=en(t,i,a&&e&&e.i!==3&&!Mr(e.R,n)?a.concat(n):void 0);if(Dc(o,n,c),!Lt(c))return;t.m=!1}else l&&o.add(i);if(lt(i)&&!ji(i)){if(!t.h.D&&t._<1)return;en(t,i),e&&e.A.l||tn(t,i)}}function tn(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Gi(e,o)}function Di(t,e){var o=t[ie];return(o?Wt(o):t)[e]}function Nc(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 Vt(t){t.P||(t.P=!0,t.l&&Vt(t.l))}function Bi(t){t.o||(t.o=Vi(t.t))}function Fi(t,e,o){var n=Hi(e)?gt("MapSet").F(e,o):Wi(e)?gt("MapSet").T(e,o):t.O?function(i,a){var l=Array.isArray(i),c={i:l?1:0,A:a?a.A:Mi(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=c,u=ho;l&&(p=[c],u=uo);var g=Proxy.revocable(p,u),h=g.revoke,m=g.proxy;return c.k=m,c.j=h,m}(e,o):gt("ES5").J(e,o);return(o?o.A:Mi()).p.push(n),n}function pp(t){return Lt(t)||Je(22,t),function e(o){if(!lt(o))return o;var n,i=o[ie],a=Fr(o);if(i){if(!i.P&&(i.i<4||!gt("ES5").K(i)))return i.t;i.I=!0,n=Pc(o,a),i.I=!1}else n=Pc(o,a);return cr(n,function(l,c){i&&sp(i.t,l)===c||Dc(n,l,e(c))}),a===3?new Set(n):n}(t)}function Pc(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Vi(t)}function Mc(){function t(l,c){var p=a[l];return p?p.enumerable=c:a[l]=p={configurable:!0,enumerable:c,get:function(){var u=this[ie];return ho.get(u,l)},set:function(u){var g=this[ie];ho.set(g,l,u)}},p}function e(l){for(var c=l.length-1;c>=0;c--){var p=l[c][ie];if(!p.P)switch(p.i){case 5:n(p)&&Vt(p);break;case 4:o(p)&&Vt(p)}}}function o(l){for(var c=l.t,p=l.k,u=Ur(p),g=u.length-1;g>=0;g--){var h=u[g];if(h!==ie){var m=c[h];if(m===void 0&&!Mr(c,h))return!0;var S=p[h],v=S&&S[ie];if(v?v.t!==m:!Bc(S,m))return!0}}var O=!!c[ie];return u.length!==Ur(c).length+(O?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function i(l){l.g&&Je(3,JSON.stringify(Wt(l)))}var a={};cp("ES5",{J:function(l,c){var p=Array.isArray(l),u=function(h,m){if(h){for(var S=Array(m.length),v=0;v<m.length;v++)Object.defineProperty(S,""+v,t(v,!0));return S}var O=Fc(m);delete O[ie];for(var T=Ur(O),R=0;R<T.length;R++){var L=T[R];O[L]=t(L,h||!!O[L].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(p,l),g={i:p?5:4,A:c?c.A:Mi(),P:!1,I:!1,R:{},l:c,t:l,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,ie,{value:g,writable:!0}),u},S:function(l,c,p){p?Lt(c)&&c[ie].A===l&&e(l.p):(l.u&&function u(g){if(g&&typeof g=="object"){var h=g[ie];if(h){var m=h.t,S=h.k,v=h.R,O=h.i;if(O===4)cr(S,function(V){V!==ie&&(m[V]!==void 0||Mr(m,V)?v[V]||u(S[V]):(v[V]=!0,Vt(h)))}),cr(m,function(V){S[V]!==void 0||Mr(S,V)||(v[V]=!1,Vt(h))});else if(O===5){if(n(h)&&(Vt(h),v.length=!0),S.length<m.length)for(var T=S.length;T<m.length;T++)v[T]=!1;else for(var R=m.length;R<S.length;R++)v[R]=!0;for(var L=Math.min(S.length,m.length),U=0;U<L;U++)S.hasOwnProperty(U)||(v[U]=!0),v[U]===void 0&&u(S[U])}}}}(l.p[0]),e(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var _c,fo,Ki=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",up=typeof Map<"u",fp=typeof Set<"u",kc=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Uc=Ki?Symbol.for("immer-nothing"):((_c={})["immer-nothing"]=!0,_c),$c=Ki?Symbol.for("immer-draftable"):"__$immer_draftable",ie=Ki?Symbol.for("immer-state"):"__$immer_state";var hp=""+Object.prototype.constructor,Ur=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Fc=Object.getOwnPropertyDescriptors||function(t){var e={};return Ur(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},zi={},ho={get:function(t,e){if(e===ie)return t;var o=Wt(t);if(!Mr(o,e))return function(i,a,l){var c,p=Nc(a,l);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(i.k):void 0}(t,o,e);var n=o[e];return t.I||!lt(n)?n:n===Di(t.t,e)?(Bi(t),t.o[e]=Fi(t.A.h,n,t)):n},has:function(t,e){return e in Wt(t)},ownKeys:function(t){return Reflect.ownKeys(Wt(t))},set:function(t,e,o){var n=Nc(Wt(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var i=Di(Wt(t),e),a=i?.[ie];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Bc(o,i)&&(o!==void 0||Mr(t.t,e)))return!0;Bi(t),Vt(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 Di(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Bi(t),Vt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Wt(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){Je(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Je(12)}},uo={};cr(ho,function(t,e){uo[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),uo.deleteProperty=function(t,e){return uo.set.call(this,t,e,void 0)},uo.set=function(t,e,o){return ho.set.call(this,t[0],e,o,t[0])};var yp=function(){function t(o){var n=this;this.O=kc,this.D=!0,this.produce=function(i,a,l){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var p=n;return function(O){var T=this;O===void 0&&(O=c);for(var R=arguments.length,L=Array(R>1?R-1:0),U=1;U<R;U++)L[U-1]=arguments[U];return p.produce(O,function(V){var j;return(j=a).call.apply(j,[T,V].concat(L))})}}var u;if(typeof a!="function"&&Je(6),l!==void 0&&typeof l!="function"&&Je(7),lt(i)){var g=Lc(n),h=Fi(n,i,void 0),m=!0;try{u=a(h),m=!1}finally{m?Jo(g):Ui(g)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return ki(g,l),$i(O,g)},function(O){throw Jo(g),O}):(ki(g,l),$i(u,g))}if(!i||typeof i!="object"){if((u=a(i))===void 0&&(u=i),u===Uc&&(u=void 0),n.D&&Gi(u,!0),l){var S=[],v=[];gt("Patches").M(i,u,S,v),l(S,v)}return u}Je(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(u){for(var g=arguments.length,h=Array(g>1?g-1:0),m=1;m<g;m++)h[m-1]=arguments[m];return n.produceWithPatches(u,function(S){return i.apply(void 0,[S].concat(h))})};var l,c,p=n.produce(i,a,function(u,g){l=u,c=g});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,l,c]}):[p,l,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){lt(o)||Je(8),Lt(o)&&(o=pp(o));var n=Lc(this),i=Fi(this,o,void 0);return i[ie].C=!0,Ui(n),i},e.finishDraft=function(o,n){var i=o&&o[ie],a=i.A;return ki(a,n),$i(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!kc&&Je(20),this.O=o},e.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}i>-1&&(n=n.slice(i+1));var l=gt("Patches").$;return Lt(o)?l(o,n):this.produce(o,function(c){return l(c,n)})},t}(),He=new yp,gp=He.produce,K0=He.produceWithPatches.bind(He),Z0=He.setAutoFreeze.bind(He),q0=He.setUseProxies.bind(He),Y0=He.applyPatches.bind(He),X0=He.createDraft.bind(He),Q0=He.finishDraft.bind(He),rn=gp;function dr(t){"@babel/helpers - typeof";return dr=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},dr(t)}function zc(t,e){if(dr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(dr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hc(t){var e=zc(t,"string");return dr(e)=="symbol"?e:e+""}function Wc(t,e,o){return(e=Hc(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(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Zi(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){Wc(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 Le(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 Gc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),qi=function(){return Math.random().toString(36).substring(7).split("").join(".")},on={INIT:"@@redux/INIT"+qi(),REPLACE:"@@redux/REPLACE"+qi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+qi()}};function mp(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 Yi(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(Le(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(Le(1));return o(Yi)(t,e)}if(typeof t!="function")throw new Error(Le(2));var i=t,a=e,l=[],c=l,p=!1;function u(){c===l&&(c=l.slice())}function g(){if(p)throw new Error(Le(3));return a}function h(O){if(typeof O!="function")throw new Error(Le(4));if(p)throw new Error(Le(5));var T=!0;return u(),c.push(O),function(){if(T){if(p)throw new Error(Le(6));T=!1,u();var L=c.indexOf(O);c.splice(L,1),l=null}}}function m(O){if(!mp(O))throw new Error(Le(7));if(typeof O.type>"u")throw new Error(Le(8));if(p)throw new Error(Le(9));try{p=!0,a=i(a,O)}finally{p=!1}for(var T=l=c,R=0;R<T.length;R++){var L=T[R];L()}return O}function S(O){if(typeof O!="function")throw new Error(Le(10));i=O,m({type:on.REPLACE})}function v(){var O,T=h;return O={subscribe:function(L){if(typeof L!="object"||L===null)throw new Error(Le(11));function U(){L.next&&L.next(g())}U();var V=T(U);return{unsubscribe:V}}},O[Gc]=function(){return this},O}return m({type:on.INIT}),n={dispatch:m,subscribe:h,getState:g,replaceReducer:S},n[Gc]=v,n}function bp(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:on.INIT});if(typeof n>"u")throw new Error(Le(12));if(typeof o(void 0,{type:on.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Le(13))})}function jc(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(o[i]=t[i])}var a=Object.keys(o),l,c;try{bp(o)}catch(p){c=p}return function(u,g){if(u===void 0&&(u={}),c)throw c;if(0)var h;for(var m=!1,S={},v=0;v<a.length;v++){var O=a[v],T=o[O],R=u[O],L=T(R,g);if(typeof L>"u"){var U=g&&g.type;throw new Error(Le(14))}S[O]=L,m=m||L!==R}return m=m||a.length!==Object.keys(u).length,m?S:u}}function zr(){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,i){return function(){return n(i.apply(void 0,arguments))}})}function Kc(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(Le(15))},l={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(l)});return a=zr.apply(void 0,c)(i.dispatch),Zi(Zi({},i),{},{dispatch:a})}}}function Zc(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(l){return function(c){return typeof c=="function"?c(i,a,t):l(c)}}};return e}var qc=Zc();qc.withExtraArgument=Zc;var Xi=qc;var ed=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},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)}}(),xp=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(u){return function(g){return p([u,g])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(g){u=[6,g],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Hr=function(t,e){for(var o=0,n=e.length,i=t.length;o<n;o++,i++)t[i]=e[o];return t},vp=Object.defineProperty,Sp=Object.defineProperties,Cp=Object.getOwnPropertyDescriptors,Yc=Object.getOwnPropertySymbols,Op=Object.prototype.hasOwnProperty,Ep=Object.prototype.propertyIsEnumerable,Xc=function(t,e,o){return e in t?vp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Gt=function(t,e){for(var o in e||(e={}))Op.call(e,o)&&Xc(t,o,e[o]);if(Yc)for(var n=0,i=Yc(e);n<i.length;n++){var o=i[n];Ep.call(e,o)&&Xc(t,o,e[o])}return t},Qi=function(t,e){return Sp(t,Cp(e))},wp=function(t,e,o){return new Promise(function(n,i){var a=function(p){try{c(o.next(p))}catch(u){i(u)}},l=function(p){try{c(o.throw(p))}catch(u){i(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,l)};c((o=o.apply(t,e)).next())})};var Ap=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zr:zr.apply(null,arguments)},gC=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Rp(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 Tp=function(t){ed(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}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,Hr([void 0],o[0].concat(this)))):new(e.bind.apply(e,Hr([void 0],o.concat(this))))},e}(Array),Lp=function(t){ed(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}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,Hr([void 0],o[0].concat(this)))):new(e.bind.apply(e,Hr([void 0],o.concat(this))))},e}(Array);function ta(t){return lt(t)?rn(t,function(){}):t}function Ip(t){return typeof t=="boolean"}function Np(){return function(e){return Pp(e)}}function Pp(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,l=a===void 0?!0:a,c=new Tp;if(o&&(Ip(o)?c.push(Xi):c.push(Xi.withExtraArgument(o.extraArgument))),0){if(i)var p;if(l)var u}return c}var Ji=!0;function td(t){var e=Np(),o=t||{},n=o.reducer,i=n===void 0?void 0:n,a=o.middleware,l=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,g=u===void 0?void 0:u,h=o.enhancers,m=h===void 0?void 0:h,S;if(typeof i=="function")S=i;else if(Rp(i))S=jc(i);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=l;if(typeof v=="function"&&(v=v(e),!Ji&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ji&&v.some(function(V){return typeof V!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Kc.apply(void 0,v),T=zr;p&&(T=Ap(Gt({trace:!Ji},typeof p=="object"&&p)));var R=new Lp(O),L=R;Array.isArray(m)?L=Hr([O],m):typeof m=="function"&&(L=m(R));var U=T.apply(void 0,L);return Yi(S,g,U)}function jt(t,e){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return Gt(Gt({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.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 rd(t){var e={},o=[],n,i={addCase:function(a,l){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=l,i},addMatcher:function(a,l){return o.push({matcher:a,reducer:l}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,o,n]}function _p(t){return typeof t=="function"}function kp(t,e,o,n){o===void 0&&(o=[]);var i=typeof e=="function"?rd(e):[e,o,n],a=i[0],l=i[1],c=i[2],p;if(_p(t))p=function(){return ta(t())};else{var u=ta(t);p=function(){return u}}function g(h,m){h===void 0&&(h=p());var S=Hr([a[m.type]],l.filter(function(v){var O=v.matcher;return O(m)}).map(function(v){var O=v.reducer;return O}));return S.filter(function(v){return!!v}).length===0&&(S=[c]),S.reduce(function(v,O){if(O)if(Lt(v)){var T=v,R=O(T,m);return R===void 0?v:R}else{if(lt(v))return rn(v,function(L){return O(L,m)});var R=O(v,m);if(R===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}return v},h)}return g.getInitialState=p,g}function $p(t,e){return t+"/"+e}function od(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:ta(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},l={},c={};i.forEach(function(g){var h=n[g],m=$p(e,g),S,v;"reducer"in h?(S=h.reducer,v=h.prepare):S=h,a[g]=S,l[m]=S,c[g]=v?jt(m,v):jt(m)});function p(){var g=typeof t.extraReducers=="function"?rd(t.extraReducers):[t.extraReducers],h=g[0],m=h===void 0?{}:h,S=g[1],v=S===void 0?[]:S,O=g[2],T=O===void 0?void 0:O,R=Gt(Gt({},m),l);return kp(o,function(L){for(var U in R)L.addCase(U,R[U]);for(var V=0,j=v;V<j.length;V++){var Pe=j[V];L.addMatcher(Pe.matcher,Pe.reducer)}T&&L.addDefaultCase(T)})}var u;return{name:e,reducer:function(g,h){return u||(u=p()),u(g,h)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Dp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Bp=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=Dp[Math.random()*64|0];return e},Mp=["name","message","stack","code"],ea=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Qc=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Up=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=Mp;o<n.length;o++){var i=n[o];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},vC=function(){function t(e,o,n){var i=jt(e+"/fulfilled",function(g,h,m,S){return{payload:g,meta:Qi(Gt({},S||{}),{arg:m,requestId:h,requestStatus:"fulfilled"})}}),a=jt(e+"/pending",function(g,h,m){return{payload:void 0,meta:Qi(Gt({},m||{}),{arg:h,requestId:g,requestStatus:"pending"})}}),l=jt(e+"/rejected",function(g,h,m,S,v){return{payload:S,error:(n&&n.serializeError||Up)(g||"Rejected"),meta:Qi(Gt({},v||{}),{arg:m,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function g(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return g.prototype.abort=function(){},g}();function u(g){return function(h,m,S){var v=n?.idGenerator?n.idGenerator(g):Bp(),O=new p,T,R=!1;function L(V){T=V,O.abort()}var U=function(){return wp(this,null,function(){var V,j,Pe,dt,Ie,pt,Ce;return xp(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),dt=(V=n?.condition)==null?void 0:V.call(n,g,{getState:m,extra:S}),zp(dt)?[4,dt]:[3,2];case 1:dt=y.sent(),y.label=2;case 2:if(dt===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return R=!0,Ie=new Promise(function(x,k){return O.signal.addEventListener("abort",function(){return k({name:"AbortError",message:T||"Aborted"})})}),h(a(v,g,(j=n?.getPendingMeta)==null?void 0:j.call(n,{requestId:v,arg:g},{getState:m,extra:S}))),[4,Promise.race([Ie,Promise.resolve(o(g,{dispatch:h,getState:m,extra:S,requestId:v,signal:O.signal,abort:L,rejectWithValue:function(x,k){return new ea(x,k)},fulfillWithValue:function(x,k){return new Qc(x,k)}})).then(function(x){if(x instanceof ea)throw x;return x instanceof Qc?i(x.payload,v,g,x.meta):i(x,v,g)})])];case 3:return Pe=y.sent(),[3,5];case 4:return pt=y.sent(),Pe=pt instanceof ea?l(null,v,g,pt.payload,pt.meta):l(pt,v,g),[3,5];case 5:return Ce=n&&!n.dispatchConditionRejection&&l.match(Pe)&&Pe.meta.condition,Ce||h(Pe),[2,Pe]}})})}();return Object.assign(U,{abort:L,requestId:v,arg:g,unwrap:function(){return U.then(Fp)}})}}return Object.assign(u,{pending:a,rejected:l,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Fp(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function zp(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var nd="listener",id="completed",ad="cancelled",SC="task-"+ad,CC="task-"+id,OC=nd+"-"+ad,EC=nd+"-"+id;var ra="listenerMiddleware";var wC=jt(ra+"/add"),AC=jt(ra+"/removeAll"),RC=jt(ra+"/remove");var Jc,TC=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Jc||(Jc=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Hp=function(t){return function(e){setTimeout(e,t)}},LC=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Hp(10);Mc();var Wp=Ko(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,i){this.eventBus.addEventListener(o,n,i)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,i){this.eventBus.removeEventListener(o,n,i)}}}),nn=class extends Wp(Object){};window.ftReduxStores||(window.ftReduxStores={});var sd=class t extends nn{static get(e){var o;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Qo(a))return a;if(i==null)return;let l=od({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),c=td({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:l.reducer(p,u)});return window.ftReduxStores[i.name]=new t(l,c,i.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Zo;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,l,c)=>{let p=l,u=a[p];return u?(...g)=>{let h=u(...g.map(i));return this.reduxStore.dispatch(h),h}:g=>{this.setState({[p]:i(g)})}}}),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 an=class{static format(e,o,n,i){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(e,o,n,i)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,n,i){let a=typeof e=="string"?new Date(e):e,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(a);if(!i)return l;let c=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(a);return`${l} ${c}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var ld=b(N()),sn=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},JC=(0,ld.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>an.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return sn([(0,oa.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),sn([(0,oa.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),sn([_i({store:I.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),sn([_i({store:I.name})],e.prototype,"uiLocale",void 0),e});var dn=b(N());var ln=class extends ze{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 cn=class extends ze{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var Vp="ft-user-assets",Gp={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(Qe).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={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;ia(t,o,[...na(t,o),i]),cd(t,o,1,n),dd(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;ia(t,o,na(t,o).map(i=>i.id===n.id?n:i)),dd(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;ia(t,o,na(t,o).filter(a=>a.id!==i)),cd(t,o,-1,n)}},pd={[Qe.SEARCHES]:"savedSearches",[Qe.BOOKMARKS]:"bookmarks",[Qe.BOOKS]:void 0,[Qe.COLLECTIONS]:void 0},na=(t,e)=>{var o;let n=pd[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},ia=(t,e,o)=>{let n=pd[e];n&&(t[n]=o)},cd=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===Qe.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},dd=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},We=dn.FtReduxStore.get({name:Vp,reducers:Gp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Qe).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),aa=class{constructor(e=new ln,o=new cn){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Uo,this.savedSearchesService=new Vo,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,dn.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),We.actions.clearAssetCount(),We.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),We.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),We.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();We.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();We.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&We.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&We.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(We.getState().assetCounts.bookmarkByMap).length!==0;e===Qe.BOOKMARKS&&o&&We.actions.clearBookmarkCountByMap(),We.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;We.actions.bookmarks(o)}}},jp=new aa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=jp);(0,ud.customElement)("ft-app-context")(oe);var yd=b(se());var sa=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},fd=new sa;var Kp=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Zp=Symbol("i18nAttributes"),qp=Symbol("i18nListAttributes"),gd=Symbol("i18nProperties"),pn=Symbol("i18nContexts"),yo=Symbol("i18nUnsubs"),fn=(0,Wr.applyMixinOnce)(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?zo:kr}i18n(a){let{context:l,key:c,message:p}=a,{custom:u,args:g,argsProvider:h}=a;if(l&&c){this.hasI18nContext(l)||this.addI18nContext(l,void 0,u);let m=g??(h?h(this):[]);return this.getI18nService(u).resolveMessage(l,c,...m)}return p}async awaitI18n(a){let{context:l,custom:c}=a;return l&&await this.getI18nService(c).prepareContext(l),this.i18n(a)}customI18n(a,l){if(fd.isI18nKey(a)){let[c,p]=a.split(".");return this.i18n({custom:!0,context:c,key:p,...l})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((l,c,p)=>a.has(c)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((l,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(l=>l.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var l,c;let p=this,u=(g,h,m)=>m?.context&&m.key&&a(g,h,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...g})}:m;(l=this[Zp])===null||l===void 0||l.forEach((g,h)=>p[h]=u(g,h,p[h])),(c=this[qp])===null||c===void 0||c.forEach((g,h)=>{var m;return p[h]=(m=p[h])===null||m===void 0?void 0:m.map(S=>u(g,h,S))})}updateI18nProperties(a){var l;(l=this[gd])===null||l===void 0||l.forEach((c,p)=>{a(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(a,l,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,l,c)}addI18nContext(a,l,c){let p=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[pn].set(p,{isCustomContext:c}),this[yo].has(p)||this[yo].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,l)}hasI18nContext(a){return this[pn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[pn].forEach((a,l)=>this.addI18nContext(l,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[yo].forEach(a=>a()),this[yo].clear()}}return e=pn,o=yo,Kp([(0,yd.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),hd=class extends fn(Wr.FtLitElement){},un=class extends fn(Wr.FtLitElementRedux){};var go=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(a=(i<3?l(a):i>3?l(e,o,a):l(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ct=class extends un{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":hn.nothing:hn.html`
2125
2125
  <span class="ft-i18n">
2126
2126
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
2127
2127
  </span>
@@ -2201,7 +2201,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
2201
2201
  `;var _d=_`
2202
2202
  `;var _f="ft-app-info",pr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};pr.eventName="authentication-change";var Nf={session:(t,e)=>{De(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>$.dispatchEvent(new pr(e.payload)),0))}},$=ir.get({name:_f,reducers:Nf,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 ur=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=$.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=$.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var jn=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ur.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ur.await()}};var Ue=class extends jn{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new ct,this.cache=e?i.commonCache:new ct}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Gn=class extends Ue{async listMyBookmarks(){let e=$.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var hs=class{addCommand(e,r=!1){$.commands.add(e,r)}consumeCommand(e){return $.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new hs;var Nd,Qr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Pf=Symbol("clearAfterUnitTest"),Kn=class extends Xo(Ue){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Nd]=()=>{this.defaultMessages={},this.cache=new ct,this.listeners={}},this.currentUiLocale=$.getState().uiLocale,$.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=$.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};De(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new Oo((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof Yt)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Qr({loadedContexts:e})),this.dispatchEvent(new Qr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Qr({loadedContexts:[e]})),this.dispatchEvent(new Qr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Yo(0).then(()=>n()).catch(()=>null)))}};Nd=Pf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Kn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Kn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var eo=window.FluidTopicsI18nService,Zn=window.FluidTopicsCustomI18nService;var ms=class{highlightHtml(e,r,n){ha(e,r,n)}};window.FluidTopicsHighlightHtmlService=new ms;var qn=class extends Ue{async listMySearches(){let{session:e}=$.getState();return Mc(e,ye.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var gs=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=$.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a;return ar.format(e,(n=r?.locale)!==null&&n!==void 0?n:$.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new gs;var $o=class{static get(e,r){var n,i;let a=$.getState(),{lang:s,region:l}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Fr(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${l}`)}};var ys=class{urlToSearchRequest(e){return $o.get().parse(e)}searchRequestToUrl(e){return $o.get().serialize(e)}};window.FluidTopicsUrlService=new ys;var fr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};fr.eventName="change";var bs=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Pd=new bs;var Yn=class t extends bt{static build(){return new t(window.history,Pd,()=>window.location,!1)}constructor(e,r,n,i){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&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),De(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new fr(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[a,s,l])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(i,[u,s,l]),this.setCurrentState(u,!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 r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(fr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(fr.eventName,e)}currentItem(){return uo(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 uo(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 uo(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 r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Yn.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 kd=$;function $d(t,e){var r;return kd.getState().authenticationRequired&&!(!((r=kd.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var ve=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},de=class extends K{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=()=>ur.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new ct,this.cleanSessionDebouncer=new Le,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return P`
2203
2203
  <slot></slot>
2204
- `}connectedCallback(){super.connectedCallback(),$.addEventListener(pr.eventName,this.reloadConfiguration)}disconnectedCallback(){$.addEventListener(pr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&($.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&$.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&$.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&$.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&$.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&$.actions.noCustom(this.noCustom),e.has("editorMode")&&$.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&$.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&$.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>eo.addContext(u)),e.has("openExternalDocumentInNewTab")&&$.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&$.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&$.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&($.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),$.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),$.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&$.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&$.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),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",()=>$d(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};de.elementDefinitions={};de.styles=_d;ve([b()],de.prototype,"baseUrl",void 0);ve([b()],de.prototype,"apiIntegrationIdentifier",void 0);ve([b()],de.prototype,"apiIntegrationAppVersion",void 0);ve([b()],de.prototype,"uiLocale",void 0);ve([We(null)],de.prototype,"availableUiLocales",void 0);ve([We(null)],de.prototype,"metadataConfiguration",void 0);ve([b({type:Boolean})],de.prototype,"editorMode",void 0);ve([b({type:Boolean})],de.prototype,"noCustom",void 0);ve([b({type:Boolean})],de.prototype,"openExternalDocumentInNewTab",void 0);ve([b({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],de.prototype,"noCustomComponent",void 0);ve([b({type:Boolean})],de.prototype,"withManualResources",void 0);ve([b({type:Boolean})],de.prototype,"navigatorOnline",void 0);ve([b({type:Boolean})],de.prototype,"forcedOffline",void 0);ve([b({type:Object})],de.prototype,"apiProvider",void 0);ve([b({type:Boolean})],de.prototype,"authenticationRequired",void 0);ve([We([])],de.prototype,"messageContexts",void 0);ve([We(void 0)],de.prototype,"session",void 0);ve([G()],de.prototype,"localesConfiguration",void 0);ve([G()],de.prototype,"availableContentLocales",void 0);var Xn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},DT=Ee(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore($)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>ar.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Xn([b({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Xn([b({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Xn([Lr({store:$.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Xn([Lr({store:$.name})],e.prototype,"uiLocale",void 0),e});var Jn=class extends Ue{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=$.getState().session;return!!e?.sessionAuthenticated}};var Qn=class extends Ue{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var kf="ft-user-assets",$f={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(je).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;vs(t,r,[...xs(t,r),i]),Dd(t,r,1,n),Md(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;vs(t,r,xs(t,r).map(i=>i.id===n.id?n:i)),Md(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;vs(t,r,xs(t,r).filter(a=>a.id!==i)),Dd(t,r,-1,n)}},Bd={[je.SEARCHES]:"savedSearches",[je.BOOKMARKS]:"bookmarks",[je.BOOKS]:void 0,[je.COLLECTIONS]:void 0},xs=(t,e)=>{var r;let n=Bd[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},vs=(t,e,r)=>{let n=Bd[e];n&&(t[n]=r)},Dd=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===je.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+r)}},Md=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},ze=ir.get({name:kf,reducers:$f,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(je).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ss=class{constructor(e=new Jn,r=new Qn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Gn,this.savedSearchesService=new qn,$.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=$.getState();De((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),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 reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ze.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ze.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ze.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ze.getState().assetCounts.bookmarkByMap).length!==0;e===je.BOOKMARKS&&r&&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 r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ze.actions.bookmarks(r)}}},Df=new Ss;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Df);re("ft-app-context")(de);var Cs=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Fd=new Cs;var Mf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Bf=Symbol("i18nAttributes"),Ff=Symbol("i18nListAttributes"),zd=Symbol("i18nProperties"),ei=Symbol("i18nContexts"),Do=Symbol("i18nUnsubs"),ri=Ee(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Zn:eo}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let m=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...m)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Fd.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Bf])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[Ff])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(S=>u(h,f,S))})}updateI18nProperties(a){var s;(s=this[zd])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[ei].set(d,{isCustomContext:l}),this[Do].has(d)||this[Do].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[ei].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[ei].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Do].forEach(a=>a()),this[Do].clear()}}return e=ei,r=Do,Mf([b({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Ud=class extends ri(K){},ti=class extends ri(Ao){};var Mo=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},at=class extends ti{constructor(){super(),this.editorMode=!1,this.addStore($)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":z:P`
2204
+ `}connectedCallback(){super.connectedCallback(),$.addEventListener(pr.eventName,this.reloadConfiguration)}disconnectedCallback(){$.addEventListener(pr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,i,a,s,l,d;super.update(e),e.has("baseUrl")&&($.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&$.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&$.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&$.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&$.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&$.actions.noCustom(this.noCustom),e.has("editorMode")&&$.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&$.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&$.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>eo.addContext(u)),e.has("openExternalDocumentInNewTab")&&$.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&$.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&$.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&($.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),$.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),$.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&$.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&$.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),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",()=>$d(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};de.elementDefinitions={};de.styles=_d;ve([b()],de.prototype,"baseUrl",void 0);ve([b()],de.prototype,"apiIntegrationIdentifier",void 0);ve([b()],de.prototype,"apiIntegrationAppVersion",void 0);ve([b()],de.prototype,"uiLocale",void 0);ve([We(null)],de.prototype,"availableUiLocales",void 0);ve([We(null)],de.prototype,"metadataConfiguration",void 0);ve([b({type:Boolean})],de.prototype,"editorMode",void 0);ve([b({type:Boolean})],de.prototype,"noCustom",void 0);ve([b({type:Boolean})],de.prototype,"openExternalDocumentInNewTab",void 0);ve([b({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],de.prototype,"noCustomComponent",void 0);ve([b({type:Boolean})],de.prototype,"withManualResources",void 0);ve([b({type:Boolean})],de.prototype,"navigatorOnline",void 0);ve([b({type:Boolean})],de.prototype,"forcedOffline",void 0);ve([b({type:Object})],de.prototype,"apiProvider",void 0);ve([b({type:Boolean})],de.prototype,"authenticationRequired",void 0);ve([We([])],de.prototype,"messageContexts",void 0);ve([We(void 0)],de.prototype,"session",void 0);ve([G()],de.prototype,"localesConfiguration",void 0);ve([G()],de.prototype,"availableContentLocales",void 0);var Xn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},DT=Ee(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore($)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>ar.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Xn([b({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Xn([b({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Xn([Lr({store:$.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Xn([Lr({store:$.name})],e.prototype,"uiLocale",void 0),e});var Jn=class extends Ue{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=$.getState().session;return!!e?.sessionAuthenticated}};var Qn=class extends Ue{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var kf="ft-user-assets",$f={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(je).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;vs(t,r,[...xs(t,r),i]),Dd(t,r,1,n),Md(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;vs(t,r,xs(t,r).map(i=>i.id===n.id?n:i)),Md(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;vs(t,r,xs(t,r).filter(a=>a.id!==i)),Dd(t,r,-1,n)}},Bd={[je.SEARCHES]:"savedSearches",[je.BOOKMARKS]:"bookmarks",[je.BOOKS]:void 0,[je.COLLECTIONS]:void 0},xs=(t,e)=>{var r;let n=Bd[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},vs=(t,e,r)=>{let n=Bd[e];n&&(t[n]=r)},Dd=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===je.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+r)}},Md=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},ze=ir.get({name:kf,reducers:$f,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(je).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ss=class{constructor(e=new Jn,r=new Qn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Gn,this.savedSearchesService=new qn,$.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=$.getState();De((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),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 reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ze.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ze.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ze.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ze.getState().assetCounts.bookmarkByMap).length!==0;e===je.BOOKMARKS&&r&&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 r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ze.actions.bookmarks(r)}}},Df=new Ss;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Df);re("ft-app-context")(de);var Cs=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[n,i]=e.split(".");return{context:n,key:i,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Fd=new Cs;var Mf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Bf=Symbol("i18nAttributes"),Ff=Symbol("i18nListAttributes"),zd=Symbol("i18nProperties"),ei=Symbol("i18nContexts"),Do=Symbol("i18nUnsubs"),ri=Ee(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Zn:eo}i18n(a){let{context:s,key:l,message:d}=a,{custom:u,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let m=h??(f?f(this):[]);return this.getI18nService(u).resolveMessage(s,l,...m)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Fd.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,u=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Bf])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(l=this[Ff])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(S=>u(h,f,S))})}updateI18nProperties(a){var s;(s=this[zd])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[ei].set(d,{isCustomContext:l}),this[Do].has(d)||this[Do].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[ei].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[ei].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Do].forEach(a=>a()),this[Do].clear()}}return e=ei,r=Do,Mf([b({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Ud=class extends ri(K){},ti=class extends ri(Ao){};var Mo=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},at=class extends ti{constructor(){super(),this.editorMode=!1,this.addStore($)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":z:P`
2205
2205
  <span class="ft-i18n">
2206
2206
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
2207
2207
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-combobox",
3
- "version": "1.3.46",
3
+ "version": "1.3.47",
4
4
  "description": "A",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "1.3.46",
22
+ "@fluid-topics/ft-wc-utils": "1.3.47",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/ft-wc-test-utils": "1.3.46"
26
+ "@fluid-topics/ft-wc-test-utils": "1.3.47"
27
27
  },
28
- "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
28
+ "gitHead": "16ac56d62f3a88a3b03cbc92bcd04dd91951a015"
29
29
  }