@fluid-topics/ft-reader-content 1.3.54 → 1.3.55

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.
@@ -45,7 +45,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
45
45
  input::-webkit-search-results-decoration {
46
46
  display: none;
47
47
  }
48
- `;var xs={};var Un={};D(Un,{ParametrizedLabelResolver:()=>Sr});var Sr=class r{constructor(e,t){this.defaultLabels=e,this.labels=t}resolve(e,...t){var n,a;e=this.resolvePluralKey(e,t);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return r.replaceParameters(i,...t)}static replaceParameters(e,...t){return t.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>r.formatValue(n,s))),e}resolvePluralKey(e,t){for(let n of t)if(typeof n=="number"){let a=`${String(e)}[\\=${n}]`;if(a in this.labels||a in this.defaultLabels)return a}return e}static formatValue(e,t){return e instanceof Date?r.formatDate(e,t):e??""}static formatDate(e,t){let n=a=>t?.includes("date")?e.toLocaleDateString(a):t?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var la={};D(la,{FtCommandQueue:()=>Or,FtLitElementRedux:()=>mt,FtReduxStore:()=>He,FtStateManager:()=>ca,ReduxWatcher:()=>to,clearAllStores:()=>Bu,isFtReduxStore:()=>Bt,redux:()=>j,reduxEventListener:()=>ru,reduxReactive:()=>tu,watch:()=>Hu,withRedux:()=>Ss});var tu=()=>(r,e)=>{var t;let n=r.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(t=n.reduxReactiveProperties)===null||t===void 0||t.add(e)},j=r=>{let e=r??{};return(t,n)=>{var a;let i={hasChanged:ke,attribute:!1,...e};A(i)(t,n);let s=t.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:l=>l[n],store:e.store})}},ru=r=>(e,t)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(t,r)};var Or=class{constructor(){this.queue=[]}add(e,t=!1){t&&this.clear(e.type),this.queue.push(e)}consume(e){let t=this.queue.find(n=>n.type===e);return t&&(this.queue=this.queue.filter(n=>n!==t)),t}clear(e){typeof e=="string"?this.queue=this.queue.filter(t=>t.type!==e):this.queue=this.queue.filter(t=>!e.test(t.type))}};function Bt(r){var e;return(e=r?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Er=Symbol("internalReduxEventsUnsubscribers"),Ye=Symbol("internalStoresUnsubscribers"),gt=Symbol("internalStores"),Ss=X(Symbol("withRedux"),function(r){var e,t,n;class a extends r{constructor(){super(...arguments),this[e]=new Map,this[t]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[gt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[gt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[gt].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[gt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[gt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[gt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let d=this.constructor.getPropertyOptions(l);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:l)){let p=this.getStore(s.store);p&&(s.store?this[Ye].has(s.store):this[Ye].size>0)&&(this[l]=s.selector(p.getState(),this))}})}subscribeToStore(s,l){var d;this[Ye].set(s,l.subscribe(()=>this.updateFromStores())),this[Er].set(s,[]),Bt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||l.name===p.store)){let f=m=>this[h](m);l.addEventListener(p.eventName,f),this[Er].get(s).push(()=>l.removeEventListener(p.eventName,f))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ye].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ye].has(s)&&this[Ye].get(s)(),this[Ye].delete(s),(l=this[Er].get(s))===null||l===void 0||l.forEach(d=>d()),this[Er].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ye,t=gt,n=Er,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),mt=class extends Ss(ee){};function ge(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+r+(t.length?" "+t.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Be(r){return!!r&&!!r[G]}function Oe(r){var e;return!!r&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===du}(r)||Array.isArray(r)||!!r[Is]||!!(!((e=r.constructor)===null||e===void 0)&&e[Is])||Kn(r)||Zn(r))}function yt(r,e,t){t===void 0&&(t=!1),$t(r)===0?(t?Object.keys:Wt)(r).forEach(function(n){t&&typeof n=="symbol"||e(n,r[n],r)}):r.forEach(function(n,a){return e(a,n,r)})}function $t(r){var e=r[G];return e?e.i>3?e.i-4:e.i:Array.isArray(r)?1:Kn(r)?2:Zn(r)?3:0}function Ht(r,e){return $t(r)===2?r.has(e):Object.prototype.hasOwnProperty.call(r,e)}function ou(r,e){return $t(r)===2?r.get(e):r[e]}function Ts(r,e,t){var n=$t(r);n===2?r.set(e,t):n===3?r.add(t):r[e]=t}function _s(r,e){return r===e?r!==0||1/r==1/e:r!=r&&e!=e}function Kn(r){return cu&&r instanceof Map}function Zn(r){return lu&&r instanceof Set}function Je(r){return r.o||r.t}function qn(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var e=Ps(r);delete e[G];for(var t=Wt(e),n=0;n<t.length;n++){var a=t[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:r[a]})}return Object.create(Object.getPrototypeOf(r),e)}function Yn(r,e){return e===void 0&&(e=!1),Jn(r)||Be(r)||!Oe(r)||($t(r)>1&&(r.set=r.add=r.clear=r.delete=nu),Object.freeze(r),e&&yt(r,function(t,n){return Yn(n,!0)},!0)),r}function nu(){ge(2)}function Jn(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function Te(r){var e=Vn[r];return e||ge(18,r),e}function au(r,e){Vn[r]||(Vn[r]=e)}function zn(){return Cr}function Bn(r,e){e&&(Te("Patches"),r.u=[],r.s=[],r.v=e)}function Yr(r){jn(r),r.p.forEach(iu),r.p=null}function jn(r){r===Cr&&(Cr=r.l)}function Os(r){return Cr={p:[],l:Cr,h:r,m:!0,_:0}}function iu(r){var e=r[G];e.i===0||e.i===1?e.j():e.g=!0}function Hn(r,e){e._=e.p.length;var t=e.p[0],n=r!==void 0&&r!==t;return e.h.O||Te("ES5").S(e,r,n),n?(t[G].P&&(Yr(e),ge(4)),Oe(r)&&(r=Jr(e,r),e.l||Qr(e,r)),e.u&&Te("Patches").M(t[G].t,r,e.u,e.s)):r=Jr(e,t,[]),Yr(e),e.u&&e.v(e.u,e.s),r!==Ls?r:void 0}function Jr(r,e,t){if(Jn(e))return e;var n=e[G];if(!n)return yt(e,function(l,d){return Es(r,n,e,l,d,t)},!0),e;if(n.A!==r)return e;if(!n.P)return Qr(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=qn(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),yt(i,function(l,d){return Es(r,n,a,l,d,t,s)}),Qr(r,a,!1),t&&r.u&&Te("Patches").N(n,t,r.u,r.s)}return n.o}function Es(r,e,t,n,a,i,s){if(Be(a)){var l=Jr(r,a,i&&e&&e.i!==3&&!Ht(e.R,n)?i.concat(n):void 0);if(Ts(t,n,l),!Be(l))return;r.m=!1}else s&&t.add(a);if(Oe(a)&&!Jn(a)){if(!r.h.D&&r._<1)return;Jr(r,a),e&&e.A.l||Qr(r,a)}}function Qr(r,e,t){t===void 0&&(t=!1),!r.l&&r.h.D&&r.m&&Yn(e,t)}function Wn(r,e){var t=r[G];return(t?Je(t):r)[e]}function ws(r,e){if(e in r)for(var t=Object.getPrototypeOf(r);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function Qe(r){r.P||(r.P=!0,r.l&&Qe(r.l))}function $n(r){r.o||(r.o=qn(r.t))}function Gn(r,e,t){var n=Kn(e)?Te("MapSet").F(e,t):Zn(e)?Te("MapSet").T(e,t):r.O?function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:zn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},d=l,p=Ar;s&&(d=[l],p=wr);var h=Proxy.revocable(d,p),f=h.revoke,m=h.proxy;return l.k=m,l.j=f,m}(e,t):Te("ES5").J(e,t);return(t?t.A:zn()).p.push(n),n}function su(r){return Be(r)||ge(22,r),function e(t){if(!Oe(t))return t;var n,a=t[G],i=$t(t);if(a){if(!a.P&&(a.i<4||!Te("ES5").K(a)))return a.t;a.I=!0,n=Cs(t,i),a.I=!1}else n=Cs(t,i);return yt(n,function(s,l){a&&ou(a.t,s)===l||Ts(n,s,e(l))}),i===3?new Set(n):n}(r)}function Cs(r,e){switch(e){case 2:return new Map(r);case 3:return Array.from(r)}return qn(r)}function Ns(){function r(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var p=this[G];return Ar.get(p,s)},set:function(p){var h=this[G];Ar.set(h,s,p)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][G];if(!d.P)switch(d.i){case 5:n(d)&&Qe(d);break;case 4:t(d)&&Qe(d)}}}function t(s){for(var l=s.t,d=s.k,p=Wt(d),h=p.length-1;h>=0;h--){var f=p[h];if(f!==G){var m=l[f];if(m===void 0&&!Ht(l,f))return!0;var b=d[f],y=b&&b[G];if(y?y.t!==m:!_s(b,m))return!0}}var E=!!l[G];return p.length!==Wt(l).length+(E?0:1)}function n(s){var l=s.k;if(l.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(l,l.length-1);if(d&&!d.get)return!0;for(var p=0;p<l.length;p++)if(!l.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&ge(3,JSON.stringify(Je(s)))}var i={};au("ES5",{J:function(s,l){var d=Array.isArray(s),p=function(f,m){if(f){for(var b=Array(m.length),y=0;y<m.length;y++)Object.defineProperty(b,""+y,r(y,!0));return b}var E=Ps(m);delete E[G];for(var w=Wt(E),C=0;C<w.length;C++){var R=w[C];E[R]=r(R,f||!!E[R].enumerable)}return Object.create(Object.getPrototypeOf(m),E)}(d,s),h={i:d?5:4,A:l?l.A:zn(),P:!1,I:!1,R:{},l,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,G,{value:h,writable:!0}),p},S:function(s,l,d){d?Be(l)&&l[G].A===s&&e(s.p):(s.u&&function p(h){if(h&&typeof h=="object"){var f=h[G];if(f){var m=f.t,b=f.k,y=f.R,E=f.i;if(E===4)yt(b,function(v){v!==G&&(m[v]!==void 0||Ht(m,v)?y[v]||p(b[v]):(y[v]=!0,Qe(f)))}),yt(m,function(v){b[v]!==void 0||Ht(b,v)||(y[v]=!1,Qe(f))});else if(E===5){if(n(f)&&(Qe(f),y.length=!0),b.length<m.length)for(var w=b.length;w<m.length;w++)y[w]=!1;else for(var C=m.length;C<b.length;C++)y[C]=!0;for(var R=Math.min(b.length,m.length),S=0;S<R;S++)b.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&p(b[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?t(s):n(s)}})}var As,Cr,Qn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",cu=typeof Map<"u",lu=typeof Set<"u",Rs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ls=Qn?Symbol.for("immer-nothing"):((As={})["immer-nothing"]=!0,As),Is=Qn?Symbol.for("immer-draftable"):"__$immer_draftable",G=Qn?Symbol.for("immer-state"):"__$immer_state";var du=""+Object.prototype.constructor,Wt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,Ps=Object.getOwnPropertyDescriptors||function(r){var e={};return Wt(r).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(r,t)}),e},Vn={},Ar={get:function(r,e){if(e===G)return r;var t=Je(r);if(!Ht(t,e))return function(a,i,s){var l,d=ws(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(r,t,e);var n=t[e];return r.I||!Oe(n)?n:n===Wn(r.t,e)?($n(r),r.o[e]=Gn(r.A.h,n,r)):n},has:function(r,e){return e in Je(r)},ownKeys:function(r){return Reflect.ownKeys(Je(r))},set:function(r,e,t){var n=ws(Je(r),e);if(n?.set)return n.set.call(r.k,t),!0;if(!r.P){var a=Wn(Je(r),e),i=a?.[G];if(i&&i.t===t)return r.o[e]=t,r.R[e]=!1,!0;if(_s(t,a)&&(t!==void 0||Ht(r.t,e)))return!0;$n(r),Qe(r)}return r.o[e]===t&&(t!==void 0||e in r.o)||Number.isNaN(t)&&Number.isNaN(r.o[e])||(r.o[e]=t,r.R[e]=!0),!0},deleteProperty:function(r,e){return Wn(r.t,e)!==void 0||e in r.t?(r.R[e]=!1,$n(r),Qe(r)):delete r.R[e],r.o&&delete r.o[e],!0},getOwnPropertyDescriptor:function(r,e){var t=Je(r),n=Reflect.getOwnPropertyDescriptor(t,e);return n&&{writable:!0,configurable:r.i!==1||e!=="length",enumerable:n.enumerable,value:t[e]}},defineProperty:function(){ge(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){ge(12)}},wr={};yt(Ar,function(r,e){wr[r]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),wr.deleteProperty=function(r,e){return wr.set.call(this,r,e,void 0)},wr.set=function(r,e,t){return Ar.set.call(this,r[0],e,t,r[0])};var uu=function(){function r(t){var n=this;this.O=Rs,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var d=n;return function(E){var w=this;E===void 0&&(E=l);for(var C=arguments.length,R=Array(C>1?C-1:0),S=1;S<C;S++)R[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=i).call.apply(O,[w,v].concat(R))})}}var p;if(typeof i!="function"&&ge(6),s!==void 0&&typeof s!="function"&&ge(7),Oe(a)){var h=Os(n),f=Gn(n,a,void 0),m=!0;try{p=i(f),m=!1}finally{m?Yr(h):jn(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(E){return Bn(h,s),Hn(E,h)},function(E){throw Yr(h),E}):(Bn(h,s),Hn(p,h))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===Ls&&(p=void 0),n.D&&Yn(p,!0),s){var b=[],y=[];Te("Patches").M(a,p,b,y),s(b,y)}return p}ge(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var h=arguments.length,f=Array(h>1?h-1:0),m=1;m<h;m++)f[m-1]=arguments[m];return n.produceWithPatches(p,function(b){return a.apply(void 0,[b].concat(f))})};var s,l,d=n.produce(a,i,function(p,h){s=p,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(p){return[p,s,l]}):[d,s,l]},typeof t?.useProxies=="boolean"&&this.setUseProxies(t.useProxies),typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=r.prototype;return e.createDraft=function(t){Oe(t)||ge(8),Be(t)&&(t=su(t));var n=Os(this),a=Gn(this,t,void 0);return a[G].C=!0,jn(n),a},e.finishDraft=function(t,n){var a=t&&t[G],i=a.A;return Bn(i,n),Hn(void 0,i)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!Rs&&ge(20),this.O=t},e.applyPatches=function(t,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}a>-1&&(n=n.slice(a+1));var s=Te("Patches").$;return Be(t)?s(t,n):this.produce(t,function(l){return s(l,n)})},r}(),pe=new uu,pu=pe.produce,Zy=pe.produceWithPatches.bind(pe),qy=pe.setAutoFreeze.bind(pe),Yy=pe.setUseProxies.bind(pe),Jy=pe.applyPatches.bind(pe),Qy=pe.createDraft.bind(pe),Xy=pe.finishDraft.bind(pe),Xr=pu;function bt(r){"@babel/helpers - typeof";return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(r)}function ks(r,e){if(bt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ms(r){var e=ks(r,"string");return bt(e)=="symbol"?e:e+""}function Ds(r,e,t){return(e=Ms(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fs(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Xn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fs(Object(t),!0).forEach(function(n){Ds(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fs(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ne(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var Us=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ea=function(){return Math.random().toString(36).substring(7).split("").join(".")},eo={INIT:"@@redux/INIT"+ea(),REPLACE:"@@redux/REPLACE"+ea(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ea()}};function fu(r){if(typeof r!="object"||r===null)return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function ta(r,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ne(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ne(1));return t(ta)(r,e)}if(typeof r!="function")throw new Error(ne(2));var a=r,i=e,s=[],l=s,d=!1;function p(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(ne(3));return i}function f(E){if(typeof E!="function")throw new Error(ne(4));if(d)throw new Error(ne(5));var w=!0;return p(),l.push(E),function(){if(w){if(d)throw new Error(ne(6));w=!1,p();var R=l.indexOf(E);l.splice(R,1),s=null}}}function m(E){if(!fu(E))throw new Error(ne(7));if(typeof E.type>"u")throw new Error(ne(8));if(d)throw new Error(ne(9));try{d=!0,i=a(i,E)}finally{d=!1}for(var w=s=l,C=0;C<w.length;C++){var R=w[C];R()}return E}function b(E){if(typeof E!="function")throw new Error(ne(10));a=E,m({type:eo.REPLACE})}function y(){var E,w=f;return E={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(ne(11));function S(){R.next&&R.next(h())}S();var v=w(S);return{unsubscribe:v}}},E[Us]=function(){return this},E}return m({type:eo.INIT}),n={dispatch:m,subscribe:f,getState:h,replaceReducer:b},n[Us]=y,n}function hu(r){Object.keys(r).forEach(function(e){var t=r[e],n=t(void 0,{type:eo.INIT});if(typeof n>"u")throw new Error(ne(12));if(typeof t(void 0,{type:eo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ne(13))})}function Bs(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var a=e[n];typeof r[a]=="function"&&(t[a]=r[a])}var i=Object.keys(t),s,l;try{hu(t)}catch(d){l=d}return function(p,h){if(p===void 0&&(p={}),l)throw l;if(0)var f;for(var m=!1,b={},y=0;y<i.length;y++){var E=i[y],w=t[E],C=p[E],R=w(C,h);if(typeof R>"u"){var S=h&&h.type;throw new Error(ne(14))}b[E]=R,m=m||R!==C}return m=m||i.length!==Object.keys(p).length,m?b:p}}function zt(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Hs(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ne(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=zt.apply(void 0,l)(a.dispatch),Xn(Xn({},a),{},{dispatch:i})}}}function Ws(r){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,r):s(l)}}};return e}var $s=Ws();$s.withExtraArgument=Ws;var ra=$s;var Ks=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),gu=function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,a&&(i=p[0]&2?a.return:p[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,p[1])).done)return i;switch(a=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,a=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){t.label=p[1];break}if(p[0]===6&&t.label<i[1]){t.label=i[1],i=p;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(p);break}i[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(h){p=[6,h],a=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},jt=function(r,e){for(var t=0,n=e.length,a=r.length;t<n;t++,a++)r[a]=e[t];return r},mu=Object.defineProperty,yu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,zs=Object.getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,js=function(r,e,t){return e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t},Xe=function(r,e){for(var t in e||(e={}))vu.call(e,t)&&js(r,t,e[t]);if(zs)for(var n=0,a=zs(e);n<a.length;n++){var t=a[n];xu.call(e,t)&&js(r,t,e[t])}return r},oa=function(r,e){return yu(r,bu(e))},Su=function(r,e,t){return new Promise(function(n,a){var i=function(d){try{l(t.next(d))}catch(p){a(p)}},s=function(d){try{l(t.throw(d))}catch(p){a(p)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((t=t.apply(r,e)).next())})};var Ou=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zt:zt.apply(null,arguments)},yb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function Eu(r){if(typeof r!="object"||r===null)return!1;var e=Object.getPrototypeOf(r);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var wu=function(r){Ks(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=r.apply(this,t)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,jt([void 0],t[0].concat(this)))):new(e.bind.apply(e,jt([void 0],t.concat(this))))},e}(Array),Cu=function(r){Ks(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=r.apply(this,t)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,jt([void 0],t[0].concat(this)))):new(e.bind.apply(e,jt([void 0],t.concat(this))))},e}(Array);function ia(r){return Oe(r)?Xr(r,function(){}):r}function Au(r){return typeof r=="boolean"}function Ru(){return function(e){return Iu(e)}}function Iu(r){r===void 0&&(r={});var e=r.thunk,t=e===void 0?!0:e,n=r.immutableCheck,a=n===void 0?!0:n,i=r.serializableCheck,s=i===void 0?!0:i,l=new wu;if(t&&(Au(t)?l.push(ra):l.push(ra.withExtraArgument(t.extraArgument))),0){if(a)var d;if(s)var p}return l}var na=!0;function Zs(r){var e=Ru(),t=r||{},n=t.reducer,a=n===void 0?void 0:n,i=t.middleware,s=i===void 0?e():i,l=t.devTools,d=l===void 0?!0:l,p=t.preloadedState,h=p===void 0?void 0:p,f=t.enhancers,m=f===void 0?void 0:f,b;if(typeof a=="function")b=a;else if(Eu(a))b=Bs(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(e),!na&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!na&&y.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=Hs.apply(void 0,y),w=zt;d&&(w=Ou(Xe({trace:!na},typeof d=="object"&&d)));var C=new Cu(E),R=C;Array.isArray(m)?R=jt([E],m):typeof m=="function"&&(R=m(C));var S=w.apply(void 0,R);return ta(b,h,S)}function et(r,e){function t(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Xe(Xe({type:r,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:r,payload:n[0]}}return t.toString=function(){return""+r},t.type=r,t.match=function(n){return n.type===r},t}function qs(r){var e={},t=[],n,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(l in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[l]=s,a},addMatcher:function(i,s){return t.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return r(a),[e,t,n]}function Tu(r){return typeof r=="function"}function _u(r,e,t,n){t===void 0&&(t=[]);var a=typeof e=="function"?qs(e):[e,t,n],i=a[0],s=a[1],l=a[2],d;if(Tu(r))d=function(){return ia(r())};else{var p=ia(r);d=function(){return p}}function h(f,m){f===void 0&&(f=d());var b=jt([i[m.type]],s.filter(function(y){var E=y.matcher;return E(m)}).map(function(y){var E=y.reducer;return E}));return b.filter(function(y){return!!y}).length===0&&(b=[l]),b.reduce(function(y,E){if(E)if(Be(y)){var w=y,C=E(w,m);return C===void 0?y:C}else{if(Oe(y))return Xr(y,function(R){return E(R,m)});var C=E(y,m);if(C===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}return y},f)}return h.getInitialState=d,h}function Nu(r,e){return r+"/"+e}function Ys(r){var e=r.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof r.initialState=="function"?r.initialState:ia(r.initialState),n=r.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var f=n[h],m=Nu(e,h),b,y;"reducer"in f?(b=f.reducer,y=f.prepare):b=f,i[h]=b,s[m]=b,l[h]=y?et(m,y):et(m)});function d(){var h=typeof r.extraReducers=="function"?qs(r.extraReducers):[r.extraReducers],f=h[0],m=f===void 0?{}:f,b=h[1],y=b===void 0?[]:b,E=h[2],w=E===void 0?void 0:E,C=Xe(Xe({},m),s);return _u(t,function(R){for(var S in C)R.addCase(S,C[S]);for(var v=0,O=y;v<O.length;v++){var _=O[v];R.addMatcher(_.matcher,_.reducer)}w&&R.addDefaultCase(w)})}var p;return{name:e,reducer:function(h,f){return p||(p=d()),p(h,f)},actions:l,caseReducers:i,getInitialState:function(){return p||(p=d()),p.getInitialState()}}}var Lu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Pu=function(r){r===void 0&&(r=21);for(var e="",t=r;t--;)e+=Lu[Math.random()*64|0];return e},ku=["name","message","stack","code"],aa=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Gs=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Mu=function(r){if(typeof r=="object"&&r!==null){for(var e={},t=0,n=ku;t<n.length;t++){var a=n[t];typeof r[a]=="string"&&(e[a]=r[a])}return e}return{message:String(r)}},Sb=function(){function r(e,t,n){var a=et(e+"/fulfilled",function(h,f,m,b){return{payload:h,meta:oa(Xe({},b||{}),{arg:m,requestId:f,requestStatus:"fulfilled"})}}),i=et(e+"/pending",function(h,f,m){return{payload:void 0,meta:oa(Xe({},m||{}),{arg:f,requestId:h,requestStatus:"pending"})}}),s=et(e+"/rejected",function(h,f,m,b,y){return{payload:b,error:(n&&n.serializeError||Mu)(h||"Rejected"),meta:oa(Xe({},y||{}),{arg:m,requestId:f,rejectedWithValue:!!b,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(f,m,b){var y=n?.idGenerator?n.idGenerator(h):Pu(),E=new d,w,C=!1;function R(v){w=v,E.abort()}var S=function(){return Su(this,null,function(){var v,O,_,L,M,P,N;return gu(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),L=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:b}),Fu(L)?[4,L]:[3,2];case 1:L=g.sent(),g.label=2;case 2:if(L===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return C=!0,M=new Promise(function(x,T){return E.signal.addEventListener("abort",function(){return T({name:"AbortError",message:w||"Aborted"})})}),f(i(y,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:y,arg:h},{getState:m,extra:b}))),[4,Promise.race([M,Promise.resolve(t(h,{dispatch:f,getState:m,extra:b,requestId:y,signal:E.signal,abort:R,rejectWithValue:function(x,T){return new aa(x,T)},fulfillWithValue:function(x,T){return new Gs(x,T)}})).then(function(x){if(x instanceof aa)throw x;return x instanceof Gs?a(x.payload,y,h,x.meta):a(x,y,h)})])];case 3:return _=g.sent(),[3,5];case 4:return P=g.sent(),_=P instanceof aa?s(null,y,h,P.payload,P.meta):s(P,y,h),[3,5];case 5:return N=n&&!n.dispatchConditionRejection&&s.match(_)&&_.meta.condition,N||f(_),[2,_]}})})}();return Object.assign(S,{abort:R,requestId:y,arg:h,unwrap:function(){return S.then(Du)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return r.withTypes=function(){return r},r}();function Du(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function Fu(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var Js="listener",Qs="completed",Xs="cancelled",Ob="task-"+Xs,Eb="task-"+Qs,wb=Js+"-"+Xs,Cb=Js+"-"+Qs;var sa="listenerMiddleware";var Ab=et(sa+"/add"),Rb=et(sa+"/removeAll"),Ib=et(sa+"/remove");var Vs,Tb=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(Vs||(Vs=Promise.resolve())).then(r).catch(function(e){return setTimeout(function(){throw e},0)})},Uu=function(r){return function(e){setTimeout(e,r)}},_b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Uu(10);Ns();window.ftReduxStores||(window.ftReduxStores={});var He=class r extends Me{static get(e){var t;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Bt(i))return i;if(a==null)return;let s=Ys({...a,reducers:(t=a.reducers)!==null&&t!==void 0?t:{}}),l=Zs({reducer:(d,p)=>p.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...d,...p.overwrites}:s.reducer(d,p)});return window.ftReduxStores[a.name]=new r(s,l,a.eventBus)}constructor(e,t,n){super(),this.reduxSlice=e,this.reduxStore=t,this.isFtReduxStore=!0,this.commands=new Or;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let d=s,p=i[d];return p?(...h)=>{let f=p(...h.map(a));return this.reduxStore.dispatch(f),f}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Bu(){var r;for(let e of Object.values((r=window.ftReduxStores)!==null&&r!==void 0?r:{}))Bt(e)&&e.clear()}var to=class{constructor(e,t,n){this.store=e,this.valueSelector=t,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),t=this.valueSelector(e);ke(this.lastValue,t)&&(this.callback(t,e),this.lastValue=t)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function Hu(r,e,t){return new to(r,e,t).watch()}var ca=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var t;return(t=this.requestConsumers.get(e))!==null&&t!==void 0?t:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).add(e)}unregisterComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var pa={};D(pa,{scrollHelper:()=>Gt});var da,ro=new Map,ua=class{lock(e,t){if(t){let n=ro.get(t);if(n==null||n===e)return ro.set(t,e),t}}release(e,t){t&&ro.get(t)===e&&ro.delete(t)}findFirstScrollableParent(e){var t;let n,a;for(let i of Yo(e)){let s=i,l=this.elementCanScroll(s);if(l&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else l&&a==null&&(a=s)}return(t=n??a)!==null&&t!==void 0?t:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)}catch{return!1}}getAbsoluteScrollOffset(e,t){var n,a;let i=0;for(;t&&t.offsetParent!==e.offsetParent;)i+=(n=t.offsetTop)!==null&&n!==void 0?n:0,t=t.offsetParent;return i+((a=t?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,t){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return t;default:return 0}}scrollIntoViewIfPossible(e,t){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let a=this.getAbsoluteScrollOffset(n,e),i=a-n.clientHeight+e.clientHeight,s=a,l=dt(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(t?.position,l)*(i-s)+s;n.scrollTo({behavior:t?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(da=window.FluidTopicsScrollHelper)!==null&&da!==void 0?da:new ua;var Gt=window.FluidTopicsScrollHelper;var ha={};D(ha,{SearchPlaceConverter:()=>qt,SearchPlaceQueryParams:()=>H,isSearchPlaceQueryParams:()=>Pc,serializeRequest:()=>ju});var $u=sl(tc(),1);var rc;(function(r){r.black="black",r.green="green",r.blue="blue",r.purple="purple",r.red="red",r.orange="orange",r.yellow="yellow"})(rc||(rc={}));var oc;(function(r){r.OFFICIAL="OFFICIAL",r.PERSONAL="PERSONAL",r.SHARED="SHARED"})(oc||(oc={}));var nc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(nc||(nc={}));var ac;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(ac||(ac={}));var ic;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(ic||(ic={}));var sc;(function(r){r.VALUE="VALUE",r.DATE="DATE",r.RANGE="RANGE"})(sc||(sc={}));var cc;(function(r){r.BOOKMARK__CREATE="BOOKMARK__CREATE",r.BOOKMARK__DELETE="BOOKMARK__DELETE",r.CASE_DEFLECTION__START="CASE_DEFLECTION__START",r.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",r.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",r.CHATBOT__RATE="CHATBOT__RATE",r.COLLECTION__CREATE="COLLECTION__CREATE",r.COLLECTION__UPDATE="COLLECTION__UPDATE",r.COLLECTION__DELETE="COLLECTION__DELETE",r.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",r.DOCUMENT__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",r.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",r.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",r.DOCUMENT__PRINT="DOCUMENT__PRINT",r.DOCUMENT__PROCESS="DOCUMENT__PROCESS",r.DOCUMENT__RATE="DOCUMENT__RATE",r.DOCUMENT__SEARCH="DOCUMENT__SEARCH",r.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",r.DOCUMENT__UNRATE="DOCUMENT__UNRATE",r.FEEDBACK__SEND="FEEDBACK__SEND",r.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",r.AI__RATE="AI__RATE",r.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",r.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",r.KHUB__PROCESS="KHUB__PROCESS",r.KHUB__SEARCH="KHUB__SEARCH",r.LABELS__DOWNLOAD="LABELS__DOWNLOAD",r.LINK__SHARE="LINK__SHARE",r.PAGE__DISPLAY="PAGE__DISPLAY",r.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",r.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",r.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",r.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",r.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",r.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",r.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",r.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",r.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",r.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",r.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",r.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",r.TOPIC__DISPLAY="TOPIC__DISPLAY",r.TOPIC__RATE="TOPIC__RATE",r.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",r.TOPIC__UNRATE="TOPIC__UNRATE",r.USER__LOGIN="USER__LOGIN",r.USER__LOGOUT="USER__LOGOUT",r.HEARTBEAT="HEARTBEAT"})(cc||(cc={}));var lc;(function(r){r.THIRD_PARTY="THIRD_PARTY",r.OFF_THE_GRID="OFF_THE_GRID",r.CONTENT_PACKAGER="CONTENT_PACKAGER",r.PAGES="PAGES",r.DESIGNED_READER="DESIGNED_READER"})(lc||(lc={}));var dc;(function(r){r.HOMEPAGE="HOMEPAGE",r.CUSTOM="CUSTOM",r.HEADER="HEADER",r.READER="READER",r.TOPIC_TEMPLATE="TOPIC_TEMPLATE",r.SEARCH="SEARCH",r.SEARCH_RESULT="SEARCH_RESULT",r.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",r.LINK_PREVIEW="LINK_PREVIEW"})(dc||(dc={}));var uc;(function(r){r.CLASSIC="CLASSIC",r.CUSTOM="CUSTOM",r.DESIGNER="DESIGNER"})(uc||(uc={}));var pc;(function(r){r.AND="AND",r.OR="OR",r.MONOVALUED="MONOVALUED"})(pc||(pc={}));var fc;(function(r){r.NONE="NONE",r.ALPHABET="ALPHABET",r.VERSION="VERSION"})(fc||(fc={}));var hc;(function(r){r.STARS="STARS",r.LIKE="LIKE",r.DICHOTOMOUS="DICHOTOMOUS",r.NO_RATING="NO_RATING"})(hc||(hc={}));var gc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR",r.CUSTOM="CUSTOM"})(gc||(gc={}));var Kt;(function(r){r.OPTIONAL="OPTIONAL",r.MANDATORY="MANDATORY"})(Kt||(Kt={}));var mc;(function(r){r.ASC="ASC",r.DESC="DESC"})(mc||(mc={}));var yc;(function(r){r.ALPHA="ALPHA",r.NATURAL="NATURAL"})(yc||(yc={}));var fa;(function(r){r.EVERYWHERE="EVERYWHERE",r.TITLE_ONLY="TITLE_ONLY",r.NONE="NONE"})(fa||(fa={}));var wc=r=>Object.keys(fa).includes(r);var bc;(function(r){r.ARTICLE="ARTICLE",r.BOOK="BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(bc||(bc={}));var vc;(function(r){r.FLUIDTOPICS="FLUIDTOPICS",r.EXTERNAL="EXTERNAL"})(vc||(vc={}));var xc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.PERSONAL_BOOK="PERSONAL_BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(xc||(xc={}));var Zt;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(Zt||(Zt={}));var Cc=r=>Object.keys(Zt).includes(r);var Sc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.HTML_PACKAGE="HTML_PACKAGE",r.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Sc||(Sc={}));var Oc;(function(r){r.DEFAULT="DEFAULT",r.DOCUMENTS="DOCUMENTS",r.ALL_TOPICS="ALL_TOPICS",r.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Oc||(Oc={}));var Ec;(function(r){r.PLAIN_TEXT="PLAIN_TEXT",r.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",r.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ec||(Ec={}));var $;(function(r){r.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",r.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",r.HTML_EXPORT_USER="HTML_EXPORT_USER",r.PDF_EXPORT_USER="PDF_EXPORT_USER",r.SAVED_SEARCH_USER="SAVED_SEARCH_USER",r.COLLECTION_USER="COLLECTION_USER",r.OFFLINE_USER="OFFLINE_USER",r.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",r.ANALYTICS_USER="ANALYTICS_USER",r.BETA_USER="BETA_USER",r.DEBUG_USER="DEBUG_USER",r.PRINT_USER="PRINT_USER",r.RATING_USER="RATING_USER",r.FEEDBACK_USER="FEEDBACK_USER",r.GENERATIVE_AI_USER="GENERATIVE_AI_USER",r.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",r.CONTENT_PUBLISHER="CONTENT_PUBLISHER",r.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",r.KHUB_ADMIN="KHUB_ADMIN",r.USERS_ADMIN="USERS_ADMIN",r.PORTAL_ADMIN="PORTAL_ADMIN",r.ADMIN="ADMIN"})($||($={}));var me;(function(r){r.SEARCHES="SEARCHES",r.BOOKMARKS="BOOKMARKS",r.BOOKS="BOOKS",r.COLLECTIONS="COLLECTIONS"})(me||(me={}));var Ac;(function(r){r.VALID="VALID",r.INVALID="INVALID"})(Ac||(Ac={}));var Rc;(function(r){r.JSON="JSON",r.TEXT="TEXT"})(Rc||(Rc={}));var Ic;(function(r){r.USER="USER",r.ASSISTANT="ASSISTANT"})(Ic||(Ic={}));var Tc;(function(r){r.TEXT="TEXT",r.HTML="HTML"})(Tc||(Tc={}));var _c;(function(r){r.HTML="HTML",r.MARKDOWN="MARKDOWN"})(_c||(_c={}));var Wu={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function Nc(r,e){return r===e||(Wu[r]??[]).some(t=>Nc(t,e))}function We(r,e){return r==null?!1:(Array.isArray(r)?r:Array.isArray(r.roles)?r.roles:Array.isArray(r.profile?.roles)?r.profile.roles:[]).some(n=>Nc(n,e))}function zu(r){return`"${r}"`}function Lc(r){return r.startsWith('"')&&r.endsWith('"')?r.replace(/(^"+)|("+$)/g,""):r}function ju(r,e){return new qt(r).serialize(e)}var H;(function(r){r.LOCALE="content-lang",r.QUERY="query",r.SCOPE="scope",r.FILTERS="filters",r.VIRTUAL_FIELD="virtual-field",r.PERIOD="period",r.VALUE_FILTERS="value-filters",r.DATE_FILTERS="date-filters",r.RANGE_FILTERS="range-filters",r.SORT="sort",r.PER_PAGE="per-page",r.KEYWORD_MATCH="keyword-match"})(H||(H={}));var Gu=new Set(Object.values(H));function Pc(r){return Gu.has(r)}var qt=class{constructor(e,t=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=t,this.allLanguagesAllowed=n,this.defaultContentLocale=a,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,t){return this.serializeToCurrentPageIfPossible(e,t??"/search")}serializeToCurrentPageIfPossible(e,t){let n=t==null||t.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${t}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,t=!1){var n,a,i,s,l,d,p,h,f,m,b;let y=new URLSearchParams;e.contentLocale?(!t||e.contentLocale!==this.defaultContentLocale)&&y.append(H.LOCALE,e.contentLocale):y.append(H.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&y.append(H.QUERY,e.query);let E=(i=(a=e.metadataFilters)===null||a===void 0?void 0:a.filter(v=>v.valueFilter&&!v.valueFilter.negative))!==null&&i!==void 0?i:[];if(E.length>0){let v=E.map(O=>{var _,L;let M=((L=(_=O.valueFilter)===null||_===void 0?void 0:_.values)!==null&&L!==void 0?L:[]).map(P=>this.escapeFilters(P)).map(P=>zu(Lc(P))).join("_");return`${O.key}~${M}`}).join("*");y.append(H.VALUE_FILTERS,v)}let w=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&l!==void 0?l:[];if(w.length>0){let v=w.map(O=>{var _;return`${O.key}~${(_=O.dateFilter)===null||_===void 0?void 0:_.type.toLowerCase()}`}).join("*");y.append(H.DATE_FILTERS,v)}let C=(p=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&p!==void 0?p:[];if(C.length>0){let v=C.map(O=>{var _,L;return`${O.key}~${(_=O.rangeFilter)===null||_===void 0?void 0:_.from}_${(L=O.rangeFilter)===null||L===void 0?void 0:L.to}`}).join("*");y.append(H.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&y.append(H.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&y.append(H.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&y.append(H.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(f=e.paging)===null||f===void 0?void 0:f.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&y.append(H.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&y.append(H.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let R=(b=e.otherQueryParams)!==null&&b!==void 0?b:{};for(let v in R)y.append(v,R[v]);let S=new Array;return y.forEach((v,O)=>{S.push(this.encodeQueryString(O)+"="+this.encodeQueryString(v))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var t;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(t=this.scopeMapping[i])!==null&&t!==void 0?t:a.scope}}fromURLSearchParams(e){var t,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(C){console.warn("Could not decode search request query params, fallback on raw value",C)}let d=new URLSearchParams(e),p=d.get(H.LOCALE)==="all"?void 0:d.get(H.LOCALE),h=((t=d.get(H.VIRTUAL_FIELD))!==null&&t!==void 0?t:"EVERYWHERE").toUpperCase(),f=(n=d.get(H.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(a=d.get(H.SCOPE))!==null&&a!==void 0?a:"default",b=+((i=d.get(H.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),y=d.get(H.KEYWORD_MATCH),E=y?y.toUpperCase()===Kt.MANDATORY?Kt.MANDATORY:Kt.OPTIONAL:void 0,w={};for(let C of d.keys())Pc(C)||(w[C]=d.get(C));return{contentLocale:p??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(H.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[m])!==null&&l!==void 0?l:"DEFAULT",virtualField:wc(h)?h:"EVERYWHERE",sortId:f,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:dt(1,isNaN(b)?this.defaultPerPage:b,1e3)},keywordMatch:E,otherQueryParams:w}}parseCompatFilters(e){var t,n,a,i,s,l;let d=[];return e.has(H.FILTERS)&&(d=this.parseValueFilters((t=e.get(H.FILTERS))!==null&&t!==void 0?t:"")),(n=e.has(H.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(H.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(H.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(H.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(H.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(t=>t.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],valueFilter:{values:t[1].split("_").map(Lc).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],dateFilter:{type:Zt[t[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],rangeFilter:{from:t[1].split("_")[0],to:t[1].split("_")[1]}}))}escapeFilters(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replaceAll(t,n);return e}superEscapeFilters(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replace(a,t);return e}parseLegacyPeriodFilter(e){if(Cc(e))return[{key:"ft:lastEdition",dateFilter:{type:Zt[e]}}];if(e.startsWith("CUSTOM_")){let[t,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var ma={};D(ma,{toFtFormComponent:()=>Vu});var ga=Symbol("elementInternals"),Vu=X(Symbol("toFtFormComponent"),function(r){class e extends r{static get formAssociated(){return!0}get form(){return this[ga].form}constructor(...n){super(n),this[ga]=this.attachInternals()}setFormValue(n){this[ga].setFormValue(n)}}return e});var ya={};D(ya,{DateFormatter:()=>vt});var vt=class{static format(e,t,n,a){return window.moment?window.moment(e).locale(t).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,t,n,a)}static getMomentDateFormat(e,t){return e?t?"lll":"ll":t?"L LT":"L"}static getIntlDateTime(e,t,n,a){let i=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(t,{dateStyle:n?"medium":"short"}).format(i);if(!a)return s;let l=new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(i);return`${s} ${l}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),t=new Date().getTimezoneOffset();return`${t<0?"+":"-"}${e(Math.abs(t)/60)}:${e(Math.abs(t)%60)}`}};var va={};D(va,{ALL_KEYS_VALUE:()=>ba,SameWindowStorageEvent:()=>Yt});var ba="__all__",Yt=class extends CustomEvent{constructor(e,t,n){super("same-window-storage",{detail:{key:e,oldValue:t,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==ba}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new Yt(t[0],n,t[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new Yt(t[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(r,e,t){Reflect.apply(r,e,t),window.dispatchEvent(new Yt(ba))}});var Sa={};D(Sa,{FocusMainContentEvent:()=>xa});var xa=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var kc={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function Ku(r){(r.key==="Enter"||r.key===" "||r.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=r.key}function Zu(r){window.FluidTopicsA11yHints.isKeyboardNavigation=r.detail==0}document.addEventListener("keydown",Ku);document.addEventListener("click",Zu);var Mc=U`
48
+ `;var xs={};var Un={};D(Un,{ParametrizedLabelResolver:()=>Sr});var Sr=class r{constructor(e,t){this.defaultLabels=e,this.labels=t}resolve(e,...t){var n,a;e=this.resolvePluralKey(e,t);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return r.replaceParameters(i,...t)}static replaceParameters(e,...t){return t.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>r.formatValue(n,s))),e}resolvePluralKey(e,t){for(let n of t)if(typeof n=="number"){let a=`${String(e)}[\\=${n}]`;if(a in this.labels||a in this.defaultLabels)return a}return e}static formatValue(e,t){return e instanceof Date?r.formatDate(e,t):e??""}static formatDate(e,t){let n=a=>t?.includes("date")?e.toLocaleDateString(a):t?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var la={};D(la,{FtCommandQueue:()=>Or,FtLitElementRedux:()=>mt,FtReduxStore:()=>He,FtStateManager:()=>ca,ReduxWatcher:()=>to,clearAllStores:()=>Bu,isFtReduxStore:()=>Bt,redux:()=>j,reduxEventListener:()=>ru,reduxReactive:()=>tu,watch:()=>Hu,withRedux:()=>Ss});var tu=()=>(r,e)=>{var t;let n=r.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(t=n.reduxReactiveProperties)===null||t===void 0||t.add(e)},j=r=>{let e=r??{};return(t,n)=>{var a;let i={hasChanged:ke,attribute:!1,...e};A(i)(t,n);let s=t.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:l=>l[n],store:e.store})}},ru=r=>(e,t)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(t,r)};var Or=class{constructor(){this.queue=[]}add(e,t=!1){t&&this.clear(e.type),this.queue.push(e)}consume(e){let t=this.queue.find(n=>n.type===e);return t&&(this.queue=this.queue.filter(n=>n!==t)),t}clear(e){typeof e=="string"?this.queue=this.queue.filter(t=>t.type!==e):this.queue=this.queue.filter(t=>!e.test(t.type))}};function Bt(r){var e;return(e=r?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Er=Symbol("internalReduxEventsUnsubscribers"),Ye=Symbol("internalStoresUnsubscribers"),gt=Symbol("internalStores"),Ss=X(Symbol("withRedux"),function(r){var e,t,n;class a extends r{constructor(){super(...arguments),this[e]=new Map,this[t]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[gt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[gt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[gt].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[gt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[gt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[gt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let d=this.constructor.getPropertyOptions(l);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:l)){let p=this.getStore(s.store);p&&(s.store?this[Ye].has(s.store):this[Ye].size>0)&&(this[l]=s.selector(p.getState(),this))}})}subscribeToStore(s,l){var d;this[Ye].set(s,l.subscribe(()=>this.updateFromStores())),this[Er].set(s,[]),Bt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||l.name===p.store)){let f=m=>this[h](m);l.addEventListener(p.eventName,f),this[Er].get(s).push(()=>l.removeEventListener(p.eventName,f))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ye].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ye].has(s)&&this[Ye].get(s)(),this[Ye].delete(s),(l=this[Er].get(s))===null||l===void 0||l.forEach(d=>d()),this[Er].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ye,t=gt,n=Er,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),mt=class extends Ss(ee){};function ge(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+r+(t.length?" "+t.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Be(r){return!!r&&!!r[G]}function Oe(r){var e;return!!r&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===du}(r)||Array.isArray(r)||!!r[Is]||!!(!((e=r.constructor)===null||e===void 0)&&e[Is])||Kn(r)||Zn(r))}function yt(r,e,t){t===void 0&&(t=!1),$t(r)===0?(t?Object.keys:Wt)(r).forEach(function(n){t&&typeof n=="symbol"||e(n,r[n],r)}):r.forEach(function(n,a){return e(a,n,r)})}function $t(r){var e=r[G];return e?e.i>3?e.i-4:e.i:Array.isArray(r)?1:Kn(r)?2:Zn(r)?3:0}function Ht(r,e){return $t(r)===2?r.has(e):Object.prototype.hasOwnProperty.call(r,e)}function ou(r,e){return $t(r)===2?r.get(e):r[e]}function Ts(r,e,t){var n=$t(r);n===2?r.set(e,t):n===3?r.add(t):r[e]=t}function _s(r,e){return r===e?r!==0||1/r==1/e:r!=r&&e!=e}function Kn(r){return cu&&r instanceof Map}function Zn(r){return lu&&r instanceof Set}function Je(r){return r.o||r.t}function qn(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var e=Ps(r);delete e[G];for(var t=Wt(e),n=0;n<t.length;n++){var a=t[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:r[a]})}return Object.create(Object.getPrototypeOf(r),e)}function Yn(r,e){return e===void 0&&(e=!1),Jn(r)||Be(r)||!Oe(r)||($t(r)>1&&(r.set=r.add=r.clear=r.delete=nu),Object.freeze(r),e&&yt(r,function(t,n){return Yn(n,!0)},!0)),r}function nu(){ge(2)}function Jn(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function Te(r){var e=Vn[r];return e||ge(18,r),e}function au(r,e){Vn[r]||(Vn[r]=e)}function zn(){return Cr}function Bn(r,e){e&&(Te("Patches"),r.u=[],r.s=[],r.v=e)}function Yr(r){jn(r),r.p.forEach(iu),r.p=null}function jn(r){r===Cr&&(Cr=r.l)}function Os(r){return Cr={p:[],l:Cr,h:r,m:!0,_:0}}function iu(r){var e=r[G];e.i===0||e.i===1?e.j():e.g=!0}function Hn(r,e){e._=e.p.length;var t=e.p[0],n=r!==void 0&&r!==t;return e.h.O||Te("ES5").S(e,r,n),n?(t[G].P&&(Yr(e),ge(4)),Oe(r)&&(r=Jr(e,r),e.l||Qr(e,r)),e.u&&Te("Patches").M(t[G].t,r,e.u,e.s)):r=Jr(e,t,[]),Yr(e),e.u&&e.v(e.u,e.s),r!==Ls?r:void 0}function Jr(r,e,t){if(Jn(e))return e;var n=e[G];if(!n)return yt(e,function(l,d){return Es(r,n,e,l,d,t)},!0),e;if(n.A!==r)return e;if(!n.P)return Qr(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=qn(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),yt(i,function(l,d){return Es(r,n,a,l,d,t,s)}),Qr(r,a,!1),t&&r.u&&Te("Patches").N(n,t,r.u,r.s)}return n.o}function Es(r,e,t,n,a,i,s){if(Be(a)){var l=Jr(r,a,i&&e&&e.i!==3&&!Ht(e.R,n)?i.concat(n):void 0);if(Ts(t,n,l),!Be(l))return;r.m=!1}else s&&t.add(a);if(Oe(a)&&!Jn(a)){if(!r.h.D&&r._<1)return;Jr(r,a),e&&e.A.l||Qr(r,a)}}function Qr(r,e,t){t===void 0&&(t=!1),!r.l&&r.h.D&&r.m&&Yn(e,t)}function Wn(r,e){var t=r[G];return(t?Je(t):r)[e]}function ws(r,e){if(e in r)for(var t=Object.getPrototypeOf(r);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function Qe(r){r.P||(r.P=!0,r.l&&Qe(r.l))}function $n(r){r.o||(r.o=qn(r.t))}function Gn(r,e,t){var n=Kn(e)?Te("MapSet").F(e,t):Zn(e)?Te("MapSet").T(e,t):r.O?function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:zn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},d=l,p=Ar;s&&(d=[l],p=wr);var h=Proxy.revocable(d,p),f=h.revoke,m=h.proxy;return l.k=m,l.j=f,m}(e,t):Te("ES5").J(e,t);return(t?t.A:zn()).p.push(n),n}function su(r){return Be(r)||ge(22,r),function e(t){if(!Oe(t))return t;var n,a=t[G],i=$t(t);if(a){if(!a.P&&(a.i<4||!Te("ES5").K(a)))return a.t;a.I=!0,n=Cs(t,i),a.I=!1}else n=Cs(t,i);return yt(n,function(s,l){a&&ou(a.t,s)===l||Ts(n,s,e(l))}),i===3?new Set(n):n}(r)}function Cs(r,e){switch(e){case 2:return new Map(r);case 3:return Array.from(r)}return qn(r)}function Ns(){function r(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var p=this[G];return Ar.get(p,s)},set:function(p){var h=this[G];Ar.set(h,s,p)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][G];if(!d.P)switch(d.i){case 5:n(d)&&Qe(d);break;case 4:t(d)&&Qe(d)}}}function t(s){for(var l=s.t,d=s.k,p=Wt(d),h=p.length-1;h>=0;h--){var f=p[h];if(f!==G){var m=l[f];if(m===void 0&&!Ht(l,f))return!0;var b=d[f],y=b&&b[G];if(y?y.t!==m:!_s(b,m))return!0}}var E=!!l[G];return p.length!==Wt(l).length+(E?0:1)}function n(s){var l=s.k;if(l.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(l,l.length-1);if(d&&!d.get)return!0;for(var p=0;p<l.length;p++)if(!l.hasOwnProperty(p))return!0;return!1}function a(s){s.g&&ge(3,JSON.stringify(Je(s)))}var i={};au("ES5",{J:function(s,l){var d=Array.isArray(s),p=function(f,m){if(f){for(var b=Array(m.length),y=0;y<m.length;y++)Object.defineProperty(b,""+y,r(y,!0));return b}var E=Ps(m);delete E[G];for(var w=Wt(E),C=0;C<w.length;C++){var R=w[C];E[R]=r(R,f||!!E[R].enumerable)}return Object.create(Object.getPrototypeOf(m),E)}(d,s),h={i:d?5:4,A:l?l.A:zn(),P:!1,I:!1,R:{},l,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,G,{value:h,writable:!0}),p},S:function(s,l,d){d?Be(l)&&l[G].A===s&&e(s.p):(s.u&&function p(h){if(h&&typeof h=="object"){var f=h[G];if(f){var m=f.t,b=f.k,y=f.R,E=f.i;if(E===4)yt(b,function(v){v!==G&&(m[v]!==void 0||Ht(m,v)?y[v]||p(b[v]):(y[v]=!0,Qe(f)))}),yt(m,function(v){b[v]!==void 0||Ht(b,v)||(y[v]=!1,Qe(f))});else if(E===5){if(n(f)&&(Qe(f),y.length=!0),b.length<m.length)for(var w=b.length;w<m.length;w++)y[w]=!1;else for(var C=m.length;C<b.length;C++)y[C]=!0;for(var R=Math.min(b.length,m.length),S=0;S<R;S++)b.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&p(b[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?t(s):n(s)}})}var As,Cr,Qn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",cu=typeof Map<"u",lu=typeof Set<"u",Rs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ls=Qn?Symbol.for("immer-nothing"):((As={})["immer-nothing"]=!0,As),Is=Qn?Symbol.for("immer-draftable"):"__$immer_draftable",G=Qn?Symbol.for("immer-state"):"__$immer_state";var du=""+Object.prototype.constructor,Wt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,Ps=Object.getOwnPropertyDescriptors||function(r){var e={};return Wt(r).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(r,t)}),e},Vn={},Ar={get:function(r,e){if(e===G)return r;var t=Je(r);if(!Ht(t,e))return function(a,i,s){var l,d=ws(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(r,t,e);var n=t[e];return r.I||!Oe(n)?n:n===Wn(r.t,e)?($n(r),r.o[e]=Gn(r.A.h,n,r)):n},has:function(r,e){return e in Je(r)},ownKeys:function(r){return Reflect.ownKeys(Je(r))},set:function(r,e,t){var n=ws(Je(r),e);if(n?.set)return n.set.call(r.k,t),!0;if(!r.P){var a=Wn(Je(r),e),i=a?.[G];if(i&&i.t===t)return r.o[e]=t,r.R[e]=!1,!0;if(_s(t,a)&&(t!==void 0||Ht(r.t,e)))return!0;$n(r),Qe(r)}return r.o[e]===t&&(t!==void 0||e in r.o)||Number.isNaN(t)&&Number.isNaN(r.o[e])||(r.o[e]=t,r.R[e]=!0),!0},deleteProperty:function(r,e){return Wn(r.t,e)!==void 0||e in r.t?(r.R[e]=!1,$n(r),Qe(r)):delete r.R[e],r.o&&delete r.o[e],!0},getOwnPropertyDescriptor:function(r,e){var t=Je(r),n=Reflect.getOwnPropertyDescriptor(t,e);return n&&{writable:!0,configurable:r.i!==1||e!=="length",enumerable:n.enumerable,value:t[e]}},defineProperty:function(){ge(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){ge(12)}},wr={};yt(Ar,function(r,e){wr[r]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),wr.deleteProperty=function(r,e){return wr.set.call(this,r,e,void 0)},wr.set=function(r,e,t){return Ar.set.call(this,r[0],e,t,r[0])};var uu=function(){function r(t){var n=this;this.O=Rs,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var d=n;return function(E){var w=this;E===void 0&&(E=l);for(var C=arguments.length,R=Array(C>1?C-1:0),S=1;S<C;S++)R[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=i).call.apply(O,[w,v].concat(R))})}}var p;if(typeof i!="function"&&ge(6),s!==void 0&&typeof s!="function"&&ge(7),Oe(a)){var h=Os(n),f=Gn(n,a,void 0),m=!0;try{p=i(f),m=!1}finally{m?Yr(h):jn(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(E){return Bn(h,s),Hn(E,h)},function(E){throw Yr(h),E}):(Bn(h,s),Hn(p,h))}if(!a||typeof a!="object"){if((p=i(a))===void 0&&(p=a),p===Ls&&(p=void 0),n.D&&Yn(p,!0),s){var b=[],y=[];Te("Patches").M(a,p,b,y),s(b,y)}return p}ge(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(p){for(var h=arguments.length,f=Array(h>1?h-1:0),m=1;m<h;m++)f[m-1]=arguments[m];return n.produceWithPatches(p,function(b){return a.apply(void 0,[b].concat(f))})};var s,l,d=n.produce(a,i,function(p,h){s=p,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(p){return[p,s,l]}):[d,s,l]},typeof t?.useProxies=="boolean"&&this.setUseProxies(t.useProxies),typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=r.prototype;return e.createDraft=function(t){Oe(t)||ge(8),Be(t)&&(t=su(t));var n=Os(this),a=Gn(this,t,void 0);return a[G].C=!0,jn(n),a},e.finishDraft=function(t,n){var a=t&&t[G],i=a.A;return Bn(i,n),Hn(void 0,i)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!Rs&&ge(20),this.O=t},e.applyPatches=function(t,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}a>-1&&(n=n.slice(a+1));var s=Te("Patches").$;return Be(t)?s(t,n):this.produce(t,function(l){return s(l,n)})},r}(),pe=new uu,pu=pe.produce,Zy=pe.produceWithPatches.bind(pe),qy=pe.setAutoFreeze.bind(pe),Yy=pe.setUseProxies.bind(pe),Jy=pe.applyPatches.bind(pe),Qy=pe.createDraft.bind(pe),Xy=pe.finishDraft.bind(pe),Xr=pu;function bt(r){"@babel/helpers - typeof";return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(r)}function ks(r,e){if(bt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ms(r){var e=ks(r,"string");return bt(e)=="symbol"?e:e+""}function Ds(r,e,t){return(e=Ms(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fs(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Xn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fs(Object(t),!0).forEach(function(n){Ds(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fs(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ne(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var Us=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ea=function(){return Math.random().toString(36).substring(7).split("").join(".")},eo={INIT:"@@redux/INIT"+ea(),REPLACE:"@@redux/REPLACE"+ea(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ea()}};function fu(r){if(typeof r!="object"||r===null)return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function ta(r,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ne(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ne(1));return t(ta)(r,e)}if(typeof r!="function")throw new Error(ne(2));var a=r,i=e,s=[],l=s,d=!1;function p(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(ne(3));return i}function f(E){if(typeof E!="function")throw new Error(ne(4));if(d)throw new Error(ne(5));var w=!0;return p(),l.push(E),function(){if(w){if(d)throw new Error(ne(6));w=!1,p();var R=l.indexOf(E);l.splice(R,1),s=null}}}function m(E){if(!fu(E))throw new Error(ne(7));if(typeof E.type>"u")throw new Error(ne(8));if(d)throw new Error(ne(9));try{d=!0,i=a(i,E)}finally{d=!1}for(var w=s=l,C=0;C<w.length;C++){var R=w[C];R()}return E}function b(E){if(typeof E!="function")throw new Error(ne(10));a=E,m({type:eo.REPLACE})}function y(){var E,w=f;return E={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(ne(11));function S(){R.next&&R.next(h())}S();var v=w(S);return{unsubscribe:v}}},E[Us]=function(){return this},E}return m({type:eo.INIT}),n={dispatch:m,subscribe:f,getState:h,replaceReducer:b},n[Us]=y,n}function hu(r){Object.keys(r).forEach(function(e){var t=r[e],n=t(void 0,{type:eo.INIT});if(typeof n>"u")throw new Error(ne(12));if(typeof t(void 0,{type:eo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ne(13))})}function Bs(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var a=e[n];typeof r[a]=="function"&&(t[a]=r[a])}var i=Object.keys(t),s,l;try{hu(t)}catch(d){l=d}return function(p,h){if(p===void 0&&(p={}),l)throw l;if(0)var f;for(var m=!1,b={},y=0;y<i.length;y++){var E=i[y],w=t[E],C=p[E],R=w(C,h);if(typeof R>"u"){var S=h&&h.type;throw new Error(ne(14))}b[E]=R,m=m||R!==C}return m=m||i.length!==Object.keys(p).length,m?b:p}}function zt(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Hs(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ne(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=zt.apply(void 0,l)(a.dispatch),Xn(Xn({},a),{},{dispatch:i})}}}function Ws(r){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,r):s(l)}}};return e}var $s=Ws();$s.withExtraArgument=Ws;var ra=$s;var Ks=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),gu=function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,a&&(i=p[0]&2?a.return:p[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,p[1])).done)return i;switch(a=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,a=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){t.label=p[1];break}if(p[0]===6&&t.label<i[1]){t.label=i[1],i=p;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(p);break}i[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(h){p=[6,h],a=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},jt=function(r,e){for(var t=0,n=e.length,a=r.length;t<n;t++,a++)r[a]=e[t];return r},mu=Object.defineProperty,yu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,zs=Object.getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,js=function(r,e,t){return e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t},Xe=function(r,e){for(var t in e||(e={}))vu.call(e,t)&&js(r,t,e[t]);if(zs)for(var n=0,a=zs(e);n<a.length;n++){var t=a[n];xu.call(e,t)&&js(r,t,e[t])}return r},oa=function(r,e){return yu(r,bu(e))},Su=function(r,e,t){return new Promise(function(n,a){var i=function(d){try{l(t.next(d))}catch(p){a(p)}},s=function(d){try{l(t.throw(d))}catch(p){a(p)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((t=t.apply(r,e)).next())})};var Ou=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zt:zt.apply(null,arguments)},yb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function Eu(r){if(typeof r!="object"||r===null)return!1;var e=Object.getPrototypeOf(r);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var wu=function(r){Ks(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=r.apply(this,t)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,jt([void 0],t[0].concat(this)))):new(e.bind.apply(e,jt([void 0],t.concat(this))))},e}(Array),Cu=function(r){Ks(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=r.apply(this,t)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,jt([void 0],t[0].concat(this)))):new(e.bind.apply(e,jt([void 0],t.concat(this))))},e}(Array);function ia(r){return Oe(r)?Xr(r,function(){}):r}function Au(r){return typeof r=="boolean"}function Ru(){return function(e){return Iu(e)}}function Iu(r){r===void 0&&(r={});var e=r.thunk,t=e===void 0?!0:e,n=r.immutableCheck,a=n===void 0?!0:n,i=r.serializableCheck,s=i===void 0?!0:i,l=new wu;if(t&&(Au(t)?l.push(ra):l.push(ra.withExtraArgument(t.extraArgument))),0){if(a)var d;if(s)var p}return l}var na=!0;function Zs(r){var e=Ru(),t=r||{},n=t.reducer,a=n===void 0?void 0:n,i=t.middleware,s=i===void 0?e():i,l=t.devTools,d=l===void 0?!0:l,p=t.preloadedState,h=p===void 0?void 0:p,f=t.enhancers,m=f===void 0?void 0:f,b;if(typeof a=="function")b=a;else if(Eu(a))b=Bs(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(e),!na&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!na&&y.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=Hs.apply(void 0,y),w=zt;d&&(w=Ou(Xe({trace:!na},typeof d=="object"&&d)));var C=new Cu(E),R=C;Array.isArray(m)?R=jt([E],m):typeof m=="function"&&(R=m(C));var S=w.apply(void 0,R);return ta(b,h,S)}function et(r,e){function t(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Xe(Xe({type:r,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:r,payload:n[0]}}return t.toString=function(){return""+r},t.type=r,t.match=function(n){return n.type===r},t}function qs(r){var e={},t=[],n,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(l in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[l]=s,a},addMatcher:function(i,s){return t.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return r(a),[e,t,n]}function Tu(r){return typeof r=="function"}function _u(r,e,t,n){t===void 0&&(t=[]);var a=typeof e=="function"?qs(e):[e,t,n],i=a[0],s=a[1],l=a[2],d;if(Tu(r))d=function(){return ia(r())};else{var p=ia(r);d=function(){return p}}function h(f,m){f===void 0&&(f=d());var b=jt([i[m.type]],s.filter(function(y){var E=y.matcher;return E(m)}).map(function(y){var E=y.reducer;return E}));return b.filter(function(y){return!!y}).length===0&&(b=[l]),b.reduce(function(y,E){if(E)if(Be(y)){var w=y,C=E(w,m);return C===void 0?y:C}else{if(Oe(y))return Xr(y,function(R){return E(R,m)});var C=E(y,m);if(C===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}return y},f)}return h.getInitialState=d,h}function Nu(r,e){return r+"/"+e}function Ys(r){var e=r.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof r.initialState=="function"?r.initialState:ia(r.initialState),n=r.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var f=n[h],m=Nu(e,h),b,y;"reducer"in f?(b=f.reducer,y=f.prepare):b=f,i[h]=b,s[m]=b,l[h]=y?et(m,y):et(m)});function d(){var h=typeof r.extraReducers=="function"?qs(r.extraReducers):[r.extraReducers],f=h[0],m=f===void 0?{}:f,b=h[1],y=b===void 0?[]:b,E=h[2],w=E===void 0?void 0:E,C=Xe(Xe({},m),s);return _u(t,function(R){for(var S in C)R.addCase(S,C[S]);for(var v=0,O=y;v<O.length;v++){var _=O[v];R.addMatcher(_.matcher,_.reducer)}w&&R.addDefaultCase(w)})}var p;return{name:e,reducer:function(h,f){return p||(p=d()),p(h,f)},actions:l,caseReducers:i,getInitialState:function(){return p||(p=d()),p.getInitialState()}}}var Lu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Pu=function(r){r===void 0&&(r=21);for(var e="",t=r;t--;)e+=Lu[Math.random()*64|0];return e},ku=["name","message","stack","code"],aa=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Gs=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Mu=function(r){if(typeof r=="object"&&r!==null){for(var e={},t=0,n=ku;t<n.length;t++){var a=n[t];typeof r[a]=="string"&&(e[a]=r[a])}return e}return{message:String(r)}},Sb=function(){function r(e,t,n){var a=et(e+"/fulfilled",function(h,f,m,b){return{payload:h,meta:oa(Xe({},b||{}),{arg:m,requestId:f,requestStatus:"fulfilled"})}}),i=et(e+"/pending",function(h,f,m){return{payload:void 0,meta:oa(Xe({},m||{}),{arg:f,requestId:h,requestStatus:"pending"})}}),s=et(e+"/rejected",function(h,f,m,b,y){return{payload:b,error:(n&&n.serializeError||Mu)(h||"Rejected"),meta:oa(Xe({},y||{}),{arg:m,requestId:f,rejectedWithValue:!!b,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(f,m,b){var y=n?.idGenerator?n.idGenerator(h):Pu(),E=new d,w,C=!1;function R(v){w=v,E.abort()}var S=function(){return Su(this,null,function(){var v,O,_,L,M,P,N;return gu(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),L=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:b}),Fu(L)?[4,L]:[3,2];case 1:L=g.sent(),g.label=2;case 2:if(L===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return C=!0,M=new Promise(function(x,T){return E.signal.addEventListener("abort",function(){return T({name:"AbortError",message:w||"Aborted"})})}),f(i(y,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:y,arg:h},{getState:m,extra:b}))),[4,Promise.race([M,Promise.resolve(t(h,{dispatch:f,getState:m,extra:b,requestId:y,signal:E.signal,abort:R,rejectWithValue:function(x,T){return new aa(x,T)},fulfillWithValue:function(x,T){return new Gs(x,T)}})).then(function(x){if(x instanceof aa)throw x;return x instanceof Gs?a(x.payload,y,h,x.meta):a(x,y,h)})])];case 3:return _=g.sent(),[3,5];case 4:return P=g.sent(),_=P instanceof aa?s(null,y,h,P.payload,P.meta):s(P,y,h),[3,5];case 5:return N=n&&!n.dispatchConditionRejection&&s.match(_)&&_.meta.condition,N||f(_),[2,_]}})})}();return Object.assign(S,{abort:R,requestId:y,arg:h,unwrap:function(){return S.then(Du)}})}}return Object.assign(p,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return r.withTypes=function(){return r},r}();function Du(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function Fu(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var Js="listener",Qs="completed",Xs="cancelled",Ob="task-"+Xs,Eb="task-"+Qs,wb=Js+"-"+Xs,Cb=Js+"-"+Qs;var sa="listenerMiddleware";var Ab=et(sa+"/add"),Rb=et(sa+"/removeAll"),Ib=et(sa+"/remove");var Vs,Tb=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(Vs||(Vs=Promise.resolve())).then(r).catch(function(e){return setTimeout(function(){throw e},0)})},Uu=function(r){return function(e){setTimeout(e,r)}},_b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Uu(10);Ns();window.ftReduxStores||(window.ftReduxStores={});var He=class r extends Me{static get(e){var t;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Bt(i))return i;if(a==null)return;let s=Ys({...a,reducers:(t=a.reducers)!==null&&t!==void 0?t:{}}),l=Zs({reducer:(d,p)=>p.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...d,...p.overwrites}:s.reducer(d,p)});return window.ftReduxStores[a.name]=new r(s,l,a.eventBus)}constructor(e,t,n){super(),this.reduxSlice=e,this.reduxStore=t,this.isFtReduxStore=!0,this.commands=new Or;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let d=s,p=i[d];return p?(...h)=>{let f=p(...h.map(a));return this.reduxStore.dispatch(f),f}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Bu(){var r;for(let e of Object.values((r=window.ftReduxStores)!==null&&r!==void 0?r:{}))Bt(e)&&e.clear()}var to=class{constructor(e,t,n){this.store=e,this.valueSelector=t,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),t=this.valueSelector(e);ke(this.lastValue,t)&&(this.callback(t,e),this.lastValue=t)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function Hu(r,e,t){return new to(r,e,t).watch()}var ca=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var t;return(t=this.requestConsumers.get(e))!==null&&t!==void 0?t:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).add(e)}unregisterComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var pa={};D(pa,{scrollHelper:()=>Gt});var da,ro=new Map,ua=class{lock(e,t){if(t){let n=ro.get(t);if(n==null||n===e)return ro.set(t,e),t}}release(e,t){t&&ro.get(t)===e&&ro.delete(t)}findFirstScrollableParent(e){var t;let n,a;for(let i of Yo(e)){let s=i,l=this.elementCanScroll(s);if(l&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else l&&a==null&&(a=s)}return(t=n??a)!==null&&t!==void 0?t:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)}catch{return!1}}getAbsoluteScrollOffset(e,t){var n,a;let i=0;for(;t&&t.offsetParent!==e.offsetParent;)i+=(n=t.offsetTop)!==null&&n!==void 0?n:0,t=t.offsetParent;return i+((a=t?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,t){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return t;default:return 0}}scrollIntoViewIfPossible(e,t){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let a=this.getAbsoluteScrollOffset(n,e),i=a-n.clientHeight+e.clientHeight,s=a,l=dt(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(t?.position,l)*(i-s)+s;n.scrollTo({behavior:t?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(da=window.FluidTopicsScrollHelper)!==null&&da!==void 0?da:new ua;var Gt=window.FluidTopicsScrollHelper;var ha={};D(ha,{SearchPlaceConverter:()=>qt,SearchPlaceQueryParams:()=>H,isSearchPlaceQueryParams:()=>kc,serializeRequest:()=>ju});var $u=sl(tc(),1);var rc;(function(r){r.black="black",r.green="green",r.blue="blue",r.purple="purple",r.red="red",r.orange="orange",r.yellow="yellow"})(rc||(rc={}));var oc;(function(r){r.OFFICIAL="OFFICIAL",r.PERSONAL="PERSONAL",r.SHARED="SHARED"})(oc||(oc={}));var nc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(nc||(nc={}));var ac;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(ac||(ac={}));var ic;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(ic||(ic={}));var sc;(function(r){r.VALUE="VALUE",r.DATE="DATE",r.RANGE="RANGE"})(sc||(sc={}));var cc;(function(r){r.BOOKMARK__CREATE="BOOKMARK__CREATE",r.BOOKMARK__DELETE="BOOKMARK__DELETE",r.CASE_DEFLECTION__START="CASE_DEFLECTION__START",r.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",r.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",r.CHATBOT__RATE="CHATBOT__RATE",r.COLLECTION__CREATE="COLLECTION__CREATE",r.COLLECTION__UPDATE="COLLECTION__UPDATE",r.COLLECTION__DELETE="COLLECTION__DELETE",r.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",r.DOCUMENT__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",r.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",r.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",r.DOCUMENT__PRINT="DOCUMENT__PRINT",r.DOCUMENT__PROCESS="DOCUMENT__PROCESS",r.DOCUMENT__RATE="DOCUMENT__RATE",r.DOCUMENT__SEARCH="DOCUMENT__SEARCH",r.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",r.DOCUMENT__UNRATE="DOCUMENT__UNRATE",r.FEEDBACK__SEND="FEEDBACK__SEND",r.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",r.AI__RATE="AI__RATE",r.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",r.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",r.KHUB__PROCESS="KHUB__PROCESS",r.KHUB__SEARCH="KHUB__SEARCH",r.LABELS__DOWNLOAD="LABELS__DOWNLOAD",r.LINK__SHARE="LINK__SHARE",r.PAGE__DISPLAY="PAGE__DISPLAY",r.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",r.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",r.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",r.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",r.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",r.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",r.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",r.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",r.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",r.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",r.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",r.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",r.TOPIC__DISPLAY="TOPIC__DISPLAY",r.TOPIC__RATE="TOPIC__RATE",r.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",r.TOPIC__UNRATE="TOPIC__UNRATE",r.USER__LOGIN="USER__LOGIN",r.USER__LOGOUT="USER__LOGOUT",r.HEARTBEAT="HEARTBEAT"})(cc||(cc={}));var lc;(function(r){r.THIRD_PARTY="THIRD_PARTY",r.OFF_THE_GRID="OFF_THE_GRID",r.CONTENT_PACKAGER="CONTENT_PACKAGER",r.PAGES="PAGES",r.DESIGNED_READER="DESIGNED_READER"})(lc||(lc={}));var dc;(function(r){r.HOMEPAGE="HOMEPAGE",r.CUSTOM="CUSTOM",r.HEADER="HEADER",r.READER="READER",r.TOPIC_TEMPLATE="TOPIC_TEMPLATE",r.SEARCH="SEARCH",r.SEARCH_RESULT="SEARCH_RESULT",r.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",r.LINK_PREVIEW="LINK_PREVIEW"})(dc||(dc={}));var uc;(function(r){r.CLASSIC="CLASSIC",r.CUSTOM="CUSTOM",r.DESIGNER="DESIGNER"})(uc||(uc={}));var pc;(function(r){r.AND="AND",r.OR="OR",r.MONOVALUED="MONOVALUED"})(pc||(pc={}));var fc;(function(r){r.NONE="NONE",r.ALPHABET="ALPHABET",r.VERSION="VERSION"})(fc||(fc={}));var hc;(function(r){r.STARS="STARS",r.LIKE="LIKE",r.DICHOTOMOUS="DICHOTOMOUS",r.NO_RATING="NO_RATING"})(hc||(hc={}));var gc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR",r.CUSTOM="CUSTOM"})(gc||(gc={}));var Kt;(function(r){r.OPTIONAL="OPTIONAL",r.MANDATORY="MANDATORY"})(Kt||(Kt={}));var mc;(function(r){r.ASC="ASC",r.DESC="DESC"})(mc||(mc={}));var yc;(function(r){r.ALPHA="ALPHA",r.NATURAL="NATURAL"})(yc||(yc={}));var fa;(function(r){r.EVERYWHERE="EVERYWHERE",r.TITLE_ONLY="TITLE_ONLY",r.NONE="NONE"})(fa||(fa={}));var Cc=r=>Object.keys(fa).includes(r);var bc;(function(r){r.ARTICLE="ARTICLE",r.BOOK="BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(bc||(bc={}));var vc;(function(r){r.FLUIDTOPICS="FLUIDTOPICS",r.EXTERNAL="EXTERNAL"})(vc||(vc={}));var xc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.PERSONAL_BOOK="PERSONAL_BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(xc||(xc={}));var Zt;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(Zt||(Zt={}));var Ac=r=>Object.keys(Zt).includes(r);var Sc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.HTML_PACKAGE="HTML_PACKAGE",r.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Sc||(Sc={}));var Oc;(function(r){r.DEFAULT="DEFAULT",r.DOCUMENTS="DOCUMENTS",r.ALL_TOPICS="ALL_TOPICS",r.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Oc||(Oc={}));var Ec;(function(r){r.PLAIN_TEXT="PLAIN_TEXT",r.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",r.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ec||(Ec={}));var $;(function(r){r.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",r.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",r.HTML_EXPORT_USER="HTML_EXPORT_USER",r.PDF_EXPORT_USER="PDF_EXPORT_USER",r.SAVED_SEARCH_USER="SAVED_SEARCH_USER",r.COLLECTION_USER="COLLECTION_USER",r.OFFLINE_USER="OFFLINE_USER",r.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",r.ANALYTICS_USER="ANALYTICS_USER",r.BETA_USER="BETA_USER",r.DEBUG_USER="DEBUG_USER",r.PRINT_USER="PRINT_USER",r.RATING_USER="RATING_USER",r.FEEDBACK_USER="FEEDBACK_USER",r.GENERATIVE_AI_USER="GENERATIVE_AI_USER",r.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",r.CONTENT_PUBLISHER="CONTENT_PUBLISHER",r.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",r.KHUB_ADMIN="KHUB_ADMIN",r.USERS_ADMIN="USERS_ADMIN",r.PORTAL_ADMIN="PORTAL_ADMIN",r.ADMIN="ADMIN"})($||($={}));var me;(function(r){r.SEARCHES="SEARCHES",r.BOOKMARKS="BOOKMARKS",r.BOOKS="BOOKS",r.COLLECTIONS="COLLECTIONS"})(me||(me={}));var wc;(function(r){r.UNAUTHENTICATED="UNAUTHENTICATED",r.USER_INCOMPLETE="USER_INCOMPLETE",r.MFA_REQUIRED="MFA_REQUIRED",r.AUTHENTICATED="AUTHENTICATED"})(wc||(wc={}));var Rc;(function(r){r.VALID="VALID",r.INVALID="INVALID"})(Rc||(Rc={}));var Ic;(function(r){r.JSON="JSON",r.TEXT="TEXT"})(Ic||(Ic={}));var Tc;(function(r){r.USER="USER",r.ASSISTANT="ASSISTANT"})(Tc||(Tc={}));var _c;(function(r){r.TEXT="TEXT",r.HTML="HTML"})(_c||(_c={}));var Nc;(function(r){r.HTML="HTML",r.MARKDOWN="MARKDOWN"})(Nc||(Nc={}));var Wu={[$.PERSONAL_BOOK_SHARE_USER]:[$.PERSONAL_BOOK_USER],[$.HTML_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.PDF_EXPORT_USER]:[$.PERSONAL_BOOK_USER],[$.KHUB_ADMIN]:[$.CONTENT_PUBLISHER],[$.ADMIN]:[$.KHUB_ADMIN,$.USERS_ADMIN,$.PORTAL_ADMIN],[$.GENERATIVE_AI_EXPORT_USER]:[$.GENERATIVE_AI_USER]};function Lc(r,e){return r===e||(Wu[r]??[]).some(t=>Lc(t,e))}function We(r,e){return r==null?!1:(Array.isArray(r)?r:Array.isArray(r.roles)?r.roles:Array.isArray(r.profile?.roles)?r.profile.roles:[]).some(n=>Lc(n,e))}function zu(r){return`"${r}"`}function Pc(r){return r.startsWith('"')&&r.endsWith('"')?r.replace(/(^"+)|("+$)/g,""):r}function ju(r,e){return new qt(r).serialize(e)}var H;(function(r){r.LOCALE="content-lang",r.QUERY="query",r.SCOPE="scope",r.FILTERS="filters",r.VIRTUAL_FIELD="virtual-field",r.PERIOD="period",r.VALUE_FILTERS="value-filters",r.DATE_FILTERS="date-filters",r.RANGE_FILTERS="range-filters",r.SORT="sort",r.PER_PAGE="per-page",r.KEYWORD_MATCH="keyword-match"})(H||(H={}));var Gu=new Set(Object.values(H));function kc(r){return Gu.has(r)}var qt=class{constructor(e,t=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=t,this.allLanguagesAllowed=n,this.defaultContentLocale=a,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,t){return this.serializeToCurrentPageIfPossible(e,t??"/search")}serializeToCurrentPageIfPossible(e,t){let n=t==null||t.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${t}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,t=!1){var n,a,i,s,l,d,p,h,f,m,b;let y=new URLSearchParams;e.contentLocale?(!t||e.contentLocale!==this.defaultContentLocale)&&y.append(H.LOCALE,e.contentLocale):y.append(H.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&y.append(H.QUERY,e.query);let E=(i=(a=e.metadataFilters)===null||a===void 0?void 0:a.filter(v=>v.valueFilter&&!v.valueFilter.negative))!==null&&i!==void 0?i:[];if(E.length>0){let v=E.map(O=>{var _,L;let M=((L=(_=O.valueFilter)===null||_===void 0?void 0:_.values)!==null&&L!==void 0?L:[]).map(P=>this.escapeFilters(P)).map(P=>zu(Pc(P))).join("_");return`${O.key}~${M}`}).join("*");y.append(H.VALUE_FILTERS,v)}let w=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&l!==void 0?l:[];if(w.length>0){let v=w.map(O=>{var _;return`${O.key}~${(_=O.dateFilter)===null||_===void 0?void 0:_.type.toLowerCase()}`}).join("*");y.append(H.DATE_FILTERS,v)}let C=(p=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&p!==void 0?p:[];if(C.length>0){let v=C.map(O=>{var _,L;return`${O.key}~${(_=O.rangeFilter)===null||_===void 0?void 0:_.from}_${(L=O.rangeFilter)===null||L===void 0?void 0:L.to}`}).join("*");y.append(H.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&y.append(H.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&y.append(H.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&y.append(H.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(f=e.paging)===null||f===void 0?void 0:f.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&y.append(H.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&y.append(H.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let R=(b=e.otherQueryParams)!==null&&b!==void 0?b:{};for(let v in R)y.append(v,R[v]);let S=new Array;return y.forEach((v,O)=>{S.push(this.encodeQueryString(O)+"="+this.encodeQueryString(v))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var t;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(t=this.scopeMapping[i])!==null&&t!==void 0?t:a.scope}}fromURLSearchParams(e){var t,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(C){console.warn("Could not decode search request query params, fallback on raw value",C)}let d=new URLSearchParams(e),p=d.get(H.LOCALE)==="all"?void 0:d.get(H.LOCALE),h=((t=d.get(H.VIRTUAL_FIELD))!==null&&t!==void 0?t:"EVERYWHERE").toUpperCase(),f=(n=d.get(H.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(a=d.get(H.SCOPE))!==null&&a!==void 0?a:"default",b=+((i=d.get(H.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),y=d.get(H.KEYWORD_MATCH),E=y?y.toUpperCase()===Kt.MANDATORY?Kt.MANDATORY:Kt.OPTIONAL:void 0,w={};for(let C of d.keys())kc(C)||(w[C]=d.get(C));return{contentLocale:p??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(H.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[m])!==null&&l!==void 0?l:"DEFAULT",virtualField:Cc(h)?h:"EVERYWHERE",sortId:f,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:dt(1,isNaN(b)?this.defaultPerPage:b,1e3)},keywordMatch:E,otherQueryParams:w}}parseCompatFilters(e){var t,n,a,i,s,l;let d=[];return e.has(H.FILTERS)&&(d=this.parseValueFilters((t=e.get(H.FILTERS))!==null&&t!==void 0?t:"")),(n=e.has(H.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(H.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(H.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(H.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(H.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(t=>t.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],valueFilter:{values:t[1].split("_").map(Pc).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],dateFilter:{type:Zt[t[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],rangeFilter:{from:t[1].split("_")[0],to:t[1].split("_")[1]}}))}escapeFilters(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replaceAll(t,n);return e}superEscapeFilters(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[t,n,a]of this.filtersEscapeMapping)e=e.replace(a,t);return e}parseLegacyPeriodFilter(e){if(Ac(e))return[{key:"ft:lastEdition",dateFilter:{type:Zt[e]}}];if(e.startsWith("CUSTOM_")){let[t,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var ma={};D(ma,{toFtFormComponent:()=>Vu});var ga=Symbol("elementInternals"),Vu=X(Symbol("toFtFormComponent"),function(r){class e extends r{static get formAssociated(){return!0}get form(){return this[ga].form}constructor(...n){super(n),this[ga]=this.attachInternals()}setFormValue(n){this[ga].setFormValue(n)}}return e});var ya={};D(ya,{DateFormatter:()=>vt});var vt=class{static format(e,t,n,a){return window.moment?window.moment(e).locale(t).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,t,n,a)}static getMomentDateFormat(e,t){return e?t?"lll":"ll":t?"L LT":"L"}static getIntlDateTime(e,t,n,a){let i=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(t,{dateStyle:n?"medium":"short"}).format(i);if(!a)return s;let l=new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(i);return`${s} ${l}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),t=new Date().getTimezoneOffset();return`${t<0?"+":"-"}${e(Math.abs(t)/60)}:${e(Math.abs(t)%60)}`}};var va={};D(va,{ALL_KEYS_VALUE:()=>ba,SameWindowStorageEvent:()=>Yt});var ba="__all__",Yt=class extends CustomEvent{constructor(e,t,n){super("same-window-storage",{detail:{key:e,oldValue:t,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==ba}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new Yt(t[0],n,t[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new Yt(t[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(r,e,t){Reflect.apply(r,e,t),window.dispatchEvent(new Yt(ba))}});var Sa={};D(Sa,{FocusMainContentEvent:()=>xa});var xa=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var Mc={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function Ku(r){(r.key==="Enter"||r.key===" "||r.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=r.key}function Zu(r){window.FluidTopicsA11yHints.isKeyboardNavigation=r.detail==0}document.addEventListener("keydown",Ku);document.addEventListener("click",Zu);var Dc=U`
49
49
  .sr-only {
50
50
  position:absolute;
51
51
  left:-10000px;
@@ -69,7 +69,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
69
69
  width:auto;
70
70
  height:auto;
71
71
  }
72
- `;var qu={checkVisibility:!0},mv=X(Symbol("withAriaNotification"),function(r){class e extends r{sendAriaNotification(n,a){let{checkVisibility:i}={...qu,...a};setTimeout(()=>{(!i||this.checkVisibility())&&(n=typeof n=="string"?n:n?.message,n&&this.dispatchEvent(new dr({type:"aria",message:n})))},20)}}return e});function Dc(r,e,t){return r?e(r):t?.(r)}var te=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},xt;(function(r){r.blur="blur",r.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",r.input="input"})(xt||(xt={}));var St;(function(r){r.default="default",r.warning="warning",r.error="error"})(St||(St={}));var Oa=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}},Av=X(Symbol("toFtInput"),function(r){class e extends r{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=xt.input,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=St.default,this.focused=!1,this.additionalWarningRules=[],this.additionalErrorRules=[]}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===xt.blur||this.validateOn===xt.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){(this.status!==St.default&&this.validateOn===xt.blurWithStatusResolutionOnInput||this.validateOn===xt.input)&&this.triggerValidation()}triggerValidation(){this.errorMessages=this.processRules([...this.errorRules,...this.additionalErrorRules]),this.warningMessages=this.processRules([...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new Oa(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return V`
72
+ `;var qu={checkVisibility:!0},mv=X(Symbol("withAriaNotification"),function(r){class e extends r{sendAriaNotification(n,a){let{checkVisibility:i}={...qu,...a};setTimeout(()=>{(!i||this.checkVisibility())&&(n=typeof n=="string"?n:n?.message,n&&this.dispatchEvent(new dr({type:"aria",message:n})))},20)}}return e});function Fc(r,e,t){return r?e(r):t?.(r)}var te=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},xt;(function(r){r.blur="blur",r.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",r.input="input"})(xt||(xt={}));var St;(function(r){r.default="default",r.warning="warning",r.error="error"})(St||(St={}));var Oa=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}},Av=X(Symbol("toFtInput"),function(r){class e extends r{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=xt.input,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=St.default,this.focused=!1,this.additionalWarningRules=[],this.additionalErrorRules=[]}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===xt.blur||this.validateOn===xt.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){(this.status!==St.default&&this.validateOn===xt.blurWithStatusResolutionOnInput||this.validateOn===xt.input)&&this.triggerValidation()}triggerValidation(){this.errorMessages=this.processRules([...this.errorRules,...this.additionalErrorRules]),this.warningMessages=this.processRules([...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new Oa(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return V`
73
73
  <ul aria-live="polite" id="${this.messagesForScreenReaderElementId}"
74
74
  style="position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;list-style:none;">
75
75
  ${Ge(this.errorMessages,n=>V`
@@ -78,11 +78,11 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
78
78
  ${Ge(this.warningMessages,n=>V`
79
79
  <li>${n}</li>
80
80
  `)}
81
- ${Dc(!this.errorMessages.length&&!this.warningMessages.length&&this.helperText,()=>V`
81
+ ${Fc(!this.errorMessages.length&&!this.warningMessages.length&&this.helperText,()=>V`
82
82
  <li>${this.helperText}</li>
83
83
  `)}
84
84
  </ul>
85
- `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?St.error:this.warningMessages.length?St.warning:St.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return te([A()],e.prototype,"warningRules",void 0),te([A()],e.prototype,"errorRules",void 0),te([A()],e.prototype,"validateOn",void 0),te([A({type:Boolean})],e.prototype,"validateAtRender",void 0),te([A()],e.prototype,"label",void 0),te([A({type:Boolean})],e.prototype,"hideLabel",void 0),te([A()],e.prototype,"name",void 0),te([A({type:Boolean})],e.prototype,"disabled",void 0),te([A()],e.prototype,"helperText",void 0),te([A()],e.prototype,"forceStatus",void 0),te([A({reflect:!0})],e.prototype,"value",void 0),te([K()],e.prototype,"errorMessages",void 0),te([K()],e.prototype,"warningMessages",void 0),te([K()],e.prototype,"status",void 0),te([K()],e.prototype,"focused",void 0),te([K()],e.prototype,"additionalWarningRules",void 0),te([K()],e.prototype,"additionalErrorRules",void 0),e});var Rr=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let n of t)n._$AO?.(e,!1),Rr(n,e);return!0},ao=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Fc=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Qu(e)}};function Yu(r){this._$AN!==void 0?(ao(this),this._$AM=r,Fc(this)):this._$AM=r}function Ju(r,e=!1,t=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=t;i<n.length;i++)Rr(n[i],!1),ao(n[i]);else n!=null&&(Rr(n,!1),ao(n));else Rr(this,r)}var Qu=r=>{r.type==Ce.CHILD&&(r._$AP??=Ju,r._$AQ??=Yu)},io=class extends he{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Fc(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Rr(this,e),ao(this))}setValue(e){if(si(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var Uc;(function(r){r.sm="sm",r.md="md",r.lg="lg",r.xl="xl"})(Uc||(Uc={}));var Xu={sm:640,md:768,lg:1024,xl:1280},Ea=class extends io{constructor(e){super(e),this.size=0,this.onResize=()=>{let t=window.innerWidth;this.size!==t&&(this.size=t,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[t,n,a]){return this.lastArgs=[t,n,a],this.render(t,n,a)}render(e,t,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?t():i()}resolveThreshold(e){return typeof e=="number"?e:Xu[e]}},Hv=xe(Ea);var wa,Ca,Aa,Ra,ep=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Aa=(Ca=(wa=window.safari)===null||wa===void 0?void 0:wa.pushNotification)===null||Ca===void 0?void 0:Ca.toString())!==null&&Aa!==void 0?Aa:"")==="[object SafariRemoteNotification]",tp="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ra=window.ftGlobals)!==null&&Ra!==void 0?Ra:{lit:$o,litDecorators:zo,litRepeat:jo,litClassMap:Go,litStyleMap:Vo,litUnsafeHTML:Zo,wcUtils:{...tn,...qo,...an,...ya,...sn,...cn,...pn,...en,...Rn,...Sa,...kc,...pa,...un,...Pn,...ma,...Nn,...bs,...Jo,...Dn,...fn,...Fn,...Mc,...xs,...Un,...la,...va,...In,..._n,...ha,...on,isSafari:ep,isTouchScreen:tp,setVariable:Nt}};var Ot;(function(r){r.clusteringHelperCreated="clustering-helper-created",r.mapAttachmentsUpdate="map-attachments-update",r.visibleTopicChange="visible-topic-change"})(Ot||(Ot={}));var $e;(function(r){r.FEEDBACK="FEEDBACK",r.RATING="RATING",r.PRINT="PRINT",r.BOOKMARK="BOOKMARK",r.COLLECTIONS="COLLECTIONS",r.PERSONAL_BOOKS="PERSONAL_BOOKS"})($e||($e={}));var rp=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},Ta=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},Ia=Symbol("registerInterval"),op=X(Symbol("toFtReaderComponent"),function(r){var e;class t extends r{constructor(){super(...arguments),this[e]=0}setReaderStateManager(a){this.clearStateManager(),this.stateManager=a,this.addStore(a.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var a;return(a=this.stateManager)===null||a===void 0?void 0:a.service}connectedCallback(){super.connectedCallback(),this[Ia]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[Ia]):this.dispatchEvent(new Ta)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Ia,rp([K()],t.prototype,"stateManager",void 0),t}),rt=class extends op(mt){};var _a={padding:o.create("--ft-infinite-scroll-padding","","SIZE","0"),itemsGap:o.create("--ft-infinite-scroll-items-gap","","SIZE","4px"),itemContainerMinHeight:o.create("--ft-infinite-scroll-item-container-min-height","","SIZE",".1px")},Bc=U`
85
+ `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?St.error:this.warningMessages.length?St.warning:St.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return te([A()],e.prototype,"warningRules",void 0),te([A()],e.prototype,"errorRules",void 0),te([A()],e.prototype,"validateOn",void 0),te([A({type:Boolean})],e.prototype,"validateAtRender",void 0),te([A()],e.prototype,"label",void 0),te([A({type:Boolean})],e.prototype,"hideLabel",void 0),te([A()],e.prototype,"name",void 0),te([A({type:Boolean})],e.prototype,"disabled",void 0),te([A()],e.prototype,"helperText",void 0),te([A()],e.prototype,"forceStatus",void 0),te([A({reflect:!0})],e.prototype,"value",void 0),te([K()],e.prototype,"errorMessages",void 0),te([K()],e.prototype,"warningMessages",void 0),te([K()],e.prototype,"status",void 0),te([K()],e.prototype,"focused",void 0),te([K()],e.prototype,"additionalWarningRules",void 0),te([K()],e.prototype,"additionalErrorRules",void 0),e});var Rr=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let n of t)n._$AO?.(e,!1),Rr(n,e);return!0},ao=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Uc=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Qu(e)}};function Yu(r){this._$AN!==void 0?(ao(this),this._$AM=r,Uc(this)):this._$AM=r}function Ju(r,e=!1,t=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=t;i<n.length;i++)Rr(n[i],!1),ao(n[i]);else n!=null&&(Rr(n,!1),ao(n));else Rr(this,r)}var Qu=r=>{r.type==Ce.CHILD&&(r._$AP??=Ju,r._$AQ??=Yu)},io=class extends he{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Uc(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Rr(this,e),ao(this))}setValue(e){if(si(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var Bc;(function(r){r.sm="sm",r.md="md",r.lg="lg",r.xl="xl"})(Bc||(Bc={}));var Xu={sm:640,md:768,lg:1024,xl:1280},Ea=class extends io{constructor(e){super(e),this.size=0,this.onResize=()=>{let t=window.innerWidth;this.size!==t&&(this.size=t,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[t,n,a]){return this.lastArgs=[t,n,a],this.render(t,n,a)}render(e,t,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?t():i()}resolveThreshold(e){return typeof e=="number"?e:Xu[e]}},Hv=xe(Ea);var wa,Ca,Aa,Ra,ep=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Aa=(Ca=(wa=window.safari)===null||wa===void 0?void 0:wa.pushNotification)===null||Ca===void 0?void 0:Ca.toString())!==null&&Aa!==void 0?Aa:"")==="[object SafariRemoteNotification]",tp="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ra=window.ftGlobals)!==null&&Ra!==void 0?Ra:{lit:$o,litDecorators:zo,litRepeat:jo,litClassMap:Go,litStyleMap:Vo,litUnsafeHTML:Zo,wcUtils:{...tn,...qo,...an,...ya,...sn,...cn,...pn,...en,...Rn,...Sa,...Mc,...pa,...un,...Pn,...ma,...Nn,...bs,...Jo,...Dn,...fn,...Fn,...Dc,...xs,...Un,...la,...va,...In,..._n,...ha,...on,isSafari:ep,isTouchScreen:tp,setVariable:Nt}};var Ot;(function(r){r.clusteringHelperCreated="clustering-helper-created",r.mapAttachmentsUpdate="map-attachments-update",r.visibleTopicChange="visible-topic-change"})(Ot||(Ot={}));var $e;(function(r){r.FEEDBACK="FEEDBACK",r.RATING="RATING",r.PRINT="PRINT",r.BOOKMARK="BOOKMARK",r.COLLECTIONS="COLLECTIONS",r.PERSONAL_BOOKS="PERSONAL_BOOKS"})($e||($e={}));var rp=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},Ta=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},Ia=Symbol("registerInterval"),op=X(Symbol("toFtReaderComponent"),function(r){var e;class t extends r{constructor(){super(...arguments),this[e]=0}setReaderStateManager(a){this.clearStateManager(),this.stateManager=a,this.addStore(a.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var a;return(a=this.stateManager)===null||a===void 0?void 0:a.service}connectedCallback(){super.connectedCallback(),this[Ia]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[Ia]):this.dispatchEvent(new Ta)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Ia,rp([K()],t.prototype,"stateManager",void 0),t}),rt=class extends op(mt){};var _a={padding:o.create("--ft-infinite-scroll-padding","","SIZE","0"),itemsGap:o.create("--ft-infinite-scroll-items-gap","","SIZE","4px"),itemContainerMinHeight:o.create("--ft-infinite-scroll-item-container-min-height","","SIZE",".1px")},Hc=U`
86
86
  .items-container {
87
87
  padding: ${_a.padding};
88
88
  outline: none;
@@ -122,13 +122,13 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
122
122
  data-item-index="${t}">
123
123
  ${a?(()=>{let s=this.renderItem(e,t);return typeof s=="string"?Ko(s):s})():B}
124
124
  </div>
125
- `}prepareRenderIfNeeded(e){let t=this.renderApprovalTimeouts[e]!=null;this.inRenderRange(e)&&!t&&(this.renderApprovalTimeouts[e]=setTimeout(()=>{this.inRenderRange(e)?this.addRenderedIndex(e):this.renderApprovalTimeouts[e]=void 0,this.requestUpdate()},300))}addRenderedIndex(e){e>=0&&!this.renderedIndexes.has(e)&&this.renderedIndexes.add(e)}inRenderRange(e){return e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=np(this.visibleItems)+this.renderAfterLast}isRendered(e){return this.renderedIndexes.has(this.items.indexOf(e))}resetScroll(e=!0){this.shouldRestoreScroll=!1,this.intersectionObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.internalScroll&&this.scrollable!==this.internalScrollable?this.scrollable=this.internalScrollable:!this.internalScroll&&e&&(this.scrollable=Gt.findFirstScrollableParent(this.itemsContainer));let t=this.resolveScrollToIndex();this.addRenderedIndex(t),this.scrollToTarget(t),this.scrollDoneDebouncer.run(()=>{this.ensureScrollToTarget&&t>=0&&this.scrollDebouncer.run(()=>{Math.abs(this.scrollable.scrollTop-this.getOffset(t))>5&&this.scrollToTarget(t)},500),this.scrollToTarget(t),this.scrolledToTarget=!0,this.shouldRestoreScroll=!0,this.resetIntersectionObserver()})}resolveScrollToIndex(){var e;let t=(e=this.scrollToIndex)!==null&&e!==void 0?e:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;return t>=this.items.length?-1:t}getItem(e){var t,n,a;return(n=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(`#item-${e}`))!==null&&n!==void 0?n:(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector("#item-0")}scrollToTarget(e){e<=0?(this.scrollable.scrollTop=0,this.scrollRestorationOffset=-this.getOffset(e)):(this.scrollable.scrollTop=this.getOffset(e),this.scrollRestorationOffset=0),this.scrollRestorationItem=e>=0?e:void 0}onScrollIntoView(e){var t;this.scrollDebouncer.cancel();let n=e.composedPath()[0],a=this.getOffset(n),i=(t=e.composedPath().find(s=>typeof s.matches=="function"&&s.matches(".item-container")))===null||t===void 0?void 0:t.getAttribute("data-item-index");this.scrollRestorationItem=i==null?this.scrollRestorationItem:+i,this.scrollRestorationOffset=a-this.getOffset(this.scrollRestorationItem),this.ignoreNextScrollEvent=!0,this.scrollable.scrollTop=a}getOffset(e){let t=typeof e=="number"?this.getItem(e):e;return t?Gt.getAbsoluteScrollOffset(this.scrollable,t):0}appendItems(...e){this.items=[...this.items,...e]}prependItems(...e){this.items=[...e,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0}),this.resetScroll()},0)}disconnectedCallback(){super.disconnectedCallback(),this.scrollable=void 0,this.intersectionObserver.disconnect(),this.mutationObserver.disconnect(),this.shouldRestoreScroll=!1}resetIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]}),this.onMutation()}searchFirstVisibleItem(e,t,n,a){if(n=n??0,a=a??t.length-1,a<=n)return t[n];let i=Math.floor((a-n)/2)+n,s=t[i],l=this.getOffset(s);return l>e?this.searchFirstVisibleItem(e,t,n,i-1):l+s.clientHeight<e?this.searchFirstVisibleItem(e,t,i+1,a):s}get shouldRestoreScroll(){return this._shouldRestoreScroll}set shouldRestoreScroll(e){let t=e&&!this._shouldRestoreScroll;this._shouldRestoreScroll=e,t&&requestAnimationFrame(this.scrollAdjustment)}willUpdate(e){super.willUpdate(e),e.has("items")&&(this.renderedIndexes=new Set,this.lastRenderedItemsLength=0,this.renderApprovalTimeouts=[]),((e.has("scrollToItem")||e.has("scrollToIndex"))&&(this.scrollToItem!=null||this.scrollToIndex!=null)||e.has("internalScroll"))&&lt(()=>this.itemsContainer).then(()=>this.resetScroll())}updated(e){super.updated(e),(e.has("visibleItems")||e.has("items"))&&this.onVisibleItemsChange(),e.has("scrolledToTarget")&&this.scrolledToTarget&&(this.scrollToItem!=null||this.scrollToIndex!=null)&&this.dispatchEvent(new Pa)}contentAvailableCallback(e){var t,n;super.contentAvailableCallback(e);let a=[...(n=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelectorAll(".item-container.rendered"))!==null&&n!==void 0?n:[]].map(i=>+i.getAttribute("data-item-index"));this.lastRenderedItemsLength!==a.length&&(this.dispatchRenderedItemsChangeEvent(a),this.lastRenderedItemsLength=a.length)}dispatchRenderedItemsChangeEvent(e){let t=e??[...this.renderedIndexes].sort((n,a)=>n-a);this.dispatchEvent(new La(t,t.map(n=>this.items[n])))}onVisibleItemsChange(){this.visibleItems.every((t,n)=>this.visibleItems[n+1]==null||t+1===this.visibleItems[n+1])||ae(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchVisibleItemsEvent()):this.resetVisibleItemsDebouncer.run(()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.resetIntersectionObserver()})}dispatchVisibleItemsEvent(){var e;(e=this.cancelableDispatchEvent)===null||e===void 0||e.cancel(),this.cancelableDispatchEvent=sr(cr(()=>this.scrolledToTarget&&!this.scrolling)),this.cancelableDispatchEvent.then(()=>this.dispatchEvent(new Na(this.visibleItems,this.visibleItems.map(t=>this.items[t])))).catch(()=>null)}};q.styles=Bc;le([A({attribute:!1,hasChanged:ke})],q.prototype,"items",void 0);le([A({attribute:!1})],q.prototype,"renderItem",void 0);le([A({attribute:!1})],q.prototype,"getItemKey",void 0);le([A({type:Object})],q.prototype,"scrollToItem",void 0);le([A({type:Number})],q.prototype,"scrollToIndex",void 0);le([A({type:Boolean})],q.prototype,"internalScroll",void 0);le([A({type:Number})],q.prototype,"renderBeforeFirst",void 0);le([A({type:Number})],q.prototype,"renderAfterLast",void 0);le([A({type:Boolean})],q.prototype,"ensureScrollToTarget",void 0);le([K({hasChanged(r,e){return r!=null&&e==null||r.length!==e.length||r[0]!==e[0]}})],q.prototype,"visibleItems",void 0);le([ze(".scrollable")],q.prototype,"internalScrollable",void 0);le([ze(".items-container")],q.prototype,"itemsContainer",void 0);le([K()],q.prototype,"scrolledToTarget",void 0);le([K()],q.prototype,"scrolling",void 0);se("ft-infinite-scroll")(q);var Y0={},Hc=U`
126
- `;var Wc=U`
125
+ `}prepareRenderIfNeeded(e){let t=this.renderApprovalTimeouts[e]!=null;this.inRenderRange(e)&&!t&&(this.renderApprovalTimeouts[e]=setTimeout(()=>{this.inRenderRange(e)?this.addRenderedIndex(e):this.renderApprovalTimeouts[e]=void 0,this.requestUpdate()},300))}addRenderedIndex(e){e>=0&&!this.renderedIndexes.has(e)&&this.renderedIndexes.add(e)}inRenderRange(e){return e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=np(this.visibleItems)+this.renderAfterLast}isRendered(e){return this.renderedIndexes.has(this.items.indexOf(e))}resetScroll(e=!0){this.shouldRestoreScroll=!1,this.intersectionObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.internalScroll&&this.scrollable!==this.internalScrollable?this.scrollable=this.internalScrollable:!this.internalScroll&&e&&(this.scrollable=Gt.findFirstScrollableParent(this.itemsContainer));let t=this.resolveScrollToIndex();this.addRenderedIndex(t),this.scrollToTarget(t),this.scrollDoneDebouncer.run(()=>{this.ensureScrollToTarget&&t>=0&&this.scrollDebouncer.run(()=>{Math.abs(this.scrollable.scrollTop-this.getOffset(t))>5&&this.scrollToTarget(t)},500),this.scrollToTarget(t),this.scrolledToTarget=!0,this.shouldRestoreScroll=!0,this.resetIntersectionObserver()})}resolveScrollToIndex(){var e;let t=(e=this.scrollToIndex)!==null&&e!==void 0?e:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;return t>=this.items.length?-1:t}getItem(e){var t,n,a;return(n=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(`#item-${e}`))!==null&&n!==void 0?n:(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector("#item-0")}scrollToTarget(e){e<=0?(this.scrollable.scrollTop=0,this.scrollRestorationOffset=-this.getOffset(e)):(this.scrollable.scrollTop=this.getOffset(e),this.scrollRestorationOffset=0),this.scrollRestorationItem=e>=0?e:void 0}onScrollIntoView(e){var t;this.scrollDebouncer.cancel();let n=e.composedPath()[0],a=this.getOffset(n),i=(t=e.composedPath().find(s=>typeof s.matches=="function"&&s.matches(".item-container")))===null||t===void 0?void 0:t.getAttribute("data-item-index");this.scrollRestorationItem=i==null?this.scrollRestorationItem:+i,this.scrollRestorationOffset=a-this.getOffset(this.scrollRestorationItem),this.ignoreNextScrollEvent=!0,this.scrollable.scrollTop=a}getOffset(e){let t=typeof e=="number"?this.getItem(e):e;return t?Gt.getAbsoluteScrollOffset(this.scrollable,t):0}appendItems(...e){this.items=[...this.items,...e]}prependItems(...e){this.items=[...e,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0}),this.resetScroll()},0)}disconnectedCallback(){super.disconnectedCallback(),this.scrollable=void 0,this.intersectionObserver.disconnect(),this.mutationObserver.disconnect(),this.shouldRestoreScroll=!1}resetIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]}),this.onMutation()}searchFirstVisibleItem(e,t,n,a){if(n=n??0,a=a??t.length-1,a<=n)return t[n];let i=Math.floor((a-n)/2)+n,s=t[i],l=this.getOffset(s);return l>e?this.searchFirstVisibleItem(e,t,n,i-1):l+s.clientHeight<e?this.searchFirstVisibleItem(e,t,i+1,a):s}get shouldRestoreScroll(){return this._shouldRestoreScroll}set shouldRestoreScroll(e){let t=e&&!this._shouldRestoreScroll;this._shouldRestoreScroll=e,t&&requestAnimationFrame(this.scrollAdjustment)}willUpdate(e){super.willUpdate(e),e.has("items")&&(this.renderedIndexes=new Set,this.lastRenderedItemsLength=0,this.renderApprovalTimeouts=[]),((e.has("scrollToItem")||e.has("scrollToIndex"))&&(this.scrollToItem!=null||this.scrollToIndex!=null)||e.has("internalScroll"))&&lt(()=>this.itemsContainer).then(()=>this.resetScroll())}updated(e){super.updated(e),(e.has("visibleItems")||e.has("items"))&&this.onVisibleItemsChange(),e.has("scrolledToTarget")&&this.scrolledToTarget&&(this.scrollToItem!=null||this.scrollToIndex!=null)&&this.dispatchEvent(new Pa)}contentAvailableCallback(e){var t,n;super.contentAvailableCallback(e);let a=[...(n=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelectorAll(".item-container.rendered"))!==null&&n!==void 0?n:[]].map(i=>+i.getAttribute("data-item-index"));this.lastRenderedItemsLength!==a.length&&(this.dispatchRenderedItemsChangeEvent(a),this.lastRenderedItemsLength=a.length)}dispatchRenderedItemsChangeEvent(e){let t=e??[...this.renderedIndexes].sort((n,a)=>n-a);this.dispatchEvent(new La(t,t.map(n=>this.items[n])))}onVisibleItemsChange(){this.visibleItems.every((t,n)=>this.visibleItems[n+1]==null||t+1===this.visibleItems[n+1])||ae(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchVisibleItemsEvent()):this.resetVisibleItemsDebouncer.run(()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.resetIntersectionObserver()})}dispatchVisibleItemsEvent(){var e;(e=this.cancelableDispatchEvent)===null||e===void 0||e.cancel(),this.cancelableDispatchEvent=sr(cr(()=>this.scrolledToTarget&&!this.scrolling)),this.cancelableDispatchEvent.then(()=>this.dispatchEvent(new Na(this.visibleItems,this.visibleItems.map(t=>this.items[t])))).catch(()=>null)}};q.styles=Hc;le([A({attribute:!1,hasChanged:ke})],q.prototype,"items",void 0);le([A({attribute:!1})],q.prototype,"renderItem",void 0);le([A({attribute:!1})],q.prototype,"getItemKey",void 0);le([A({type:Object})],q.prototype,"scrollToItem",void 0);le([A({type:Number})],q.prototype,"scrollToIndex",void 0);le([A({type:Boolean})],q.prototype,"internalScroll",void 0);le([A({type:Number})],q.prototype,"renderBeforeFirst",void 0);le([A({type:Number})],q.prototype,"renderAfterLast",void 0);le([A({type:Boolean})],q.prototype,"ensureScrollToTarget",void 0);le([K({hasChanged(r,e){return r!=null&&e==null||r.length!==e.length||r[0]!==e[0]}})],q.prototype,"visibleItems",void 0);le([ze(".scrollable")],q.prototype,"internalScrollable",void 0);le([ze(".items-container")],q.prototype,"itemsContainer",void 0);le([K()],q.prototype,"scrolledToTarget",void 0);le([K()],q.prototype,"scrolling",void 0);se("ft-infinite-scroll")(q);var Y0={},Wc=U`
126
+ `;var $c=U`
127
127
  `;var Et=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},ye=class extends rt{constructor(){super(...arguments),this.disableContextInteractions=!1,this.headingLevelsShift=0,this.registeredComponents=[]}render(){return V`
128
128
  <article id=${this.tocId}>
129
129
  <slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
130
130
  </article>
131
- `}registerComponent(e){e.stopPropagation();let t=e.composedPath()[0];this.register(t)}register(e){this.registeredComponents.push(e),e.tocNode=this.tocNode,e.disableContextInteractions=this.disableContextInteractions,e.headingLevelsShift=this.headingLevelsShift}update(e){super.update(e),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(t=>e.has(t))&&this.setTocNode(),e.has("tocNode")&&this.registeredComponents.forEach(t=>t.tocNode=this.tocNode)}async setTocNode(){var e;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((e=this.stateManager)===null||e===void 0?void 0:e.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};ye.styles=Wc;Et([j({selector:r=>{var e;return(e=r.map)===null||e===void 0?void 0:e.id}})],ye.prototype,"mapId",void 0);Et([j({selector:r=>r.translation.profileId})],ye.prototype,"translationProfileId",void 0);Et([j({selector:r=>r.translation.destinationLanguage})],ye.prototype,"translationDestinationLanguage",void 0);Et([A()],ye.prototype,"tocId",void 0);Et([A({type:Boolean})],ye.prototype,"disableContextInteractions",void 0);Et([A({type:Number})],ye.prototype,"headingLevelsShift",void 0);Et([K()],ye.prototype,"tocNode",void 0);se("ft-reader-topic-context")(ye);var $c=U`
131
+ `}registerComponent(e){e.stopPropagation();let t=e.composedPath()[0];this.register(t)}register(e){this.registeredComponents.push(e),e.tocNode=this.tocNode,e.disableContextInteractions=this.disableContextInteractions,e.headingLevelsShift=this.headingLevelsShift}update(e){super.update(e),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(t=>e.has(t))&&this.setTocNode(),e.has("tocNode")&&this.registeredComponents.forEach(t=>t.tocNode=this.tocNode)}async setTocNode(){var e;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((e=this.stateManager)===null||e===void 0?void 0:e.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};ye.styles=$c;Et([j({selector:r=>{var e;return(e=r.map)===null||e===void 0?void 0:e.id}})],ye.prototype,"mapId",void 0);Et([j({selector:r=>r.translation.profileId})],ye.prototype,"translationProfileId",void 0);Et([j({selector:r=>r.translation.destinationLanguage})],ye.prototype,"translationDestinationLanguage",void 0);Et([A()],ye.prototype,"tocId",void 0);Et([A({type:Boolean})],ye.prototype,"disableContextInteractions",void 0);Et([A({type:Number})],ye.prototype,"headingLevelsShift",void 0);Et([K()],ye.prototype,"tocNode",void 0);se("ft-reader-topic-context")(ye);var zc=U`
132
132
  :host {
133
133
  position: absolute;
134
134
  top: 0;
@@ -161,10 +161,10 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
161
161
  </text>
162
162
  </svg>
163
163
  </div>
164
- `:B}updated(e){if(super.updated(e),e.has("watermark")&&this.watermark){let t=this.svg.getBBox();this.svg.setAttribute("viewBox",t.x+" "+t.y+" "+t.width+" "+t.height)}}};be.styles=$c;ka([ze(".ft-watermark")],be.prototype,"svg",void 0);ka([A({attribute:!1})],be.prototype,"watermark",void 0);ka([A()],be.prototype,"height",void 0);se("ft-reader-watermark")(be);var ap={setTranslationDestinationLanguage:(r,e)=>{r.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(r,e)=>{r.translation.sourceLanguage=e.payload},setTranslationProfileId:(r,e)=>{r.translation.profileId=e.payload},setTranslationLoading:(r,e)=>{r.translation.isLoading=e.payload},setTranslationError:(r,e)=>{r.translation.isError=e.payload},setTopicsRating:(r,e)=>{for(let t in e.payload)r.topicsRating[t]=e.payload[t]},setLinkPreviewDialogId:(r,e)=>{r.linkPreviewDialogId=e.payload}},zc=r=>He.get({name:"ft-reader-"+r,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0,mapRating:void 0,topicsRating:{},translation:{sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1},linkPreviewDialogId:void 0},reducers:ap});var Ma=class{constructor(e,t){this.mapId=e,this.paginatedToc=t,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId,translationError:this.paginatedToc.translationError}}extractPagesToc(e,t,n){return e.flatMap(a=>{var i;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,t,n):[{tocId:a.tocId,title:(i=a.title)!==null&&i!==void 0?i:"",untranslatedTitle:a.untranslatedTitle,depth:t,children:this.extractPagesToc(a.children,t+1,a.tocId)}]})}convertNodes(e,t,n){return e.flatMap(a=>{var i,s,l;if(a.tocId==null)return[...this.convertSectionNodes((i=a.pageToc)!==null&&i!==void 0?i:[],t,a.tocId),...this.convertNodes(a.children,t,a.tocId)];let d=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:d,depth:t,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((l=a.pageToc)!==null&&l!==void 0?l:[],t+1,a.tocId),f=this.convertNodes(a.children,t+1,p.tocId);return p.children=[...h,...f],[p]})}convertSectionNodes(e,t,n){return e.flatMap(a=>{var i;let s=(i=a.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),l={...a,prettyUrl:s,depth:t,parentTocId:n,children:[]};return this.register(l),l.children=this.convertSectionNodes(a.children,t+1,a.tocId),[l]})}buildPage(e,t){var n,a,i,s,l,d;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(a=e.tocId)!==null&&a!==void 0?a:"root",toc:((i=e.pageToc)!==null&&i!==void 0?i:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:t?this.buildBreadcrumb(this.nodeByTocId[t]):[]},h=(m,b)=>(b?p.topics:p.hiddenTopics).push(m),f=(l=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&l!==void 0?l:[];return p.breadcrumb.forEach((m,b)=>{h(m,f[b])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),p}registerPage(e){for(let t of[...e.topics,...e.hiddenTopics])this.pageByTocId[t]||(this.pageByTocId[t]=e);this.pages.push(e)}tocIds(e){return e.flatMap(t=>[t.tocId,...this.tocIds(t.children)])}buildBreadcrumb(e){let t=[e.tocId];for(;e?.parentTocId;)t.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return t}register(e){e.prettyUrl&&(this.nodeByUrl[e.prettyUrl]==null?this.nodeByUrl[e.prettyUrl]=e:this.duplicatedPrettyUrls.add(e.prettyUrl)),this.nodeByUrl[`${this.mapId}/${e.tocId}`]=e,this.nodeByTocId[e.tocId]=e}},so=class{convertPaginatedToc(e,t){return new Ma(e,t).build()}};var jc=U`
165
- `;var ip="ft-app-info",_e=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:e})}};_e.eventName="authentication-change";var sp={session:(r,e)=>{ae(r.session,e.payload)||(r.session=e.payload,setTimeout(()=>I.dispatchEvent(new _e(e.payload)),0))}},I=He.get({name:ip,reducers:sp,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var wt=class r{static get(e){let{baseUrl:t,apiIntegrationIdentifier:n}=I.getState(),a=e??n;if(t&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(t,a,!0)}static await(e){return new Promise(t=>{let n=r.get(e);if(n)t(n);else{let a=I.subscribe(()=>{n=r.get(e),n&&(a(),t(n))})}})}};var co=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:wt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):wt.await()}};var ie=class extends co{constructor(e=!0,t){var n;super(t),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Ae,this.cache=e?a.commonCache:new Ae}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((t,n)=>0|31*t+n.charCodeAt(0),0))}};var lo=class extends ie{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Da=class{addCommand(e,t=!1){I.commands.add(e,t)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Da;var Gc,Jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},cp=Symbol("clearAfterUnitTest"),uo=class extends $r(ie){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Gc]=()=>{this.defaultMessages={},this.cache=new Ae,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let t=e.name.toLowerCase();this.cache.setFinal(t,e),this.notify(t)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,t){var n;if(e=e.toLowerCase(),t&&Object.keys(t).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...t};ae(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var t,n;return this.fetchContext(e),(n=(t=this.cache.getNow(e))===null||t===void 0?void 0:t.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,t){let n=e.toLowerCase();return this.resolveContext(n)[t]}resolveMessage(e,t,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new Sr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(t,...n)}async fetchContext(e){let t=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),t&&await this.notify(e)}catch(a){!(a instanceof Pe)&&t&&console.error(a)}return n}subscribe(e,t){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(t),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(t)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Jt({loadedContexts:e})),this.dispatchEvent(new Jt({loadedContexts:e})),await Promise.all(e.map(t=>this.notify(t,!1)))}async notify(e,t=!0){t&&(document.body.dispatchEvent(new Jt({loadedContexts:[e]})),this.dispatchEvent(new Jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Wr(0).then(()=>n()).catch(()=>null)))}};Gc=cp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends uo{constructor(){super(async(r,e)=>(await this.awaitApi).getFluidTopicsMessageContext(r,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends uo{constructor(){super(async(r,e)=>(await this.awaitApi).getCustomMessageContext(r,e))}});var Vc=window.FluidTopicsI18nService,Kx=window.FluidTopicsCustomI18nService;var Fa=class{highlightHtml(e,t,n){Mn(e,t,n)}};window.FluidTopicsHighlightHtmlService=new Fa;var po=class extends ie{async listMySearches(){let{session:e}=I.getState();return We(e,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Ua=class{isDate(e){var t,n,a,i;return(i=(a=((n=(t=I.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,t){var n,a,i;return vt.format(e,(n=t?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(a=t?.longFormat)!==null&&a!==void 0?a:!1,(i=t?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Ua;var Ir=class{static get(e,t){var n,a;let i=I.getState(),{lang:s,region:l}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new qt(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,t??`${s}-${l}`)}};var Ba=class{urlToSearchRequest(e){return Ir.get().parse(e)}searchRequestToUrl(e){return Ir.get().serialize(e)}};window.FluidTopicsUrlService=new Ba;var Ct=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:{currentItem:e}})}};Ct.eventName="change";var Ha=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let t=sessionStorage.getItem(this.itemName(e));return t?JSON.parse(t):void 0}set(e,t){sessionStorage.setItem(this.itemName(e),JSON.stringify(t))}},Kc=new Ha;var fo=class r extends Me{static build(){return new r(window.history,Kc,()=>window.location,!1)}constructor(e,t,n,a){var i,s;super(),this.history=e,this.historyStorage=t,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,t=!1){let n=t&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),ae(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Ct(this.currentItem())),0)}installProxies(){let e=t=>(n,a,[i,s,l])=>{let d=t(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[p,s,l]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let t=this.history.length-1;t>=0;t--)e?this.states[t]=this.historyStorage.get(t):setTimeout(()=>this.states[t]=this.historyStorage.get(t),this.history.length-t)}updateCurrentState(e){var t;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(t=e?.title)!==null&&t!==void 0?t:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Ct.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ct.eventName,e)}currentItem(){return lr(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 lr(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return lr(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 t;let n=(t=this.states[e])===null||t===void 0?void 0:t.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,t;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(t=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,t){var n;if(!this.hasState(e))return!1;let a=t??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(r),removeHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(r)});var Zc=I;function qc(r,e){var t;return Zc.getState().authenticationRequired&&!(!((t=Zc.getState().session)===null||t===void 0)&&t.sessionAuthenticated)?Promise.resolve(e):r()}var Y=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},z=class extends ee{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>wt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Ae,this.cleanSessionDebouncer=new Z,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return V`
164
+ `:B}updated(e){if(super.updated(e),e.has("watermark")&&this.watermark){let t=this.svg.getBBox();this.svg.setAttribute("viewBox",t.x+" "+t.y+" "+t.width+" "+t.height)}}};be.styles=zc;ka([ze(".ft-watermark")],be.prototype,"svg",void 0);ka([A({attribute:!1})],be.prototype,"watermark",void 0);ka([A()],be.prototype,"height",void 0);se("ft-reader-watermark")(be);var ap={setTranslationDestinationLanguage:(r,e)=>{r.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(r,e)=>{r.translation.sourceLanguage=e.payload},setTranslationProfileId:(r,e)=>{r.translation.profileId=e.payload},setTranslationLoading:(r,e)=>{r.translation.isLoading=e.payload},setTranslationError:(r,e)=>{r.translation.isError=e.payload},setTopicsRating:(r,e)=>{for(let t in e.payload)r.topicsRating[t]=e.payload[t]},setLinkPreviewDialogId:(r,e)=>{r.linkPreviewDialogId=e.payload}},jc=r=>He.get({name:"ft-reader-"+r,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0,mapRating:void 0,topicsRating:{},translation:{sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1},linkPreviewDialogId:void 0},reducers:ap});var Ma=class{constructor(e,t){this.mapId=e,this.paginatedToc=t,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId,translationError:this.paginatedToc.translationError}}extractPagesToc(e,t,n){return e.flatMap(a=>{var i;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,t,n):[{tocId:a.tocId,title:(i=a.title)!==null&&i!==void 0?i:"",untranslatedTitle:a.untranslatedTitle,depth:t,children:this.extractPagesToc(a.children,t+1,a.tocId)}]})}convertNodes(e,t,n){return e.flatMap(a=>{var i,s,l;if(a.tocId==null)return[...this.convertSectionNodes((i=a.pageToc)!==null&&i!==void 0?i:[],t,a.tocId),...this.convertNodes(a.children,t,a.tocId)];let d=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:d,depth:t,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((l=a.pageToc)!==null&&l!==void 0?l:[],t+1,a.tocId),f=this.convertNodes(a.children,t+1,p.tocId);return p.children=[...h,...f],[p]})}convertSectionNodes(e,t,n){return e.flatMap(a=>{var i;let s=(i=a.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),l={...a,prettyUrl:s,depth:t,parentTocId:n,children:[]};return this.register(l),l.children=this.convertSectionNodes(a.children,t+1,a.tocId),[l]})}buildPage(e,t){var n,a,i,s,l,d;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(a=e.tocId)!==null&&a!==void 0?a:"root",toc:((i=e.pageToc)!==null&&i!==void 0?i:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:t?this.buildBreadcrumb(this.nodeByTocId[t]):[]},h=(m,b)=>(b?p.topics:p.hiddenTopics).push(m),f=(l=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&l!==void 0?l:[];return p.breadcrumb.forEach((m,b)=>{h(m,f[b])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),p}registerPage(e){for(let t of[...e.topics,...e.hiddenTopics])this.pageByTocId[t]||(this.pageByTocId[t]=e);this.pages.push(e)}tocIds(e){return e.flatMap(t=>[t.tocId,...this.tocIds(t.children)])}buildBreadcrumb(e){let t=[e.tocId];for(;e?.parentTocId;)t.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return t}register(e){e.prettyUrl&&(this.nodeByUrl[e.prettyUrl]==null?this.nodeByUrl[e.prettyUrl]=e:this.duplicatedPrettyUrls.add(e.prettyUrl)),this.nodeByUrl[`${this.mapId}/${e.tocId}`]=e,this.nodeByTocId[e.tocId]=e}},so=class{convertPaginatedToc(e,t){return new Ma(e,t).build()}};var Gc=U`
165
+ `;var ip="ft-app-info",_e=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:e})}};_e.eventName="authentication-change";var sp={session:(r,e)=>{ae(r.session,e.payload)||(r.session=e.payload,setTimeout(()=>I.dispatchEvent(new _e(e.payload)),0))}},I=He.get({name:ip,reducers:sp,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var wt=class r{static get(e){let{baseUrl:t,apiIntegrationIdentifier:n}=I.getState(),a=e??n;if(t&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(t,a,!0)}static await(e){return new Promise(t=>{let n=r.get(e);if(n)t(n);else{let a=I.subscribe(()=>{n=r.get(e),n&&(a(),t(n))})}})}};var co=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:wt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):wt.await()}};var ie=class extends co{constructor(e=!0,t){var n;super(t),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Ae,this.cache=e?a.commonCache:new Ae}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((t,n)=>0|31*t+n.charCodeAt(0),0))}};var lo=class extends ie{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Da=class{addCommand(e,t=!1){I.commands.add(e,t)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Da;var Vc,Jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},cp=Symbol("clearAfterUnitTest"),uo=class extends $r(ie){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Vc]=()=>{this.defaultMessages={},this.cache=new Ae,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let t=e.name.toLowerCase();this.cache.setFinal(t,e),this.notify(t)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,t){var n;if(e=e.toLowerCase(),t&&Object.keys(t).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...t};ae(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var t,n;return this.fetchContext(e),(n=(t=this.cache.getNow(e))===null||t===void 0?void 0:t.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,t){let n=e.toLowerCase();return this.resolveContext(n)[t]}resolveMessage(e,t,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new Sr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(t,...n)}async fetchContext(e){let t=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),t&&await this.notify(e)}catch(a){!(a instanceof Pe)&&t&&console.error(a)}return n}subscribe(e,t){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(t),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(t)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Jt({loadedContexts:e})),this.dispatchEvent(new Jt({loadedContexts:e})),await Promise.all(e.map(t=>this.notify(t,!1)))}async notify(e,t=!0){t&&(document.body.dispatchEvent(new Jt({loadedContexts:[e]})),this.dispatchEvent(new Jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Wr(0).then(()=>n()).catch(()=>null)))}};Vc=cp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends uo{constructor(){super(async(r,e)=>(await this.awaitApi).getFluidTopicsMessageContext(r,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends uo{constructor(){super(async(r,e)=>(await this.awaitApi).getCustomMessageContext(r,e))}});var Kc=window.FluidTopicsI18nService,Kx=window.FluidTopicsCustomI18nService;var Fa=class{highlightHtml(e,t,n){Mn(e,t,n)}};window.FluidTopicsHighlightHtmlService=new Fa;var po=class extends ie{async listMySearches(){let{session:e}=I.getState();return We(e,$.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Ua=class{isDate(e){var t,n,a,i;return(i=(a=((n=(t=I.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,t){var n,a,i;return vt.format(e,(n=t?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(a=t?.longFormat)!==null&&a!==void 0?a:!1,(i=t?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Ua;var Ir=class{static get(e,t){var n,a;let i=I.getState(),{lang:s,region:l}=(a=(n=i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new qt(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,t??`${s}-${l}`)}};var Ba=class{urlToSearchRequest(e){return Ir.get().parse(e)}searchRequestToUrl(e){return Ir.get().serialize(e)}};window.FluidTopicsUrlService=new Ba;var Ct=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:{currentItem:e}})}};Ct.eventName="change";var Ha=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let t=sessionStorage.getItem(this.itemName(e));return t?JSON.parse(t):void 0}set(e,t){sessionStorage.setItem(this.itemName(e),JSON.stringify(t))}},Zc=new Ha;var fo=class r extends Me{static build(){return new r(window.history,Zc,()=>window.location,!1)}constructor(e,t,n,a){var i,s;super(),this.history=e,this.historyStorage=t,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,t=!1){let n=t&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),ae(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Ct(this.currentItem())),0)}installProxies(){let e=t=>(n,a,[i,s,l])=>{let d=t(),p={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[p,s,l]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let t=this.history.length-1;t>=0;t--)e?this.states[t]=this.historyStorage.get(t):setTimeout(()=>this.states[t]=this.historyStorage.get(t),this.history.length-t)}updateCurrentState(e){var t;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(t=e?.title)!==null&&t!==void 0?t:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Ct.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ct.eventName,e)}currentItem(){return lr(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 lr(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return lr(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 t;let n=(t=this.states[e])===null||t===void 0?void 0:t.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,t;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(t=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,t){var n;if(!this.hasState(e))return!1;let a=t??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(r),removeHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(r)});function qc(r,e){let{authenticationRequired:t,session:n}=I.getState();return t&&!n?.sessionAuthenticated?Promise.resolve(e):r()}var Y=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},z=class extends ee{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>wt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Ae,this.cleanSessionDebouncer=new Z,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return V`
166
166
  <slot></slot>
167
- `}connectedCallback(){super.connectedCallback(),I.addEventListener(_e.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(_e.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var t,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Vc.addContext(p)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((t=this.localesConfiguration)===null||t===void 0?void 0:t.defaultLocales),I.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),I.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>qc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=jc;Y([A()],z.prototype,"baseUrl",void 0);Y([A()],z.prototype,"apiIntegrationIdentifier",void 0);Y([A()],z.prototype,"apiIntegrationAppVersion",void 0);Y([A()],z.prototype,"uiLocale",void 0);Y([Ve(null)],z.prototype,"availableUiLocales",void 0);Y([Ve(null)],z.prototype,"metadataConfiguration",void 0);Y([A({type:Boolean})],z.prototype,"editorMode",void 0);Y([A({type:Boolean})],z.prototype,"noCustom",void 0);Y([A({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);Y([A({converter:{fromAttribute(r){return r==="false"?!1:r==="true"||(r??!1)}}})],z.prototype,"noCustomComponent",void 0);Y([A({type:Boolean})],z.prototype,"withManualResources",void 0);Y([A({type:Boolean})],z.prototype,"navigatorOnline",void 0);Y([A({type:Boolean})],z.prototype,"forcedOffline",void 0);Y([A({type:Object})],z.prototype,"apiProvider",void 0);Y([A({type:Boolean})],z.prototype,"authenticationRequired",void 0);Y([Ve([])],z.prototype,"messageContexts",void 0);Y([Ve(void 0)],z.prototype,"session",void 0);Y([K()],z.prototype,"localesConfiguration",void 0);Y([K()],z.prototype,"availableContentLocales",void 0);var ho=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},JS=X(Symbol("withDateFormat"),function(r){class e extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>vt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ho([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ho([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ho([j({store:I.name,selector:t=>{var n,a;return(a=(n=t.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),ho([j({store:I.name})],e.prototype,"uiLocale",void 0),e});var go=class extends ie{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var mo=class extends ie{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var lp="ft-user-assets",dp={setAssetCount:(r,e)=>{let{userAssetType:t,count:n}=e.payload.assetCount;r.assetCounts.allAsset[t]=n},clearAssetCount:r=>{Object.values(me).forEach(e=>{r.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(r,e)=>{let t=e.payload.mapId;r.assetCounts.bookmarkByMap[t]=e.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,e)=>{let{assetType:t,mapId:n,asset:a}=e.payload;$a(r,t,[...Wa(r,t),a]),Yc(r,t,1,n),Jc(r,a)},editAsset:(r,e)=>{let{assetType:t,asset:n}=e.payload;$a(r,t,Wa(r,t).map(a=>a.id===n.id?n:a)),Jc(r,n)},removeAsset:(r,e)=>{let{assetType:t,mapId:n,assetId:a}=e.payload;$a(r,t,Wa(r,t).filter(i=>i.id!==a)),Yc(r,t,-1,n)}},Qc={[me.SEARCHES]:"savedSearches",[me.BOOKMARKS]:"bookmarks",[me.BOOKS]:void 0,[me.COLLECTIONS]:void 0},Wa=(r,e)=>{var t;let n=Qc[e];return n?(t=r[n])!==null&&t!==void 0?t:[]:[]},$a=(r,e,t)=>{let n=Qc[e];n&&(r[n]=t)},Yc=(r,e,t,n)=>{let a=r.assetCounts.allAsset[e];if(a!==void 0&&(r.assetCounts.allAsset[e]=Math.max(0,a+t),e===me.BOOKMARKS&&n)){let i=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,i+t)}},Jc=(r,e)=>{let t=r.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!t.includes(a)).map(a=>({title:a}));r.assetLabels.push(...n)},fe=He.get({name:lp,reducers:dp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(me).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),za=class{constructor(e=new go,t=new mo){this.assetCountsService=e,this.assetLabelsService=t,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new lo,this.savedSearchesService=new po,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:t}=I.getState();ae((e=this.currentSession)===null||e===void 0?void 0:e.profile,t?.profile)||(this.currentSession=t,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),fe.actions.clearAssetCount(),fe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),fe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),fe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();fe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();fe.actions.assetLabels(e)}async loadAssetCount(e){let t=await this.assetCountsService.getUserAssetCount(e);t&&fe.actions.setAssetCount({assetCount:t})}async loadBookmarkByMapId(e){let t=await this.assetCountsService.getUserBookmarkCountByMap(e);t&&fe.actions.setBookmarkCountByMap({count:t.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let t=Object.keys(fe.getState().assetCounts.bookmarkByMap).length!==0;e===me.BOOKMARKS&&t&&fe.actions.clearBookmarkCountByMap(),fe.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 t=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;fe.actions.bookmarks(t)}}},ja=new za;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ja);se("ft-app-context")(z);var yo=class extends ie{get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,t,n){super(!1,t),this.converter=e,this._mapId=n,this.initCache()}async withMapId(e){return this._mapId?e(this._mapId):void 0}initCache(){this.cache.register("configuration",()=>this.api.getReaderConfiguration()),this.cache.register("map",()=>this.withMapId(e=>this.fetchMap(e))),this.cache.register("enrichedToc",()=>this.withMapId(e=>this.fetchPages(e).then(t=>this.converter.convertPaginatedToc(e,t)))),this.cache.register("ratingSummary",()=>{var e,t;return We((t=(e=I.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&t!==void 0?t:[],"RATING_USER")?this.withMapId(a=>this.fetchMapRating(a)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,t){return e+(t?"-destinationLanguage-"+t?.destinationLanguage:"")}getMap(e){return this.cache.get(this.makeCacheKey("map",e),()=>this.fetchMap(this.mapId,e))}getMapNow(e){return this.cache.getNow(this.makeCacheKey("map",e))}getConfiguration(){return this.cache.get("configuration")}clearConfiguration(){this.cache.clear("configuration")}getEnrichedToc(e){return this.cache.get(this.makeCacheKey("enrichedToc",e),()=>this.fetchPages(this.mapId,e).then(t=>this.converter.convertPaginatedToc(this.mapId,t)))}getEnrichedTocNow(e){return this.cache.getNow(this.makeCacheKey("enrichedToc",e))}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(e){return(await this.getEnrichedToc(e)).toc}async getPagesToc(e){return(await this.getEnrichedToc(e)).pagesToc}async getTranslationError(e){return(await this.getEnrichedToc(e)).translationError}async getTocNode(e,t){return(await this.getEnrichedToc(t)).nodeByTocId[e]}getTocNodeNow(e,t){var n;return(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,t){var n,a;let i=this.getMapNow(t);return i?.prettyUrl==e||`${i?.id}/root`===e?(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.toc[0]:(a=this.getEnrichedTocNow(t))===null||a===void 0?void 0:a.nodeByUrl[e]}async getPage(e,t){let n=await this.getEnrichedToc(t);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,t){let n=await this.getEnrichedToc(t);return n.pageByTocId[e]||n.pages[0]}getTopicInfo(e){return this.cache.get("topic-"+e.tocId,()=>this.fetchTopicMetadata(e))}getTopicContent(e){return this.cache.get("topic-content-"+e.tocId,()=>this.fetchTopicHTMLContent(e))}getTranslatedTopicContent(e,t){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,t),()=>this.fetchTranslatedTopicHTMLContent(e,t))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,t){return this.cache.get("document-relatives-"+e+"-"+t.join("-"),()=>this.fetchRelativesForDocument(e,t))}getRelativesForTopicInMap(e,t,n){return this.cache.get("topic-relatives-"+[e,t,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,t,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,t,n){let a=this.getNavigationData(e,t,n),i=this.getReaderLinkPrefix()+(a.prettyUrl?a.prettyUrl:`${a.mapId}/${a.tocId}`),s=new URL(i,this.api.tenantBaseUrl);return a.page!=null&&s.searchParams.set("page",`${a.page}`),a.prettyUrlDuplicated&&s.searchParams.set("tocId",a.tocId),a.section!=null&&s.searchParams.set("section",a.section),s.href}getNavigationData(e,t,n,a){var i,s;e=e||"root";let l=this.getEnrichedTocNow(a),d=l?.pageByTocId[e],p=l?.nodeByTocId[e],h=p?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(i=p?.title)!==null&&i!==void 0?i:"",untranslatedTopicTitle:p?.untranslatedTitle,page:t&&d&&d.number!==t?t:void 0,prettyUrl:h?.replace(/^r\//,""),prettyUrlDuplicated:(s=l?.duplicatedPrettyUrls.has(h??""))!==null&&s!==void 0?s:!1,section:n}}async getAccurateNavigationData(e,t,n,a){return await this.getEnrichedToc(a),this.getNavigationData(e,t,n,a)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then(e=>e?.publication)}getTopicRating(e){return this.getRatingSummary().then(t=>{var n;return t?{type:t.topics.type,rating:(n=t.topics)===null||n===void 0?void 0:n.ratings.find(a=>a.tocId===e)}:void 0})}rateMap(e,t){return this.makeRateMapRequest(e,t).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,t){return this.makeMapFeedbackRequest(e,t)}rateTopic(e,t,n){return this.makeRateTopicRequest(e,t,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=I.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,t,n){return this.makeTopicFeedbackRequest(e,t,n)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,t){let n=this.getTocNodeNow(e,t),a=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],i=this.getTocNodeNow(n.parentTocId,t);for(;i;)a.unshift({tocId:i.tocId,title:i.title,untranslatedTitle:i.untranslatedTitle}),i=this.getTocNodeNow(i.parentTocId,t);return a}isFeatureAccessible(e,{session:t}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case $e.FEEDBACK:return We(t??[],$.FEEDBACK_USER);case $e.RATING:return We(t??[],$.RATING_USER);case $e.PRINT:return We(t??[],$.PRINT_USER);case $e.BOOKMARK:return!!t?.sessionAuthenticated;case $e.COLLECTIONS:return We(t??[],$.COLLECTION_USER);case $e.PERSONAL_BOOKS:return We(t??[],$.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var bo=class r extends yo{static async build(e){return new r(new so,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,t){let n=await this.api.getMap(e,t);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,t){return await this.getMap(t),this.api.getPages(e,this.fingerprint,t)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,t){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,t)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,t){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:t}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,t,n){let a={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:t,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(a)}makeMapFeedbackRequest(e,t){return this.api.sendMapFeedback(this.mapId,e,t)}makeRateMapRequest(e,t){return this.api.rateMap(this.mapId,e,t)}makeRateTopicRequest(e,t,n){return this.api.rateTopic(this.mapId,e,t,n)}makeTopicFeedbackRequest(e,t,n){return this.api.sendTopicFeedback(this.mapId,e,t,n)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(e){return this.api.unrateTopic(this.mapId,e)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(e){return!0}};var vo=class r{static build(e,t){return new r(zc(e.trim()||"context"),t??bo.build)}loaded(){return cr(()=>this._loaded)}constructor(e,t,n){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new Z(10),this.initService(t)}async initService(e){return this.service=await e(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(e){e!==this.store.getState().mapId&&(this.store.actions.mapId(e),this.service&&(this.service.mapId=e),await this.reload())}setRenderedTopics(e){this.store.actions.renderedTopics(e)}setVisibleTopics(e){this.store.actions.visibleTopics(e)}async awaitService(){return lt(()=>this.service)}async navigateToTopic(e,t,n){await this.loaded();let a=await this.awaitService(),i=await(n!=null?a.getPage(n,this.getTranslationSettings()):a.getPageByTocId(e??"root",this.getTranslationSettings()));this.store.actions.currentPage(i);let s=this.resolveValidNonRootTocId(e,i);this.store.actions.scrollTarget({tocId:s,section:t}),this.store.getState().visibleTopics[0]!==s&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,t){var n,a,i;let s=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:t.rootTocId;return t.topics.includes(s)?s:(i=(a=t.topics[0])!==null&&a!==void 0?a:t.hiddenTopics[0])!==null&&i!==void 0?i:"root"}async navigateToPage(e){await this.loaded();let n=await(await this.awaitService()).getPage(e,this.getTranslationSettings());this.store.actions.currentPage(n)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var e;!((e=this.service)===null||e===void 0)&&e.mapId&&this.store.getState().map==null&&await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}clear(){var e;this._loaded=!1,this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),this.store.actions.relatives(void 0),this.store.actions.renderedTopics([]),this.store.actions.visibleTopics([]),this.store.actions.translation({sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1}),this.store.actions.mapRating(void 0),(e=this.service)===null||e===void 0||e.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(e){var t,n,a,i,s;try{e&&this.setTranslationLoading(!0);let l=d=>{throw e&&this.setTranslationError(!0),d};await Promise.all([this.loadConfiguration(),(t=this.service)===null||t===void 0?void 0:t.getMap(e).then(d=>this.store.actions.map(d)).catch(l),(n=this.service)===null||n===void 0?void 0:n.getToc(e).then(d=>this.store.actions.toc(d)).catch(l),(a=this.service)===null||a===void 0?void 0:a.getPagesToc(e).then(d=>this.store.actions.pagesToc(d)).catch(l),(i=this.service)===null||i===void 0?void 0:i.getPaginationConfiguration().then(d=>this.store.actions.paginationConfiguration(d)).catch(l),(s=this.service)===null||s===void 0?void 0:s.getTranslationError(e).then(d=>this.setTranslationError(d))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,e&&this.setTranslationLoading(!1)}catch(l){this.errorHandler&&!(l instanceof Pe)&&this.errorHandler(l)}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(t=>this.store.actions.configuration(t))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}fetchRelatives(){var e,t;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(a=>{var i;return a.key==((i=this.store.getState().configuration)===null||i===void 0?void 0:i.relativePivotMetadata)}).flatMap(a=>a.values);n!==void 0&&n.length>0?(t=this.service)===null||t===void 0||t.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n).then(a=>{let i=a.results.flatMap(s=>s.entries);this.store.actions.relatives(i),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new Event(Ot.clusteringHelperCreated))}createClusteringHelper(){var e,t;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let n=this.store.getState().relatives;if(n){let a=n.find(s=>{var l;return((l=s.map)===null||l===void 0?void 0:l.mapId)==this.store.getState().mapId}),i=(t=(e=I.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&t!==void 0?t:[];return new pr(n,a,this.metadataForSwitchToRelatives,i)}}async navigateToRelativeTopicIfFound(e){var t,n,a;await this.loaded();let i=await lt(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),s=this.store.getState().mapId,d=await(await this.awaitService()).getRelativesForTopicInMap(s,i,[e]);if(!((a=(n=(t=d?.results)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.entries)===null||a===void 0)&&a[0]){let p=d.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(e){this.store.actions.searchInDocumentQuery(e)}async setTranslationDestinationLanguage(e){this.store.actions.setTranslationDestinationLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}async setTranslationSourceLanguage(e){this.store.actions.setTranslationSourceLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}async setTranslationProfileId(e){this.store.actions.setTranslationProfileId(e)}async setTranslationLoading(e){this.store.actions.setTranslationLoading(e)}async setTranslationError(e){this.store.actions.setTranslationError(e)}getTranslationSettings(){var e;let t=this.store.getState();return t.translation.profileId&&t.translation.destinationLanguage?{profileId:t.translation.profileId,destinationLanguage:t.translation.destinationLanguage.code,sourceLanguage:(e=t.map)===null||e===void 0?void 0:e.lang}:void 0}setLinkPreviewDialogId(e){this.store.actions.setLinkPreviewDialogId(e)}async fetchMapRating(){var e;this.store.actions.mapRating(await((e=this.service)===null||e===void 0?void 0:e.getMapRating()))}async fetchTopicRating(e){var t;let n=await((t=this.service)===null||t===void 0?void 0:t.getTopicRating(e));n&&this.store.actions.setTopicsRating({[e]:n})}registerMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.add(e),this.store.getState().relatives==null?this.fetchRelatives():this.updateClusteringHelper()}unregisterMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.delete(e),this.updateClusteringHelper()}getAccurateNavigationData(e,t,n){return this.service.getAccurateNavigationData(e,t?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var t;return(t=this.service)===null||t===void 0?void 0:t.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var t,n;let a=this.getTranslationSettings();return a?(t=this.service)===null||t===void 0?void 0:t.getTranslatedTopicContent(e,a).then(i=>(i.isTranslationError&&this.setTranslationError(!0),i.content)):(n=this.service)===null||n===void 0?void 0:n.getTopicContent(e)}getTocNode(e){return this.service.getTocNode(e,this.getTranslationSettings())}getPage(e){return this.service.getPage(e,this.getTranslationSettings())}onMapAttachmentsUpdate(){var e;(e=this.service)===null||e===void 0||e.clearMapAttachments(),this.store.dispatchEvent(new Event(Ot.mapAttachmentsUpdate))}};var Xc=U`
167
+ `}connectedCallback(){super.connectedCallback(),I.addEventListener(_e.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(_e.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var t,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Kc.addContext(p)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((t=this.localesConfiguration)===null||t===void 0?void 0:t.defaultLocales),I.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),I.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.actions.availableContentLocales((d=(l=this.availableContentLocales)===null||l===void 0?void 0:l.contentLocales)!==null&&d!==void 0?d:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>qc(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=Gc;Y([A()],z.prototype,"baseUrl",void 0);Y([A()],z.prototype,"apiIntegrationIdentifier",void 0);Y([A()],z.prototype,"apiIntegrationAppVersion",void 0);Y([A()],z.prototype,"uiLocale",void 0);Y([Ve(null)],z.prototype,"availableUiLocales",void 0);Y([Ve(null)],z.prototype,"metadataConfiguration",void 0);Y([A({type:Boolean})],z.prototype,"editorMode",void 0);Y([A({type:Boolean})],z.prototype,"noCustom",void 0);Y([A({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);Y([A({converter:{fromAttribute(r){return r==="false"?!1:r==="true"||(r??!1)}}})],z.prototype,"noCustomComponent",void 0);Y([A({type:Boolean})],z.prototype,"withManualResources",void 0);Y([A({type:Boolean})],z.prototype,"navigatorOnline",void 0);Y([A({type:Boolean})],z.prototype,"forcedOffline",void 0);Y([A({type:Object})],z.prototype,"apiProvider",void 0);Y([A({type:Boolean})],z.prototype,"authenticationRequired",void 0);Y([Ve([])],z.prototype,"messageContexts",void 0);Y([Ve(void 0)],z.prototype,"session",void 0);Y([K()],z.prototype,"localesConfiguration",void 0);Y([K()],z.prototype,"availableContentLocales",void 0);var ho=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},JS=X(Symbol("withDateFormat"),function(r){class e extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>vt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ho([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ho([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ho([j({store:I.name,selector:t=>{var n,a;return(a=(n=t.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),ho([j({store:I.name})],e.prototype,"uiLocale",void 0),e});var go=class extends ie{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var mo=class extends ie{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var lp="ft-user-assets",dp={setAssetCount:(r,e)=>{let{userAssetType:t,count:n}=e.payload.assetCount;r.assetCounts.allAsset[t]=n},clearAssetCount:r=>{Object.values(me).forEach(e=>{r.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(r,e)=>{let t=e.payload.mapId;r.assetCounts.bookmarkByMap[t]=e.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,e)=>{let{assetType:t,mapId:n,asset:a}=e.payload;$a(r,t,[...Wa(r,t),a]),Yc(r,t,1,n),Jc(r,a)},editAsset:(r,e)=>{let{assetType:t,asset:n}=e.payload;$a(r,t,Wa(r,t).map(a=>a.id===n.id?n:a)),Jc(r,n)},removeAsset:(r,e)=>{let{assetType:t,mapId:n,assetId:a}=e.payload;$a(r,t,Wa(r,t).filter(i=>i.id!==a)),Yc(r,t,-1,n)}},Qc={[me.SEARCHES]:"savedSearches",[me.BOOKMARKS]:"bookmarks",[me.BOOKS]:void 0,[me.COLLECTIONS]:void 0},Wa=(r,e)=>{var t;let n=Qc[e];return n?(t=r[n])!==null&&t!==void 0?t:[]:[]},$a=(r,e,t)=>{let n=Qc[e];n&&(r[n]=t)},Yc=(r,e,t,n)=>{let a=r.assetCounts.allAsset[e];if(a!==void 0&&(r.assetCounts.allAsset[e]=Math.max(0,a+t),e===me.BOOKMARKS&&n)){let i=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,i+t)}},Jc=(r,e)=>{let t=r.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!t.includes(a)).map(a=>({title:a}));r.assetLabels.push(...n)},fe=He.get({name:lp,reducers:dp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(me).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),za=class{constructor(e=new go,t=new mo){this.assetCountsService=e,this.assetLabelsService=t,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new lo,this.savedSearchesService=new po,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:t}=I.getState();ae((e=this.currentSession)===null||e===void 0?void 0:e.profile,t?.profile)||(this.currentSession=t,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),fe.actions.clearAssetCount(),fe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),fe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),fe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();fe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();fe.actions.assetLabels(e)}async loadAssetCount(e){let t=await this.assetCountsService.getUserAssetCount(e);t&&fe.actions.setAssetCount({assetCount:t})}async loadBookmarkByMapId(e){let t=await this.assetCountsService.getUserBookmarkCountByMap(e);t&&fe.actions.setBookmarkCountByMap({count:t.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let t=Object.keys(fe.getState().assetCounts.bookmarkByMap).length!==0;e===me.BOOKMARKS&&t&&fe.actions.clearBookmarkCountByMap(),fe.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 t=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;fe.actions.bookmarks(t)}}},ja=new za;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=ja);se("ft-app-context")(z);var yo=class extends ie{get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,t,n){super(!1,t),this.converter=e,this._mapId=n,this.initCache()}async withMapId(e){return this._mapId?e(this._mapId):void 0}initCache(){this.cache.register("configuration",()=>this.api.getReaderConfiguration()),this.cache.register("map",()=>this.withMapId(e=>this.fetchMap(e))),this.cache.register("enrichedToc",()=>this.withMapId(e=>this.fetchPages(e).then(t=>this.converter.convertPaginatedToc(e,t)))),this.cache.register("ratingSummary",()=>{var e,t;return We((t=(e=I.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&t!==void 0?t:[],"RATING_USER")?this.withMapId(a=>this.fetchMapRating(a)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,t){return e+(t?"-destinationLanguage-"+t?.destinationLanguage:"")}getMap(e){return this.cache.get(this.makeCacheKey("map",e),()=>this.fetchMap(this.mapId,e))}getMapNow(e){return this.cache.getNow(this.makeCacheKey("map",e))}getConfiguration(){return this.cache.get("configuration")}clearConfiguration(){this.cache.clear("configuration")}getEnrichedToc(e){return this.cache.get(this.makeCacheKey("enrichedToc",e),()=>this.fetchPages(this.mapId,e).then(t=>this.converter.convertPaginatedToc(this.mapId,t)))}getEnrichedTocNow(e){return this.cache.getNow(this.makeCacheKey("enrichedToc",e))}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(e){return(await this.getEnrichedToc(e)).toc}async getPagesToc(e){return(await this.getEnrichedToc(e)).pagesToc}async getTranslationError(e){return(await this.getEnrichedToc(e)).translationError}async getTocNode(e,t){return(await this.getEnrichedToc(t)).nodeByTocId[e]}getTocNodeNow(e,t){var n;return(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,t){var n,a;let i=this.getMapNow(t);return i?.prettyUrl==e||`${i?.id}/root`===e?(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.toc[0]:(a=this.getEnrichedTocNow(t))===null||a===void 0?void 0:a.nodeByUrl[e]}async getPage(e,t){let n=await this.getEnrichedToc(t);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,t){let n=await this.getEnrichedToc(t);return n.pageByTocId[e]||n.pages[0]}getTopicInfo(e){return this.cache.get("topic-"+e.tocId,()=>this.fetchTopicMetadata(e))}getTopicContent(e){return this.cache.get("topic-content-"+e.tocId,()=>this.fetchTopicHTMLContent(e))}getTranslatedTopicContent(e,t){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,t),()=>this.fetchTranslatedTopicHTMLContent(e,t))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,t){return this.cache.get("document-relatives-"+e+"-"+t.join("-"),()=>this.fetchRelativesForDocument(e,t))}getRelativesForTopicInMap(e,t,n){return this.cache.get("topic-relatives-"+[e,t,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,t,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,t,n){let a=this.getNavigationData(e,t,n),i=this.getReaderLinkPrefix()+(a.prettyUrl?a.prettyUrl:`${a.mapId}/${a.tocId}`),s=new URL(i,this.api.tenantBaseUrl);return a.page!=null&&s.searchParams.set("page",`${a.page}`),a.prettyUrlDuplicated&&s.searchParams.set("tocId",a.tocId),a.section!=null&&s.searchParams.set("section",a.section),s.href}getNavigationData(e,t,n,a){var i,s;e=e||"root";let l=this.getEnrichedTocNow(a),d=l?.pageByTocId[e],p=l?.nodeByTocId[e],h=p?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(i=p?.title)!==null&&i!==void 0?i:"",untranslatedTopicTitle:p?.untranslatedTitle,page:t&&d&&d.number!==t?t:void 0,prettyUrl:h?.replace(/^r\//,""),prettyUrlDuplicated:(s=l?.duplicatedPrettyUrls.has(h??""))!==null&&s!==void 0?s:!1,section:n}}async getAccurateNavigationData(e,t,n,a){return await this.getEnrichedToc(a),this.getNavigationData(e,t,n,a)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then(e=>e?.publication)}getTopicRating(e){return this.getRatingSummary().then(t=>{var n;return t?{type:t.topics.type,rating:(n=t.topics)===null||n===void 0?void 0:n.ratings.find(a=>a.tocId===e)}:void 0})}rateMap(e,t){return this.makeRateMapRequest(e,t).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,t){return this.makeMapFeedbackRequest(e,t)}rateTopic(e,t,n){return this.makeRateTopicRequest(e,t,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=I.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,t,n){return this.makeTopicFeedbackRequest(e,t,n)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,t){let n=this.getTocNodeNow(e,t),a=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],i=this.getTocNodeNow(n.parentTocId,t);for(;i;)a.unshift({tocId:i.tocId,title:i.title,untranslatedTitle:i.untranslatedTitle}),i=this.getTocNodeNow(i.parentTocId,t);return a}isFeatureAccessible(e,{session:t}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case $e.FEEDBACK:return We(t??[],$.FEEDBACK_USER);case $e.RATING:return We(t??[],$.RATING_USER);case $e.PRINT:return We(t??[],$.PRINT_USER);case $e.BOOKMARK:return!!t?.sessionAuthenticated;case $e.COLLECTIONS:return We(t??[],$.COLLECTION_USER);case $e.PERSONAL_BOOKS:return We(t??[],$.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var bo=class r extends yo{static async build(e){return new r(new so,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,t){let n=await this.api.getMap(e,t);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,t){return await this.getMap(t),this.api.getPages(e,this.fingerprint,t)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,t){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,t)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,t){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:t}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,t,n){let a={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:t,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(a)}makeMapFeedbackRequest(e,t){return this.api.sendMapFeedback(this.mapId,e,t)}makeRateMapRequest(e,t){return this.api.rateMap(this.mapId,e,t)}makeRateTopicRequest(e,t,n){return this.api.rateTopic(this.mapId,e,t,n)}makeTopicFeedbackRequest(e,t,n){return this.api.sendTopicFeedback(this.mapId,e,t,n)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(e){return this.api.unrateTopic(this.mapId,e)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(e){return!0}};var vo=class r{static build(e,t){return new r(jc(e.trim()||"context"),t??bo.build)}loaded(){return cr(()=>this._loaded)}constructor(e,t,n){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new Z(10),this.initService(t)}async initService(e){return this.service=await e(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(e){e!==this.store.getState().mapId&&(this.store.actions.mapId(e),this.service&&(this.service.mapId=e),await this.reload())}setRenderedTopics(e){this.store.actions.renderedTopics(e)}setVisibleTopics(e){this.store.actions.visibleTopics(e)}async awaitService(){return lt(()=>this.service)}async navigateToTopic(e,t,n){await this.loaded();let a=await this.awaitService(),i=await(n!=null?a.getPage(n,this.getTranslationSettings()):a.getPageByTocId(e??"root",this.getTranslationSettings()));this.store.actions.currentPage(i);let s=this.resolveValidNonRootTocId(e,i);this.store.actions.scrollTarget({tocId:s,section:t}),this.store.getState().visibleTopics[0]!==s&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,t){var n,a,i;let s=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:t.rootTocId;return t.topics.includes(s)?s:(i=(a=t.topics[0])!==null&&a!==void 0?a:t.hiddenTopics[0])!==null&&i!==void 0?i:"root"}async navigateToPage(e){await this.loaded();let n=await(await this.awaitService()).getPage(e,this.getTranslationSettings());this.store.actions.currentPage(n)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var e;!((e=this.service)===null||e===void 0)&&e.mapId&&this.store.getState().map==null&&await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}clear(){var e;this._loaded=!1,this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),this.store.actions.relatives(void 0),this.store.actions.renderedTopics([]),this.store.actions.visibleTopics([]),this.store.actions.translation({sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1}),this.store.actions.mapRating(void 0),(e=this.service)===null||e===void 0||e.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(e){var t,n,a,i,s;try{e&&this.setTranslationLoading(!0);let l=d=>{throw e&&this.setTranslationError(!0),d};await Promise.all([this.loadConfiguration(),(t=this.service)===null||t===void 0?void 0:t.getMap(e).then(d=>this.store.actions.map(d)).catch(l),(n=this.service)===null||n===void 0?void 0:n.getToc(e).then(d=>this.store.actions.toc(d)).catch(l),(a=this.service)===null||a===void 0?void 0:a.getPagesToc(e).then(d=>this.store.actions.pagesToc(d)).catch(l),(i=this.service)===null||i===void 0?void 0:i.getPaginationConfiguration().then(d=>this.store.actions.paginationConfiguration(d)).catch(l),(s=this.service)===null||s===void 0?void 0:s.getTranslationError(e).then(d=>this.setTranslationError(d))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,e&&this.setTranslationLoading(!1)}catch(l){this.errorHandler&&!(l instanceof Pe)&&this.errorHandler(l)}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(t=>this.store.actions.configuration(t))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}fetchRelatives(){var e,t;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(a=>{var i;return a.key==((i=this.store.getState().configuration)===null||i===void 0?void 0:i.relativePivotMetadata)}).flatMap(a=>a.values);n!==void 0&&n.length>0?(t=this.service)===null||t===void 0||t.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n).then(a=>{let i=a.results.flatMap(s=>s.entries);this.store.actions.relatives(i),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new Event(Ot.clusteringHelperCreated))}createClusteringHelper(){var e,t;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let n=this.store.getState().relatives;if(n){let a=n.find(s=>{var l;return((l=s.map)===null||l===void 0?void 0:l.mapId)==this.store.getState().mapId}),i=(t=(e=I.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&t!==void 0?t:[];return new pr(n,a,this.metadataForSwitchToRelatives,i)}}async navigateToRelativeTopicIfFound(e){var t,n,a;await this.loaded();let i=await lt(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),s=this.store.getState().mapId,d=await(await this.awaitService()).getRelativesForTopicInMap(s,i,[e]);if(!((a=(n=(t=d?.results)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.entries)===null||a===void 0)&&a[0]){let p=d.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(e){this.store.actions.searchInDocumentQuery(e)}async setTranslationDestinationLanguage(e){this.store.actions.setTranslationDestinationLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}async setTranslationSourceLanguage(e){this.store.actions.setTranslationSourceLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}async setTranslationProfileId(e){this.store.actions.setTranslationProfileId(e)}async setTranslationLoading(e){this.store.actions.setTranslationLoading(e)}async setTranslationError(e){this.store.actions.setTranslationError(e)}getTranslationSettings(){var e;let t=this.store.getState();return t.translation.profileId&&t.translation.destinationLanguage?{profileId:t.translation.profileId,destinationLanguage:t.translation.destinationLanguage.code,sourceLanguage:(e=t.map)===null||e===void 0?void 0:e.lang}:void 0}setLinkPreviewDialogId(e){this.store.actions.setLinkPreviewDialogId(e)}async fetchMapRating(){var e;this.store.actions.mapRating(await((e=this.service)===null||e===void 0?void 0:e.getMapRating()))}async fetchTopicRating(e){var t;let n=await((t=this.service)===null||t===void 0?void 0:t.getTopicRating(e));n&&this.store.actions.setTopicsRating({[e]:n})}registerMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.add(e),this.store.getState().relatives==null?this.fetchRelatives():this.updateClusteringHelper()}unregisterMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.delete(e),this.updateClusteringHelper()}getAccurateNavigationData(e,t,n){return this.service.getAccurateNavigationData(e,t?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var t;return(t=this.service)===null||t===void 0?void 0:t.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var t,n;let a=this.getTranslationSettings();return a?(t=this.service)===null||t===void 0?void 0:t.getTranslatedTopicContent(e,a).then(i=>(i.isTranslationError&&this.setTranslationError(!0),i.content)):(n=this.service)===null||n===void 0?void 0:n.getTopicContent(e)}getTocNode(e){return this.service.getTocNode(e,this.getTranslationSettings())}getPage(e){return this.service.getPage(e,this.getTranslationSettings())}onMapAttachmentsUpdate(){var e;(e=this.service)===null||e===void 0||e.clearMapAttachments(),this.store.dispatchEvent(new Event(Ot.mapAttachmentsUpdate))}};var Xc=U`
168
168
  `;var xo=class extends CustomEvent{constructor(e,t){super("ft-reader-map-loaded",{detail:{map:e,toc:t}})}},So=class extends CustomEvent{constructor(e,t){super("ft-reader-visible-topics-change",{detail:{visibleTopics:t}})}},Oo=class extends CustomEvent{constructor(e){super("ft-reader-navigation-done",{detail:e})}},Eo=class extends CustomEvent{constructor(e){super("ft-reader-load-error",{detail:e})}},wo=class extends Event{constructor(){super("ft-reader-map-not-found")}},Co=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},Ao=class extends Event{constructor(){super("ft-reader-map-forbidden")}},Ro=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var Io=class{constructor(e){this.stateManager=e}searchInDocument(e){this.stateManager.setSearchInDocumentQuery(e??"")}};var de=function(r,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},up=r=>e=>+(e??"NaN")>0?+e:r,J=class extends mt{constructor(){super(),this.visibleTopics=[],this.updateConfiguration=()=>{this.stateManager.reloadConfiguration()},this.scrollToTargetDebouncer=new Z(5),this.navigationDebouncer=new Z(10),this.mapLoadedEventDebouncer=new Z(50),this.addStore(I)}render(){return V`
169
169
  ${this.importStyleIfNeeded()}
170
170
  <slot @register-ft-reader-component=${this.registerComponent}></slot>
@@ -199,7 +199,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
199
199
  headingLevelsShift="${this.headingLevelsShift}">
200
200
  ${this.renderTopic(e,t)}
201
201
  </ft-reader-topic-context>
202
- `}getScrollTarget(){var e,t,n;if(this.disableContextInteractions)return null;let a=(e=this.container)===null||e===void 0?void 0:e.isRendered((t=this.scrollTarget)===null||t===void 0?void 0:t.tocId);return!((n=this.scrollTarget)===null||n===void 0)&&n.tocId&&(!a||this.scrollTarget.section==null)?this.scrollTarget.tocId:null}renderedTopicChange(e){this.disableContextInteractions||this.renderedTopicsDebouncer.run(()=>{var t;return(t=this.stateManager)===null||t===void 0?void 0:t.setRenderedTopics(e.detail.items)})}visibleTopicChange(e){var t;this.disableContextInteractions||this.visibleTopicsDebouncer.run(()=>{var n;return(n=this.stateManager)===null||n===void 0?void 0:n.setVisibleTopics(e.detail.items)}),(t=this.stateManager)===null||t===void 0||t.store.dispatchEvent(new Event(Ot.visibleTopicChange))}onScrollDone(){var e,t;!this.disableContextInteractions&&!(!((e=this.scrollTarget)===null||e===void 0)&&e.section)&&((t=this.stateManager)===null||t===void 0||t.scrollDone())}};re.elementDefinitions={"ft-infinite-scroll":q,"ft-reader-watermark":be};re.styles=Hc;Ee([A()],re.prototype,"renderTopic",void 0);Ee([A({type:Boolean})],re.prototype,"disableContextInteractions",void 0);Ee([A({type:Number})],re.prototype,"headingLevelsShift",void 0);Ee([j()],re.prototype,"currentPage",void 0);Ee([j()],re.prototype,"scrollTarget",void 0);Ee([j()],re.prototype,"visibleTopics",void 0);Ee([j({selector:r=>{var e,t;return(t=(e=r.configuration)===null||e===void 0?void 0:e.loadBeforeFirstVisibleTopic)!==null&&t!==void 0?t:5}})],re.prototype,"renderBeforeFirst",void 0);Ee([j({selector:r=>{var e,t;return(t=(e=r.configuration)===null||e===void 0?void 0:e.loadAfterLastVisibleTopic)!==null&&t!==void 0?t:5}})],re.prototype,"renderAfterLast",void 0);Ee([j()],re.prototype,"mapId",void 0);Ee([ze(".ft-reader-content")],re.prototype,"container",void 0);Ee([j({selector:r=>{var e;return(e=r.map)===null||e===void 0?void 0:e.watermark}})],re.prototype,"watermark",void 0);se("ft-reader-content")(re);se("ft-reader-watermark")(be);})();
202
+ `}getScrollTarget(){var e,t,n;if(this.disableContextInteractions)return null;let a=(e=this.container)===null||e===void 0?void 0:e.isRendered((t=this.scrollTarget)===null||t===void 0?void 0:t.tocId);return!((n=this.scrollTarget)===null||n===void 0)&&n.tocId&&(!a||this.scrollTarget.section==null)?this.scrollTarget.tocId:null}renderedTopicChange(e){this.disableContextInteractions||this.renderedTopicsDebouncer.run(()=>{var t;return(t=this.stateManager)===null||t===void 0?void 0:t.setRenderedTopics(e.detail.items)})}visibleTopicChange(e){var t;this.disableContextInteractions||this.visibleTopicsDebouncer.run(()=>{var n;return(n=this.stateManager)===null||n===void 0?void 0:n.setVisibleTopics(e.detail.items)}),(t=this.stateManager)===null||t===void 0||t.store.dispatchEvent(new Event(Ot.visibleTopicChange))}onScrollDone(){var e,t;!this.disableContextInteractions&&!(!((e=this.scrollTarget)===null||e===void 0)&&e.section)&&((t=this.stateManager)===null||t===void 0||t.scrollDone())}};re.elementDefinitions={"ft-infinite-scroll":q,"ft-reader-watermark":be};re.styles=Wc;Ee([A()],re.prototype,"renderTopic",void 0);Ee([A({type:Boolean})],re.prototype,"disableContextInteractions",void 0);Ee([A({type:Number})],re.prototype,"headingLevelsShift",void 0);Ee([j()],re.prototype,"currentPage",void 0);Ee([j()],re.prototype,"scrollTarget",void 0);Ee([j()],re.prototype,"visibleTopics",void 0);Ee([j({selector:r=>{var e,t;return(t=(e=r.configuration)===null||e===void 0?void 0:e.loadBeforeFirstVisibleTopic)!==null&&t!==void 0?t:5}})],re.prototype,"renderBeforeFirst",void 0);Ee([j({selector:r=>{var e,t;return(t=(e=r.configuration)===null||e===void 0?void 0:e.loadAfterLastVisibleTopic)!==null&&t!==void 0?t:5}})],re.prototype,"renderAfterLast",void 0);Ee([j()],re.prototype,"mapId",void 0);Ee([ze(".ft-reader-content")],re.prototype,"container",void 0);Ee([j({selector:r=>{var e;return(e=r.map)===null||e===void 0?void 0:e.watermark}})],re.prototype,"watermark",void 0);se("ft-reader-content")(re);se("ft-reader-watermark")(be);})();
203
203
  /*! Bundled license information:
204
204
 
205
205
  @webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js: