@fluid-topics/ft-viewer 2.2.40 → 2.2.41

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.
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var dh=Object.create;var gl=Object.defineProperty;var uh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var fh=Object.getPrototypeOf,hh=Object.prototype.hasOwnProperty;var sr=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var mh=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ph(e))!hh.call(t,n)&&n!==i&&gl(t,n,{get:()=>e[n],enumerable:!(r=uh(e,n))||r.enumerable});return t};var c=(t,e,i)=>(i=t!=null?dh(fh(t)):{},mh(e||!t||!t.__esModule?gl(i,"default",{value:t,enumerable:!0}):i,t));var h=sr((lg,yl)=>{yl.exports=ftGlobals.wcUtils});var $=sr((cg,vl)=>{vl.exports=ftGlobals.litDecorators});var S=sr((Pg,wl)=>{wl.exports=ftGlobals.lit});var br=sr((bb,Rd)=>{Rd.exports=ftGlobals.litRepeat});var Va=sr((Qb,cu)=>{cu.exports=ftGlobals.litUnsafeHTML});var ut=sr((pE,Nu)=>{Nu.exports=ftGlobals.litClassMap});var ah=c(h());var bl=c(h()),Sl=c($());var Xt=class extends Event{constructor(e,i,r,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i,this.callback=r,this.subscribe=n??!1}};var ar=class{constructor(e,i,r,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,s)),this.unsubscribe=s},this.host=e,i.context!==void 0){let o=i;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=i,this.callback=r,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Xt(this.context,this.host,this.t,this.subscribe))}};var Mn=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,i=!1){let r=i||!Object.is(e,this.o);this.o=e,r&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[i,{disposer:r}]of this.subscriptions)i(this.o,r)},e!==void 0&&(this.value=e)}addCallback(e,i,r){if(!r)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:i});let{disposer:n}=this.subscriptions.get(e);e(this.value,n)}clearCallbacks(){this.subscriptions.clear()}};var Gs=class extends Event{constructor(e,i){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i}},lr=class extends Mn{constructor(e,i,r){super(i.context!==void 0?i.initialValue:r),this.onContextRequest=n=>{if(n.context!==this.context)return;let o=n.contextTarget??n.composedPath()[0];o!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,o,n.subscribe))},this.onProviderRequest=n=>{if(n.context!==this.context||(n.contextTarget??n.composedPath()[0])===this.host)return;let o=new Set;for(let[s,{consumerHost:a}]of this.subscriptions)o.has(s)||(o.add(s),a.dispatchEvent(new Xt(this.context,a,s,!0)));n.stopPropagation()},this.host=e,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Gs(this.context,this.host))}};var Gr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let i=this.pendingContextRequests.get(e.context);if(i===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:r}=i;for(let{elementRef:n,callbackRef:o}of r){let s=n.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new Xt(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let i=e.contextTarget??e.composedPath()[0],r=e.callback,n=this.pendingContextRequests.get(e.context);n===void 0&&this.pendingContextRequests.set(e.context,n={callbacks:new WeakMap,requests:[]});let o=n.callbacks.get(i);o===void 0&&n.callbacks.set(i,o=new WeakSet),o.has(r)||(o.add(r),n.requests.push({elementRef:new WeakRef(i),callbackRef:new WeakRef(r)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};function qr({context:t}){return(e,i)=>{let r=new WeakMap;if(typeof i=="object")return{get(){return e.get.call(this)},set(n){return r.get(this).setValue(n),e.set.call(this,n)},init(n){return r.set(this,new lr(this,{context:t,initialValue:n})),n}};{e.constructor.addInitializer((s=>{r.set(s,new lr(s,{context:t}))}));let n=Object.getOwnPropertyDescriptor(e,i),o;if(n===void 0){let s=new WeakMap;o={get(){return s.get(this)},set(a){r.get(this).setValue(a),s.set(this,a)},configurable:!0,enumerable:!0}}else{let s=n.set;o={...n,set(a){r.get(this).setValue(a),s?.call(this,a)}}}return void Object.defineProperty(e,i,o)}}}function Yr({context:t,subscribe:e}){return(i,r)=>{typeof r=="object"?r.addInitializer((function(){new ar(this,{context:t,callback:n=>{i.set.call(this,n)},subscribe:e})})):i.constructor.addInitializer((n=>{new ar(n,{context:t,callback:o=>{n[r]=o},subscribe:e})}))}}var gh=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},qs="asset-viewer-state-manager",Ft=(0,bl.applyMixinOnce)(Symbol("toFtAssetViewerComponent"),function(t){class e extends t{willUpdate(r){super.willUpdate(r),r.has("viewerStateManager")&&(this.viewerStateManager?this.addStore(this.viewerStateManager.store,"viewer"):this.removeStore("viewer"))}connectedCallback(){super.connectedCallback(),this.viewerStateManager&&this.addStore(this.viewerStateManager.store,"viewer")}disconnectedCallback(){super.disconnectedCallback(),this.removeStore("viewer")}get service(){var r;return(r=this.viewerStateManager)===null||r===void 0?void 0:r.service}}return gh([Yr({context:qs,subscribe:!0}),(0,Sl.state)()],e.prototype,"viewerStateManager",void 0),e});var Ed=c(S()),xr=c(h());var El=c(h()),yh={setZoom:(t,e)=>{t.contentModifiers.zoom=e.payload},setRotation:(t,e)=>{t.contentModifiers.rotation=e.payload}},Nn=t=>El.FtReduxStore.get({name:"ft-viewer-"+t,initialState:{documentId:void 0,unstructuredDocument:void 0,document:void 0,assetId:void 0,origin:void 0,descriptor:void 0,contentModifiers:{zoom:void 0,rotation:0},watermark:void 0,configuration:void 0,documentRating:void 0,assetRating:void 0,relatives:void 0},reducers:yh});var bd=c(h());var ga=c($());var Al=c($(),1);var Ys=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},vh=t=>({fromAttribute:e=>{if(e==null)return Zr(t);try{return JSON.parse(e)}catch{return Zr(t)}},toAttribute:e=>JSON.stringify(e)});function _l(t,e){return(0,Al.property)({type:Object,converter:vh(t),hasChanged:Xr,...e??{}})}function xh(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let i,r;if(Array.isArray(t)){if(i=t.length,i!=e.length)return!1;for(r=i;r--!==0;)if(!cr(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!cr(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let n=s=>Object.keys(s).filter(a=>s[a]!=null),o=n(t);if(i=o.length,i!==n(e).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=i;r--!==0;){let s=o[r];if(!cr(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function cr(t,e){try{return xh(t,e)}catch{return!1}}function Xr(t,e){return!cr(t,e)}function Zr(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function $n(t,e){let i=r=>r[t]===!0;return r=>{if(i(r))return r;let n=e(r);return n[t]=!0,n}}var Cl=c($(),1);var Zs=t=>{let e=t??{};return(i,r)=>{var n;let o={hasChanged:Xr,attribute:!1,...e};(0,Cl.property)(o)(i,r);let s=i.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(r,{selector:(n=e.selector)!==null&&n!==void 0?n:(a=>a[r]),store:e.store})}};var Fn=class{constructor(){this.queue=[]}add(e,i=!1){i&&this.clear(e.type),this.queue.push(e)}consume(e){let i=this.queue.find(r=>r.type===e);return i&&(this.queue=this.queue.filter(r=>r!==i)),i}clear(e){typeof e=="string"?this.queue=this.queue.filter(i=>i.type!==e):this.queue=this.queue.filter(i=>!e.test(i.type))}};var Ti=c($(),1);var Un=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,i){return this.callbacks=[e],this.debounce(i)}queue(e,i){return this.callbacks.push(e),this.debounce(i)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((i,r)=>{this.resolvePromise=i,this.rejectPromise=r})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,i;let r=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),o=(i=this.resolvePromise)!==null&&i!==void 0?i:(()=>null);this.clearPromise();for(let s of r)try{await s()}catch(a){n(a);return}o(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Bn=c(S(),1);var Vn=class extends Bn.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let i={...e.shadowRootOptions,customElements:e.registry},r=this.renderOptions.creationScope=this.attachShadow(i);return(0,Bn.adoptStyles)(r,e.elementStyles),r}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([i,r])=>this.defineScopedElement(i,r))}static defineScopedElement(e,i){Ys(e)(i),this.canDefineScopedElement(e)&&this.registry.define(e,i)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,i){this.scopedRegistryConstructor.defineScopedElement(e,i)}};function Tl(t,e,...i){var r;let n=t.querySelector(e);for(let o of i)n=(r=n?.shadowRoot)===null||r===void 0?void 0:r.querySelector(o);return n}var ur=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},Dl,Rl=Symbol("constructorPrototype"),Ol=Symbol("constructorName"),Il=Symbol("exportpartsDebouncer"),kl=Symbol("dynamicDependenciesLoaded"),dr=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};dr.eventName="exportparts-updated";var Ut=class extends Vn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Dl]=new Un(5),this.scheduleExportpartsUpdate=()=>{var e,i,r;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(r=(i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)!==null&&r!==void 0&&r)&&this[Il].run(()=>{var n,o;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ol]=this.constructor.name,this[Rl]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ol]&&Object.setPrototypeOf(this,this[Rl])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let i=this.constructor;i[kl]||(i[kl]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(dr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(dr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new dr)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:i,selector:r,shadowPath:n}=this.elementToFocus;if(r!=null){let o=[...n??[],r];i=Tl(this.shadowRoot,...o)}i?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||i?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var i,r,n;if(((r=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&r!==void 0?r:[]).forEach(o=>o.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(o){console.error(o,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let o=document.createElement("style");o.classList.add("ft-lit-element--custom-stylesheet"),o.innerHTML=this.customStylesheet,this.shadowRoot.append(o)}}setExportpartsAttribute(e){var i,r,n,o,s,a;let l=f=>f!=null&&f.trim().length>0,d=e.filter(l).map(f=>f.trim());if(d.length===0){this.exportparts=void 0;return}let u=new Set;for(let f of(o=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let y=(s=(r=f.getAttribute("part"))===null||r===void 0?void 0:r.split(" "))!==null&&s!==void 0?s:[],w=(a=(n=f.getAttribute("exportparts"))===null||n===void 0?void 0:n.split(",").map(b=>b.split(":")[1]))!==null&&a!==void 0?a:[],T=[...y,...w].filter(l).map(b=>b.trim());for(let b of T)u.add(b)}if(u.size===0){this.exportparts=void 0;return}let p=[...u.values()].flatMap(f=>d.map(y=>`${f}:${y}--${f}`));this.exportparts=[...this.part,...p].join(", ")}};Dl=Il;ur([(0,Ti.property)()],Ut.prototype,"exportpartsPrefix",void 0);ur([_l([])],Ut.prototype,"exportpartsPrefixes",void 0);ur([(0,Ti.property)({reflect:!0})],Ut.prototype,"exportparts",void 0);ur([(0,Ti.property)()],Ut.prototype,"customStylesheet",void 0);ur([(0,Ti.property)()],Ut.prototype,"elementToFocus",void 0);ur([(0,Ti.state)()],Ut.prototype,"useAdoptedStyleSheets",void 0);function Hn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Jr=Symbol("internalReduxEventsUnsubscribers"),pi=Symbol("internalStoresUnsubscribers"),Ri=Symbol("internalStores"),bh=$n(Symbol("withRedux"),function(t){var e,i,r;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[i]=new Map,this[r]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(a=>s.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Ri].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ri].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Ri].get(s)}addStore(s,a){var l;a=(l=a??s.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Ri].set(a,s),this.subscribeToStore(a,s),this.updateFromStores()}removeStore(s){let a=typeof s=="string"?s:s.name;this.unsubscribeFromStore(a),this[Ri].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Ri].forEach((s,a)=>this.subscribeToStore(a,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let d=this.getStore(s.store);d&&(s.store?this[pi].has(s.store):this[pi].size>0)&&(this[a]=s.selector(d.getState(),this))}})}subscribeToStore(s,a){var l,d;this[pi].set(s,a.subscribe(()=>this.updateFromStores())),this[Jr].set(s,[]),Hn(a)&&(!((l=a.deprecatedKeys)===null||l===void 0)&&l.length&&this.reduxConstructor.reduxProperties.forEach((u,p)=>{this.getStore(u.store)===a&&a.deprecatedKeys.includes(p)&&console.warn("Element",this,"is subscribed to deprecated key",p,"in store",a.name)}),a.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((u,p)=>{if(typeof this[p]=="function"&&(!u.store||a.name===u.store)){let f=y=>this[p](y);a.addEventListener(u.eventName,f),this[Jr].get(s).push(()=>a.removeEventListener(u.eventName,f))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[pi].forEach((s,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(s){var a;this[pi].has(s)&&this[pi].get(s)(),this[pi].delete(s),(a=this[Jr].get(s))===null||a===void 0||a.forEach(l=>l()),this[Jr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=pi,i=Ri,r=Jr,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Ll=class extends bh(Ut){};function Re(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Sh=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pl=Sh,Xs=()=>Math.random().toString(36).substring(7).split("").join("."),wh={INIT:`@@redux/INIT${Xs()}`,REPLACE:`@@redux/REPLACE${Xs()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Xs()}`},zn=wh;function jn(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Js(t,e,i){if(typeof t!="function")throw new Error(Re(2));if(typeof e=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(Re(0));if(typeof e=="function"&&typeof i>"u"&&(i=e,e=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(Re(1));return i(Js)(t,e)}let r=t,n=e,o=new Map,s=o,a=0,l=!1;function d(){s===o&&(s=new Map,o.forEach((b,k)=>{s.set(k,b)}))}function u(){if(l)throw new Error(Re(3));return n}function p(b){if(typeof b!="function")throw new Error(Re(4));if(l)throw new Error(Re(5));let k=!0;d();let H=a++;return s.set(H,b),function(){if(k){if(l)throw new Error(Re(6));k=!1,d(),s.delete(H),o=null}}}function f(b){if(!jn(b))throw new Error(Re(7));if(typeof b.type>"u")throw new Error(Re(8));if(typeof b.type!="string")throw new Error(Re(17));if(l)throw new Error(Re(9));try{l=!0,n=r(n,b)}finally{l=!1}return(o=s).forEach(H=>{H()}),b}function y(b){if(typeof b!="function")throw new Error(Re(10));r=b,f({type:zn.REPLACE})}function w(){let b=p;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Re(11));function H(){let A=k;A.next&&A.next(u())}return H(),{unsubscribe:b(H)}},[Pl](){return this}}}return f({type:zn.INIT}),{dispatch:f,subscribe:p,getState:u,replaceReducer:y,[Pl]:w}}function Eh(t){Object.keys(t).forEach(e=>{let i=t[e];if(typeof i(void 0,{type:zn.INIT})>"u")throw new Error(Re(12));if(typeof i(void 0,{type:zn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Re(13))})}function Qs(t){let e=Object.keys(t),i={};for(let s=0;s<e.length;s++){let a=e[s];typeof t[a]=="function"&&(i[a]=t[a])}let r=Object.keys(i),n,o;try{Eh(i)}catch(s){o=s}return function(a={},l){if(o)throw o;let d=!1,u={};for(let p=0;p<r.length;p++){let f=r[p],y=i[f],w=a[f],T=y(w,l);if(typeof T>"u"){let b=l&&l.type;throw new Error(Re(14))}u[f]=T,d=d||T!==w}return d=d||r.length!==Object.keys(a).length,d?u:a}}function Qr(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,i)=>(...r)=>e(i(...r)))}function Ml(...t){return e=>(i,r)=>{let n=e(i,r),o=()=>{throw new Error(Re(15))},s={getState:n.getState,dispatch:(l,...d)=>o(l,...d)},a=t.map(l=>l(s));return o=Qr(...a)(n.dispatch),{...n,dispatch:o}}}function Nl(t){return jn(t)&&"type"in t&&typeof t.type=="string"}var Wl=Symbol.for("immer-nothing"),$l=Symbol.for("immer-draftable"),Pe=Symbol.for("immer-state");function At(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var nt=Object,fr=nt.getPrototypeOf,qn="constructor",eo="prototype",ra="configurable",Yn="enumerable",Kn="writable",en="value",Vt=t=>!!t&&!!t[Pe];function ot(t){return t?Kl(t)||io(t)||!!t[$l]||!!t[qn]?.[$l]||ro(t)||on(t):!1}var Ah=nt[eo][qn].toString(),Fl=new WeakMap;function Kl(t){if(!t||!ua(t))return!1;let e=fr(t);if(e===null||e===nt[eo])return!0;let i=nt.hasOwnProperty.call(e,qn)&&e[qn];if(i===Object)return!0;if(!pr(i))return!1;let r=Fl.get(i);return r===void 0&&(r=Function.toString.call(i),Fl.set(i,r)),r===Ah}function to(t,e,i=!0){nn(t)===0?(i?Reflect.ownKeys(t):nt.keys(t)).forEach(n=>{e(n,t[n],t)}):t.forEach((r,n)=>e(n,r,t))}function nn(t){let e=t[Pe];return e?e.type_:io(t)?1:ro(t)?2:on(t)?3:0}var ea=(t,e,i=nn(t))=>i===2?t.has(e):nt[eo].hasOwnProperty.call(t,e),na=(t,e,i=nn(t))=>i===2?t.get(e):t[e],Zn=(t,e,i,r=nn(t))=>{r===2?t.set(e,i):r===3?t.add(i):t[e]=i};function _h(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var io=Array.isArray,ro=t=>t instanceof Map,on=t=>t instanceof Set,ua=t=>typeof t=="object",pr=t=>typeof t=="function",ta=t=>typeof t=="boolean";function Ch(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var Jt=t=>t.copy_||t.base_;var pa=t=>t.modified_?t.copy_:t.base_;function oa(t,e){if(ro(t))return new Map(t);if(on(t))return new Set(t);if(io(t))return Array[eo].slice.call(t);let i=Kl(t);if(e===!0||e==="class_only"&&!i){let r=nt.getOwnPropertyDescriptors(t);delete r[Pe];let n=Reflect.ownKeys(r);for(let o=0;o<n.length;o++){let s=n[o],a=r[s];a[Kn]===!1&&(a[Kn]=!0,a[ra]=!0),(a.get||a.set)&&(r[s]={[ra]:!0,[Kn]:!0,[Yn]:a[Yn],[en]:t[s]})}return nt.create(fr(t),r)}else{let r=fr(t);if(r!==null&&i)return{...t};let n=nt.create(r);return nt.assign(n,t)}}function no(t,e=!1){return oo(t)||Vt(t)||!ot(t)||(nn(t)>1&&nt.defineProperties(t,{set:Wn,add:Wn,clear:Wn,delete:Wn}),nt.freeze(t),e&&to(t,(i,r)=>{no(r,!0)},!1)),t}function Th(){At(2)}var Wn={[en]:Th};function oo(t){return t===null||!ua(t)?!0:nt.isFrozen(t)}var Xn="MapSet",sa="Patches",Ul="ArrayMethods",Gl={};function Oi(t){let e=Gl[t];return e||At(0,t),e}var Vl=t=>!!Gl[t];var tn,ql=()=>tn,Rh=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Vl(Xn)?Oi(Xn):void 0,arrayMethodsPlugin_:Vl(Ul)?Oi(Ul):void 0});function Bl(t,e){e&&(t.patchPlugin_=Oi(sa),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function aa(t){la(t),t.drafts_.forEach(Oh),t.drafts_=null}function la(t){t===tn&&(tn=t.parent_)}var Hl=t=>tn=Rh(tn,t);function Oh(t){let e=t[Pe];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function zl(t,e){e.unfinalizedDrafts_=e.drafts_.length;let i=e.drafts_[0];if(t!==void 0&&t!==i){i[Pe].modified_&&(aa(e),At(4)),ot(t)&&(t=jl(e,t));let{patchPlugin_:n}=e;n&&n.generateReplacementPatches_(i[Pe].base_,t,e)}else t=jl(e,i);return kh(e,t,!0),aa(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Wl?t:void 0}function jl(t,e){if(oo(e))return e;let i=e[Pe];if(!i)return Jn(e,t.handledSet_,t);if(!so(i,t))return e;if(!i.modified_)return i.base_;if(!i.finalized_){let{callbacks_:r}=i;if(r)for(;r.length>0;)r.pop()(t);Xl(i,t)}return i.copy_}function kh(t,e,i=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&no(e,i)}function Yl(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var so=(t,e)=>t.scope_===e,Dh=[];function Zl(t,e,i,r){let n=Jt(t),o=t.type_;if(r!==void 0&&na(n,r,o)===e){Zn(n,r,i,o);return}if(!t.draftLocations_){let a=t.draftLocations_=new Map;to(n,(l,d)=>{if(Vt(d)){let u=a.get(d)||[];u.push(l),a.set(d,u)}})}let s=t.draftLocations_.get(e)??Dh;for(let a of s)Zn(n,a,i,o)}function Ih(t,e,i){t.callbacks_.push(function(n){let o=e;if(!o||!so(o,n))return;n.mapSetPlugin_?.fixSetContents(o);let s=pa(o);Zl(t,o.draft_??o,s,i),Xl(o,n)})}function Xl(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:r}=e;if(r){let n=r.getPath(t);n&&r.generatePatches_(t,n,e)}Yl(t)}}function Lh(t,e,i){let{scope_:r}=t;if(Vt(i)){let n=i[Pe];so(n,r)&&n.callbacks_.push(function(){Gn(t);let s=pa(n);Zl(t,i,s,e)})}else ot(i)&&t.callbacks_.push(function(){let o=Jt(t);t.type_===3?o.has(i)&&Jn(i,r.handledSet_,r):na(o,e,t.type_)===i&&r.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&Jn(na(t.copy_,e,t.type_),r.handledSet_,r)})}function Jn(t,e,i){return!i.immer_.autoFreeze_&&i.unfinalizedDrafts_<1||Vt(t)||e.has(t)||!ot(t)||oo(t)||(e.add(t),to(t,(r,n)=>{if(Vt(n)){let o=n[Pe];if(so(o,i)){let s=pa(o);Zn(t,r,s,t.type_),Yl(o)}}else ot(n)&&Jn(n,e,i)})),t}function Ph(t,e){let i=io(t),r={type_:i?1:0,scope_:e?e.scope_:ql(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},n=r,o=Qn;i&&(n=[r],o=rn);let{revoke:s,proxy:a}=Proxy.revocable(n,o);return r.draft_=a,r.revoke_=s,[a,r]}var Qn={get(t,e){if(e===Pe)return t;let i=t.scope_.arrayMethodsPlugin_,r=t.type_===1&&typeof e=="string";if(r&&i?.isArrayOperationMethod(e))return i.createMethodInterceptor(t,e);let n=Jt(t);if(!ea(n,e,t.type_))return Nh(t,n,e);let o=n[e];if(t.finalized_||!ot(o)||r&&t.operationMethod&&i?.isMutatingArrayMethod(t.operationMethod)&&Ch(e))return o;if(o===ia(t.base_,e)||Mh(t,e,o)){Gn(t);let s=t.type_===1?+e:e,a=da(t.scope_,o,t,s);return t.copy_[s]=a}return o},has(t,e){return e in Jt(t)},ownKeys(t){return Reflect.ownKeys(Jt(t))},set(t,e,i){let r=Jl(Jt(t),e);if(r?.set)return r.set.call(t.draft_,i),!0;if(!t.modified_){let n=ia(Jt(t),e),o=n?.[Pe];if(o&&o.base_===i)return t.copy_[e]=i,t.assigned_.delete(e),!0;if(_h(i,n)&&(i!==void 0||ea(t.base_,e,t.type_)))return!0;Gn(t),ca(t)}return t.copy_[e]===i&&(i!==void 0||ea(t.copy_,e,t.type_))||Number.isNaN(i)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=i,t.assigned_.set(e,!0),Lh(t,e,i)),!0},deleteProperty(t,e){return Gn(t),ia(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),ca(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let i=Jt(t),r=Reflect.getOwnPropertyDescriptor(i,e);return r&&{[Kn]:!0,[ra]:t.type_!==1||e!=="length",[Yn]:r[Yn],[en]:i[e]}},defineProperty(){At(11)},getPrototypeOf(t){return fr(t.base_)},setPrototypeOf(){At(12)}},rn={};for(let t in Qn){let e=Qn[t];rn[t]=function(){let i=arguments;return i[0]=i[0][0],e.apply(this,i)}}rn.deleteProperty=function(t,e){return rn.set.call(this,t,e,void 0)};rn.set=function(t,e,i){return Qn.set.call(this,t[0],e,i,t[0])};function ia(t,e){let i=t[Pe];return(i?Jt(i):t)[e]}function Mh(t,e,i){return t.type_!==1||!t.allIndicesReassigned_||!ot(i)||i[Pe]?!1:t.baseRefs_.has(i)}function Nh(t,e,i){let r=Jl(e,i);return r?en in r?r[en]:r.get?.call(t.draft_):void 0}function Jl(t,e){if(!(e in t))return;let i=fr(t);for(;i;){let r=Object.getOwnPropertyDescriptor(i,e);if(r)return r;i=fr(i)}}function ca(t){t.modified_||(t.modified_=!0,t.parent_&&ca(t.parent_))}function Gn(t){t.copy_||(t.assigned_=new Map,t.copy_=oa(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var $h=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,i,r)=>{if(pr(e)&&!pr(i)){let o=i;i=e;let s=this;return function(l=o,...d){return s.produce(l,u=>i.call(this,u,...d))}}pr(i)||At(6),r!==void 0&&!pr(r)&&At(7);let n;if(ot(e)){let o=Hl(this),s=da(o,e,void 0),a=!0;try{n=i(s),a=!1}finally{a?aa(o):la(o)}return Bl(o,r),zl(n,o)}else if(!e||!ua(e)){if(n=i(e),n===void 0&&(n=e),n===Wl&&(n=void 0),this.autoFreeze_&&no(n,!0),r){let o=[],s=[];Oi(sa).generateReplacementPatches_(e,n,{patches_:o,inversePatches_:s}),r(o,s)}return n}else At(1,e)},this.produceWithPatches=(e,i)=>{if(pr(e))return(s,...a)=>this.produceWithPatches(s,l=>e(l,...a));let r,n;return[this.produce(e,i,(s,a)=>{r=s,n=a}),r,n]},ta(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ta(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ta(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ot(t)||At(8),Vt(t)&&(t=Ql(t));let e=Hl(this),i=da(e,t,void 0);return i[Pe].isManual_=!0,la(e),i}finishDraft(t,e){let i=t&&t[Pe];(!i||!i.isManual_)&&At(9);let{scope_:r}=i;return Bl(r,e),zl(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let i;for(i=e.length-1;i>=0;i--){let n=e[i];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}i>-1&&(e=e.slice(i+1));let r=Oi(sa).applyPatches_;return Vt(t)?r(t,e):this.produce(t,n=>r(n,e))}};function da(t,e,i,r){let[n,o]=ro(e)?Oi(Xn).proxyMap_(e,i):on(e)?Oi(Xn).proxySet_(e,i):Ph(e,i);return(i?.scope_??ql()).drafts_.push(n),o.callbacks_=i?.callbacks_??[],o.key_=r,i&&r!==void 0?Ih(i,o,r):o.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:d}=l;o.modified_&&d&&d.generatePatches_(o,[],l)}),n}function Ql(t){return Vt(t)||At(10,t),ec(t)}function ec(t){if(!ot(t)||oo(t))return t;let e=t[Pe],i,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,i=oa(t,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else i=oa(t,!0);let n=i;return on(i)&&(i=new Set),to(n,(o,s)=>{Zn(i,o,ec(s))},r),e&&(e.finalized_=!1),i}var Fh=globalThis.Iterator,oy=typeof Fh?.from=="function";var Uh=new $h,fa=Uh.produce;function tc(t){return({dispatch:i,getState:r})=>n=>o=>typeof o=="function"?o(i,r,t):n(o)}var ic=tc(),rc=tc;var Vh=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qr:Qr.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Bh=t=>t&&typeof t.match=="function";function fi(t,e){function i(...r){if(e){let n=e(...r);if(!n)throw new Error(Bt(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:r[0]}}return i.toString=()=>`${t}`,i.type=t,i.match=r=>Nl(r)&&r.type===t,i}var lc=class sn extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new sn(...e[0].concat(this)):new sn(...e.concat(this))}};function nc(t){return ot(t)?fa(t,()=>{}):t}function ao(t,e,i){return t.has(e)?t.get(e):t.set(e,i(e)).get(e)}function Hh(t){return typeof t=="boolean"}var zh=()=>function(e){let{thunk:i=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:o=!0}=e??{},s=new lc;return i&&(Hh(i)?s.push(ic):s.push(rc(i.extraArgument))),s},jh="RTK_autoBatch";var oc=t=>e=>{setTimeout(e,t)},Wh=(t,e)=>i=>{let r=!1,n,o,s=()=>{r||(r=!0,cancelAnimationFrame(n),clearTimeout(o),i())};n=t(s),o=setTimeout(s,e)},Kh=(t={type:"raf"})=>e=>(...i)=>{let r=e(...i),n=!0,o=!1,s=!1,a=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Wh(window.requestAnimationFrame,100):oc(10):t.type==="callback"?t.queueNotification:oc(t.timeout),d=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){let p=()=>n&&u(),f=r.subscribe(p);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){try{return n=!u?.meta?.[jh],o=!n,o&&(s||(s=!0,l(d))),r.dispatch(u)}finally{n=!0}}})},Gh=t=>function(i){let{autoBatch:r=!0}=i??{},n=new lc(t);return r&&n.push(Kh(typeof r=="object"?r:void 0)),n};function cc(t){let e=zh(),{reducer:i=void 0,middleware:r,devTools:n=!0,duplicateMiddlewareCheck:o=!0,preloadedState:s=void 0,enhancers:a=void 0}=t||{},l;if(typeof i=="function")l=i;else if(jn(i))l=Qs(i);else throw new Error(Bt(1));let d;typeof r=="function"?d=r(e):d=e();let u=Qr;n&&(u=Vh({trace:!1,...typeof n=="object"&&n}));let p=Ml(...d),f=Gh(p),y=typeof a=="function"?a(f):f(),w=u(...y);return Js(l,s,w)}function dc(t){let e={},i=[],r,n={addCase(o,s){let a=typeof o=="string"?o:o.type;if(!a)throw new Error(Bt(28));if(a in e)throw new Error(Bt(29));return e[a]=s,n},addAsyncThunk(o,s){return s.pending&&(e[o.pending.type]=s.pending),s.rejected&&(e[o.rejected.type]=s.rejected),s.fulfilled&&(e[o.fulfilled.type]=s.fulfilled),s.settled&&i.push({matcher:o.settled,reducer:s.settled}),n},addMatcher(o,s){return i.push({matcher:o,reducer:s}),n},addDefaultCase(o){return r=o,n}};return t(n),[e,i,r]}function qh(t){return typeof t=="function"}function Yh(t,e){let[i,r,n]=dc(e),o;if(qh(t))o=()=>nc(t());else{let a=nc(t);o=()=>a}function s(a=o(),l){let d=[i[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[n]),d.reduce((u,p)=>{if(p)if(Vt(u)){let f=p(u,l);return f===void 0?u:f}else{if(ot(u))return fa(u,f=>p(f,l));{let f=p(u,l);if(f===void 0){if(u===null)return u;throw new Error(Bt(9))}return f}}return u},a)}return s.getInitialState=o,s}var Zh=(t,e)=>Bh(t)?t.match(e):t(e);function Xh(...t){return e=>t.some(i=>Zh(i,e))}var Jh="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qh=(t=21)=>{let e="",i=t;for(;i--;)e+=Jh[Math.random()*64|0];return e},em=["name","message","stack","code"],ha=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},sc=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},tm=t=>{if(typeof t=="object"&&t!==null){let e={};for(let i of em)typeof t[i]=="string"&&(e[i]=t[i]);return e}return{message:String(t)}},ac="External signal was aborted",im=(()=>{function t(e,i,r){let n=fi(e+"/fulfilled",(l,d,u,p)=>({payload:l,meta:{...p||{},arg:u,requestId:d,requestStatus:"fulfilled"}})),o=fi(e+"/pending",(l,d,u)=>({payload:void 0,meta:{...u||{},arg:d,requestId:l,requestStatus:"pending"}})),s=fi(e+"/rejected",(l,d,u,p,f)=>({payload:p,error:(r&&r.serializeError||tm)(l||"Rejected"),meta:{...f||{},arg:u,requestId:d,rejectedWithValue:p!==void 0,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:d}={}){return(u,p,f)=>{let y=r?.idGenerator?r.idGenerator(l):Qh(),w=new AbortController,T,b;function k(E){b=E,w.abort()}d&&(d.aborted?k(ac):d.addEventListener("abort",()=>k(ac),{once:!0}));let H=(async function(){let E;try{let A=r?.condition?.(l,{getState:p,extra:f});if(nm(A)&&(A=await A),A===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(w.signal.aborted)throw{name:"AbortError",message:b||"Aborted"};let K=new Promise((U,ye)=>{T=()=>{ye({name:"AbortError",message:b||"Aborted"})},w.signal.addEventListener("abort",T,{once:!0})});u(o(y,l,r?.getPendingMeta?.({requestId:y,arg:l},{getState:p,extra:f}))),E=await Promise.race([K,Promise.resolve(i(l,{dispatch:u,getState:p,extra:f,requestId:y,signal:w.signal,abort:k,rejectWithValue:((U,ye)=>new ha(U,ye)),fulfillWithValue:((U,ye)=>new sc(U,ye))})).then(U=>{if(U instanceof ha)throw U;return U instanceof sc?n(U.payload,y,l,U.meta):n(U,y,l)})])}catch(A){E=A instanceof ha?s(null,y,l,A.payload,A.meta):s(A,y,l)}finally{T&&w.signal.removeEventListener("abort",T)}return r&&!r.dispatchConditionRejection&&s.match(E)&&E.meta.condition||u(E),E})();return Object.assign(H,{abort:k,requestId:y,arg:l,unwrap(){return H.then(rm)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:n,settled:Xh(s,n),typePrefix:e})}return t.withTypes=()=>t,t})();function rm(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function nm(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var uc=Symbol.for("rtk-slice-createasyncthunk"),fy={[uc]:im};function om(t,e){return`${t}/${e}`}function sm({creators:t}={}){let e=t?.asyncThunk?.[uc];return function(r){let{name:n,reducerPath:o=n}=r;if(!n)throw new Error(Bt(11));typeof process<"u";let s=(typeof r.reducers=="function"?r.reducers(lm()):r.reducers)||{},a=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(E,A){let K=typeof E=="string"?E:E.type;if(!K)throw new Error(Bt(12));if(K in l.sliceCaseReducersByType)throw new Error(Bt(13));return l.sliceCaseReducersByType[K]=A,d},addMatcher(E,A){return l.sliceMatchers.push({matcher:E,reducer:A}),d},exposeAction(E,A){return l.actionCreators[E]=A,d},exposeCaseReducer(E,A){return l.sliceCaseReducersByName[E]=A,d}};a.forEach(E=>{let A=s[E],K={reducerName:E,type:om(n,E),createNotation:typeof r.reducers=="function"};dm(A)?pm(K,A,d,e):cm(K,A,d)});function u(){let[E={},A=[],K=void 0]=typeof r.extraReducers=="function"?dc(r.extraReducers):[r.extraReducers],U={...E,...l.sliceCaseReducersByType};return Yh(r.initialState,ye=>{for(let Le in U)ye.addCase(Le,U[Le]);for(let Le of l.sliceMatchers)ye.addMatcher(Le.matcher,Le.reducer);for(let Le of A)ye.addMatcher(Le.matcher,Le.reducer);K&&ye.addDefaultCase(K)})}let p=E=>E,f=new Map,y=new WeakMap,w;function T(E,A){return w||(w=u()),w(E,A)}function b(){return w||(w=u()),w.getInitialState()}function k(E,A=!1){function K(ye){let Le=ye[E];return typeof Le>"u"&&A&&(Le=ao(y,K,b)),Le}function U(ye=p){return ao(ao(f,A,()=>new WeakMap),ye,()=>{let Le={};for(let[Pn,mt]of Object.entries(r.selectors??{}))Le[Pn]=am(mt,ye,()=>ao(y,ye,b),A);return Le})}return{reducerPath:E,getSelectors:U,get selectors(){return U(K)},selectSlice:K}}let H={name:n,reducer:T,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:b,...k(o),injectInto(E,{reducerPath:A,...K}={}){let U=A??o;return E.inject({reducerPath:U,reducer:T},K),{...H,...k(U,!0)}}};return H}}function am(t,e,i,r){function n(o,...s){let a=e(o);return typeof a>"u"&&r&&(a=i()),t(a,...s)}return n.unwrapped=t,n}var pc=sm();function lm(){function t(e,i){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...i}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...i){return e(...i)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,i){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:i}},asyncThunk:t}}function cm({type:t,reducerName:e,createNotation:i},r,n){let o,s;if("reducer"in r){if(i&&!um(r))throw new Error(Bt(17));o=r.reducer,s=r.prepare}else o=r;n.addCase(t,o).exposeCaseReducer(e,o).exposeAction(e,s?fi(t,s):fi(t))}function dm(t){return t._reducerDefinitionType==="asyncThunk"}function um(t){return t._reducerDefinitionType==="reducerWithPrepare"}function pm({type:t,reducerName:e},i,r,n){if(!n)throw new Error(Bt(18));let{payloadCreator:o,fulfilled:s,pending:a,rejected:l,settled:d,options:u}=i,p=n(t,o,u);r.exposeAction(e,p),s&&r.addCase(p.fulfilled,s),a&&r.addCase(p.pending,a),l&&r.addCase(p.rejected,l),d&&r.addMatcher(p.settled,d),r.exposeCaseReducer(e,{fulfilled:s||lo,pending:a||lo,rejected:l||lo,settled:d||lo})}function lo(){}var fc="listener",hc="completed",mc="cancelled",hy=`task-${mc}`,my=`task-${hc}`,gy=`${fc}-${mc}`,yy=`${fc}-${hc}`;var{assign:gc}=Object;var ma="listenerMiddleware";var fm=gc(fi(`${ma}/add`),{withTypes:()=>fm}),vy=fi(`${ma}/removeAll`),hm=gc(fi(`${ma}/remove`),{withTypes:()=>hm});function Bt(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var mm=$n(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(i,r,n){this.eventBus.addEventListener(i,r,n)}dispatchEvent(i){return this.eventBus.dispatchEvent(i)}removeEventListener(i,r,n){this.eventBus.removeEventListener(i,r,n)}}}),co=class extends mm(Object){};window.ftReduxStores||(window.ftReduxStores={});var yc=class t extends co{static get(e){var i;let r=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,o=window.ftReduxStores[r];if(Hn(o))return o;if(n==null)return;let s=pc({...n,reducers:(i=n.reducers)!==null&&i!==void 0?i:{}}),a=cc({reducer:(l,d)=>{if(d.type==="CLEAR_FT_REDUX_STORE"){let u=Zr(s.getInitialState());for(let p of d.keeping)u[p]=(l??u)[p];return u}else if(typeof d.type=="string"&&d.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...d.overwrites};return s.reducer(l,d)}});return window.ftReduxStores[n.name]=new t(s,a,n.eventBus,n.deprecatedKeys)}constructor(e,i,r,n){super(),this.reduxSlice=e,this.reduxStore=i,this.deprecatedKeys=n,this.isFtReduxStore=!0,this.commands=new Fn,this.injectInto=(s,a)=>this.reduxSlice.injectInto(s,a),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let o=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,l)=>{let d=a,u=s[d];return u?(...p)=>{let f=u(...p.map(o));return this.reduxStore.dispatch(f),f}:p=>{let f=d,y=this.getState()[f];cr(y,p)||this.setState({[f]:o(p)})}}}),this.eventBus=r??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var uo=class{static format(e,i,r,n,o){return window.moment?window.moment(e).locale(i).format(this.getMomentDateFormat(r,n,!!o)):this.getIntlDateTime(e,i,r,n,!!o)}static getMomentDateFormat(e,i,r){return r?"LT":e?i?"lll":"ll":i?"L LT":"L"}static getIntlDateTime(e,i,r,n,o){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(i,{dateStyle:r?"medium":"short"}).format(s),l=new Intl.DateTimeFormat(i,{timeStyle:"short"}).format(s);return o?l:n?`${a} ${l}`:a}static getTimezoneAsString(){let e=r=>String(Math.floor(r)).padStart(2,"0"),i=new Date().getTimezoneOffset();return`${i<0?"+":"-"}${e(Math.abs(i)/60)}:${e(Math.abs(i)%60)}`}};var po=c(h()),gm="ft-app-info",st=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};st.eventName="authentication-change";var ki=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ki.eventName="ui-locale-changed";var ym={session:(t,e)=>{(0,po.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>v.dispatchEvent(new st(e.payload)),0))}},v=po.FtReduxStore.get({name:gm,reducers:ym,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var vc=c(h()),fo=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},xc=(0,vc.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...r){super(r),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(v)}dateFormatOptionsChanged(r){return r.has("metadataDescriptors")||r.has("useLongDateFormat")||r.has("useDateTimeFormat")||r.has("uiLocale")}getDateFormatter(r){var n,o;return((o=(n=this.metadataDescriptors.find(a=>a.key===r))===null||n===void 0?void 0:n.date)!==null&&o!==void 0?o:!1)?a=>uo.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return fo([(0,ga.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),fo([(0,ga.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),fo([Zs({store:v.name,selector:i=>{var r,n;return(n=(r=i.metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),fo([Zs({store:v.name})],e.prototype,"uiLocale",void 0),e});var bc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(bc||(bc={}));var Sc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Sc||(Sc={}));var wc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(wc||(wc={}));var Ec;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Ec||(Ec={}));var Ac;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Ac||(Ac={}));var _c;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(_c||(_c={}));var Cc;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(Cc||(Cc={}));var Tc;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Tc||(Tc={}));var Rc;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Rc||(Rc={}));var Oc;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(Oc||(Oc={}));var kc;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER",t.DOC_DIFF="DOC_DIFF"})(kc||(kc={}));var Dc;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(Dc||(Dc={}));var Ic;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Ic||(Ic={}));var Lc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Lc||(Lc={}));var Pc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Pc||(Pc={}));var Ee;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ee||(Ee={}));var Mc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Mc||(Mc={}));var Nc;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Nc||(Nc={}));var $c;(function(t){t.ASC="ASC",t.DESC="DESC"})($c||($c={}));var Fc;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Fc||(Fc={}));var Uc;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Uc||(Uc={}));var Vc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Vc||(Vc={}));var ho;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ho||(ho={}));var Bc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Bc||(Bc={}));var Hc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Hc||(Hc={}));var zc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(zc||(zc={}));var jc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(jc||(jc={}));var Wc;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Wc||(Wc={}));var re;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(re||(re={}));var gt;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(gt||(gt={}));var Kc;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Kc||(Kc={}));var Gc;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Gc||(Gc={}));var qc;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(qc||(qc={}));var Yc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Yc||(Yc={}));var Zc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Zc||(Zc={}));var Xc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Xc||(Xc={}));var Jc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Jc||(Jc={}));var Qc;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(Qc||(Qc={}));var ed;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(ed||(ed={}));var td;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(td||(td={}));var id;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(id||(id={}));var rd;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(rd||(rd={}));var mo;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(mo||(mo={}));var vm={[re.PERSONAL_BOOK_SHARE_USER]:[re.PERSONAL_BOOK_USER],[re.HTML_EXPORT_USER]:[re.PERSONAL_BOOK_USER],[re.PDF_EXPORT_USER]:[re.PERSONAL_BOOK_USER],[re.KHUB_ADMIN]:[re.CONTENT_PUBLISHER],[re.ADMIN]:[re.KHUB_ADMIN,re.USERS_ADMIN,re.PORTAL_ADMIN,re.BEHAVIOR_DATA_USER],[re.GENERATIVE_AI_EXPORT_USER]:[re.GENERATIVE_AI_USER]};function nd(t,e){return t===e||(vm[t]??[]).some(i=>nd(i,e))}function hr(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(r=>nd(r,e))}function od(t,...e){return t==null?!1:e.some(i=>hr(t,i))}var bo=c(h());var ya=c(h());var Ht=class t{static get(e){let{baseUrl:i,apiIntegrationIdentifier:r}=v.getState(),n=e??r;if(i&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,n,!0)}static await(e){return new Promise(i=>{let r=t.get(e);if(r)i(r);else{let n=v.subscribe(()=>{r=t.get(e),r&&(n(),i(r))})}})}};var mr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ht.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ht.await()}};var Oe=class extends mr{constructor(e=!0,i){var r;super(i),this.sortObjectFields=(o,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([a],[l])=>a.localeCompare(l)));let n=this.constructor;n.commonCache=(r=n.commonCache)!==null&&r!==void 0?r:new ya.CacheRegistry,this.cache=e?n.commonCache:new ya.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((i,r)=>0|31*i+r.charCodeAt(0),0))}};var go=class extends Oe{async listMySearches(){let{session:e}=v.getState();return hr(e,re.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var yo=class extends Oe{async listMyBookmarks(){let e=v.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var vo=class extends Oe{constructor(){super(...arguments),this.CACHE_DURATION=180*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=v.getState().session;return!!e?.sessionAuthenticated}};var xo=class extends Oe{constructor(){super(...arguments),this.CACHE_DURATION=180*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=v.getState().session;return!!e?.sessionAuthenticated}};var xm="ft-user-assets",bm={setAssetCount:(t,e)=>{let{userAssetType:i,count:r}=e.payload.assetCount;t.assetCounts.allAsset[i]=r},clearAssetCount:t=>{Object.values(gt).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let i=e.payload.mapId;t.assetCounts.bookmarkByMap[i]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:i,mapId:r,asset:n}=e.payload;xa(t,i,[...va(t,i),n]),sd(t,i,1,r),ad(t,n)},editAsset:(t,e)=>{let{assetType:i,asset:r}=e.payload;xa(t,i,va(t,i).map(n=>n.id===r.id?r:n)),ad(t,r)},removeAsset:(t,e)=>{let{assetType:i,mapId:r,assetId:n}=e.payload;xa(t,i,va(t,i).filter(o=>o.id!==n)),sd(t,i,-1,r)}},ld={[gt.SEARCHES]:"savedSearches",[gt.BOOKMARKS]:"bookmarks",[gt.BOOKS]:void 0,[gt.COLLECTIONS]:void 0},va=(t,e)=>{var i;let r=ld[e];return r?(i=t[r])!==null&&i!==void 0?i:[]:[]},xa=(t,e,i)=>{let r=ld[e];r&&(t[r]=i)},sd=(t,e,i,r)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+i),e===gt.BOOKMARKS&&r)){let o=t.assetCounts.bookmarkByMap[r];t.assetCounts.bookmarkByMap[r]=Math.max(0,o+i)}},ad=(t,e)=>{let i=t.assetLabels.map(n=>n.title),r=e.labels.filter(n=>!i.includes(n)).map(n=>({title:n}));t.assetLabels.push(...r)},Ve=bo.FtReduxStore.get({name:xm,reducers:bm,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(gt).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ba=class{constructor(e=new vo,i=new xo){this.assetCountsService=e,this.assetLabelsService=i,this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new yo,this.savedSearchesService=new go,v.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:i}=v.getState();(0,bo.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,i?.profile)||(this.currentSession=i,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Ve.actions.clearAssetCount(),Ve.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Ve.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Ve.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Ve.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();Ve.actions.assetLabels(e)}async loadAssetCount(e){let i=await this.assetCountsService.getUserAssetCount(e);i&&Ve.getState().assetCounts.allAsset[e]!==i.count&&Ve.actions.setAssetCount({assetCount:i})}async loadBookmarkByMapId(e){let i=await this.assetCountsService.getUserBookmarkCountByMap(e);i&&Ve.getState().assetCounts.bookmarkByMap[e]!==i.count&&Ve.actions.setBookmarkCountByMap({count:i.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let i=Object.keys(Ve.getState().assetCounts.bookmarkByMap).length!==0;e===gt.BOOKMARKS&&i&&Ve.actions.clearBookmarkCountByMap(),Ve.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 i=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Ve.actions.bookmarks(i)}}},Sm=new ba;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Sm);var Sa=class{addCommand(e,i=!1){v.commands.add(e,i)}consumeCommand(e){return v.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Sa;var yt=c(h());var cd,gr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},wm=Symbol("clearAfterUnitTest"),So=class extends(0,yt.withEventBus)(Oe){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[cd]=()=>{this.defaultMessages={},this.cache=new yt.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=v.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let i=e.name.toLowerCase();this.cache.setFinal(i,e),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,i){var r;if(e=e.toLowerCase(),i&&Object.keys(i).length>0){let n={...(r=this.defaultMessages[e])!==null&&r!==void 0?r:{},...i};(0,yt.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var i,r;return this.fetchContext(e),(r=(i=this.cache.getNow(e))===null||i===void 0?void 0:i.messages)!==null&&r!==void 0?r:{}}resolveRawMessage(e,i){let r=e.toLowerCase();return this.resolveContext(r)[i]}resolveMessage(e,i,...r){var n;let o=e.toLowerCase(),s=this.resolveContext(o);return new yt.ParametrizedLabelResolver((n=this.defaultMessages[o])!==null&&n!==void 0?n:{},s).resolve(i,...r)}async fetchContext(e){let i=!this.cache.has(e),r;try{r=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),i&&await this.notify(e)}catch(n){!(n instanceof yt.CanceledPromiseError)&&i&&console.error(n)}return r}subscribe(e,i){var r;return e=e.toLowerCase(),this.listeners[e]=(r=this.listeners[e])!==null&&r!==void 0?r:new Set,this.listeners[e].add(i),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(i)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new gr({loadedContexts:e})),this.dispatchEvent(new gr({loadedContexts:e})),await Promise.all(e.map(i=>this.notify(i,!1)))}async notify(e,i=!0){i&&(document.body.dispatchEvent(new gr({loadedContexts:[e]})),this.dispatchEvent(new gr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>(0,yt.delay)(0).then(()=>r()).catch(()=>null)))}};cd=wm;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends So{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends So{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var yr=window.FluidTopicsI18nService,wo=window.FluidTopicsCustomI18nService;var dd=c(h()),wa=class{highlightHtml(e,i,r){(0,dd.highlightHtml)(e,i,r)}};window.FluidTopicsHighlightHtmlService=new wa;var ud=c(h());var Ea=class{isDate(e){var i,r,n,o;return(o=(r=((n=(i=v.getState().metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===e))===null||r===void 0?void 0:r.date)!==null&&o!==void 0?o:!1}format(e,i){var r,n,o,s;if(e==null)return"";try{return ud.DateFormatter.format(e,(r=i?.locale)!==null&&r!==void 0?r:v.getState().uiLocale,(n=i?.longFormat)!==null&&n!==void 0?n:!1,(o=i?.withTime)!==null&&o!==void 0?o:!1,(s=i?.onlyTime)!==null&&s!==void 0?s:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new Ea;var pd=c(h());var an=class{static get(e,i,{baseUrl:r,localesConfiguration:n,availableContentLocales:o}=v.getState()){var s;if(!i||o.length>0&&!o.some(a=>a.lang===i)){let a=n?.defaultLocales.defaultContentLocale;i=a?`${a.lang}-${a.region}`:(s=o[0])===null||s===void 0?void 0:s.lang}return new pd.SearchPlaceConverter(r,e??20,n?.allLanguagesAllowed,i,o)}};var Aa=class{urlToSearchRequest(e){return an.get().parse(e)}searchRequestToUrl(e){return an.get().serialize(e)}};window.FluidTopicsUrlService=new Aa;var Qt=c(h());var Di=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Di.eventName="before-location-change";var Ii=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Ii.eventName="change";var _a=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let i=sessionStorage.getItem(this.itemName(e));return i?JSON.parse(i):void 0}set(e,i){sessionStorage.setItem(this.itemName(e),JSON.stringify(i))}},fd=new _a;var Eo=class t extends Qt.WithEventBus{static build(){return new t(window.history,fd,()=>window.location,!1)}constructor(e,i,r,n){var o,s;super(),this.history=e,this.historyStorage=i,this.windowLocation=r,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(o=e.state)===null||o===void 0?void 0:o.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,i=!1){let r=i&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,r&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Qt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Ii(this.currentItem())),0)}installProxies(){let e=i=>(r,n,[o,s,a])=>{let l=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),d=new Di(l);this.dispatchEvent(d);let u=i(),p={...u===this.currentIndex?this.currentState:void 0,...o,index:u,href:d.detail.nextLocation.href};r.apply(n,[p,s,p.href]),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 i=this.history.length-1;i>=0;i--)e?this.states[i]=this.historyStorage.get(i):setTimeout(()=>this.states[i]=this.historyStorage.get(i),this.history.length-i)}updateCurrentState(e){var i;let r={...this.buildCurrentState(),...e,index:this.currentIndex,title:(i=e?.title)!==null&&i!==void 0?i:this.currentState.title};this.setCurrentState(r)}addBeforeLocationChangeListener(e){this.addEventListener(Di.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Di.eventName,e)}addHistoryChangeListener(e){this.addEventListener(Ii.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ii.eventName,e)}currentItem(){return(0,Qt.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Qt.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let i=this.states.filter(r=>!!r).filter(r=>r.index<this.currentIndex).reverse();return(0,Qt.deepCopy)(i.find(r=>e(r)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,Qt.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var i;let r=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;if(!r)return e;let n=e,o=e+1;for(;this.states.length>o&&!this.isDifferentMajorState(o,r);)this.hasState(o)&&(n=o),o++;return n}buildCurrentState(){var e,i;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(i=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&i!==void 0?i:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,i){var r;if(!this.hasState(e))return!1;let n=i??this.currentState.majorStateId,o=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;return o==null||o!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Eo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Ao=class{constructor(){this.storeListeners=[]}store(e,i){if(this.isAuthenticated())return;let r=JSON.stringify(i);window.localStorage.setItem(e,r),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:r,storageArea:window.localStorage}))}get(e){var i,r;if(!this.isAuthenticated())return(r=JSON.parse((i=window.localStorage.getItem(e))!==null&&i!==void 0?i:"null"))!==null&&r!==void 0?r:void 0}addStoreListener(e,i){let r=n=>{n.key===e()&&!this.isAuthenticated()&&i()};this.storeListeners.push(r),window.addEventListener("storage",r)}clearStoreListeners(){this.storeListeners.forEach(e=>window.removeEventListener("storage",e)),this.storeListeners.length=0}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var hd=c(S());var md=hd.css`
1
+ "use strict";(()=>{var dh=Object.create;var gl=Object.defineProperty;var uh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var fh=Object.getPrototypeOf,hh=Object.prototype.hasOwnProperty;var sr=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var mh=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ph(e))!hh.call(t,n)&&n!==i&&gl(t,n,{get:()=>e[n],enumerable:!(r=uh(e,n))||r.enumerable});return t};var c=(t,e,i)=>(i=t!=null?dh(fh(t)):{},mh(e||!t||!t.__esModule?gl(i,"default",{value:t,enumerable:!0}):i,t));var h=sr((lg,yl)=>{yl.exports=ftGlobals.wcUtils});var $=sr((cg,vl)=>{vl.exports=ftGlobals.litDecorators});var S=sr((Pg,wl)=>{wl.exports=ftGlobals.lit});var br=sr((bb,Rd)=>{Rd.exports=ftGlobals.litRepeat});var Va=sr((Qb,cu)=>{cu.exports=ftGlobals.litUnsafeHTML});var ut=sr((pE,Nu)=>{Nu.exports=ftGlobals.litClassMap});var ah=c(h());var bl=c(h()),Sl=c($());var Xt=class extends Event{constructor(e,i,r,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i,this.callback=r,this.subscribe=n??!1}};var ar=class{constructor(e,i,r,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,s)),this.unsubscribe=s},this.host=e,i.context!==void 0){let o=i;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=i,this.callback=r,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Xt(this.context,this.host,this.t,this.subscribe))}};var Mn=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,i=!1){let r=i||!Object.is(e,this.o);this.o=e,r&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[i,{disposer:r}]of this.subscriptions)i(this.o,r)},e!==void 0&&(this.value=e)}addCallback(e,i,r){if(!r)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:i});let{disposer:n}=this.subscriptions.get(e);e(this.value,n)}clearCallbacks(){this.subscriptions.clear()}};var Gs=class extends Event{constructor(e,i){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i}},lr=class extends Mn{constructor(e,i,r){super(i.context!==void 0?i.initialValue:r),this.onContextRequest=n=>{if(n.context!==this.context)return;let o=n.contextTarget??n.composedPath()[0];o!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,o,n.subscribe))},this.onProviderRequest=n=>{if(n.context!==this.context||(n.contextTarget??n.composedPath()[0])===this.host)return;let o=new Set;for(let[s,{consumerHost:a}]of this.subscriptions)o.has(s)||(o.add(s),a.dispatchEvent(new Xt(this.context,a,s,!0)));n.stopPropagation()},this.host=e,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Gs(this.context,this.host))}};var Gr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let i=this.pendingContextRequests.get(e.context);if(i===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:r}=i;for(let{elementRef:n,callbackRef:o}of r){let s=n.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new Xt(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let i=e.contextTarget??e.composedPath()[0],r=e.callback,n=this.pendingContextRequests.get(e.context);n===void 0&&this.pendingContextRequests.set(e.context,n={callbacks:new WeakMap,requests:[]});let o=n.callbacks.get(i);o===void 0&&n.callbacks.set(i,o=new WeakSet),o.has(r)||(o.add(r),n.requests.push({elementRef:new WeakRef(i),callbackRef:new WeakRef(r)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};function qr({context:t}){return(e,i)=>{let r=new WeakMap;if(typeof i=="object")return{get(){return e.get.call(this)},set(n){return r.get(this).setValue(n),e.set.call(this,n)},init(n){return r.set(this,new lr(this,{context:t,initialValue:n})),n}};{e.constructor.addInitializer((s=>{r.set(s,new lr(s,{context:t}))}));let n=Object.getOwnPropertyDescriptor(e,i),o;if(n===void 0){let s=new WeakMap;o={get(){return s.get(this)},set(a){r.get(this).setValue(a),s.set(this,a)},configurable:!0,enumerable:!0}}else{let s=n.set;o={...n,set(a){r.get(this).setValue(a),s?.call(this,a)}}}return void Object.defineProperty(e,i,o)}}}function Yr({context:t,subscribe:e}){return(i,r)=>{typeof r=="object"?r.addInitializer((function(){new ar(this,{context:t,callback:n=>{i.set.call(this,n)},subscribe:e})})):i.constructor.addInitializer((n=>{new ar(n,{context:t,callback:o=>{n[r]=o},subscribe:e})}))}}var gh=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},qs="asset-viewer-state-manager",Ft=(0,bl.applyMixinOnce)(Symbol("toFtAssetViewerComponent"),function(t){class e extends t{willUpdate(r){super.willUpdate(r),r.has("viewerStateManager")&&(this.viewerStateManager?this.addStore(this.viewerStateManager.store,"viewer"):this.removeStore("viewer"))}connectedCallback(){super.connectedCallback(),this.viewerStateManager&&this.addStore(this.viewerStateManager.store,"viewer")}disconnectedCallback(){super.disconnectedCallback(),this.removeStore("viewer")}get service(){var r;return(r=this.viewerStateManager)===null||r===void 0?void 0:r.service}}return gh([Yr({context:qs,subscribe:!0}),(0,Sl.state)()],e.prototype,"viewerStateManager",void 0),e});var Ed=c(S()),xr=c(h());var El=c(h()),yh={setZoom:(t,e)=>{t.contentModifiers.zoom=e.payload},setRotation:(t,e)=>{t.contentModifiers.rotation=e.payload}},Nn=t=>El.FtReduxStore.get({name:"ft-viewer-"+t,initialState:{documentId:void 0,unstructuredDocument:void 0,document:void 0,assetId:void 0,origin:void 0,descriptor:void 0,contentModifiers:{zoom:void 0,rotation:0},watermark:void 0,configuration:void 0,documentRating:void 0,assetRating:void 0,relatives:void 0},reducers:yh});var bd=c(h());var ga=c($());var Al=c($(),1);var Ys=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},vh=t=>({fromAttribute:e=>{if(e==null)return Zr(t);try{return JSON.parse(e)}catch{return Zr(t)}},toAttribute:e=>JSON.stringify(e)});function _l(t,e){return(0,Al.property)({type:Object,converter:vh(t),hasChanged:Xr,...e??{}})}function xh(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let i,r;if(Array.isArray(t)){if(i=t.length,i!=e.length)return!1;for(r=i;r--!==0;)if(!cr(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!cr(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let n=s=>Object.keys(s).filter(a=>s[a]!=null),o=n(t);if(i=o.length,i!==n(e).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=i;r--!==0;){let s=o[r];if(!cr(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function cr(t,e){try{return xh(t,e)}catch{return!1}}function Xr(t,e){return!cr(t,e)}function Zr(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function $n(t,e){let i=r=>r[t]===!0;return r=>{if(i(r))return r;let n=e(r);return n[t]=!0,n}}var Cl=c($(),1);var Zs=t=>{let e=t??{};return(i,r)=>{var n;let o={hasChanged:Xr,attribute:!1,...e};(0,Cl.property)(o)(i,r);let s=i.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(r,{selector:(n=e.selector)!==null&&n!==void 0?n:(a=>a[r]),store:e.store})}};var Fn=class{constructor(){this.queue=[]}add(e,i=!1){i&&this.clear(e.type),this.queue.push(e)}consume(e){let i=this.queue.find(r=>r.type===e);return i&&(this.queue=this.queue.filter(r=>r!==i)),i}clear(e){typeof e=="string"?this.queue=this.queue.filter(i=>i.type!==e):this.queue=this.queue.filter(i=>!e.test(i.type))}};var Ti=c($(),1);var Un=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,i){return this.callbacks=[e],this.debounce(i)}queue(e,i){return this.callbacks.push(e),this.debounce(i)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((i,r)=>{this.resolvePromise=i,this.rejectPromise=r})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,i;let r=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),o=(i=this.resolvePromise)!==null&&i!==void 0?i:(()=>null);this.clearPromise();for(let s of r)try{await s()}catch(a){n(a);return}o(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Bn=c(S(),1);var Vn=class extends Bn.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let i={...e.shadowRootOptions,customElements:e.registry},r=this.renderOptions.creationScope=this.attachShadow(i);return(0,Bn.adoptStyles)(r,e.elementStyles),r}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([i,r])=>this.defineScopedElement(i,r))}static defineScopedElement(e,i){Ys(e)(i),this.canDefineScopedElement(e)&&this.registry.define(e,i)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,i){this.scopedRegistryConstructor.defineScopedElement(e,i)}};function Tl(t,e,...i){var r;let n=t.querySelector(e);for(let o of i)n=(r=n?.shadowRoot)===null||r===void 0?void 0:r.querySelector(o);return n}var ur=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},Dl,Rl=Symbol("constructorPrototype"),Ol=Symbol("constructorName"),Il=Symbol("exportpartsDebouncer"),kl=Symbol("dynamicDependenciesLoaded"),dr=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};dr.eventName="exportparts-updated";var Ut=class extends Vn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Dl]=new Un(5),this.scheduleExportpartsUpdate=()=>{var e,i,r;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(r=(i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)!==null&&r!==void 0&&r)&&this[Il].run(()=>{var n,o;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ol]=this.constructor.name,this[Rl]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ol]&&Object.setPrototypeOf(this,this[Rl])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let i=this.constructor;i[kl]||(i[kl]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(dr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(dr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new dr)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:i,selector:r,shadowPath:n}=this.elementToFocus;if(r!=null){let o=[...n??[],r];i=Tl(this.shadowRoot,...o)}i?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||i?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var i,r,n;if(((r=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&r!==void 0?r:[]).forEach(o=>o.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(o){console.error(o,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let o=document.createElement("style");o.classList.add("ft-lit-element--custom-stylesheet"),o.innerHTML=this.customStylesheet,this.shadowRoot.append(o)}}setExportpartsAttribute(e){var i,r,n,o,s,a;let l=f=>f!=null&&f.trim().length>0,d=e.filter(l).map(f=>f.trim());if(d.length===0){this.exportparts=void 0;return}let u=new Set;for(let f of(o=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let y=(s=(r=f.getAttribute("part"))===null||r===void 0?void 0:r.split(" "))!==null&&s!==void 0?s:[],w=(a=(n=f.getAttribute("exportparts"))===null||n===void 0?void 0:n.split(",").map(b=>b.split(":")[1]))!==null&&a!==void 0?a:[],T=[...y,...w].filter(l).map(b=>b.trim());for(let b of T)u.add(b)}if(u.size===0){this.exportparts=void 0;return}let p=[...u.values()].flatMap(f=>d.map(y=>`${f}:${y}--${f}`));this.exportparts=[...this.part,...p].join(", ")}};Dl=Il;ur([(0,Ti.property)()],Ut.prototype,"exportpartsPrefix",void 0);ur([_l([])],Ut.prototype,"exportpartsPrefixes",void 0);ur([(0,Ti.property)({reflect:!0})],Ut.prototype,"exportparts",void 0);ur([(0,Ti.property)()],Ut.prototype,"customStylesheet",void 0);ur([(0,Ti.property)()],Ut.prototype,"elementToFocus",void 0);ur([(0,Ti.state)()],Ut.prototype,"useAdoptedStyleSheets",void 0);function Hn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Jr=Symbol("internalReduxEventsUnsubscribers"),pi=Symbol("internalStoresUnsubscribers"),Ri=Symbol("internalStores"),bh=$n(Symbol("withRedux"),function(t){var e,i,r;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[i]=new Map,this[r]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(a=>s.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Ri].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ri].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Ri].get(s)}addStore(s,a){var l;a=(l=a??s.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Ri].set(a,s),this.subscribeToStore(a,s),this.updateFromStores()}removeStore(s){let a=typeof s=="string"?s:s.name;this.unsubscribeFromStore(a),this[Ri].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Ri].forEach((s,a)=>this.subscribeToStore(a,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let d=this.getStore(s.store);d&&(s.store?this[pi].has(s.store):this[pi].size>0)&&(this[a]=s.selector(d.getState(),this))}})}subscribeToStore(s,a){var l,d;this[pi].set(s,a.subscribe(()=>this.updateFromStores())),this[Jr].set(s,[]),Hn(a)&&(!((l=a.deprecatedKeys)===null||l===void 0)&&l.length&&this.reduxConstructor.reduxProperties.forEach((u,p)=>{this.getStore(u.store)===a&&a.deprecatedKeys.includes(p)&&console.warn("Element",this,"is subscribed to deprecated key",p,"in store",a.name)}),a.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((u,p)=>{if(typeof this[p]=="function"&&(!u.store||a.name===u.store)){let f=y=>this[p](y);a.addEventListener(u.eventName,f),this[Jr].get(s).push(()=>a.removeEventListener(u.eventName,f))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[pi].forEach((s,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(s){var a;this[pi].has(s)&&this[pi].get(s)(),this[pi].delete(s),(a=this[Jr].get(s))===null||a===void 0||a.forEach(l=>l()),this[Jr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=pi,i=Ri,r=Jr,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Ll=class extends bh(Ut){};function Re(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Sh=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pl=Sh,Xs=()=>Math.random().toString(36).substring(7).split("").join("."),wh={INIT:`@@redux/INIT${Xs()}`,REPLACE:`@@redux/REPLACE${Xs()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Xs()}`},zn=wh;function jn(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Js(t,e,i){if(typeof t!="function")throw new Error(Re(2));if(typeof e=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(Re(0));if(typeof e=="function"&&typeof i>"u"&&(i=e,e=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(Re(1));return i(Js)(t,e)}let r=t,n=e,o=new Map,s=o,a=0,l=!1;function d(){s===o&&(s=new Map,o.forEach((b,k)=>{s.set(k,b)}))}function u(){if(l)throw new Error(Re(3));return n}function p(b){if(typeof b!="function")throw new Error(Re(4));if(l)throw new Error(Re(5));let k=!0;d();let H=a++;return s.set(H,b),function(){if(k){if(l)throw new Error(Re(6));k=!1,d(),s.delete(H),o=null}}}function f(b){if(!jn(b))throw new Error(Re(7));if(typeof b.type>"u")throw new Error(Re(8));if(typeof b.type!="string")throw new Error(Re(17));if(l)throw new Error(Re(9));try{l=!0,n=r(n,b)}finally{l=!1}return(o=s).forEach(H=>{H()}),b}function y(b){if(typeof b!="function")throw new Error(Re(10));r=b,f({type:zn.REPLACE})}function w(){let b=p;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Re(11));function H(){let A=k;A.next&&A.next(u())}return H(),{unsubscribe:b(H)}},[Pl](){return this}}}return f({type:zn.INIT}),{dispatch:f,subscribe:p,getState:u,replaceReducer:y,[Pl]:w}}function Eh(t){Object.keys(t).forEach(e=>{let i=t[e];if(typeof i(void 0,{type:zn.INIT})>"u")throw new Error(Re(12));if(typeof i(void 0,{type:zn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Re(13))})}function Qs(t){let e=Object.keys(t),i={};for(let s=0;s<e.length;s++){let a=e[s];typeof t[a]=="function"&&(i[a]=t[a])}let r=Object.keys(i),n,o;try{Eh(i)}catch(s){o=s}return function(a={},l){if(o)throw o;let d=!1,u={};for(let p=0;p<r.length;p++){let f=r[p],y=i[f],w=a[f],T=y(w,l);if(typeof T>"u"){let b=l&&l.type;throw new Error(Re(14))}u[f]=T,d=d||T!==w}return d=d||r.length!==Object.keys(a).length,d?u:a}}function Qr(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,i)=>(...r)=>e(i(...r)))}function Ml(...t){return e=>(i,r)=>{let n=e(i,r),o=()=>{throw new Error(Re(15))},s={getState:n.getState,dispatch:(l,...d)=>o(l,...d)},a=t.map(l=>l(s));return o=Qr(...a)(n.dispatch),{...n,dispatch:o}}}function Nl(t){return jn(t)&&"type"in t&&typeof t.type=="string"}var Wl=Symbol.for("immer-nothing"),$l=Symbol.for("immer-draftable"),Pe=Symbol.for("immer-state");function At(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var nt=Object,fr=nt.getPrototypeOf,qn="constructor",eo="prototype",ra="configurable",Yn="enumerable",Kn="writable",en="value",Vt=t=>!!t&&!!t[Pe];function ot(t){return t?Kl(t)||io(t)||!!t[$l]||!!t[qn]?.[$l]||ro(t)||on(t):!1}var Ah=nt[eo][qn].toString(),Fl=new WeakMap;function Kl(t){if(!t||!ua(t))return!1;let e=fr(t);if(e===null||e===nt[eo])return!0;let i=nt.hasOwnProperty.call(e,qn)&&e[qn];if(i===Object)return!0;if(!pr(i))return!1;let r=Fl.get(i);return r===void 0&&(r=Function.toString.call(i),Fl.set(i,r)),r===Ah}function to(t,e,i=!0){nn(t)===0?(i?Reflect.ownKeys(t):nt.keys(t)).forEach(n=>{e(n,t[n],t)}):t.forEach((r,n)=>e(n,r,t))}function nn(t){let e=t[Pe];return e?e.type_:io(t)?1:ro(t)?2:on(t)?3:0}var ea=(t,e,i=nn(t))=>i===2?t.has(e):nt[eo].hasOwnProperty.call(t,e),na=(t,e,i=nn(t))=>i===2?t.get(e):t[e],Zn=(t,e,i,r=nn(t))=>{r===2?t.set(e,i):r===3?t.add(i):t[e]=i};function _h(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var io=Array.isArray,ro=t=>t instanceof Map,on=t=>t instanceof Set,ua=t=>typeof t=="object",pr=t=>typeof t=="function",ta=t=>typeof t=="boolean";function Ch(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var Jt=t=>t.copy_||t.base_;var pa=t=>t.modified_?t.copy_:t.base_;function oa(t,e){if(ro(t))return new Map(t);if(on(t))return new Set(t);if(io(t))return Array[eo].slice.call(t);let i=Kl(t);if(e===!0||e==="class_only"&&!i){let r=nt.getOwnPropertyDescriptors(t);delete r[Pe];let n=Reflect.ownKeys(r);for(let o=0;o<n.length;o++){let s=n[o],a=r[s];a[Kn]===!1&&(a[Kn]=!0,a[ra]=!0),(a.get||a.set)&&(r[s]={[ra]:!0,[Kn]:!0,[Yn]:a[Yn],[en]:t[s]})}return nt.create(fr(t),r)}else{let r=fr(t);if(r!==null&&i)return{...t};let n=nt.create(r);return nt.assign(n,t)}}function no(t,e=!1){return oo(t)||Vt(t)||!ot(t)||(nn(t)>1&&nt.defineProperties(t,{set:Wn,add:Wn,clear:Wn,delete:Wn}),nt.freeze(t),e&&to(t,(i,r)=>{no(r,!0)},!1)),t}function Th(){At(2)}var Wn={[en]:Th};function oo(t){return t===null||!ua(t)?!0:nt.isFrozen(t)}var Xn="MapSet",sa="Patches",Ul="ArrayMethods",Gl={};function Oi(t){let e=Gl[t];return e||At(0,t),e}var Vl=t=>!!Gl[t];var tn,ql=()=>tn,Rh=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Vl(Xn)?Oi(Xn):void 0,arrayMethodsPlugin_:Vl(Ul)?Oi(Ul):void 0});function Bl(t,e){e&&(t.patchPlugin_=Oi(sa),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function aa(t){la(t),t.drafts_.forEach(Oh),t.drafts_=null}function la(t){t===tn&&(tn=t.parent_)}var Hl=t=>tn=Rh(tn,t);function Oh(t){let e=t[Pe];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function zl(t,e){e.unfinalizedDrafts_=e.drafts_.length;let i=e.drafts_[0];if(t!==void 0&&t!==i){i[Pe].modified_&&(aa(e),At(4)),ot(t)&&(t=jl(e,t));let{patchPlugin_:n}=e;n&&n.generateReplacementPatches_(i[Pe].base_,t,e)}else t=jl(e,i);return kh(e,t,!0),aa(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Wl?t:void 0}function jl(t,e){if(oo(e))return e;let i=e[Pe];if(!i)return Jn(e,t.handledSet_,t);if(!so(i,t))return e;if(!i.modified_)return i.base_;if(!i.finalized_){let{callbacks_:r}=i;if(r)for(;r.length>0;)r.pop()(t);Xl(i,t)}return i.copy_}function kh(t,e,i=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&no(e,i)}function Yl(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var so=(t,e)=>t.scope_===e,Dh=[];function Zl(t,e,i,r){let n=Jt(t),o=t.type_;if(r!==void 0&&na(n,r,o)===e){Zn(n,r,i,o);return}if(!t.draftLocations_){let a=t.draftLocations_=new Map;to(n,(l,d)=>{if(Vt(d)){let u=a.get(d)||[];u.push(l),a.set(d,u)}})}let s=t.draftLocations_.get(e)??Dh;for(let a of s)Zn(n,a,i,o)}function Ih(t,e,i){t.callbacks_.push(function(n){let o=e;if(!o||!so(o,n))return;n.mapSetPlugin_?.fixSetContents(o);let s=pa(o);Zl(t,o.draft_??o,s,i),Xl(o,n)})}function Xl(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:r}=e;if(r){let n=r.getPath(t);n&&r.generatePatches_(t,n,e)}Yl(t)}}function Lh(t,e,i){let{scope_:r}=t;if(Vt(i)){let n=i[Pe];so(n,r)&&n.callbacks_.push(function(){Gn(t);let s=pa(n);Zl(t,i,s,e)})}else ot(i)&&t.callbacks_.push(function(){let o=Jt(t);t.type_===3?o.has(i)&&Jn(i,r.handledSet_,r):na(o,e,t.type_)===i&&r.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&Jn(na(t.copy_,e,t.type_),r.handledSet_,r)})}function Jn(t,e,i){return!i.immer_.autoFreeze_&&i.unfinalizedDrafts_<1||Vt(t)||e.has(t)||!ot(t)||oo(t)||(e.add(t),to(t,(r,n)=>{if(Vt(n)){let o=n[Pe];if(so(o,i)){let s=pa(o);Zn(t,r,s,t.type_),Yl(o)}}else ot(n)&&Jn(n,e,i)})),t}function Ph(t,e){let i=io(t),r={type_:i?1:0,scope_:e?e.scope_:ql(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},n=r,o=Qn;i&&(n=[r],o=rn);let{revoke:s,proxy:a}=Proxy.revocable(n,o);return r.draft_=a,r.revoke_=s,[a,r]}var Qn={get(t,e){if(e===Pe)return t;let i=t.scope_.arrayMethodsPlugin_,r=t.type_===1&&typeof e=="string";if(r&&i?.isArrayOperationMethod(e))return i.createMethodInterceptor(t,e);let n=Jt(t);if(!ea(n,e,t.type_))return Nh(t,n,e);let o=n[e];if(t.finalized_||!ot(o)||r&&t.operationMethod&&i?.isMutatingArrayMethod(t.operationMethod)&&Ch(e))return o;if(o===ia(t.base_,e)||Mh(t,e,o)){Gn(t);let s=t.type_===1?+e:e,a=da(t.scope_,o,t,s);return t.copy_[s]=a}return o},has(t,e){return e in Jt(t)},ownKeys(t){return Reflect.ownKeys(Jt(t))},set(t,e,i){let r=Jl(Jt(t),e);if(r?.set)return r.set.call(t.draft_,i),!0;if(!t.modified_){let n=ia(Jt(t),e),o=n?.[Pe];if(o&&o.base_===i)return t.copy_[e]=i,t.assigned_.delete(e),!0;if(_h(i,n)&&(i!==void 0||ea(t.base_,e,t.type_)))return!0;Gn(t),ca(t)}return t.copy_[e]===i&&(i!==void 0||ea(t.copy_,e,t.type_))||Number.isNaN(i)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=i,t.assigned_.set(e,!0),Lh(t,e,i)),!0},deleteProperty(t,e){return Gn(t),ia(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),ca(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let i=Jt(t),r=Reflect.getOwnPropertyDescriptor(i,e);return r&&{[Kn]:!0,[ra]:t.type_!==1||e!=="length",[Yn]:r[Yn],[en]:i[e]}},defineProperty(){At(11)},getPrototypeOf(t){return fr(t.base_)},setPrototypeOf(){At(12)}},rn={};for(let t in Qn){let e=Qn[t];rn[t]=function(){let i=arguments;return i[0]=i[0][0],e.apply(this,i)}}rn.deleteProperty=function(t,e){return rn.set.call(this,t,e,void 0)};rn.set=function(t,e,i){return Qn.set.call(this,t[0],e,i,t[0])};function ia(t,e){let i=t[Pe];return(i?Jt(i):t)[e]}function Mh(t,e,i){return t.type_!==1||!t.allIndicesReassigned_||!ot(i)||i[Pe]?!1:t.baseRefs_.has(i)}function Nh(t,e,i){let r=Jl(e,i);return r?en in r?r[en]:r.get?.call(t.draft_):void 0}function Jl(t,e){if(!(e in t))return;let i=fr(t);for(;i;){let r=Object.getOwnPropertyDescriptor(i,e);if(r)return r;i=fr(i)}}function ca(t){t.modified_||(t.modified_=!0,t.parent_&&ca(t.parent_))}function Gn(t){t.copy_||(t.assigned_=new Map,t.copy_=oa(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var $h=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,i,r)=>{if(pr(e)&&!pr(i)){let o=i;i=e;let s=this;return function(l=o,...d){return s.produce(l,u=>i.call(this,u,...d))}}pr(i)||At(6),r!==void 0&&!pr(r)&&At(7);let n;if(ot(e)){let o=Hl(this),s=da(o,e,void 0),a=!0;try{n=i(s),a=!1}finally{a?aa(o):la(o)}return Bl(o,r),zl(n,o)}else if(!e||!ua(e)){if(n=i(e),n===void 0&&(n=e),n===Wl&&(n=void 0),this.autoFreeze_&&no(n,!0),r){let o=[],s=[];Oi(sa).generateReplacementPatches_(e,n,{patches_:o,inversePatches_:s}),r(o,s)}return n}else At(1,e)},this.produceWithPatches=(e,i)=>{if(pr(e))return(s,...a)=>this.produceWithPatches(s,l=>e(l,...a));let r,n;return[this.produce(e,i,(s,a)=>{r=s,n=a}),r,n]},ta(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ta(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ta(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ot(t)||At(8),Vt(t)&&(t=Ql(t));let e=Hl(this),i=da(e,t,void 0);return i[Pe].isManual_=!0,la(e),i}finishDraft(t,e){let i=t&&t[Pe];(!i||!i.isManual_)&&At(9);let{scope_:r}=i;return Bl(r,e),zl(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let i;for(i=e.length-1;i>=0;i--){let n=e[i];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}i>-1&&(e=e.slice(i+1));let r=Oi(sa).applyPatches_;return Vt(t)?r(t,e):this.produce(t,n=>r(n,e))}};function da(t,e,i,r){let[n,o]=ro(e)?Oi(Xn).proxyMap_(e,i):on(e)?Oi(Xn).proxySet_(e,i):Ph(e,i);return(i?.scope_??ql()).drafts_.push(n),o.callbacks_=i?.callbacks_??[],o.key_=r,i&&r!==void 0?Ih(i,o,r):o.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:d}=l;o.modified_&&d&&d.generatePatches_(o,[],l)}),n}function Ql(t){return Vt(t)||At(10,t),ec(t)}function ec(t){if(!ot(t)||oo(t))return t;let e=t[Pe],i,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,i=oa(t,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else i=oa(t,!0);let n=i;return on(i)&&(i=new Set),to(n,(o,s)=>{Zn(i,o,ec(s))},r),e&&(e.finalized_=!1),i}var Fh=globalThis.Iterator,oy=typeof Fh?.from=="function";var Uh=new $h,fa=Uh.produce;function tc(t){return({dispatch:i,getState:r})=>n=>o=>typeof o=="function"?o(i,r,t):n(o)}var ic=tc(),rc=tc;var Vh=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qr:Qr.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Bh=t=>t&&typeof t.match=="function";function fi(t,e){function i(...r){if(e){let n=e(...r);if(!n)throw new Error(Bt(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:r[0]}}return i.toString=()=>`${t}`,i.type=t,i.match=r=>Nl(r)&&r.type===t,i}var lc=class sn extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new sn(...e[0].concat(this)):new sn(...e.concat(this))}};function nc(t){return ot(t)?fa(t,()=>{}):t}function ao(t,e,i){return t.has(e)?t.get(e):t.set(e,i(e)).get(e)}function Hh(t){return typeof t=="boolean"}var zh=()=>function(e){let{thunk:i=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:o=!0}=e??{},s=new lc;return i&&(Hh(i)?s.push(ic):s.push(rc(i.extraArgument))),s},jh="RTK_autoBatch";var oc=t=>e=>{setTimeout(e,t)},Wh=(t,e)=>i=>{let r=!1,n,o,s=()=>{r||(r=!0,cancelAnimationFrame(n),clearTimeout(o),i())};n=t(s),o=setTimeout(s,e)},Kh=(t={type:"raf"})=>e=>(...i)=>{let r=e(...i),n=!0,o=!1,s=!1,a=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Wh(window.requestAnimationFrame,100):oc(10):t.type==="callback"?t.queueNotification:oc(t.timeout),d=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){let p=()=>n&&u(),f=r.subscribe(p);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){try{return n=!u?.meta?.[jh],o=!n,o&&(s||(s=!0,l(d))),r.dispatch(u)}finally{n=!0}}})},Gh=t=>function(i){let{autoBatch:r=!0}=i??{},n=new lc(t);return r&&n.push(Kh(typeof r=="object"?r:void 0)),n};function cc(t){let e=zh(),{reducer:i=void 0,middleware:r,devTools:n=!0,duplicateMiddlewareCheck:o=!0,preloadedState:s=void 0,enhancers:a=void 0}=t||{},l;if(typeof i=="function")l=i;else if(jn(i))l=Qs(i);else throw new Error(Bt(1));let d;typeof r=="function"?d=r(e):d=e();let u=Qr;n&&(u=Vh({trace:!1,...typeof n=="object"&&n}));let p=Ml(...d),f=Gh(p),y=typeof a=="function"?a(f):f(),w=u(...y);return Js(l,s,w)}function dc(t){let e={},i=[],r,n={addCase(o,s){let a=typeof o=="string"?o:o.type;if(!a)throw new Error(Bt(28));if(a in e)throw new Error(Bt(29));return e[a]=s,n},addAsyncThunk(o,s){return s.pending&&(e[o.pending.type]=s.pending),s.rejected&&(e[o.rejected.type]=s.rejected),s.fulfilled&&(e[o.fulfilled.type]=s.fulfilled),s.settled&&i.push({matcher:o.settled,reducer:s.settled}),n},addMatcher(o,s){return i.push({matcher:o,reducer:s}),n},addDefaultCase(o){return r=o,n}};return t(n),[e,i,r]}function qh(t){return typeof t=="function"}function Yh(t,e){let[i,r,n]=dc(e),o;if(qh(t))o=()=>nc(t());else{let a=nc(t);o=()=>a}function s(a=o(),l){let d=[i[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[n]),d.reduce((u,p)=>{if(p)if(Vt(u)){let f=p(u,l);return f===void 0?u:f}else{if(ot(u))return fa(u,f=>p(f,l));{let f=p(u,l);if(f===void 0){if(u===null)return u;throw new Error(Bt(9))}return f}}return u},a)}return s.getInitialState=o,s}var Zh=(t,e)=>Bh(t)?t.match(e):t(e);function Xh(...t){return e=>t.some(i=>Zh(i,e))}var Jh="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qh=(t=21)=>{let e="",i=t;for(;i--;)e+=Jh[Math.random()*64|0];return e},em=["name","message","stack","code"],ha=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},sc=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},tm=t=>{if(typeof t=="object"&&t!==null){let e={};for(let i of em)typeof t[i]=="string"&&(e[i]=t[i]);return e}return{message:String(t)}},ac="External signal was aborted",im=(()=>{function t(e,i,r){let n=fi(e+"/fulfilled",(l,d,u,p)=>({payload:l,meta:{...p||{},arg:u,requestId:d,requestStatus:"fulfilled"}})),o=fi(e+"/pending",(l,d,u)=>({payload:void 0,meta:{...u||{},arg:d,requestId:l,requestStatus:"pending"}})),s=fi(e+"/rejected",(l,d,u,p,f)=>({payload:p,error:(r&&r.serializeError||tm)(l||"Rejected"),meta:{...f||{},arg:u,requestId:d,rejectedWithValue:p!==void 0,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:d}={}){return(u,p,f)=>{let y=r?.idGenerator?r.idGenerator(l):Qh(),w=new AbortController,T,b;function k(E){b=E,w.abort()}d&&(d.aborted?k(ac):d.addEventListener("abort",()=>k(ac),{once:!0}));let H=(async function(){let E;try{let A=r?.condition?.(l,{getState:p,extra:f});if(nm(A)&&(A=await A),A===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(w.signal.aborted)throw{name:"AbortError",message:b||"Aborted"};let K=new Promise((U,ye)=>{T=()=>{ye({name:"AbortError",message:b||"Aborted"})},w.signal.addEventListener("abort",T,{once:!0})});u(o(y,l,r?.getPendingMeta?.({requestId:y,arg:l},{getState:p,extra:f}))),E=await Promise.race([K,Promise.resolve(i(l,{dispatch:u,getState:p,extra:f,requestId:y,signal:w.signal,abort:k,rejectWithValue:((U,ye)=>new ha(U,ye)),fulfillWithValue:((U,ye)=>new sc(U,ye))})).then(U=>{if(U instanceof ha)throw U;return U instanceof sc?n(U.payload,y,l,U.meta):n(U,y,l)})])}catch(A){E=A instanceof ha?s(null,y,l,A.payload,A.meta):s(A,y,l)}finally{T&&w.signal.removeEventListener("abort",T)}return r&&!r.dispatchConditionRejection&&s.match(E)&&E.meta.condition||u(E),E})();return Object.assign(H,{abort:k,requestId:y,arg:l,unwrap(){return H.then(rm)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:n,settled:Xh(s,n),typePrefix:e})}return t.withTypes=()=>t,t})();function rm(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function nm(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var uc=Symbol.for("rtk-slice-createasyncthunk"),fy={[uc]:im};function om(t,e){return`${t}/${e}`}function sm({creators:t}={}){let e=t?.asyncThunk?.[uc];return function(r){let{name:n,reducerPath:o=n}=r;if(!n)throw new Error(Bt(11));typeof process<"u";let s=(typeof r.reducers=="function"?r.reducers(lm()):r.reducers)||{},a=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(E,A){let K=typeof E=="string"?E:E.type;if(!K)throw new Error(Bt(12));if(K in l.sliceCaseReducersByType)throw new Error(Bt(13));return l.sliceCaseReducersByType[K]=A,d},addMatcher(E,A){return l.sliceMatchers.push({matcher:E,reducer:A}),d},exposeAction(E,A){return l.actionCreators[E]=A,d},exposeCaseReducer(E,A){return l.sliceCaseReducersByName[E]=A,d}};a.forEach(E=>{let A=s[E],K={reducerName:E,type:om(n,E),createNotation:typeof r.reducers=="function"};dm(A)?pm(K,A,d,e):cm(K,A,d)});function u(){let[E={},A=[],K=void 0]=typeof r.extraReducers=="function"?dc(r.extraReducers):[r.extraReducers],U={...E,...l.sliceCaseReducersByType};return Yh(r.initialState,ye=>{for(let Le in U)ye.addCase(Le,U[Le]);for(let Le of l.sliceMatchers)ye.addMatcher(Le.matcher,Le.reducer);for(let Le of A)ye.addMatcher(Le.matcher,Le.reducer);K&&ye.addDefaultCase(K)})}let p=E=>E,f=new Map,y=new WeakMap,w;function T(E,A){return w||(w=u()),w(E,A)}function b(){return w||(w=u()),w.getInitialState()}function k(E,A=!1){function K(ye){let Le=ye[E];return typeof Le>"u"&&A&&(Le=ao(y,K,b)),Le}function U(ye=p){return ao(ao(f,A,()=>new WeakMap),ye,()=>{let Le={};for(let[Pn,mt]of Object.entries(r.selectors??{}))Le[Pn]=am(mt,ye,()=>ao(y,ye,b),A);return Le})}return{reducerPath:E,getSelectors:U,get selectors(){return U(K)},selectSlice:K}}let H={name:n,reducer:T,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:b,...k(o),injectInto(E,{reducerPath:A,...K}={}){let U=A??o;return E.inject({reducerPath:U,reducer:T},K),{...H,...k(U,!0)}}};return H}}function am(t,e,i,r){function n(o,...s){let a=e(o);return typeof a>"u"&&r&&(a=i()),t(a,...s)}return n.unwrapped=t,n}var pc=sm();function lm(){function t(e,i){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...i}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...i){return e(...i)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,i){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:i}},asyncThunk:t}}function cm({type:t,reducerName:e,createNotation:i},r,n){let o,s;if("reducer"in r){if(i&&!um(r))throw new Error(Bt(17));o=r.reducer,s=r.prepare}else o=r;n.addCase(t,o).exposeCaseReducer(e,o).exposeAction(e,s?fi(t,s):fi(t))}function dm(t){return t._reducerDefinitionType==="asyncThunk"}function um(t){return t._reducerDefinitionType==="reducerWithPrepare"}function pm({type:t,reducerName:e},i,r,n){if(!n)throw new Error(Bt(18));let{payloadCreator:o,fulfilled:s,pending:a,rejected:l,settled:d,options:u}=i,p=n(t,o,u);r.exposeAction(e,p),s&&r.addCase(p.fulfilled,s),a&&r.addCase(p.pending,a),l&&r.addCase(p.rejected,l),d&&r.addMatcher(p.settled,d),r.exposeCaseReducer(e,{fulfilled:s||lo,pending:a||lo,rejected:l||lo,settled:d||lo})}function lo(){}var fc="listener",hc="completed",mc="cancelled",hy=`task-${mc}`,my=`task-${hc}`,gy=`${fc}-${mc}`,yy=`${fc}-${hc}`;var{assign:gc}=Object;var ma="listenerMiddleware";var fm=gc(fi(`${ma}/add`),{withTypes:()=>fm}),vy=fi(`${ma}/removeAll`),hm=gc(fi(`${ma}/remove`),{withTypes:()=>hm});function Bt(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var mm=$n(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(i,r,n){this.eventBus.addEventListener(i,r,n)}dispatchEvent(i){return this.eventBus.dispatchEvent(i)}removeEventListener(i,r,n){this.eventBus.removeEventListener(i,r,n)}}}),co=class extends mm(Object){};window.ftReduxStores||(window.ftReduxStores={});var yc=class t extends co{static get(e){var i;let r=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,o=window.ftReduxStores[r];if(Hn(o))return o;if(n==null)return;let s=pc({...n,reducers:(i=n.reducers)!==null&&i!==void 0?i:{}}),a=cc({reducer:(l,d)=>{if(d.type==="CLEAR_FT_REDUX_STORE"){let u=Zr(s.getInitialState());for(let p of d.keeping)u[p]=(l??u)[p];return u}else if(typeof d.type=="string"&&d.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...d.overwrites};return s.reducer(l,d)}});return window.ftReduxStores[n.name]=new t(s,a,n.eventBus,n.deprecatedKeys)}constructor(e,i,r,n){super(),this.reduxSlice=e,this.reduxStore=i,this.deprecatedKeys=n,this.isFtReduxStore=!0,this.commands=new Fn,this.injectInto=(s,a)=>this.reduxSlice.injectInto(s,a),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let o=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,l)=>{let d=a,u=s[d];return u?(...p)=>{let f=u(...p.map(o));return this.reduxStore.dispatch(f),f}:p=>{let f=d,y=this.getState()[f];cr(y,p)||this.setState({[f]:o(p)})}}}),this.eventBus=r??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var uo=class{static format(e,i,r,n,o){return window.moment?window.moment(e).locale(i).format(this.getMomentDateFormat(r,n,!!o)):this.getIntlDateTime(e,i,r,n,!!o)}static getMomentDateFormat(e,i,r){return r?"LT":e?i?"lll":"ll":i?"L LT":"L"}static getIntlDateTime(e,i,r,n,o){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(i,{dateStyle:r?"medium":"short"}).format(s),l=new Intl.DateTimeFormat(i,{timeStyle:"short"}).format(s);return o?l:n?`${a} ${l}`:a}static getTimezoneAsString(){let e=r=>String(Math.floor(r)).padStart(2,"0"),i=new Date().getTimezoneOffset();return`${i<0?"+":"-"}${e(Math.abs(i)/60)}:${e(Math.abs(i)%60)}`}};var po=c(h()),gm="ft-app-info",st=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};st.eventName="authentication-change";var ki=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ki.eventName="ui-locale-changed";var ym={session:(t,e)=>{(0,po.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>v.dispatchEvent(new st(e.payload)),0))}},v=po.FtReduxStore.get({name:gm,reducers:ym,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var vc=c(h()),fo=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},xc=(0,vc.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...r){super(r),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(v)}dateFormatOptionsChanged(r){return r.has("metadataDescriptors")||r.has("useLongDateFormat")||r.has("useDateTimeFormat")||r.has("uiLocale")}getDateFormatter(r){var n,o;return((o=(n=this.metadataDescriptors.find(a=>a.key===r))===null||n===void 0?void 0:n.date)!==null&&o!==void 0?o:!1)?a=>uo.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return fo([(0,ga.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),fo([(0,ga.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),fo([Zs({store:v.name,selector:i=>{var r,n;return(n=(r=i.metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),fo([Zs({store:v.name})],e.prototype,"uiLocale",void 0),e});var bc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(bc||(bc={}));var Sc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Sc||(Sc={}));var wc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(wc||(wc={}));var Ec;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Ec||(Ec={}));var Ac;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Ac||(Ac={}));var _c;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(_c||(_c={}));var Cc;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(Cc||(Cc={}));var Tc;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Tc||(Tc={}));var Rc;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Rc||(Rc={}));var Oc;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(Oc||(Oc={}));var kc;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER",t.DOC_DIFF="DOC_DIFF"})(kc||(kc={}));var Dc;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(Dc||(Dc={}));var Ic;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Ic||(Ic={}));var Lc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Lc||(Lc={}));var Pc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Pc||(Pc={}));var Ee;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ee||(Ee={}));var Mc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Mc||(Mc={}));var Nc;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Nc||(Nc={}));var $c;(function(t){t.ASC="ASC",t.DESC="DESC"})($c||($c={}));var Fc;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Fc||(Fc={}));var Uc;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Uc||(Uc={}));var Vc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Vc||(Vc={}));var ho;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ho||(ho={}));var Bc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Bc||(Bc={}));var Hc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Hc||(Hc={}));var zc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(zc||(zc={}));var jc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(jc||(jc={}));var Wc;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Wc||(Wc={}));var re;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(re||(re={}));var gt;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(gt||(gt={}));var Kc;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Kc||(Kc={}));var Gc;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Gc||(Gc={}));var qc;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(qc||(qc={}));var Yc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Yc||(Yc={}));var Zc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Zc||(Zc={}));var Xc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Xc||(Xc={}));var Jc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Jc||(Jc={}));var Qc;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(Qc||(Qc={}));var ed;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(ed||(ed={}));var td;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(td||(td={}));var id;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(id||(id={}));var rd;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(rd||(rd={}));var mo;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(mo||(mo={}));var vm={[re.PERSONAL_BOOK_SHARE_USER]:[re.PERSONAL_BOOK_USER],[re.HTML_EXPORT_USER]:[re.PERSONAL_BOOK_USER],[re.PDF_EXPORT_USER]:[re.PERSONAL_BOOK_USER],[re.KHUB_ADMIN]:[re.CONTENT_PUBLISHER],[re.ADMIN]:[re.KHUB_ADMIN,re.USERS_ADMIN,re.PORTAL_ADMIN,re.BEHAVIOR_DATA_USER],[re.GENERATIVE_AI_EXPORT_USER]:[re.GENERATIVE_AI_USER]};function nd(t,e){return t===e||(vm[t]??[]).some(i=>nd(i,e))}function hr(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(r=>nd(r,e))}function od(t,...e){return t==null?!1:e.some(i=>hr(t,i))}var bo=c(h());var ya=c(h());var Ht=class t{static get(e){let{baseUrl:i,apiIntegrationIdentifier:r}=v.getState(),n=e??r;if(i&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,n,!0)}static await(e){return new Promise(i=>{let r=t.get(e);if(r)i(r);else{let n=v.subscribe(()=>{r=t.get(e),r&&(n(),i(r))})}})}};var mr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ht.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ht.await()}};var Oe=class extends mr{constructor(e=!0,i){var r;super(i),this.sortObjectFields=(o,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([a],[l])=>a.localeCompare(l)));let n=this.constructor;n.commonCache=(r=n.commonCache)!==null&&r!==void 0?r:new ya.CacheRegistry,this.cache=e?n.commonCache:new ya.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((i,r)=>0|31*i+r.charCodeAt(0),0))}};var go=class extends Oe{async listMySearches(){let{session:e}=v.getState();return hr(e,re.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var yo=class extends Oe{async listMyBookmarks(){let e=v.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var vo=class extends Oe{constructor(){super(...arguments),this.CACHE_DURATION=180*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=v.getState().session;return!!e?.sessionAuthenticated}};var xo=class extends Oe{constructor(){super(...arguments),this.CACHE_DURATION=180*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=v.getState().session;return!!e?.sessionAuthenticated}};var xm="ft-user-assets",bm={setAssetCount:(t,e)=>{let{userAssetType:i,count:r}=e.payload.assetCount;t.assetCounts.allAsset[i]=r},clearAssetCount:t=>{Object.values(gt).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let i=e.payload.mapId;t.assetCounts.bookmarkByMap[i]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:i,mapId:r,asset:n}=e.payload;xa(t,i,[...va(t,i),n]),sd(t,i,1,r),ad(t,n)},editAsset:(t,e)=>{let{assetType:i,asset:r}=e.payload;xa(t,i,va(t,i).map(n=>n.id===r.id?r:n)),ad(t,r)},removeAsset:(t,e)=>{let{assetType:i,mapId:r,assetId:n}=e.payload;xa(t,i,va(t,i).filter(o=>o.id!==n)),sd(t,i,-1,r)}},ld={[gt.SEARCHES]:"savedSearches",[gt.BOOKMARKS]:"bookmarks",[gt.BOOKS]:void 0,[gt.COLLECTIONS]:void 0},va=(t,e)=>{var i;let r=ld[e];return r?(i=t[r])!==null&&i!==void 0?i:[]:[]},xa=(t,e,i)=>{let r=ld[e];r&&(t[r]=i)},sd=(t,e,i,r)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+i),e===gt.BOOKMARKS&&r)){let o=t.assetCounts.bookmarkByMap[r];t.assetCounts.bookmarkByMap[r]=Math.max(0,o+i)}},ad=(t,e)=>{let i=t.assetLabels.map(n=>n.title),r=e.labels.filter(n=>!i.includes(n)).map(n=>({title:n}));t.assetLabels.push(...r)},Ve=bo.FtReduxStore.get({name:xm,reducers:bm,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(gt).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ba=class{constructor(e=new vo,i=new xo){this.assetCountsService=e,this.assetLabelsService=i,this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new yo,this.savedSearchesService=new go,v.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:i}=v.getState();(0,bo.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,i?.profile)||(this.currentSession=i,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Ve.actions.clearAssetCount(),Ve.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Ve.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Ve.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Ve.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();Ve.actions.assetLabels(e)}async loadAssetCount(e){let i=await this.assetCountsService.getUserAssetCount(e);i&&Ve.getState().assetCounts.allAsset[e]!==i.count&&Ve.actions.setAssetCount({assetCount:i})}async loadBookmarkByMapId(e){let i=await this.assetCountsService.getUserBookmarkCountByMap(e);i&&Ve.getState().assetCounts.bookmarkByMap[e]!==i.count&&Ve.actions.setBookmarkCountByMap({count:i.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let i=Object.keys(Ve.getState().assetCounts.bookmarkByMap).length!==0;e===gt.BOOKMARKS&&i&&Ve.actions.clearBookmarkCountByMap(),Ve.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 i=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Ve.actions.bookmarks(i)}}},Sm=new ba;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Sm);var Sa=class{addCommand(e,i=!1){v.commands.add(e,i)}consumeCommand(e){return v.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Sa;var yt=c(h());var cd,gr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},wm=Symbol("clearAfterUnitTest"),So=class extends(0,yt.withEventBus)(Oe){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[cd]=()=>{this.defaultMessages={},this.cache=new yt.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=v.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let i=e.name.toLowerCase();this.cache.setFinal(i,e),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,i){var r;if(e=e.toLowerCase(),i&&Object.keys(i).length>0){let n={...(r=this.defaultMessages[e])!==null&&r!==void 0?r:{},...i};(0,yt.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var i,r;return this.fetchContext(e),(r=(i=this.cache.getNow(e))===null||i===void 0?void 0:i.messages)!==null&&r!==void 0?r:{}}resolveRawMessage(e,i){let r=e.toLowerCase();return this.resolveContext(r)[i]}resolveMessage(e,i,...r){var n;let o=e.toLowerCase(),s=this.resolveContext(o);return new yt.ParametrizedLabelResolver((n=this.defaultMessages[o])!==null&&n!==void 0?n:{},s).resolve(i,...r)}async fetchContext(e){let i=!this.cache.has(e),r;try{r=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),i&&await this.notify(e)}catch(n){!(n instanceof yt.CanceledPromiseError)&&i&&console.error(n)}return r}subscribe(e,i){var r;return e=e.toLowerCase(),this.listeners[e]=(r=this.listeners[e])!==null&&r!==void 0?r:new Set,this.listeners[e].add(i),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(i)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new gr({loadedContexts:e})),this.dispatchEvent(new gr({loadedContexts:e})),await Promise.all(e.map(i=>this.notify(i,!1)))}async notify(e,i=!0){i&&(document.body.dispatchEvent(new gr({loadedContexts:[e]})),this.dispatchEvent(new gr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>(0,yt.delay)(0).then(()=>r()).catch(()=>null)))}};cd=wm;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends So{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends So{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var yr=window.FluidTopicsI18nService,wo=window.FluidTopicsCustomI18nService;var dd=c(h()),wa=class{highlightHtml(e,i,r){(0,dd.highlightHtml)(e,i,r)}};window.FluidTopicsHighlightHtmlService=new wa;var ud=c(h());var Ea=class{isDate(e){var i,r,n,o;return(o=(r=((n=(i=v.getState().metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===e))===null||r===void 0?void 0:r.date)!==null&&o!==void 0?o:!1}format(e,i){var r,n,o,s;if(e==null)return"";try{return ud.DateFormatter.format(e,(r=i?.locale)!==null&&r!==void 0?r:v.getState().uiLocale,(n=i?.longFormat)!==null&&n!==void 0?n:!1,(o=i?.withTime)!==null&&o!==void 0?o:!1,(s=i?.onlyTime)!==null&&s!==void 0?s:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new Ea;var pd=c(h());var an=class{static get(e,i,{baseUrl:r,localesConfiguration:n,availableContentLocales:o}=v.getState()){var s;if(i==="all"&&n?.allLanguagesAllowed)i=void 0;else if(!i||o.length>0&&!o.some(a=>a.lang===i)){let a=n?.defaultLocales.defaultContentLocale;i=a?`${a.lang}-${a.region}`:(s=o[0])===null||s===void 0?void 0:s.lang}return new pd.SearchPlaceConverter(r,e??20,n?.allLanguagesAllowed,i,o)}};var Aa=class{urlToSearchRequest(e){return an.get().parse(e)}searchRequestToUrl(e){return an.get().serialize(e)}};window.FluidTopicsUrlService=new Aa;var Qt=c(h());var Di=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Di.eventName="before-location-change";var Ii=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Ii.eventName="change";var _a=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let i=sessionStorage.getItem(this.itemName(e));return i?JSON.parse(i):void 0}set(e,i){sessionStorage.setItem(this.itemName(e),JSON.stringify(i))}},fd=new _a;var Eo=class t extends Qt.WithEventBus{static build(){return new t(window.history,fd,()=>window.location,!1)}constructor(e,i,r,n){var o,s;super(),this.history=e,this.historyStorage=i,this.windowLocation=r,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(o=e.state)===null||o===void 0?void 0:o.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,i=!1){let r=i&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,r&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Qt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Ii(this.currentItem())),0)}installProxies(){let e=i=>(r,n,[o,s,a])=>{let l=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),d=new Di(l);this.dispatchEvent(d);let u=i(),p={...u===this.currentIndex?this.currentState:void 0,...o,index:u,href:d.detail.nextLocation.href};r.apply(n,[p,s,p.href]),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 i=this.history.length-1;i>=0;i--)e?this.states[i]=this.historyStorage.get(i):setTimeout(()=>this.states[i]=this.historyStorage.get(i),this.history.length-i)}updateCurrentState(e){var i;let r={...this.buildCurrentState(),...e,index:this.currentIndex,title:(i=e?.title)!==null&&i!==void 0?i:this.currentState.title};this.setCurrentState(r)}addBeforeLocationChangeListener(e){this.addEventListener(Di.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Di.eventName,e)}addHistoryChangeListener(e){this.addEventListener(Ii.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ii.eventName,e)}currentItem(){return(0,Qt.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Qt.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let i=this.states.filter(r=>!!r).filter(r=>r.index<this.currentIndex).reverse();return(0,Qt.deepCopy)(i.find(r=>e(r)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,Qt.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var i;let r=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;if(!r)return e;let n=e,o=e+1;for(;this.states.length>o&&!this.isDifferentMajorState(o,r);)this.hasState(o)&&(n=o),o++;return n}buildCurrentState(){var e,i;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(i=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&i!==void 0?i:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,i){var r;if(!this.hasState(e))return!1;let n=i??this.currentState.majorStateId,o=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;return o==null||o!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Eo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Ao=class{constructor(){this.storeListeners=[]}store(e,i){if(this.isAuthenticated())return;let r=JSON.stringify(i);window.localStorage.setItem(e,r),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:r,storageArea:window.localStorage}))}get(e){var i,r;if(!this.isAuthenticated())return(r=JSON.parse((i=window.localStorage.getItem(e))!==null&&i!==void 0?i:"null"))!==null&&r!==void 0?r:void 0}addStoreListener(e,i){let r=n=>{n.key===e()&&!this.isAuthenticated()&&i()};this.storeListeners.push(r),window.addEventListener("storage",r)}clearStoreListeners(){this.storeListeners.forEach(e=>window.removeEventListener("storage",e)),this.storeListeners.length=0}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var hd=c(S());var md=hd.css`
2
2
  `;var yd=c(S()),Be=c($()),Li=c(h());var zt=c(h());function gd(t,e){let{authenticationRequired:i,session:r}=v.getState();return i&&!r?.sessionAuthenticated?Promise.resolve(e):t()}var _o=class extends mr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Ca=class t extends zt.FtStateManager{static build(e){return new t(v,e)}constructor(e,i){super(),this.store=e,this.cache=new zt.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new _o,this.knownContexts=new zt.AbstractRegistry,this.knownCustomComponents=new zt.AbstractRegistry,this.cleanSessionDebouncer=new zt.Debouncer,this.reloadConfiguration=()=>{var r;(r=this.cache)===null||r===void 0||r.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new zt.Debouncer(500),this.apiProvider=i??(()=>Ht.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(st.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(st.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let i=await this.apiProvider().getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},i.idleTimeoutInMillis),i});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let i=await this.cache.get("availableContentLocales",()=>gd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=i.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,i){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:i}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new ki(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return od(v.getState().session,...e)}},at=Ca.build();var Ae=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},X=class extends Li.FtLitElementRedux{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.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=at,this.contextRoot=new Gr}render(){return yd.html`
3
3
  <slot></slot>
4
4
  `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var i;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(r=>yr.addContext(r)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((i=this.stateManager)===null||i===void 0||i.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};X.elementDefinitions={};X.styles=md;Ae([(0,Be.property)()],X.prototype,"baseUrl",void 0);Ae([(0,Be.property)()],X.prototype,"tenantId",void 0);Ae([(0,Be.property)()],X.prototype,"apiIntegrationIdentifier",void 0);Ae([(0,Be.property)()],X.prototype,"apiIntegrationAppVersion",void 0);Ae([(0,Be.property)()],X.prototype,"uiLocale",void 0);Ae([(0,Li.jsonProperty)(null)],X.prototype,"availableUiLocales",void 0);Ae([(0,Li.jsonProperty)(null)],X.prototype,"metadataConfiguration",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"editorMode",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"noCustom",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"openExternalDocumentInNewTab",void 0);Ae([(0,Be.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],X.prototype,"noCustomComponent",void 0);Ae([(0,Be.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],X.prototype,"noCustomCode",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"withManualResources",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"navigatorOnline",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"forcedOffline",void 0);Ae([(0,Be.property)({type:Boolean})],X.prototype,"authenticationRequired",void 0);Ae([(0,Li.jsonProperty)([])],X.prototype,"messageContexts",void 0);Ae([(0,Li.jsonProperty)(void 0)],X.prototype,"session",void 0);var xd=c(h());var vd={"ft-app-context":X};(0,xd.customElements)(vd);var vr=class extends bd.FtStateManager{constructor(e,i){super(),this.store=e,this.service=i,v.addEventListener(st.eventName,()=>{i.clearCache(),this.clear()})}setZoom(e){this.store.actions.setZoom(e)}setRotation(e){this.store.actions.setRotation(e)}};var wd=c(h()),hi;(function(t){t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.UD_ATTACHMENT="UD_ATTACHMENT",t.RESOURCE="RESOURCE"})(hi||(hi={}));var Sd;(function(t){t.FIT_TO_CONTAINER="fit-to-container",t.ZOOM_REAL_SIZE="zoom-real-size",t.ZOOM_IN="zoom-in",t.ZOOM_OUT="zoom-out",t.ROTATE_LEFT="rotate-left",t.ROTATE_RIGHT="rotate-right"})(Sd||(Sd={}));var Pi=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:(0,wd.deepCopy)(e),composed:!0,bubbles:!0})}};Pi.eventName="ft-viewer-loaded";var Co=class t extends Event{constructor(){super(t.eventName,{composed:!0,bubbles:!0})}};Co.eventName="ft-viewer-not-found";var To=class t extends Event{constructor(){super(t.eventName,{composed:!0,bubbles:!0})}};To.eventName="ft-viewer-unauthorized";var Ro=class t extends Event{constructor(){super(t.eventName,{composed:!0,bubbles:!0})}};Ro.eventName="ft-viewer-forbidden";var Oo=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e,composed:!0,bubbles:!0})}};Oo.eventName="ft-viewer-load-error";function ko(t,e){let i=e;i.status===401?t.dispatchEvent(new To):i.status===403?t.dispatchEvent(new Ro):i.status===404?t.dispatchEvent(new Co):t.dispatchEvent(new Oo(e))}var Do=class extends Oe{getAsset(e,i,r){let n={[hi.MAP_ATTACHMENT]:()=>this.api.getMapAttachment(e,i),[hi.UD_ATTACHMENT]:()=>this.api.getUdAttachment(e,i),[hi.RESOURCE]:()=>this.api.getMapResource(e,i)};return this.cache.get(i,n[r])}makeAbsolute(e){return this.api.makeAbsolute(e)}};var Io=class t extends vr{static build(e){return new t(Nn(e),new Do)}constructor(e,i){super(e,i),this.store=e,this.service=i}async load(){let{documentId:e,assetId:i,origin:r}=this.store.getState();if(e&&i&&r){let n=await this.service.getAsset(e,i,r);this.store.actions.document(n.holder),this.store.actions.descriptor({id:n.id,portalUrl:n.portalUrl,filename:n.filename,fingerprint:n.fingerprint,displayName:n.displayName,alt:n.displayName,mimeType:n.mimeType,size:n.size,viewableInCurrentBrowser:n.viewableInCurrentBrowser,contentUrl:n.contentUrl}),this.store.actions.watermark(n.watermark)}}clear(){this.store.clearKeeping("documentId","assetId","origin")}reload(){return this.clear(),this.load()}async init(e,i,r){return this.store.actions.documentId(e),this.store.actions.assetId(i),this.store.actions.origin(r),await this.reload(),this.store.getState()}};var Lo=c($());var ln=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},ei=class extends xr.FtLitElementRedux{constructor(){super(...arguments),this.viewerStateManager=Io.build(this.id||(0,xr.randomId)(6))}render(){return Ed.html`