@fluid-topics/ft-search-result-missing-terms 1.3.46 → 1.3.48
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`;var Ke=E(P());var Wa=E(P());var jn=E(q()),H=E(K()),te=E(P());var on=E(q());var nn=on.css`
|
|
8
8
|
`;var Et=E(P()),zi="ft-app-info",Ce=class r extends CustomEvent{constructor(t){super(r.eventName,{detail:t})}};Ce.eventName="authentication-change";var Hi={session:(r,t)=>{(0,Et.deepEqual)(r.session,t.payload)||(r.session=t.payload,setTimeout(()=>C.dispatchEvent(new Ce(t.payload)),0))}},C=Et.FtReduxStore.get({name:zi,reducers:Hi,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 mr=E(P());var Oe=class r{static get(t){let{baseUrl:o,apiIntegrationIdentifier:n}=C.getState(),i=t??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(t){return new Promise(o=>{let n=r.get(t);if(n)o(n);else{let i=C.subscribe(()=>{n=r.get(t),n&&(i(),o(n))})}})}};var At=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Oe.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Oe.await()}};var $=class extends At{constructor(t=!0,o){var n;super(o),this.sortObjectFields=(s,c)=>typeof c!="object"||c==null||Array.isArray(c)?c:Object.fromEntries(Object.entries(c).sort(([d],[u])=>d.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new mr.CacheRegistry,this.cache=t?i.commonCache:new mr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var wt=class extends ${async listMyBookmarks(){let t=C.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),5*60*1e3):[]}};var br=class{addCommand(t,o=!1){C.commands.add(t,o)}consumeCommand(t){return C.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new br;var Y=E(P());var an,De=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Gi=Symbol("clearAfterUnitTest"),It=class extends(0,Y.withEventBus)($){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[an]=()=>{this.defaultMessages={},this.cache=new Y.CacheRegistry,this.listeners={}},this.currentUiLocale=C.getState().uiLocale,C.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=C.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var n;if(t=t.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...o};(0,Y.deepEqual)(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var o,n;return this.fetchContext(t),(n=(o=this.cache.getNow(t))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,o){let n=t.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(t,o,...n){var i;let s=t.toLowerCase(),c=this.resolveContext(s);return new Y.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},c).resolve(o,...n)}async fetchContext(t){let o=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),o&&await this.notify(t)}catch(i){!(i instanceof Y.CanceledPromiseError)&&o&&console.error(i)}return n}subscribe(t,o){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(o),()=>{var i;return(i=this.listeners[t])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new De({loadedContexts:t})),this.dispatchEvent(new De({loadedContexts:t})),await Promise.all(t.map(o=>this.notify(o,!1)))}async notify(t,o=!0){o&&(document.body.dispatchEvent(new De({loadedContexts:[t]})),this.dispatchEvent(new De({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,Y.delay)(0).then(()=>n()).catch(()=>null)))}};an=Gi;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends It{constructor(){super(async(r,t)=>(await this.awaitApi).getFluidTopicsMessageContext(r,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends It{constructor(){super(async(r,t)=>(await this.awaitApi).getCustomMessageContext(r,t))}});var Ue=window.FluidTopicsI18nService,Rt=window.FluidTopicsCustomI18nService;var sn=E(P()),xr=class{highlightHtml(t,o,n){(0,sn.highlightHtml)(t,o,n)}};window.FluidTopicsHighlightHtmlService=new xr;var $i=E(ln(),1);var dn;(function(r){r.black="black",r.green="green",r.blue="blue",r.purple="purple",r.red="red",r.orange="orange",r.yellow="yellow"})(dn||(dn={}));var un;(function(r){r.OFFICIAL="OFFICIAL",r.PERSONAL="PERSONAL",r.SHARED="SHARED"})(un||(un={}));var pn;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(pn||(pn={}));var fn;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(fn||(fn={}));var hn;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(hn||(hn={}));var yn;(function(r){r.VALUE="VALUE",r.DATE="DATE",r.RANGE="RANGE"})(yn||(yn={}));var gn;(function(r){r.BOOKMARK__CREATE="BOOKMARK__CREATE",r.BOOKMARK__DELETE="BOOKMARK__DELETE",r.CASE_DEFLECTION__START="CASE_DEFLECTION__START",r.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",r.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",r.CHATBOT__RATE="CHATBOT__RATE",r.COLLECTION__CREATE="COLLECTION__CREATE",r.COLLECTION__UPDATE="COLLECTION__UPDATE",r.COLLECTION__DELETE="COLLECTION__DELETE",r.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",r.DOCUMENT__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",r.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",r.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",r.DOCUMENT__PRINT="DOCUMENT__PRINT",r.DOCUMENT__PROCESS="DOCUMENT__PROCESS",r.DOCUMENT__RATE="DOCUMENT__RATE",r.DOCUMENT__SEARCH="DOCUMENT__SEARCH",r.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",r.DOCUMENT__UNRATE="DOCUMENT__UNRATE",r.FEEDBACK__SEND="FEEDBACK__SEND",r.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",r.AI__RATE="AI__RATE",r.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",r.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",r.KHUB__PROCESS="KHUB__PROCESS",r.KHUB__SEARCH="KHUB__SEARCH",r.LABELS__DOWNLOAD="LABELS__DOWNLOAD",r.LINK__SHARE="LINK__SHARE",r.PAGE__DISPLAY="PAGE__DISPLAY",r.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",r.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",r.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",r.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",r.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",r.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",r.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",r.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",r.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",r.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",r.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",r.TOPIC__DISPLAY="TOPIC__DISPLAY",r.TOPIC__RATE="TOPIC__RATE",r.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",r.TOPIC__UNRATE="TOPIC__UNRATE",r.USER__LOGIN="USER__LOGIN",r.USER__LOGOUT="USER__LOGOUT",r.HEARTBEAT="HEARTBEAT"})(gn||(gn={}));var mn;(function(r){r.THIRD_PARTY="THIRD_PARTY",r.OFF_THE_GRID="OFF_THE_GRID",r.CONTENT_PACKAGER="CONTENT_PACKAGER",r.PAGES="PAGES",r.DESIGNED_READER="DESIGNED_READER"})(mn||(mn={}));var bn;(function(r){r.HOMEPAGE="HOMEPAGE",r.CUSTOM="CUSTOM",r.HEADER="HEADER",r.READER="READER",r.TOPIC_TEMPLATE="TOPIC_TEMPLATE",r.SEARCH="SEARCH",r.SEARCH_RESULT="SEARCH_RESULT",r.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT"})(bn||(bn={}));var xn;(function(r){r.CLASSIC="CLASSIC",r.CUSTOM="CUSTOM",r.DESIGNER="DESIGNER"})(xn||(xn={}));var vn;(function(r){r.AND="AND",r.OR="OR",r.MONOVALUED="MONOVALUED"})(vn||(vn={}));var Sn;(function(r){r.NONE="NONE",r.ALPHABET="ALPHABET",r.VERSION="VERSION"})(Sn||(Sn={}));var Cn;(function(r){r.STARS="STARS",r.LIKE="LIKE",r.DICHOTOMOUS="DICHOTOMOUS",r.NO_RATING="NO_RATING"})(Cn||(Cn={}));var On;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR",r.CUSTOM="CUSTOM"})(On||(On={}));var vr;(function(r){r.OPTIONAL="OPTIONAL",r.MANDATORY="MANDATORY"})(vr||(vr={}));var En;(function(r){r.ASC="ASC",r.DESC="DESC"})(En||(En={}));var An;(function(r){r.ALPHA="ALPHA",r.NATURAL="NATURAL"})(An||(An={}));var Sr;(function(r){r.EVERYWHERE="EVERYWHERE",r.TITLE_ONLY="TITLE_ONLY",r.NONE="NONE"})(Sr||(Sr={}));var wn;(function(r){r.ARTICLE="ARTICLE",r.BOOK="BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(wn||(wn={}));var In;(function(r){r.FLUIDTOPICS="FLUIDTOPICS",r.EXTERNAL="EXTERNAL"})(In||(In={}));var Rn;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.PERSONAL_BOOK="PERSONAL_BOOK",r.SHARED_BOOK="SHARED_BOOK"})(Rn||(Rn={}));var Nn;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(Nn||(Nn={}));var Tn;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC"})(Tn||(Tn={}));var Cr;(function(r){r.DEFAULT="DEFAULT",r.DOCUMENTS="DOCUMENTS",r.ALL_TOPICS="ALL_TOPICS",r.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Cr||(Cr={}));var Ln;(function(r){r.PLAIN_TEXT="PLAIN_TEXT",r.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",r.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ln||(Ln={}));var U;(function(r){r.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",r.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",r.HTML_EXPORT_USER="HTML_EXPORT_USER",r.PDF_EXPORT_USER="PDF_EXPORT_USER",r.SAVED_SEARCH_USER="SAVED_SEARCH_USER",r.COLLECTION_USER="COLLECTION_USER",r.OFFLINE_USER="OFFLINE_USER",r.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",r.ANALYTICS_USER="ANALYTICS_USER",r.BETA_USER="BETA_USER",r.DEBUG_USER="DEBUG_USER",r.PRINT_USER="PRINT_USER",r.RATING_USER="RATING_USER",r.FEEDBACK_USER="FEEDBACK_USER",r.GENERATIVE_AI_USER="GENERATIVE_AI_USER",r.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",r.CONTENT_PUBLISHER="CONTENT_PUBLISHER",r.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",r.KHUB_ADMIN="KHUB_ADMIN",r.USERS_ADMIN="USERS_ADMIN",r.PORTAL_ADMIN="PORTAL_ADMIN",r.ADMIN="ADMIN"})(U||(U={}));var Q;(function(r){r.SEARCHES="SEARCHES",r.BOOKMARKS="BOOKMARKS",r.BOOKS="BOOKS",r.COLLECTIONS="COLLECTIONS"})(Q||(Q={}));var _n;(function(r){r.VALID="VALID",r.INVALID="INVALID"})(_n||(_n={}));var Pn;(function(r){r.JSON="JSON",r.TEXT="TEXT"})(Pn||(Pn={}));var kn;(function(r){r.USER="USER",r.ASSISTANT="ASSISTANT"})(kn||(kn={}));var Fn;(function(r){r.TEXT="TEXT",r.HTML="HTML"})(Fn||(Fn={}));var Dn;(function(r){r.HTML="HTML",r.MARKDOWN="MARKDOWN"})(Dn||(Dn={}));var ji={[U.PERSONAL_BOOK_SHARE_USER]:[U.PERSONAL_BOOK_USER],[U.HTML_EXPORT_USER]:[U.PERSONAL_BOOK_USER],[U.PDF_EXPORT_USER]:[U.PERSONAL_BOOK_USER],[U.KHUB_ADMIN]:[U.CONTENT_PUBLISHER],[U.ADMIN]:[U.KHUB_ADMIN,U.USERS_ADMIN,U.PORTAL_ADMIN],[U.GENERATIVE_AI_EXPORT_USER]:[U.GENERATIVE_AI_USER]};function Un(r,t){return r===t||(ji[r]??[]).some(o=>Un(o,t))}function Bn(r,t){return r==null?!1:(Array.isArray(r)?r:Array.isArray(r.roles)?r.roles:Array.isArray(r.profile?.roles)?r.profile.roles:[]).some(n=>Un(n,t))}var Lt=class extends ${async listMySearches(){let{session:t}=C.getState();return Bn(t,U.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),5*60*1e3):[]}};var Mn=E(P());var Or=class{isDate(t){var o,n,i,s;return(s=(i=((n=(o=C.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===t))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(t,o){var n,i,s;return Mn.DateFormatter.format(t,(n=o?.locale)!==null&&n!==void 0?n:C.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(s=o?.withTime)!==null&&s!==void 0?s:!1)}};window.FluidTopicsDateService=new Or;var Wn=E(P());var dt=class{static get(t,o){var n,i;let s=C.getState(),{lang:c,region:d}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Wn.SearchPlaceConverter(s.baseUrl,t??20,s.searchInAllLanguagesAllowed,o??`${c}-${d}`)}};var Er=class{urlToSearchRequest(t){return dt.get().parse(t)}searchRequestToUrl(t){return dt.get().serialize(t)}};window.FluidTopicsUrlService=new Er;var ue=E(P());var Ee=class r extends CustomEvent{constructor(t){super(r.eventName,{detail:{currentItem:t}})}};Ee.eventName="change";var Ar=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let o=sessionStorage.getItem(this.itemName(t));return o?JSON.parse(o):void 0}set(t,o){sessionStorage.setItem(this.itemName(t),JSON.stringify(o))}},zn=new Ar;var _t=class r extends ue.WithEventBus{static build(){return new r(window.history,zn,()=>window.location,!1)}constructor(t,o,n,i){var s,c;super(),this.history=t,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(c=(s=t.state)===null||s===void 0?void 0:s.index)!==null&&c!==void 0?c:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(t,o=!1){let n=o&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},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,ue.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Ee(this.currentItem())),0)}installProxies(){let t=o=>(n,i,[s,c,d])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(i,[p,c,d]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.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(t){for(let o=this.history.length-1;o>=0;o--)t?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(t){var o;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(o=t?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(Ee.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Ee.eventName,t)}currentItem(){return(0,ue.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ue.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,ue.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var o;let n=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;if(!n)return t;let i=t,s=t+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;return i}buildCurrentState(){var t,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,o){var n;if(!this.hasState(t))return!1;let i=o??this.currentState.majorStateId,s=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=_t.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(r),removeHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(r)});var Hn=C;function Gn(r,t){var o;return Hn.getState().authenticationRequired&&!(!((o=Hn.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(t):r()}var B=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},k=class extends te.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=()=>Oe.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new te.CacheRegistry,this.cleanSessionDebouncer=new te.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return jn.html`
|
|
9
9
|
<slot></slot>
|
|
10
|
-
`}connectedCallback(){super.connectedCallback(),C.addEventListener(Ce.eventName,this.reloadConfiguration)}disconnectedCallback(){C.addEventListener(Ce.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var o,n,i,s,c,d,u;super.update(t),t.has("baseUrl")&&(C.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&C.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&C.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&C.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&C.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&C.actions.noCustom(this.noCustom),t.has("editorMode")&&C.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&C.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&C.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Ue.addContext(p)),t.has("openExternalDocumentInNewTab")&&C.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&C.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&C.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(C.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),C.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),C.actions.searchInAllLanguagesAllowed((c=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),t.has("authenticationRequired")&&C.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&C.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}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",()=>Gn(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};k.elementDefinitions={};k.styles=nn;B([(0,H.property)()],k.prototype,"baseUrl",void 0);B([(0,H.property)()],k.prototype,"apiIntegrationIdentifier",void 0);B([(0,H.property)()],k.prototype,"apiIntegrationAppVersion",void 0);B([(0,H.property)()],k.prototype,"uiLocale",void 0);B([(0,te.jsonProperty)(null)],k.prototype,"availableUiLocales",void 0);B([(0,te.jsonProperty)(null)],k.prototype,"metadataConfiguration",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"editorMode",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"noCustom",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"openExternalDocumentInNewTab",void 0);B([(0,H.property)({converter:{fromAttribute(r){return r==="false"?!1:r==="true"||(r??!1)}}})],k.prototype,"noCustomComponent",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"withManualResources",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"navigatorOnline",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"forcedOffline",void 0);B([(0,H.property)({type:Object})],k.prototype,"apiProvider",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"authenticationRequired",void 0);B([(0,te.jsonProperty)([])],k.prototype,"messageContexts",void 0);B([(0,te.jsonProperty)(void 0)],k.prototype,"session",void 0);B([(0,H.state)()],k.prototype,"localesConfiguration",void 0);B([(0,H.state)()],k.prototype,"availableContentLocales",void 0);var Yr=E(K());function Ki(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;let o,n,i;if(Array.isArray(r)){if(o=r.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!Pt(r[n],t[n]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(n of r.entries())if(!t.has(n[0]))return!1;for(n of r.entries())if(!Pt(n[1],t.get(n[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(n of r.entries())if(!t.has(n[0]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(i=s(r),o=i.length,o!==s(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=o;n--!==0;){let c=i[n];if(!Pt(r[c],t[c]))return!1}return!0}return r!==r&&t!==t||r==null&&t==null}function Pt(r,t){try{return Ki(r,t)}catch{return!1}}function ut(r,t){return!Pt(r,t)}function kt(r,t){let o=n=>n[r]===!0;return n=>{if(o(n))return n;let i=t(n);return i[r]=!0,i}}var $n=E(K(),1);var wr=r=>{let t=r??{};return(o,n)=>{var i;let s={hasChanged:ut,attribute:!1,...t};(0,$n.property)(s)(o,n);let c=o.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:d=>d[n],store:t.store})}};var Ft=class{constructor(){this.queue=[]}add(t,o=!1){o&&this.clear(t.type),this.queue.push(t)}consume(t){let o=this.queue.find(n=>n.type===t);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(t){typeof t=="string"?this.queue=this.queue.filter(o=>o.type!==t):this.queue=this.queue.filter(o=>!t.test(o.type))}};var Ae=E(K(),1);var Kn=E(K(),1);function Vn(r,t){let o=()=>JSON.parse(JSON.stringify(r));return(0,Kn.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:ut,...t??{}})}var Dt=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,o;let n=[...this.callbacks];this.callbacks=[];let i=(t=this.rejectPromise)!==null&&t!==void 0?t:()=>null,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){i(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var qn=E(q(),1);var Ut=globalThis,Vi=Ut.ShadowRoot&&(Ut.ShadyCSS===void 0||Ut.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dl=Symbol();var Zn=(r,t)=>{if(Vi)r.adoptedStyleSheets=t.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of t){let n=document.createElement("style"),i=Ut.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,r.appendChild(n)}};var Bt=class extends qn.LitElement{createRenderRoot(){let t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach(([i,s])=>t.registry.define(i,s)));let o={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Zn(n,t.elementStyles),n}};function Yn(r,t,...o){var n;let i=r.querySelector(t);for(let s of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var We=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ea,Qn=Symbol("constructorPrototype"),Xn=Symbol("constructorName"),ta=Symbol("exportpartsDebouncer"),Jn=Symbol("dynamicDependenciesLoaded"),Me=class r extends CustomEvent{constructor(){super(r.eventName,{bubbles:!0})}};Me.eventName="exportparts-updated";var ne=class extends Bt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ea]=new Dt(5),this.scheduleExportpartsUpdate=()=>{var t,o,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[ta].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Xn]=this.constructor.name,this[Qn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Xn]&&Object.setPrototypeOf(this,this[Qn])}connectedCallback(){var t;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[Jn]||(o[Jn]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Me.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Me.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Me)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];o=Yn(this.shadowRoot,...s)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){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(s=>s.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(t){var o,n,i,s,c,d;let u=g=>g!=null&&g.trim().length>0,p=t.filter(u).map(g=>g.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=g.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],b=(d=(c=g.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(w=>w.split(":")[1]))!==null&&d!==void 0?d:[],S=[...v,...b].filter(u).map(w=>w.trim());for(let w of S)h.add(w)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(g=>p.map(v=>`${g}:${v}--${g}`));this.exportparts=[...this.part,...y].join(", ")}};ea=ta;We([(0,Ae.property)()],ne.prototype,"exportpartsPrefix",void 0);We([Vn([])],ne.prototype,"exportpartsPrefixes",void 0);We([(0,Ae.property)({reflect:!0})],ne.prototype,"exportparts",void 0);We([(0,Ae.property)()],ne.prototype,"customStylesheet",void 0);We([(0,Ae.property)()],ne.prototype,"elementToFocus",void 0);We([(0,Ae.state)()],ne.prototype,"useAdoptedStyleSheets",void 0);function Mt(r){var t;return(t=r?.isFtReduxStore)!==null&&t!==void 0?t:!1}var pt=Symbol("internalReduxEventsUnsubscribers"),pe=Symbol("internalStoresUnsubscribers"),we=Symbol("internalStores"),Zi=kt(Symbol("withRedux"),function(r){var t,o,n;class i extends r{constructor(){super(...arguments),this[t]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[we].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[we].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[we].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[we].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[we].delete(d)}setupStores(){this.unsubscribeFromStores(),this[we].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[pe].has(c.store):this[pe].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[pe].set(c,d.subscribe(()=>this.updateFromStores())),this[pt].set(c,[]),Mt(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=g=>this[h](g);d.addEventListener(p.eventName,y),this[pt].get(c).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[pe].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[pe].has(c)&&this[pe].get(c)(),this[pe].delete(c),(d=this[pt].get(c))===null||d===void 0||d.forEach(u=>u()),this[pt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=pe,o=we,n=pt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),ra=class extends Zi(ne){};function X(r){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+r+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ie(r){return!!r&&!!r[F]}function re(r){var t;return!!r&&(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)===rs}(r)||Array.isArray(r)||!!r[la]||!!(!((t=r.constructor)===null||t===void 0)&&t[la])||Fr(r)||Dr(r))}function Ie(r,t,o){o===void 0&&(o=!1),Ge(r)===0?(o?Object.keys:He)(r).forEach(function(n){o&&typeof n=="symbol"||t(n,r[n],r)}):r.forEach(function(n,i){return t(i,n,r)})}function Ge(r){var t=r[F];return t?t.i>3?t.i-4:t.i:Array.isArray(r)?1:Fr(r)?2:Dr(r)?3:0}function ze(r,t){return Ge(r)===2?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function qi(r,t){return Ge(r)===2?r.get(t):r[t]}function da(r,t,o){var n=Ge(r);n===2?r.set(t,o):n===3?r.add(o):r[t]=o}function ua(r,t){return r===t?r!==0||1/r==1/t:r!=r&&t!=t}function Fr(r){return es&&r instanceof Map}function Dr(r){return ts&&r instanceof Set}function fe(r){return r.o||r.t}function Ur(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var t=ha(r);delete t[F];for(var o=He(t),n=0;n<o.length;n++){var i=o[n],s=t[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:r[i]})}return Object.create(Object.getPrototypeOf(r),t)}function Br(r,t){return t===void 0&&(t=!1),Mr(r)||ie(r)||!re(r)||(Ge(r)>1&&(r.set=r.add=r.clear=r.delete=Yi),Object.freeze(r),t&&Ie(r,function(o,n){return Br(n,!0)},!0)),r}function Yi(){X(2)}function Mr(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function ae(r){var t=kr[r];return t||X(18,r),t}function Qi(r,t){kr[r]||(kr[r]=t)}function Lr(){return ht}function Ir(r,t){t&&(ae("Patches"),r.u=[],r.s=[],r.v=t)}function Wt(r){_r(r),r.p.forEach(Xi),r.p=null}function _r(r){r===ht&&(ht=r.l)}function oa(r){return ht={p:[],l:ht,h:r,m:!0,_:0}}function Xi(r){var t=r[F];t.i===0||t.i===1?t.j():t.g=!0}function Rr(r,t){t._=t.p.length;var o=t.p[0],n=r!==void 0&&r!==o;return t.h.O||ae("ES5").S(t,r,n),n?(o[F].P&&(Wt(t),X(4)),re(r)&&(r=zt(t,r),t.l||Ht(t,r)),t.u&&ae("Patches").M(o[F].t,r,t.u,t.s)):r=zt(t,o,[]),Wt(t),t.u&&t.v(t.u,t.s),r!==fa?r:void 0}function zt(r,t,o){if(Mr(t))return t;var n=t[F];if(!n)return Ie(t,function(d,u){return na(r,n,t,d,u,o)},!0),t;if(n.A!==r)return t;if(!n.P)return Ht(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ur(n.k):n.o,s=i,c=!1;n.i===3&&(s=new Set(i),i.clear(),c=!0),Ie(s,function(d,u){return na(r,n,i,d,u,o,c)}),Ht(r,i,!1),o&&r.u&&ae("Patches").N(n,o,r.u,r.s)}return n.o}function na(r,t,o,n,i,s,c){if(ie(i)){var d=zt(r,i,s&&t&&t.i!==3&&!ze(t.R,n)?s.concat(n):void 0);if(da(o,n,d),!ie(d))return;r.m=!1}else c&&o.add(i);if(re(i)&&!Mr(i)){if(!r.h.D&&r._<1)return;zt(r,i),t&&t.A.l||Ht(r,i)}}function Ht(r,t,o){o===void 0&&(o=!1),!r.l&&r.h.D&&r.m&&Br(t,o)}function Nr(r,t){var o=r[F];return(o?fe(o):r)[t]}function aa(r,t){if(t in r)for(var o=Object.getPrototypeOf(r);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function he(r){r.P||(r.P=!0,r.l&&he(r.l))}function Tr(r){r.o||(r.o=Ur(r.t))}function Pr(r,t,o){var n=Fr(t)?ae("MapSet").F(t,o):Dr(t)?ae("MapSet").T(t,o):r.O?function(i,s){var c=Array.isArray(i),d={i:c?1:0,A:s?s.A:Lr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=d,p=yt;c&&(u=[d],p=ft);var h=Proxy.revocable(u,p),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(t,o):ae("ES5").J(t,o);return(o?o.A:Lr()).p.push(n),n}function Ji(r){return ie(r)||X(22,r),function t(o){if(!re(o))return o;var n,i=o[F],s=Ge(o);if(i){if(!i.P&&(i.i<4||!ae("ES5").K(i)))return i.t;i.I=!0,n=ia(o,s),i.I=!1}else n=ia(o,s);return Ie(n,function(c,d){i&&qi(i.t,c)===d||da(n,c,t(d))}),s===3?new Set(n):n}(r)}function ia(r,t){switch(t){case 2:return new Map(r);case 3:return Array.from(r)}return Ur(r)}function pa(){function r(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[F];return yt.get(p,c)},set:function(p){var h=this[F];yt.set(h,c,p)}},u}function t(c){for(var d=c.length-1;d>=0;d--){var u=c[d][F];if(!u.P)switch(u.i){case 5:n(u)&&he(u);break;case 4:o(u)&&he(u)}}}function o(c){for(var d=c.t,u=c.k,p=He(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==F){var g=d[y];if(g===void 0&&!ze(d,y))return!0;var v=u[y],b=v&&v[F];if(b?b.t!==g:!ua(v,g))return!0}}var S=!!d[F];return p.length!==He(d).length+(S?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function i(c){c.g&&X(3,JSON.stringify(fe(c)))}var s={};Qi("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(y,g){if(y){for(var v=Array(g.length),b=0;b<g.length;b++)Object.defineProperty(v,""+b,r(b,!0));return v}var S=ha(g);delete S[F];for(var w=He(S),I=0;I<w.length;I++){var R=w[I];S[R]=r(R,y||!!S[R].enumerable)}return Object.create(Object.getPrototypeOf(g),S)}(u,c),h={i:u?5:4,A:d?d.A:Lr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,F,{value:h,writable:!0}),p},S:function(c,d,u){u?ie(d)&&d[F].A===c&&t(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var y=h[F];if(y){var g=y.t,v=y.k,b=y.R,S=y.i;if(S===4)Ie(v,function(T){T!==F&&(g[T]!==void 0||ze(g,T)?b[T]||p(v[T]):(b[T]=!0,he(y)))}),Ie(g,function(T){v[T]!==void 0||ze(v,T)||(b[T]=!1,he(y))});else if(S===5){if(n(y)&&(he(y),b.length=!0),v.length<g.length)for(var w=v.length;w<g.length;w++)b[w]=!1;else for(var I=g.length;I<v.length;I++)b[I]=!0;for(var R=Math.min(v.length,g.length),_=0;_<R;_++)v.hasOwnProperty(_)||(b[_]=!0),b[_]===void 0&&p(v[_])}}}}(c.p[0]),t(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var sa,ht,Wr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",es=typeof Map<"u",ts=typeof Set<"u",ca=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",fa=Wr?Symbol.for("immer-nothing"):((sa={})["immer-nothing"]=!0,sa),la=Wr?Symbol.for("immer-draftable"):"__$immer_draftable",F=Wr?Symbol.for("immer-state"):"__$immer_state";var rs=""+Object.prototype.constructor,He=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,ha=Object.getOwnPropertyDescriptors||function(r){var t={};return He(r).forEach(function(o){t[o]=Object.getOwnPropertyDescriptor(r,o)}),t},kr={},yt={get:function(r,t){if(t===F)return r;var o=fe(r);if(!ze(o,t))return function(i,s,c){var d,u=aa(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(i.k):void 0}(r,o,t);var n=o[t];return r.I||!re(n)?n:n===Nr(r.t,t)?(Tr(r),r.o[t]=Pr(r.A.h,n,r)):n},has:function(r,t){return t in fe(r)},ownKeys:function(r){return Reflect.ownKeys(fe(r))},set:function(r,t,o){var n=aa(fe(r),t);if(n?.set)return n.set.call(r.k,o),!0;if(!r.P){var i=Nr(fe(r),t),s=i?.[F];if(s&&s.t===o)return r.o[t]=o,r.R[t]=!1,!0;if(ua(o,i)&&(o!==void 0||ze(r.t,t)))return!0;Tr(r),he(r)}return r.o[t]===o&&(o!==void 0||t in r.o)||Number.isNaN(o)&&Number.isNaN(r.o[t])||(r.o[t]=o,r.R[t]=!0),!0},deleteProperty:function(r,t){return Nr(r.t,t)!==void 0||t in r.t?(r.R[t]=!1,Tr(r),he(r)):delete r.R[t],r.o&&delete r.o[t],!0},getOwnPropertyDescriptor:function(r,t){var o=fe(r),n=Reflect.getOwnPropertyDescriptor(o,t);return n&&{writable:!0,configurable:r.i!==1||t!=="length",enumerable:n.enumerable,value:o[t]}},defineProperty:function(){X(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){X(12)}},ft={};Ie(yt,function(r,t){ft[r]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ft.deleteProperty=function(r,t){return ft.set.call(this,r,t,void 0)},ft.set=function(r,t,o){return yt.set.call(this,r[0],t,o,r[0])};var os=function(){function r(o){var n=this;this.O=ca,this.D=!0,this.produce=function(i,s,c){if(typeof i=="function"&&typeof s!="function"){var d=s;s=i;var u=n;return function(S){var w=this;S===void 0&&(S=d);for(var I=arguments.length,R=Array(I>1?I-1:0),_=1;_<I;_++)R[_-1]=arguments[_];return u.produce(S,function(T){var W;return(W=s).call.apply(W,[w,T].concat(R))})}}var p;if(typeof s!="function"&&X(6),c!==void 0&&typeof c!="function"&&X(7),re(i)){var h=oa(n),y=Pr(n,i,void 0),g=!0;try{p=s(y),g=!1}finally{g?Wt(h):_r(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(S){return Ir(h,c),Rr(S,h)},function(S){throw Wt(h),S}):(Ir(h,c),Rr(p,h))}if(!i||typeof i!="object"){if((p=s(i))===void 0&&(p=i),p===fa&&(p=void 0),n.D&&Br(p,!0),c){var v=[],b=[];ae("Patches").M(i,p,v,b),c(v,b)}return p}X(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(p,function(v){return i.apply(void 0,[v].concat(y))})};var c,d,u=n.produce(i,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var t=r.prototype;return t.createDraft=function(o){re(o)||X(8),ie(o)&&(o=Ji(o));var n=oa(this),i=Pr(this,o,void 0);return i[F].C=!0,_r(n),i},t.finishDraft=function(o,n){var i=o&&o[F],s=i.A;return Ir(s,n),Rr(void 0,s)},t.setAutoFreeze=function(o){this.D=o},t.setUseProxies=function(o){o&&!ca&&X(20),this.O=o},t.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}i>-1&&(n=n.slice(i+1));var c=ae("Patches").$;return ie(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},r}(),V=new os,ns=V.produce,Ql=V.produceWithPatches.bind(V),Xl=V.setAutoFreeze.bind(V),Jl=V.setUseProxies.bind(V),ed=V.applyPatches.bind(V),td=V.createDraft.bind(V),rd=V.finishDraft.bind(V),Gt=ns;function Re(r){"@babel/helpers - typeof";return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(r)}function ya(r,t){if(Re(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var n=o.call(r,t||"default");if(Re(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function ga(r){var t=ya(r,"string");return Re(t)=="symbol"?t:t+""}function ma(r,t,o){return(t=ga(t))in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}function ba(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),o.push.apply(o,n)}return o}function zr(r){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ba(Object(o),!0).forEach(function(n){ma(r,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ba(Object(o)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(o,n))})}return r}function G(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var xa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Hr=function(){return Math.random().toString(36).substring(7).split("").join(".")},jt={INIT:"@@redux/INIT"+Hr(),REPLACE:"@@redux/REPLACE"+Hr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Hr()}};function as(r){if(typeof r!="object"||r===null)return!1;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function Gr(r,t,o){var n;if(typeof t=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(G(0));if(typeof t=="function"&&typeof o>"u"&&(o=t,t=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(G(1));return o(Gr)(r,t)}if(typeof r!="function")throw new Error(G(2));var i=r,s=t,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(G(3));return s}function y(S){if(typeof S!="function")throw new Error(G(4));if(u)throw new Error(G(5));var w=!0;return p(),d.push(S),function(){if(w){if(u)throw new Error(G(6));w=!1,p();var R=d.indexOf(S);d.splice(R,1),c=null}}}function g(S){if(!as(S))throw new Error(G(7));if(typeof S.type>"u")throw new Error(G(8));if(u)throw new Error(G(9));try{u=!0,s=i(s,S)}finally{u=!1}for(var w=c=d,I=0;I<w.length;I++){var R=w[I];R()}return S}function v(S){if(typeof S!="function")throw new Error(G(10));i=S,g({type:jt.REPLACE})}function b(){var S,w=y;return S={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(G(11));function _(){R.next&&R.next(h())}_();var T=w(_);return{unsubscribe:T}}},S[xa]=function(){return this},S}return g({type:jt.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:v},n[xa]=b,n}function is(r){Object.keys(r).forEach(function(t){var o=r[t],n=o(void 0,{type:jt.INIT});if(typeof n>"u")throw new Error(G(12));if(typeof o(void 0,{type:jt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(G(13))})}function va(r){for(var t=Object.keys(r),o={},n=0;n<t.length;n++){var i=t[n];typeof r[i]=="function"&&(o[i]=r[i])}var s=Object.keys(o),c,d;try{is(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var g=!1,v={},b=0;b<s.length;b++){var S=s[b],w=o[S],I=p[S],R=w(I,h);if(typeof R>"u"){var _=h&&h.type;throw new Error(G(14))}v[S]=R,g=g||R!==I}return g=g||s.length!==Object.keys(p).length,g?v:p}}function je(){for(var r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Sa(){for(var r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(G(15))},c={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=t.map(function(u){return u(c)});return s=je.apply(void 0,d)(i.dispatch),zr(zr({},i),{},{dispatch:s})}}}function Ca(r){var t=function(n){var i=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(i,s,r):c(d)}}};return t}var Oa=Ca();Oa.withExtraArgument=Ca;var jr=Oa;var Ra=function(){var r=function(t,o){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");r(t,o);function n(){this.constructor=t}t.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),ss=function(r,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(s=p[0]&2?i.return:p[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,p[1])).done)return s;switch(i=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,i=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=t.call(r,o)}catch(h){p=[6,h],i=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},$e=function(r,t){for(var o=0,n=t.length,i=r.length;o<n;o++,i++)r[i]=t[o];return r},cs=Object.defineProperty,ls=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,Ea=Object.getOwnPropertySymbols,us=Object.prototype.hasOwnProperty,ps=Object.prototype.propertyIsEnumerable,Aa=function(r,t,o){return t in r?cs(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o},ye=function(r,t){for(var o in t||(t={}))us.call(t,o)&&Aa(r,o,t[o]);if(Ea)for(var n=0,i=Ea(t);n<i.length;n++){var o=i[n];ps.call(t,o)&&Aa(r,o,t[o])}return r},$r=function(r,t){return ls(r,ds(t))},fs=function(r,t,o){return new Promise(function(n,i){var s=function(u){try{d(o.next(u))}catch(p){i(p)}},c=function(u){try{d(o.throw(u))}catch(p){i(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((o=o.apply(r,t)).next())})};var hs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?je:je.apply(null,arguments)},vd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function ys(r){if(typeof r!="object"||r===null)return!1;var t=Object.getPrototypeOf(r);if(t===null)return!0;for(var o=t;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return t===o}var gs=function(r){Ra(t,r);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=r.apply(this,o)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return r.prototype.concat.apply(this,o)},t.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(t.bind.apply(t,$e([void 0],o[0].concat(this)))):new(t.bind.apply(t,$e([void 0],o.concat(this))))},t}(Array),ms=function(r){Ra(t,r);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=r.apply(this,o)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return r.prototype.concat.apply(this,o)},t.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(t.bind.apply(t,$e([void 0],o[0].concat(this)))):new(t.bind.apply(t,$e([void 0],o.concat(this))))},t}(Array);function Zr(r){return re(r)?Gt(r,function(){}):r}function bs(r){return typeof r=="boolean"}function xs(){return function(t){return vs(t)}}function vs(r){r===void 0&&(r={});var t=r.thunk,o=t===void 0?!0:t,n=r.immutableCheck,i=n===void 0?!0:n,s=r.serializableCheck,c=s===void 0?!0:s,d=new gs;if(o&&(bs(o)?d.push(jr):d.push(jr.withExtraArgument(o.extraArgument))),0){if(i)var u;if(c)var p}return d}var Kr=!0;function Na(r){var t=xs(),o=r||{},n=o.reducer,i=n===void 0?void 0:n,s=o.middleware,c=s===void 0?t():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,g=y===void 0?void 0:y,v;if(typeof i=="function")v=i;else if(ys(i))v=va(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 b=c;if(typeof b=="function"&&(b=b(t),!Kr&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Kr&&b.some(function(T){return typeof T!="function"}))throw new Error("each middleware provided to configureStore must be a function");var S=Sa.apply(void 0,b),w=je;u&&(w=hs(ye({trace:!Kr},typeof u=="object"&&u)));var I=new ms(S),R=I;Array.isArray(g)?R=$e([S],g):typeof g=="function"&&(R=g(I));var _=w.apply(void 0,R);return Gr(v,h,_)}function ge(r,t){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var s=t.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ye(ye({type:r,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:r,payload:n[0]}}return o.toString=function(){return""+r},o.type=r,o.match=function(n){return n.type===r},o}function Ta(r){var t={},o=[],n,i={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[d]=c,i},addMatcher:function(s,c){return o.push({matcher:s,reducer:c}),i},addDefaultCase:function(s){return n=s,i}};return r(i),[t,o,n]}function Ss(r){return typeof r=="function"}function Cs(r,t,o,n){o===void 0&&(o=[]);var i=typeof t=="function"?Ta(t):[t,o,n],s=i[0],c=i[1],d=i[2],u;if(Ss(r))u=function(){return Zr(r())};else{var p=Zr(r);u=function(){return p}}function h(y,g){y===void 0&&(y=u());var v=$e([s[g.type]],c.filter(function(b){var S=b.matcher;return S(g)}).map(function(b){var S=b.reducer;return S}));return v.filter(function(b){return!!b}).length===0&&(v=[d]),v.reduce(function(b,S){if(S)if(ie(b)){var w=b,I=S(w,g);return I===void 0?b:I}else{if(re(b))return Gt(b,function(R){return S(R,g)});var I=S(b,g);if(I===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return b},y)}return h.getInitialState=u,h}function Os(r,t){return r+"/"+t}function La(r){var t=r.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof r.initialState=="function"?r.initialState:Zr(r.initialState),n=r.reducers||{},i=Object.keys(n),s={},c={},d={};i.forEach(function(h){var y=n[h],g=Os(t,h),v,b;"reducer"in y?(v=y.reducer,b=y.prepare):v=y,s[h]=v,c[g]=v,d[h]=b?ge(g,b):ge(g)});function u(){var h=typeof r.extraReducers=="function"?Ta(r.extraReducers):[r.extraReducers],y=h[0],g=y===void 0?{}:y,v=h[1],b=v===void 0?[]:v,S=h[2],w=S===void 0?void 0:S,I=ye(ye({},g),c);return Cs(o,function(R){for(var _ in I)R.addCase(_,I[_]);for(var T=0,W=b;T<W.length;T++){var ee=W[T];R.addMatcher(ee.matcher,ee.reducer)}w&&R.addDefaultCase(w)})}var p;return{name:t,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Es="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",As=function(r){r===void 0&&(r=21);for(var t="",o=r;o--;)t+=Es[Math.random()*64|0];return t},ws=["name","message","stack","code"],Vr=function(){function r(t,o){this.payload=t,this.meta=o}return r}(),wa=function(){function r(t,o){this.payload=t,this.meta=o}return r}(),Is=function(r){if(typeof r=="object"&&r!==null){for(var t={},o=0,n=ws;o<n.length;o++){var i=n[o];typeof r[i]=="string"&&(t[i]=r[i])}return t}return{message:String(r)}},Ed=function(){function r(t,o,n){var i=ge(t+"/fulfilled",function(h,y,g,v){return{payload:h,meta:$r(ye({},v||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=ge(t+"/pending",function(h,y,g){return{payload:void 0,meta:$r(ye({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),c=ge(t+"/rejected",function(h,y,g,v,b){return{payload:v,error:(n&&n.serializeError||Is)(h||"Rejected"),meta:$r(ye({},b||{}),{arg:g,requestId:y,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,g,v){var b=n?.idGenerator?n.idGenerator(h):As(),S=new u,w,I=!1;function R(T){w=T,S.abort()}var _=function(){return fs(this,null,function(){var T,W,ee,xe,j,ve,Fe;return ss(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),xe=(T=n?.condition)==null?void 0:T.call(n,h,{getState:g,extra:v}),Ns(xe)?[4,xe]:[3,2];case 1:xe=f.sent(),f.label=2;case 2:if(xe===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,j=new Promise(function(m,A){return S.signal.addEventListener("abort",function(){return A({name:"AbortError",message:w||"Aborted"})})}),y(s(b,h,(W=n?.getPendingMeta)==null?void 0:W.call(n,{requestId:b,arg:h},{getState:g,extra:v}))),[4,Promise.race([j,Promise.resolve(o(h,{dispatch:y,getState:g,extra:v,requestId:b,signal:S.signal,abort:R,rejectWithValue:function(m,A){return new Vr(m,A)},fulfillWithValue:function(m,A){return new wa(m,A)}})).then(function(m){if(m instanceof Vr)throw m;return m instanceof wa?i(m.payload,b,h,m.meta):i(m,b,h)})])];case 3:return ee=f.sent(),[3,5];case 4:return ve=f.sent(),ee=ve instanceof Vr?c(null,b,h,ve.payload,ve.meta):c(ve,b,h),[3,5];case 5:return Fe=n&&!n.dispatchConditionRejection&&c.match(ee)&&ee.meta.condition,Fe||y(ee),[2,ee]}})})}();return Object.assign(_,{abort:R,requestId:b,arg:h,unwrap:function(){return _.then(Rs)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:i,typePrefix:t})}return r.withTypes=function(){return r},r}();function Rs(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function Ns(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var _a="listener",Pa="completed",ka="cancelled",Ad="task-"+ka,wd="task-"+Pa,Id=_a+"-"+ka,Rd=_a+"-"+Pa;var qr="listenerMiddleware";var Nd=ge(qr+"/add"),Td=ge(qr+"/removeAll"),Ld=ge(qr+"/remove");var Ia,_d=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(Ia||(Ia=Promise.resolve())).then(r).catch(function(t){return setTimeout(function(){throw t},0)})},Ts=function(r){return function(t){setTimeout(t,r)}},Pd=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ts(10);pa();var Ls=kt(Symbol("withEventBus"),function(r,t){return class extends r{constructor(){super(...arguments),this.eventBus=t??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)}}}),$t=class extends Ls(Object){};window.ftReduxStores||(window.ftReduxStores={});var Fa=class r extends $t{static get(t){var o;let n=typeof t=="string"?t:t.name,i=typeof t=="string"?void 0:t,s=window.ftReduxStores[n];if(Mt(s))return s;if(i==null)return;let c=La({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),d=Na({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:c.reducer(u,p)});return window.ftReduxStores[i.name]=new r(c,d,i.eventBus)}constructor(t,o,n){super(),this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Ft;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let y=p(...h.map(i));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:i(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Kt=class{static format(t,o,n,i){return window.moment?window.moment(t).locale(o).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(t,o,n,i)}static getMomentDateFormat(t,o){return t?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(t,o,n,i){let s=typeof t=="string"?new Date(t):t,c=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!i)return c;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${c} ${d}`}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${t(Math.abs(o)/60)}:${t(Math.abs(o)%60)}`}};var Da=E(P()),Vt=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ou=(0,Da.applyMixinOnce)(Symbol("withDateFormat"),function(r){class t extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(C)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(d=>d.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?d=>Kt.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Vt([(0,Yr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Vt([(0,Yr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Vt([wr({store:C.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],t.prototype,"metadataDescriptors",void 0),Vt([wr({store:C.name})],t.prototype,"uiLocale",void 0),t});var Yt=E(P());var Zt=class extends ${constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=C.getState().session;return!!t?.sessionAuthenticated}};var qt=class extends ${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 t=C.getState().session;return!!t?.sessionAuthenticated}};var _s="ft-user-assets",Ps={setAssetCount:(r,t)=>{let{userAssetType:o,count:n}=t.payload.assetCount;r.assetCounts.allAsset[o]=n},clearAssetCount:r=>{Object.values(Q).forEach(t=>{r.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(r,t)=>{let o=t.payload.mapId;r.assetCounts.bookmarkByMap[o]=t.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,t)=>{let{assetType:o,mapId:n,asset:i}=t.payload;Xr(r,o,[...Qr(r,o),i]),Ua(r,o,1,n),Ba(r,i)},editAsset:(r,t)=>{let{assetType:o,asset:n}=t.payload;Xr(r,o,Qr(r,o).map(i=>i.id===n.id?n:i)),Ba(r,n)},removeAsset:(r,t)=>{let{assetType:o,mapId:n,assetId:i}=t.payload;Xr(r,o,Qr(r,o).filter(s=>s.id!==i)),Ua(r,o,-1,n)}},Ma={[Q.SEARCHES]:"savedSearches",[Q.BOOKMARKS]:"bookmarks",[Q.BOOKS]:void 0,[Q.COLLECTIONS]:void 0},Qr=(r,t)=>{var o;let n=Ma[t];return n?(o=r[n])!==null&&o!==void 0?o:[]:[]},Xr=(r,t,o)=>{let n=Ma[t];n&&(r[n]=o)},Ua=(r,t,o,n)=>{let i=r.assetCounts.allAsset[t];if(i!==void 0&&(r.assetCounts.allAsset[t]=Math.max(0,i+o),t===Q.BOOKMARKS&&n)){let s=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},Ba=(r,t)=>{let o=r.assetLabels.map(i=>i.title),n=t.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));r.assetLabels.push(...n)},Z=Yt.FtReduxStore.get({name:_s,reducers:Ps,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Q).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Jr=class{constructor(t=new Zt,o=new qt){this.assetCountsService=t,this.assetLabelsService=o,this.currentSession=C.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new wt,this.savedSearchesService=new Lt,C.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:o}=C.getState();(0,Yt.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Z.actions.clearAssetCount(),Z.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Z.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Z.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();Z.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();Z.actions.assetLabels(t)}async loadAssetCount(t){let o=await this.assetCountsService.getUserAssetCount(t);o&&Z.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(t){let o=await this.assetCountsService.getUserBookmarkCountByMap(t);o&&Z.actions.setBookmarkCountByMap({count:o.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let o=Object.keys(Z.getState().assetCounts.bookmarkByMap).length!==0;t===Q.BOOKMARKS&&o&&Z.actions.clearBookmarkCountByMap(),Z.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let o=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Z.actions.bookmarks(o)}}},ks=new Jr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ks);(0,Wa.customElement)("ft-app-context")(k);var Ga=E(K());var eo=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,i]=t.split(".");return{context:n,key:i,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},za=new eo;var Fs=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},Ds=Symbol("i18nAttributes"),Us=Symbol("i18nListAttributes"),ja=Symbol("i18nProperties"),Qt=Symbol("i18nContexts"),gt=Symbol("i18nUnsubs"),Jt=(0,Ke.applyMixinOnce)(Symbol("withI18n"),function(r){var t,o;class n extends r{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Rt:Ue}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let g=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...g)}return u}async awaitI18n(s){let{context:c,custom:d}=s;return c&&await this.getI18nService(d).prepareContext(c),this.i18n(s)}customI18n(s,c){if(za.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(c=this[Ds])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[Us])===null||d===void 0||d.forEach((h,y)=>{var g;return u[y]=(g=u[y])===null||g===void 0?void 0:g.map(v=>p(h,y,v))})}updateI18nProperties(s){var c;(c=this[ja])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[Qt].set(u,{isCustomContext:d}),this[gt].has(u)||this[gt].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[Qt].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Qt].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[gt].forEach(s=>s()),this[gt].clear()}}return t=Qt,o=gt,Fs([(0,Ga.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Ha=class extends Jt(Ke.FtLitElement){},Xt=class extends Jt(Ke.FtLitElementRedux){};var mt=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},oe=class extends Xt{constructor(){super(),this.editorMode=!1,this.addStore(C)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":er.nothing:er.html`
|
|
10
|
+
`}connectedCallback(){super.connectedCallback(),C.addEventListener(Ce.eventName,this.reloadConfiguration)}disconnectedCallback(){C.addEventListener(Ce.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var o,n,i,s,c,d,u;super.update(t),t.has("baseUrl")&&(C.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&C.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&C.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&C.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&C.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&C.actions.noCustom(this.noCustom),t.has("editorMode")&&C.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&C.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&C.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Ue.addContext(p)),t.has("openExternalDocumentInNewTab")&&C.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&C.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&C.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(C.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),C.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),C.actions.searchInAllLanguagesAllowed((c=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),t.has("authenticationRequired")&&C.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&C.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}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",()=>Gn(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};k.elementDefinitions={};k.styles=nn;B([(0,H.property)()],k.prototype,"baseUrl",void 0);B([(0,H.property)()],k.prototype,"apiIntegrationIdentifier",void 0);B([(0,H.property)()],k.prototype,"apiIntegrationAppVersion",void 0);B([(0,H.property)()],k.prototype,"uiLocale",void 0);B([(0,te.jsonProperty)(null)],k.prototype,"availableUiLocales",void 0);B([(0,te.jsonProperty)(null)],k.prototype,"metadataConfiguration",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"editorMode",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"noCustom",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"openExternalDocumentInNewTab",void 0);B([(0,H.property)({converter:{fromAttribute(r){return r==="false"?!1:r==="true"||(r??!1)}}})],k.prototype,"noCustomComponent",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"withManualResources",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"navigatorOnline",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"forcedOffline",void 0);B([(0,H.property)({type:Object})],k.prototype,"apiProvider",void 0);B([(0,H.property)({type:Boolean})],k.prototype,"authenticationRequired",void 0);B([(0,te.jsonProperty)([])],k.prototype,"messageContexts",void 0);B([(0,te.jsonProperty)(void 0)],k.prototype,"session",void 0);B([(0,H.state)()],k.prototype,"localesConfiguration",void 0);B([(0,H.state)()],k.prototype,"availableContentLocales",void 0);var Yr=E(K());function Ki(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;let o,n,i;if(Array.isArray(r)){if(o=r.length,o!=t.length)return!1;for(n=o;n--!==0;)if(!Pt(r[n],t[n]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(n of r.entries())if(!t.has(n[0]))return!1;for(n of r.entries())if(!Pt(n[1],t.get(n[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(n of r.entries())if(!t.has(n[0]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(i=s(r),o=i.length,o!==s(t).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=o;n--!==0;){let c=i[n];if(!Pt(r[c],t[c]))return!1}return!0}return r!==r&&t!==t||r==null&&t==null}function Pt(r,t){try{return Ki(r,t)}catch{return!1}}function ut(r,t){return!Pt(r,t)}function kt(r,t){let o=n=>n[r]===!0;return n=>{if(o(n))return n;let i=t(n);return i[r]=!0,i}}var $n=E(K(),1);var wr=r=>{let t=r??{};return(o,n)=>{var i;let s={hasChanged:ut,attribute:!1,...t};(0,$n.property)(s)(o,n);let c=o.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:d=>d[n],store:t.store})}};var Ft=class{constructor(){this.queue=[]}add(t,o=!1){o&&this.clear(t.type),this.queue.push(t)}consume(t){let o=this.queue.find(n=>n.type===t);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(t){typeof t=="string"?this.queue=this.queue.filter(o=>o.type!==t):this.queue=this.queue.filter(o=>!t.test(o.type))}};var Ae=E(K(),1);var Kn=E(K(),1);function Vn(r,t){let o=()=>JSON.parse(JSON.stringify(r));return(0,Kn.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:ut,...t??{}})}var Dt=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,o){return this.callbacks=[t],this.debounce(o)}queue(t,o){return this.callbacks.push(t),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,o;let n=[...this.callbacks];this.callbacks=[];let i=(t=this.rejectPromise)!==null&&t!==void 0?t:()=>null,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){i(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var qn=E(q(),1);var Ut=globalThis,Vi=Ut.ShadowRoot&&(Ut.ShadyCSS===void 0||Ut.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dl=Symbol();var Zn=(r,t)=>{if(Vi)r.adoptedStyleSheets=t.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of t){let n=document.createElement("style"),i=Ut.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,r.appendChild(n)}};var Bt=class extends qn.LitElement{createRenderRoot(){let t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach(([i,s])=>t.registry.define(i,s)));let o={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Zn(n,t.elementStyles),n}};function Yn(r,t,...o){var n;let i=r.querySelector(t);for(let s of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var We=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ea,Qn=Symbol("constructorPrototype"),Xn=Symbol("constructorName"),ta=Symbol("exportpartsDebouncer"),Jn=Symbol("dynamicDependenciesLoaded"),Me=class r extends CustomEvent{constructor(){super(r.eventName,{bubbles:!0})}};Me.eventName="exportparts-updated";var ne=class extends Bt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ea]=new Dt(5),this.scheduleExportpartsUpdate=()=>{var t,o,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[ta].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Xn]=this.constructor.name,this[Qn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Xn]&&Object.setPrototypeOf(this,this[Qn])}connectedCallback(){var t;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[Jn]||(o[Jn]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Me.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Me.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Me)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];o=Yn(this.shadowRoot,...s)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){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(s=>s.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(t){var o,n,i,s,c,d;let u=g=>g!=null&&g.trim().length>0,p=t.filter(u).map(g=>g.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=g.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],b=(d=(c=g.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(w=>w.split(":")[1]))!==null&&d!==void 0?d:[],S=[...v,...b].filter(u).map(w=>w.trim());for(let w of S)h.add(w)}if(h.size===0){this.exportparts=void 0;return}let y=[...h.values()].flatMap(g=>p.map(v=>`${g}:${v}--${g}`));this.exportparts=[...this.part,...y].join(", ")}};ea=ta;We([(0,Ae.property)()],ne.prototype,"exportpartsPrefix",void 0);We([Vn([])],ne.prototype,"exportpartsPrefixes",void 0);We([(0,Ae.property)({reflect:!0})],ne.prototype,"exportparts",void 0);We([(0,Ae.property)()],ne.prototype,"customStylesheet",void 0);We([(0,Ae.property)()],ne.prototype,"elementToFocus",void 0);We([(0,Ae.state)()],ne.prototype,"useAdoptedStyleSheets",void 0);function Mt(r){var t;return(t=r?.isFtReduxStore)!==null&&t!==void 0?t:!1}var pt=Symbol("internalReduxEventsUnsubscribers"),pe=Symbol("internalStoresUnsubscribers"),we=Symbol("internalStores"),Zi=kt(Symbol("withRedux"),function(r){var t,o,n;class i extends r{constructor(){super(...arguments),this[t]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[we].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[we].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[we].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[we].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[we].delete(d)}setupStores(){this.unsubscribeFromStores(),this[we].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[pe].has(c.store):this[pe].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[pe].set(c,d.subscribe(()=>this.updateFromStores())),this[pt].set(c,[]),Mt(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=g=>this[h](g);d.addEventListener(p.eventName,y),this[pt].get(c).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[pe].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[pe].has(c)&&this[pe].get(c)(),this[pe].delete(c),(d=this[pt].get(c))===null||d===void 0||d.forEach(u=>u()),this[pt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=pe,o=we,n=pt,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),ra=class extends Zi(ne){};function X(r){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+r+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ie(r){return!!r&&!!r[F]}function re(r){var t;return!!r&&(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)===rs}(r)||Array.isArray(r)||!!r[la]||!!(!((t=r.constructor)===null||t===void 0)&&t[la])||Fr(r)||Dr(r))}function Ie(r,t,o){o===void 0&&(o=!1),Ge(r)===0?(o?Object.keys:He)(r).forEach(function(n){o&&typeof n=="symbol"||t(n,r[n],r)}):r.forEach(function(n,i){return t(i,n,r)})}function Ge(r){var t=r[F];return t?t.i>3?t.i-4:t.i:Array.isArray(r)?1:Fr(r)?2:Dr(r)?3:0}function ze(r,t){return Ge(r)===2?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function qi(r,t){return Ge(r)===2?r.get(t):r[t]}function da(r,t,o){var n=Ge(r);n===2?r.set(t,o):n===3?r.add(o):r[t]=o}function ua(r,t){return r===t?r!==0||1/r==1/t:r!=r&&t!=t}function Fr(r){return es&&r instanceof Map}function Dr(r){return ts&&r instanceof Set}function fe(r){return r.o||r.t}function Ur(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var t=ha(r);delete t[F];for(var o=He(t),n=0;n<o.length;n++){var i=o[n],s=t[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:r[i]})}return Object.create(Object.getPrototypeOf(r),t)}function Br(r,t){return t===void 0&&(t=!1),Mr(r)||ie(r)||!re(r)||(Ge(r)>1&&(r.set=r.add=r.clear=r.delete=Yi),Object.freeze(r),t&&Ie(r,function(o,n){return Br(n,!0)},!0)),r}function Yi(){X(2)}function Mr(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function ae(r){var t=kr[r];return t||X(18,r),t}function Qi(r,t){kr[r]||(kr[r]=t)}function Lr(){return ht}function Ir(r,t){t&&(ae("Patches"),r.u=[],r.s=[],r.v=t)}function Wt(r){_r(r),r.p.forEach(Xi),r.p=null}function _r(r){r===ht&&(ht=r.l)}function oa(r){return ht={p:[],l:ht,h:r,m:!0,_:0}}function Xi(r){var t=r[F];t.i===0||t.i===1?t.j():t.g=!0}function Rr(r,t){t._=t.p.length;var o=t.p[0],n=r!==void 0&&r!==o;return t.h.O||ae("ES5").S(t,r,n),n?(o[F].P&&(Wt(t),X(4)),re(r)&&(r=zt(t,r),t.l||Ht(t,r)),t.u&&ae("Patches").M(o[F].t,r,t.u,t.s)):r=zt(t,o,[]),Wt(t),t.u&&t.v(t.u,t.s),r!==fa?r:void 0}function zt(r,t,o){if(Mr(t))return t;var n=t[F];if(!n)return Ie(t,function(d,u){return na(r,n,t,d,u,o)},!0),t;if(n.A!==r)return t;if(!n.P)return Ht(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ur(n.k):n.o,s=i,c=!1;n.i===3&&(s=new Set(i),i.clear(),c=!0),Ie(s,function(d,u){return na(r,n,i,d,u,o,c)}),Ht(r,i,!1),o&&r.u&&ae("Patches").N(n,o,r.u,r.s)}return n.o}function na(r,t,o,n,i,s,c){if(ie(i)){var d=zt(r,i,s&&t&&t.i!==3&&!ze(t.R,n)?s.concat(n):void 0);if(da(o,n,d),!ie(d))return;r.m=!1}else c&&o.add(i);if(re(i)&&!Mr(i)){if(!r.h.D&&r._<1)return;zt(r,i),t&&t.A.l||Ht(r,i)}}function Ht(r,t,o){o===void 0&&(o=!1),!r.l&&r.h.D&&r.m&&Br(t,o)}function Nr(r,t){var o=r[F];return(o?fe(o):r)[t]}function aa(r,t){if(t in r)for(var o=Object.getPrototypeOf(r);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function he(r){r.P||(r.P=!0,r.l&&he(r.l))}function Tr(r){r.o||(r.o=Ur(r.t))}function Pr(r,t,o){var n=Fr(t)?ae("MapSet").F(t,o):Dr(t)?ae("MapSet").T(t,o):r.O?function(i,s){var c=Array.isArray(i),d={i:c?1:0,A:s?s.A:Lr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=d,p=yt;c&&(u=[d],p=ft);var h=Proxy.revocable(u,p),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(t,o):ae("ES5").J(t,o);return(o?o.A:Lr()).p.push(n),n}function Ji(r){return ie(r)||X(22,r),function t(o){if(!re(o))return o;var n,i=o[F],s=Ge(o);if(i){if(!i.P&&(i.i<4||!ae("ES5").K(i)))return i.t;i.I=!0,n=ia(o,s),i.I=!1}else n=ia(o,s);return Ie(n,function(c,d){i&&qi(i.t,c)===d||da(n,c,t(d))}),s===3?new Set(n):n}(r)}function ia(r,t){switch(t){case 2:return new Map(r);case 3:return Array.from(r)}return Ur(r)}function pa(){function r(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[F];return yt.get(p,c)},set:function(p){var h=this[F];yt.set(h,c,p)}},u}function t(c){for(var d=c.length-1;d>=0;d--){var u=c[d][F];if(!u.P)switch(u.i){case 5:n(u)&&he(u);break;case 4:o(u)&&he(u)}}}function o(c){for(var d=c.t,u=c.k,p=He(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==F){var g=d[y];if(g===void 0&&!ze(d,y))return!0;var v=u[y],b=v&&v[F];if(b?b.t!==g:!ua(v,g))return!0}}var S=!!d[F];return p.length!==He(d).length+(S?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function i(c){c.g&&X(3,JSON.stringify(fe(c)))}var s={};Qi("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(y,g){if(y){for(var v=Array(g.length),b=0;b<g.length;b++)Object.defineProperty(v,""+b,r(b,!0));return v}var S=ha(g);delete S[F];for(var w=He(S),I=0;I<w.length;I++){var R=w[I];S[R]=r(R,y||!!S[R].enumerable)}return Object.create(Object.getPrototypeOf(g),S)}(u,c),h={i:u?5:4,A:d?d.A:Lr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,F,{value:h,writable:!0}),p},S:function(c,d,u){u?ie(d)&&d[F].A===c&&t(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var y=h[F];if(y){var g=y.t,v=y.k,b=y.R,S=y.i;if(S===4)Ie(v,function(T){T!==F&&(g[T]!==void 0||ze(g,T)?b[T]||p(v[T]):(b[T]=!0,he(y)))}),Ie(g,function(T){v[T]!==void 0||ze(v,T)||(b[T]=!1,he(y))});else if(S===5){if(n(y)&&(he(y),b.length=!0),v.length<g.length)for(var w=v.length;w<g.length;w++)b[w]=!1;else for(var I=g.length;I<v.length;I++)b[I]=!0;for(var R=Math.min(v.length,g.length),_=0;_<R;_++)v.hasOwnProperty(_)||(b[_]=!0),b[_]===void 0&&p(v[_])}}}}(c.p[0]),t(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var sa,ht,Wr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",es=typeof Map<"u",ts=typeof Set<"u",ca=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",fa=Wr?Symbol.for("immer-nothing"):((sa={})["immer-nothing"]=!0,sa),la=Wr?Symbol.for("immer-draftable"):"__$immer_draftable",F=Wr?Symbol.for("immer-state"):"__$immer_state";var rs=""+Object.prototype.constructor,He=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,ha=Object.getOwnPropertyDescriptors||function(r){var t={};return He(r).forEach(function(o){t[o]=Object.getOwnPropertyDescriptor(r,o)}),t},kr={},yt={get:function(r,t){if(t===F)return r;var o=fe(r);if(!ze(o,t))return function(i,s,c){var d,u=aa(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(i.k):void 0}(r,o,t);var n=o[t];return r.I||!re(n)?n:n===Nr(r.t,t)?(Tr(r),r.o[t]=Pr(r.A.h,n,r)):n},has:function(r,t){return t in fe(r)},ownKeys:function(r){return Reflect.ownKeys(fe(r))},set:function(r,t,o){var n=aa(fe(r),t);if(n?.set)return n.set.call(r.k,o),!0;if(!r.P){var i=Nr(fe(r),t),s=i?.[F];if(s&&s.t===o)return r.o[t]=o,r.R[t]=!1,!0;if(ua(o,i)&&(o!==void 0||ze(r.t,t)))return!0;Tr(r),he(r)}return r.o[t]===o&&(o!==void 0||t in r.o)||Number.isNaN(o)&&Number.isNaN(r.o[t])||(r.o[t]=o,r.R[t]=!0),!0},deleteProperty:function(r,t){return Nr(r.t,t)!==void 0||t in r.t?(r.R[t]=!1,Tr(r),he(r)):delete r.R[t],r.o&&delete r.o[t],!0},getOwnPropertyDescriptor:function(r,t){var o=fe(r),n=Reflect.getOwnPropertyDescriptor(o,t);return n&&{writable:!0,configurable:r.i!==1||t!=="length",enumerable:n.enumerable,value:o[t]}},defineProperty:function(){X(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){X(12)}},ft={};Ie(yt,function(r,t){ft[r]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ft.deleteProperty=function(r,t){return ft.set.call(this,r,t,void 0)},ft.set=function(r,t,o){return yt.set.call(this,r[0],t,o,r[0])};var os=function(){function r(o){var n=this;this.O=ca,this.D=!0,this.produce=function(i,s,c){if(typeof i=="function"&&typeof s!="function"){var d=s;s=i;var u=n;return function(S){var w=this;S===void 0&&(S=d);for(var I=arguments.length,R=Array(I>1?I-1:0),_=1;_<I;_++)R[_-1]=arguments[_];return u.produce(S,function(T){var W;return(W=s).call.apply(W,[w,T].concat(R))})}}var p;if(typeof s!="function"&&X(6),c!==void 0&&typeof c!="function"&&X(7),re(i)){var h=oa(n),y=Pr(n,i,void 0),g=!0;try{p=s(y),g=!1}finally{g?Wt(h):_r(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(S){return Ir(h,c),Rr(S,h)},function(S){throw Wt(h),S}):(Ir(h,c),Rr(p,h))}if(!i||typeof i!="object"){if((p=s(i))===void 0&&(p=i),p===fa&&(p=void 0),n.D&&Br(p,!0),c){var v=[],b=[];ae("Patches").M(i,p,v,b),c(v,b)}return p}X(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(p,function(v){return i.apply(void 0,[v].concat(y))})};var c,d,u=n.produce(i,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var t=r.prototype;return t.createDraft=function(o){re(o)||X(8),ie(o)&&(o=Ji(o));var n=oa(this),i=Pr(this,o,void 0);return i[F].C=!0,_r(n),i},t.finishDraft=function(o,n){var i=o&&o[F],s=i.A;return Ir(s,n),Rr(void 0,s)},t.setAutoFreeze=function(o){this.D=o},t.setUseProxies=function(o){o&&!ca&&X(20),this.O=o},t.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}i>-1&&(n=n.slice(i+1));var c=ae("Patches").$;return ie(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},r}(),V=new os,ns=V.produce,Ql=V.produceWithPatches.bind(V),Xl=V.setAutoFreeze.bind(V),Jl=V.setUseProxies.bind(V),ed=V.applyPatches.bind(V),td=V.createDraft.bind(V),rd=V.finishDraft.bind(V),Gt=ns;function Re(r){"@babel/helpers - typeof";return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(r)}function ya(r,t){if(Re(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var n=o.call(r,t||"default");if(Re(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function ga(r){var t=ya(r,"string");return Re(t)=="symbol"?t:t+""}function ma(r,t,o){return(t=ga(t))in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}function ba(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),o.push.apply(o,n)}return o}function zr(r){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ba(Object(o),!0).forEach(function(n){ma(r,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ba(Object(o)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(o,n))})}return r}function G(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var xa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Hr=function(){return Math.random().toString(36).substring(7).split("").join(".")},jt={INIT:"@@redux/INIT"+Hr(),REPLACE:"@@redux/REPLACE"+Hr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Hr()}};function as(r){if(typeof r!="object"||r===null)return!1;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function Gr(r,t,o){var n;if(typeof t=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(G(0));if(typeof t=="function"&&typeof o>"u"&&(o=t,t=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(G(1));return o(Gr)(r,t)}if(typeof r!="function")throw new Error(G(2));var i=r,s=t,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(G(3));return s}function y(S){if(typeof S!="function")throw new Error(G(4));if(u)throw new Error(G(5));var w=!0;return p(),d.push(S),function(){if(w){if(u)throw new Error(G(6));w=!1,p();var R=d.indexOf(S);d.splice(R,1),c=null}}}function g(S){if(!as(S))throw new Error(G(7));if(typeof S.type>"u")throw new Error(G(8));if(u)throw new Error(G(9));try{u=!0,s=i(s,S)}finally{u=!1}for(var w=c=d,I=0;I<w.length;I++){var R=w[I];R()}return S}function v(S){if(typeof S!="function")throw new Error(G(10));i=S,g({type:jt.REPLACE})}function b(){var S,w=y;return S={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(G(11));function _(){R.next&&R.next(h())}_();var T=w(_);return{unsubscribe:T}}},S[xa]=function(){return this},S}return g({type:jt.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:v},n[xa]=b,n}function is(r){Object.keys(r).forEach(function(t){var o=r[t],n=o(void 0,{type:jt.INIT});if(typeof n>"u")throw new Error(G(12));if(typeof o(void 0,{type:jt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(G(13))})}function va(r){for(var t=Object.keys(r),o={},n=0;n<t.length;n++){var i=t[n];typeof r[i]=="function"&&(o[i]=r[i])}var s=Object.keys(o),c,d;try{is(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var g=!1,v={},b=0;b<s.length;b++){var S=s[b],w=o[S],I=p[S],R=w(I,h);if(typeof R>"u"){var _=h&&h.type;throw new Error(G(14))}v[S]=R,g=g||R!==I}return g=g||s.length!==Object.keys(p).length,g?v:p}}function je(){for(var r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Sa(){for(var r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(G(15))},c={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=t.map(function(u){return u(c)});return s=je.apply(void 0,d)(i.dispatch),zr(zr({},i),{},{dispatch:s})}}}function Ca(r){var t=function(n){var i=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(i,s,r):c(d)}}};return t}var Oa=Ca();Oa.withExtraArgument=Ca;var jr=Oa;var Ra=function(){var r=function(t,o){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");r(t,o);function n(){this.constructor=t}t.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),ss=function(r,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(s=p[0]&2?i.return:p[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,p[1])).done)return s;switch(i=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,i=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=t.call(r,o)}catch(h){p=[6,h],i=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},$e=function(r,t){for(var o=0,n=t.length,i=r.length;o<n;o++,i++)r[i]=t[o];return r},cs=Object.defineProperty,ls=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,Ea=Object.getOwnPropertySymbols,us=Object.prototype.hasOwnProperty,ps=Object.prototype.propertyIsEnumerable,Aa=function(r,t,o){return t in r?cs(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o},ye=function(r,t){for(var o in t||(t={}))us.call(t,o)&&Aa(r,o,t[o]);if(Ea)for(var n=0,i=Ea(t);n<i.length;n++){var o=i[n];ps.call(t,o)&&Aa(r,o,t[o])}return r},$r=function(r,t){return ls(r,ds(t))},fs=function(r,t,o){return new Promise(function(n,i){var s=function(u){try{d(o.next(u))}catch(p){i(p)}},c=function(u){try{d(o.throw(u))}catch(p){i(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((o=o.apply(r,t)).next())})};var hs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?je:je.apply(null,arguments)},vd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function ys(r){if(typeof r!="object"||r===null)return!1;var t=Object.getPrototypeOf(r);if(t===null)return!0;for(var o=t;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return t===o}var gs=function(r){Ra(t,r);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=r.apply(this,o)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return r.prototype.concat.apply(this,o)},t.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(t.bind.apply(t,$e([void 0],o[0].concat(this)))):new(t.bind.apply(t,$e([void 0],o.concat(this))))},t}(Array),ms=function(r){Ra(t,r);function t(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=r.apply(this,o)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return r.prototype.concat.apply(this,o)},t.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(t.bind.apply(t,$e([void 0],o[0].concat(this)))):new(t.bind.apply(t,$e([void 0],o.concat(this))))},t}(Array);function Zr(r){return re(r)?Gt(r,function(){}):r}function bs(r){return typeof r=="boolean"}function xs(){return function(t){return vs(t)}}function vs(r){r===void 0&&(r={});var t=r.thunk,o=t===void 0?!0:t,n=r.immutableCheck,i=n===void 0?!0:n,s=r.serializableCheck,c=s===void 0?!0:s,d=new gs;if(o&&(bs(o)?d.push(jr):d.push(jr.withExtraArgument(o.extraArgument))),0){if(i)var u;if(c)var p}return d}var Kr=!0;function Na(r){var t=xs(),o=r||{},n=o.reducer,i=n===void 0?void 0:n,s=o.middleware,c=s===void 0?t():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,g=y===void 0?void 0:y,v;if(typeof i=="function")v=i;else if(ys(i))v=va(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 b=c;if(typeof b=="function"&&(b=b(t),!Kr&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Kr&&b.some(function(T){return typeof T!="function"}))throw new Error("each middleware provided to configureStore must be a function");var S=Sa.apply(void 0,b),w=je;u&&(w=hs(ye({trace:!Kr},typeof u=="object"&&u)));var I=new ms(S),R=I;Array.isArray(g)?R=$e([S],g):typeof g=="function"&&(R=g(I));var _=w.apply(void 0,R);return Gr(v,h,_)}function ge(r,t){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var s=t.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ye(ye({type:r,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:r,payload:n[0]}}return o.toString=function(){return""+r},o.type=r,o.match=function(n){return n.type===r},o}function Ta(r){var t={},o=[],n,i={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[d]=c,i},addMatcher:function(s,c){return o.push({matcher:s,reducer:c}),i},addDefaultCase:function(s){return n=s,i}};return r(i),[t,o,n]}function Ss(r){return typeof r=="function"}function Cs(r,t,o,n){o===void 0&&(o=[]);var i=typeof t=="function"?Ta(t):[t,o,n],s=i[0],c=i[1],d=i[2],u;if(Ss(r))u=function(){return Zr(r())};else{var p=Zr(r);u=function(){return p}}function h(y,g){y===void 0&&(y=u());var v=$e([s[g.type]],c.filter(function(b){var S=b.matcher;return S(g)}).map(function(b){var S=b.reducer;return S}));return v.filter(function(b){return!!b}).length===0&&(v=[d]),v.reduce(function(b,S){if(S)if(ie(b)){var w=b,I=S(w,g);return I===void 0?b:I}else{if(re(b))return Gt(b,function(R){return S(R,g)});var I=S(b,g);if(I===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return b},y)}return h.getInitialState=u,h}function Os(r,t){return r+"/"+t}function La(r){var t=r.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof r.initialState=="function"?r.initialState:Zr(r.initialState),n=r.reducers||{},i=Object.keys(n),s={},c={},d={};i.forEach(function(h){var y=n[h],g=Os(t,h),v,b;"reducer"in y?(v=y.reducer,b=y.prepare):v=y,s[h]=v,c[g]=v,d[h]=b?ge(g,b):ge(g)});function u(){var h=typeof r.extraReducers=="function"?Ta(r.extraReducers):[r.extraReducers],y=h[0],g=y===void 0?{}:y,v=h[1],b=v===void 0?[]:v,S=h[2],w=S===void 0?void 0:S,I=ye(ye({},g),c);return Cs(o,function(R){for(var _ in I)R.addCase(_,I[_]);for(var T=0,W=b;T<W.length;T++){var ee=W[T];R.addMatcher(ee.matcher,ee.reducer)}w&&R.addDefaultCase(w)})}var p;return{name:t,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Es="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",As=function(r){r===void 0&&(r=21);for(var t="",o=r;o--;)t+=Es[Math.random()*64|0];return t},ws=["name","message","stack","code"],Vr=function(){function r(t,o){this.payload=t,this.meta=o}return r}(),wa=function(){function r(t,o){this.payload=t,this.meta=o}return r}(),Is=function(r){if(typeof r=="object"&&r!==null){for(var t={},o=0,n=ws;o<n.length;o++){var i=n[o];typeof r[i]=="string"&&(t[i]=r[i])}return t}return{message:String(r)}},Ed=function(){function r(t,o,n){var i=ge(t+"/fulfilled",function(h,y,g,v){return{payload:h,meta:$r(ye({},v||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=ge(t+"/pending",function(h,y,g){return{payload:void 0,meta:$r(ye({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),c=ge(t+"/rejected",function(h,y,g,v,b){return{payload:v,error:(n&&n.serializeError||Is)(h||"Rejected"),meta:$r(ye({},b||{}),{arg:g,requestId:y,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,g,v){var b=n?.idGenerator?n.idGenerator(h):As(),S=new u,w,I=!1;function R(T){w=T,S.abort()}var _=function(){return fs(this,null,function(){var T,W,ee,xe,j,ve,Fe;return ss(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),xe=(T=n?.condition)==null?void 0:T.call(n,h,{getState:g,extra:v}),Ns(xe)?[4,xe]:[3,2];case 1:xe=f.sent(),f.label=2;case 2:if(xe===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,j=new Promise(function(m,A){return S.signal.addEventListener("abort",function(){return A({name:"AbortError",message:w||"Aborted"})})}),y(s(b,h,(W=n?.getPendingMeta)==null?void 0:W.call(n,{requestId:b,arg:h},{getState:g,extra:v}))),[4,Promise.race([j,Promise.resolve(o(h,{dispatch:y,getState:g,extra:v,requestId:b,signal:S.signal,abort:R,rejectWithValue:function(m,A){return new Vr(m,A)},fulfillWithValue:function(m,A){return new wa(m,A)}})).then(function(m){if(m instanceof Vr)throw m;return m instanceof wa?i(m.payload,b,h,m.meta):i(m,b,h)})])];case 3:return ee=f.sent(),[3,5];case 4:return ve=f.sent(),ee=ve instanceof Vr?c(null,b,h,ve.payload,ve.meta):c(ve,b,h),[3,5];case 5:return Fe=n&&!n.dispatchConditionRejection&&c.match(ee)&&ee.meta.condition,Fe||y(ee),[2,ee]}})})}();return Object.assign(_,{abort:R,requestId:b,arg:h,unwrap:function(){return _.then(Rs)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:i,typePrefix:t})}return r.withTypes=function(){return r},r}();function Rs(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function Ns(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var _a="listener",Pa="completed",ka="cancelled",Ad="task-"+ka,wd="task-"+Pa,Id=_a+"-"+ka,Rd=_a+"-"+Pa;var qr="listenerMiddleware";var Nd=ge(qr+"/add"),Td=ge(qr+"/removeAll"),Ld=ge(qr+"/remove");var Ia,_d=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(Ia||(Ia=Promise.resolve())).then(r).catch(function(t){return setTimeout(function(){throw t},0)})},Ts=function(r){return function(t){setTimeout(t,r)}},Pd=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ts(10);pa();var Ls=kt(Symbol("withEventBus"),function(r,t){return class extends r{constructor(){super(...arguments),this.eventBus=t??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)}}}),$t=class extends Ls(Object){};window.ftReduxStores||(window.ftReduxStores={});var Fa=class r extends $t{static get(t){var o;let n=typeof t=="string"?t:t.name,i=typeof t=="string"?void 0:t,s=window.ftReduxStores[n];if(Mt(s))return s;if(i==null)return;let c=La({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),d=Na({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:c.reducer(u,p)});return window.ftReduxStores[i.name]=new r(c,d,i.eventBus)}constructor(t,o,n){super(),this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Ft;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let y=p(...h.map(i));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:i(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Kt=class{static format(t,o,n,i){return window.moment?window.moment(t).locale(o).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(t,o,n,i)}static getMomentDateFormat(t,o){return t?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(t,o,n,i){let s=typeof t=="string"?new Date(t):t,c=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!i)return c;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${c} ${d}`}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${t(Math.abs(o)/60)}:${t(Math.abs(o)%60)}`}};var Da=E(P()),Vt=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ou=(0,Da.applyMixinOnce)(Symbol("withDateFormat"),function(r){class t extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(C)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(d=>d.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?d=>Kt.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Vt([(0,Yr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Vt([(0,Yr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Vt([wr({store:C.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],t.prototype,"metadataDescriptors",void 0),Vt([wr({store:C.name})],t.prototype,"uiLocale",void 0),t});var Yt=E(P());var Zt=class extends ${constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=C.getState().session;return!!t?.sessionAuthenticated}};var qt=class extends ${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 t=C.getState().session;return!!t?.sessionAuthenticated}};var _s="ft-user-assets",Ps={setAssetCount:(r,t)=>{let{userAssetType:o,count:n}=t.payload.assetCount;r.assetCounts.allAsset[o]=n},clearAssetCount:r=>{Object.values(Q).forEach(t=>{r.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(r,t)=>{let o=t.payload.mapId;r.assetCounts.bookmarkByMap[o]=t.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,t)=>{let{assetType:o,mapId:n,asset:i}=t.payload;Xr(r,o,[...Qr(r,o),i]),Ua(r,o,1,n),Ba(r,i)},editAsset:(r,t)=>{let{assetType:o,asset:n}=t.payload;Xr(r,o,Qr(r,o).map(i=>i.id===n.id?n:i)),Ba(r,n)},removeAsset:(r,t)=>{let{assetType:o,mapId:n,assetId:i}=t.payload;Xr(r,o,Qr(r,o).filter(s=>s.id!==i)),Ua(r,o,-1,n)}},Ma={[Q.SEARCHES]:"savedSearches",[Q.BOOKMARKS]:"bookmarks",[Q.BOOKS]:void 0,[Q.COLLECTIONS]:void 0},Qr=(r,t)=>{var o;let n=Ma[t];return n?(o=r[n])!==null&&o!==void 0?o:[]:[]},Xr=(r,t,o)=>{let n=Ma[t];n&&(r[n]=o)},Ua=(r,t,o,n)=>{let i=r.assetCounts.allAsset[t];if(i!==void 0&&(r.assetCounts.allAsset[t]=Math.max(0,i+o),t===Q.BOOKMARKS&&n)){let s=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,s+o)}},Ba=(r,t)=>{let o=r.assetLabels.map(i=>i.title),n=t.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));r.assetLabels.push(...n)},Z=Yt.FtReduxStore.get({name:_s,reducers:Ps,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Q).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Jr=class{constructor(t=new Zt,o=new qt){this.assetCountsService=t,this.assetLabelsService=o,this.currentSession=C.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new wt,this.savedSearchesService=new Lt,C.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:o}=C.getState();(0,Yt.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Z.actions.clearAssetCount(),Z.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Z.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Z.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();Z.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();Z.actions.assetLabels(t)}async loadAssetCount(t){let o=await this.assetCountsService.getUserAssetCount(t);o&&Z.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(t){let o=await this.assetCountsService.getUserBookmarkCountByMap(t);o&&Z.actions.setBookmarkCountByMap({count:o.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let o=Object.keys(Z.getState().assetCounts.bookmarkByMap).length!==0;t===Q.BOOKMARKS&&o&&Z.actions.clearBookmarkCountByMap(),Z.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let o=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Z.actions.bookmarks(o)}}},ks=new Jr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ks);(0,Wa.customElement)("ft-app-context")(k);var Ga=E(K());var eo=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,i]=t.split(".");return{context:n,key:i,custom:!0,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},za=new eo;var Fs=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},Ds=Symbol("i18nAttributes"),Us=Symbol("i18nListAttributes"),ja=Symbol("i18nProperties"),Qt=Symbol("i18nContexts"),gt=Symbol("i18nUnsubs"),Jt=(0,Ke.applyMixinOnce)(Symbol("withI18n"),function(r){var t,o;class n extends r{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Rt:Ue}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let g=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...g)}return u}async awaitI18n(s){let{context:c,custom:d}=s;return c&&await this.getI18nService(d).prepareContext(c),this.i18n(s)}customI18n(s,c){if(za.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(c=this[Ds])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[Us])===null||d===void 0||d.forEach((h,y)=>{var g;return u[y]=(g=u[y])===null||g===void 0?void 0:g.map(v=>p(h,y,v))})}updateI18nProperties(s){var c;(c=this[ja])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[Qt].set(u,{isCustomContext:d}),this[gt].has(u)||this[gt].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[Qt].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Qt].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[gt].forEach(s=>s()),this[gt].clear()}}return t=Qt,o=gt,Fs([(0,Ga.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Ha=class extends Jt(Ke.FtLitElement){},Xt=class extends Jt(Ke.FtLitElementRedux){};var mt=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},oe=class extends Xt{constructor(){super(),this.editorMode=!1,this.addStore(C)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":er.nothing:er.html`
|
|
11
11
|
<span class="ft-i18n">
|
|
12
12
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
13
13
|
</span>
|
|
@@ -90,7 +90,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
90
90
|
`;var Gc=P`
|
|
91
91
|
`;var Op="ft-app-info",pt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};pt.eventName="authentication-change";var Cp={session:(t,e)=>{oe(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>T.dispatchEvent(new pt(e.payload)),0))}},T=Ve.get({name:Op,reducers:Cp,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 ft=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=T.getState(),a=e??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let a=T.subscribe(()=>{n=t.get(e),n&&(a(),o(n))})}})}};var $o=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ft.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ft.await()}};var re=class extends $o{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new be,this.cache=e?a.commonCache:new be}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Wo=class extends re{async listMyBookmarks(){let e=T.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){T.commands.add(e,o)}consumeCommand(e){return T.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ti;var Vc,Ht=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},wp=Symbol("clearAfterUnitTest"),Ho=class extends Vr(re){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Vc]=()=>{this.defaultMessages={},this.cache=new be,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=T.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};oe(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new Sr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(a){!(a instanceof Fe)&&o&&console.error(a)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ht({loadedContexts:e})),this.dispatchEvent(new Ht({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new Ht({loadedContexts:[e]})),this.dispatchEvent(new Ht({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Gr(0).then(()=>n()).catch(()=>null)))}};Vc=wp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ho{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ho{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var zt=window.FluidTopicsI18nService,zo=window.FluidTopicsCustomI18nService;var ri=class{highlightHtml(e,o,n){la(e,o,n)}};window.FluidTopicsHighlightHtmlService=new ri;var jo=class extends re{async listMySearches(){let{session:e}=T.getState();return Pc(e,K.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var oi=class{isDate(e){var o,n,a,i;return(i=(a=((n=(o=T.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,o){var n,a,i;return lt.format(e,(n=o?.locale)!==null&&n!==void 0?n:T.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new oi;var Ir=class{static get(e,o){var n,a;let i=T.getState(),{lang:s,region:l}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new $t(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,o??`${s}-${l}`)}};var ni=class{urlToSearchRequest(e){return Ir.get().parse(e)}searchRequestToUrl(e){return Ir.get().serialize(e)}};window.FluidTopicsUrlService=new ni;var ht=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ht.eventName="change";var ai=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))}},Kc=new ai;var Go=class t extends Re{static build(){return new t(window.history,Kc,()=>window.location,!1)}constructor(e,o,n,a){var i,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),oe(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ht(this.currentItem())),0)}installProxies(){let e=o=>(n,a,[i,s,l])=>{let d=o(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[p,s,l]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(ht.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ht.eventName,e)}currentItem(){return dr(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 dr(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 dr(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=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 Zc=T;function qc(t,e){var o;return Zc.getState().authenticationRequired&&!(!((o=Zc.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(e):t()}var Z=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},z=class extends V{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=()=>ft.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new be,this.cleanSessionDebouncer=new Me,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return X`
|
|
92
92
|
<slot></slot>
|
|
93
|
-
`}connectedCallback(){super.connectedCallback(),T.addEventListener(pt.eventName,this.reloadConfiguration)}disconnectedCallback(){T.addEventListener(pt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(T.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&T.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&T.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&T.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&T.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&T.actions.noCustom(this.noCustom),e.has("editorMode")&&T.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&T.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&T.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>zt.addContext(p)),e.has("openExternalDocumentInNewTab")&&T.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&T.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&T.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(T.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),T.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),T.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&T.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&T.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",()=>qc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=Gc;Z([R()],z.prototype,"baseUrl",void 0);Z([R()],z.prototype,"apiIntegrationIdentifier",void 0);Z([R()],z.prototype,"apiIntegrationAppVersion",void 0);Z([R()],z.prototype,"uiLocale",void 0);Z([ve(null)],z.prototype,"availableUiLocales",void 0);Z([ve(null)],z.prototype,"metadataConfiguration",void 0);Z([R({type:Boolean})],z.prototype,"editorMode",void 0);Z([R({type:Boolean})],z.prototype,"noCustom",void 0);Z([R({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);Z([R({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);Z([R({type:Boolean})],z.prototype,"withManualResources",void 0);Z([R({type:Boolean})],z.prototype,"navigatorOnline",void 0);Z([R({type:Boolean})],z.prototype,"forcedOffline",void 0);Z([R({type:Object})],z.prototype,"apiProvider",void 0);Z([R({type:Boolean})],z.prototype,"authenticationRequired",void 0);Z([ve([])],z.prototype,"messageContexts",void 0);Z([ve(void 0)],z.prototype,"session",void 0);Z([Y()],z.prototype,"localesConfiguration",void 0);Z([Y()],z.prototype,"availableContentLocales",void 0);var Vo=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},TS=G(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(T)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>lt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Vo([R({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Vo([R({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Vo([_t({store:T.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),Vo([_t({store:T.name})],e.prototype,"uiLocale",void 0),e});var Ko=class extends re{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=T.getState().session;return!!e?.sessionAuthenticated}};var Zo=class extends re{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=T.getState().session;return!!e?.sessionAuthenticated}};var Ep="ft-user-assets",Ap={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(le).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:a}=e.payload;si(t,o,[...ii(t,o),a]),Yc(t,o,1,n),Jc(t,a)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;si(t,o,ii(t,o).map(a=>a.id===n.id?n:a)),Jc(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:a}=e.payload;si(t,o,ii(t,o).filter(i=>i.id!==a)),Yc(t,o,-1,n)}},Qc={[le.SEARCHES]:"savedSearches",[le.BOOKMARKS]:"bookmarks",[le.BOOKS]:void 0,[le.COLLECTIONS]:void 0},ii=(t,e)=>{var o;let n=Qc[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},si=(t,e,o)=>{let n=Qc[e];n&&(t[n]=o)},Yc=(t,e,o,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+o),e===le.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},Jc=(t,e)=>{let o=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},ie=Ve.get({name:Ep,reducers:Ap,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(le).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ci=class{constructor(e=new Ko,o=new Zo){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Wo,this.savedSearchesService=new jo,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=T.getState();oe((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(),ie.actions.clearAssetCount(),ie.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ie.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ie.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ie.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ie.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ie.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ie.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ie.getState().assetCounts.bookmarkByMap).length!==0;e===le.BOOKMARKS&&o&&ie.actions.clearBookmarkCountByMap(),ie.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;ie.actions.bookmarks(o)}}},Rp=new ci;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Rp);xe("ft-app-context")(z);var li=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,a]=e.split(".");return{context:n,key:a,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Xc=new li;var Ip=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Tp=Symbol("i18nAttributes"),Np=Symbol("i18nListAttributes"),tl=Symbol("i18nProperties"),qo=Symbol("i18nContexts"),Tr=Symbol("i18nUnsubs"),Jo=G(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(i){return i??this.useCustomMessageContexts?zo:zt}i18n(i){let{context:s,key:l,message:d}=i,{custom:p,args:h,argsProvider:f}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let y=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...y)}return d}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Xc.isI18nKey(i)){let[l,d]=i.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,d)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let d=this,p=(h,f,y)=>y?.context&&y.key&&i(h,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(s=this[Tp])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[Np])===null||l===void 0||l.forEach((h,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(b=>p(h,f,b))})}updateI18nProperties(i){var s;(s=this[tl])===null||s===void 0||s.forEach((l,d)=>{i(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let d=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[qo].set(d,{isCustomContext:l}),this[Tr].has(d)||this[Tr].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(i){return this[qo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[qo].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Tr].forEach(i=>i()),this[Tr].clear()}}return e=qo,o=Tr,Ip([R({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),el=class extends Jo(V){},Yo=class extends Jo(at){};var Nr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},ye=class extends Yo{constructor(){super(),this.editorMode=!1,this.addStore(T)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":W:X`
|
|
93
|
+
`}connectedCallback(){super.connectedCallback(),T.addEventListener(pt.eventName,this.reloadConfiguration)}disconnectedCallback(){T.addEventListener(pt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var o,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(T.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&T.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&T.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&T.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&T.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&T.actions.noCustom(this.noCustom),e.has("editorMode")&&T.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&T.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&T.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>zt.addContext(p)),e.has("openExternalDocumentInNewTab")&&T.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&T.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&T.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(T.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),T.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),T.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&T.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&T.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",()=>qc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=Gc;Z([R()],z.prototype,"baseUrl",void 0);Z([R()],z.prototype,"apiIntegrationIdentifier",void 0);Z([R()],z.prototype,"apiIntegrationAppVersion",void 0);Z([R()],z.prototype,"uiLocale",void 0);Z([ve(null)],z.prototype,"availableUiLocales",void 0);Z([ve(null)],z.prototype,"metadataConfiguration",void 0);Z([R({type:Boolean})],z.prototype,"editorMode",void 0);Z([R({type:Boolean})],z.prototype,"noCustom",void 0);Z([R({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);Z([R({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);Z([R({type:Boolean})],z.prototype,"withManualResources",void 0);Z([R({type:Boolean})],z.prototype,"navigatorOnline",void 0);Z([R({type:Boolean})],z.prototype,"forcedOffline",void 0);Z([R({type:Object})],z.prototype,"apiProvider",void 0);Z([R({type:Boolean})],z.prototype,"authenticationRequired",void 0);Z([ve([])],z.prototype,"messageContexts",void 0);Z([ve(void 0)],z.prototype,"session",void 0);Z([Y()],z.prototype,"localesConfiguration",void 0);Z([Y()],z.prototype,"availableContentLocales",void 0);var Vo=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},TS=G(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(T)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>lt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Vo([R({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Vo([R({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Vo([_t({store:T.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),Vo([_t({store:T.name})],e.prototype,"uiLocale",void 0),e});var Ko=class extends re{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=T.getState().session;return!!e?.sessionAuthenticated}};var Zo=class extends re{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=T.getState().session;return!!e?.sessionAuthenticated}};var Ep="ft-user-assets",Ap={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(le).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:a}=e.payload;si(t,o,[...ii(t,o),a]),Yc(t,o,1,n),Jc(t,a)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;si(t,o,ii(t,o).map(a=>a.id===n.id?n:a)),Jc(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:a}=e.payload;si(t,o,ii(t,o).filter(i=>i.id!==a)),Yc(t,o,-1,n)}},Qc={[le.SEARCHES]:"savedSearches",[le.BOOKMARKS]:"bookmarks",[le.BOOKS]:void 0,[le.COLLECTIONS]:void 0},ii=(t,e)=>{var o;let n=Qc[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},si=(t,e,o)=>{let n=Qc[e];n&&(t[n]=o)},Yc=(t,e,o,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+o),e===le.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+o)}},Jc=(t,e)=>{let o=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!o.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},ie=Ve.get({name:Ep,reducers:Ap,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(le).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ci=class{constructor(e=new Ko,o=new Zo){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Wo,this.savedSearchesService=new jo,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=T.getState();oe((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(),ie.actions.clearAssetCount(),ie.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ie.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ie.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ie.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ie.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&ie.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&ie.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(ie.getState().assetCounts.bookmarkByMap).length!==0;e===le.BOOKMARKS&&o&&ie.actions.clearBookmarkCountByMap(),ie.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;ie.actions.bookmarks(o)}}},Rp=new ci;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Rp);xe("ft-app-context")(z);var li=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,a]=e.split(".");return{context:n,key:a,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Xc=new li;var Ip=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Tp=Symbol("i18nAttributes"),Np=Symbol("i18nListAttributes"),tl=Symbol("i18nProperties"),qo=Symbol("i18nContexts"),Tr=Symbol("i18nUnsubs"),Jo=G(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(i){return i??this.useCustomMessageContexts?zo:zt}i18n(i){let{context:s,key:l,message:d}=i,{custom:p,args:h,argsProvider:f}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let y=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...y)}return d}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Xc.isI18nKey(i)){let[l,d]=i.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,d)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let d=this,p=(h,f,y)=>y?.context&&y.key&&i(h,f,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...h})}:y;(s=this[Tp])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[Np])===null||l===void 0||l.forEach((h,f)=>{var y;return d[f]=(y=d[f])===null||y===void 0?void 0:y.map(b=>p(h,f,b))})}updateI18nProperties(i){var s;(s=this[tl])===null||s===void 0||s.forEach((l,d)=>{i(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let d=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[qo].set(d,{isCustomContext:l}),this[Tr].has(d)||this[Tr].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(i){return this[qo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[qo].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Tr].forEach(i=>i()),this[Tr].clear()}}return e=qo,o=Tr,Ip([R({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),el=class extends Jo(V){},Yo=class extends Jo(at){};var Nr=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},ye=class extends Yo{constructor(){super(),this.editorMode=!1,this.addStore(T)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":W:X`
|
|
94
94
|
<span class="ft-i18n">
|
|
95
95
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
96
96
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-result-missing-terms",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.48",
|
|
4
4
|
"description": "A component displaying the missing terms of the query in a search results",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.3.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.3.48",
|
|
23
23
|
"lit": "3.1.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "39b6d455dce42316360287db7fb6a16e0d3eeb93"
|
|
26
26
|
}
|