@fluid-topics/ft-app-context 1.1.66 → 1.1.68
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.
- package/build/ft-app-context.d.ts +3 -1
- package/build/ft-app-context.js +18 -4
- package/build/ft-app-context.light.js +3 -3
- package/build/ft-app-context.min.js +2 -2
- package/build/ft-app-context.properties.d.ts +2 -0
- package/build/redux-stores/FtAppInfoStore.d.ts +2 -0
- package/build/redux-stores/FtAppInfoStore.js +2 -0
- package/package.json +4 -4
|
@@ -15,9 +15,11 @@ export declare class FtAppContext extends FtLitElement implements FtAppContextPr
|
|
|
15
15
|
openExternalDocumentInNewTab: boolean;
|
|
16
16
|
noCustomComponent: boolean | string;
|
|
17
17
|
withManualResources: boolean;
|
|
18
|
+
navigatorOnline: boolean;
|
|
19
|
+
forcedOffline: boolean;
|
|
20
|
+
apiProvider: () => import("@fluid-topics/public-api").FluidTopicsApi | undefined;
|
|
18
21
|
messageContexts: FtMessageContext[];
|
|
19
22
|
session?: FtSession;
|
|
20
|
-
apiProvider: () => import("@fluid-topics/public-api").FluidTopicsApi | undefined;
|
|
21
23
|
private cache;
|
|
22
24
|
render(): import("lit").TemplateResult<1>;
|
|
23
25
|
update(props: PropertyValues<FtAppContext>): void;
|
package/build/ft-app-context.js
CHANGED
|
@@ -21,8 +21,10 @@ class FtAppContext extends FtLitElement {
|
|
|
21
21
|
this.openExternalDocumentInNewTab = false;
|
|
22
22
|
this.noCustomComponent = false;
|
|
23
23
|
this.withManualResources = false;
|
|
24
|
-
this.
|
|
24
|
+
this.navigatorOnline = false;
|
|
25
|
+
this.forcedOffline = false;
|
|
25
26
|
this.apiProvider = () => FluidTopicsApiProvider.get();
|
|
27
|
+
this.messageContexts = [];
|
|
26
28
|
this.cache = new CacheRegistry();
|
|
27
29
|
this.cleanSessionDebouncer = new Debouncer();
|
|
28
30
|
}
|
|
@@ -67,6 +69,12 @@ class FtAppContext extends FtLitElement {
|
|
|
67
69
|
if (props.has("openExternalDocumentInNewTab")) {
|
|
68
70
|
ftAppInfoStore.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab);
|
|
69
71
|
}
|
|
72
|
+
if (props.has("navigatorOnline")) {
|
|
73
|
+
ftAppInfoStore.actions.navigatorOnline(this.navigatorOnline);
|
|
74
|
+
}
|
|
75
|
+
if (props.has("forcedOffline")) {
|
|
76
|
+
ftAppInfoStore.actions.forcedOffline(this.forcedOffline);
|
|
77
|
+
}
|
|
70
78
|
setTimeout(() => this.updateIfNeeded());
|
|
71
79
|
}
|
|
72
80
|
async updateIfNeeded() {
|
|
@@ -139,13 +147,19 @@ __decorate([
|
|
|
139
147
|
__decorate([
|
|
140
148
|
property({ type: Boolean })
|
|
141
149
|
], FtAppContext.prototype, "withManualResources", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
property({ type: Boolean })
|
|
152
|
+
], FtAppContext.prototype, "navigatorOnline", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ type: Boolean })
|
|
155
|
+
], FtAppContext.prototype, "forcedOffline", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: Object })
|
|
158
|
+
], FtAppContext.prototype, "apiProvider", void 0);
|
|
142
159
|
__decorate([
|
|
143
160
|
jsonProperty([])
|
|
144
161
|
], FtAppContext.prototype, "messageContexts", void 0);
|
|
145
162
|
__decorate([
|
|
146
163
|
jsonProperty(undefined)
|
|
147
164
|
], FtAppContext.prototype, "session", void 0);
|
|
148
|
-
__decorate([
|
|
149
|
-
property({ type: Object })
|
|
150
|
-
], FtAppContext.prototype, "apiProvider", void 0);
|
|
151
165
|
export { FtAppContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,s,
|
|
2
|
-
`,
|
|
1
|
+
!function(t,i,s,e){const n=s.css`
|
|
2
|
+
`,o="ft-app-info",a=i.FtReduxStore.get({name:o,reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class h{static get(t){const{baseUrl:i,apiIntegrationIdentifier:s}=a.getState(),e=null!=t?t:s;if(i&&e&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,e,!0)}static await(t){return new Promise((i=>{let s=h.get(t);if(s)i(s);else{const e=a.subscribe((()=>{s=h.get(t),s&&(e(),i(s))}))}}))}}class l{constructor(t=!0,s){var e;this.overrideApi=s;let n=this.constructor;n.commonCache=null!==(e=n.commonCache)&&void 0!==e?e:new i.CacheRegistry,this.cache=t?n.commonCache:new i.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:h.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:h.await()}clearCache(){this.cache.clearAll()}}var r;const c=Symbol("clearAfterUnitTest");class d extends l{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[r]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=a.getState().uiLocale,a.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=a.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var e;if(t=t.toLowerCase(),Object.keys(s).length>0){const n={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...s};i.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,s,...e){var n,o,a;t=t.toLowerCase(),this.fetchContext(t);const h=null!==(o=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==o?o:{};return new i.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},h).resolve(s,...e)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var s;return t=t.toLowerCase(),this.listeners[t]=null!==(s=this.listeners[t])&&void 0!==s?s:new Set,this.listeners[t].add(i),()=>{var s;return null===(s=this.listeners[t])||void 0===s?void 0:s.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}r=c,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends d{constructor(){super((async(t,i)=>(await this.awaitApi).getFluidTopicsMessageContext(t,i)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends d{constructor(){super((async(t,i)=>(await this.awaitApi).getCustomMessageContext(t,i)))}});const u=window.FluidTopicsI18nService,v=window.FluidTopicsCustomI18nService;var w=function(t,i,s,e){for(var n,o=arguments.length,a=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,h=t.length-1;h>=0;h--)(n=t[h])&&(a=(o<3?n(a):o>3?n(i,s,a):n(i,s))||a);return o>3&&a&&Object.defineProperty(i,s,a),a};class f extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>h.get(),this.messageContexts=[],this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return s.html`
|
|
3
3
|
<slot></slot>
|
|
4
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(
|
|
4
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(a.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&a.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&a.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&a.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&a.actions.noCustom(this.noCustom),t.has("editorMode")&&a.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&a.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&a.actions.session(this.session),t.has("availableUiLocales")&&a.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>u.addContext(t))),t.has("openExternalDocumentInNewTab")&&a.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&a.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&a.actions.forcedOffline(this.forcedOffline),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}f.elementDefinitions={},f.styles=n,w([e.property()],f.prototype,"baseUrl",void 0),w([e.property()],f.prototype,"apiIntegrationIdentifier",void 0),w([e.property()],f.prototype,"uiLocale",void 0),w([i.jsonProperty(null)],f.prototype,"availableUiLocales",void 0),w([i.jsonProperty(null)],f.prototype,"metadataConfiguration",void 0),w([e.property({type:Boolean})],f.prototype,"editorMode",void 0),w([e.property({type:Boolean})],f.prototype,"noCustom",void 0),w([e.property({type:Boolean})],f.prototype,"openExternalDocumentInNewTab",void 0),w([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],f.prototype,"noCustomComponent",void 0),w([e.property({type:Boolean})],f.prototype,"withManualResources",void 0),w([e.property({type:Boolean})],f.prototype,"navigatorOnline",void 0),w([e.property({type:Boolean})],f.prototype,"forcedOffline",void 0),w([e.property({type:Object})],f.prototype,"apiProvider",void 0),w([i.jsonProperty([])],f.prototype,"messageContexts",void 0),w([i.jsonProperty(void 0)],f.prototype,"session",void 0);class p extends l{async listMySearches(){let t=a.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class y extends l{async listMyBookmarks(){let t=a.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const m="ft-user-assets",b=i.FtReduxStore.get({name:m,initialState:{savedSearches:void 0,bookmarks:void 0}});const C=new class{constructor(){this.currentSession=a.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new y,this.savedSearchesService=new p,a.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:s}=a.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==s?void 0:s.profile)||(this.currentSession=s,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),b.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),b.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();b.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;b.actions.bookmarks(i)}}};i.customElement("ft-app-context")(f),t.FluidTopicsApiProvider=h,t.FtAppContext=f,t.FtAppContextCssVariables={},t.FtAppInfoStoreName=o,t.FtI18nServiceInternalClass=d,t.FtServiceWithCache=l,t.FtUserAssetsStoreName=m,t.clearAfterUnitTest=c,t.ftAppInfoStore=a,t.ftCustomI18nService=v,t.ftI18nService=u,t.ftUserAssetsStore=b,t.styles=n,t.userAssetsActions=C}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
@@ -176,6 +176,6 @@ function(t){return(o,e)=>{const{slot:r,selector:n}=t??{},i="slot"+(r?`[name=${r}
|
|
|
176
176
|
width: 0;
|
|
177
177
|
}
|
|
178
178
|
`;var $n=Object.freeze({__proto__:null,noTextSelect:jn,safariEllipsisFix:Hn,wordWrap:Dn}),Tn=Object.freeze({__proto__:null});class Gn{constructor(t,o){this.defaultLabels=t,this.labels=o}resolve(t,...o){var e,r;t=this.resolvePluralKey(t,o);let n=null!==(r=null!==(e=this.labels[t])&&void 0!==e?e:this.defaultLabels[t])&&void 0!==r?r:"";return o.forEach(((t,o)=>n=n.replace(new RegExp(`\\{${o}([^}]*)\\}`,"g"),((o,e)=>this.formatValue(t,e))))),n}resolvePluralKey(t,o){for(let e of o)if("number"==typeof e){const o=`${String(t)}[\\=${e}]`;if(o in this.labels||o in this.defaultLabels)return o}return t}formatValue(t,o){return t instanceof Date?this.formatDate(t,o):null!=t?t:""}formatDate(t,o){const e=e=>(null==o?void 0:o.includes("date"))?t.toLocaleDateString(e):(null==o?void 0:o.includes("time"))?t.toLocaleTimeString(e):t.toLocaleString(e);try{return e(document.documentElement.lang)}catch(t){return e()}}}var Vn=Object.freeze({__proto__:null,ParametrizedLabelResolver:Gn});class qn{constructor(){this.queue=[]}add(t,o=!1){o&&(this.queue=this.queue.filter((o=>o.type!==t.type))),this.queue.push(t)}consume(t){const o=this.queue.find((o=>o.type===t));return o&&(this.queue=this.queue.filter((t=>t!==o))),o}}function Yn(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Jn,Xn,Qn;const ti=Symbol("internalReduxEventsUnsubscribers"),oi=Symbol("internalStoresUnsubscribers"),ei=Symbol("internalStores");class ri extends Bn{constructor(){super(...arguments),this[Jn]=new Map,this[Xn]=new Map,this[Qn]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((o=>t.has(o)))&&this.updateFromStores()}getUnnamedStore(){if(this[ei].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ei].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[ei].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Yn(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[ei].delete(o)}setupStore(t,o){this[ei].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[ei].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[oi].has(t.store):this[oi].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[oi].set(t,o.subscribe((()=>this.updateFromStores()))),Yn(o)&&o.eventBus&&(null===(e=this.reduxConstructor.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[ti].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[oi].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[ti].forEach((t=>t())),this[ti]=[]}unsubscribeFromStore(t){this[oi].has(t)&&this[oi].get(t)(),this[oi].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function ni(t){for(var o=arguments.length,e=Array(o>1?o-1:0),r=1;r<o;r++)e[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(e.length?" "+e.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ii(t){return!!t&&!!t[$i]}function ai(t){var o;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var o=Object.getPrototypeOf(t);if(null===o)return!0;var e=Object.hasOwnProperty.call(o,"constructor")&&o.constructor;return e===Object||"function"==typeof e&&Function.toString.call(e)===Ti}(t)||Array.isArray(t)||!!t[Hi]||!!(null===(o=t.constructor)||void 0===o?void 0:o[Hi])||ui(t)||pi(t))}function ci(t,o,e){void 0===e&&(e=!1),0===li(t)?(e?Object.keys:Gi)(t).forEach((function(r){e&&"symbol"==typeof r||o(r,t[r],t)})):t.forEach((function(e,r){return o(r,e,t)}))}function li(t){var o=t[$i];return o?o.i>3?o.i-4:o.i:Array.isArray(t)?1:ui(t)?2:pi(t)?3:0}function si(t,o){return 2===li(t)?t.has(o):Object.prototype.hasOwnProperty.call(t,o)}function fi(t,o,e){var r=li(t);2===r?t.set(o,e):3===r?t.add(e):t[o]=e}function di(t,o){return t===o?0!==t||1/t==1/o:t!=t&&o!=o}function ui(t){return Ki&&t instanceof Map}function pi(t){return Mi&&t instanceof Set}function hi(t){return t.o||t.t}function yi(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var o=Vi(t);delete o[$i];for(var e=Gi(o),r=0;r<e.length;r++){var n=e[r],i=o[n];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[n]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),o)}function gi(t,o){return void 0===o&&(o=!1),mi(t)||ii(t)||!ai(t)||(li(t)>1&&(t.set=t.add=t.clear=t.delete=bi),Object.freeze(t),o&&ci(t,(function(t,o){return gi(o,!0)}),!0)),t}function bi(){ni(2)}function mi(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function vi(t){var o=qi[t];return o||ni(18,t),o}function Oi(){return Pi}function Si(t,o){o&&(vi("Patches"),t.u=[],t.s=[],t.v=o)}function xi(t){wi(t),t.p.forEach(Ni),t.p=null}function wi(t){t===Pi&&(Pi=t.l)}function Ci(t){return Pi={p:[],l:Pi,h:t,m:!0,_:0}}function Ni(t){var o=t[$i];0===o.i||1===o.i?o.j():o.g=!0}function Ei(t,o){o._=o.p.length;var e=o.p[0],r=void 0!==t&&t!==e;return o.h.O||vi("ES5").S(o,t,r),r?(e[$i].P&&(xi(o),ni(4)),ai(t)&&(t=Ri(o,t),o.l||Li(o,t)),o.u&&vi("Patches").M(e[$i].t,t,o.u,o.s)):t=Ri(o,e,[]),xi(o),o.u&&o.v(o.u,o.s),t!==Di?t:void 0}function Ri(t,o,e){if(mi(o))return o;var r=o[$i];if(!r)return ci(o,(function(n,i){return Ii(t,r,o,n,i,e)}),!0),o;if(r.A!==t)return o;if(!r.P)return Li(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var n=4===r.i||5===r.i?r.o=yi(r.k):r.o,i=n,a=!1;3===r.i&&(i=new Set(n),n.clear(),a=!0),ci(i,(function(o,i){return Ii(t,r,n,o,i,e,a)})),Li(t,n,!1),e&&t.u&&vi("Patches").N(r,e,t.u,t.s)}return r.o}function Ii(t,o,e,r,n,i,a){if(ii(n)){var c=Ri(t,n,i&&o&&3!==o.i&&!si(o.R,r)?i.concat(r):void 0);if(fi(e,r,c),!ii(c))return;t.m=!1}else a&&e.add(n);if(ai(n)&&!mi(n)){if(!t.h.D&&t._<1)return;Ri(t,n),o&&o.A.l||Li(t,n)}}function Li(t,o,e){void 0===e&&(e=!1),!t.l&&t.h.D&&t.m&&gi(o,e)}function Ui(t,o){var e=t[$i];return(e?hi(e):t)[o]}function Wi(t,o){if(o in t)for(var e=Object.getPrototypeOf(t);e;){var r=Object.getOwnPropertyDescriptor(e,o);if(r)return r;e=Object.getPrototypeOf(e)}}function ki(t){t.P||(t.P=!0,t.l&&ki(t.l))}function Bi(t){t.o||(t.o=yi(t.t))}function Fi(t,o,e){var r=ui(o)?vi("MapSet").F(o,e):pi(o)?vi("MapSet").T(o,e):t.O?function(t,o){var e=Array.isArray(t),r={i:e?1:0,A:o?o.A:Oi(),P:!1,I:!1,R:{},l:o,t,k:null,o:null,j:null,C:!1},n=r,i=Yi;e&&(n=[r],i=Ji);var a=Proxy.revocable(n,i),c=a.revoke,l=a.proxy;return r.k=l,r.j=c,l}(o,e):vi("ES5").J(o,e);return(e?e.A:Oi()).p.push(r),r}function zi(t){return ii(t)||ni(22,t),function t(o){if(!ai(o))return o;var e,r=o[$i],n=li(o);if(r){if(!r.P&&(r.i<4||!vi("ES5").K(r)))return r.t;r.I=!0,e=Ai(o,n),r.I=!1}else e=Ai(o,n);return ci(e,(function(o,n){r&&function(t,o){return 2===li(t)?t.get(o):t[o]}(r.t,o)===n||fi(e,o,t(n))})),3===n?new Set(e):e}(t)}function Ai(t,o){switch(o){case 2:return new Map(t);case 3:return Array.from(t)}return yi(t)}Jn=oi,Xn=ei,Qn=ti,ri.reduxProperties=new Map,ri.reduxReactiveProperties=new Set,ri.reduxEventListeners=new Map;var _i,Pi,Zi="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Ki="undefined"!=typeof Map,Mi="undefined"!=typeof Set,ji="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Di=Zi?Symbol.for("immer-nothing"):((_i={})["immer-nothing"]=!0,_i),Hi=Zi?Symbol.for("immer-draftable"):"__$immer_draftable",$i=Zi?Symbol.for("immer-state"):"__$immer_state",Ti=""+Object.prototype.constructor,Gi="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Vi=Object.getOwnPropertyDescriptors||function(t){var o={};return Gi(t).forEach((function(e){o[e]=Object.getOwnPropertyDescriptor(t,e)})),o},qi={},Yi={get:function(t,o){if(o===$i)return t;var e=hi(t);if(!si(e,o))return function(t,o,e){var r,n=Wi(o,e);return n?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(t.k):void 0}(t,e,o);var r=e[o];return t.I||!ai(r)?r:r===Ui(t.t,o)?(Bi(t),t.o[o]=Fi(t.A.h,r,t)):r},has:function(t,o){return o in hi(t)},ownKeys:function(t){return Reflect.ownKeys(hi(t))},set:function(t,o,e){var r=Wi(hi(t),o);if(null==r?void 0:r.set)return r.set.call(t.k,e),!0;if(!t.P){var n=Ui(hi(t),o),i=null==n?void 0:n[$i];if(i&&i.t===e)return t.o[o]=e,t.R[o]=!1,!0;if(di(e,n)&&(void 0!==e||si(t.t,o)))return!0;Bi(t),ki(t)}return t.o[o]===e&&(void 0!==e||o in t.o)||Number.isNaN(e)&&Number.isNaN(t.o[o])||(t.o[o]=e,t.R[o]=!0),!0},deleteProperty:function(t,o){return void 0!==Ui(t.t,o)||o in t.t?(t.R[o]=!1,Bi(t),ki(t)):delete t.R[o],t.o&&delete t.o[o],!0},getOwnPropertyDescriptor:function(t,o){var e=hi(t),r=Reflect.getOwnPropertyDescriptor(e,o);return r?{writable:!0,configurable:1!==t.i||"length"!==o,enumerable:r.enumerable,value:e[o]}:r},defineProperty:function(){ni(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ni(12)}},Ji={};ci(Yi,(function(t,o){Ji[t]=function(){return arguments[0]=arguments[0][0],o.apply(this,arguments)}})),Ji.deleteProperty=function(t,o){return Ji.set.call(this,t,o,void 0)},Ji.set=function(t,o,e){return Yi.set.call(this,t[0],o,e,t[0])};var Xi=function(){function t(t){var o=this;this.O=ji,this.D=!0,this.produce=function(t,e,r){if("function"==typeof t&&"function"!=typeof e){var n=e;e=t;var i=o;return function(t){var o=this;void 0===t&&(t=n);for(var r=arguments.length,a=Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];return i.produce(t,(function(t){var r;return(r=e).call.apply(r,[o,t].concat(a))}))}}var a;if("function"!=typeof e&&ni(6),void 0!==r&&"function"!=typeof r&&ni(7),ai(t)){var c=Ci(o),l=Fi(o,t,void 0),s=!0;try{a=e(l),s=!1}finally{s?xi(c):wi(c)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return Si(c,r),Ei(t,c)}),(function(t){throw xi(c),t})):(Si(c,r),Ei(a,c))}if(!t||"object"!=typeof t){if(void 0===(a=e(t))&&(a=t),a===Di&&(a=void 0),o.D&&gi(a,!0),r){var f=[],d=[];vi("Patches").M(t,a,f,d),r(f,d)}return a}ni(21,t)},this.produceWithPatches=function(t,e){if("function"==typeof t)return function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return o.produceWithPatches(e,(function(o){return t.apply(void 0,[o].concat(n))}))};var r,n,i=o.produce(t,e,(function(t,o){r=t,n=o}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return[t,r,n]})):[i,r,n]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var o=t.prototype;return o.createDraft=function(t){ai(t)||ni(8),ii(t)&&(t=zi(t));var o=Ci(this),e=Fi(this,t,void 0);return e[$i].C=!0,wi(o),e},o.finishDraft=function(t,o){var e=(t&&t[$i]).A;return Si(e,o),Ei(void 0,e)},o.setAutoFreeze=function(t){this.D=t},o.setUseProxies=function(t){t&&!ji&&ni(20),this.O=t},o.applyPatches=function(t,o){var e;for(e=o.length-1;e>=0;e--){var r=o[e];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}e>-1&&(o=o.slice(e+1));var n=vi("Patches").$;return ii(t)?n(t,o):this.produce(t,(function(t){return n(t,o)}))},t}(),Qi=new Xi,ta=Qi.produce;function oa(t){return oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(t)}function ea(t){var o=function(t,o){if("object"!==oa(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,o||"default");if("object"!==oa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(t)}(t,"string");return"symbol"===oa(o)?o:String(o)}function ra(t,o,e){return(o=ea(o))in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function na(t,o){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),e.push.apply(e,r)}return e}function ia(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?na(Object(e),!0).forEach((function(o){ra(t,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):na(Object(e)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))}))}return t}function aa(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}Qi.produceWithPatches.bind(Qi),Qi.setAutoFreeze.bind(Qi),Qi.setUseProxies.bind(Qi),Qi.applyPatches.bind(Qi),Qi.createDraft.bind(Qi),Qi.finishDraft.bind(Qi);var ca="function"==typeof Symbol&&Symbol.observable||"@@observable",la=function(){return Math.random().toString(36).substring(7).split("").join(".")},sa={INIT:"@@redux/INIT"+la(),REPLACE:"@@redux/REPLACE"+la(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+la()}};function fa(t,o,e){var r;if("function"==typeof o&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(aa(0));if("function"==typeof o&&void 0===e&&(e=o,o=void 0),void 0!==e){if("function"!=typeof e)throw new Error(aa(1));return e(fa)(t,o)}if("function"!=typeof t)throw new Error(aa(2));var n=t,i=o,a=[],c=a,l=!1;function s(){c===a&&(c=a.slice())}function f(){if(l)throw new Error(aa(3));return i}function d(t){if("function"!=typeof t)throw new Error(aa(4));if(l)throw new Error(aa(5));var o=!0;return s(),c.push(t),function(){if(o){if(l)throw new Error(aa(6));o=!1,s();var e=c.indexOf(t);c.splice(e,1),a=null}}}function u(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(t)===o}(t))throw new Error(aa(7));if(void 0===t.type)throw new Error(aa(8));if(l)throw new Error(aa(9));try{l=!0,i=n(i,t)}finally{l=!1}for(var o=a=c,e=0;e<o.length;e++){(0,o[e])()}return t}return u({type:sa.INIT}),(r={dispatch:u,subscribe:d,getState:f,replaceReducer:function(t){if("function"!=typeof t)throw new Error(aa(10));n=t,u({type:sa.REPLACE})}})[ca]=function(){var t,o=d;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(aa(11));function e(){t.next&&t.next(f())}return e(),{unsubscribe:o(e)}}})[ca]=function(){return this},t},r}function da(t){for(var o=Object.keys(t),e={},r=0;r<o.length;r++){var n=o[r];"function"==typeof t[n]&&(e[n]=t[n])}var i,a=Object.keys(e);try{!function(t){Object.keys(t).forEach((function(o){var e=t[o];if(void 0===e(void 0,{type:sa.INIT}))throw new Error(aa(12));if(void 0===e(void 0,{type:sa.PROBE_UNKNOWN_ACTION()}))throw new Error(aa(13))}))}(e)}catch(t){i=t}return function(t,o){if(void 0===t&&(t={}),i)throw i;for(var r=!1,n={},c=0;c<a.length;c++){var l=a[c],s=e[l],f=t[l],d=s(f,o);if(void 0===d)throw o&&o.type,new Error(aa(14));n[l]=d,r=r||d!==f}return(r=r||a.length!==Object.keys(t).length)?n:t}}function ua(){for(var t=arguments.length,o=new Array(t),e=0;e<t;e++)o[e]=arguments[e];return 0===o.length?function(t){return t}:1===o.length?o[0]:o.reduce((function(t,o){return function(){return t(o.apply(void 0,arguments))}}))}function pa(){for(var t=arguments.length,o=new Array(t),e=0;e<t;e++)o[e]=arguments[e];return function(t){return function(){var e=t.apply(void 0,arguments),r=function(){throw new Error(aa(15))},n={getState:e.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=o.map((function(t){return t(n)}));return r=ua.apply(void 0,i)(e.dispatch),ia(ia({},e),{},{dispatch:r})}}}function ha(t){return function(o){var e=o.dispatch,r=o.getState;return function(o){return function(n){return"function"==typeof n?n(e,r,t):o(n)}}}}var ya=ha();ya.withExtraArgument=ha;var ga,ba=ya,ma=(ga=function(t,o){return ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])},ga(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=t}ga(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),va=function(t,o){var e,r,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=o.call(t,a)}catch(t){i=[6,t],r=0}finally{e=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Oa=function(t,o){for(var e=0,r=o.length,n=t.length;e<r;e++,n++)t[n]=o[e];return t},Sa=Object.defineProperty,xa=Object.defineProperties,wa=Object.getOwnPropertyDescriptors,Ca=Object.getOwnPropertySymbols,Na=Object.prototype.hasOwnProperty,Ea=Object.prototype.propertyIsEnumerable,Ra=function(t,o,e){return o in t?Sa(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e},Ia=function(t,o){for(var e in o||(o={}))Na.call(o,e)&&Ra(t,e,o[e]);if(Ca)for(var r=0,n=Ca(o);r<n.length;r++){e=n[r];Ea.call(o,e)&&Ra(t,e,o[e])}return t},La=function(t,o){return xa(t,wa(o))},Ua="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ua:ua.apply(null,arguments)};var Wa=function(t){function o(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=t.apply(this,e)||this;return Object.setPrototypeOf(n,o.prototype),n}return ma(o,t),Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];return t.prototype.concat.apply(this,o)},o.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Array.isArray(t[0])?new(o.bind.apply(o,Oa([void 0],t[0].concat(this)))):new(o.bind.apply(o,Oa([void 0],t.concat(this))))},o}(Array),ka=function(t){function o(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=t.apply(this,e)||this;return Object.setPrototypeOf(n,o.prototype),n}return ma(o,t),Object.defineProperty(o,Symbol.species,{get:function(){return o},enumerable:!1,configurable:!0}),o.prototype.concat=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];return t.prototype.concat.apply(this,o)},o.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Array.isArray(t[0])?new(o.bind.apply(o,Oa([void 0],t[0].concat(this)))):new(o.bind.apply(o,Oa([void 0],t.concat(this))))},o}(Array);function Ba(t){return ai(t)?ta(t,(function(){})):t}function Fa(){return function(t){return function(t){void 0===t&&(t={});var o=t.thunk,e=void 0===o||o;t.immutableCheck,t.serializableCheck;var r=new Wa;e&&(!function(t){return"boolean"==typeof t}(e)?r.push(ba.withExtraArgument(e.extraArgument)):r.push(ba));return r}(t)}}function za(t){var o,e=Fa(),r=t||{},n=r.reducer,i=void 0===n?void 0:n,a=r.middleware,c=void 0===a?e():a,l=r.devTools,s=void 0===l||l,f=r.preloadedState,d=void 0===f?void 0:f,u=r.enhancers,p=void 0===u?void 0:u;if("function"==typeof i)o=i;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var o=Object.getPrototypeOf(t);if(null===o)return!0;for(var e=o;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return o===e}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');o=da(i)}var h=c;"function"==typeof h&&(h=h(e));var y=pa.apply(void 0,h),g=ua;s&&(g=Ua(Ia({trace:!1},"object"==typeof s&&s)));var b=new ka(y),m=b;return Array.isArray(p)?m=Oa([y],p):"function"==typeof p&&(m=p(b)),fa(o,d,g.apply(void 0,m))}function Aa(t,o){function e(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(o){var n=o.apply(void 0,e);if(!n)throw new Error("prepareAction did not return an object");return Ia(Ia({type:t,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:t,payload:e[0]}}return e.toString=function(){return""+t},e.type=t,e.match=function(o){return o.type===t},e}function _a(t){var o,e={},r=[],n={addCase:function(t,o){var r="string"==typeof t?t:t.type;if(r in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[r]=o,n},addMatcher:function(t,o){return r.push({matcher:t,reducer:o}),n},addDefaultCase:function(t){return o=t,n}};return t(n),[e,r,o]}function Pa(t){var o=t.name;if(!o)throw new Error("`name` is a required option for createSlice");var e,r="function"==typeof t.initialState?t.initialState:Ba(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},c={},l={};function s(){var o="function"==typeof t.extraReducers?_a(t.extraReducers):[t.extraReducers],e=o[0],n=void 0===e?{}:e,i=o[1],a=void 0===i?[]:i,l=o[2],s=void 0===l?void 0:l,f=Ia(Ia({},n),c);return function(t,o,e,r){void 0===e&&(e=[]);var n,i="function"==typeof o?_a(o):[o,e,r],a=i[0],c=i[1],l=i[2];if(function(t){return"function"==typeof t}(t))n=function(){return Ba(t())};else{var s=Ba(t);n=function(){return s}}function f(t,o){void 0===t&&(t=n());var e=Oa([a[o.type]],c.filter((function(t){return(0,t.matcher)(o)})).map((function(t){return t.reducer})));return 0===e.filter((function(t){return!!t})).length&&(e=[l]),e.reduce((function(t,e){if(e){var r;if(ii(t))return void 0===(r=e(t,o))?t:r;if(ai(t))return ta(t,(function(t){return e(t,o)}));if(void 0===(r=e(t,o))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return f.getInitialState=n,f}(r,(function(t){for(var o in f)t.addCase(o,f[o]);for(var e=0,r=a;e<r.length;e++){var n=r[e];t.addMatcher(n.matcher,n.reducer)}s&&t.addDefaultCase(s)}))}return i.forEach((function(t){var e,r,i=n[t],s=o+"/"+t;"reducer"in i?(e=i.reducer,r=i.prepare):e=i,a[t]=e,c[s]=e,l[t]=r?Aa(s,r):Aa(s)})),{name:o,reducer:function(t,o){return e||(e=s()),e(t,o)},actions:l,caseReducers:a,getInitialState:function(){return e||(e=s()),e.getInitialState()}}}var Za=["name","message","stack","code"],Ka=function(t,o){this.payload=t,this.meta=o},Ma=function(t,o){this.payload=t,this.meta=o},ja=function(t){if("object"==typeof t&&null!==t){for(var o={},e=0,r=Za;e<r.length;e++){var n=r[e];"string"==typeof t[n]&&(o[n]=t[n])}return o}return{message:String(t)}};function Da(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,o,e){var r=Aa(t+"/fulfilled",(function(t,o,e,r){return{payload:t,meta:La(Ia({},r||{}),{arg:e,requestId:o,requestStatus:"fulfilled"})}})),n=Aa(t+"/pending",(function(t,o,e){return{payload:void 0,meta:La(Ia({},e||{}),{arg:o,requestId:t,requestStatus:"pending"})}})),i=Aa(t+"/rejected",(function(t,o,r,n,i){return{payload:n,error:(e&&e.serializeError||ja)(t||"Rejected"),meta:La(Ia({},i||{}),{arg:r,requestId:o,rejectedWithValue:!!n,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(c,l,s){var f,d=(null==e?void 0:e.idGenerator)?e.idGenerator(t):function(t){void 0===t&&(t=21);for(var o="",e=t;e--;)o+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return o}(),u=new a;function p(t){f=t,u.abort()}var h=function(){return a=this,h=null,y=function(){var a,h,y,g,b,m;return va(this,(function(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),g=null==(a=null==e?void 0:e.condition)?void 0:a.call(e,t,{getState:l,extra:s}),null===(O=g)||"object"!=typeof O||"function"!=typeof O.then?[3,2]:[4,g];case 1:g=v.sent(),v.label=2;case 2:if(!1===g||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,o){return u.signal.addEventListener("abort",(function(){return o({name:"AbortError",message:f||"Aborted"})}))})),c(n(d,t,null==(h=null==e?void 0:e.getPendingMeta)?void 0:h.call(e,{requestId:d,arg:t},{getState:l,extra:s}))),[4,Promise.race([b,Promise.resolve(o(t,{dispatch:c,getState:l,extra:s,requestId:d,signal:u.signal,abort:p,rejectWithValue:function(t,o){return new Ka(t,o)},fulfillWithValue:function(t,o){return new Ma(t,o)}})).then((function(o){if(o instanceof Ka)throw o;return o instanceof Ma?r(o.payload,d,t,o.meta):r(o,d,t)}))])];case 3:return y=v.sent(),[3,5];case 4:return m=v.sent(),y=m instanceof Ka?i(null,d,t,m.payload,m.meta):i(m,d,t),[3,5];case 5:return e&&!e.dispatchConditionRejection&&i.match(y)&&y.meta.condition||c(y),[2,y]}var O}))},new Promise((function(t,o){var e=function(t){try{n(y.next(t))}catch(t){o(t)}},r=function(t){try{n(y.throw(t))}catch(t){o(t)}},n=function(o){return o.done?t(o.value):Promise.resolve(o.value).then(e,r)};n((y=y.apply(a,h)).next())}));var a,h,y}();return Object.assign(h,{abort:p,requestId:d,arg:t,unwrap:function(){return h.then(Da)}})}}),{pending:n,rejected:i,fulfilled:r,typePrefix:t})}t.withTypes=function(){return t}}();var Ha="listenerMiddleware";Aa(Ha+"/add"),Aa(Ha+"/removeAll"),Aa(Ha+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,o){var e=n[t];return e?e.enumerable=o:n[t]=e={configurable:!0,enumerable:o,get:function(){var o=this[$i];return Yi.get(o,t)},set:function(o){var e=this[$i];Yi.set(e,t,o)}},e}function o(t){for(var o=t.length-1;o>=0;o--){var n=t[o][$i];if(!n.P)switch(n.i){case 5:r(n)&&ki(n);break;case 4:e(n)&&ki(n)}}}function e(t){for(var o=t.t,e=t.k,r=Gi(e),n=r.length-1;n>=0;n--){var i=r[n];if(i!==$i){var a=o[i];if(void 0===a&&!si(o,i))return!0;var c=e[i],l=c&&c[$i];if(l?l.t!==a:!di(c,a))return!0}}var s=!!o[$i];return r.length!==Gi(o).length+(s?0:1)}function r(t){var o=t.k;if(o.length!==t.t.length)return!0;var e=Object.getOwnPropertyDescriptor(o,o.length-1);if(e&&!e.get)return!0;for(var r=0;r<o.length;r++)if(!o.hasOwnProperty(r))return!0;return!1}var n={};!function(t,o){qi[t]||(qi[t]=o)}("ES5",{J:function(o,e){var r=Array.isArray(o),n=function(o,e){if(o){for(var r=Array(e.length),n=0;n<e.length;n++)Object.defineProperty(r,""+n,t(n,!0));return r}var i=Vi(e);delete i[$i];for(var a=Gi(i),c=0;c<a.length;c++){var l=a[c];i[l]=t(l,o||!!i[l].enumerable)}return Object.create(Object.getPrototypeOf(e),i)}(r,o),i={i:r?5:4,A:e?e.A:Oi(),P:!1,I:!1,R:{},l:e,t:o,k:n,o:null,g:!1,C:!1};return Object.defineProperty(n,$i,{value:i,writable:!0}),n},S:function(t,e,n){n?ii(e)&&e[$i].A===t&&o(t.p):(t.u&&function t(o){if(o&&"object"==typeof o){var e=o[$i];if(e){var n=e.t,i=e.k,a=e.R,c=e.i;if(4===c)ci(i,(function(o){o!==$i&&(void 0!==n[o]||si(n,o)?a[o]||t(i[o]):(a[o]=!0,ki(e)))})),ci(n,(function(t){void 0!==i[t]||si(i,t)||(a[t]=!1,ki(e))}));else if(5===c){if(r(e)&&(ki(e),a.length=!0),i.length<n.length)for(var l=i.length;l<n.length;l++)a[l]=!1;else for(var s=n.length;s<i.length;s++)a[s]=!0;for(var f=Math.min(i.length,n.length),d=0;d<f;d++)i.hasOwnProperty(d)||(a[d]=!0),void 0===a[d]&&t(i[d])}}}}(t.p[0]),o(t.p))},K:function(t){return 4===t.i?e(t):r(t)}})}(),window.ftReduxStores||(window.ftReduxStores={});class $a{static get(t){var o;const e="string"==typeof t?t:t.name,r="string"==typeof t?void 0:t,n=window.ftReduxStores[e];if(Yn(n))return n;if(null==r)return;const i=Pa({...r,reducers:null!==(o=r.reducers)&&void 0!==o?o:{}}),a=za({reducer:(t,o)=>"CLEAR_FT_REDUX_STORE"===o.type?i.getInitialState():"string"==typeof o.type&&o.type.startsWith("DEFAULT_VALUE_SETTER__")?{...t,...o.overwrites}:i.reducer(t,o)});return window.ftReduxStores[r.name]=new $a(i,a)}constructor(t,o){this.reduxSlice=t,this.reduxStore=o,this.isFtReduxStore=!0,this.eventBus=document.createElement("event-bus"),this.commands=new qn,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,o,e)=>{const r=o,n=t[r];return n?(...t)=>{const o=n(...t);return this.reduxStore.dispatch(o),o}:t=>{this.setState({[r]:t})}}})}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 Ta=Object.freeze({__proto__:null,FtCommandQueue:qn,FtLitElementRedux:ri,FtReduxStore:$a,clearAllStores:function(){var t;for(let o of Object.values(null!==(t=window.ftReduxStores)&&void 0!==t?t:{}))Yn(o)&&o.clear()},isFtReduxStore:Yn,redux:t=>{const o=null!=t?t:{};return(t,e)=>{var r;const n={hasChanged:(t,o)=>!ce(t,o),attribute:!1,...o};xo(n)(t,e);const i=t.constructor;i.reduxProperties=new Map(i.reduxProperties),i.reduxProperties.set(e,{selector:null!==(r=o.selector)&&void 0!==r?r:t=>t[e],store:o.store})}},reduxEventListener:t=>(o,e)=>{const r=o.constructor;r.reduxEventListeners=new Map(r.reduxEventListeners),r.reduxEventListeners.set(e,t)},reduxReactive:()=>(t,o)=>{var e;const r=t.constructor;r.reduxReactiveProperties=new Set(r.reduxReactiveProperties),null===(e=r.reduxReactiveProperties)||void 0===e||e.add(o)}});var Ga=Object.freeze({__proto__:null,serializeRequest:function(t,o){var e,r,n,i;const a=new URLSearchParams({"content-lang":null!==(e=o.contentLocale)&&void 0!==e?e:"all"});if((null===(r=o.query)||void 0===r?void 0:r.length)>0&&a.append("query",o.query),o.scope&&"DEFAULT"!==o.scope&&a.append("scope",o.scope.toLowerCase()),o.virtualField&&a.append("virtual-field",o.virtualField.toLowerCase()),o.periodFilter){let t=o.periodFilter.period;const e=t?`_${t.from}_${t.to}`:"";a.append("period",o.periodFilter.periodType.toLowerCase()+e)}if((null===(n=o.sort)||void 0===n?void 0:n.length)>0&&"ft:lastEdition"===o.sort[0].key&&a.append("sort","last_update"),(null===(i=o.filters)||void 0===i?void 0:i.length)>0){const t=o.filters.map((t=>{const o=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${o}`})).join("*");a.append("filters",t)}return new URL(`${t.replace(/\/+$/,"")}/search?${a.toString()}`).href}});const Va=Symbol("elementInternals");var qa,Ya,Ja,Xa,Qa=Object.freeze({__proto__:null,toFtFormComponent:function(t,o){return class extends t{static get formAssociated(){return!0}get form(){return this[Va].form}constructor(...t){super(t),this[Va]=this.attachInternals(),this[Va].role=o}setFormValue(t){this[Va].setFormValue(t)}}}});const tc=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Ja=null===(Ya=null===(qa=window.safari)||void 0===qa?void 0:qa.pushNotification)||void 0===Ya?void 0:Ya.toString())&&void 0!==Ja?Ja:""),oc="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=null!==(Xa=window.ftGlobals)&&void 0!==Xa?Xa:{lit:vo,litDecorators:No,litRepeat:Po,litClassMap:Ko,litStyleMap:Ho,litUnsafeHTML:Go,wcUtils:{...Qo,...Jo,...oe,...re,...ue,...gr,...Or,...wn,...hr,...Fn,...zn,...le,...Mn,...$n,...Tn,...Vn,...Ta,...In,...Ga,...Qa,isSafari:tc,isTouchScreen:oc}};const ec=dt`
|
|
179
|
-
`,rc="ft-app-info",nc=$a.get({name:rc,reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class ic{static get(t){const{baseUrl:o,apiIntegrationIdentifier:e}=nc.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static await(t){return new Promise((o=>{let e=ic.get(t);if(e)o(e);else{const r=nc.subscribe((()=>{e=ic.get(t),e&&(r(),o(e))}))}}))}}class ac{constructor(t=!0,o){var e;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(e=r.commonCache)&&void 0!==e?e:new Xo,this.cache=t?r.commonCache:new Xo}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ic.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ic.await()}clearCache(){this.cache.clearAll()}}var cc;const lc=Symbol("clearAfterUnitTest");class sc extends ac{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[cc]=()=>{this.defaultMessages={},this.cache=new Xo,this.listeners={}},this.currentUiLocale=nc.getState().uiLocale,nc.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=nc.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var e;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...o};ce(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...e){var r,n,i;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new Gn(null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},a).resolve(o,...e)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>ne(0).then((()=>t())).catch((()=>null)))))}}cc=lc,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends sc{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends sc{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const fc=window.FluidTopicsI18nService,dc=window.FluidTopicsCustomI18nService;var uc=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,c=t.length-1;c>=0;c--)(n=t[c])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class pc extends Bn{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.
|
|
179
|
+
`,rc="ft-app-info",nc=$a.get({name:rc,reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class ic{static get(t){const{baseUrl:o,apiIntegrationIdentifier:e}=nc.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static await(t){return new Promise((o=>{let e=ic.get(t);if(e)o(e);else{const r=nc.subscribe((()=>{e=ic.get(t),e&&(r(),o(e))}))}}))}}class ac{constructor(t=!0,o){var e;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(e=r.commonCache)&&void 0!==e?e:new Xo,this.cache=t?r.commonCache:new Xo}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ic.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ic.await()}clearCache(){this.cache.clearAll()}}var cc;const lc=Symbol("clearAfterUnitTest");class sc extends ac{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[cc]=()=>{this.defaultMessages={},this.cache=new Xo,this.listeners={}},this.currentUiLocale=nc.getState().uiLocale,nc.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=nc.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var e;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...o};ce(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...e){var r,n,i;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new Gn(null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},a).resolve(o,...e)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>ne(0).then((()=>t())).catch((()=>null)))))}}cc=lc,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends sc{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends sc{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const fc=window.FluidTopicsI18nService,dc=window.FluidTopicsCustomI18nService;var uc=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,c=t.length-1;c>=0;c--)(n=t[c])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class pc extends Bn{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ic.get(),this.messageContexts=[],this.cache=new Xo,this.cleanSessionDebouncer=new ee}render(){return Yt`
|
|
180
180
|
<slot></slot>
|
|
181
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(nc.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&nc.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&nc.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&nc.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&nc.actions.noCustom(this.noCustom),t.has("editorMode")&&nc.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&nc.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&nc.actions.session(this.session),t.has("availableUiLocales")&&nc.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>fc.addContext(t))),t.has("openExternalDocumentInNewTab")&&nc.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}pc.elementDefinitions={},pc.styles=ec,uc([xo()],pc.prototype,"baseUrl",void 0),uc([xo()],pc.prototype,"apiIntegrationIdentifier",void 0),uc([xo()],pc.prototype,"uiLocale",void 0),uc([fe(null)],pc.prototype,"availableUiLocales",void 0),uc([fe(null)],pc.prototype,"metadataConfiguration",void 0),uc([xo({type:Boolean})],pc.prototype,"editorMode",void 0),uc([xo({type:Boolean})],pc.prototype,"noCustom",void 0),uc([xo({type:Boolean})],pc.prototype,"openExternalDocumentInNewTab",void 0),uc([xo({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],pc.prototype,"noCustomComponent",void 0),uc([xo({type:Boolean})],pc.prototype,"withManualResources",void 0),uc([
|
|
181
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(nc.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&nc.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&nc.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&nc.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&nc.actions.noCustom(this.noCustom),t.has("editorMode")&&nc.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&nc.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&nc.actions.session(this.session),t.has("availableUiLocales")&&nc.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>fc.addContext(t))),t.has("openExternalDocumentInNewTab")&&nc.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&nc.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&nc.actions.forcedOffline(this.forcedOffline),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}pc.elementDefinitions={},pc.styles=ec,uc([xo()],pc.prototype,"baseUrl",void 0),uc([xo()],pc.prototype,"apiIntegrationIdentifier",void 0),uc([xo()],pc.prototype,"uiLocale",void 0),uc([fe(null)],pc.prototype,"availableUiLocales",void 0),uc([fe(null)],pc.prototype,"metadataConfiguration",void 0),uc([xo({type:Boolean})],pc.prototype,"editorMode",void 0),uc([xo({type:Boolean})],pc.prototype,"noCustom",void 0),uc([xo({type:Boolean})],pc.prototype,"openExternalDocumentInNewTab",void 0),uc([xo({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],pc.prototype,"noCustomComponent",void 0),uc([xo({type:Boolean})],pc.prototype,"withManualResources",void 0),uc([xo({type:Boolean})],pc.prototype,"navigatorOnline",void 0),uc([xo({type:Boolean})],pc.prototype,"forcedOffline",void 0),uc([xo({type:Object})],pc.prototype,"apiProvider",void 0),uc([fe([])],pc.prototype,"messageContexts",void 0),uc([fe(void 0)],pc.prototype,"session",void 0);class hc extends ac{async listMySearches(){let t=nc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class yc extends ac{async listMyBookmarks(){let t=nc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const gc="ft-user-assets",bc=$a.get({name:gc,initialState:{savedSearches:void 0,bookmarks:void 0}});const mc=new class{constructor(){this.currentSession=nc.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new yc,this.savedSearchesService=new hc,nc.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=nc.getState();ce(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),bc.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),bc.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();bc.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;bc.actions.bookmarks(o)}}};se("ft-app-context")(pc),t.FluidTopicsApiProvider=ic,t.FtAppContext=pc,t.FtAppContextCssVariables={},t.FtAppInfoStoreName=rc,t.FtI18nServiceInternalClass=sc,t.FtServiceWithCache=ac,t.FtUserAssetsStoreName=gc,t.clearAfterUnitTest=lc,t.ftAppInfoStore=nc,t.ftCustomI18nService=dc,t.ftI18nService=fc,t.ftUserAssetsStore=bc,t.styles=ec,t.userAssetsActions=mc}({});
|
|
@@ -12,6 +12,8 @@ export interface FtAppInfoState {
|
|
|
12
12
|
noCustomComponent: boolean | string;
|
|
13
13
|
session: Optional<FtSession>;
|
|
14
14
|
openExternalDocumentInNewTab: boolean;
|
|
15
|
+
navigatorOnline: boolean;
|
|
16
|
+
forcedOffline: boolean;
|
|
15
17
|
}
|
|
16
18
|
declare const reducers: {};
|
|
17
19
|
export type FtAppInfoStateReducers = typeof reducers;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-app-context",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.68",
|
|
4
4
|
"description": "Global application context for Fluid Topics integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.1.68",
|
|
23
23
|
"lit": "3.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@fluid-topics/public-api": "1.0.
|
|
26
|
+
"@fluid-topics/public-api": "1.0.67"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d10171ba718cee726044d0cc44820ebbb1ab7cbc"
|
|
29
29
|
}
|