@fluid-topics/ft-search-result-title 2.2.49 → 2.2.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var Qi=Object.create;var nn=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var Xi=Object.getOwnPropertyNames;var Ji=Object.getPrototypeOf,Zi=Object.prototype.hasOwnProperty;var ot=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var eo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Xi(t))!Zi.call(e,s)&&s!==r&&nn(e,s,{get:()=>t[s],enumerable:!(n=Yi(t,s))||n.enumerable});return e};var y=(e,t,r)=>(r=e!=null?Qi(Ji(e)):{},eo(t||!e||!e.__esModule?nn(r,"default",{value:e,enumerable:!0}):r,e));var v=ot((pa,sn)=>{sn.exports=ftGlobals.wcUtils});var ie=ot((ha,on)=>{on.exports=ftGlobals.lit});var q=ot((fa,an)=>{an.exports=ftGlobals.litDecorators});var Pi=ot((Kd,Fi)=>{Fi.exports=ftGlobals.litUnsafeHTML});var Ki=y(v());var it=y(ie()),ji=y(q()),Vi=y(v());var Le=y(v());var ne=y(v()),Ze=y(q());var nr;(function(e){e.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(nr||(nr={}));var re=y(v());var to=y(v());var cn;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(cn||(cn={}));var ln;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(ln||(ln={}));var un;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(un||(un={}));var dn;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(dn||(dn={}));var pn;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(pn||(pn={}));var hn;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(hn||(hn={}));var fn;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(fn||(fn={}));var yn;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(yn||(yn={}));var mn;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(mn||(mn={}));var gn;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(gn||(gn={}));var Sn;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER",e.DOC_DIFF="DOC_DIFF"})(Sn||(Sn={}));var En;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(En||(En={}));var An;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(An||(An={}));var vn;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(vn||(vn={}));var bn;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(bn||(bn={}));var xn;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(xn||(xn={}));var _n;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(_n||(_n={}));var sr;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(sr||(sr={}));var Cn;(function(e){e.ASC="ASC",e.DESC="DESC"})(Cn||(Cn={}));var Tn;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Tn||(Tn={}));var ir;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ir||(ir={}));var wn;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(wn||(wn={}));var at;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(at||(at={}));var Rn;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Rn||(Rn={}));var On;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(On||(On={}));var In;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(In||(In={}));var or;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(or||(or={}));var kn;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(kn||(kn={}));var x;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(x||(x={}));var U;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(U||(U={}));var Dn;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Dn||(Dn={}));var Nn;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Nn||(Nn={}));var Mn;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Mn||(Mn={}));var Ln;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Ln||(Ln={}));var Fn;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Fn||(Fn={}));var Pn;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Pn||(Pn={}));var Un;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Un||(Un={}));var $n;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})($n||($n={}));var Hn;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Hn||(Hn={}));var Bn;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(Bn||(Bn={}));var jn;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(jn||(jn={}));var Vn;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Vn||(Vn={}));var qn;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(qn||(qn={}));var ro={[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 zn(e,t){return e===t||(ro[e]??[]).some(r=>zn(r,t))}function ct(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>zn(n,t))}function Kn(e,...t){return e==null?!1:t.some(r=>ct(e,r))}var wr=y(q());var Wn=y(q(),1);var ar=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},no=e=>({fromAttribute:t=>{if(t==null)return $e(e);try{return JSON.parse(t)}catch{return $e(e)}},toAttribute:t=>JSON.stringify(t)});function Gn(e,t){return(0,Wn.property)({type:Object,converter:no(e),hasChanged:He,...t??{}})}function so(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Re(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!Re(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let s=o=>Object.keys(o).filter(a=>o[a]!=null),i=s(e);if(r=i.length,r!==s(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){let o=i[n];if(!Re(e[o],t[o]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Re(e,t){try{return so(e,t)}catch{return!1}}function He(e,t){return!Re(e,t)}function $e(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function lt(e,t){let r=n=>n[e]===!0;return n=>{if(r(n))return n;let s=t(n);return s[e]=!0,s}}var Qn=y(q(),1);var cr=e=>{let t=e??{};return(r,n)=>{var s;let i={hasChanged:He,attribute:!1,...t};(0,Qn.property)(i)(r,n);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(n,{selector:(s=t.selector)!==null&&s!==void 0?s:(a=>a[n]),store:t.store})}};var ut=class{constructor(){this.queue=[]}add(t,r=!1){r&&this.clear(t.type),this.queue.push(t)}consume(t){let r=this.queue.find(n=>n.type===t);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(t){typeof t=="string"?this.queue=this.queue.filter(r=>r.type!==t):this.queue=this.queue.filter(r=>!t.test(r.type))}};var oe=y(q(),1);var dt=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,r){return this.callbacks=[t],this.debounce(r)}queue(t,r){return this.callbacks.push(t),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,r;let n=[...this.callbacks];this.callbacks=[];let s=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of n)try{await o()}catch(a){s(a);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ht=y(ie(),1);var pt=class extends ht.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let r={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,ht.adoptStyles)(n,t.elementStyles),n}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(t,r){ar(t)(r),this.canDefineScopedElement(t)&&this.registry.define(t,r)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,r){this.scopedRegistryConstructor.defineScopedElement(t,r)}};function Yn(e,t,...r){var n;let s=e.querySelector(t);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Ie=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},es,Xn=Symbol("constructorPrototype"),Jn=Symbol("constructorName"),ts=Symbol("exportpartsDebouncer"),Zn=Symbol("dynamicDependenciesLoaded"),Oe=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Oe.eventName="exportparts-updated";var z=class extends pt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[es]=new dt(5),this.scheduleExportpartsUpdate=()=>{var t,r,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[ts].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Jn]=this.constructor.name,this[Xn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Jn]&&Object.setPrototypeOf(this,this[Xn])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Zn]||(r[Zn]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Oe.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Oe.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Oe)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=Yn(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var r,n,s,i,o,a;let c=f=>f!=null&&f.trim().length>0,l=t.filter(c).map(f=>f.trim());if(l.length===0){this.exportparts=void 0;return}let p=new Set;for(let f of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let g=(o=(n=f.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&o!==void 0?o:[],_=(a=(s=f.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(S=>S.split(":")[1]))!==null&&a!==void 0?a:[],F=[...g,..._].filter(c).map(S=>S.trim());for(let S of F)p.add(S)}if(p.size===0){this.exportparts=void 0;return}let d=[...p.values()].flatMap(f=>l.map(g=>`${f}:${g}--${f}`));this.exportparts=[...this.part,...d].join(", ")}};es=ts;Ie([(0,oe.property)()],z.prototype,"exportpartsPrefix",void 0);Ie([Gn([])],z.prototype,"exportpartsPrefixes",void 0);Ie([(0,oe.property)({reflect:!0})],z.prototype,"exportparts",void 0);Ie([(0,oe.property)()],z.prototype,"customStylesheet",void 0);Ie([(0,oe.property)()],z.prototype,"elementToFocus",void 0);Ie([(0,oe.state)()],z.prototype,"useAdoptedStyleSheets",void 0);function ft(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Be=Symbol("internalReduxEventsUnsubscribers"),ee=Symbol("internalStoresUnsubscribers"),ae=Symbol("internalStores"),io=lt(Symbol("withRedux"),function(e){var t,r,n;class s extends e{constructor(){super(...arguments),this[t]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ae].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[ae].get(o)}addStore(o,a){var c;a=(c=a??o.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(a),this[ae].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[ae].delete(a)}setupStores(){this.unsubscribeFromStores(),this[ae].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let c=this.constructor.getPropertyOptions(a);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:a)){let l=this.getStore(o.store);l&&(o.store?this[ee].has(o.store):this[ee].size>0)&&(this[a]=o.selector(l.getState(),this))}})}subscribeToStore(o,a){var c,l;this[ee].set(o,a.subscribe(()=>this.updateFromStores())),this[Be].set(o,[]),ft(a)&&(!((c=a.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((p,d)=>{this.getStore(p.store)===a&&a.deprecatedKeys.includes(d)&&console.warn("Element",this,"is subscribed to deprecated key",d,"in store",a.name)}),a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((p,d)=>{if(typeof this[d]=="function"&&(!p.store||a.name===p.store)){let f=g=>this[d](g);a.addEventListener(p.eventName,f),this[Be].get(o).push(()=>a.removeEventListener(p.eventName,f))}}))),this.onStoreAvailable(o)}unsubscribeFromStores(){this[ee].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[ee].has(o)&&this[ee].get(o)(),this[ee].delete(o),(a=this[Be].get(o))===null||a===void 0||a.forEach(c=>c()),this[Be].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ee,r=ae,n=Be,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),rs=class extends io(z){};function w(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oo=typeof Symbol=="function"&&Symbol.observable||"@@observable",ns=oo,lr=()=>Math.random().toString(36).substring(7).split("").join("."),ao={INIT:`@@redux/INIT${lr()}`,REPLACE:`@@redux/REPLACE${lr()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${lr()}`},yt=ao;function mt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ur(e,t,r){if(typeof e!="function")throw new Error(w(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(w(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(w(1));return r(ur)(e,t)}let n=e,s=t,i=new Map,o=i,a=0,c=!1;function l(){o===i&&(o=new Map,i.forEach((S,P)=>{o.set(P,S)}))}function p(){if(c)throw new Error(w(3));return s}function d(S){if(typeof S!="function")throw new Error(w(4));if(c)throw new Error(w(5));let P=!0;l();let j=a++;return o.set(j,S),function(){if(P){if(c)throw new Error(w(6));P=!1,l(),o.delete(j),i=null}}}function f(S){if(!mt(S))throw new Error(w(7));if(typeof S.type>"u")throw new Error(w(8));if(typeof S.type!="string")throw new Error(w(17));if(c)throw new Error(w(9));try{c=!0,s=n(s,S)}finally{c=!1}return(i=o).forEach(j=>{j()}),S}function g(S){if(typeof S!="function")throw new Error(w(10));n=S,f({type:yt.REPLACE})}function _(){let S=d;return{subscribe(P){if(typeof P!="object"||P===null)throw new Error(w(11));function j(){let A=P;A.next&&A.next(p())}return j(),{unsubscribe:S(j)}},[ns](){return this}}}return f({type:yt.INIT}),{dispatch:f,subscribe:d,getState:p,replaceReducer:g,[ns]:_}}function co(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:yt.INIT})>"u")throw new Error(w(12));if(typeof r(void 0,{type:yt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(w(13))})}function dr(e){let t=Object.keys(e),r={};for(let o=0;o<t.length;o++){let a=t[o];typeof e[a]=="function"&&(r[a]=e[a])}let n=Object.keys(r),s,i;try{co(r)}catch(o){i=o}return function(a={},c){if(i)throw i;let l=!1,p={};for(let d=0;d<n.length;d++){let f=n[d],g=r[f],_=a[f],F=g(_,c);if(typeof F>"u"){let S=c&&c.type;throw new Error(w(14))}p[f]=F,l=l||F!==_}return l=l||n.length!==Object.keys(a).length,l?p:a}}function je(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ss(...e){return t=>(r,n)=>{let s=t(r,n),i=()=>{throw new Error(w(15))},o={getState:s.getState,dispatch:(c,...l)=>i(c,...l)},a=e.map(c=>c(o));return i=je(...a)(s.dispatch),{...s,dispatch:i}}}function is(e){return mt(e)&&"type"in e&&typeof e.type=="string"}var fs=Symbol.for("immer-nothing"),os=Symbol.for("immer-draftable"),R=Symbol.for("immer-state");function B(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var M=Object,De=M.getPrototypeOf,At="constructor",Tt="prototype",yr="configurable",vt="enumerable",St="writable",Ve="value",K=e=>!!e&&!!e[R];function L(e){return e?ys(e)||Rt(e)||!!e[os]||!!e[At]?.[os]||Ot(e)||We(e):!1}var lo=M[Tt][At].toString(),as=new WeakMap;function ys(e){if(!e||!xr(e))return!1;let t=De(e);if(t===null||t===M[Tt])return!0;let r=M.hasOwnProperty.call(t,At)&&t[At];if(r===Object)return!0;if(!ke(r))return!1;let n=as.get(r);return n===void 0&&(n=Function.toString.call(r),as.set(r,n)),n===lo}function wt(e,t,r=!0){Ke(e)===0?(r?Reflect.ownKeys(e):M.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function Ke(e){let t=e[R];return t?t.type_:Rt(e)?1:Ot(e)?2:We(e)?3:0}var pr=(e,t,r=Ke(e))=>r===2?e.has(t):M[Tt].hasOwnProperty.call(e,t),mr=(e,t,r=Ke(e))=>r===2?e.get(t):e[t],bt=(e,t,r,n=Ke(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function uo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rt=Array.isArray,Ot=e=>e instanceof Map,We=e=>e instanceof Set,xr=e=>typeof e=="object",ke=e=>typeof e=="function",hr=e=>typeof e=="boolean";function po(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Q=e=>e.copy_||e.base_;var _r=e=>e.modified_?e.copy_:e.base_;function gr(e,t){if(Ot(e))return new Map(e);if(We(e))return new Set(e);if(Rt(e))return Array[Tt].slice.call(e);let r=ys(e);if(t===!0||t==="class_only"&&!r){let n=M.getOwnPropertyDescriptors(e);delete n[R];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let o=s[i],a=n[o];a[St]===!1&&(a[St]=!0,a[yr]=!0),(a.get||a.set)&&(n[o]={[yr]:!0,[St]:!0,[vt]:a[vt],[Ve]:e[o]})}return M.create(De(e),n)}else{let n=De(e);if(n!==null&&r)return{...e};let s=M.create(n);return M.assign(s,e)}}function It(e,t=!1){return kt(e)||K(e)||!L(e)||(Ke(e)>1&&M.defineProperties(e,{set:gt,add:gt,clear:gt,delete:gt}),M.freeze(e),t&&wt(e,(r,n)=>{It(n,!0)},!1)),e}function ho(){B(2)}var gt={[Ve]:ho};function kt(e){return e===null||!xr(e)?!0:M.isFrozen(e)}var xt="MapSet",Sr="Patches",cs="ArrayMethods",ms={};function ce(e){let t=ms[e];return t||B(0,e),t}var ls=e=>!!ms[e];var qe,gs=()=>qe,fo=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ls(xt)?ce(xt):void 0,arrayMethodsPlugin_:ls(cs)?ce(cs):void 0});function us(e,t){t&&(e.patchPlugin_=ce(Sr),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Er(e){Ar(e),e.drafts_.forEach(yo),e.drafts_=null}function Ar(e){e===qe&&(qe=e.parent_)}var ds=e=>qe=fo(qe,e);function yo(e){let t=e[R];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ps(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[R].modified_&&(Er(t),B(4)),L(e)&&(e=hs(t,e));let{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[R].base_,e,t)}else e=hs(t,r);return mo(t,e,!0),Er(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fs?e:void 0}function hs(e,t){if(kt(t))return t;let r=t[R];if(!r)return _t(t,e.handledSet_,e);if(!Dt(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);As(r,e)}return r.copy_}function mo(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&It(t,r)}function Ss(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Dt=(e,t)=>e.scope_===t,go=[];function Es(e,t,r,n){let s=Q(e),i=e.type_;if(n!==void 0&&mr(s,n,i)===t){bt(s,n,r,i);return}if(!e.draftLocations_){let a=e.draftLocations_=new Map;wt(s,(c,l)=>{if(K(l)){let p=a.get(l)||[];p.push(c),a.set(l,p)}})}let o=e.draftLocations_.get(t)??go;for(let a of o)bt(s,a,r,i)}function So(e,t,r){e.callbacks_.push(function(s){let i=t;if(!i||!Dt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let o=_r(i);Es(e,i.draft_??i,o,r),As(i,s)})}function As(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let s=n.getPath(e);s&&n.generatePatches_(e,s,t)}Ss(e)}}function Eo(e,t,r){let{scope_:n}=e;if(K(r)){let s=r[R];Dt(s,n)&&s.callbacks_.push(function(){Et(e);let o=_r(s);Es(e,r,o,t)})}else L(r)&&e.callbacks_.push(function(){let i=Q(e);e.type_===3?i.has(r)&&_t(r,n.handledSet_,n):mr(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_t(mr(e.copy_,t,e.type_),n.handledSet_,n)})}function _t(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||K(e)||t.has(e)||!L(e)||kt(e)||(t.add(e),wt(e,(n,s)=>{if(K(s)){let i=s[R];if(Dt(i,r)){let o=_r(i);bt(e,n,o,e.type_),Ss(i)}}else L(s)&&_t(s,t,r)})),e}function Ao(e,t){let r=Rt(e),n={type_:r?1:0,scope_:t?t.scope_:gs(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=Ct;r&&(s=[n],i=ze);let{revoke:o,proxy:a}=Proxy.revocable(s,i);return n.draft_=a,n.revoke_=o,[a,n]}var Ct={get(e,t){if(t===R)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let s=Q(e);if(!pr(s,t,e.type_))return bo(e,s,t);let i=s[t];if(e.finalized_||!L(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&po(t))return i;if(i===fr(e.base_,t)||vo(e,t,i)){Et(e);let o=e.type_===1?+t:t,a=br(e.scope_,i,e,o);return e.copy_[o]=a}return i},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let n=vs(Q(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let s=fr(Q(e),t),i=s?.[R];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.delete(t),!0;if(uo(r,s)&&(r!==void 0||pr(e.base_,t,e.type_)))return!0;Et(e),vr(e)}return e.copy_[t]===r&&(r!==void 0||pr(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Eo(e,t,r)),!0},deleteProperty(e,t){return Et(e),fr(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vr(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[St]:!0,[yr]:e.type_!==1||t!=="length",[vt]:n[vt],[Ve]:r[t]}},defineProperty(){B(11)},getPrototypeOf(e){return De(e.base_)},setPrototypeOf(){B(12)}},ze={};for(let e in Ct){let t=Ct[e];ze[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ze.deleteProperty=function(e,t){return ze.set.call(this,e,t,void 0)};ze.set=function(e,t,r){return Ct.set.call(this,e[0],t,r,e[0])};function fr(e,t){let r=e[R];return(r?Q(r):e)[t]}function vo(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||!L(r)||r[R]?!1:e.baseRefs_.has(r)}function bo(e,t,r){let n=vs(t,r);return n?Ve in n?n[Ve]:n.get?.call(e.draft_):void 0}function vs(e,t){if(!(t in e))return;let r=De(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=De(r)}}function vr(e){e.modified_||(e.modified_=!0,e.parent_&&vr(e.parent_))}function Et(e){e.copy_||(e.assigned_=new Map,e.copy_=gr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xo=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(ke(t)&&!ke(r)){let i=r;r=t;let o=this;return function(c=i,...l){return o.produce(c,p=>r.call(this,p,...l))}}ke(r)||B(6),n!==void 0&&!ke(n)&&B(7);let s;if(L(t)){let i=ds(this),o=br(i,t,void 0),a=!0;try{s=r(o),a=!1}finally{a?Er(i):Ar(i)}return us(i,n),ps(s,i)}else if(!t||!xr(t)){if(s=r(t),s===void 0&&(s=t),s===fs&&(s=void 0),this.autoFreeze_&&It(s,!0),n){let i=[],o=[];ce(Sr).generateReplacementPatches_(t,s,{patches_:i,inversePatches_:o}),n(i,o)}return s}else B(1,t)},this.produceWithPatches=(t,r)=>{if(ke(t))return(o,...a)=>this.produceWithPatches(o,c=>t(c,...a));let n,s;return[this.produce(t,r,(o,a)=>{n=o,s=a}),n,s]},hr(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),hr(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),hr(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){L(e)||B(8),K(e)&&(e=bs(e));let t=ds(this),r=br(t,e,void 0);return r[R].isManual_=!0,Ar(t),r}finishDraft(e,t){let r=e&&e[R];(!r||!r.isManual_)&&B(9);let{scope_:n}=r;return us(n,t),ps(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let n=ce(Sr).applyPatches_;return K(e)?n(e,t):this.produce(e,s=>n(s,t))}};function br(e,t,r,n){let[s,i]=Ot(t)?ce(xt).proxyMap_(t,r):We(t)?ce(xt).proxySet_(t,r):Ao(t,r);return(r?.scope_??gs()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?So(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:l}=c;i.modified_&&l&&l.generatePatches_(i,[],c)}),s}function bs(e){return K(e)||B(10,e),xs(e)}function xs(e){if(!L(e)||kt(e))return e;let t=e[R],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=gr(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=gr(e,!0);let s=r;return We(r)&&(r=new Set),wt(s,(i,o)=>{bt(r,i,xs(o))},n),t&&(t.finalized_=!1),r}var _o=globalThis.Iterator,rc=typeof _o?.from=="function";var Co=new xo,Cr=Co.produce;function _s(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var Cs=_s(),Ts=_s;var To=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?je:je.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Qe(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(W(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>n!=null&&n.type===e&&is(n),r}var Os=class Ge extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ge.prototype)}static get[Symbol.species](){return Ge}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ge(...t[0].concat(this)):new Ge(...t.concat(this))}};function ws(e){return L(e)?Cr(e,()=>{}):e}function Nt(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function wo(e){return typeof e=="boolean"}var Ro=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{},o=new Os;return r&&(wo(r)?o.push(Cs):o.push(Ts(r.extraArgument))),o},Oo="RTK_autoBatch";var Rs=e=>t=>{setTimeout(t,e)},Io=(e,t,r)=>n=>{let s=!1,i,o,a=()=>{s||(s=!0,t?.(i),clearTimeout(o),n())};i=e(a),o=setTimeout(a,r)},ko=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),s=!0,i=!1,o=!1,a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Io(window.requestAnimationFrame,window.cancelAnimationFrame,100):Rs(10):e.type==="callback"?e.queueNotification:Rs(e.timeout),l=()=>{o=!1,i&&(i=!1,a.forEach(p=>p()))};return Object.assign({},n,{subscribe(p){let d=()=>s&&p(),f=n.subscribe(d);return a.add(p),()=>{f(),a.delete(p)}},dispatch(p){try{return s=!p?.meta?.[Oo],i=!s,i&&(o||(o=!0,c(l))),n.dispatch(p)}finally{s=!0}}})},Do=e=>function(r){let{autoBatch:n=!0}=r??{},s=new Os(e);return n&&s.push(ko(typeof n=="object"?n:void 0)),s};function Is(e){let t=Ro(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{},c;if(typeof r=="function")c=r;else if(mt(r))c=dr(r);else throw new Error(W(1));let l;typeof n=="function"?l=n(t):l=t();let p=je;s&&(p=To({trace:!1,...typeof s=="object"&&s}));let d=ss(...l),f=Do(d),g=typeof a=="function"?a(f):f(),_=p(...g);return ur(c,o,_)}function ks(e){let t={},r=[],n,s={addCase(i,o){let a=typeof i=="string"?i:i.type;if(!a)throw new Error(W(28));if(a in t)throw new Error(W(29));return t[a]=o,s},addAsyncThunk(i,o){return o.pending&&(t[i.pending.type]=o.pending),o.rejected&&(t[i.rejected.type]=o.rejected),o.fulfilled&&(t[i.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:i.settled,reducer:o.settled}),s},addMatcher(i,o){return r.push({matcher:i,reducer:o}),s},addDefaultCase(i){return n=i,s}};return e(s),[t,r,n]}function No(e){return typeof e=="function"}function Mo(e,t){let[r,n,s]=ks(t),i;if(No(e))i=()=>ws(e());else{let c=ws(e);i=()=>c}function o(c,l,p){if(K(c)){let d=l(c,p);return d===void 0?c:d}else{if(L(c))return Cr(c,d=>l(d,p));{let d=l(c,p);if(d===void 0){if(c===null)return c;throw new Error(W(9))}return d}}}function a(c=i(),l){let p=r[l.type],d;for(let{matcher:f,reducer:g}of n)f(l)&&g&&(d??=[]).push(g);if(!p&&!d)return s?o(c,s,l):c;if(p&&(c=o(c,p,l)),d)for(let f of d)c=o(c,f,l);return c}return a.getInitialState=i,a}var Lo=Symbol.for("rtk-slice-createasyncthunk");function Fo(e,t){return`${e}/${t}`}function Po({creators:e}={}){let t=e?.asyncThunk?.[Lo];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(W(11));typeof process<"u";let o=(typeof n.reducers=="function"?n.reducers($o()):n.reducers)||{},a=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(E,A){let O=typeof E=="string"?E:E.type;if(!O)throw new Error(W(12));if(O in c.sliceCaseReducersByType)throw new Error(W(13));return c.sliceCaseReducersByType[O]=A,l},addMatcher(E,A){return c.sliceMatchers.push({matcher:E,reducer:A}),l},exposeAction(E,A){return c.actionCreators[E]=A,l},exposeCaseReducer(E,A){return c.sliceCaseReducersByName[E]=A,l}};a.forEach(E=>{let A=o[E],O={reducerName:E,type:Fo(s,E),createNotation:typeof n.reducers=="function"};Bo(A)?Vo(O,A,l,t):Ho(O,A,l)});function p(){let[E={},A=[],O=void 0]=typeof n.extraReducers=="function"?ks(n.extraReducers):[n.extraReducers],Z={...E,...c.sliceCaseReducersByType};return Mo(n.initialState,V=>{for(let I in Z)V.addCase(I,Z[I]);for(let I of c.sliceMatchers)V.addMatcher(I.matcher,I.reducer);for(let I of A)V.addMatcher(I.matcher,I.reducer);O&&V.addDefaultCase(O)})}let d=E=>E,f=new Map,g=new WeakMap,_;function F(E,A){return _||(_=p()),_(E,A)}function S(){return _||(_=p()),_.getInitialState()}function P(E,A=!1){function O(V){let I=V[E];return typeof I>"u"&&A&&(I=Nt(g,O,S)),I}function Z(V=d){return Nt(Nt(f,A,()=>new WeakMap),V,()=>{let I={};for(let[Wi,Gi]of Object.entries(n.selectors??{}))I[Wi]=Uo(Gi,V,()=>Nt(g,V,S),A);return I})}return{reducerPath:E,getSelectors:Z,get selectors(){return Z(O)},selectSlice:O}}let j={name:s,reducer:F,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:S,...P(i),injectInto(E,{reducerPath:A,...O}={}){let Z=A??i;return E.inject({reducerPath:Z,reducer:F},O),{...j,...P(Z,!0)}}};return j}}function Uo(e,t,r,n){function s(i,...o){let a=t(i);return typeof a>"u"&&n&&(a=r()),e(a,...o)}return s.unwrapped=e,s}var Ds=Po();function $o(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Ho({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!jo(n))throw new Error(W(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?Qe(e,o):Qe(e))}function Bo(e){return e._reducerDefinitionType==="asyncThunk"}function jo(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Vo({type:e,reducerName:t},r,n,s){if(!s)throw new Error(W(18));let{payloadCreator:i,fulfilled:o,pending:a,rejected:c,settled:l,options:p}=r,d=s(e,i,p);n.exposeAction(t,d),o&&n.addCase(d.fulfilled,o),a&&n.addCase(d.pending,a),c&&n.addCase(d.rejected,c),l&&n.addMatcher(d.settled,l),n.exposeCaseReducer(t,{fulfilled:o||Mt,pending:a||Mt,rejected:c||Mt,settled:l||Mt})}function Mt(){}var Ns="listener",Ms="completed",Ls="cancelled",uc=`task-${Ls}`,dc=`task-${Ms}`,pc=`${Ns}-${Ls}`,hc=`${Ns}-${Ms}`;var{assign:Fs}=Object;var Tr="listenerMiddleware";var qo=Fs(Qe(`${Tr}/add`),{withTypes:()=>qo}),fc=Qe(`${Tr}/removeAll`),zo=Fs(Qe(`${Tr}/remove`),{withTypes:()=>zo});function W(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ko=lt(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),Lt=class extends Ko(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ps=class e extends Lt{static get(t){var r;let n=typeof t=="string"?t:t.name,s=typeof t=="string"?void 0:t,i=window.ftReduxStores[n];if(ft(i))return i;if(s==null)return;let o=Ds({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),a=Is({reducer:(c,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let p=$e(o.getInitialState());for(let d of l.keeping)p[d]=(c??p)[d];return p}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...l.overwrites};return o.reducer(c,l)}});return window.ftReduxStores[s.name]=new e(o,a,s.eventBus,s.deprecatedKeys)}constructor(t,r,n,s){super(),this.reduxSlice=t,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new ut,this.injectInto=(o,a)=>this.reduxSlice.injectInto(o,a),this.selectSlice=o=>this.reduxSlice.selectSlice(o);let i=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,a,c)=>{let l=a,p=o[l];return p?(...d)=>{let f=p(...d.map(i));return this.reduxStore.dispatch(f),f}:d=>{let f=l,g=this.getState()[f];Re(g,d)||this.setState({[f]:i(d)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Ft=class{static format(t,r,n,s,i){return window.moment?window.moment(t).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(t,r,n,s,!!i)}static getMomentDateFormat(t,r,n){return n?"LT":t?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(t,r,n,s,i){let o=typeof t=="string"?new Date(t):t,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(o),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return i?c:s?`${a} ${c}`:a}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${t(Math.abs(r)/60)}:${t(Math.abs(r)%60)}`}};var Pt=y(v()),Wo="ft-app-info",te=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};te.eventName="authentication-change";var Ye=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Ye.eventName="ui-locale-changed";var Go={session:(e,t)=>{(0,Pt.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>m.dispatchEvent(new te(t.payload)),0))}},m=Pt.FtReduxStore.get({name:Wo,reducers:Go,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Us=y(v()),Ut=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},jc=(0,Us.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(m)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(a=>a.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?a=>Ft.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Ut([(0,wr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Ut([(0,wr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Ut([cr({store:m.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],t.prototype,"metadataDescriptors",void 0),Ut([cr({store:m.name})],t.prototype,"uiLocale",void 0),t});var Vt=y(v());var Rr=y(v());var le=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=m.getState(),s=t??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(t){return new Promise(r=>{let n=e.get(t);if(n)r(n);else{let s=m.subscribe(()=>{n=e.get(t),n&&(s(),r(n))})}})}};var Ne=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:le.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):le.await()}};var N=class extends Ne{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(i,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[c])=>a.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Rr.CacheRegistry,this.cache=t?s.commonCache:new Rr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var $t=class extends N{async listMySearches(){let{session:t}=m.getState();return ct(t,x.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Ht=class extends N{async listMyBookmarks(){let t=m.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Bt=class extends N{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=m.getState().session;return!!t?.sessionAuthenticated}};var jt=class extends N{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=m.getState().session;return!!t?.sessionAuthenticated}};var Qo="ft-user-assets",Yo={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(U).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let r=t.payload.mapId;e.assetCounts.bookmarkByMap[r]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:r,mapId:n,asset:s}=t.payload;Ir(e,r,[...Or(e,r),s]),$s(e,r,1,n),Hs(e,s)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Ir(e,r,Or(e,r).map(s=>s.id===n.id?n:s)),Hs(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:s}=t.payload;Ir(e,r,Or(e,r).filter(i=>i.id!==s)),$s(e,r,-1,n)}},Bs={[U.SEARCHES]:"savedSearches",[U.BOOKMARKS]:"bookmarks",[U.BOOKS]:void 0,[U.COLLECTIONS]:void 0},Or=(e,t)=>{var r;let n=Bs[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Ir=(e,t,r)=>{let n=Bs[t];n&&(e[n]=r)},$s=(e,t,r,n)=>{let s=e.assetCounts.allAsset[t];if(s!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,s+r),t===U.BOOKMARKS&&n)){let i=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Hs=(e,t)=>{let r=e.assetLabels.map(s=>s.title),n=t.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));e.assetLabels.push(...n)},k=Vt.FtReduxStore.get({name:Qo,reducers:Yo,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(U).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),kr=class{constructor(t=new Bt,r=new jt){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=m.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ht,this.savedSearchesService=new $t,m.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=m.getState();(0,Vt.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),k.actions.clearAssetCount(),k.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),k.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),k.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();k.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();k.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&k.getState().assetCounts.allAsset[t]!==r.count&&k.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&k.getState().assetCounts.bookmarkByMap[t]!==r.count&&k.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(k.getState().assetCounts.bookmarkByMap).length!==0;t===U.BOOKMARKS&&r&&k.actions.clearBookmarkCountByMap(),k.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let r=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;k.actions.bookmarks(r)}}},Xo=new kr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Xo);var Dr=class{addCommand(t,r=!1){m.commands.add(t,r)}consumeCommand(t){return m.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Dr;var $=y(v());var js,Me=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Jo=Symbol("clearAfterUnitTest"),qt=class extends(0,$.withEventBus)(N){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[js]=()=>{this.defaultMessages={},this.cache=new $.CacheRegistry,this.listeners={}},this.currentUiLocale=m.getState().uiLocale,m.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=m.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let r=t.name.toLowerCase();this.cache.setFinal(r,t),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var n;if(t=t.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...r};(0,$.deepEqual)(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var r,n;return this.fetchContext(t),(n=(r=this.cache.getNow(t))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,r){let n=t.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(t,r,...n){var s;let i=t.toLowerCase(),o=this.resolveContext(i);return new $.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},o).resolve(r,...n)}async fetchContext(t){let r=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),r&&await this.notify(t)}catch(s){!(s instanceof $.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(t,r){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(r),()=>{var s;return(s=this.listeners[t])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Me({loadedContexts:t})),this.dispatchEvent(new Me({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new Me({loadedContexts:[t]})),this.dispatchEvent(new Me({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,$.delay)(0).then(()=>n()).catch(()=>null)))}};js=Jo;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qt{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qt{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Vs=window.FluidTopicsI18nService,xl=window.FluidTopicsCustomI18nService;var qs=y(v()),Nr=class{highlightHtml(t,r,n){(0,qs.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new Nr;var zs=y(v());var Mr=class{isDate(t){var r,n,s,i;return(i=(n=((s=(r=m.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(a=>a.key===t))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(t,r){var n,s,i,o;if(t==null)return"";try{return zs.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:m.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(t)} is not valid`,a),a}}};window.FluidTopicsDateService=new Mr;var Ks=y(v());var Xe=class{static get(t,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=m.getState()){var o;if(r==="all"&&s?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(a=>a.lang===r)){let a=s?.defaultLocales.defaultContentLocale;r=a?`${a.lang}-${a.region}`:(o=i[0])===null||o===void 0?void 0:o.lang}return new Ks.SearchPlaceConverter(n,t??20,s?.allLanguagesAllowed,r,i)}};var Lr=class{urlToSearchRequest(t){return Xe.get().parse(t)}searchRequestToUrl(t){return Xe.get().serialize(t)}};window.FluidTopicsUrlService=new Lr;var Y=y(v());var ue=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};ue.eventName="before-location-change";var de=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};de.eventName="change";var Fr=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let r=sessionStorage.getItem(this.itemName(t));return r?JSON.parse(r):void 0}set(t,r){sessionStorage.setItem(this.itemName(t),JSON.stringify(r))}},Ws=new Fr;var zt=class e extends Y.WithEventBus{static build(){return new e(window.history,Ws,()=>window.location,!1)}constructor(t,r,n,s){var i,o;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(o=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&o!==void 0?o:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(t,r=!1){let n=r&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Y.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new de(this.currentItem())),0)}installProxies(){let t=r=>(n,s,[i,o,a])=>{let c=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),l=new ue(c);this.dispatchEvent(l);let p=r(),d={...p===this.currentIndex?this.currentState:void 0,...i,index:p,href:l.detail.nextLocation.href};n.apply(s,[d,o,d.href]),this.setCurrentState(d,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let r=this.history.length-1;r>=0;r--)t?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(t){var r;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(r=t?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(t){this.addEventListener(ue.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(ue.eventName,t)}addHistoryChangeListener(t){this.addEventListener(de.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(de.eventName,t)}currentItem(){return(0,Y.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Y.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,Y.deepCopy)(r.find(n=>t(n)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,Y.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var r;let n=(r=this.states[t])===null||r===void 0?void 0:r.majorStateId;if(!n)return t;let s=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var t,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&r!==void 0?r:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,r){var n;if(!this.hasState(t))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=zt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var Gs=y(ie());var Qs=Gs.css`
1
+ "use strict";(()=>{var Qi=Object.create;var nn=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var Xi=Object.getOwnPropertyNames;var Ji=Object.getPrototypeOf,Zi=Object.prototype.hasOwnProperty;var ot=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var eo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Xi(t))!Zi.call(e,s)&&s!==r&&nn(e,s,{get:()=>t[s],enumerable:!(n=Yi(t,s))||n.enumerable});return e};var y=(e,t,r)=>(r=e!=null?Qi(Ji(e)):{},eo(t||!e||!e.__esModule?nn(r,"default",{value:e,enumerable:!0}):r,e));var v=ot((pa,sn)=>{sn.exports=ftGlobals.wcUtils});var ie=ot((ha,on)=>{on.exports=ftGlobals.lit});var q=ot((fa,an)=>{an.exports=ftGlobals.litDecorators});var Pi=ot((Kd,Fi)=>{Fi.exports=ftGlobals.litUnsafeHTML});var Ki=y(v());var it=y(ie()),ji=y(q()),Vi=y(v());var Le=y(v());var ne=y(v()),Ze=y(q());var nr;(function(e){e.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(nr||(nr={}));var re=y(v());var to=y(v());var cn;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(cn||(cn={}));var ln;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(ln||(ln={}));var un;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(un||(un={}));var dn;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(dn||(dn={}));var pn;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(pn||(pn={}));var hn;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(hn||(hn={}));var fn;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(fn||(fn={}));var yn;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(yn||(yn={}));var mn;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(mn||(mn={}));var gn;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(gn||(gn={}));var Sn;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER",e.DOC_DIFF="DOC_DIFF"})(Sn||(Sn={}));var En;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(En||(En={}));var An;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(An||(An={}));var vn;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(vn||(vn={}));var bn;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(bn||(bn={}));var xn;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(xn||(xn={}));var _n;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(_n||(_n={}));var sr;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(sr||(sr={}));var Cn;(function(e){e.ASC="ASC",e.DESC="DESC"})(Cn||(Cn={}));var Tn;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Tn||(Tn={}));var ir;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ir||(ir={}));var wn;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(wn||(wn={}));var at;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(at||(at={}));var Rn;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Rn||(Rn={}));var On;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(On||(On={}));var In;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(In||(In={}));var or;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(or||(or={}));var kn;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(kn||(kn={}));var x;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(x||(x={}));var U;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(U||(U={}));var Dn;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Dn||(Dn={}));var Nn;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Nn||(Nn={}));var Mn;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Mn||(Mn={}));var Ln;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Ln||(Ln={}));var Fn;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Fn||(Fn={}));var Pn;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Pn||(Pn={}));var Un;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Un||(Un={}));var $n;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})($n||($n={}));var Hn;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Hn||(Hn={}));var Bn;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(Bn||(Bn={}));var jn;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(jn||(jn={}));var Vn;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Vn||(Vn={}));var qn;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(qn||(qn={}));var ro={[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 zn(e,t){return e===t||(ro[e]??[]).some(r=>zn(r,t))}function ct(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>zn(n,t))}function Kn(e,...t){return e==null?!1:t.some(r=>ct(e,r))}var wr=y(q());var Wn=y(q(),1);var ar=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},no=e=>({fromAttribute:t=>{if(t==null)return $e(e);try{return JSON.parse(t)}catch{return $e(e)}},toAttribute:t=>JSON.stringify(t)});function Gn(e,t){return(0,Wn.property)({type:Object,converter:no(e),hasChanged:He,...t??{}})}function so(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Re(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!Re(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let s=o=>Object.keys(o).filter(a=>o[a]!=null),i=s(e);if(r=i.length,r!==s(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){let o=i[n];if(!Re(e[o],t[o]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Re(e,t){try{return so(e,t)}catch{return!1}}function He(e,t){return!Re(e,t)}function $e(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function lt(e,t){let r=n=>n[e]===!0;return n=>{if(r(n))return n;let s=t(n);return s[e]=!0,s}}var Qn=y(q(),1);var cr=e=>{let t=e??{};return(r,n)=>{var s;let i={hasChanged:He,attribute:!1,...t};(0,Qn.property)(i)(r,n);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(n,{selector:(s=t.selector)!==null&&s!==void 0?s:(a=>a[n]),store:t.store})}};var ut=class{constructor(){this.queue=[]}add(t,r=!1){r&&this.clear(t.type),this.queue.push(t)}consume(t){let r=this.queue.find(n=>n.type===t);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(t){typeof t=="string"?this.queue=this.queue.filter(r=>r.type!==t):this.queue=this.queue.filter(r=>!t.test(r.type))}};var oe=y(q(),1);var dt=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,r){return this.callbacks=[t],this.debounce(r)}queue(t,r){return this.callbacks.push(t),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,r;let n=[...this.callbacks];this.callbacks=[];let s=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of n)try{await o()}catch(a){s(a);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ht=y(ie(),1);var pt=class extends ht.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let r={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,ht.adoptStyles)(n,t.elementStyles),n}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(t,r){ar(t)(r),this.canDefineScopedElement(t)&&this.registry.define(t,r)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,r){this.scopedRegistryConstructor.defineScopedElement(t,r)}};function Yn(e,t,...r){var n;let s=e.querySelector(t);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Ie=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},es,Xn=Symbol("constructorPrototype"),Jn=Symbol("constructorName"),ts=Symbol("exportpartsDebouncer"),Zn=Symbol("dynamicDependenciesLoaded"),Oe=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Oe.eventName="exportparts-updated";var z=class extends pt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[es]=new dt(5),this.scheduleExportpartsUpdate=()=>{var t,r,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[ts].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Jn]=this.constructor.name,this[Xn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Jn]&&Object.setPrototypeOf(this,this[Xn])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Zn]||(r[Zn]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Oe.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Oe.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Oe)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=Yn(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var r,n,s,i,o,a;let c=f=>f!=null&&f.trim().length>0,l=t.filter(c).map(f=>f.trim());if(l.length===0){this.exportparts=void 0;return}let p=new Set;for(let f of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let g=(o=(n=f.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&o!==void 0?o:[],_=(a=(s=f.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(S=>S.split(":")[1]))!==null&&a!==void 0?a:[],F=[...g,..._].filter(c).map(S=>S.trim());for(let S of F)p.add(S)}if(p.size===0){this.exportparts=void 0;return}let d=[...p.values()].flatMap(f=>l.map(g=>`${f}:${g}--${f}`));this.exportparts=[...this.part,...d].join(", ")}};es=ts;Ie([(0,oe.property)()],z.prototype,"exportpartsPrefix",void 0);Ie([Gn([])],z.prototype,"exportpartsPrefixes",void 0);Ie([(0,oe.property)({reflect:!0})],z.prototype,"exportparts",void 0);Ie([(0,oe.property)()],z.prototype,"customStylesheet",void 0);Ie([(0,oe.property)()],z.prototype,"elementToFocus",void 0);Ie([(0,oe.state)()],z.prototype,"useAdoptedStyleSheets",void 0);function ft(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Be=Symbol("internalReduxEventsUnsubscribers"),ee=Symbol("internalStoresUnsubscribers"),ae=Symbol("internalStores"),io=lt(Symbol("withRedux"),function(e){var t,r,n;class s extends e{constructor(){super(...arguments),this[t]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ae].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[ae].get(o)}addStore(o,a){var c;a=(c=a??o.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(a),this[ae].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[ae].delete(a)}setupStores(){this.unsubscribeFromStores(),this[ae].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let c=this.constructor.getPropertyOptions(a);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:a)){let l=this.getStore(o.store);l&&(o.store?this[ee].has(o.store):this[ee].size>0)&&(this[a]=o.selector(l.getState(),this))}})}subscribeToStore(o,a){var c,l;this[ee].set(o,a.subscribe(()=>this.updateFromStores())),this[Be].set(o,[]),ft(a)&&(!((c=a.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((p,d)=>{this.getStore(p.store)===a&&a.deprecatedKeys.includes(d)&&console.warn("Element",this,"is subscribed to deprecated key",d,"in store",a.name)}),a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((p,d)=>{if(typeof this[d]=="function"&&(!p.store||a.name===p.store)){let f=g=>this[d](g);a.addEventListener(p.eventName,f),this[Be].get(o).push(()=>a.removeEventListener(p.eventName,f))}}))),this.onStoreAvailable(o)}unsubscribeFromStores(){this[ee].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[ee].has(o)&&this[ee].get(o)(),this[ee].delete(o),(a=this[Be].get(o))===null||a===void 0||a.forEach(c=>c()),this[Be].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=ee,r=ae,n=Be,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),rs=class extends io(z){};function w(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oo=typeof Symbol=="function"&&Symbol.observable||"@@observable",ns=oo,lr=()=>Math.random().toString(36).substring(7).split("").join("."),ao={INIT:`@@redux/INIT${lr()}`,REPLACE:`@@redux/REPLACE${lr()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${lr()}`},yt=ao;function mt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ur(e,t,r){if(typeof e!="function")throw new Error(w(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(w(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(w(1));return r(ur)(e,t)}let n=e,s=t,i=new Map,o=i,a=0,c=!1;function l(){o===i&&(o=new Map,i.forEach((S,P)=>{o.set(P,S)}))}function p(){if(c)throw new Error(w(3));return s}function d(S){if(typeof S!="function")throw new Error(w(4));if(c)throw new Error(w(5));let P=!0;l();let j=a++;return o.set(j,S),function(){if(P){if(c)throw new Error(w(6));P=!1,l(),o.delete(j),i=null}}}function f(S){if(!mt(S))throw new Error(w(7));if(typeof S.type>"u")throw new Error(w(8));if(typeof S.type!="string")throw new Error(w(17));if(c)throw new Error(w(9));try{c=!0,s=n(s,S)}finally{c=!1}return(i=o).forEach(j=>{j()}),S}function g(S){if(typeof S!="function")throw new Error(w(10));n=S,f({type:yt.REPLACE})}function _(){let S=d;return{subscribe(P){if(typeof P!="object"||P===null)throw new Error(w(11));function j(){let A=P;A.next&&A.next(p())}return j(),{unsubscribe:S(j)}},[ns](){return this}}}return f({type:yt.INIT}),{dispatch:f,subscribe:d,getState:p,replaceReducer:g,[ns]:_}}function co(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:yt.INIT})>"u")throw new Error(w(12));if(typeof r(void 0,{type:yt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(w(13))})}function dr(e){let t=Object.keys(e),r={};for(let o=0;o<t.length;o++){let a=t[o];typeof e[a]=="function"&&(r[a]=e[a])}let n=Object.keys(r),s,i;try{co(r)}catch(o){i=o}return function(a={},c){if(i)throw i;let l=!1,p={};for(let d=0;d<n.length;d++){let f=n[d],g=r[f],_=a[f],F=g(_,c);if(typeof F>"u"){let S=c&&c.type;throw new Error(w(14))}p[f]=F,l=l||F!==_}return l=l||n.length!==Object.keys(a).length,l?p:a}}function je(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ss(...e){return t=>(r,n)=>{let s=t(r,n),i=()=>{throw new Error(w(15))},o={getState:s.getState,dispatch:(c,...l)=>i(c,...l)},a=e.map(c=>c(o));return i=je(...a)(s.dispatch),{...s,dispatch:i}}}function is(e){return mt(e)&&"type"in e&&typeof e.type=="string"}var fs=Symbol.for("immer-nothing"),os=Symbol.for("immer-draftable"),R=Symbol.for("immer-state");function B(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var M=Object,De=M.getPrototypeOf,At="constructor",Tt="prototype",yr="configurable",vt="enumerable",St="writable",Ve="value",K=e=>!!e&&!!e[R];function L(e){return e?ys(e)||Rt(e)||!!e[os]||!!e[At]?.[os]||Ot(e)||We(e):!1}var lo=M[Tt][At].toString(),as=new WeakMap;function ys(e){if(!e||!xr(e))return!1;let t=De(e);if(t===null||t===M[Tt])return!0;let r=M.hasOwnProperty.call(t,At)&&t[At];if(r===Object)return!0;if(!ke(r))return!1;let n=as.get(r);return n===void 0&&(n=Function.toString.call(r),as.set(r,n)),n===lo}function wt(e,t,r=!0){Ke(e)===0?(r?Reflect.ownKeys(e):M.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function Ke(e){let t=e[R];return t?t.type_:Rt(e)?1:Ot(e)?2:We(e)?3:0}var pr=(e,t,r=Ke(e))=>r===2?e.has(t):M[Tt].hasOwnProperty.call(e,t),mr=(e,t,r=Ke(e))=>r===2?e.get(t):e[t],bt=(e,t,r,n=Ke(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function uo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rt=Array.isArray,Ot=e=>e instanceof Map,We=e=>e instanceof Set,xr=e=>typeof e=="object",ke=e=>typeof e=="function",hr=e=>typeof e=="boolean";function po(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Q=e=>e.copy_||e.base_;var _r=e=>e.modified_?e.copy_:e.base_;function gr(e,t){if(Ot(e))return new Map(e);if(We(e))return new Set(e);if(Rt(e))return Array[Tt].slice.call(e);let r=ys(e);if(t===!0||t==="class_only"&&!r){let n=M.getOwnPropertyDescriptors(e);delete n[R];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let o=s[i],a=n[o];a[St]===!1&&(a[St]=!0,a[yr]=!0),(a.get||a.set)&&(n[o]={[yr]:!0,[St]:!0,[vt]:a[vt],[Ve]:e[o]})}return M.create(De(e),n)}else{let n=De(e);if(n!==null&&r)return{...e};let s=M.create(n);return M.assign(s,e)}}function It(e,t=!1){return kt(e)||K(e)||!L(e)||(Ke(e)>1&&M.defineProperties(e,{set:gt,add:gt,clear:gt,delete:gt}),M.freeze(e),t&&wt(e,(r,n)=>{It(n,!0)},!1)),e}function ho(){B(2)}var gt={[Ve]:ho};function kt(e){return e===null||!xr(e)?!0:M.isFrozen(e)}var xt="MapSet",Sr="Patches",cs="ArrayMethods",ms={};function ce(e){let t=ms[e];return t||B(0,e),t}var ls=e=>!!ms[e];var qe,gs=()=>qe,fo=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ls(xt)?ce(xt):void 0,arrayMethodsPlugin_:ls(cs)?ce(cs):void 0});function us(e,t){t&&(e.patchPlugin_=ce(Sr),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Er(e){Ar(e),e.drafts_.forEach(yo),e.drafts_=null}function Ar(e){e===qe&&(qe=e.parent_)}var ds=e=>qe=fo(qe,e);function yo(e){let t=e[R];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ps(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[R].modified_&&(Er(t),B(4)),L(e)&&(e=hs(t,e));let{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[R].base_,e,t)}else e=hs(t,r);return mo(t,e,!0),Er(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fs?e:void 0}function hs(e,t){if(kt(t))return t;let r=t[R];if(!r)return _t(t,e.handledSet_,e);if(!Dt(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);As(r,e)}return r.copy_}function mo(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&It(t,r)}function Ss(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Dt=(e,t)=>e.scope_===t,go=[];function Es(e,t,r,n){let s=Q(e),i=e.type_;if(n!==void 0&&mr(s,n,i)===t){bt(s,n,r,i);return}if(!e.draftLocations_){let a=e.draftLocations_=new Map;wt(s,(c,l)=>{if(K(l)){let p=a.get(l)||[];p.push(c),a.set(l,p)}})}let o=e.draftLocations_.get(t)??go;for(let a of o)bt(s,a,r,i)}function So(e,t,r){e.callbacks_.push(function(s){let i=t;if(!i||!Dt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let o=_r(i);Es(e,i.draft_??i,o,r),As(i,s)})}function As(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let s=n.getPath(e);s&&n.generatePatches_(e,s,t)}Ss(e)}}function Eo(e,t,r){let{scope_:n}=e;if(K(r)){let s=r[R];Dt(s,n)&&s.callbacks_.push(function(){Et(e);let o=_r(s);Es(e,r,o,t)})}else L(r)&&e.callbacks_.push(function(){let i=Q(e);e.type_===3?i.has(r)&&_t(r,n.handledSet_,n):mr(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_t(mr(e.copy_,t,e.type_),n.handledSet_,n)})}function _t(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||K(e)||t.has(e)||!L(e)||kt(e)||(t.add(e),wt(e,(n,s)=>{if(K(s)){let i=s[R];if(Dt(i,r)){let o=_r(i);bt(e,n,o,e.type_),Ss(i)}}else L(s)&&_t(s,t,r)})),e}function Ao(e,t){let r=Rt(e),n={type_:r?1:0,scope_:t?t.scope_:gs(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=Ct;r&&(s=[n],i=ze);let{revoke:o,proxy:a}=Proxy.revocable(s,i);return n.draft_=a,n.revoke_=o,[a,n]}var Ct={get(e,t){if(t===R)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let s=Q(e);if(!pr(s,t,e.type_))return bo(e,s,t);let i=s[t];if(e.finalized_||!L(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&po(t))return i;if(i===fr(e.base_,t)||vo(e,t,i)){Et(e);let o=e.type_===1?+t:t,a=br(e.scope_,i,e,o);return e.copy_[o]=a}return i},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let n=vs(Q(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let s=fr(Q(e),t),i=s?.[R];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.delete(t),!0;if(uo(r,s)&&(r!==void 0||pr(e.base_,t,e.type_)))return!0;Et(e),vr(e)}return e.copy_[t]===r&&(r!==void 0||pr(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Eo(e,t,r)),!0},deleteProperty(e,t){return Et(e),fr(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vr(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[St]:!0,[yr]:e.type_!==1||t!=="length",[vt]:n[vt],[Ve]:r[t]}},defineProperty(){B(11)},getPrototypeOf(e){return De(e.base_)},setPrototypeOf(){B(12)}},ze={};for(let e in Ct){let t=Ct[e];ze[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ze.deleteProperty=function(e,t){return ze.set.call(this,e,t,void 0)};ze.set=function(e,t,r){return Ct.set.call(this,e[0],t,r,e[0])};function fr(e,t){let r=e[R];return(r?Q(r):e)[t]}function vo(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||!L(r)||r[R]?!1:e.baseRefs_.has(r)}function bo(e,t,r){let n=vs(t,r);return n?Ve in n?n[Ve]:n.get?.call(e.draft_):void 0}function vs(e,t){if(!(t in e))return;let r=De(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=De(r)}}function vr(e){e.modified_||(e.modified_=!0,e.parent_&&vr(e.parent_))}function Et(e){e.copy_||(e.assigned_=new Map,e.copy_=gr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xo=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(ke(t)&&!ke(r)){let i=r;r=t;let o=this;return function(c=i,...l){return o.produce(c,p=>r.call(this,p,...l))}}ke(r)||B(6),n!==void 0&&!ke(n)&&B(7);let s;if(L(t)){let i=ds(this),o=br(i,t,void 0),a=!0;try{s=r(o),a=!1}finally{a?Er(i):Ar(i)}return us(i,n),ps(s,i)}else if(!t||!xr(t)){if(s=r(t),s===void 0&&(s=t),s===fs&&(s=void 0),this.autoFreeze_&&It(s,!0),n){let i=[],o=[];ce(Sr).generateReplacementPatches_(t,s,{patches_:i,inversePatches_:o}),n(i,o)}return s}else B(1,t)},this.produceWithPatches=(t,r)=>{if(ke(t))return(o,...a)=>this.produceWithPatches(o,c=>t(c,...a));let n,s;return[this.produce(t,r,(o,a)=>{n=o,s=a}),n,s]},hr(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),hr(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),hr(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){L(e)||B(8),K(e)&&(e=bs(e));let t=ds(this),r=br(t,e,void 0);return r[R].isManual_=!0,Ar(t),r}finishDraft(e,t){let r=e&&e[R];(!r||!r.isManual_)&&B(9);let{scope_:n}=r;return us(n,t),ps(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let n=ce(Sr).applyPatches_;return K(e)?n(e,t):this.produce(e,s=>n(s,t))}};function br(e,t,r,n){let[s,i]=Ot(t)?ce(xt).proxyMap_(t,r):We(t)?ce(xt).proxySet_(t,r):Ao(t,r);return(r?.scope_??gs()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?So(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:l}=c;i.modified_&&l&&l.generatePatches_(i,[],c)}),s}function bs(e){return K(e)||B(10,e),xs(e)}function xs(e){if(!L(e)||kt(e))return e;let t=e[R],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=gr(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=gr(e,!0);let s=r;return We(r)&&(r=new Set),wt(s,(i,o)=>{bt(r,i,xs(o))},n),t&&(t.finalized_=!1),r}var _o=globalThis.Iterator,rc=typeof _o?.from=="function";var Co=new xo,Cr=Co.produce;function _s(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var Cs=_s(),Ts=_s;var To=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?je:je.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Qe(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(W(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>n!=null&&n.type===e&&is(n),r}var Os=class Ge extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ge.prototype)}static get[Symbol.species](){return Ge}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ge(...t[0].concat(this)):new Ge(...t.concat(this))}};function ws(e){return L(e)?Cr(e,()=>{}):e}function Nt(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function wo(e){return typeof e=="boolean"}var Ro=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{},o=new Os;return r&&(wo(r)?o.push(Cs):o.push(Ts(r.extraArgument))),o},Oo="RTK_autoBatch";var Rs=e=>t=>{setTimeout(t,e)},Io=(e,t,r)=>n=>{let s=!1,i,o,a=()=>{s||(s=!0,t?.(i),clearTimeout(o),n())};i=e(a),o=setTimeout(a,r)},ko=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),s=!0,i=!1,o=!1,a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Io(window.requestAnimationFrame,window.cancelAnimationFrame,100):Rs(10):e.type==="callback"?e.queueNotification:Rs(e.timeout),l=()=>{o=!1,i&&(i=!1,a.forEach(p=>p()))};return Object.assign({},n,{subscribe(p){let d=()=>s&&p(),f=n.subscribe(d);return a.add(p),()=>{f(),a.delete(p)}},dispatch(p){try{return s=!p?.meta?.[Oo],i=!s,i&&(o||(o=!0,c(l))),n.dispatch(p)}finally{s=!0}}})},Do=e=>function(r){let{autoBatch:n=!0}=r??{},s=new Os(e);return n&&s.push(ko(typeof n=="object"?n:void 0)),s};function Is(e){let t=Ro(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{},c;if(typeof r=="function")c=r;else if(mt(r))c=dr(r);else throw new Error(W(1));let l;typeof n=="function"?l=n(t):l=t();let p=je;s&&(p=To({trace:!1,...typeof s=="object"&&s}));let d=ss(...l),f=Do(d),g=typeof a=="function"?a(f):f(),_=p(...g);return ur(c,o,_)}function ks(e){let t={},r=[],n,s={addCase(i,o){let a=typeof i=="string"?i:i.type;if(!a)throw new Error(W(28));if(a in t)throw new Error(W(29));return t[a]=o,s},addAsyncThunk(i,o){return o.pending&&(t[i.pending.type]=o.pending),o.rejected&&(t[i.rejected.type]=o.rejected),o.fulfilled&&(t[i.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:i.settled,reducer:o.settled}),s},addMatcher(i,o){return r.push({matcher:i,reducer:o}),s},addDefaultCase(i){return n=i,s}};return e(s),[t,r,n]}function No(e){return typeof e=="function"}function Mo(e,t){let[r,n,s]=ks(t),i;if(No(e))i=()=>ws(e());else{let c=ws(e);i=()=>c}function o(c,l,p){if(K(c)){let d=l(c,p);return d===void 0?c:d}else{if(L(c))return Cr(c,d=>l(d,p));{let d=l(c,p);if(d===void 0){if(c===null)return c;throw new Error(W(9))}return d}}}function a(c=i(),l){let p=r[l.type],d;for(let{matcher:f,reducer:g}of n)f(l)&&g&&(d??=[]).push(g);if(!p&&!d)return s?o(c,s,l):c;if(p&&(c=o(c,p,l)),d)for(let f of d)c=o(c,f,l);return c}return a.getInitialState=i,a}var Lo=Symbol.for("rtk-slice-createasyncthunk");function Fo(e,t){return`${e}/${t}`}function Po({creators:e}={}){let t=e?.asyncThunk?.[Lo];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(W(11));typeof process<"u";let o=(typeof n.reducers=="function"?n.reducers($o()):n.reducers)||{},a=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(E,A){let O=typeof E=="string"?E:E.type;if(!O)throw new Error(W(12));if(O in c.sliceCaseReducersByType)throw new Error(W(13));return c.sliceCaseReducersByType[O]=A,l},addMatcher(E,A){return c.sliceMatchers.push({matcher:E,reducer:A}),l},exposeAction(E,A){return c.actionCreators[E]=A,l},exposeCaseReducer(E,A){return c.sliceCaseReducersByName[E]=A,l}};a.forEach(E=>{let A=o[E],O={reducerName:E,type:Fo(s,E),createNotation:typeof n.reducers=="function"};Bo(A)?Vo(O,A,l,t):Ho(O,A,l)});function p(){let[E={},A=[],O=void 0]=typeof n.extraReducers=="function"?ks(n.extraReducers):[n.extraReducers],Z={...E,...c.sliceCaseReducersByType};return Mo(n.initialState,V=>{for(let I in Z)V.addCase(I,Z[I]);for(let I of c.sliceMatchers)V.addMatcher(I.matcher,I.reducer);for(let I of A)V.addMatcher(I.matcher,I.reducer);O&&V.addDefaultCase(O)})}let d=E=>E,f=new Map,g=new WeakMap,_;function F(E,A){return _||(_=p()),_(E,A)}function S(){return _||(_=p()),_.getInitialState()}function P(E,A=!1){function O(V){let I=V[E];return typeof I>"u"&&A&&(I=Nt(g,O,S)),I}function Z(V=d){return Nt(Nt(f,A,()=>new WeakMap),V,()=>{let I={};for(let[Wi,Gi]of Object.entries(n.selectors??{}))I[Wi]=Uo(Gi,V,()=>Nt(g,V,S),A);return I})}return{reducerPath:E,getSelectors:Z,get selectors(){return Z(O)},selectSlice:O}}let j={name:s,reducer:F,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:S,...P(i),injectInto(E,{reducerPath:A,...O}={}){let Z=A??i;return E.inject({reducerPath:Z,reducer:F},O),{...j,...P(Z,!0)}}};return j}}function Uo(e,t,r,n){function s(i,...o){let a=t(i);return typeof a>"u"&&n&&(a=r()),e(a,...o)}return s.unwrapped=e,s}var Ds=Po();function $o(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Ho({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!jo(n))throw new Error(W(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?Qe(e,o):Qe(e))}function Bo(e){return e._reducerDefinitionType==="asyncThunk"}function jo(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Vo({type:e,reducerName:t},r,n,s){if(!s)throw new Error(W(18));let{payloadCreator:i,fulfilled:o,pending:a,rejected:c,settled:l,options:p}=r,d=s(e,i,p);n.exposeAction(t,d),o&&n.addCase(d.fulfilled,o),a&&n.addCase(d.pending,a),c&&n.addCase(d.rejected,c),l&&n.addMatcher(d.settled,l),n.exposeCaseReducer(t,{fulfilled:o||Mt,pending:a||Mt,rejected:c||Mt,settled:l||Mt})}function Mt(){}var Ns="listener",Ms="completed",Ls="cancelled",uc=`task-${Ls}`,dc=`task-${Ms}`,pc=`${Ns}-${Ls}`,hc=`${Ns}-${Ms}`;var{assign:Fs}=Object;var Tr="listenerMiddleware";var qo=Fs(Qe(`${Tr}/add`),{withTypes:()=>qo}),fc=Qe(`${Tr}/removeAll`),zo=Fs(Qe(`${Tr}/remove`),{withTypes:()=>zo});function W(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ko=lt(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),Lt=class extends Ko(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ps=class e extends Lt{static get(t){var r;let n=typeof t=="string"?t:t.name,s=typeof t=="string"?void 0:t,i=window.ftReduxStores[n];if(ft(i))return i;if(s==null)return;let o=Ds({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),a=Is({reducer:(c,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let p=$e(o.getInitialState());for(let d of l.keeping)p[d]=(c??p)[d];return p}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...l.overwrites};return o.reducer(c,l)}});return window.ftReduxStores[s.name]=new e(o,a,s.eventBus,s.deprecatedKeys)}constructor(t,r,n,s){super(),this.reduxSlice=t,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new ut,this.injectInto=(o,a)=>this.reduxSlice.injectInto(o,a),this.selectSlice=o=>this.reduxSlice.selectSlice(o);let i=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,a,c)=>{let l=a,p=o[l];return p?(...d)=>{let f=p(...d.map(i));return this.reduxStore.dispatch(f),f}:d=>{let f=l,g=this.getState()[f];Re(g,d)||this.setState({[f]:i(d)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Ft=class{static format(t,r,n,s,i){return window.moment?window.moment(t).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(t,r,n,s,!!i)}static getMomentDateFormat(t,r,n){return n?"LT":t?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(t,r,n,s,i){let o=typeof t=="string"?new Date(t):t,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(o),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return i?c:s?`${a} ${c}`:a}static getTimezoneAsString(){let t=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${t(Math.abs(r)/60)}:${t(Math.abs(r)%60)}`}};var Pt=y(v()),Wo="ft-app-info",te=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};te.eventName="authentication-change";var Ye=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Ye.eventName="ui-locale-changed";var Go={session:(e,t)=>{(0,Pt.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>m.dispatchEvent(new te(t.payload)),0))}},m=Pt.FtReduxStore.get({name:Wo,reducers:Go,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Us=y(v()),Ut=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},jc=(0,Us.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(m)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(a=>a.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?a=>Ft.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Ut([(0,wr.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Ut([(0,wr.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Ut([cr({store:m.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],t.prototype,"metadataDescriptors",void 0),Ut([cr({store:m.name})],t.prototype,"uiLocale",void 0),t});var Vt=y(v());var Rr=y(v());var le=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=m.getState(),s=t??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(t){return new Promise(r=>{let n=e.get(t);if(n)r(n);else{let s=m.subscribe(()=>{n=e.get(t),n&&(s(),r(n))})}})}};var Ne=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:le.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):le.await()}};var N=class extends Ne{constructor(t=!0,r){var n;super(r),this.sortObjectFields=(i,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[c])=>a.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Rr.CacheRegistry,this.cache=t?s.commonCache:new Rr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var $t=class extends N{async listMySearches(){let{session:t}=m.getState();return ct(t,x.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Ht=class extends N{async listMyBookmarks(){let t=m.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Bt=class extends N{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=m.getState().session;return!!t?.sessionAuthenticated}};var jt=class extends N{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let t=m.getState().session;return!!t?.sessionAuthenticated}};var Qo="ft-user-assets",Yo={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(U).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let r=t.payload.mapId;e.assetCounts.bookmarkByMap[r]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:r,mapId:n,asset:s}=t.payload;Ir(e,r,[...Or(e,r),s]),$s(e,r,1,n),Hs(e,s)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;Ir(e,r,Or(e,r).map(s=>s.id===n.id?n:s)),Hs(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:s}=t.payload;Ir(e,r,Or(e,r).filter(i=>i.id!==s)),$s(e,r,-1,n)}},Bs={[U.SEARCHES]:"savedSearches",[U.BOOKMARKS]:"bookmarks",[U.BOOKS]:void 0,[U.COLLECTIONS]:void 0},Or=(e,t)=>{var r;let n=Bs[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},Ir=(e,t,r)=>{let n=Bs[t];n&&(e[n]=r)},$s=(e,t,r,n)=>{let s=e.assetCounts.allAsset[t];if(s!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,s+r),t===U.BOOKMARKS&&n)){let i=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Hs=(e,t)=>{let r=e.assetLabels.map(s=>s.title),n=t.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));e.assetLabels.push(...n)},k=Vt.FtReduxStore.get({name:Qo,reducers:Yo,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(U).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),kr=class{constructor(t=new Bt,r=new jt){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=m.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ht,this.savedSearchesService=new $t,m.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=m.getState();(0,Vt.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),k.actions.clearAssetCount(),k.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),k.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),k.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();k.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();k.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&k.getState().assetCounts.allAsset[t]!==r.count&&k.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&k.getState().assetCounts.bookmarkByMap[t]!==r.count&&k.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(k.getState().assetCounts.bookmarkByMap).length!==0;t===U.BOOKMARKS&&r&&k.actions.clearBookmarkCountByMap(),k.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let r=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;k.actions.bookmarks(r)}}},Xo=new kr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Xo);var Dr=class{addCommand(t,r=!1){m.commands.add(t,r)}consumeCommand(t){return m.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Dr;var $=y(v());var js,Me=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},Jo=Symbol("clearAfterUnitTest"),qt=class extends(0,$.withEventBus)(N){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[js]=()=>{this.defaultMessages={},this.cache=new $.CacheRegistry,this.listeners={}},this.currentUiLocale=m.getState().uiLocale,m.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=m.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let r=t.name.toLowerCase();this.cache.setFinal(r,t),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var n;if(t=t.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...r};(0,$.deepEqual)(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var r,n;return this.fetchContext(t),(n=(r=this.cache.getNow(t))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,r){let n=t.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(t,r,...n){var s;let i=t.toLowerCase(),o=this.resolveContext(i);return new $.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},o).resolve(r,...n)}async fetchContext(t){let r=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),r&&await this.notify(t)}catch(s){!(s instanceof $.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(t,r){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(r),()=>{var s;return(s=this.listeners[t])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Me({loadedContexts:t})),this.dispatchEvent(new Me({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new Me({loadedContexts:[t]})),this.dispatchEvent(new Me({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,$.delay)(0).then(()=>n()).catch(()=>null)))}};js=Jo;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends qt{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends qt{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Vs=window.FluidTopicsI18nService,xl=window.FluidTopicsCustomI18nService;var qs=y(v()),Nr=class{highlightHtml(t,r,n){(0,qs.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new Nr;var zs=y(v());var Mr=class{isDate(t){var r,n,s,i;return(i=(n=((s=(r=m.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(a=>a.key===t))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(t,r){var n,s,i,o;if(t==null)return"";try{return zs.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:m.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(t)} is not valid`,a),a}}};window.FluidTopicsDateService=new Mr;var Ks=y(v());var Xe=class{static get(t,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=m.getState()){var o;if(r==="all"&&s?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(a=>a.lang===r)){let a=s?.defaultLocales.defaultContentLocale;r=a?`${a.lang}-${a.region}`:(o=i[0])===null||o===void 0?void 0:o.lang}return new Ks.SearchPlaceConverter(n,t??20,s?.allLanguagesAllowed,r,i)}};var Lr=class{urlToSearchRequest(t){return Xe.get().parse(t)}searchRequestToUrl(t){return Xe.get().serialize(t)}};window.FluidTopicsUrlService=new Lr;var Y=y(v());var ue=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};ue.eventName="before-location-change";var de=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};de.eventName="change";var Fr=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let r=sessionStorage.getItem(this.itemName(t));return r?JSON.parse(r):void 0}set(t,r){sessionStorage.setItem(this.itemName(t),JSON.stringify(r))}},Ws=new Fr;var zt=class e extends Y.WithEventBus{static build(){return new e(window.history,Ws,()=>window.location,!1)}constructor(t,r,n,s){var i,o;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(o=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&o!==void 0?o:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(t,r=!1){let n=r&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Y.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new de(this.currentItem())),0)}installProxies(){let t=r=>(n,s,[i,o,a])=>{let c=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),l=new ue(c);this.dispatchEvent(l);let p=r(),d={...p===this.currentIndex?this.currentState:void 0,...i,index:p,href:l.detail.nextLocation.href};n.apply(s,[d,o,d.href]),this.setCurrentState(d,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let r=this.history.length-1;r>=0;r--)t?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(t){var r;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(r=t?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(t){this.addEventListener(ue.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(ue.eventName,t)}addHistoryChangeListener(t){this.addEventListener(de.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(de.eventName,t)}currentItem(){return(0,Y.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Y.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,Y.deepCopy)(r.find(n=>t(n)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,Y.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var r;let n=(r=this.states[t])===null||r===void 0?void 0:r.majorStateId;if(!n)return t;let s=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var t,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&r!==void 0?r:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,r){var n;if(!this.hasState(t))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=zt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var Gs=y(ie());var Qs=Gs.css`
2
2
  `;var Xs=y(ie()),D=y(q()),he=y(v());var G=y(v());function Ys(e,t){let{authenticationRequired:r,session:n}=m.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var Kt=class extends Ne{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var Pr=class e extends G.FtStateManager{static build(t){return new e(m,t)}constructor(t,r){super(),this.store=t,this.cache=new G.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Kt,this.knownContexts=new G.AbstractRegistry,this.knownCustomComponents=new G.AbstractRegistry,this.cleanSessionDebouncer=new G.Debouncer,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new G.Debouncer(500),this.apiProvider=r??(()=>le.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}addListeners(){this.store.addEventListener(te.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(te.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let t=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(t)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var t;let r=await this.cache.get("availableContentLocales",()=>Ys(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=r.contentLocales)!==null&&t!==void 0?t:[])}setStickyFilters(t){this.store.actions.stickyFilters(t)}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setTenantId(t){this.store.actions.tenantId(t)}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t,r){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ye(n)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setNoCustomCode(t){this.store.actions.noCustomCode(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}userHasAnyRole(...t){return Kn(m.getState().session,...t)}},Ur=Pr.build();var pe=class extends Event{constructor(t,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var Je=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let r=this.pendingContextRequests.get(t.context);if(r===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let o=s.deref(),a=i.deref();o===void 0||a===void 0||o.dispatchEvent(new pe(t.context,o,a,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let r=t.contextTarget??t.composedPath()[0],n=t.callback,s=this.pendingContextRequests.get(t.context);s===void 0&&this.pendingContextRequests.set(t.context,s={callbacks:new WeakMap,requests:[]});let i=s.callbacks.get(r);i===void 0&&s.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),s.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var T=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},b=class extends he.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Ur,this.contextRoot=new Je}render(){return Xs.html`
3
3
  <slot></slot>
4
4
  `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(t){var r;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Vs.addContext(n)),t.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),t.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),t.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};b.elementDefinitions={};b.styles=Qs;T([(0,D.property)()],b.prototype,"baseUrl",void 0);T([(0,D.property)()],b.prototype,"tenantId",void 0);T([(0,D.property)()],b.prototype,"apiIntegrationIdentifier",void 0);T([(0,D.property)()],b.prototype,"apiIntegrationAppVersion",void 0);T([(0,D.property)()],b.prototype,"uiLocale",void 0);T([(0,he.jsonProperty)(null)],b.prototype,"availableUiLocales",void 0);T([(0,he.jsonProperty)(null)],b.prototype,"metadataConfiguration",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"editorMode",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"noCustom",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"openExternalDocumentInNewTab",void 0);T([(0,D.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],b.prototype,"noCustomComponent",void 0);T([(0,D.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],b.prototype,"noCustomCode",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"withManualResources",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"navigatorOnline",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"forcedOffline",void 0);T([(0,D.property)({type:Boolean})],b.prototype,"authenticationRequired",void 0);T([(0,he.jsonProperty)([])],b.prototype,"messageContexts",void 0);T([(0,he.jsonProperty)(void 0)],b.prototype,"session",void 0);var Zs=y(v());var Js={"ft-app-context":b};(0,Zs.customElements)(Js);var Wt=class extends CustomEvent{constructor(t,r){super("ft-search-result-click",{detail:{result:t,rank:r},bubbles:!0,composed:!0})}},Gt=class extends CustomEvent{constructor(t,r){super("ft-search-result-open-context-menu",{detail:{result:t,rank:r},bubbles:!0,composed:!0})}};var Qt=class e extends Event{constructor(){super(e.eventName)}};Qt.eventName="search-context-clear-all-filters";var $r=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},Br=class extends ne.FtContextRegistrationEvent{constructor(t){super("register-ft-search-component",t)}},ei=Symbol("registerInterval"),Hr=Symbol("registerAttempts"),ta=40,ra=(0,ne.applyMixinOnce)(Symbol("toFtSearchComponent"),function(e){class t extends e{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var s,i,o;super.willUpdate(n),n.has("neededSearchRequests")&&((s=this.stateManager)===null||s===void 0||s.unregisterComponent(this,(o=n.get("neededSearchRequests"))!==null&&o!==void 0?o:[]),(i=this.stateManager)===null||i===void 0||i.registerComponent(this,this.neededSearchRequests))}setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.stateManager.registerComponent(this,this.neededSearchRequests),this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.stateManager.unregisterComponent(this,this.neededSearchRequests),this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Hr]=0,this.tryToRegisterToContext(),this[ei]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Hr]>ta?window.clearInterval(this[ei]):(this[Hr]++,this.dispatchEvent(new Br({target:this,registrationId:this.searchRegistrationId})))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return $r([(0,Ze.state)()],t.prototype,"stateManager",void 0),$r([(0,Ze.state)({hasChanged:ne.hasChanged})],t.prototype,"neededSearchRequests",void 0),$r([(0,Ze.property)()],t.prototype,"searchRegistrationId",void 0),t}),Yt=class extends ra(ne.FtLitElementRedux){};var Jt=y(q()),Xt=function(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i},Vr=class extends Le.FtContextRegistrationEvent{constructor(t){super("register-ft-search-result-component",t)}},jr=Symbol("registerInterval"),na=(0,Le.applyMixinOnce)(Symbol("toFtSearchResultComponent"),function(e){var t;class r extends e{constructor(){super(...arguments),this[t]=0}setResultStateManager(s){this.resultStateManager=s}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[jr]=window.setInterval(()=>this.tryToRegisterToResultContext(),50)}tryToRegisterToResultContext(){this.result!=null?window.clearInterval(this[jr]):this.dispatchEvent(new Vr({target:this}))}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return t=jr,Xt([(0,Jt.property)({attribute:!1})],r.prototype,"cluster",void 0),Xt([(0,Jt.property)({attribute:!1})],r.prototype,"result",void 0),Xt([(0,Le.numberProperty)()],r.prototype,"rank",void 0),Xt([(0,Jt.property)({attribute:!1,type:Boolean})],r.prototype,"openResultInNewTab",void 0),r}),Zt=class extends na(Yt){};var ti=y(ie()),ri=y(v()),sa={highlightBackgroundColor:ri.FtCssVariableFactory.create("--ft-srt-highlight-background-color","","COLOR","transparent")},ni=ti.css`
@@ -81,7 +81,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
81
81
  <li>${this.helperText}</li>
82
82
  `)}
83
83
  </ul>
84
- `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ie.error:this.warningMessages.length?Ie.warning:Ie.default}}return V([E()],e.prototype,"warningRules",void 0),V([E()],e.prototype,"errorRules",void 0),V([E()],e.prototype,"validateOn",void 0),V([E({type:Boolean})],e.prototype,"validateAtRender",void 0),V([E()],e.prototype,"label",void 0),V([E({type:Boolean})],e.prototype,"hideLabel",void 0),V([E()],e.prototype,"name",void 0),V([E({type:Boolean})],e.prototype,"disabled",void 0),V([E()],e.prototype,"helperText",void 0),V([E()],e.prototype,"forceStatus",void 0),V([E({reflect:!0})],e.prototype,"value",void 0),V([j()],e.prototype,"errorMessages",void 0),V([j()],e.prototype,"warningMessages",void 0),V([j()],e.prototype,"status",void 0),V([j()],e.prototype,"focused",void 0),V([j()],e.prototype,"additionalWarningRules",void 0),V([j()],e.prototype,"additionalErrorRules",void 0),V([j()],e.prototype,"externalErrorMessages",void 0),e});var _r=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),_r(n,e);return!0},_o=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},yl=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),lf(e)}};function sf(t){this._$AN!==void 0?(_o(this),this._$AM=t,yl(this)):this._$AM=t}function cf(t,e=!1,o=0){let n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let a=o;a<n.length;a++)_r(n[a],!1),_o(n[a]);else n!=null&&(_r(n,!1),_o(n));else _r(this,t)}var lf=t=>{t.type==pe.CHILD&&(t._$AP??=cf,t._$AQ??=sf)},Wt=class extends ne{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),yl(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(_r(this,e),_o(this))}setValue(e){if(La(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Bi=class extends Wt{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return z}update(e){return this.part=e,this.ensureFocusTrap(e.element),z}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var o,n;this.isElementTrappable(e)&&(((o=this.firstTrap)===null||o===void 0?void 0:o.parentElement)===e&&((n=this.lastTrap)===null||n===void 0?void 0:n.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,o,n,i;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(o=this.lastTrap)===null||o===void 0||o.removeEventListener("focus",this.onLastTrapFocus),(n=this.firstTrap)===null||n===void 0||n.remove(),(i=this.lastTrap)===null||i===void 0||i.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=0;n<o.length;n++){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusFirstDescendant(i)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=o.length-1;n>=0;n--){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusLastDescendant(i)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof oe&&await e.updateComplete}isInsideElement(e,o){return Fe(e).includes(o)}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},fS=ee(Bi);var bl;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(bl||(bl={}));var df={sm:640,md:768,lg:1024,xl:1280},$i=class extends Wt{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,i]){return this.lastArgs=[o,n,i],this.render(o,n,i)}render(e,o,n){let i=this.resolveThreshold(e),a=n??(()=>M);return this.size>i?o():a()}resolveThreshold(e){return typeof e=="number"?e:df[e]}},yS=ee($i);var zi,ct=class{static compareDeepPosition(e,o){if(e===o)return 0;let n=Fe(e).reverse(),i=Fe(o).reverse();if(n[0]!==i[0])return Node.DOCUMENT_POSITION_DISCONNECTED|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|Node.DOCUMENT_POSITION_PRECEDING;let a=0;for(;(n[a]||i[a])&&n[a]===i[a];)a++;return n[a]==null?Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING:i[a]==null?Node.DOCUMENT_POSITION_CONTAINS|Node.DOCUMENT_POSITION_PRECEDING:n[a].compareDocumentPosition(i[a])}static compareDocumentPosition(e,o){let n=zi.compareDeepPosition(e,o);return{equal:n===0,disconnected:(n&Node.DOCUMENT_POSITION_DISCONNECTED)!==0,implementationSpecific:(n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)!==0,preceding:(n&Node.DOCUMENT_POSITION_PRECEDING)!==0,following:(n&Node.DOCUMENT_POSITION_FOLLOWING)!==0,contains:(n&Node.DOCUMENT_POSITION_CONTAINS)!==0,containedBy:(n&Node.DOCUMENT_POSITION_CONTAINED_BY)!==0}}static findFirstInDOM(e){let o=0;for(let n=1;n<e.length;n++)this.domOrderSorter(e[o],e[n])>0&&(o=n);return e[o]}static getDeepActiveElement(){var e;if(!document.activeElement)return null;let o=document.activeElement;for(;!((e=o.shadowRoot)===null||e===void 0)&&e.activeElement;)o=o.shadowRoot.activeElement;return o}};zi=ct;ct.domOrderSorter=(t,e)=>{if(t===e||!t?.isConnected&&!e?.isConnected)return 0;if(!e?.isConnected)return-1;if(!t?.isConnected)return 1;let{preceding:o,following:n,contains:i,containedBy:a}=zi.compareDocumentPosition(t,e);return o||i?1:n||a?-1:0};var Hi=class t{static autoFocus(e){t.allowAutoFocus(e)&&e.focus()}static allowAutoFocus(e){if(Vi)return!1;let o=ct.getDeepActiveElement();if(!o)return!0;let n=ct.compareDocumentPosition(o,e);return n.disconnected||n.implementationSpecific?!1:n.preceding&&!n.contains||n.containedBy}};window.FluidTopicsFocusHelper=Hi;var Wi,Gi,ji,Ki,uf=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((ji=(Gi=(Wi=window.safari)===null||Wi===void 0?void 0:Wi.pushNotification)===null||Gi===void 0?void 0:Gi.toString())!==null&&ji!==void 0?ji:"")==="[object SafariRemoteNotification]",Vi="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ki=window.ftGlobals)!==null&&Ki!==void 0?Ki:{lit:rn,litDecorators:on,litRepeat:nn,litClassMap:an,litStyleMap:sn,litUnsafeHTML:ln,wcUtils:{...dn,...yn,...un,...An,...Ri,...Rn,...pn,...Ln,...gn,...Wn,...Li,...fl,...wi,...Gn,...Tn,...Qn,...Ai,...Zn,...ki,...Ni,...Ic,...fn,...ei,...Di,...kn,...ti,...hl,...Lc,...ri,...vi,...Ii,...jn,...qn,...Sn,...Cn,...Fi,isSafari:uf,isTouchScreen:Vi,setVariable:Lt}};var qi;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(qi||(qi={}));var pf="ft-app-info",ze=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ze.eventName="authentication-change";var Ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ir.eventName="ui-locale-changed";var ff={session:(t,e)=>{q(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>T.dispatchEvent(new ze(e.payload)),0))}},T=$e.get({name:pf,reducers:ff,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Io=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Nv=H(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(T)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>at.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Io([E({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Io([E({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Io([io({store:T.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Io([io({store:T.name})],e.prototype,"uiLocale",void 0),e});var lt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=T.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=T.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Gt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:lt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):lt.await()}};var J=class extends Gt{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[u])=>l.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new he,this.cache=e?i.commonCache:new he}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var To=class extends J{async listMySearches(){let{session:e}=T.getState();return Qr(e,B.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Lo=class extends J{async listMyBookmarks(){let e=T.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var ko=class extends J{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/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(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var No=class extends J{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var hf="ft-user-assets",mf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(ae).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Yi(t,o,[...Zi(t,o),i]),xl(t,o,1,n),Sl(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Yi(t,o,Zi(t,o).map(i=>i.id===n.id?n:i)),Sl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Yi(t,o,Zi(t,o).filter(a=>a.id!==i)),xl(t,o,-1,n)}},vl={[ae.SEARCHES]:"savedSearches",[ae.BOOKMARKS]:"bookmarks",[ae.BOOKS]:void 0,[ae.COLLECTIONS]:void 0},Zi=(t,e)=>{var o;let n=vl[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Yi=(t,e,o)=>{let n=vl[e];n&&(t[n]=o)},xl=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===ae.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Sl=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},Y=$e.get({name:hf,reducers:mf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ae).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Qi=class{constructor(e=new ko,o=new No){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Lo,this.savedSearchesService=new To,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=T.getState();q((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Y.actions.clearAssetCount(),Y.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Y.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Y.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Y.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();Y.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&Y.getState().assetCounts.allAsset[e]!==o.count&&Y.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&Y.getState().assetCounts.bookmarkByMap[e]!==o.count&&Y.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(Y.getState().assetCounts.bookmarkByMap).length!==0;e===ae.BOOKMARKS&&o&&Y.actions.clearBookmarkCountByMap(),Y.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Y.actions.bookmarks(o)}}},gf=new Qi;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gf);var Ji=class{addCommand(e,o=!1){T.commands.add(e,o)}consumeCommand(e){return T.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ji;var El,jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},yf=Symbol("clearAfterUnitTest"),Po=class extends Kr(J){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[El]=()=>{this.defaultMessages={},this.cache=new he,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=T.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};q(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new mr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof Ne)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new jt({loadedContexts:e})),this.dispatchEvent(new jt({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new jt({loadedContexts:[e]})),this.dispatchEvent(new jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>jr(0).then(()=>n()).catch(()=>null)))}};El=yf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Po{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Po{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Cl=window.FluidTopicsI18nService,yE=window.FluidTopicsCustomI18nService;var Xi=class{highlightHtml(e,o,n){Xn(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Xi;var ea=class{isDate(e){var o,n,i,a;return(a=(n=((i=(o=T.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&i!==void 0?i:[]).find(l=>l.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a,s;if(e==null)return"";try{return at.format(e,(n=o?.locale)!==null&&n!==void 0?n:T.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1,(s=o?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new ea;var Tr=class{static get(e,o,{baseUrl:n,localesConfiguration:i,availableContentLocales:a}=T.getState()){var s;if(o==="all"&&i?.allLanguagesAllowed)o=void 0;else if(!o||a.length>0&&!a.some(l=>l.lang===o)){let l=i?.defaultLocales.defaultContentLocale;o=l?`${l.lang}-${l.region}`:(s=a[0])===null||s===void 0?void 0:s.lang}return new we(n,e??20,i?.allLanguagesAllowed,o,a)}};var ta=class{urlToSearchRequest(e){return Tr.get().parse(e)}searchRequestToUrl(e){return Tr.get().serialize(e)}};window.FluidTopicsUrlService=new ta;var dt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};dt.eventName="before-location-change";var ut=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ut.eventName="change";var ra=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},wl=new ra;var Fo=class t extends Ce{static build(){return new t(window.history,wl,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),q(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new ut(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let u=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),p=new dt(u);this.dispatchEvent(p);let h=o(),f={...h===this.currentIndex?this.currentState:void 0,...a,index:h,href:p.detail.nextLocation.href};n.apply(i,[f,s,f.href]),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 o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(dt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(dt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(ut.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ut.eventName,e)}currentItem(){return ie(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 ie(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let o=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return ie(o.find(n=>e(n)))}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 ie(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Ol=N`
84
+ `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ie.error:this.warningMessages.length?Ie.warning:Ie.default}}return V([E()],e.prototype,"warningRules",void 0),V([E()],e.prototype,"errorRules",void 0),V([E()],e.prototype,"validateOn",void 0),V([E({type:Boolean})],e.prototype,"validateAtRender",void 0),V([E()],e.prototype,"label",void 0),V([E({type:Boolean})],e.prototype,"hideLabel",void 0),V([E()],e.prototype,"name",void 0),V([E({type:Boolean})],e.prototype,"disabled",void 0),V([E()],e.prototype,"helperText",void 0),V([E()],e.prototype,"forceStatus",void 0),V([E({reflect:!0})],e.prototype,"value",void 0),V([j()],e.prototype,"errorMessages",void 0),V([j()],e.prototype,"warningMessages",void 0),V([j()],e.prototype,"status",void 0),V([j()],e.prototype,"focused",void 0),V([j()],e.prototype,"additionalWarningRules",void 0),V([j()],e.prototype,"additionalErrorRules",void 0),V([j()],e.prototype,"externalErrorMessages",void 0),e});var _r=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),_r(n,e);return!0},_o=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},yl=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),lf(e)}};function sf(t){this._$AN!==void 0?(_o(this),this._$AM=t,yl(this)):this._$AM=t}function cf(t,e=!1,o=0){let n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let a=o;a<n.length;a++)_r(n[a],!1),_o(n[a]);else n!=null&&(_r(n,!1),_o(n));else _r(this,t)}var lf=t=>{t.type==pe.CHILD&&(t._$AP??=cf,t._$AQ??=sf)},Wt=class extends ne{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),yl(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(_r(this,e),_o(this))}setValue(e){if(La(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Bi=class extends Wt{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return z}update(e){return this.part=e,this.ensureFocusTrap(e.element),z}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var o,n;this.isElementTrappable(e)&&(((o=this.firstTrap)===null||o===void 0?void 0:o.parentElement)===e&&((n=this.lastTrap)===null||n===void 0?void 0:n.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,o,n,i;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(o=this.lastTrap)===null||o===void 0||o.removeEventListener("focus",this.onLastTrapFocus),(n=this.firstTrap)===null||n===void 0||n.remove(),(i=this.lastTrap)===null||i===void 0||i.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=0;n<o.length;n++){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusFirstDescendant(i)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=o.length-1;n>=0;n--){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusLastDescendant(i)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof oe&&await e.updateComplete}isInsideElement(e,o){return Fe(e).includes(o)}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},fS=ee(Bi);var bl;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(bl||(bl={}));var df={sm:640,md:768,lg:1024,xl:1280},$i=class extends Wt{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,i]){return this.lastArgs=[o,n,i],this.render(o,n,i)}render(e,o,n){let i=this.resolveThreshold(e),a=n??(()=>M);return this.size>i?o():a()}resolveThreshold(e){return typeof e=="number"?e:df[e]}},yS=ee($i);var zi,ct=class{static compareDeepPosition(e,o){if(e===o)return 0;let n=Fe(e).reverse(),i=Fe(o).reverse();if(n[0]!==i[0])return Node.DOCUMENT_POSITION_DISCONNECTED|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|Node.DOCUMENT_POSITION_PRECEDING;let a=0;for(;(n[a]||i[a])&&n[a]===i[a];)a++;return n[a]==null?Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING:i[a]==null?Node.DOCUMENT_POSITION_CONTAINS|Node.DOCUMENT_POSITION_PRECEDING:n[a].compareDocumentPosition(i[a])}static compareDocumentPosition(e,o){let n=zi.compareDeepPosition(e,o);return{equal:n===0,disconnected:(n&Node.DOCUMENT_POSITION_DISCONNECTED)!==0,implementationSpecific:(n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)!==0,preceding:(n&Node.DOCUMENT_POSITION_PRECEDING)!==0,following:(n&Node.DOCUMENT_POSITION_FOLLOWING)!==0,contains:(n&Node.DOCUMENT_POSITION_CONTAINS)!==0,containedBy:(n&Node.DOCUMENT_POSITION_CONTAINED_BY)!==0}}static findFirstInDOM(e){let o=0;for(let n=1;n<e.length;n++)this.domOrderSorter(e[o],e[n])>0&&(o=n);return e[o]}static getDeepActiveElement(){var e;if(!document.activeElement)return null;let o=document.activeElement;for(;!((e=o.shadowRoot)===null||e===void 0)&&e.activeElement;)o=o.shadowRoot.activeElement;return o}};zi=ct;ct.domOrderSorter=(t,e)=>{if(t===e||!t?.isConnected&&!e?.isConnected)return 0;if(!e?.isConnected)return-1;if(!t?.isConnected)return 1;let{preceding:o,following:n,contains:i,containedBy:a}=zi.compareDocumentPosition(t,e);return o||i?1:n||a?-1:0};var Hi=class t{static autoFocus(e){t.allowAutoFocus(e)&&e.focus()}static allowAutoFocus(e){if(Vi)return!1;let o=ct.getDeepActiveElement();if(!o)return!0;let n=ct.compareDocumentPosition(o,e);return n.disconnected||n.implementationSpecific?!1:n.preceding&&!n.contains||n.containedBy}};window.FluidTopicsFocusHelper=Hi;var Wi,Gi,ji,Ki,uf=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((ji=(Gi=(Wi=window.safari)===null||Wi===void 0?void 0:Wi.pushNotification)===null||Gi===void 0?void 0:Gi.toString())!==null&&ji!==void 0?ji:"")==="[object SafariRemoteNotification]",Vi="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ki=window.ftGlobals)!==null&&Ki!==void 0?Ki:{lit:rn,litDecorators:on,litRepeat:nn,litClassMap:an,litStyleMap:sn,litUnsafeHTML:ln,wcUtils:{...dn,...yn,...un,...An,...Ri,...Rn,...pn,...Ln,...gn,...Wn,...Li,...fl,...wi,...Gn,...Tn,...Qn,...Ai,...Zn,...ki,...Ni,...Ic,...fn,...ei,...Di,...kn,...ti,...hl,...Lc,...ri,...vi,...Ii,...jn,...qn,...Sn,...Cn,...Fi,isSafari:uf,isTouchScreen:Vi,setVariable:Lt}};var qi;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(qi||(qi={}));var pf="ft-app-info",ze=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ze.eventName="authentication-change";var Ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ir.eventName="ui-locale-changed";var ff={session:(t,e)=>{q(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>T.dispatchEvent(new ze(e.payload)),0))}},T=$e.get({name:pf,reducers:ff,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Io=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Nv=H(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(T)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>at.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Io([E({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Io([E({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Io([io({store:T.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Io([io({store:T.name})],e.prototype,"uiLocale",void 0),e});var lt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=T.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=T.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Gt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:lt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):lt.await()}};var J=class extends Gt{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[u])=>l.localeCompare(u)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new he,this.cache=e?i.commonCache:new he}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var To=class extends J{async listMySearches(){let{session:e}=T.getState();return Qr(e,B.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Lo=class extends J{async listMyBookmarks(){let e=T.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var ko=class extends J{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/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(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var No=class extends J{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var hf="ft-user-assets",mf={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(ae).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Yi(t,o,[...Zi(t,o),i]),xl(t,o,1,n),Sl(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Yi(t,o,Zi(t,o).map(i=>i.id===n.id?n:i)),Sl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Yi(t,o,Zi(t,o).filter(a=>a.id!==i)),xl(t,o,-1,n)}},vl={[ae.SEARCHES]:"savedSearches",[ae.BOOKMARKS]:"bookmarks",[ae.BOOKS]:void 0,[ae.COLLECTIONS]:void 0},Zi=(t,e)=>{var o;let n=vl[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Yi=(t,e,o)=>{let n=vl[e];n&&(t[n]=o)},xl=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===ae.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Sl=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},Y=$e.get({name:hf,reducers:mf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ae).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Qi=class{constructor(e=new ko,o=new No){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Lo,this.savedSearchesService=new To,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=T.getState();q((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Y.actions.clearAssetCount(),Y.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Y.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Y.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Y.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();Y.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&Y.getState().assetCounts.allAsset[e]!==o.count&&Y.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&Y.getState().assetCounts.bookmarkByMap[e]!==o.count&&Y.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(Y.getState().assetCounts.bookmarkByMap).length!==0;e===ae.BOOKMARKS&&o&&Y.actions.clearBookmarkCountByMap(),Y.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Y.actions.bookmarks(o)}}},gf=new Qi;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=gf);var Ji=class{addCommand(e,o=!1){T.commands.add(e,o)}consumeCommand(e){return T.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ji;var El,jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},yf=Symbol("clearAfterUnitTest"),Po=class extends Kr(J){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[El]=()=>{this.defaultMessages={},this.cache=new he,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=T.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};q(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new mr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof Ne)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new jt({loadedContexts:e})),this.dispatchEvent(new jt({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new jt({loadedContexts:[e]})),this.dispatchEvent(new jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>jr(0).then(()=>n()).catch(()=>null)))}};El=yf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Po{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Po{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Cl=window.FluidTopicsI18nService,yE=window.FluidTopicsCustomI18nService;var Xi=class{highlightHtml(e,o,n){Xn(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Xi;var ea=class{isDate(e){var o,n,i,a;return(a=(n=((i=(o=T.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&i!==void 0?i:[]).find(l=>l.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a,s;if(e==null)return"";try{return at.format(e,(n=o?.locale)!==null&&n!==void 0?n:T.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1,(s=o?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new ea;var Tr=class{static get(e,o,{baseUrl:n,localesConfiguration:i,availableContentLocales:a}=T.getState()){var s;if(o==="all"&&i?.allLanguagesAllowed)o=void 0;else if(!o||a.length>0&&!a.some(l=>l.lang===o)){let l=i?.defaultLocales.defaultContentLocale;o=l?`${l.lang}-${l.region}`:(s=a[0])===null||s===void 0?void 0:s.lang}return new we(n,e??20,i?.allLanguagesAllowed,o,a)}};var ta=class{urlToSearchRequest(e){return Tr.get().parse(e)}searchRequestToUrl(e){return Tr.get().serialize(e)}};window.FluidTopicsUrlService=new ta;var dt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};dt.eventName="before-location-change";var ut=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ut.eventName="change";var ra=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},wl=new ra;var Fo=class t extends Ce{static build(){return new t(window.history,wl,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),q(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new ut(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let u=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),p=new dt(u);this.dispatchEvent(p);let h=o(),f={...h===this.currentIndex?this.currentState:void 0,...a,index:h,href:p.detail.nextLocation.href};n.apply(i,[f,s,f.href]),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 o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(dt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(dt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(ut.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ut.eventName,e)}currentItem(){return ie(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 ie(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let o=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return ie(o.find(n=>e(n)))}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 ie(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Ol=N`
85
85
  `;function Al(t,e){let{authenticationRequired:o,session:n}=T.getState();return o&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Mo=class extends Gt{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var oa=class t extends Ht{static build(e){return new t(T,e)}constructor(e,o){super(),this.store=e,this.cache=new he,this.withManualResources=!0,this.userLocaleService=new Mo,this.knownContexts=new It,this.knownCustomComponents=new It,this.cleanSessionDebouncer=new Oe,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new Oe(500),this.apiProvider=o??(()=>lt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(ze.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(ze.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let o=await this.apiProvider().getCurrentSession();return o.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},o.idleTimeoutInMillis),o});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let o=await this.cache.get("availableContentLocales",()=>Al(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=o.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,o){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:o}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ir(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Is(T.getState().session,...e)}},na=oa.build();var pt=class extends Event{constructor(e,o,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=o,this.callback=n,this.subscribe=i??!1}};var Lr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let o=this.pendingContextRequests.get(e.context);if(o===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=o;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),l=a.deref();s===void 0||l===void 0||s.dispatchEvent(new pt(e.context,s,l,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let o=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(o);a===void 0&&i.callbacks.set(o,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(o),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var W=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},D=class extends nt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=na,this.contextRoot=new Lr}render(){return X`
86
86
  <slot></slot>
87
87
  `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var o;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Cl.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((o=this.stateManager)===null||o===void 0||o.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};D.elementDefinitions={};D.styles=Ol;W([E()],D.prototype,"baseUrl",void 0);W([E()],D.prototype,"tenantId",void 0);W([E()],D.prototype,"apiIntegrationIdentifier",void 0);W([E()],D.prototype,"apiIntegrationAppVersion",void 0);W([E()],D.prototype,"uiLocale",void 0);W([Ee(null)],D.prototype,"availableUiLocales",void 0);W([Ee(null)],D.prototype,"metadataConfiguration",void 0);W([E({type:Boolean})],D.prototype,"editorMode",void 0);W([E({type:Boolean})],D.prototype,"noCustom",void 0);W([E({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);W([E({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomComponent",void 0);W([E({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomCode",void 0);W([E({type:Boolean})],D.prototype,"withManualResources",void 0);W([E({type:Boolean})],D.prototype,"navigatorOnline",void 0);W([E({type:Boolean})],D.prototype,"forcedOffline",void 0);W([E({type:Boolean})],D.prototype,"authenticationRequired",void 0);W([Ee([])],D.prototype,"messageContexts",void 0);W([Ee(void 0)],D.prototype,"session",void 0);var Rl={"ft-app-context":D};Ke(Rl);var Do=class extends CustomEvent{constructor(e,o){super("ft-search-result-click",{detail:{result:e,rank:o},bubbles:!0,composed:!0})}},Uo=class extends CustomEvent{constructor(e,o){super("ft-search-result-open-context-menu",{detail:{result:e,rank:o},bubbles:!0,composed:!0})}};var Bo=class t extends Event{constructor(){super(t.eventName)}};Bo.eventName="search-context-clear-all-filters";var ia=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},sa=class extends qe{constructor(e){super("register-ft-search-component",e)}},_l=Symbol("registerInterval"),aa=Symbol("registerAttempts"),Sf=40,vf=H(Symbol("toFtSearchComponent"),function(t){class e extends t{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var i,a,s;super.willUpdate(n),n.has("neededSearchRequests")&&((i=this.stateManager)===null||i===void 0||i.unregisterComponent(this,(s=n.get("neededSearchRequests"))!==null&&s!==void 0?s:[]),(a=this.stateManager)===null||a===void 0||a.registerComponent(this,this.neededSearchRequests))}setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.stateManager.registerComponent(this,this.neededSearchRequests),this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.stateManager.unregisterComponent(this,this.neededSearchRequests),this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[aa]=0,this.tryToRegisterToContext(),this[_l]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[aa]>Sf?window.clearInterval(this[_l]):(this[aa]++,this.dispatchEvent(new sa({target:this,registrationId:this.searchRegistrationId})))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return ia([j()],e.prototype,"stateManager",void 0),ia([j({hasChanged:fe})],e.prototype,"neededSearchRequests",void 0),ia([E()],e.prototype,"searchRegistrationId",void 0),e}),$o=class extends vf(nt){};var zo=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},la=class extends qe{constructor(e){super("register-ft-search-result-component",e)}},ca=Symbol("registerInterval"),Ef=H(Symbol("toFtSearchResultComponent"),function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setResultStateManager(i){this.resultStateManager=i}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[ca]=window.setInterval(()=>this.tryToRegisterToResultContext(),50)}tryToRegisterToResultContext(){this.result!=null?window.clearInterval(this[ca]):this.dispatchEvent(new la({target:this}))}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return e=ca,zo([E({attribute:!1})],o.prototype,"cluster",void 0),zo([E({attribute:!1})],o.prototype,"result",void 0),zo([Gr()],o.prototype,"rank",void 0),zo([E({attribute:!1,type:Boolean})],o.prototype,"openResultInNewTab",void 0),o}),Ho=class extends Ef($o){};var Cf={highlightBackgroundColor:r.create("--ft-srt-highlight-background-color","","COLOR","transparent")},Il=N`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-result-title",
3
- "version": "2.2.49",
3
+ "version": "2.2.50",
4
4
  "description": "Search result title for integrated search component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,14 +19,14 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-search-context": "2.2.49",
23
- "@fluid-topics/ft-search-result-context": "2.2.49",
24
- "@fluid-topics/ft-typography": "2.2.49",
25
- "@fluid-topics/ft-wc-utils": "2.2.49",
22
+ "@fluid-topics/ft-search-context": "2.2.50",
23
+ "@fluid-topics/ft-search-result-context": "2.2.50",
24
+ "@fluid-topics/ft-typography": "2.2.50",
25
+ "@fluid-topics/ft-wc-utils": "2.2.50",
26
26
  "lit": "3.3.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@fluid-topics/public-api": "1.0.150"
29
+ "@fluid-topics/public-api": "1.0.151"
30
30
  },
31
- "gitHead": "be8b2f2af5f9182a10af365d0105c5391a142cf2"
31
+ "gitHead": "827b5f0b91f05b76d24e8c231411908394c47b4e"
32
32
  }