@fluid-topics/ft-reader-topic-title 2.0.11 → 2.0.12
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.
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
`;var he=class extends Rn.FtLitElement{render(){return On.html`
|
|
40
40
|
`}};he.elementDefinitions={};he.styles=xn;var In=A(I());(0,In.customElement)("ft-skeleton")(he);var Dn=A(ne());var Pn=Dn.css`
|
|
41
|
-
`;var nt=A(ne()),Me=A(ie()),k=A(I());var re=A(I());var Mn=A(I()),Vs={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Nn=t=>Mn.FtReduxStore.get({name:"ft-reader-"+t,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:Vs});var gr=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,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,r,n){return e.flatMap(i=>{var s;return i.pageConfiguration&&this.registerPage(this.buildPage(i,n)),i.tocId==null?this.extractPagesToc(i.children,r,n):[{tocId:i.tocId,title:(s=i.title)!==null&&s!==void 0?s:"",untranslatedTitle:i.untranslatedTitle,depth:r,children:this.extractPagesToc(i.children,r+1,i.tocId)}]})}convertNodes(e,r,n){return e.flatMap(i=>{var s,a,o;if(i.tocId==null)return[...this.convertSectionNodes((s=i.pageToc)!==null&&s!==void 0?s:[],r,i.tocId),...this.convertNodes(i.children,r,i.tocId)];let u=(a=i.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={tocId:i.tocId,contentId:i.contentId,title:i.title,untranslatedTitle:i.untranslatedTitle,hasRating:i.hasRating,origin:i.origin,prettyUrl:u,depth:r,parentTocId:n,children:[]};this.register(c);let d=this.convertSectionNodes((o=i.pageToc)!==null&&o!==void 0?o:[],r+1,i.tocId),h=this.convertNodes(i.children,r+1,c.tocId);return c.children=[...d,...h],[c]})}convertSectionNodes(e,r,n){return e.flatMap(i=>{var s;let a=(s=i.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),o={...i,prettyUrl:a,depth:r,parentTocId:n,children:[]};return this.register(o),o.children=this.convertSectionNodes(i.children,r+1,i.tocId),[o]})}buildPage(e,r){var n,i,s,a,o,u;let c={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(i=e.tocId)!==null&&i!==void 0?i:"root",toc:((s=e.pageToc)!==null&&s!==void 0?s:[]).map(p=>this.nodeByTocId[p.tocId]),topics:[],hiddenTopics:[],breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},d=(p,v)=>(v?c.topics:c.hiddenTopics).push(p),h=(o=(a=e.pageConfiguration)===null||a===void 0?void 0:a.parentsVisibility)!==null&&o!==void 0?o:[];return c.breadcrumb.forEach((p,v)=>{d(p,h[v])}),e.tocId&&d(e.tocId,e.pageConfiguration.isVisible),c.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[])),c}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}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}},mt=class{convertPaginatedToc(e,r){return new gr(e,r).build()}};var qs=A(kn(),1);var Un;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Un||(Un={}));var Fn;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Fn||(Fn={}));var jn;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(jn||(jn={}));var Bn;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Bn||(Bn={}));var $n;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})($n||($n={}));var Hn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Hn||(Hn={}));var Vn;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Vn||(Vn={}));var Kn;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(Kn||(Kn={}));var qn;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(qn||(qn={}));var Gn;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Gn||(Gn={}));var Wn;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Wn||(Wn={}));var zn;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(zn||(zn={}));var Qn;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Qn||(Qn={}));var Xn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Xn||(Xn={}));var Yn;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Yn||(Yn={}));var Jn;(function(t){t.ASC="ASC",t.DESC="DESC"})(Jn||(Jn={}));var Zn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Zn||(Zn={}));var ei;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ei||(ei={}));var ti;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(ti||(ti={}));var ri;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ri||(ri={}));var ni;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(ni||(ni={}));var ii;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ii||(ii={}));var si;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(si||(si={}));var ai;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ai||(ai={}));var oi;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(oi||(oi={}));var x;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(x||(x={}));var z;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(z||(z={}));var ui;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(ui||(ui={}));var ci;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(ci||(ci={}));var li;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(li||(li={}));var di;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(di||(di={}));var hi;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(hi||(hi={}));var fi;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(fi||(fi={}));var pi;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(pi||(pi={}));var mi;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(mi||(mi={}));var vi;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(vi||(vi={}));var Ks={[x.PERSONAL_BOOK_SHARE_USER]:[x.PERSONAL_BOOK_USER],[x.HTML_EXPORT_USER]:[x.PERSONAL_BOOK_USER],[x.PDF_EXPORT_USER]:[x.PERSONAL_BOOK_USER],[x.KHUB_ADMIN]:[x.CONTENT_PUBLISHER],[x.ADMIN]:[x.KHUB_ADMIN,x.USERS_ADMIN,x.PORTAL_ADMIN,x.BEHAVIOR_DATA_USER],[x.GENERATIVE_AI_EXPORT_USER]:[x.GENERATIVE_AI_USER]};function yi(t,e){return t===e||(Ks[t]??[]).some(r=>yi(r,e))}function ce(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>yi(n,e))}var Vr=A(ie());function Gs(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!gt(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!gt(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let s=a=>Object.keys(a).filter(o=>a[o]!=null);if(i=s(t),r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!gt(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function gt(t,e){try{return Gs(t,e)}catch{return!1}}function Ye(t,e){return!gt(t,e)}function gi(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function bt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let i=e(n);return i[t]=!0,i}}var bi=A(ie(),1);var br=t=>{let e=t??{};return(r,n)=>{var i;let s={hasChanged:Ye,attribute:!1,...e};(0,bi.property)(s)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:o=>o[n],store:e.store})}};var At=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var xe=A(ie(),1);var Ai=A(ie(),1);function Ei(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Ai.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Ye,...e??{}})}var Et=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let a of n)try{await a()}catch(o){i(o);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ti=A(ne(),1);var St=globalThis,Ws=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Uo=Symbol();var Si=(t,e)=>{if(Ws)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=St.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var Tt=class extends Ti.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,s])=>e.registry.define(i,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Si(n,e.elementStyles),n}};function wi(t,e,...r){var n;let i=t.querySelector(e);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var Be=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Oi,_i=Symbol("constructorPrototype"),Ci=Symbol("constructorName"),Ri=Symbol("exportpartsDebouncer"),xi=Symbol("dynamicDependenciesLoaded"),je=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};je.eventName="exportparts-updated";var se=class extends Tt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Oi]=new Et(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Ri].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ci]=this.constructor.name,this[_i]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ci]&&Object.setPrototypeOf(this,this[_i])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[xi]||(r[xi]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(je.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(je.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new je)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=wi(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,n,i,s,a,o;let u=p=>p!=null&&p.trim().length>0,c=e.filter(u).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let d=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],m=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(E=>E.split(":")[1]))!==null&&o!==void 0?o:[],g=[...v,...m].filter(u).map(E=>E.trim());for(let E of g)d.add(E)}if(d.size===0){this.exportparts=void 0;return}let h=[...d.values()].flatMap(p=>c.map(v=>`${p}:${v}--${p}`));this.exportparts=[...this.part,...h].join(", ")}};Oi=Ri;Be([(0,xe.property)()],se.prototype,"exportpartsPrefix",void 0);Be([Ei([])],se.prototype,"exportpartsPrefixes",void 0);Be([(0,xe.property)({reflect:!0})],se.prototype,"exportparts",void 0);Be([(0,xe.property)()],se.prototype,"customStylesheet",void 0);Be([(0,xe.property)()],se.prototype,"elementToFocus",void 0);Be([(0,xe.state)()],se.prototype,"useAdoptedStyleSheets",void 0);function wt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Je=Symbol("internalReduxEventsUnsubscribers"),pe=Symbol("internalStoresUnsubscribers"),Oe=Symbol("internalStores"),zs=bt(Symbol("withRedux"),function(t){var e,r,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Oe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Oe].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[Oe].get(a)}addStore(a,o){var u;o=(u=o??a.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(o),this[Oe].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[Oe].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Oe].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let u=this.constructor.getPropertyOptions(o);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:o)){let c=this.getStore(a.store);c&&(a.store?this[pe].has(a.store):this[pe].size>0)&&(this[o]=a.selector(c.getState(),this))}})}subscribeToStore(a,o){var u;this[pe].set(a,o.subscribe(()=>this.updateFromStores())),this[Je].set(a,[]),wt(o)&&o.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((c,d)=>{if(typeof this[d]=="function"&&(!c.store||o.name===c.store)){let h=p=>this[d](p);o.addEventListener(c.eventName,h),this[Je].get(a).push(()=>o.removeEventListener(c.eventName,h))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[pe].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[pe].has(a)&&this[pe].get(a)(),this[pe].delete(a),(o=this[Je].get(a))===null||o===void 0||o.forEach(u=>u()),this[Je].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=pe,r=Oe,n=Je,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Ii=class extends zs(se){};function Q(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function le(t){return!!t&&!!t[D]}function ee(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===ra}(t)||Array.isArray(t)||!!t[Ui]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ui])||Or(t)||Rr(t))}function Re(t,e,r){r===void 0&&(r=!1),Ve(t)===0?(r?Object.keys:He)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Ve(t){var e=t[D];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Or(t)?2:Rr(t)?3:0}function $e(t,e){return Ve(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Qs(t,e){return Ve(t)===2?t.get(e):t[e]}function Fi(t,e,r){var n=Ve(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function ji(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Or(t){return ea&&t instanceof Map}function Rr(t){return ta&&t instanceof Set}function me(t){return t.o||t.t}function Ir(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Hi(t);delete e[D];for(var r=He(e),n=0;n<r.length;n++){var i=r[n],s=e[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Dr(t,e){return e===void 0&&(e=!1),Pr(t)||le(t)||!ee(t)||(Ve(t)>1&&(t.set=t.add=t.clear=t.delete=Xs),Object.freeze(t),e&&Re(t,function(r,n){return Dr(n,!0)},!0)),t}function Xs(){Q(2)}function Pr(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ae(t){var e=xr[t];return e||Q(18,t),e}function Ys(t,e){xr[t]||(xr[t]=e)}function wr(){return et}function Ar(t,e){e&&(ae("Patches"),t.u=[],t.s=[],t.v=e)}function _t(t){_r(t),t.p.forEach(Js),t.p=null}function _r(t){t===et&&(et=t.l)}function Di(t){return et={p:[],l:et,h:t,m:!0,_:0}}function Js(t){var e=t[D];e.i===0||e.i===1?e.j():e.g=!0}function Er(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||ae("ES5").S(e,t,n),n?(r[D].P&&(_t(e),Q(4)),ee(t)&&(t=Ct(e,t),e.l||xt(e,t)),e.u&&ae("Patches").M(r[D].t,t,e.u,e.s)):t=Ct(e,r,[]),_t(e),e.u&&e.v(e.u,e.s),t!==$i?t:void 0}function Ct(t,e,r){if(Pr(e))return e;var n=e[D];if(!n)return Re(e,function(o,u){return Pi(t,n,e,o,u,r)},!0),e;if(n.A!==t)return e;if(!n.P)return xt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ir(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),Re(s,function(o,u){return Pi(t,n,i,o,u,r,a)}),xt(t,i,!1),r&&t.u&&ae("Patches").N(n,r,t.u,t.s)}return n.o}function Pi(t,e,r,n,i,s,a){if(le(i)){var o=Ct(t,i,s&&e&&e.i!==3&&!$e(e.R,n)?s.concat(n):void 0);if(Fi(r,n,o),!le(o))return;t.m=!1}else a&&r.add(i);if(ee(i)&&!Pr(i)){if(!t.h.D&&t._<1)return;Ct(t,i),e&&e.A.l||xt(t,i)}}function xt(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Dr(e,r)}function Sr(t,e){var r=t[D];return(r?me(r):t)[e]}function Mi(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function ve(t){t.P||(t.P=!0,t.l&&ve(t.l))}function Tr(t){t.o||(t.o=Ir(t.t))}function Cr(t,e,r){var n=Or(e)?ae("MapSet").F(e,r):Rr(e)?ae("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:wr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=o,c=tt;a&&(u=[o],c=Ze);var d=Proxy.revocable(u,c),h=d.revoke,p=d.proxy;return o.k=p,o.j=h,p}(e,r):ae("ES5").J(e,r);return(r?r.A:wr()).p.push(n),n}function Zs(t){return le(t)||Q(22,t),function e(r){if(!ee(r))return r;var n,i=r[D],s=Ve(r);if(i){if(!i.P&&(i.i<4||!ae("ES5").K(i)))return i.t;i.I=!0,n=Ni(r,s),i.I=!1}else n=Ni(r,s);return Re(n,function(a,o){i&&Qs(i.t,a)===o||Fi(n,a,e(o))}),s===3?new Set(n):n}(t)}function Ni(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ir(t)}function Bi(){function t(a,o){var u=s[a];return u?u.enumerable=o:s[a]=u={configurable:!0,enumerable:o,get:function(){var c=this[D];return tt.get(c,a)},set:function(c){var d=this[D];tt.set(d,a,c)}},u}function e(a){for(var o=a.length-1;o>=0;o--){var u=a[o][D];if(!u.P)switch(u.i){case 5:n(u)&&ve(u);break;case 4:r(u)&&ve(u)}}}function r(a){for(var o=a.t,u=a.k,c=He(u),d=c.length-1;d>=0;d--){var h=c[d];if(h!==D){var p=o[h];if(p===void 0&&!$e(o,h))return!0;var v=u[h],m=v&&v[D];if(m?m.t!==p:!ji(v,p))return!0}}var g=!!o[D];return c.length!==He(o).length+(g?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var u=Object.getOwnPropertyDescriptor(o,o.length-1);if(u&&!u.get)return!0;for(var c=0;c<o.length;c++)if(!o.hasOwnProperty(c))return!0;return!1}function i(a){a.g&&Q(3,JSON.stringify(me(a)))}var s={};Ys("ES5",{J:function(a,o){var u=Array.isArray(a),c=function(h,p){if(h){for(var v=Array(p.length),m=0;m<p.length;m++)Object.defineProperty(v,""+m,t(m,!0));return v}var g=Hi(p);delete g[D];for(var E=He(g),S=0;S<E.length;S++){var T=E[S];g[T]=t(T,h||!!g[T].enumerable)}return Object.create(Object.getPrototypeOf(p),g)}(u,a),d={i:u?5:4,A:o?o.A:wr(),P:!1,I:!1,R:{},l:o,t:a,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,D,{value:d,writable:!0}),c},S:function(a,o,u){u?le(o)&&o[D].A===a&&e(a.p):(a.u&&function c(d){if(d&&typeof d=="object"){var h=d[D];if(h){var p=h.t,v=h.k,m=h.R,g=h.i;if(g===4)Re(v,function(_){_!==D&&(p[_]!==void 0||$e(p,_)?m[_]||c(v[_]):(m[_]=!0,ve(h)))}),Re(p,function(_){v[_]!==void 0||$e(v,_)||(m[_]=!1,ve(h))});else if(g===5){if(n(h)&&(ve(h),m.length=!0),v.length<p.length)for(var E=v.length;E<p.length;E++)m[E]=!1;else for(var S=p.length;S<v.length;S++)m[S]=!0;for(var T=Math.min(v.length,p.length),O=0;O<T;O++)v.hasOwnProperty(O)||(m[O]=!0),m[O]===void 0&&c(v[O])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var Li,et,Mr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ea=typeof Map<"u",ta=typeof Set<"u",ki=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",$i=Mr?Symbol.for("immer-nothing"):((Li={})["immer-nothing"]=!0,Li),Ui=Mr?Symbol.for("immer-draftable"):"__$immer_draftable",D=Mr?Symbol.for("immer-state"):"__$immer_state";var ra=""+Object.prototype.constructor,He=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Hi=Object.getOwnPropertyDescriptors||function(t){var e={};return He(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},xr={},tt={get:function(t,e){if(e===D)return t;var r=me(t);if(!$e(r,e))return function(i,s,a){var o,u=Mi(s,a);return u?"value"in u?u.value:(o=u.get)===null||o===void 0?void 0:o.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!ee(n)?n:n===Sr(t.t,e)?(Tr(t),t.o[e]=Cr(t.A.h,n,t)):n},has:function(t,e){return e in me(t)},ownKeys:function(t){return Reflect.ownKeys(me(t))},set:function(t,e,r){var n=Mi(me(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=Sr(me(t),e),s=i?.[D];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(ji(r,i)&&(r!==void 0||$e(t.t,e)))return!0;Tr(t),ve(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return Sr(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Tr(t),ve(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=me(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){Q(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Q(12)}},Ze={};Re(tt,function(t,e){Ze[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ze.deleteProperty=function(t,e){return Ze.set.call(this,t,e,void 0)},Ze.set=function(t,e,r){return tt.set.call(this,t[0],e,r,t[0])};var na=function(){function t(r){var n=this;this.O=ki,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var u=n;return function(g){var E=this;g===void 0&&(g=o);for(var S=arguments.length,T=Array(S>1?S-1:0),O=1;O<S;O++)T[O-1]=arguments[O];return u.produce(g,function(_){var U;return(U=s).call.apply(U,[E,_].concat(T))})}}var c;if(typeof s!="function"&&Q(6),a!==void 0&&typeof a!="function"&&Q(7),ee(i)){var d=Di(n),h=Cr(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?_t(d):_r(d)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(g){return Ar(d,a),Er(g,d)},function(g){throw _t(d),g}):(Ar(d,a),Er(c,d))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===$i&&(c=void 0),n.D&&Dr(c,!0),a){var v=[],m=[];ae("Patches").M(i,c,v,m),a(v,m)}return c}Q(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(c){for(var d=arguments.length,h=Array(d>1?d-1:0),p=1;p<d;p++)h[p-1]=arguments[p];return n.produceWithPatches(c,function(v){return i.apply(void 0,[v].concat(h))})};var a,o,u=n.produce(i,s,function(c,d){a=c,o=d});return typeof Promise<"u"&&u instanceof Promise?u.then(function(c){return[c,a,o]}):[u,a,o]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){ee(r)||Q(8),le(r)&&(r=Zs(r));var n=Di(this),i=Cr(this,r,void 0);return i[D].C=!0,_r(n),i},e.finishDraft=function(r,n){var i=r&&r[D],s=i.A;return Ar(s,n),Er(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!ki&&Q(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var a=ae("Patches").$;return le(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),q=new na,ia=q.produce,Jo=q.produceWithPatches.bind(q),Zo=q.setAutoFreeze.bind(q),eu=q.setUseProxies.bind(q),tu=q.applyPatches.bind(q),ru=q.createDraft.bind(q),nu=q.finishDraft.bind(q),Ot=ia;function Ie(t){"@babel/helpers - typeof";return Ie=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},Ie(t)}function Vi(t,e){if(Ie(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ki(t){var e=Vi(t,"string");return Ie(e)=="symbol"?e:e+""}function qi(t,e,r){return(e=Ki(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Nr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(r),!0).forEach(function(n){qi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Lr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Rt={INIT:"@@redux/INIT"+Lr(),REPLACE:"@@redux/REPLACE"+Lr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Lr()}};function sa(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function kr(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(B(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(B(1));return r(kr)(t,e)}if(typeof t!="function")throw new Error(B(2));var i=t,s=e,a=[],o=a,u=!1;function c(){o===a&&(o=a.slice())}function d(){if(u)throw new Error(B(3));return s}function h(g){if(typeof g!="function")throw new Error(B(4));if(u)throw new Error(B(5));var E=!0;return c(),o.push(g),function(){if(E){if(u)throw new Error(B(6));E=!1,c();var T=o.indexOf(g);o.splice(T,1),a=null}}}function p(g){if(!sa(g))throw new Error(B(7));if(typeof g.type>"u")throw new Error(B(8));if(u)throw new Error(B(9));try{u=!0,s=i(s,g)}finally{u=!1}for(var E=a=o,S=0;S<E.length;S++){var T=E[S];T()}return g}function v(g){if(typeof g!="function")throw new Error(B(10));i=g,p({type:Rt.REPLACE})}function m(){var g,E=h;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(B(11));function O(){T.next&&T.next(d())}O();var _=E(O);return{unsubscribe:_}}},g[Wi]=function(){return this},g}return p({type:Rt.INIT}),n={dispatch:p,subscribe:h,getState:d,replaceReducer:v},n[Wi]=m,n}function aa(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Rt.INIT});if(typeof n>"u")throw new Error(B(12));if(typeof r(void 0,{type:Rt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(B(13))})}function zi(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var s=Object.keys(r),a,o;try{aa(r)}catch(u){o=u}return function(c,d){if(c===void 0&&(c={}),o)throw o;if(0)var h;for(var p=!1,v={},m=0;m<s.length;m++){var g=s[m],E=r[g],S=c[g],T=E(S,d);if(typeof T>"u"){var O=d&&d.type;throw new Error(B(14))}v[g]=T,p=p||T!==S}return p=p||s.length!==Object.keys(c).length,p?v:c}}function Ke(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Qi(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(B(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(u){return u(a)});return s=Ke.apply(void 0,o)(i.dispatch),Nr(Nr({},i),{},{dispatch:s})}}}function Xi(t){var e=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,t):a(o)}}};return e}var Yi=Xi();Yi.withExtraArgument=Xi;var Ur=Yi;var rs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),oa=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(d){return u([c,d])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},qe=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},ua=Object.defineProperty,ca=Object.defineProperties,la=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,da=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,Zi=function(t,e,r){return e in t?ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ye=function(t,e){for(var r in e||(e={}))da.call(e,r)&&Zi(t,r,e[r]);if(Ji)for(var n=0,i=Ji(e);n<i.length;n++){var r=i[n];ha.call(e,r)&&Zi(t,r,e[r])}return t},Fr=function(t,e){return ca(t,la(e))},fa=function(t,e,r){return new Promise(function(n,i){var s=function(u){try{o(r.next(u))}catch(c){i(c)}},a=function(u){try{o(r.throw(u))}catch(c){i(c)}},o=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,a)};o((r=r.apply(t,e)).next())})};var pa=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ke:Ke.apply(null,arguments)},Eu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function ma(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var va=function(t){rs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,qe([void 0],r[0].concat(this)))):new(e.bind.apply(e,qe([void 0],r.concat(this))))},e}(Array),ya=function(t){rs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,qe([void 0],r[0].concat(this)))):new(e.bind.apply(e,qe([void 0],r.concat(this))))},e}(Array);function $r(t){return ee(t)?Ot(t,function(){}):t}function ga(t){return typeof t=="boolean"}function ba(){return function(e){return Aa(e)}}function Aa(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,s=t.serializableCheck,a=s===void 0?!0:s,o=new va;if(r&&(ga(r)?o.push(Ur):o.push(Ur.withExtraArgument(r.extraArgument))),0){if(i)var u;if(a)var c}return o}var jr=!0;function ns(t){var e=ba(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?e():s,o=r.devTools,u=o===void 0?!0:o,c=r.preloadedState,d=c===void 0?void 0:c,h=r.enhancers,p=h===void 0?void 0:h,v;if(typeof i=="function")v=i;else if(ma(i))v=zi(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=a;if(typeof m=="function"&&(m=m(e),!jr&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!jr&&m.some(function(_){return typeof _!="function"}))throw new Error("each middleware provided to configureStore must be a function");var g=Qi.apply(void 0,m),E=Ke;u&&(E=pa(ye({trace:!jr},typeof u=="object"&&u)));var S=new ya(g),T=S;Array.isArray(p)?T=qe([g],p):typeof p=="function"&&(T=p(S));var O=E.apply(void 0,T);return kr(v,d,O)}function ge(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ye(ye({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function is(t){var e={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(o in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return t(i),[e,r,n]}function Ea(t){return typeof t=="function"}function Sa(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?is(e):[e,r,n],s=i[0],a=i[1],o=i[2],u;if(Ea(t))u=function(){return $r(t())};else{var c=$r(t);u=function(){return c}}function d(h,p){h===void 0&&(h=u());var v=qe([s[p.type]],a.filter(function(m){var g=m.matcher;return g(p)}).map(function(m){var g=m.reducer;return g}));return v.filter(function(m){return!!m}).length===0&&(v=[o]),v.reduce(function(m,g){if(g)if(le(m)){var E=m,S=g(E,p);return S===void 0?m:S}else{if(ee(m))return Ot(m,function(T){return g(T,p)});var S=g(m,p);if(S===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}return m},h)}return d.getInitialState=u,d}function Ta(t,e){return t+"/"+e}function ss(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:$r(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(d){var h=n[d],p=Ta(e,d),v,m;"reducer"in h?(v=h.reducer,m=h.prepare):v=h,s[d]=v,a[p]=v,o[d]=m?ge(p,m):ge(p)});function u(){var d=typeof t.extraReducers=="function"?is(t.extraReducers):[t.extraReducers],h=d[0],p=h===void 0?{}:h,v=d[1],m=v===void 0?[]:v,g=d[2],E=g===void 0?void 0:g,S=ye(ye({},p),a);return Sa(r,function(T){for(var O in S)T.addCase(O,S[O]);for(var _=0,U=m;_<U.length;_++){var J=U[_];T.addMatcher(J.matcher,J.reducer)}E&&T.addDefaultCase(E)})}var c;return{name:e,reducer:function(d,h){return c||(c=u()),c(d,h)},actions:o,caseReducers:s,getInitialState:function(){return c||(c=u()),c.getInitialState()}}}var wa="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_a=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=wa[Math.random()*64|0];return e},Ca=["name","message","stack","code"],Br=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),es=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),xa=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Ca;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},_u=function(){function t(e,r,n){var i=ge(e+"/fulfilled",function(d,h,p,v){return{payload:d,meta:Fr(ye({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=ge(e+"/pending",function(d,h,p){return{payload:void 0,meta:Fr(ye({},p||{}),{arg:h,requestId:d,requestStatus:"pending"})}}),a=ge(e+"/rejected",function(d,h,p,v,m){return{payload:v,error:(n&&n.serializeError||xa)(d||"Rejected"),meta:Fr(ye({},m||{}),{arg:p,requestId:h,rejectedWithValue:!!v,requestStatus:"rejected",aborted:d?.name==="AbortError",condition:d?.name==="ConditionError"})}}),o=!1,u=typeof AbortController<"u"?AbortController:function(){function d(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return d.prototype.abort=function(){},d}();function c(d){return function(h,p,v){var m=n?.idGenerator?n.idGenerator(d):_a(),g=new u,E,S=!1;function T(_){E=_,g.abort()}var O=function(){return fa(this,null,function(){var _,U,J,Ae,H,Ee,Le;return oa(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),Ae=(_=n?.condition)==null?void 0:_.call(n,d,{getState:p,extra:v}),Ra(Ae)?[4,Ae]:[3,2];case 1:Ae=l.sent(),l.label=2;case 2:if(Ae===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,H=new Promise(function(f,b){return g.signal.addEventListener("abort",function(){return b({name:"AbortError",message:E||"Aborted"})})}),h(s(m,d,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:m,arg:d},{getState:p,extra:v}))),[4,Promise.race([H,Promise.resolve(r(d,{dispatch:h,getState:p,extra:v,requestId:m,signal:g.signal,abort:T,rejectWithValue:function(f,b){return new Br(f,b)},fulfillWithValue:function(f,b){return new es(f,b)}})).then(function(f){if(f instanceof Br)throw f;return f instanceof es?i(f.payload,m,d,f.meta):i(f,m,d)})])];case 3:return J=l.sent(),[3,5];case 4:return Ee=l.sent(),J=Ee instanceof Br?a(null,m,d,Ee.payload,Ee.meta):a(Ee,m,d),[3,5];case 5:return Le=n&&!n.dispatchConditionRejection&&a.match(J)&&J.meta.condition,Le||h(J),[2,J]}})})}();return Object.assign(O,{abort:T,requestId:m,arg:d,unwrap:function(){return O.then(Oa)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Oa(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Ra(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var as="listener",os="completed",us="cancelled",Cu="task-"+us,xu="task-"+os,Ou=as+"-"+us,Ru=as+"-"+os;var Hr="listenerMiddleware";var Iu=ge(Hr+"/add"),Du=ge(Hr+"/removeAll"),Pu=ge(Hr+"/remove");var ts,Mu=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ts||(ts=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ia=function(t){return function(e){setTimeout(e,t)}},Nu=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ia(10);Bi();var Da=bt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),It=class extends Da(Object){};window.ftReduxStores||(window.ftReduxStores={});var cs=class t extends It{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(wt(s))return s;if(i==null)return;let a=ss({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=ns({reducer:(u,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let d=gi(a.getInitialState());for(let h of c.keeping)d[h]=(u??d)[h];return d}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...c.overwrites};return a.reducer(u,c)}});return window.ftReduxStores[i.name]=new t(a,o,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new At;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let u=a,c=s[u];return c?(...d)=>{let h=c(...d.map(i));return this.reduxStore.dispatch(h),h}:d=>{this.setState({[u]:i(d)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Dt=class{static format(e,r,n,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(e,r,n,i)}static getMomentDateFormat(e,r){return e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,i){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(s);if(!i)return a;let o=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return`${a} ${o}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Pt=A(I()),Pa="ft-app-info",oe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};oe.eventName="authentication-change";var Ma={session:(t,e)=>{(0,Pt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>y.dispatchEvent(new oe(e.payload)),0))}},y=Pt.FtReduxStore.get({name:Pa,reducers:Ma,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 ls=A(I()),Mt=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},uc=(0,ls.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(y)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(o=>o.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?o=>Dt.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Mt([(0,Vr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Mt([(0,Vr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Mt([br({store:y.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Mt([br({store:y.name})],e.prototype,"uiLocale",void 0),e});var jt=A(I());var Kr=A(I());var De=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=y.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=y.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var Nt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:De.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):De.await()}};var $=class extends Nt{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[u])=>o.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Kr.CacheRegistry,this.cache=e?i.commonCache:new Kr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Lt=class extends ${async listMySearches(){let{session:e}=y.getState();return ce(e,x.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var kt=class extends ${async listMyBookmarks(){let e=y.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Ut=class extends ${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=y.getState().session;return!!e?.sessionAuthenticated}};var Ft=class extends ${constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=y.getState().session;return!!e?.sessionAuthenticated}};var Na="ft-user-assets",La={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(z).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;Gr(t,r,[...qr(t,r),i]),ds(t,r,1,n),hs(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;Gr(t,r,qr(t,r).map(i=>i.id===n.id?n:i)),hs(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;Gr(t,r,qr(t,r).filter(s=>s.id!==i)),ds(t,r,-1,n)}},fs={[z.SEARCHES]:"savedSearches",[z.BOOKMARKS]:"bookmarks",[z.BOOKS]:void 0,[z.COLLECTIONS]:void 0},qr=(t,e)=>{var r;let n=fs[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},Gr=(t,e,r)=>{let n=fs[e];n&&(t[n]=r)},ds=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===z.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},hs=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},G=jt.FtReduxStore.get({name:Na,reducers:La,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(z).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Wr=class{constructor(e=new Ut,r=new Ft){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=y.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new kt,this.savedSearchesService=new Lt,y.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=y.getState();(0,jt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),G.actions.clearAssetCount(),G.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),G.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),G.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();G.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();G.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&G.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&G.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(G.getState().assetCounts.bookmarkByMap).length!==0;e===z.BOOKMARKS&&r&&G.actions.clearBookmarkCountByMap(),G.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;G.actions.bookmarks(r)}}},zr=new Wr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=zr);var Qr=class{addCommand(e,r=!1){y.commands.add(e,r)}consumeCommand(e){return y.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Qr;var X=A(I());var ps,Ge=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ka=Symbol("clearAfterUnitTest"),Bt=class extends(0,X.withEventBus)($){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ps]=()=>{this.defaultMessages={},this.cache=new X.CacheRegistry,this.listeners={}},this.currentUiLocale=y.getState().uiLocale,y.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=y.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,X.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let s=e.toLowerCase(),a=this.resolveContext(s);return new X.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof X.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ge({loadedContexts:e})),this.dispatchEvent(new Ge({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ge({loadedContexts:[e]})),this.dispatchEvent(new Ge({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,X.delay)(0).then(()=>n()).catch(()=>null)))}};ps=ka;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Bt{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Bt{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var ms=window.FluidTopicsI18nService,Vc=window.FluidTopicsCustomI18nService;var vs=A(I()),Xr=class{highlightHtml(e,r,n){(0,vs.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Xr;var ys=A(I());var Yr=class{isDate(e){var r,n,i,s;return(s=(i=((n=(r=y.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var n,i,s;if(e==null)return"";try{return ys.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:y.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new Yr;var gs=A(I());var rt=class{static get(e,r){var n,i;let s=y.getState(),{lang:a,region:o}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new gs.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${a}-${o}`)}};var $t=class extends ${async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,a)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(a.key):typeof s=="string"&&typeof a=="string"?s.localeCompare(a):String(s).localeCompare(String(a)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(r),console.debug(i),n)),1e3)}};var Jr=class{urlToSearchRequest(e){return rt.get().parse(e)}searchRequestToUrl(e){return rt.get().serialize(e)}};window.FluidTopicsUrlService=new Jr;var be=A(I());var Pe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Pe.eventName="change";var Zr=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},bs=new Zr;var Ht=class t extends be.WithEventBus{static build(){return new t(window.history,bs,()=>window.location,!1)}constructor(e,r,n,i){var s,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,be.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Pe(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[s,a,o])=>{let u=r(),c={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[c,a,o]),this.setCurrentState(c,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Pe.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Pe.eventName,e)}currentItem(){return(0,be.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,be.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,be.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Ht.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var As=A(ne());var Es=As.css`
|
|
41
|
+
`;var nt=A(ne()),Me=A(ie()),k=A(I());var re=A(I());var Mn=A(I()),Vs={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Nn=t=>Mn.FtReduxStore.get({name:"ft-reader-"+t,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:Vs});var gr=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,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,r,n){return e.flatMap(i=>{var s;return i.pageConfiguration&&this.registerPage(this.buildPage(i,n)),i.tocId==null?this.extractPagesToc(i.children,r,n):[{tocId:i.tocId,title:(s=i.title)!==null&&s!==void 0?s:"",untranslatedTitle:i.untranslatedTitle,depth:r,children:this.extractPagesToc(i.children,r+1,i.tocId)}]})}convertNodes(e,r,n){return e.flatMap(i=>{var s,a,o;if(i.tocId==null)return[...this.convertSectionNodes((s=i.pageToc)!==null&&s!==void 0?s:[],r,i.tocId),...this.convertNodes(i.children,r,i.tocId)];let u=(a=i.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={tocId:i.tocId,contentId:i.contentId,title:i.title,untranslatedTitle:i.untranslatedTitle,hasRating:i.hasRating,origin:i.origin,prettyUrl:u,depth:r,parentTocId:n,children:[]};this.register(c);let d=this.convertSectionNodes((o=i.pageToc)!==null&&o!==void 0?o:[],r+1,i.tocId),h=this.convertNodes(i.children,r+1,c.tocId);return c.children=[...d,...h],[c]})}convertSectionNodes(e,r,n){return e.flatMap(i=>{var s;let a=(s=i.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),o={...i,prettyUrl:a,depth:r,parentTocId:n,children:[]};return this.register(o),o.children=this.convertSectionNodes(i.children,r+1,i.tocId),[o]})}buildPage(e,r){var n,i,s,a,o,u;let c={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(i=e.tocId)!==null&&i!==void 0?i:"root",toc:((s=e.pageToc)!==null&&s!==void 0?s:[]).map(p=>this.nodeByTocId[p.tocId]),topics:[],hiddenTopics:[],breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},d=(p,v)=>(v?c.topics:c.hiddenTopics).push(p),h=(o=(a=e.pageConfiguration)===null||a===void 0?void 0:a.parentsVisibility)!==null&&o!==void 0?o:[];return c.breadcrumb.forEach((p,v)=>{d(p,h[v])}),e.tocId&&d(e.tocId,e.pageConfiguration.isVisible),c.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[])),c}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}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}},mt=class{convertPaginatedToc(e,r){return new gr(e,r).build()}};var qs=A(kn(),1);var Un;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Un||(Un={}));var Fn;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Fn||(Fn={}));var jn;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(jn||(jn={}));var Bn;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Bn||(Bn={}));var $n;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})($n||($n={}));var Hn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Hn||(Hn={}));var Vn;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Vn||(Vn={}));var Kn;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(Kn||(Kn={}));var qn;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(qn||(qn={}));var Gn;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Gn||(Gn={}));var Wn;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Wn||(Wn={}));var zn;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(zn||(zn={}));var Qn;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Qn||(Qn={}));var Xn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Xn||(Xn={}));var Yn;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Yn||(Yn={}));var Jn;(function(t){t.ASC="ASC",t.DESC="DESC"})(Jn||(Jn={}));var Zn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Zn||(Zn={}));var ei;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ei||(ei={}));var ti;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(ti||(ti={}));var ri;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ri||(ri={}));var ni;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(ni||(ni={}));var ii;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ii||(ii={}));var si;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(si||(si={}));var ai;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ai||(ai={}));var oi;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(oi||(oi={}));var x;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(x||(x={}));var z;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(z||(z={}));var ui;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(ui||(ui={}));var ci;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(ci||(ci={}));var li;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(li||(li={}));var di;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(di||(di={}));var hi;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(hi||(hi={}));var fi;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(fi||(fi={}));var pi;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(pi||(pi={}));var mi;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(mi||(mi={}));var vi;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(vi||(vi={}));var Ks={[x.PERSONAL_BOOK_SHARE_USER]:[x.PERSONAL_BOOK_USER],[x.HTML_EXPORT_USER]:[x.PERSONAL_BOOK_USER],[x.PDF_EXPORT_USER]:[x.PERSONAL_BOOK_USER],[x.KHUB_ADMIN]:[x.CONTENT_PUBLISHER],[x.ADMIN]:[x.KHUB_ADMIN,x.USERS_ADMIN,x.PORTAL_ADMIN,x.BEHAVIOR_DATA_USER],[x.GENERATIVE_AI_EXPORT_USER]:[x.GENERATIVE_AI_USER]};function yi(t,e){return t===e||(Ks[t]??[]).some(r=>yi(r,e))}function ce(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>yi(n,e))}var Vr=A(ie());function Gs(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!gt(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!gt(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let s=a=>Object.keys(a).filter(o=>a[o]!=null);if(i=s(t),r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!gt(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function gt(t,e){try{return Gs(t,e)}catch{return!1}}function Ye(t,e){return!gt(t,e)}function gi(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function bt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let i=e(n);return i[t]=!0,i}}var bi=A(ie(),1);var br=t=>{let e=t??{};return(r,n)=>{var i;let s={hasChanged:Ye,attribute:!1,...e};(0,bi.property)(s)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:o=>o[n],store:e.store})}};var At=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var xe=A(ie(),1);var Ai=A(ie(),1);function Ei(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Ai.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Ye,...e??{}})}var Et=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let a of n)try{await a()}catch(o){i(o);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ti=A(ne(),1);var St=globalThis,Ws=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Uo=Symbol();var Si=(t,e)=>{if(Ws)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=St.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var Tt=class extends Ti.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,s])=>e.registry.define(i,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Si(n,e.elementStyles),n}};function wi(t,e,...r){var n;let i=t.querySelector(e);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var Be=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Oi,_i=Symbol("constructorPrototype"),Ci=Symbol("constructorName"),Ri=Symbol("exportpartsDebouncer"),xi=Symbol("dynamicDependenciesLoaded"),je=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};je.eventName="exportparts-updated";var se=class extends Tt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Oi]=new Et(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[Ri].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ci]=this.constructor.name,this[_i]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ci]&&Object.setPrototypeOf(this,this[_i])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[xi]||(r[xi]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(je.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(je.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new je)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=wi(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,n,i,s,a,o;let u=p=>p!=null&&p.trim().length>0,c=e.filter(u).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let d=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],m=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(E=>E.split(":")[1]))!==null&&o!==void 0?o:[],g=[...v,...m].filter(u).map(E=>E.trim());for(let E of g)d.add(E)}if(d.size===0){this.exportparts=void 0;return}let h=[...d.values()].flatMap(p=>c.map(v=>`${p}:${v}--${p}`));this.exportparts=[...this.part,...h].join(", ")}};Oi=Ri;Be([(0,xe.property)()],se.prototype,"exportpartsPrefix",void 0);Be([Ei([])],se.prototype,"exportpartsPrefixes",void 0);Be([(0,xe.property)({reflect:!0})],se.prototype,"exportparts",void 0);Be([(0,xe.property)()],se.prototype,"customStylesheet",void 0);Be([(0,xe.property)()],se.prototype,"elementToFocus",void 0);Be([(0,xe.state)()],se.prototype,"useAdoptedStyleSheets",void 0);function wt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Je=Symbol("internalReduxEventsUnsubscribers"),pe=Symbol("internalStoresUnsubscribers"),Oe=Symbol("internalStores"),zs=bt(Symbol("withRedux"),function(t){var e,r,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Oe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Oe].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[Oe].get(a)}addStore(a,o){var u;o=(u=o??a.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(o),this[Oe].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[Oe].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Oe].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let u=this.constructor.getPropertyOptions(o);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:o)){let c=this.getStore(a.store);c&&(a.store?this[pe].has(a.store):this[pe].size>0)&&(this[o]=a.selector(c.getState(),this))}})}subscribeToStore(a,o){var u;this[pe].set(a,o.subscribe(()=>this.updateFromStores())),this[Je].set(a,[]),wt(o)&&o.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((c,d)=>{if(typeof this[d]=="function"&&(!c.store||o.name===c.store)){let h=p=>this[d](p);o.addEventListener(c.eventName,h),this[Je].get(a).push(()=>o.removeEventListener(c.eventName,h))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[pe].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[pe].has(a)&&this[pe].get(a)(),this[pe].delete(a),(o=this[Je].get(a))===null||o===void 0||o.forEach(u=>u()),this[Je].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=pe,r=Oe,n=Je,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Ii=class extends zs(se){};function Q(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function le(t){return!!t&&!!t[D]}function ee(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===ra}(t)||Array.isArray(t)||!!t[Ui]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ui])||Or(t)||Rr(t))}function Re(t,e,r){r===void 0&&(r=!1),Ve(t)===0?(r?Object.keys:He)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Ve(t){var e=t[D];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Or(t)?2:Rr(t)?3:0}function $e(t,e){return Ve(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Qs(t,e){return Ve(t)===2?t.get(e):t[e]}function Fi(t,e,r){var n=Ve(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function ji(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Or(t){return ea&&t instanceof Map}function Rr(t){return ta&&t instanceof Set}function me(t){return t.o||t.t}function Ir(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Hi(t);delete e[D];for(var r=He(e),n=0;n<r.length;n++){var i=r[n],s=e[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Dr(t,e){return e===void 0&&(e=!1),Pr(t)||le(t)||!ee(t)||(Ve(t)>1&&(t.set=t.add=t.clear=t.delete=Xs),Object.freeze(t),e&&Re(t,function(r,n){return Dr(n,!0)},!0)),t}function Xs(){Q(2)}function Pr(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ae(t){var e=xr[t];return e||Q(18,t),e}function Ys(t,e){xr[t]||(xr[t]=e)}function wr(){return et}function Ar(t,e){e&&(ae("Patches"),t.u=[],t.s=[],t.v=e)}function _t(t){_r(t),t.p.forEach(Js),t.p=null}function _r(t){t===et&&(et=t.l)}function Di(t){return et={p:[],l:et,h:t,m:!0,_:0}}function Js(t){var e=t[D];e.i===0||e.i===1?e.j():e.g=!0}function Er(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||ae("ES5").S(e,t,n),n?(r[D].P&&(_t(e),Q(4)),ee(t)&&(t=Ct(e,t),e.l||xt(e,t)),e.u&&ae("Patches").M(r[D].t,t,e.u,e.s)):t=Ct(e,r,[]),_t(e),e.u&&e.v(e.u,e.s),t!==$i?t:void 0}function Ct(t,e,r){if(Pr(e))return e;var n=e[D];if(!n)return Re(e,function(o,u){return Pi(t,n,e,o,u,r)},!0),e;if(n.A!==t)return e;if(!n.P)return xt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ir(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),Re(s,function(o,u){return Pi(t,n,i,o,u,r,a)}),xt(t,i,!1),r&&t.u&&ae("Patches").N(n,r,t.u,t.s)}return n.o}function Pi(t,e,r,n,i,s,a){if(le(i)){var o=Ct(t,i,s&&e&&e.i!==3&&!$e(e.R,n)?s.concat(n):void 0);if(Fi(r,n,o),!le(o))return;t.m=!1}else a&&r.add(i);if(ee(i)&&!Pr(i)){if(!t.h.D&&t._<1)return;Ct(t,i),e&&e.A.l||xt(t,i)}}function xt(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Dr(e,r)}function Sr(t,e){var r=t[D];return(r?me(r):t)[e]}function Mi(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function ve(t){t.P||(t.P=!0,t.l&&ve(t.l))}function Tr(t){t.o||(t.o=Ir(t.t))}function Cr(t,e,r){var n=Or(e)?ae("MapSet").F(e,r):Rr(e)?ae("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:wr(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},u=o,c=tt;a&&(u=[o],c=Ze);var d=Proxy.revocable(u,c),h=d.revoke,p=d.proxy;return o.k=p,o.j=h,p}(e,r):ae("ES5").J(e,r);return(r?r.A:wr()).p.push(n),n}function Zs(t){return le(t)||Q(22,t),function e(r){if(!ee(r))return r;var n,i=r[D],s=Ve(r);if(i){if(!i.P&&(i.i<4||!ae("ES5").K(i)))return i.t;i.I=!0,n=Ni(r,s),i.I=!1}else n=Ni(r,s);return Re(n,function(a,o){i&&Qs(i.t,a)===o||Fi(n,a,e(o))}),s===3?new Set(n):n}(t)}function Ni(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ir(t)}function Bi(){function t(a,o){var u=s[a];return u?u.enumerable=o:s[a]=u={configurable:!0,enumerable:o,get:function(){var c=this[D];return tt.get(c,a)},set:function(c){var d=this[D];tt.set(d,a,c)}},u}function e(a){for(var o=a.length-1;o>=0;o--){var u=a[o][D];if(!u.P)switch(u.i){case 5:n(u)&&ve(u);break;case 4:r(u)&&ve(u)}}}function r(a){for(var o=a.t,u=a.k,c=He(u),d=c.length-1;d>=0;d--){var h=c[d];if(h!==D){var p=o[h];if(p===void 0&&!$e(o,h))return!0;var v=u[h],m=v&&v[D];if(m?m.t!==p:!ji(v,p))return!0}}var g=!!o[D];return c.length!==He(o).length+(g?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var u=Object.getOwnPropertyDescriptor(o,o.length-1);if(u&&!u.get)return!0;for(var c=0;c<o.length;c++)if(!o.hasOwnProperty(c))return!0;return!1}function i(a){a.g&&Q(3,JSON.stringify(me(a)))}var s={};Ys("ES5",{J:function(a,o){var u=Array.isArray(a),c=function(h,p){if(h){for(var v=Array(p.length),m=0;m<p.length;m++)Object.defineProperty(v,""+m,t(m,!0));return v}var g=Hi(p);delete g[D];for(var E=He(g),S=0;S<E.length;S++){var T=E[S];g[T]=t(T,h||!!g[T].enumerable)}return Object.create(Object.getPrototypeOf(p),g)}(u,a),d={i:u?5:4,A:o?o.A:wr(),P:!1,I:!1,R:{},l:o,t:a,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,D,{value:d,writable:!0}),c},S:function(a,o,u){u?le(o)&&o[D].A===a&&e(a.p):(a.u&&function c(d){if(d&&typeof d=="object"){var h=d[D];if(h){var p=h.t,v=h.k,m=h.R,g=h.i;if(g===4)Re(v,function(_){_!==D&&(p[_]!==void 0||$e(p,_)?m[_]||c(v[_]):(m[_]=!0,ve(h)))}),Re(p,function(_){v[_]!==void 0||$e(v,_)||(m[_]=!1,ve(h))});else if(g===5){if(n(h)&&(ve(h),m.length=!0),v.length<p.length)for(var E=v.length;E<p.length;E++)m[E]=!1;else for(var S=p.length;S<v.length;S++)m[S]=!0;for(var T=Math.min(v.length,p.length),O=0;O<T;O++)v.hasOwnProperty(O)||(m[O]=!0),m[O]===void 0&&c(v[O])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var Li,et,Mr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ea=typeof Map<"u",ta=typeof Set<"u",ki=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",$i=Mr?Symbol.for("immer-nothing"):((Li={})["immer-nothing"]=!0,Li),Ui=Mr?Symbol.for("immer-draftable"):"__$immer_draftable",D=Mr?Symbol.for("immer-state"):"__$immer_state";var ra=""+Object.prototype.constructor,He=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Hi=Object.getOwnPropertyDescriptors||function(t){var e={};return He(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},xr={},tt={get:function(t,e){if(e===D)return t;var r=me(t);if(!$e(r,e))return function(i,s,a){var o,u=Mi(s,a);return u?"value"in u?u.value:(o=u.get)===null||o===void 0?void 0:o.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!ee(n)?n:n===Sr(t.t,e)?(Tr(t),t.o[e]=Cr(t.A.h,n,t)):n},has:function(t,e){return e in me(t)},ownKeys:function(t){return Reflect.ownKeys(me(t))},set:function(t,e,r){var n=Mi(me(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=Sr(me(t),e),s=i?.[D];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(ji(r,i)&&(r!==void 0||$e(t.t,e)))return!0;Tr(t),ve(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return Sr(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Tr(t),ve(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=me(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){Q(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Q(12)}},Ze={};Re(tt,function(t,e){Ze[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ze.deleteProperty=function(t,e){return Ze.set.call(this,t,e,void 0)},Ze.set=function(t,e,r){return tt.set.call(this,t[0],e,r,t[0])};var na=function(){function t(r){var n=this;this.O=ki,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var u=n;return function(g){var E=this;g===void 0&&(g=o);for(var S=arguments.length,T=Array(S>1?S-1:0),O=1;O<S;O++)T[O-1]=arguments[O];return u.produce(g,function(_){var U;return(U=s).call.apply(U,[E,_].concat(T))})}}var c;if(typeof s!="function"&&Q(6),a!==void 0&&typeof a!="function"&&Q(7),ee(i)){var d=Di(n),h=Cr(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?_t(d):_r(d)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(g){return Ar(d,a),Er(g,d)},function(g){throw _t(d),g}):(Ar(d,a),Er(c,d))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===$i&&(c=void 0),n.D&&Dr(c,!0),a){var v=[],m=[];ae("Patches").M(i,c,v,m),a(v,m)}return c}Q(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(c){for(var d=arguments.length,h=Array(d>1?d-1:0),p=1;p<d;p++)h[p-1]=arguments[p];return n.produceWithPatches(c,function(v){return i.apply(void 0,[v].concat(h))})};var a,o,u=n.produce(i,s,function(c,d){a=c,o=d});return typeof Promise<"u"&&u instanceof Promise?u.then(function(c){return[c,a,o]}):[u,a,o]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){ee(r)||Q(8),le(r)&&(r=Zs(r));var n=Di(this),i=Cr(this,r,void 0);return i[D].C=!0,_r(n),i},e.finishDraft=function(r,n){var i=r&&r[D],s=i.A;return Ar(s,n),Er(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!ki&&Q(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var a=ae("Patches").$;return le(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),q=new na,ia=q.produce,Jo=q.produceWithPatches.bind(q),Zo=q.setAutoFreeze.bind(q),eu=q.setUseProxies.bind(q),tu=q.applyPatches.bind(q),ru=q.createDraft.bind(q),nu=q.finishDraft.bind(q),Ot=ia;function Ie(t){"@babel/helpers - typeof";return Ie=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},Ie(t)}function Vi(t,e){if(Ie(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ki(t){var e=Vi(t,"string");return Ie(e)=="symbol"?e:e+""}function qi(t,e,r){return(e=Ki(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Nr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(r),!0).forEach(function(n){qi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Lr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Rt={INIT:"@@redux/INIT"+Lr(),REPLACE:"@@redux/REPLACE"+Lr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Lr()}};function sa(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function kr(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(B(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(B(1));return r(kr)(t,e)}if(typeof t!="function")throw new Error(B(2));var i=t,s=e,a=[],o=a,u=!1;function c(){o===a&&(o=a.slice())}function d(){if(u)throw new Error(B(3));return s}function h(g){if(typeof g!="function")throw new Error(B(4));if(u)throw new Error(B(5));var E=!0;return c(),o.push(g),function(){if(E){if(u)throw new Error(B(6));E=!1,c();var T=o.indexOf(g);o.splice(T,1),a=null}}}function p(g){if(!sa(g))throw new Error(B(7));if(typeof g.type>"u")throw new Error(B(8));if(u)throw new Error(B(9));try{u=!0,s=i(s,g)}finally{u=!1}for(var E=a=o,S=0;S<E.length;S++){var T=E[S];T()}return g}function v(g){if(typeof g!="function")throw new Error(B(10));i=g,p({type:Rt.REPLACE})}function m(){var g,E=h;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(B(11));function O(){T.next&&T.next(d())}O();var _=E(O);return{unsubscribe:_}}},g[Wi]=function(){return this},g}return p({type:Rt.INIT}),n={dispatch:p,subscribe:h,getState:d,replaceReducer:v},n[Wi]=m,n}function aa(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Rt.INIT});if(typeof n>"u")throw new Error(B(12));if(typeof r(void 0,{type:Rt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(B(13))})}function zi(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var s=Object.keys(r),a,o;try{aa(r)}catch(u){o=u}return function(c,d){if(c===void 0&&(c={}),o)throw o;if(0)var h;for(var p=!1,v={},m=0;m<s.length;m++){var g=s[m],E=r[g],S=c[g],T=E(S,d);if(typeof T>"u"){var O=d&&d.type;throw new Error(B(14))}v[g]=T,p=p||T!==S}return p=p||s.length!==Object.keys(c).length,p?v:c}}function Ke(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Qi(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(B(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(u){return u(a)});return s=Ke.apply(void 0,o)(i.dispatch),Nr(Nr({},i),{},{dispatch:s})}}}function Xi(t){var e=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,t):a(o)}}};return e}var Yi=Xi();Yi.withExtraArgument=Xi;var Ur=Yi;var rs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),oa=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(d){return u([c,d])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},qe=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},ua=Object.defineProperty,ca=Object.defineProperties,la=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,da=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,Zi=function(t,e,r){return e in t?ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ye=function(t,e){for(var r in e||(e={}))da.call(e,r)&&Zi(t,r,e[r]);if(Ji)for(var n=0,i=Ji(e);n<i.length;n++){var r=i[n];ha.call(e,r)&&Zi(t,r,e[r])}return t},Fr=function(t,e){return ca(t,la(e))},fa=function(t,e,r){return new Promise(function(n,i){var s=function(u){try{o(r.next(u))}catch(c){i(c)}},a=function(u){try{o(r.throw(u))}catch(c){i(c)}},o=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,a)};o((r=r.apply(t,e)).next())})};var pa=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ke:Ke.apply(null,arguments)},Eu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function ma(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var va=function(t){rs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,qe([void 0],r[0].concat(this)))):new(e.bind.apply(e,qe([void 0],r.concat(this))))},e}(Array),ya=function(t){rs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,qe([void 0],r[0].concat(this)))):new(e.bind.apply(e,qe([void 0],r.concat(this))))},e}(Array);function $r(t){return ee(t)?Ot(t,function(){}):t}function ga(t){return typeof t=="boolean"}function ba(){return function(e){return Aa(e)}}function Aa(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,s=t.serializableCheck,a=s===void 0?!0:s,o=new va;if(r&&(ga(r)?o.push(Ur):o.push(Ur.withExtraArgument(r.extraArgument))),0){if(i)var u;if(a)var c}return o}var jr=!0;function ns(t){var e=ba(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?e():s,o=r.devTools,u=o===void 0?!0:o,c=r.preloadedState,d=c===void 0?void 0:c,h=r.enhancers,p=h===void 0?void 0:h,v;if(typeof i=="function")v=i;else if(ma(i))v=zi(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=a;if(typeof m=="function"&&(m=m(e),!jr&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!jr&&m.some(function(_){return typeof _!="function"}))throw new Error("each middleware provided to configureStore must be a function");var g=Qi.apply(void 0,m),E=Ke;u&&(E=pa(ye({trace:!jr},typeof u=="object"&&u)));var S=new ya(g),T=S;Array.isArray(p)?T=qe([g],p):typeof p=="function"&&(T=p(S));var O=E.apply(void 0,T);return kr(v,d,O)}function ge(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ye(ye({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function is(t){var e={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(o in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return t(i),[e,r,n]}function Ea(t){return typeof t=="function"}function Sa(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?is(e):[e,r,n],s=i[0],a=i[1],o=i[2],u;if(Ea(t))u=function(){return $r(t())};else{var c=$r(t);u=function(){return c}}function d(h,p){h===void 0&&(h=u());var v=qe([s[p.type]],a.filter(function(m){var g=m.matcher;return g(p)}).map(function(m){var g=m.reducer;return g}));return v.filter(function(m){return!!m}).length===0&&(v=[o]),v.reduce(function(m,g){if(g)if(le(m)){var E=m,S=g(E,p);return S===void 0?m:S}else{if(ee(m))return Ot(m,function(T){return g(T,p)});var S=g(m,p);if(S===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}return m},h)}return d.getInitialState=u,d}function Ta(t,e){return t+"/"+e}function ss(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:$r(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(d){var h=n[d],p=Ta(e,d),v,m;"reducer"in h?(v=h.reducer,m=h.prepare):v=h,s[d]=v,a[p]=v,o[d]=m?ge(p,m):ge(p)});function u(){var d=typeof t.extraReducers=="function"?is(t.extraReducers):[t.extraReducers],h=d[0],p=h===void 0?{}:h,v=d[1],m=v===void 0?[]:v,g=d[2],E=g===void 0?void 0:g,S=ye(ye({},p),a);return Sa(r,function(T){for(var O in S)T.addCase(O,S[O]);for(var _=0,U=m;_<U.length;_++){var J=U[_];T.addMatcher(J.matcher,J.reducer)}E&&T.addDefaultCase(E)})}var c;return{name:e,reducer:function(d,h){return c||(c=u()),c(d,h)},actions:o,caseReducers:s,getInitialState:function(){return c||(c=u()),c.getInitialState()}}}var wa="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_a=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=wa[Math.random()*64|0];return e},Ca=["name","message","stack","code"],Br=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),es=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),xa=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Ca;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},_u=function(){function t(e,r,n){var i=ge(e+"/fulfilled",function(d,h,p,v){return{payload:d,meta:Fr(ye({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=ge(e+"/pending",function(d,h,p){return{payload:void 0,meta:Fr(ye({},p||{}),{arg:h,requestId:d,requestStatus:"pending"})}}),a=ge(e+"/rejected",function(d,h,p,v,m){return{payload:v,error:(n&&n.serializeError||xa)(d||"Rejected"),meta:Fr(ye({},m||{}),{arg:p,requestId:h,rejectedWithValue:!!v,requestStatus:"rejected",aborted:d?.name==="AbortError",condition:d?.name==="ConditionError"})}}),o=!1,u=typeof AbortController<"u"?AbortController:function(){function d(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return d.prototype.abort=function(){},d}();function c(d){return function(h,p,v){var m=n?.idGenerator?n.idGenerator(d):_a(),g=new u,E,S=!1;function T(_){E=_,g.abort()}var O=function(){return fa(this,null,function(){var _,U,J,Ae,H,Ee,Le;return oa(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),Ae=(_=n?.condition)==null?void 0:_.call(n,d,{getState:p,extra:v}),Ra(Ae)?[4,Ae]:[3,2];case 1:Ae=l.sent(),l.label=2;case 2:if(Ae===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,H=new Promise(function(f,b){return g.signal.addEventListener("abort",function(){return b({name:"AbortError",message:E||"Aborted"})})}),h(s(m,d,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:m,arg:d},{getState:p,extra:v}))),[4,Promise.race([H,Promise.resolve(r(d,{dispatch:h,getState:p,extra:v,requestId:m,signal:g.signal,abort:T,rejectWithValue:function(f,b){return new Br(f,b)},fulfillWithValue:function(f,b){return new es(f,b)}})).then(function(f){if(f instanceof Br)throw f;return f instanceof es?i(f.payload,m,d,f.meta):i(f,m,d)})])];case 3:return J=l.sent(),[3,5];case 4:return Ee=l.sent(),J=Ee instanceof Br?a(null,m,d,Ee.payload,Ee.meta):a(Ee,m,d),[3,5];case 5:return Le=n&&!n.dispatchConditionRejection&&a.match(J)&&J.meta.condition,Le||h(J),[2,J]}})})}();return Object.assign(O,{abort:T,requestId:m,arg:d,unwrap:function(){return O.then(Oa)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Oa(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Ra(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var as="listener",os="completed",us="cancelled",Cu="task-"+us,xu="task-"+os,Ou=as+"-"+us,Ru=as+"-"+os;var Hr="listenerMiddleware";var Iu=ge(Hr+"/add"),Du=ge(Hr+"/removeAll"),Pu=ge(Hr+"/remove");var ts,Mu=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ts||(ts=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ia=function(t){return function(e){setTimeout(e,t)}},Nu=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ia(10);Bi();var Da=bt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),It=class extends Da(Object){};window.ftReduxStores||(window.ftReduxStores={});var cs=class t extends It{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(wt(s))return s;if(i==null)return;let a=ss({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=ns({reducer:(u,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let d=gi(a.getInitialState());for(let h of c.keeping)d[h]=(u??d)[h];return d}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...c.overwrites};return a.reducer(u,c)}});return window.ftReduxStores[i.name]=new t(a,o,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new At;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let u=a,c=s[u];return c?(...d)=>{let h=c(...d.map(i));return this.reduxStore.dispatch(h),h}:d=>{this.setState({[u]:i(d)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var Dt=class{static format(e,r,n,i,s){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,i,!!s)):this.getIntlDateTime(e,r,n,i,!!s)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,i,s){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),u=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return s?u:i?`${o} ${u}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Pt=A(I()),Pa="ft-app-info",oe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};oe.eventName="authentication-change";var Ma={session:(t,e)=>{(0,Pt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>y.dispatchEvent(new oe(e.payload)),0))}},y=Pt.FtReduxStore.get({name:Pa,reducers:Ma,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 ls=A(I()),Mt=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},uc=(0,ls.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(y)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(o=>o.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?o=>Dt.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Mt([(0,Vr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Mt([(0,Vr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Mt([br({store:y.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Mt([br({store:y.name})],e.prototype,"uiLocale",void 0),e});var jt=A(I());var Kr=A(I());var De=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=y.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=y.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var Nt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:De.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):De.await()}};var $=class extends Nt{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[u])=>o.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Kr.CacheRegistry,this.cache=e?i.commonCache:new Kr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Lt=class extends ${async listMySearches(){let{session:e}=y.getState();return ce(e,x.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var kt=class extends ${async listMyBookmarks(){let e=y.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Ut=class extends ${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=y.getState().session;return!!e?.sessionAuthenticated}};var Ft=class extends ${constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=y.getState().session;return!!e?.sessionAuthenticated}};var Na="ft-user-assets",La={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(z).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;Gr(t,r,[...qr(t,r),i]),ds(t,r,1,n),hs(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;Gr(t,r,qr(t,r).map(i=>i.id===n.id?n:i)),hs(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;Gr(t,r,qr(t,r).filter(s=>s.id!==i)),ds(t,r,-1,n)}},fs={[z.SEARCHES]:"savedSearches",[z.BOOKMARKS]:"bookmarks",[z.BOOKS]:void 0,[z.COLLECTIONS]:void 0},qr=(t,e)=>{var r;let n=fs[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},Gr=(t,e,r)=>{let n=fs[e];n&&(t[n]=r)},ds=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===z.BOOKMARKS&&n)){let s=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},hs=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},G=jt.FtReduxStore.get({name:Na,reducers:La,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(z).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Wr=class{constructor(e=new Ut,r=new Ft){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=y.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new kt,this.savedSearchesService=new Lt,y.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=y.getState();(0,jt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),G.actions.clearAssetCount(),G.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),G.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),G.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();G.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();G.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&G.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&G.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(G.getState().assetCounts.bookmarkByMap).length!==0;e===z.BOOKMARKS&&r&&G.actions.clearBookmarkCountByMap(),G.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;G.actions.bookmarks(r)}}},zr=new Wr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=zr);var Qr=class{addCommand(e,r=!1){y.commands.add(e,r)}consumeCommand(e){return y.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Qr;var X=A(I());var ps,Ge=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ka=Symbol("clearAfterUnitTest"),Bt=class extends(0,X.withEventBus)($){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ps]=()=>{this.defaultMessages={},this.cache=new X.CacheRegistry,this.listeners={}},this.currentUiLocale=y.getState().uiLocale,y.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=y.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,X.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let s=e.toLowerCase(),a=this.resolveContext(s);return new X.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof X.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ge({loadedContexts:e})),this.dispatchEvent(new Ge({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ge({loadedContexts:[e]})),this.dispatchEvent(new Ge({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,X.delay)(0).then(()=>n()).catch(()=>null)))}};ps=ka;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Bt{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Bt{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var ms=window.FluidTopicsI18nService,Vc=window.FluidTopicsCustomI18nService;var vs=A(I()),Xr=class{highlightHtml(e,r,n){(0,vs.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Xr;var ys=A(I());var Yr=class{isDate(e){var r,n,i,s;return(s=(i=((n=(r=y.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var n,i,s,a;if(e==null)return"";try{return ys.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:y.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new Yr;var gs=A(I());var rt=class{static get(e,r){var n,i;let s=y.getState(),{lang:a,region:o}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new gs.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${a}-${o}`)}};var $t=class extends ${async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,a)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(a.key):typeof s=="string"&&typeof a=="string"?s.localeCompare(a):String(s).localeCompare(String(a)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(r),console.debug(i),n)),1e3)}};var Jr=class{urlToSearchRequest(e){return rt.get().parse(e)}searchRequestToUrl(e){return rt.get().serialize(e)}};window.FluidTopicsUrlService=new Jr;var be=A(I());var Pe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Pe.eventName="change";var Zr=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},bs=new Zr;var Ht=class t extends be.WithEventBus{static build(){return new t(window.history,bs,()=>window.location,!1)}constructor(e,r,n,i){var s,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,be.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Pe(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[s,a,o])=>{let u=r(),c={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[c,a,o]),this.setCurrentState(c,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Pe.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Pe.eventName,e)}currentItem(){return(0,be.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,be.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,be.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Ht.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var As=A(ne());var Es=As.css`
|
|
42
42
|
`;var Ts=A(ne()),j=A(ie()),te=A(I());function Ss(t,e){let{authenticationRequired:r,session:n}=y.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var M=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},R=class extends te.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>De.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new te.CacheRegistry,this.cleanSessionDebouncer=new te.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Ts.html`
|
|
43
43
|
<slot></slot>
|
|
44
44
|
`}connectedCallback(){super.connectedCallback(),y.addEventListener(oe.eventName,this.reloadConfiguration)}disconnectedCallback(){y.addEventListener(oe.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,i,s,a,o,u;super.update(e),e.has("baseUrl")&&(y.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&y.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&y.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&y.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&y.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&y.actions.noCustom(this.noCustom),e.has("editorMode")&&y.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&y.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&y.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>ms.addContext(c)),e.has("openExternalDocumentInNewTab")&&y.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&y.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&y.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(y.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),y.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),y.actions.searchInAllLanguagesAllowed((a=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&a!==void 0?a:!1)),e.has("authenticationRequired")&&y.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&y.actions.availableContentLocales((u=(o=this.availableContentLocales)===null||o===void 0?void 0:o.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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",()=>Ss(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};R.elementDefinitions={};R.styles=Es;M([(0,j.property)()],R.prototype,"baseUrl",void 0);M([(0,j.property)()],R.prototype,"apiIntegrationIdentifier",void 0);M([(0,j.property)()],R.prototype,"apiIntegrationAppVersion",void 0);M([(0,j.property)()],R.prototype,"uiLocale",void 0);M([(0,te.jsonProperty)(null)],R.prototype,"availableUiLocales",void 0);M([(0,te.jsonProperty)(null)],R.prototype,"metadataConfiguration",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"editorMode",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"noCustom",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"openExternalDocumentInNewTab",void 0);M([(0,j.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],R.prototype,"noCustomComponent",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"withManualResources",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"navigatorOnline",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"forcedOffline",void 0);M([(0,j.property)({type:Object})],R.prototype,"apiProvider",void 0);M([(0,j.property)({type:Boolean})],R.prototype,"authenticationRequired",void 0);M([(0,te.jsonProperty)([])],R.prototype,"messageContexts",void 0);M([(0,te.jsonProperty)(void 0)],R.prototype,"session",void 0);M([(0,j.state)()],R.prototype,"localesConfiguration",void 0);M([(0,j.state)()],R.prototype,"availableContentLocales",void 0);var ws=A(I());(0,ws.customElement)("ft-app-context")(R);var Vt=class extends ${get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,r,n){super(!1,r),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(r=>this.converter.convertPaginatedToc(e,r)))),this.cache.register("ratingSummary",()=>{var e,r;return ce((r=(e=y.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&r!==void 0?r:[],"RATING_USER")?this.withMapId(i=>this.fetchMapRating(i)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,r){return e+(r?"-destinationLanguage-"+r?.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(r=>this.converter.convertPaginatedToc(this.mapId,r)))}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,r){return(await this.getEnrichedToc(r)).nodeByTocId[e]}getTocNodeNow(e,r){var n;return(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,r){var n,i;let s=this.getMapNow(r);return s?.prettyUrl==e||`${s?.id}/root`===e?(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.toc[0]:(i=this.getEnrichedTocNow(r))===null||i===void 0?void 0:i.nodeByUrl[e]}async getPage(e,r){let n=await this.getEnrichedToc(r);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,r){let n=await this.getEnrichedToc(r);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,r){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,r),()=>this.fetchTranslatedTopicHTMLContent(e,r))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,r){return this.cache.get("document-relatives-"+e+"-"+r.join("-"),()=>this.fetchRelativesForDocument(e,r))}getRelativesForTopicInMap(e,r,n){return this.cache.get("topic-relatives-"+[e,r,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,r,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,r,n){let i=this.getNavigationData(e,r,n),s=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),a=new URL(s,this.api.tenantBaseUrl);return i.page!=null&&a.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&a.searchParams.set("tocId",i.tocId),i.section!=null&&a.searchParams.set("section",i.section),a.href}getNavigationData(e,r,n,i){var s,a;e=e||"root";let o=this.getEnrichedTocNow(i),u=o?.pageByTocId[e],c=o?.nodeByTocId[e],d=c?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(s=c?.title)!==null&&s!==void 0?s:"",untranslatedTopicTitle:c?.untranslatedTitle,page:r&&u&&u.number!==r?r:void 0,prettyUrl:d?.replace(/^r\//,""),prettyUrlDuplicated:(a=o?.duplicatedPrettyUrls.has(d??""))!==null&&a!==void 0?a:!1,section:n}}async getAccurateNavigationData(e,r,n,i){return await this.getEnrichedToc(i),this.getNavigationData(e,r,n,i)}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(r=>{var n;return r?{type:r.topics.type,rating:(n=r.topics)===null||n===void 0?void 0:n.ratings.find(i=>i.tocId===e)}:void 0})}rateMap(e,r){return this.makeRateMapRequest(e,r).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,r){return this.makeMapFeedbackRequest(e,r)}rateTopic(e,r,n){return this.makeRateTopicRequest(e,r,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=y.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,r,n){return this.makeTopicFeedbackRequest(e,r,n)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,r){let n=this.getTocNodeNow(e,r),i=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],s=this.getTocNodeNow(n.parentTocId,r);for(;s;)i.unshift({tocId:s.tocId,title:s.title,untranslatedTitle:s.untranslatedTitle}),s=this.getTocNodeNow(s.parentTocId,r);return i}isFeatureAccessible(e,{session:r}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case ue.FEEDBACK:return ce(r??[],x.FEEDBACK_USER);case ue.RATING:return ce(r??[],x.RATING_USER);case ue.PRINT:return ce(r??[],x.PRINT_USER);case ue.BOOKMARK:return!!r?.sessionAuthenticated;case ue.COLLECTIONS:return ce(r??[],x.COLLECTION_USER);case ue.PERSONAL_BOOKS:return ce(r??[],x.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var Kt=class t extends Vt{static async build(e){return new t(new mt,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,r){let n=await this.api.getMap(e,r);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,r){return await this.getMap(r),this.api.getPages(e,this.fingerprint,r)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,r){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,r)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,r){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:r}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,r,n){let i={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:r,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(i)}makeMapFeedbackRequest(e,r){return this.api.sendMapFeedback(this.mapId,e,r)}makeRateMapRequest(e,r){return this.api.rateMap(this.mapId,e,r)}makeRateTopicRequest(e,r,n){return this.api.rateTopic(this.mapId,e,r,n)}makeTopicFeedbackRequest(e,r,n){return this.api.sendTopicFeedback(this.mapId,e,r,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 qt=class t{static build(e,r){return new t(Nn(e.trim()||"context"),r??Kt.build)}loaded(){return(0,re.waitUntil)(()=>this._loaded)}constructor(e,r,n,i){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new re.Debouncer(10),this.analyticsEventsService=i??new $t,this.initService(r)}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(0,re.waitFor)(()=>this.service)}async navigateToTopic(e,r,n){await this.loaded();let i=await this.awaitService(),s=await(n!=null?i.getPage(n,this.getTranslationSettings()):i.getPageByTocId(e??"root",this.getTranslationSettings()));this.store.actions.currentPage(s);let a=this.resolveValidNonRootTocId(e,s);this.store.actions.scrollTarget({tocId:a,section:r}),this.store.getState().visibleTopics[0]!==a&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,r){var n,i,s;let a=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:r.rootTocId;return r.topics.includes(a)?a:(s=(i=r.topics[0])!==null&&i!==void 0?i:r.hiddenTopics[0])!==null&&s!==void 0?s:"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 r,n,i,s,a;try{e&&this.setTranslationLoading(!0);let o=u=>{throw e&&this.setTranslationError(!0),u};await Promise.all([this.loadConfiguration(),(r=this.service)===null||r===void 0?void 0:r.getMap(e).then(u=>this.store.actions.map(u)).catch(o),(n=this.service)===null||n===void 0?void 0:n.getToc(e).then(u=>this.store.actions.toc(u)).catch(o),(i=this.service)===null||i===void 0?void 0:i.getPagesToc(e).then(u=>this.store.actions.pagesToc(u)).catch(o),(s=this.service)===null||s===void 0?void 0:s.getPaginationConfiguration().then(u=>this.store.actions.paginationConfiguration(u)).catch(o),(a=this.service)===null||a===void 0?void 0:a.getTranslationError(e).then(u=>this.setTranslationError(u))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,e&&this.setTranslationLoading(!1)}catch(o){this.errorHandler&&!(o instanceof re.CanceledPromiseError)&&this.errorHandler(o)}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(r=>this.store.actions.configuration(r))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}fetchRelatives(){var e,r;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(i=>{var s;return i.key==((s=this.store.getState().configuration)===null||s===void 0?void 0:s.relativePivotMetadata)}).flatMap(i=>i.values);n!==void 0&&n.length>0?(r=this.service)===null||r===void 0||r.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n).then(i=>{let s=i.results.flatMap(a=>a.entries);this.store.actions.relatives(s),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new Event(Te.clusteringHelperCreated))}createClusteringHelper(){var e,r;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let n=this.store.getState().relatives;if(n){let i=n.find(a=>{var o;return((o=a.map)===null||o===void 0?void 0:o.mapId)==this.store.getState().mapId}),s=(r=(e=y.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&r!==void 0?r:[];return new re.ClusteringHelper(n,i,this.metadataForSwitchToRelatives,s)}}async navigateToRelativeTopicIfFound(e){var r,n,i;await this.loaded();let s=await(0,re.waitFor)(()=>{var c;return(c=this.store.getState().configuration)===null||c===void 0?void 0:c.relativeTopicPivotMetadata}),a=this.store.getState().mapId,u=await(await this.awaitService()).getRelativesForTopicInMap(a,s,[e]);if(!((i=(n=(r=u?.results)===null||r===void 0?void 0:r[0])===null||n===void 0?void 0:n.entries)===null||i===void 0)&&i[0]){let c=u.results[0].entries[0].topic.tocId;return await this.navigateToTopic(c),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(e){this.store.actions.searchInDocumentQuery(e)}async setTranslationDestinationLanguage(e){this.store.actions.setTranslationDestinationLanguage(e),e&&this.sendDocumentOnDemandTranslateEvent(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 r=this.store.getState();return r.translation.profileId&&r.translation.destinationLanguage?{profileId:r.translation.profileId,destinationLanguage:r.translation.destinationLanguage.code,sourceLanguage:(e=r.map)===null||e===void 0?void 0:e.lang}:void 0}setLinkPreviewDialogId(e){this.store.actions.linkPreviewDialogId(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 r;let n=await((r=this.service)===null||r===void 0?void 0:r.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,r,n){return this.service.getAccurateNavigationData(e,r?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var r;return(r=this.service)===null||r===void 0?void 0:r.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var r,n;let i=this.getTranslationSettings();return i?(r=this.service)===null||r===void 0?void 0:r.getTranslatedTopicContent(e,i).then(s=>(s.isTranslationError&&this.setTranslationError(!0),s.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(Te.mapAttachmentsUpdate))}sendDocumentOnDemandTranslateEvent(e){let{editorMode:r,apiIntegrationIdentifier:n,apiIntegrationAppVersion:i}=y.getState(),s=this.store.getState(),a=s.map,o=s.translation.profileId;if(!(r||!a||!n||!i||!o))try{let u=this.analyticsEventsService.convertMapToAnalyticsDocument(a);this.analyticsEventsService.sendDocumentAiTranslateEvent({name:"DOCUMENT__ON_DEMAND_TRANSLATE",offline:!1,appName:n,appVersion:i,sourceLanguage:this.parseLanguageToAnalyticsFormat(a.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e.code),profileId:o,document:u})}catch(u){console.warn("Failed to send on-demand document translate event:",u)}}parseLanguageToAnalyticsFormat(e){if(!e)return;let r=e.split("-");return r.length===2?{languageCode:r[0],countryCode:r[1]}:{languageCode:r[0],countryCode:""}}};var Gt=class extends CustomEvent{constructor(e,r){super("ft-reader-map-loaded",{detail:{map:e,toc:r}})}},Wt=class extends CustomEvent{constructor(e,r){super("ft-reader-visible-topics-change",{detail:{visibleTopics:r}})}},zt=class extends CustomEvent{constructor(e){super("ft-reader-navigation-done",{detail:e})}},Qt=class extends CustomEvent{constructor(e){super("ft-reader-load-error",{detail:e})}},Xt=class extends Event{constructor(){super("ft-reader-map-not-found")}},Yt=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},Jt=class extends Event{constructor(){super("ft-reader-map-forbidden")}},Zt=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var K=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},en=class{constructor(e){this.stateManager=e}searchInDocument(e){this.stateManager.setSearchInDocumentQuery(e??"")}},N=class extends k.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.updateConfiguration=()=>{this.stateManager.reloadConfiguration()},this.scrollToTargetDebouncer=new k.Debouncer(5),this.navigationDebouncer=new k.Debouncer(10),this.mapLoadedEventDebouncer=new k.Debouncer(50),this.addStore(y)}render(){return nt.html`
|
|
@@ -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 ws={};var Wn={};M(Wn,{ParametrizedLabelResolver:()=>gr});var gr=class t{constructor(e,r){this.defaultLabels=e,this.labels=r}resolve(e,...r){var n,a;e=this.resolvePluralKey(e,r);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return t.replaceParameters(i,...r)}static replaceParameters(e,...r){return r.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>t.formatValue(n,s))),e}resolvePluralKey(e,r){for(let n of r)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,r){return e instanceof Date?t.formatDate(e,r):e??""}static formatDate(e,r){let n=a=>r?.includes("date")?e.toLocaleDateString(a):r?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var ha={};M(ha,{FtCommandQueue:()=>yr,FtLitElementRedux:()=>pt,FtReduxStore:()=>De,FtStateManager:()=>pa,ReduxWatcher:()=>Qr,clearAllStores:()=>Zu,isFtReduxStore:()=>Mt,redux:()=>q,reduxEventListener:()=>zn,reduxReactive:()=>uu,watch:()=>qu,withRedux:()=>As});var uu=()=>(t,e)=>{var r;let n=t.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(r=n.reduxReactiveProperties)===null||r===void 0||r.add(e)},q=t=>{let e=t??{};return(r,n)=>{var a;let i={hasChanged:rt,attribute:!1,...e};L(i)(r,n);let s=r.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})}},zn=t=>(e,r)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(r,t)};var yr=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};function Mt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var br=Symbol("internalReduxEventsUnsubscribers"),ze=Symbol("internalStoresUnsubscribers"),ft=Symbol("internalStores"),As=V(Symbol("withRedux"),function(t){var e,r,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=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[ft].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ft].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[ft].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[ft].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[ft].delete(l)}setupStores(){this.unsubscribeFromStores(),this[ft].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 f=this.getStore(s.store);f&&(s.store?this[ze].has(s.store):this[ze].size>0)&&(this[l]=s.selector(f.getState(),this))}})}subscribeToStore(s,l){var d;this[ze].set(s,l.subscribe(()=>this.updateFromStores())),this[br].set(s,[]),Mt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((f,h)=>{if(typeof this[h]=="function"&&(!f.store||l.name===f.store)){let p=m=>this[h](m);l.addEventListener(f.eventName,p),this[br].get(s).push(()=>l.removeEventListener(f.eventName,p))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[ze].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[ze].has(s)&&this[ze].get(s)(),this[ze].delete(s),(l=this[br].get(s))===null||l===void 0||l.forEach(d=>d()),this[br].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ze,r=ft,n=br,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),pt=class extends As(J){};function me(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Me(t){return!!t&&!!t[j]}function xe(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===vu}(t)||Array.isArray(t)||!!t[Ns]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ns])||Qn(t)||Xn(t))}function ht(t,e,r){r===void 0&&(r=!1),Ut(t)===0?(r?Object.keys:Ft)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Ut(t){var e=t[j];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Qn(t)?2:Xn(t)?3:0}function Dt(t,e){return Ut(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function fu(t,e){return Ut(t)===2?t.get(e):t[e]}function ks(t,e,r){var n=Ut(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function Ms(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Qn(t){return yu&&t instanceof Map}function Xn(t){return bu&&t instanceof Set}function je(t){return t.o||t.t}function ea(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Us(t);delete e[j];for(var r=Ft(e),n=0;n<r.length;n++){var a=r[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:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function ta(t,e){return e===void 0&&(e=!1),ra(t)||Me(t)||!xe(t)||(Ut(t)>1&&(t.set=t.add=t.clear=t.delete=pu),Object.freeze(t),e&&ht(t,function(r,n){return ta(n,!0)},!0)),t}function pu(){me(2)}function ra(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Re(t){var e=Jn[t];return e||me(18,t),e}function hu(t,e){Jn[t]||(Jn[t]=e)}function Zn(){return xr}function jn(t,e){e&&(Re("Patches"),t.u=[],t.s=[],t.v=e)}function Kr(t){qn(t),t.p.forEach(mu),t.p=null}function qn(t){t===xr&&(xr=t.l)}function Rs(t){return xr={p:[],l:xr,h:t,m:!0,_:0}}function mu(t){var e=t[j];e.i===0||e.i===1?e.j():e.g=!0}function Gn(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Re("ES5").S(e,t,n),n?(r[j].P&&(Kr(e),me(4)),xe(t)&&(t=Zr(e,t),e.l||qr(e,t)),e.u&&Re("Patches").M(r[j].t,t,e.u,e.s)):t=Zr(e,r,[]),Kr(e),e.u&&e.v(e.u,e.s),t!==Fs?t:void 0}function Zr(t,e,r){if(ra(e))return e;var n=e[j];if(!n)return ht(e,function(l,d){return Ts(t,n,e,l,d,r)},!0),e;if(n.A!==t)return e;if(!n.P)return qr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ea(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),ht(i,function(l,d){return Ts(t,n,a,l,d,r,s)}),qr(t,a,!1),r&&t.u&&Re("Patches").N(n,r,t.u,t.s)}return n.o}function Ts(t,e,r,n,a,i,s){if(Me(a)){var l=Zr(t,a,i&&e&&e.i!==3&&!Dt(e.R,n)?i.concat(n):void 0);if(ks(r,n,l),!Me(l))return;t.m=!1}else s&&r.add(a);if(xe(a)&&!ra(a)){if(!t.h.D&&t._<1)return;Zr(t,a),e&&e.A.l||qr(t,a)}}function qr(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&ta(e,r)}function Vn(t,e){var r=t[j];return(r?je(r):t)[e]}function Is(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ge(t){t.P||(t.P=!0,t.l&&Ge(t.l))}function Kn(t){t.o||(t.o=ea(t.t))}function Yn(t,e,r){var n=Qn(e)?Re("MapSet").F(e,r):Xn(e)?Re("MapSet").T(e,r):t.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,f=Sr;s&&(d=[l],f=vr);var h=Proxy.revocable(d,f),p=h.revoke,m=h.proxy;return l.k=m,l.j=p,m}(e,r):Re("ES5").J(e,r);return(r?r.A:Zn()).p.push(n),n}function gu(t){return Me(t)||me(22,t),function e(r){if(!xe(r))return r;var n,a=r[j],i=Ut(r);if(a){if(!a.P&&(a.i<4||!Re("ES5").K(a)))return a.t;a.I=!0,n=_s(r,i),a.I=!1}else n=_s(r,i);return ht(n,function(s,l){a&&fu(a.t,s)===l||ks(n,s,e(l))}),i===3?new Set(n):n}(t)}function _s(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return ea(t)}function Ds(){function t(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var f=this[j];return Sr.get(f,s)},set:function(f){var h=this[j];Sr.set(h,s,f)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][j];if(!d.P)switch(d.i){case 5:n(d)&&Ge(d);break;case 4:r(d)&&Ge(d)}}}function r(s){for(var l=s.t,d=s.k,f=Ft(d),h=f.length-1;h>=0;h--){var p=f[h];if(p!==j){var m=l[p];if(m===void 0&&!Dt(l,p))return!0;var y=d[p],b=y&&y[j];if(b?b.t!==m:!Ms(y,m))return!0}}var E=!!l[j];return f.length!==Ft(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 f=0;f<l.length;f++)if(!l.hasOwnProperty(f))return!0;return!1}function a(s){s.g&&me(3,JSON.stringify(je(s)))}var i={};hu("ES5",{J:function(s,l){var d=Array.isArray(s),f=function(p,m){if(p){for(var y=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(y,""+b,t(b,!0));return y}var E=Us(m);delete E[j];for(var C=Ft(E),w=0;w<C.length;w++){var R=C[w];E[R]=t(R,p||!!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:f,o:null,g:!1,C:!1};return Object.defineProperty(f,j,{value:h,writable:!0}),f},S:function(s,l,d){d?Me(l)&&l[j].A===s&&e(s.p):(s.u&&function f(h){if(h&&typeof h=="object"){var p=h[j];if(p){var m=p.t,y=p.k,b=p.R,E=p.i;if(E===4)ht(y,function(v){v!==j&&(m[v]!==void 0||Dt(m,v)?b[v]||f(y[v]):(b[v]=!0,Ge(p)))}),ht(m,function(v){y[v]!==void 0||Dt(y,v)||(b[v]=!1,Ge(p))});else if(E===5){if(n(p)&&(Ge(p),b.length=!0),y.length<m.length)for(var C=y.length;C<m.length;C++)b[C]=!1;else for(var w=m.length;w<y.length;w++)b[w]=!0;for(var R=Math.min(y.length,m.length),S=0;S<R;S++)y.hasOwnProperty(S)||(b[S]=!0),b[S]===void 0&&f(y[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Ls,xr,oa=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",yu=typeof Map<"u",bu=typeof Set<"u",Ps=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Fs=oa?Symbol.for("immer-nothing"):((Ls={})["immer-nothing"]=!0,Ls),Ns=oa?Symbol.for("immer-draftable"):"__$immer_draftable",j=oa?Symbol.for("immer-state"):"__$immer_state";var vu=""+Object.prototype.constructor,Ft=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Us=Object.getOwnPropertyDescriptors||function(t){var e={};return Ft(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},Jn={},Sr={get:function(t,e){if(e===j)return t;var r=je(t);if(!Dt(r,e))return function(a,i,s){var l,d=Is(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(t,r,e);var n=r[e];return t.I||!xe(n)?n:n===Vn(t.t,e)?(Kn(t),t.o[e]=Yn(t.A.h,n,t)):n},has:function(t,e){return e in je(t)},ownKeys:function(t){return Reflect.ownKeys(je(t))},set:function(t,e,r){var n=Is(je(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var a=Vn(je(t),e),i=a?.[j];if(i&&i.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Ms(r,a)&&(r!==void 0||Dt(t.t,e)))return!0;Kn(t),Ge(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return Vn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Kn(t),Ge(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=je(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){me(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){me(12)}},vr={};ht(Sr,function(t,e){vr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),vr.deleteProperty=function(t,e){return vr.set.call(this,t,e,void 0)},vr.set=function(t,e,r){return Sr.set.call(this,t[0],e,r,t[0])};var xu=function(){function t(r){var n=this;this.O=Ps,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 C=this;E===void 0&&(E=l);for(var w=arguments.length,R=Array(w>1?w-1:0),S=1;S<w;S++)R[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=i).call.apply(O,[C,v].concat(R))})}}var f;if(typeof i!="function"&&me(6),s!==void 0&&typeof s!="function"&&me(7),xe(a)){var h=Rs(n),p=Yn(n,a,void 0),m=!0;try{f=i(p),m=!1}finally{m?Kr(h):qn(h)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(E){return jn(h,s),Gn(E,h)},function(E){throw Kr(h),E}):(jn(h,s),Gn(f,h))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===Fs&&(f=void 0),n.D&&ta(f,!0),s){var y=[],b=[];Re("Patches").M(a,f,y,b),s(y,b)}return f}me(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var h=arguments.length,p=Array(h>1?h-1:0),m=1;m<h;m++)p[m-1]=arguments[m];return n.produceWithPatches(f,function(y){return a.apply(void 0,[y].concat(p))})};var s,l,d=n.produce(a,i,function(f,h){s=f,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(f){return[f,s,l]}):[d,s,l]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){xe(r)||me(8),Me(r)&&(r=gu(r));var n=Rs(this),a=Yn(this,r,void 0);return a[j].C=!0,qn(n),a},e.finishDraft=function(r,n){var a=r&&r[j],i=a.A;return jn(i,n),Gn(void 0,i)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Ps&&me(20),this.O=r},e.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}a>-1&&(n=n.slice(a+1));var s=Re("Patches").$;return Me(r)?s(r,n):this.produce(r,function(l){return s(l,n)})},t}(),le=new xu,Su=le.produce,nb=le.produceWithPatches.bind(le),ab=le.setAutoFreeze.bind(le),ib=le.setUseProxies.bind(le),sb=le.applyPatches.bind(le),cb=le.createDraft.bind(le),lb=le.finishDraft.bind(le),Yr=Su;function mt(t){"@babel/helpers - typeof";return mt=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},mt(t)}function Bs(t,e){if(mt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(mt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $s(t){var e=Bs(t,"string");return mt(e)=="symbol"?e:e+""}function Hs(t,e,r){return(e=$s(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ws(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function na(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ws(Object(r),!0).forEach(function(n){Hs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ws(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ee(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var zs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),aa=function(){return Math.random().toString(36).substring(7).split("").join(".")},Jr={INIT:"@@redux/INIT"+aa(),REPLACE:"@@redux/REPLACE"+aa(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aa()}};function Eu(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ia(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ee(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ee(1));return r(ia)(t,e)}if(typeof t!="function")throw new Error(ee(2));var a=t,i=e,s=[],l=s,d=!1;function f(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(ee(3));return i}function p(E){if(typeof E!="function")throw new Error(ee(4));if(d)throw new Error(ee(5));var C=!0;return f(),l.push(E),function(){if(C){if(d)throw new Error(ee(6));C=!1,f();var R=l.indexOf(E);l.splice(R,1),s=null}}}function m(E){if(!Eu(E))throw new Error(ee(7));if(typeof E.type>"u")throw new Error(ee(8));if(d)throw new Error(ee(9));try{d=!0,i=a(i,E)}finally{d=!1}for(var C=s=l,w=0;w<C.length;w++){var R=C[w];R()}return E}function y(E){if(typeof E!="function")throw new Error(ee(10));a=E,m({type:Jr.REPLACE})}function b(){var E,C=p;return E={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(ee(11));function S(){R.next&&R.next(h())}S();var v=C(S);return{unsubscribe:v}}},E[zs]=function(){return this},E}return m({type:Jr.INIT}),n={dispatch:m,subscribe:p,getState:h,replaceReducer:y},n[zs]=b,n}function Ou(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Jr.INIT});if(typeof n>"u")throw new Error(ee(12));if(typeof r(void 0,{type:Jr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ee(13))})}function js(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(r[a]=t[a])}var i=Object.keys(r),s,l;try{Ou(r)}catch(d){l=d}return function(f,h){if(f===void 0&&(f={}),l)throw l;if(0)var p;for(var m=!1,y={},b=0;b<i.length;b++){var E=i[b],C=r[E],w=f[E],R=C(w,h);if(typeof R>"u"){var S=h&&h.type;throw new Error(ee(14))}y[E]=R,m=m||R!==w}return m=m||i.length!==Object.keys(f).length,m?y:f}}function Bt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];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 Gs(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ee(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=Bt.apply(void 0,l)(a.dispatch),na(na({},a),{},{dispatch:i})}}}function Vs(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,t):s(l)}}};return e}var Ks=Vs();Ks.withExtraArgument=Vs;var sa=Ks;var Qs=function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cu=function(t,e){var r={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(f){return function(h){return d([f,h])}}function d(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,a=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(h){f=[6,h],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},$t=function(t,e){for(var r=0,n=e.length,a=t.length;r<n;r++,a++)t[a]=e[r];return t},wu=Object.defineProperty,Au=Object.defineProperties,Ru=Object.getOwnPropertyDescriptors,Zs=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,Iu=Object.prototype.propertyIsEnumerable,qs=function(t,e,r){return e in t?wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Ve=function(t,e){for(var r in e||(e={}))Tu.call(e,r)&&qs(t,r,e[r]);if(Zs)for(var n=0,a=Zs(e);n<a.length;n++){var r=a[n];Iu.call(e,r)&&qs(t,r,e[r])}return t},ca=function(t,e){return Au(t,Ru(e))},_u=function(t,e,r){return new Promise(function(n,a){var i=function(d){try{l(r.next(d))}catch(f){a(f)}},s=function(d){try{l(r.throw(d))}catch(f){a(f)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((r=r.apply(t,e)).next())})};var Lu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bt:Bt.apply(null,arguments)},Rb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Pu(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Nu=function(t){Qs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,$t([void 0],r[0].concat(this)))):new(e.bind.apply(e,$t([void 0],r.concat(this))))},e}(Array),ku=function(t){Qs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,$t([void 0],r[0].concat(this)))):new(e.bind.apply(e,$t([void 0],r.concat(this))))},e}(Array);function ua(t){return xe(t)?Yr(t,function(){}):t}function Mu(t){return typeof t=="boolean"}function Du(){return function(e){return Fu(e)}}function Fu(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,l=new Nu;if(r&&(Mu(r)?l.push(sa):l.push(sa.withExtraArgument(r.extraArgument))),0){if(a)var d;if(s)var f}return l}var la=!0;function Xs(t){var e=Du(),r=t||{},n=r.reducer,a=n===void 0?void 0:n,i=r.middleware,s=i===void 0?e():i,l=r.devTools,d=l===void 0?!0:l,f=r.preloadedState,h=f===void 0?void 0:f,p=r.enhancers,m=p===void 0?void 0:p,y;if(typeof a=="function")y=a;else if(Pu(a))y=js(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 b=s;if(typeof b=="function"&&(b=b(e),!la&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!la&&b.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=Gs.apply(void 0,b),C=Bt;d&&(C=Lu(Ve({trace:!la},typeof d=="object"&&d)));var w=new ku(E),R=w;Array.isArray(m)?R=$t([E],m):typeof m=="function"&&(R=m(w));var S=C.apply(void 0,R);return ia(y,h,S)}function Ke(t,e){function r(){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 Ve(Ve({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function ec(t){var e={},r=[],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 r.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,r,n]}function Uu(t){return typeof t=="function"}function Bu(t,e,r,n){r===void 0&&(r=[]);var a=typeof e=="function"?ec(e):[e,r,n],i=a[0],s=a[1],l=a[2],d;if(Uu(t))d=function(){return ua(t())};else{var f=ua(t);d=function(){return f}}function h(p,m){p===void 0&&(p=d());var y=$t([i[m.type]],s.filter(function(b){var E=b.matcher;return E(m)}).map(function(b){var E=b.reducer;return E}));return y.filter(function(b){return!!b}).length===0&&(y=[l]),y.reduce(function(b,E){if(E)if(Me(b)){var C=b,w=E(C,m);return w===void 0?b:w}else{if(xe(b))return Yr(b,function(R){return E(R,m)});var w=E(b,m);if(w===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return w}return b},p)}return h.getInitialState=d,h}function $u(t,e){return t+"/"+e}function tc(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:ua(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var p=n[h],m=$u(e,h),y,b;"reducer"in p?(y=p.reducer,b=p.prepare):y=p,i[h]=y,s[m]=y,l[h]=b?Ke(m,b):Ke(m)});function d(){var h=typeof t.extraReducers=="function"?ec(t.extraReducers):[t.extraReducers],p=h[0],m=p===void 0?{}:p,y=h[1],b=y===void 0?[]:y,E=h[2],C=E===void 0?void 0:E,w=Ve(Ve({},m),s);return Bu(r,function(R){for(var S in w)R.addCase(S,w[S]);for(var v=0,O=b;v<O.length;v++){var T=O[v];R.addMatcher(T.matcher,T.reducer)}C&&R.addDefaultCase(C)})}var f;return{name:e,reducer:function(h,p){return f||(f=d()),f(h,p)},actions:l,caseReducers:i,getInitialState:function(){return f||(f=d()),f.getInitialState()}}}var Hu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wu=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Hu[Math.random()*64|0];return e},zu=["name","message","stack","code"],da=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Ys=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),ju=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=zu;r<n.length;r++){var a=n[r];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},Lb=function(){function t(e,r,n){var a=Ke(e+"/fulfilled",function(h,p,m,y){return{payload:h,meta:ca(Ve({},y||{}),{arg:m,requestId:p,requestStatus:"fulfilled"})}}),i=Ke(e+"/pending",function(h,p,m){return{payload:void 0,meta:ca(Ve({},m||{}),{arg:p,requestId:h,requestStatus:"pending"})}}),s=Ke(e+"/rejected",function(h,p,m,y,b){return{payload:y,error:(n&&n.serializeError||ju)(h||"Rejected"),meta:ca(Ve({},b||{}),{arg:m,requestId:p,rejectedWithValue:!!y,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 f(h){return function(p,m,y){var b=n?.idGenerator?n.idGenerator(h):Wu(),E=new d,C,w=!1;function R(v){C=v,E.abort()}var S=function(){return _u(this,null,function(){var v,O,T,P,D,N,_;return Cu(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),P=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:y}),Vu(P)?[4,P]:[3,2];case 1:P=g.sent(),g.label=2;case 2:if(P===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=!0,D=new Promise(function(x,I){return E.signal.addEventListener("abort",function(){return I({name:"AbortError",message:C||"Aborted"})})}),p(i(b,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:b,arg:h},{getState:m,extra:y}))),[4,Promise.race([D,Promise.resolve(r(h,{dispatch:p,getState:m,extra:y,requestId:b,signal:E.signal,abort:R,rejectWithValue:function(x,I){return new da(x,I)},fulfillWithValue:function(x,I){return new Ys(x,I)}})).then(function(x){if(x instanceof da)throw x;return x instanceof Ys?a(x.payload,b,h,x.meta):a(x,b,h)})])];case 3:return T=g.sent(),[3,5];case 4:return N=g.sent(),T=N instanceof da?s(null,b,h,N.payload,N.meta):s(N,b,h),[3,5];case 5:return _=n&&!n.dispatchConditionRejection&&s.match(T)&&T.meta.condition,_||p(T),[2,T]}})})}();return Object.assign(S,{abort:R,requestId:b,arg:h,unwrap:function(){return S.then(Gu)}})}}return Object.assign(f,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function Gu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Vu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var rc="listener",oc="completed",nc="cancelled",Pb="task-"+nc,Nb="task-"+oc,kb=rc+"-"+nc,Mb=rc+"-"+oc;var fa="listenerMiddleware";var Db=Ke(fa+"/add"),Fb=Ke(fa+"/removeAll"),Ub=Ke(fa+"/remove");var Js,Bb=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Js||(Js=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ku=function(t){return function(e){setTimeout(e,t)}},$b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ku(10);Ds();window.ftReduxStores||(window.ftReduxStores={});var De=class t extends Pe{static get(e){var r;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Mt(i))return i;if(a==null)return;let s=tc({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),l=Xs({reducer:(d,f)=>{if(f.type==="CLEAR_FT_REDUX_STORE"){let h=nt(s.getInitialState());for(let p of f.keeping)h[p]=(d??h)[p];return h}else if(typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...f.overwrites};return s.reducer(d,f)}});return window.ftReduxStores[a.name]=new t(s,l,a.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new yr;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,f=i[d];return f?(...h)=>{let p=f(...h.map(a));return this.reduxStore.dispatch(p),p}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Zu(){var t;for(let e of Object.values((t=window.ftReduxStores)!==null&&t!==void 0?t:{}))Mt(e)&&e.clear()}var Qr=class{constructor(e,r,n){this.store=e,this.valueSelector=r,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),r=this.valueSelector(e);rt(this.lastValue,r)&&(this.callback(r,e),this.lastValue=r)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function qu(t,e,r){return new Qr(t,e,r).watch()}var pa=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var r;return(r=this.requestConsumers.get(e))!==null&&r!==void 0?r:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,r){for(let n of r)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,r){for(let n of r)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var ya={};M(ya,{scrollHelper:()=>Yu});var ma,Xr=new Map,ga=class{lock(e,r){if(r){let n=Xr.get(r);if(n==null||n===e)return Xr.set(r,e),r}}release(e,r){r&&Xr.get(r)===e&&Xr.delete(r)}findFirstScrollableParent(e){var r;let n,a;for(let i of Xo(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(r=n??a)!==null&&r!==void 0?r:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,r){var n,a;let i=0;for(;r&&r.offsetParent!==e.offsetParent;)i+=(n=r.offsetTop)!==null&&n!==void 0?n:0,r=r.offsetParent;return i+((a=r?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,r){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return r;default:return 0}}scrollIntoViewIfPossible(e,r){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=ot(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(r?.position,l)*(i-s)+s;n.scrollTo({behavior:r?.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=(ma=window.FluidTopicsScrollHelper)!==null&&ma!==void 0?ma:new ga;var Yu=window.FluidTopicsScrollHelper;var va={};M(va,{SearchPlaceConverter:()=>jt,SearchPlaceQueryParams:()=>B,isSearchPlaceQueryParams:()=>Wc,serializeRequest:()=>ef});var Qu=ml(ic(),1);var sc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(sc||(sc={}));var cc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(cc||(cc={}));var lc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(lc||(lc={}));var dc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(dc||(dc={}));var uc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(uc||(uc={}));var fc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(fc||(fc={}));var pc;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(pc||(pc={}));var hc;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(hc||(hc={}));var mc;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(mc||(mc={}));var gc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(gc||(gc={}));var yc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(yc||(yc={}));var bc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(bc||(bc={}));var vc;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(vc||(vc={}));var xc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(xc||(xc={}));var Wt;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Wt||(Wt={}));var Sc;(function(t){t.ASC="ASC",t.DESC="DESC"})(Sc||(Sc={}));var Ec;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ec||(Ec={}));var ba;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ba||(ba={}));var _c=t=>Object.keys(ba).includes(t);var Oc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Oc||(Oc={}));var Cc;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Cc||(Cc={}));var wc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(wc||(wc={}));var zt;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(zt||(zt={}));var Lc=t=>Object.keys(zt).includes(t);var Ac;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ac||(Ac={}));var Rc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Rc||(Rc={}));var Tc;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Tc||(Tc={}));var W;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(W||(W={}));var ge;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(ge||(ge={}));var Ic;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Ic||(Ic={}));var Pc;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Pc||(Pc={}));var Nc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(Nc||(Nc={}));var kc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(kc||(kc={}));var Mc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Mc||(Mc={}));var Dc;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Dc||(Dc={}));var Fc;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Fc||(Fc={}));var Uc;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Uc||(Uc={}));var Bc;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Bc||(Bc={}));var Ju={[W.PERSONAL_BOOK_SHARE_USER]:[W.PERSONAL_BOOK_USER],[W.HTML_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.PDF_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.KHUB_ADMIN]:[W.CONTENT_PUBLISHER],[W.ADMIN]:[W.KHUB_ADMIN,W.USERS_ADMIN,W.PORTAL_ADMIN,W.BEHAVIOR_DATA_USER],[W.GENERATIVE_AI_EXPORT_USER]:[W.GENERATIVE_AI_USER]};function $c(t,e){return t===e||(Ju[t]??[]).some(r=>$c(r,e))}function Fe(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>$c(n,e))}function Xu(t){return`"${t}"`}function Hc(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function ef(t,e){return new jt(t).serialize(e)}var B;(function(t){t.LOCALE="content-lang",t.QUERY="query",t.SCOPE="scope",t.FILTERS="filters",t.VIRTUAL_FIELD="virtual-field",t.PERIOD="period",t.VALUE_FILTERS="value-filters",t.DATE_FILTERS="date-filters",t.RANGE_FILTERS="range-filters",t.SORT="sort",t.PER_PAGE="per-page",t.KEYWORD_MATCH="keyword-match"})(B||(B={}));var tf=new Set(Object.values(B));function Wc(t){return tf.has(t)}var jt=class{constructor(e,r=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=r,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,r){return this.serializeToCurrentPageIfPossible(e,r??"/search")}serializeToCurrentPageIfPossible(e,r){let n=r==null||r.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${r}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,r=!1){var n,a,i,s,l,d,f,h,p,m,y;let b=new URLSearchParams;e.contentLocale?(!r||e.contentLocale!==this.defaultContentLocale)&&b.append(B.LOCALE,e.contentLocale):b.append(B.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&b.append(B.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 T,P;let D=((P=(T=O.valueFilter)===null||T===void 0?void 0:T.values)!==null&&P!==void 0?P:[]).map(N=>this.escapeFilters(N)).map(N=>Xu(Hc(N))).join("_");return`${O.key}~${D}`}).join("*");b.append(B.VALUE_FILTERS,v)}let C=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&l!==void 0?l:[];if(C.length>0){let v=C.map(O=>{var T;return`${O.key}~${(T=O.dateFilter)===null||T===void 0?void 0:T.type.toLowerCase()}`}).join("*");b.append(B.DATE_FILTERS,v)}let w=(f=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&f!==void 0?f:[];if(w.length>0){let v=w.map(O=>{var T,P;return`${O.key}~${(T=O.rangeFilter)===null||T===void 0?void 0:T.from}_${(P=O.rangeFilter)===null||P===void 0?void 0:P.to}`}).join("*");b.append(B.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&b.append(B.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&b.append(B.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&b.append(B.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(p=e.paging)===null||p===void 0?void 0:p.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&b.append(B.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&b.append(B.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let R=(y=e.otherQueryParams)!==null&&y!==void 0?y:{};for(let v in R)b.append(v,R[v]);let S=new Array;return b.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 r;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(r=this.scopeMapping[i])!==null&&r!==void 0?r:a.scope}}fromURLSearchParams(e){var r,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(w){console.warn("Could not decode search request query params, fallback on raw value",w)}let d=new URLSearchParams(e),f=d.get(B.LOCALE)==="all"?void 0:d.get(B.LOCALE),h=((r=d.get(B.VIRTUAL_FIELD))!==null&&r!==void 0?r:"EVERYWHERE").toUpperCase(),p=(n=d.get(B.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(a=d.get(B.SCOPE))!==null&&a!==void 0?a:"default",y=+((i=d.get(B.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),b=d.get(B.KEYWORD_MATCH),E=b?b.toUpperCase()===Wt.MANDATORY?Wt.MANDATORY:Wt.OPTIONAL:void 0,C={};for(let w of d.keys())Wc(w)||(C[w]=d.get(w));return{contentLocale:f??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(B.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[m])!==null&&l!==void 0?l:"DEFAULT",virtualField:_c(h)?h:"EVERYWHERE",sortId:p,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:ot(1,isNaN(y)?this.defaultPerPage:y,1e3)},keywordMatch:E,otherQueryParams:C}}parseCompatFilters(e){var r,n,a,i,s,l;let d=[];return e.has(B.FILTERS)&&(d=this.parseValueFilters((r=e.get(B.FILTERS))!==null&&r!==void 0?r:"")),(n=e.has(B.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(B.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(B.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(B.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(B.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(r=>r.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],valueFilter:{values:r[1].split("_").map(Hc).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],dateFilter:{type:zt[r[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],rangeFilter:{from:r[1].split("_")[0],to:r[1].split("_")[1]}}))}escapeFilters(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replaceAll(r,n);return e}superEscapeFilters(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replace(a,r);return e}parseLegacyPeriodFilter(e){if(Lc(e))return[{key:"ft:lastEdition",dateFilter:{type:zt[e]}}];if(e.startsWith("CUSTOM_")){let[r,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var Sa={};M(Sa,{toFtFormComponent:()=>rf});var xa=Symbol("elementInternals"),rf=V(Symbol("toFtFormComponent"),function(t){class e extends t{static get formAssociated(){return!0}get form(){return this[xa].form}constructor(...n){super(n),this[xa]=this.attachInternals()}setFormValue(n){this[xa].setFormValue(n)}}return e});var Ea={};M(Ea,{DateFormatter:()=>gt});var gt=class{static format(e,r,n,a){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,r,n,a)}static getMomentDateFormat(e,r){return e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,a){let i=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(i);if(!a)return s;let l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(i);return`${s} ${l}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Ca={};M(Ca,{ALL_KEYS_VALUE:()=>Oa,SameWindowStorageEvent:()=>Gt});var Oa="__all__",Gt=class extends CustomEvent{constructor(e,r,n){super("same-window-storage",{detail:{key:e,oldValue:r,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==Oa}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(t,e,r){let n=e.getItem(r[0]);Reflect.apply(t,e,r),window.dispatchEvent(new Gt(r[0],n,r[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(t,e,r){let n=e.getItem(r[0]);Reflect.apply(t,e,r),window.dispatchEvent(new Gt(r[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(t,e,r){Reflect.apply(t,e,r),window.dispatchEvent(new Gt(Oa))}});var Aa={};M(Aa,{FocusMainContentEvent:()=>wa});var wa=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var zc={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function of(t){(t.key==="Enter"||t.key===" "||t.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=t.key}function nf(t){window.FluidTopicsA11yHints.isKeyboardNavigation=t.detail==0}document.addEventListener("keydown",of);document.addEventListener("click",nf);var jc=H`
|
|
48
|
+
`;var ws={};var Wn={};M(Wn,{ParametrizedLabelResolver:()=>gr});var gr=class t{constructor(e,r){this.defaultLabels=e,this.labels=r}resolve(e,...r){var n,a;e=this.resolvePluralKey(e,r);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return t.replaceParameters(i,...r)}static replaceParameters(e,...r){return r.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>t.formatValue(n,s))),e}resolvePluralKey(e,r){for(let n of r)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,r){return e instanceof Date?t.formatDate(e,r):e??""}static formatDate(e,r){let n=a=>r?.includes("date")?e.toLocaleDateString(a):r?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var ha={};M(ha,{FtCommandQueue:()=>yr,FtLitElementRedux:()=>pt,FtReduxStore:()=>De,FtStateManager:()=>pa,ReduxWatcher:()=>Qr,clearAllStores:()=>Zu,isFtReduxStore:()=>Mt,redux:()=>q,reduxEventListener:()=>zn,reduxReactive:()=>uu,watch:()=>qu,withRedux:()=>As});var uu=()=>(t,e)=>{var r;let n=t.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(r=n.reduxReactiveProperties)===null||r===void 0||r.add(e)},q=t=>{let e=t??{};return(r,n)=>{var a;let i={hasChanged:rt,attribute:!1,...e};L(i)(r,n);let s=r.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})}},zn=t=>(e,r)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(r,t)};var yr=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};function Mt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var br=Symbol("internalReduxEventsUnsubscribers"),ze=Symbol("internalStoresUnsubscribers"),ft=Symbol("internalStores"),As=V(Symbol("withRedux"),function(t){var e,r,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=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[ft].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ft].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[ft].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[ft].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[ft].delete(l)}setupStores(){this.unsubscribeFromStores(),this[ft].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 f=this.getStore(s.store);f&&(s.store?this[ze].has(s.store):this[ze].size>0)&&(this[l]=s.selector(f.getState(),this))}})}subscribeToStore(s,l){var d;this[ze].set(s,l.subscribe(()=>this.updateFromStores())),this[br].set(s,[]),Mt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((f,h)=>{if(typeof this[h]=="function"&&(!f.store||l.name===f.store)){let p=m=>this[h](m);l.addEventListener(f.eventName,p),this[br].get(s).push(()=>l.removeEventListener(f.eventName,p))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[ze].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[ze].has(s)&&this[ze].get(s)(),this[ze].delete(s),(l=this[br].get(s))===null||l===void 0||l.forEach(d=>d()),this[br].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ze,r=ft,n=br,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),pt=class extends As(J){};function me(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Me(t){return!!t&&!!t[j]}function xe(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===vu}(t)||Array.isArray(t)||!!t[Ns]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ns])||Qn(t)||Xn(t))}function ht(t,e,r){r===void 0&&(r=!1),Ut(t)===0?(r?Object.keys:Ft)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Ut(t){var e=t[j];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Qn(t)?2:Xn(t)?3:0}function Dt(t,e){return Ut(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function fu(t,e){return Ut(t)===2?t.get(e):t[e]}function ks(t,e,r){var n=Ut(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function Ms(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Qn(t){return yu&&t instanceof Map}function Xn(t){return bu&&t instanceof Set}function je(t){return t.o||t.t}function ea(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Us(t);delete e[j];for(var r=Ft(e),n=0;n<r.length;n++){var a=r[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:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function ta(t,e){return e===void 0&&(e=!1),ra(t)||Me(t)||!xe(t)||(Ut(t)>1&&(t.set=t.add=t.clear=t.delete=pu),Object.freeze(t),e&&ht(t,function(r,n){return ta(n,!0)},!0)),t}function pu(){me(2)}function ra(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Re(t){var e=Jn[t];return e||me(18,t),e}function hu(t,e){Jn[t]||(Jn[t]=e)}function Zn(){return xr}function jn(t,e){e&&(Re("Patches"),t.u=[],t.s=[],t.v=e)}function Kr(t){qn(t),t.p.forEach(mu),t.p=null}function qn(t){t===xr&&(xr=t.l)}function Rs(t){return xr={p:[],l:xr,h:t,m:!0,_:0}}function mu(t){var e=t[j];e.i===0||e.i===1?e.j():e.g=!0}function Gn(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Re("ES5").S(e,t,n),n?(r[j].P&&(Kr(e),me(4)),xe(t)&&(t=Zr(e,t),e.l||qr(e,t)),e.u&&Re("Patches").M(r[j].t,t,e.u,e.s)):t=Zr(e,r,[]),Kr(e),e.u&&e.v(e.u,e.s),t!==Fs?t:void 0}function Zr(t,e,r){if(ra(e))return e;var n=e[j];if(!n)return ht(e,function(l,d){return Ts(t,n,e,l,d,r)},!0),e;if(n.A!==t)return e;if(!n.P)return qr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ea(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),ht(i,function(l,d){return Ts(t,n,a,l,d,r,s)}),qr(t,a,!1),r&&t.u&&Re("Patches").N(n,r,t.u,t.s)}return n.o}function Ts(t,e,r,n,a,i,s){if(Me(a)){var l=Zr(t,a,i&&e&&e.i!==3&&!Dt(e.R,n)?i.concat(n):void 0);if(ks(r,n,l),!Me(l))return;t.m=!1}else s&&r.add(a);if(xe(a)&&!ra(a)){if(!t.h.D&&t._<1)return;Zr(t,a),e&&e.A.l||qr(t,a)}}function qr(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&ta(e,r)}function Vn(t,e){var r=t[j];return(r?je(r):t)[e]}function Is(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ge(t){t.P||(t.P=!0,t.l&&Ge(t.l))}function Kn(t){t.o||(t.o=ea(t.t))}function Yn(t,e,r){var n=Qn(e)?Re("MapSet").F(e,r):Xn(e)?Re("MapSet").T(e,r):t.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,f=Sr;s&&(d=[l],f=vr);var h=Proxy.revocable(d,f),p=h.revoke,m=h.proxy;return l.k=m,l.j=p,m}(e,r):Re("ES5").J(e,r);return(r?r.A:Zn()).p.push(n),n}function gu(t){return Me(t)||me(22,t),function e(r){if(!xe(r))return r;var n,a=r[j],i=Ut(r);if(a){if(!a.P&&(a.i<4||!Re("ES5").K(a)))return a.t;a.I=!0,n=_s(r,i),a.I=!1}else n=_s(r,i);return ht(n,function(s,l){a&&fu(a.t,s)===l||ks(n,s,e(l))}),i===3?new Set(n):n}(t)}function _s(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return ea(t)}function Ds(){function t(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var f=this[j];return Sr.get(f,s)},set:function(f){var h=this[j];Sr.set(h,s,f)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][j];if(!d.P)switch(d.i){case 5:n(d)&&Ge(d);break;case 4:r(d)&&Ge(d)}}}function r(s){for(var l=s.t,d=s.k,f=Ft(d),h=f.length-1;h>=0;h--){var p=f[h];if(p!==j){var m=l[p];if(m===void 0&&!Dt(l,p))return!0;var y=d[p],b=y&&y[j];if(b?b.t!==m:!Ms(y,m))return!0}}var E=!!l[j];return f.length!==Ft(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 f=0;f<l.length;f++)if(!l.hasOwnProperty(f))return!0;return!1}function a(s){s.g&&me(3,JSON.stringify(je(s)))}var i={};hu("ES5",{J:function(s,l){var d=Array.isArray(s),f=function(p,m){if(p){for(var y=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(y,""+b,t(b,!0));return y}var E=Us(m);delete E[j];for(var C=Ft(E),w=0;w<C.length;w++){var R=C[w];E[R]=t(R,p||!!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:f,o:null,g:!1,C:!1};return Object.defineProperty(f,j,{value:h,writable:!0}),f},S:function(s,l,d){d?Me(l)&&l[j].A===s&&e(s.p):(s.u&&function f(h){if(h&&typeof h=="object"){var p=h[j];if(p){var m=p.t,y=p.k,b=p.R,E=p.i;if(E===4)ht(y,function(v){v!==j&&(m[v]!==void 0||Dt(m,v)?b[v]||f(y[v]):(b[v]=!0,Ge(p)))}),ht(m,function(v){y[v]!==void 0||Dt(y,v)||(b[v]=!1,Ge(p))});else if(E===5){if(n(p)&&(Ge(p),b.length=!0),y.length<m.length)for(var C=y.length;C<m.length;C++)b[C]=!1;else for(var w=m.length;w<y.length;w++)b[w]=!0;for(var R=Math.min(y.length,m.length),S=0;S<R;S++)y.hasOwnProperty(S)||(b[S]=!0),b[S]===void 0&&f(y[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Ls,xr,oa=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",yu=typeof Map<"u",bu=typeof Set<"u",Ps=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Fs=oa?Symbol.for("immer-nothing"):((Ls={})["immer-nothing"]=!0,Ls),Ns=oa?Symbol.for("immer-draftable"):"__$immer_draftable",j=oa?Symbol.for("immer-state"):"__$immer_state";var vu=""+Object.prototype.constructor,Ft=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Us=Object.getOwnPropertyDescriptors||function(t){var e={};return Ft(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},Jn={},Sr={get:function(t,e){if(e===j)return t;var r=je(t);if(!Dt(r,e))return function(a,i,s){var l,d=Is(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(t,r,e);var n=r[e];return t.I||!xe(n)?n:n===Vn(t.t,e)?(Kn(t),t.o[e]=Yn(t.A.h,n,t)):n},has:function(t,e){return e in je(t)},ownKeys:function(t){return Reflect.ownKeys(je(t))},set:function(t,e,r){var n=Is(je(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var a=Vn(je(t),e),i=a?.[j];if(i&&i.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Ms(r,a)&&(r!==void 0||Dt(t.t,e)))return!0;Kn(t),Ge(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return Vn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Kn(t),Ge(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=je(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){me(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){me(12)}},vr={};ht(Sr,function(t,e){vr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),vr.deleteProperty=function(t,e){return vr.set.call(this,t,e,void 0)},vr.set=function(t,e,r){return Sr.set.call(this,t[0],e,r,t[0])};var xu=function(){function t(r){var n=this;this.O=Ps,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 C=this;E===void 0&&(E=l);for(var w=arguments.length,R=Array(w>1?w-1:0),S=1;S<w;S++)R[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=i).call.apply(O,[C,v].concat(R))})}}var f;if(typeof i!="function"&&me(6),s!==void 0&&typeof s!="function"&&me(7),xe(a)){var h=Rs(n),p=Yn(n,a,void 0),m=!0;try{f=i(p),m=!1}finally{m?Kr(h):qn(h)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(E){return jn(h,s),Gn(E,h)},function(E){throw Kr(h),E}):(jn(h,s),Gn(f,h))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===Fs&&(f=void 0),n.D&&ta(f,!0),s){var y=[],b=[];Re("Patches").M(a,f,y,b),s(y,b)}return f}me(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var h=arguments.length,p=Array(h>1?h-1:0),m=1;m<h;m++)p[m-1]=arguments[m];return n.produceWithPatches(f,function(y){return a.apply(void 0,[y].concat(p))})};var s,l,d=n.produce(a,i,function(f,h){s=f,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(f){return[f,s,l]}):[d,s,l]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){xe(r)||me(8),Me(r)&&(r=gu(r));var n=Rs(this),a=Yn(this,r,void 0);return a[j].C=!0,qn(n),a},e.finishDraft=function(r,n){var a=r&&r[j],i=a.A;return jn(i,n),Gn(void 0,i)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Ps&&me(20),this.O=r},e.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}a>-1&&(n=n.slice(a+1));var s=Re("Patches").$;return Me(r)?s(r,n):this.produce(r,function(l){return s(l,n)})},t}(),le=new xu,Su=le.produce,nb=le.produceWithPatches.bind(le),ab=le.setAutoFreeze.bind(le),ib=le.setUseProxies.bind(le),sb=le.applyPatches.bind(le),cb=le.createDraft.bind(le),lb=le.finishDraft.bind(le),Yr=Su;function mt(t){"@babel/helpers - typeof";return mt=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},mt(t)}function Bs(t,e){if(mt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(mt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $s(t){var e=Bs(t,"string");return mt(e)=="symbol"?e:e+""}function Hs(t,e,r){return(e=$s(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ws(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function na(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ws(Object(r),!0).forEach(function(n){Hs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ws(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ee(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var zs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),aa=function(){return Math.random().toString(36).substring(7).split("").join(".")},Jr={INIT:"@@redux/INIT"+aa(),REPLACE:"@@redux/REPLACE"+aa(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aa()}};function Eu(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ia(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ee(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ee(1));return r(ia)(t,e)}if(typeof t!="function")throw new Error(ee(2));var a=t,i=e,s=[],l=s,d=!1;function f(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(ee(3));return i}function p(E){if(typeof E!="function")throw new Error(ee(4));if(d)throw new Error(ee(5));var C=!0;return f(),l.push(E),function(){if(C){if(d)throw new Error(ee(6));C=!1,f();var R=l.indexOf(E);l.splice(R,1),s=null}}}function m(E){if(!Eu(E))throw new Error(ee(7));if(typeof E.type>"u")throw new Error(ee(8));if(d)throw new Error(ee(9));try{d=!0,i=a(i,E)}finally{d=!1}for(var C=s=l,w=0;w<C.length;w++){var R=C[w];R()}return E}function y(E){if(typeof E!="function")throw new Error(ee(10));a=E,m({type:Jr.REPLACE})}function b(){var E,C=p;return E={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(ee(11));function S(){R.next&&R.next(h())}S();var v=C(S);return{unsubscribe:v}}},E[zs]=function(){return this},E}return m({type:Jr.INIT}),n={dispatch:m,subscribe:p,getState:h,replaceReducer:y},n[zs]=b,n}function Ou(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Jr.INIT});if(typeof n>"u")throw new Error(ee(12));if(typeof r(void 0,{type:Jr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ee(13))})}function js(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(r[a]=t[a])}var i=Object.keys(r),s,l;try{Ou(r)}catch(d){l=d}return function(f,h){if(f===void 0&&(f={}),l)throw l;if(0)var p;for(var m=!1,y={},b=0;b<i.length;b++){var E=i[b],C=r[E],w=f[E],R=C(w,h);if(typeof R>"u"){var S=h&&h.type;throw new Error(ee(14))}y[E]=R,m=m||R!==w}return m=m||i.length!==Object.keys(f).length,m?y:f}}function Bt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];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 Gs(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(ee(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=Bt.apply(void 0,l)(a.dispatch),na(na({},a),{},{dispatch:i})}}}function Vs(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,t):s(l)}}};return e}var Ks=Vs();Ks.withExtraArgument=Vs;var sa=Ks;var Qs=function(){var t=function(e,r){return t=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])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cu=function(t,e){var r={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(f){return function(h){return d([f,h])}}function d(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,a=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(h){f=[6,h],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},$t=function(t,e){for(var r=0,n=e.length,a=t.length;r<n;r++,a++)t[a]=e[r];return t},wu=Object.defineProperty,Au=Object.defineProperties,Ru=Object.getOwnPropertyDescriptors,Zs=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,Iu=Object.prototype.propertyIsEnumerable,qs=function(t,e,r){return e in t?wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Ve=function(t,e){for(var r in e||(e={}))Tu.call(e,r)&&qs(t,r,e[r]);if(Zs)for(var n=0,a=Zs(e);n<a.length;n++){var r=a[n];Iu.call(e,r)&&qs(t,r,e[r])}return t},ca=function(t,e){return Au(t,Ru(e))},_u=function(t,e,r){return new Promise(function(n,a){var i=function(d){try{l(r.next(d))}catch(f){a(f)}},s=function(d){try{l(r.throw(d))}catch(f){a(f)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((r=r.apply(t,e)).next())})};var Lu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bt:Bt.apply(null,arguments)},Rb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Pu(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Nu=function(t){Qs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,$t([void 0],r[0].concat(this)))):new(e.bind.apply(e,$t([void 0],r.concat(this))))},e}(Array),ku=function(t){Qs(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,$t([void 0],r[0].concat(this)))):new(e.bind.apply(e,$t([void 0],r.concat(this))))},e}(Array);function ua(t){return xe(t)?Yr(t,function(){}):t}function Mu(t){return typeof t=="boolean"}function Du(){return function(e){return Fu(e)}}function Fu(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,l=new Nu;if(r&&(Mu(r)?l.push(sa):l.push(sa.withExtraArgument(r.extraArgument))),0){if(a)var d;if(s)var f}return l}var la=!0;function Xs(t){var e=Du(),r=t||{},n=r.reducer,a=n===void 0?void 0:n,i=r.middleware,s=i===void 0?e():i,l=r.devTools,d=l===void 0?!0:l,f=r.preloadedState,h=f===void 0?void 0:f,p=r.enhancers,m=p===void 0?void 0:p,y;if(typeof a=="function")y=a;else if(Pu(a))y=js(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 b=s;if(typeof b=="function"&&(b=b(e),!la&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!la&&b.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=Gs.apply(void 0,b),C=Bt;d&&(C=Lu(Ve({trace:!la},typeof d=="object"&&d)));var w=new ku(E),R=w;Array.isArray(m)?R=$t([E],m):typeof m=="function"&&(R=m(w));var S=C.apply(void 0,R);return ia(y,h,S)}function Ke(t,e){function r(){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 Ve(Ve({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function ec(t){var e={},r=[],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 r.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,r,n]}function Uu(t){return typeof t=="function"}function Bu(t,e,r,n){r===void 0&&(r=[]);var a=typeof e=="function"?ec(e):[e,r,n],i=a[0],s=a[1],l=a[2],d;if(Uu(t))d=function(){return ua(t())};else{var f=ua(t);d=function(){return f}}function h(p,m){p===void 0&&(p=d());var y=$t([i[m.type]],s.filter(function(b){var E=b.matcher;return E(m)}).map(function(b){var E=b.reducer;return E}));return y.filter(function(b){return!!b}).length===0&&(y=[l]),y.reduce(function(b,E){if(E)if(Me(b)){var C=b,w=E(C,m);return w===void 0?b:w}else{if(xe(b))return Yr(b,function(R){return E(R,m)});var w=E(b,m);if(w===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return w}return b},p)}return h.getInitialState=d,h}function $u(t,e){return t+"/"+e}function tc(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:ua(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var p=n[h],m=$u(e,h),y,b;"reducer"in p?(y=p.reducer,b=p.prepare):y=p,i[h]=y,s[m]=y,l[h]=b?Ke(m,b):Ke(m)});function d(){var h=typeof t.extraReducers=="function"?ec(t.extraReducers):[t.extraReducers],p=h[0],m=p===void 0?{}:p,y=h[1],b=y===void 0?[]:y,E=h[2],C=E===void 0?void 0:E,w=Ve(Ve({},m),s);return Bu(r,function(R){for(var S in w)R.addCase(S,w[S]);for(var v=0,O=b;v<O.length;v++){var T=O[v];R.addMatcher(T.matcher,T.reducer)}C&&R.addDefaultCase(C)})}var f;return{name:e,reducer:function(h,p){return f||(f=d()),f(h,p)},actions:l,caseReducers:i,getInitialState:function(){return f||(f=d()),f.getInitialState()}}}var Hu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wu=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Hu[Math.random()*64|0];return e},zu=["name","message","stack","code"],da=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Ys=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),ju=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=zu;r<n.length;r++){var a=n[r];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},Lb=function(){function t(e,r,n){var a=Ke(e+"/fulfilled",function(h,p,m,y){return{payload:h,meta:ca(Ve({},y||{}),{arg:m,requestId:p,requestStatus:"fulfilled"})}}),i=Ke(e+"/pending",function(h,p,m){return{payload:void 0,meta:ca(Ve({},m||{}),{arg:p,requestId:h,requestStatus:"pending"})}}),s=Ke(e+"/rejected",function(h,p,m,y,b){return{payload:y,error:(n&&n.serializeError||ju)(h||"Rejected"),meta:ca(Ve({},b||{}),{arg:m,requestId:p,rejectedWithValue:!!y,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 f(h){return function(p,m,y){var b=n?.idGenerator?n.idGenerator(h):Wu(),E=new d,C,w=!1;function R(v){C=v,E.abort()}var S=function(){return _u(this,null,function(){var v,O,T,P,D,N,_;return Cu(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),P=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:y}),Vu(P)?[4,P]:[3,2];case 1:P=g.sent(),g.label=2;case 2:if(P===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=!0,D=new Promise(function(x,I){return E.signal.addEventListener("abort",function(){return I({name:"AbortError",message:C||"Aborted"})})}),p(i(b,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:b,arg:h},{getState:m,extra:y}))),[4,Promise.race([D,Promise.resolve(r(h,{dispatch:p,getState:m,extra:y,requestId:b,signal:E.signal,abort:R,rejectWithValue:function(x,I){return new da(x,I)},fulfillWithValue:function(x,I){return new Ys(x,I)}})).then(function(x){if(x instanceof da)throw x;return x instanceof Ys?a(x.payload,b,h,x.meta):a(x,b,h)})])];case 3:return T=g.sent(),[3,5];case 4:return N=g.sent(),T=N instanceof da?s(null,b,h,N.payload,N.meta):s(N,b,h),[3,5];case 5:return _=n&&!n.dispatchConditionRejection&&s.match(T)&&T.meta.condition,_||p(T),[2,T]}})})}();return Object.assign(S,{abort:R,requestId:b,arg:h,unwrap:function(){return S.then(Gu)}})}}return Object.assign(f,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function Gu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Vu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var rc="listener",oc="completed",nc="cancelled",Pb="task-"+nc,Nb="task-"+oc,kb=rc+"-"+nc,Mb=rc+"-"+oc;var fa="listenerMiddleware";var Db=Ke(fa+"/add"),Fb=Ke(fa+"/removeAll"),Ub=Ke(fa+"/remove");var Js,Bb=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Js||(Js=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ku=function(t){return function(e){setTimeout(e,t)}},$b=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ku(10);Ds();window.ftReduxStores||(window.ftReduxStores={});var De=class t extends Pe{static get(e){var r;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Mt(i))return i;if(a==null)return;let s=tc({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),l=Xs({reducer:(d,f)=>{if(f.type==="CLEAR_FT_REDUX_STORE"){let h=nt(s.getInitialState());for(let p of f.keeping)h[p]=(d??h)[p];return h}else if(typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...f.overwrites};return s.reducer(d,f)}});return window.ftReduxStores[a.name]=new t(s,l,a.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new yr;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,f=i[d];return f?(...h)=>{let p=f(...h.map(a));return this.reduxStore.dispatch(p),p}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Zu(){var t;for(let e of Object.values((t=window.ftReduxStores)!==null&&t!==void 0?t:{}))Mt(e)&&e.clear()}var Qr=class{constructor(e,r,n){this.store=e,this.valueSelector=r,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),r=this.valueSelector(e);rt(this.lastValue,r)&&(this.callback(r,e),this.lastValue=r)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function qu(t,e,r){return new Qr(t,e,r).watch()}var pa=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var r;return(r=this.requestConsumers.get(e))!==null&&r!==void 0?r:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,r){for(let n of r)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,r){for(let n of r)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var ya={};M(ya,{scrollHelper:()=>Yu});var ma,Xr=new Map,ga=class{lock(e,r){if(r){let n=Xr.get(r);if(n==null||n===e)return Xr.set(r,e),r}}release(e,r){r&&Xr.get(r)===e&&Xr.delete(r)}findFirstScrollableParent(e){var r;let n,a;for(let i of Xo(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(r=n??a)!==null&&r!==void 0?r:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,r){var n,a;let i=0;for(;r&&r.offsetParent!==e.offsetParent;)i+=(n=r.offsetTop)!==null&&n!==void 0?n:0,r=r.offsetParent;return i+((a=r?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,r){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return r;default:return 0}}scrollIntoViewIfPossible(e,r){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=ot(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(r?.position,l)*(i-s)+s;n.scrollTo({behavior:r?.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=(ma=window.FluidTopicsScrollHelper)!==null&&ma!==void 0?ma:new ga;var Yu=window.FluidTopicsScrollHelper;var va={};M(va,{SearchPlaceConverter:()=>jt,SearchPlaceQueryParams:()=>B,isSearchPlaceQueryParams:()=>Wc,serializeRequest:()=>ef});var Qu=ml(ic(),1);var sc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(sc||(sc={}));var cc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(cc||(cc={}));var lc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(lc||(lc={}));var dc;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(dc||(dc={}));var uc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(uc||(uc={}));var fc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(fc||(fc={}));var pc;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(pc||(pc={}));var hc;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(hc||(hc={}));var mc;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(mc||(mc={}));var gc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(gc||(gc={}));var yc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(yc||(yc={}));var bc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(bc||(bc={}));var vc;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(vc||(vc={}));var xc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(xc||(xc={}));var Wt;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Wt||(Wt={}));var Sc;(function(t){t.ASC="ASC",t.DESC="DESC"})(Sc||(Sc={}));var Ec;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ec||(Ec={}));var ba;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ba||(ba={}));var _c=t=>Object.keys(ba).includes(t);var Oc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Oc||(Oc={}));var Cc;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Cc||(Cc={}));var wc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(wc||(wc={}));var zt;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(zt||(zt={}));var Lc=t=>Object.keys(zt).includes(t);var Ac;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ac||(Ac={}));var Rc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Rc||(Rc={}));var Tc;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Tc||(Tc={}));var W;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(W||(W={}));var ge;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(ge||(ge={}));var Ic;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Ic||(Ic={}));var Pc;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Pc||(Pc={}));var Nc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(Nc||(Nc={}));var kc;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(kc||(kc={}));var Mc;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Mc||(Mc={}));var Dc;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Dc||(Dc={}));var Fc;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Fc||(Fc={}));var Uc;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Uc||(Uc={}));var Bc;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Bc||(Bc={}));var Ju={[W.PERSONAL_BOOK_SHARE_USER]:[W.PERSONAL_BOOK_USER],[W.HTML_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.PDF_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.KHUB_ADMIN]:[W.CONTENT_PUBLISHER],[W.ADMIN]:[W.KHUB_ADMIN,W.USERS_ADMIN,W.PORTAL_ADMIN,W.BEHAVIOR_DATA_USER],[W.GENERATIVE_AI_EXPORT_USER]:[W.GENERATIVE_AI_USER]};function $c(t,e){return t===e||(Ju[t]??[]).some(r=>$c(r,e))}function Fe(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>$c(n,e))}function Xu(t){return`"${t}"`}function Hc(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function ef(t,e){return new jt(t).serialize(e)}var B;(function(t){t.LOCALE="content-lang",t.QUERY="query",t.SCOPE="scope",t.FILTERS="filters",t.VIRTUAL_FIELD="virtual-field",t.PERIOD="period",t.VALUE_FILTERS="value-filters",t.DATE_FILTERS="date-filters",t.RANGE_FILTERS="range-filters",t.SORT="sort",t.PER_PAGE="per-page",t.KEYWORD_MATCH="keyword-match"})(B||(B={}));var tf=new Set(Object.values(B));function Wc(t){return tf.has(t)}var jt=class{constructor(e,r=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=r,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,r){return this.serializeToCurrentPageIfPossible(e,r??"/search")}serializeToCurrentPageIfPossible(e,r){let n=r==null||r.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${r}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,r=!1){var n,a,i,s,l,d,f,h,p,m,y;let b=new URLSearchParams;e.contentLocale?(!r||e.contentLocale!==this.defaultContentLocale)&&b.append(B.LOCALE,e.contentLocale):b.append(B.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&b.append(B.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 T,P;let D=((P=(T=O.valueFilter)===null||T===void 0?void 0:T.values)!==null&&P!==void 0?P:[]).map(N=>this.escapeFilters(N)).map(N=>Xu(Hc(N))).join("_");return`${O.key}~${D}`}).join("*");b.append(B.VALUE_FILTERS,v)}let C=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&l!==void 0?l:[];if(C.length>0){let v=C.map(O=>{var T;return`${O.key}~${(T=O.dateFilter)===null||T===void 0?void 0:T.type.toLowerCase()}`}).join("*");b.append(B.DATE_FILTERS,v)}let w=(f=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&f!==void 0?f:[];if(w.length>0){let v=w.map(O=>{var T,P;return`${O.key}~${(T=O.rangeFilter)===null||T===void 0?void 0:T.from}_${(P=O.rangeFilter)===null||P===void 0?void 0:P.to}`}).join("*");b.append(B.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&b.append(B.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&b.append(B.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&b.append(B.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(p=e.paging)===null||p===void 0?void 0:p.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&b.append(B.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&b.append(B.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let R=(y=e.otherQueryParams)!==null&&y!==void 0?y:{};for(let v in R)b.append(v,R[v]);let S=new Array;return b.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 r;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(r=this.scopeMapping[i])!==null&&r!==void 0?r:a.scope}}fromURLSearchParams(e){var r,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(w){console.warn("Could not decode search request query params, fallback on raw value",w)}let d=new URLSearchParams(e),f=d.get(B.LOCALE)==="all"?void 0:d.get(B.LOCALE),h=((r=d.get(B.VIRTUAL_FIELD))!==null&&r!==void 0?r:"EVERYWHERE").toUpperCase(),p=(n=d.get(B.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(a=d.get(B.SCOPE))!==null&&a!==void 0?a:"default",y=+((i=d.get(B.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),b=d.get(B.KEYWORD_MATCH),E=b?b.toUpperCase()===Wt.MANDATORY?Wt.MANDATORY:Wt.OPTIONAL:void 0,C={};for(let w of d.keys())Wc(w)||(C[w]=d.get(w));return{contentLocale:f??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(B.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[m])!==null&&l!==void 0?l:"DEFAULT",virtualField:_c(h)?h:"EVERYWHERE",sortId:p,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:ot(1,isNaN(y)?this.defaultPerPage:y,1e3)},keywordMatch:E,otherQueryParams:C}}parseCompatFilters(e){var r,n,a,i,s,l;let d=[];return e.has(B.FILTERS)&&(d=this.parseValueFilters((r=e.get(B.FILTERS))!==null&&r!==void 0?r:"")),(n=e.has(B.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(B.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(B.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(B.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(B.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(r=>r.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],valueFilter:{values:r[1].split("_").map(Hc).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],dateFilter:{type:zt[r[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(r=>({key:r[0],rangeFilter:{from:r[1].split("_")[0],to:r[1].split("_")[1]}}))}escapeFilters(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replaceAll(r,n);return e}superEscapeFilters(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[r,n,a]of this.filtersEscapeMapping)e=e.replace(a,r);return e}parseLegacyPeriodFilter(e){if(Lc(e))return[{key:"ft:lastEdition",dateFilter:{type:zt[e]}}];if(e.startsWith("CUSTOM_")){let[r,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var Sa={};M(Sa,{toFtFormComponent:()=>rf});var xa=Symbol("elementInternals"),rf=V(Symbol("toFtFormComponent"),function(t){class e extends t{static get formAssociated(){return!0}get form(){return this[xa].form}constructor(...n){super(n),this[xa]=this.attachInternals()}setFormValue(n){this[xa].setFormValue(n)}}return e});var Ea={};M(Ea,{DateFormatter:()=>gt});var gt=class{static format(e,r,n,a,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,a,!!i)):this.getIntlDateTime(e,r,n,a,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,a,i){let s=typeof e=="string"?new Date(e):e,l=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(s),d=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return i?d:a?`${l} ${d}`:l}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Ca={};M(Ca,{ALL_KEYS_VALUE:()=>Oa,SameWindowStorageEvent:()=>Gt});var Oa="__all__",Gt=class extends CustomEvent{constructor(e,r,n){super("same-window-storage",{detail:{key:e,oldValue:r,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==Oa}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(t,e,r){let n=e.getItem(r[0]);Reflect.apply(t,e,r),window.dispatchEvent(new Gt(r[0],n,r[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(t,e,r){let n=e.getItem(r[0]);Reflect.apply(t,e,r),window.dispatchEvent(new Gt(r[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(t,e,r){Reflect.apply(t,e,r),window.dispatchEvent(new Gt(Oa))}});var Aa={};M(Aa,{FocusMainContentEvent:()=>wa});var wa=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var zc={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function of(t){(t.key==="Enter"||t.key===" "||t.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=t.key}function nf(t){window.FluidTopicsA11yHints.isKeyboardNavigation=t.detail==0}document.addEventListener("keydown",of);document.addEventListener("click",nf);var jc=H`
|
|
49
49
|
.sr-only {
|
|
50
50
|
position:absolute;
|
|
51
51
|
left:-10000px;
|
|
@@ -119,7 +119,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
119
119
|
}
|
|
120
120
|
`;var qe=class extends J{render(){return re`
|
|
121
121
|
`}};qe.elementDefinitions={};qe.styles=Jc;Ne("ft-skeleton")(qe);var Qc=H`
|
|
122
|
-
`;var vf={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Xc=t=>De.get({name:"ft-reader-"+t,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:vf});var Ha=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,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,r,n){return e.flatMap(a=>{var i;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,r,n):[{tocId:a.tocId,title:(i=a.title)!==null&&i!==void 0?i:"",untranslatedTitle:a.untranslatedTitle,depth:r,children:this.extractPagesToc(a.children,r+1,a.tocId)}]})}convertNodes(e,r,n){return e.flatMap(a=>{var i,s,l;if(a.tocId==null)return[...this.convertSectionNodes((i=a.pageToc)!==null&&i!==void 0?i:[],r,a.tocId),...this.convertNodes(a.children,r,a.tocId)];let d=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),f={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:d,depth:r,parentTocId:n,children:[]};this.register(f);let h=this.convertSectionNodes((l=a.pageToc)!==null&&l!==void 0?l:[],r+1,a.tocId),p=this.convertNodes(a.children,r+1,f.tocId);return f.children=[...h,...p],[f]})}convertSectionNodes(e,r,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:r,parentTocId:n,children:[]};return this.register(l),l.children=this.convertSectionNodes(a.children,r+1,a.tocId),[l]})}buildPage(e,r){var n,a,i,s,l,d;let f={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:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},h=(m,y)=>(y?f.topics:f.hiddenTopics).push(m),p=(l=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&l!==void 0?l:[];return f.breadcrumb.forEach((m,y)=>{h(m,p[y])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),f.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),f}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}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,r){return new Ha(e,r).build()}};var xf="ft-app-info",Te=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Te.eventName="authentication-change";var Sf={session:(t,e)=>{se(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>A.dispatchEvent(new Te(e.payload)),0))}},A=De.get({name:xf,reducers:Sf,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 co=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},_x=V(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(A)}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=>gt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return co([L({type:Boolean})],e.prototype,"useLongDateFormat",void 0),co([L({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),co([q({store:A.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),co([q({store:A.name})],e.prototype,"uiLocale",void 0),e});var xt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=A.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=A.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var lo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):xt.await()}};var te=class extends lo{constructor(e=!0,r){var n;super(r),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 Oe,this.cache=e?a.commonCache:new Oe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var uo=class extends te{async listMySearches(){let{session:e}=A.getState();return Fe(e,W.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var fo=class extends te{async listMyBookmarks(){let e=A.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var po=class extends te{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=A.getState().session;return!!e?.sessionAuthenticated}};var ho=class extends te{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=A.getState().session;return!!e?.sessionAuthenticated}};var Ef="ft-user-assets",Of={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(ge).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;za(t,r,[...Wa(t,r),a]),el(t,r,1,n),tl(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;za(t,r,Wa(t,r).map(a=>a.id===n.id?n:a)),tl(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;za(t,r,Wa(t,r).filter(i=>i.id!==a)),el(t,r,-1,n)}},rl={[ge.SEARCHES]:"savedSearches",[ge.BOOKMARKS]:"bookmarks",[ge.BOOKS]:void 0,[ge.COLLECTIONS]:void 0},Wa=(t,e)=>{var r;let n=rl[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},za=(t,e,r)=>{let n=rl[e];n&&(t[n]=r)},el=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===ge.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},tl=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},de=De.get({name:Ef,reducers:Of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ge).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ja=class{constructor(e=new po,r=new ho){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=A.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new fo,this.savedSearchesService=new uo,A.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=A.getState();se((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),de.actions.clearAssetCount(),de.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),de.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),de.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();de.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();de.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&de.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&de.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(de.getState().assetCounts.bookmarkByMap).length!==0;e===ge.BOOKMARKS&&r&&de.actions.clearBookmarkCountByMap(),de.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;de.actions.bookmarks(r)}}},Ga=new ja;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ga);var Va=class{addCommand(e,r=!1){A.commands.add(e,r)}consumeCommand(e){return A.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Va;var ol,Vt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Cf=Symbol("clearAfterUnitTest"),mo=class extends Ur(te){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ol]=()=>{this.defaultMessages={},this.cache=new Oe,this.listeners={}},this.currentUiLocale=A.getState().uiLocale,A.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=A.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};se(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new gr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Le)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Vt({loadedContexts:e})),this.dispatchEvent(new Vt({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Vt({loadedContexts:[e]})),this.dispatchEvent(new Vt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Fr(0).then(()=>n()).catch(()=>null)))}};ol=Cf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends mo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends mo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var nl=window.FluidTopicsI18nService,hS=window.FluidTopicsCustomI18nService;var Ka=class{highlightHtml(e,r,n){mr(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Ka;var Za=class{isDate(e){var r,n,a,i;return(i=(a=((n=(r=A.getState().metadataConfiguration)===null||r===void 0?void 0:r.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,r){var n,a,i;if(e==null)return"";try{return gt.format(e,(n=r?.locale)!==null&&n!==void 0?n:A.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1)}catch(s){throw console.error(`Date ${JSON.stringify(e)} is not valid`,s),s}}};window.FluidTopicsDateService=new Za;var Or=class{static get(e,r){var n,a;let i=A.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 jt(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,r??`${s}-${l}`)}};var go=class extends te{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,a])=>Array.isArray(a)?[n,a.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,s)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(s.key):typeof i=="string"&&typeof s=="string"?i.localeCompare(s):String(i).localeCompare(String(s)))]:typeof a=="object"&&a!==null?[n,this.sortEventArrays(a)]:[n,a]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(a=>(console.info(r),console.debug(a),n)),1e3)}};var qa=class{urlToSearchRequest(e){return Or.get().parse(e)}searchRequestToUrl(e){return Or.get().serialize(e)}};window.FluidTopicsUrlService=new qa;var St=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};St.eventName="change";var Ya=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},al=new Ya;var yo=class t extends Pe{static build(){return new t(window.history,al,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,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,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),se(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new St(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,l])=>{let d=r(),f={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[f,s,l]),this.setCurrentState(f,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(St.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(St.eventName,e)}currentItem(){return nt(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 nt(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 nt(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let 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,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let a=r??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=yo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var il=H`
|
|
122
|
+
`;var vf={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Xc=t=>De.get({name:"ft-reader-"+t,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:vf});var Ha=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,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,r,n){return e.flatMap(a=>{var i;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,r,n):[{tocId:a.tocId,title:(i=a.title)!==null&&i!==void 0?i:"",untranslatedTitle:a.untranslatedTitle,depth:r,children:this.extractPagesToc(a.children,r+1,a.tocId)}]})}convertNodes(e,r,n){return e.flatMap(a=>{var i,s,l;if(a.tocId==null)return[...this.convertSectionNodes((i=a.pageToc)!==null&&i!==void 0?i:[],r,a.tocId),...this.convertNodes(a.children,r,a.tocId)];let d=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),f={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:d,depth:r,parentTocId:n,children:[]};this.register(f);let h=this.convertSectionNodes((l=a.pageToc)!==null&&l!==void 0?l:[],r+1,a.tocId),p=this.convertNodes(a.children,r+1,f.tocId);return f.children=[...h,...p],[f]})}convertSectionNodes(e,r,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:r,parentTocId:n,children:[]};return this.register(l),l.children=this.convertSectionNodes(a.children,r+1,a.tocId),[l]})}buildPage(e,r){var n,a,i,s,l,d;let f={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:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},h=(m,y)=>(y?f.topics:f.hiddenTopics).push(m),p=(l=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&l!==void 0?l:[];return f.breadcrumb.forEach((m,y)=>{h(m,p[y])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),f.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),f}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}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,r){return new Ha(e,r).build()}};var xf="ft-app-info",Te=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Te.eventName="authentication-change";var Sf={session:(t,e)=>{se(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>A.dispatchEvent(new Te(e.payload)),0))}},A=De.get({name:xf,reducers:Sf,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 co=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},_x=V(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(A)}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=>gt.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return co([L({type:Boolean})],e.prototype,"useLongDateFormat",void 0),co([L({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),co([q({store:A.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),co([q({store:A.name})],e.prototype,"uiLocale",void 0),e});var xt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=A.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=A.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var lo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):xt.await()}};var te=class extends lo{constructor(e=!0,r){var n;super(r),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 Oe,this.cache=e?a.commonCache:new Oe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var uo=class extends te{async listMySearches(){let{session:e}=A.getState();return Fe(e,W.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var fo=class extends te{async listMyBookmarks(){let e=A.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var po=class extends te{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=A.getState().session;return!!e?.sessionAuthenticated}};var ho=class extends te{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=A.getState().session;return!!e?.sessionAuthenticated}};var Ef="ft-user-assets",Of={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(ge).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;za(t,r,[...Wa(t,r),a]),el(t,r,1,n),tl(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;za(t,r,Wa(t,r).map(a=>a.id===n.id?n:a)),tl(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;za(t,r,Wa(t,r).filter(i=>i.id!==a)),el(t,r,-1,n)}},rl={[ge.SEARCHES]:"savedSearches",[ge.BOOKMARKS]:"bookmarks",[ge.BOOKS]:void 0,[ge.COLLECTIONS]:void 0},Wa=(t,e)=>{var r;let n=rl[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},za=(t,e,r)=>{let n=rl[e];n&&(t[n]=r)},el=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===ge.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},tl=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},de=De.get({name:Ef,reducers:Of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ge).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ja=class{constructor(e=new po,r=new ho){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=A.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new fo,this.savedSearchesService=new uo,A.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=A.getState();se((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),de.actions.clearAssetCount(),de.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),de.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),de.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();de.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();de.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&de.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&de.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(de.getState().assetCounts.bookmarkByMap).length!==0;e===ge.BOOKMARKS&&r&&de.actions.clearBookmarkCountByMap(),de.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;de.actions.bookmarks(r)}}},Ga=new ja;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ga);var Va=class{addCommand(e,r=!1){A.commands.add(e,r)}consumeCommand(e){return A.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Va;var ol,Vt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Cf=Symbol("clearAfterUnitTest"),mo=class extends Ur(te){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ol]=()=>{this.defaultMessages={},this.cache=new Oe,this.listeners={}},this.currentUiLocale=A.getState().uiLocale,A.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=A.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};se(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new gr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(a){!(a instanceof Le)&&r&&console.error(a)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Vt({loadedContexts:e})),this.dispatchEvent(new Vt({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Vt({loadedContexts:[e]})),this.dispatchEvent(new Vt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Fr(0).then(()=>n()).catch(()=>null)))}};ol=Cf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends mo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends mo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var nl=window.FluidTopicsI18nService,hS=window.FluidTopicsCustomI18nService;var Ka=class{highlightHtml(e,r,n){mr(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Ka;var Za=class{isDate(e){var r,n,a,i;return(i=(a=((n=(r=A.getState().metadataConfiguration)===null||r===void 0?void 0:r.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,r){var n,a,i,s;if(e==null)return"";try{return gt.format(e,(n=r?.locale)!==null&&n!==void 0?n:A.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new Za;var Or=class{static get(e,r){var n,a;let i=A.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 jt(i.baseUrl,e??20,i.searchInAllLanguagesAllowed,r??`${s}-${l}`)}};var go=class extends te{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,a])=>Array.isArray(a)?[n,a.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,s)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(s.key):typeof i=="string"&&typeof s=="string"?i.localeCompare(s):String(i).localeCompare(String(s)))]:typeof a=="object"&&a!==null?[n,this.sortEventArrays(a)]:[n,a]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(a=>(console.info(r),console.debug(a),n)),1e3)}};var qa=class{urlToSearchRequest(e){return Or.get().parse(e)}searchRequestToUrl(e){return Or.get().serialize(e)}};window.FluidTopicsUrlService=new qa;var St=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};St.eventName="change";var Ya=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},al=new Ya;var yo=class t extends Pe{static build(){return new t(window.history,al,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,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,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),se(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new St(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,l])=>{let d=r(),f={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(a,[f,s,l]),this.setCurrentState(f,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(St.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(St.eventName,e)}currentItem(){return nt(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 nt(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 nt(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let 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,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let a=r??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=yo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var il=H`
|
|
123
123
|
`;function sl(t,e){let{authenticationRequired:r,session:n}=A.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var K=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},z=class extends J{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=()=>xt.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Oe,this.cleanSessionDebouncer=new ce,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return re`
|
|
124
124
|
<slot></slot>
|
|
125
125
|
`}connectedCallback(){super.connectedCallback(),A.addEventListener(Te.eventName,this.reloadConfiguration)}disconnectedCallback(){A.addEventListener(Te.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,a,i,s,l,d;super.update(e),e.has("baseUrl")&&(A.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&A.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&A.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&A.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&A.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&A.actions.noCustom(this.noCustom),e.has("editorMode")&&A.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&A.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&A.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(f=>nl.addContext(f)),e.has("openExternalDocumentInNewTab")&&A.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&A.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&A.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(A.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),A.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),A.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&A.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&A.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",()=>sl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=il;K([L()],z.prototype,"baseUrl",void 0);K([L()],z.prototype,"apiIntegrationIdentifier",void 0);K([L()],z.prototype,"apiIntegrationAppVersion",void 0);K([L()],z.prototype,"uiLocale",void 0);K([$e(null)],z.prototype,"availableUiLocales",void 0);K([$e(null)],z.prototype,"metadataConfiguration",void 0);K([L({type:Boolean})],z.prototype,"editorMode",void 0);K([L({type:Boolean})],z.prototype,"noCustom",void 0);K([L({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);K([L({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);K([L({type:Boolean})],z.prototype,"withManualResources",void 0);K([L({type:Boolean})],z.prototype,"navigatorOnline",void 0);K([L({type:Boolean})],z.prototype,"forcedOffline",void 0);K([L({type:Object})],z.prototype,"apiProvider",void 0);K([L({type:Boolean})],z.prototype,"authenticationRequired",void 0);K([$e([])],z.prototype,"messageContexts",void 0);K([$e(void 0)],z.prototype,"session",void 0);K([G()],z.prototype,"localesConfiguration",void 0);K([G()],z.prototype,"availableContentLocales",void 0);Ne("ft-app-context")(z);var bo=class extends te{get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,r,n){super(!1,r),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(r=>this.converter.convertPaginatedToc(e,r)))),this.cache.register("ratingSummary",()=>{var e,r;return Fe((r=(e=A.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&r!==void 0?r:[],"RATING_USER")?this.withMapId(a=>this.fetchMapRating(a)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,r){return e+(r?"-destinationLanguage-"+r?.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(r=>this.converter.convertPaginatedToc(this.mapId,r)))}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,r){return(await this.getEnrichedToc(r)).nodeByTocId[e]}getTocNodeNow(e,r){var n;return(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,r){var n,a;let i=this.getMapNow(r);return i?.prettyUrl==e||`${i?.id}/root`===e?(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.toc[0]:(a=this.getEnrichedTocNow(r))===null||a===void 0?void 0:a.nodeByUrl[e]}async getPage(e,r){let n=await this.getEnrichedToc(r);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,r){let n=await this.getEnrichedToc(r);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,r){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,r),()=>this.fetchTranslatedTopicHTMLContent(e,r))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,r){return this.cache.get("document-relatives-"+e+"-"+r.join("-"),()=>this.fetchRelativesForDocument(e,r))}getRelativesForTopicInMap(e,r,n){return this.cache.get("topic-relatives-"+[e,r,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,r,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,r,n){let a=this.getNavigationData(e,r,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,r,n,a){var i,s;e=e||"root";let l=this.getEnrichedTocNow(a),d=l?.pageByTocId[e],f=l?.nodeByTocId[e],h=f?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(i=f?.title)!==null&&i!==void 0?i:"",untranslatedTopicTitle:f?.untranslatedTitle,page:r&&d&&d.number!==r?r:void 0,prettyUrl:h?.replace(/^r\//,""),prettyUrlDuplicated:(s=l?.duplicatedPrettyUrls.has(h??""))!==null&&s!==void 0?s:!1,section:n}}async getAccurateNavigationData(e,r,n,a){return await this.getEnrichedToc(a),this.getNavigationData(e,r,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(r=>{var n;return r?{type:r.topics.type,rating:(n=r.topics)===null||n===void 0?void 0:n.ratings.find(a=>a.tocId===e)}:void 0})}rateMap(e,r){return this.makeRateMapRequest(e,r).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,r){return this.makeMapFeedbackRequest(e,r)}rateTopic(e,r,n){return this.makeRateTopicRequest(e,r,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=A.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,r,n){return this.makeTopicFeedbackRequest(e,r,n)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,r){let n=this.getTocNodeNow(e,r),a=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],i=this.getTocNodeNow(n.parentTocId,r);for(;i;)a.unshift({tocId:i.tocId,title:i.title,untranslatedTitle:i.untranslatedTitle}),i=this.getTocNodeNow(i.parentTocId,r);return a}isFeatureAccessible(e,{session:r}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case Ue.FEEDBACK:return Fe(r??[],W.FEEDBACK_USER);case Ue.RATING:return Fe(r??[],W.RATING_USER);case Ue.PRINT:return Fe(r??[],W.PRINT_USER);case Ue.BOOKMARK:return!!r?.sessionAuthenticated;case Ue.COLLECTIONS:return Fe(r??[],W.COLLECTION_USER);case Ue.PERSONAL_BOOKS:return Fe(r??[],W.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var vo=class t extends bo{static async build(e){return new t(new so,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,r){let n=await this.api.getMap(e,r);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,r){return await this.getMap(r),this.api.getPages(e,this.fingerprint,r)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,r){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,r)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,r){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:r}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,r,n){let a={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:r,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(a)}makeMapFeedbackRequest(e,r){return this.api.sendMapFeedback(this.mapId,e,r)}makeRateMapRequest(e,r){return this.api.rateMap(this.mapId,e,r)}makeRateTopicRequest(e,r,n){return this.api.rateTopic(this.mapId,e,r,n)}makeTopicFeedbackRequest(e,r,n){return this.api.sendTopicFeedback(this.mapId,e,r,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 xo=class t{static build(e,r){return new t(Xc(e.trim()||"context"),r??vo.build)}loaded(){return Qo(()=>this._loaded)}constructor(e,r,n,a){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new ce(10),this.analyticsEventsService=a??new go,this.initService(r)}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 rr(()=>this.service)}async navigateToTopic(e,r,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:r}),this.store.getState().visibleTopics[0]!==s&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,r){var n,a,i;let s=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:r.rootTocId;return r.topics.includes(s)?s:(i=(a=r.topics[0])!==null&&a!==void 0?a:r.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 r,n,a,i,s;try{e&&this.setTranslationLoading(!0);let l=d=>{throw e&&this.setTranslationError(!0),d};await Promise.all([this.loadConfiguration(),(r=this.service)===null||r===void 0?void 0:r.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 Le)&&this.errorHandler(l)}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(r=>this.store.actions.configuration(r))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}fetchRelatives(){var e,r;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?(r=this.service)===null||r===void 0||r.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(vt.clusteringHelperCreated))}createClusteringHelper(){var e,r;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=(r=(e=A.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&r!==void 0?r:[];return new ar(n,a,this.metadataForSwitchToRelatives,i)}}async navigateToRelativeTopicIfFound(e){var r,n,a;await this.loaded();let i=await rr(()=>{var f;return(f=this.store.getState().configuration)===null||f===void 0?void 0:f.relativeTopicPivotMetadata}),s=this.store.getState().mapId,d=await(await this.awaitService()).getRelativesForTopicInMap(s,i,[e]);if(!((a=(n=(r=d?.results)===null||r===void 0?void 0:r[0])===null||n===void 0?void 0:n.entries)===null||a===void 0)&&a[0]){let f=d.results[0].entries[0].topic.tocId;return await this.navigateToTopic(f),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(e){this.store.actions.searchInDocumentQuery(e)}async setTranslationDestinationLanguage(e){this.store.actions.setTranslationDestinationLanguage(e),e&&this.sendDocumentOnDemandTranslateEvent(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 r=this.store.getState();return r.translation.profileId&&r.translation.destinationLanguage?{profileId:r.translation.profileId,destinationLanguage:r.translation.destinationLanguage.code,sourceLanguage:(e=r.map)===null||e===void 0?void 0:e.lang}:void 0}setLinkPreviewDialogId(e){this.store.actions.linkPreviewDialogId(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 r;let n=await((r=this.service)===null||r===void 0?void 0:r.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,r,n){return this.service.getAccurateNavigationData(e,r?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var r;return(r=this.service)===null||r===void 0?void 0:r.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var r,n;let a=this.getTranslationSettings();return a?(r=this.service)===null||r===void 0?void 0:r.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(vt.mapAttachmentsUpdate))}sendDocumentOnDemandTranslateEvent(e){let{editorMode:r,apiIntegrationIdentifier:n,apiIntegrationAppVersion:a}=A.getState(),i=this.store.getState(),s=i.map,l=i.translation.profileId;if(!(r||!s||!n||!a||!l))try{let d=this.analyticsEventsService.convertMapToAnalyticsDocument(s);this.analyticsEventsService.sendDocumentAiTranslateEvent({name:"DOCUMENT__ON_DEMAND_TRANSLATE",offline:!1,appName:n,appVersion:a,sourceLanguage:this.parseLanguageToAnalyticsFormat(s.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e.code),profileId:l,document:d})}catch(d){console.warn("Failed to send on-demand document translate event:",d)}}parseLanguageToAnalyticsFormat(e){if(!e)return;let r=e.split("-");return r.length===2?{languageCode:r[0],countryCode:r[1]}:{languageCode:r[0],countryCode:""}}};var So=class extends CustomEvent{constructor(e,r){super("ft-reader-map-loaded",{detail:{map:e,toc:r}})}},Eo=class extends CustomEvent{constructor(e,r){super("ft-reader-visible-topics-change",{detail:{visibleTopics:r}})}},Oo=class extends CustomEvent{constructor(e){super("ft-reader-navigation-done",{detail:e})}},Co=class extends CustomEvent{constructor(e){super("ft-reader-load-error",{detail:e})}},wo=class extends Event{constructor(){super("ft-reader-map-not-found")}},Ao=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},Ro=class extends Event{constructor(){super("ft-reader-map-forbidden")}},To=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var ie=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Ja=class{constructor(e){this.stateManager=e}searchInDocument(e){this.stateManager.setSearchInDocumentQuery(e??"")}},Z=class extends pt{constructor(){super(),this.visibleTopics=[],this.updateConfiguration=()=>{this.stateManager.reloadConfiguration()},this.scrollToTargetDebouncer=new ce(5),this.navigationDebouncer=new ce(10),this.mapLoadedEventDebouncer=new ce(50),this.addStore(A)}render(){return re`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-topic-title",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"description": "Title of a topic in integrated reader.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-reader-topic-context": "2.0.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "2.0.
|
|
22
|
+
"@fluid-topics/ft-reader-topic-context": "2.0.12",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "2.0.12",
|
|
24
24
|
"@fluid-topics/public-api": "1.0.117",
|
|
25
25
|
"lit": "3.1.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "4811b3ed72672d41022c271d4a0d1db15b458aca"
|
|
28
28
|
}
|