@fluid-topics/ft-search-context 2.1.23 → 2.2.0

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,11 +1,11 @@
1
- "use strict";(()=>{var ms=Object.create;var pr=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var ys=Object.getOwnPropertyNames;var gs=Object.getPrototypeOf,Ss=Object.prototype.hasOwnProperty;var Ot=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var Es=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ys(e))!Ss.call(t,s)&&s!==r&&pr(t,s,{get:()=>e[s],enumerable:!(n=vs(e,s))||n.enumerable});return t};var E=(t,e,r)=>(r=t!=null?ms(gs(t)):{},Es(e||!t||!t.__esModule?pr(r,"default",{value:t,enumerable:!0}):r,t));var w=Ot((Ci,fr)=>{fr.exports=ftGlobals.wcUtils});var me=Ot((xi,mr)=>{mr.exports=ftGlobals.lit});var J=Ot((Oi,vr)=>{vr.exports=ftGlobals.litDecorators});var fs=E(w());var hs=E(me()),G=E(J()),L=E(w());var yr=E(me());var gr=yr.css`
2
- `;var we=E(w()),cr=E(J());var ke;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(ke||(ke={}));var R=E(w());var Sr=E(w()),bs={setRequest:(t,e)=>{t.request=e.payload}},Er=t=>Sr.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],sortId:void 0,paging:{page:1,perPage:20},keywordMatch:void 0},liveQuery:"",recentQueries:[],paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,announcements:void 0,suggestResults:void 0,configuration:void 0},reducers:bs});var br;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(br||(br={}));var Ar;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Ar||(Ar={}));var Cr;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Cr||(Cr={}));var X;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(X||(X={}));var xr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(xr||(xr={}));var Or;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Or||(Or={}));var Tr;(function(t){t.OFFICIAL="OFFICIAL",t.AI="AI"})(Tr||(Tr={}));var se;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(se||(se={}));var wr;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(wr||(wr={}));var Rr;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(Rr||(Rr={}));var _r;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(_r||(_r={}));var Ir;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Ir||(Ir={}));var kr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(kr||(kr={}));var Mr;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Mr||(Mr={}));var Dr;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Dr||(Dr={}));var Lr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Lr||(Lr={}));var Ke;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Ke||(Ke={}));var Pr;(function(t){t.ASC="ASC",t.DESC="DESC"})(Pr||(Pr={}));var Nr;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Nr||(Nr={}));var ve;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(ve||(ve={}));var Ur;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Ur||(Ur={}));var Fr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Fr||(Fr={}));var jr;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(jr||(jr={}));var qr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(qr||(qr={}));var H;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(H||(H={}));var ye;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(ye||(ye={}));var Br;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Br||(Br={}));var T;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(T||(T={}));var U;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(U||(U={}));var Hr;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Hr||(Hr={}));var Vr;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Vr||(Vr={}));var Kr;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Kr||(Kr={}));var Gr;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Gr||(Gr={}));var $r;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})($r||($r={}));var zr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(zr||(zr={}));var Wr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Wr||(Wr={}));var Qr;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Qr||(Qr={}));var Yr;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(Yr||(Yr={}));var Jr;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Jr||(Jr={}));var Xr;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(Xr||(Xr={}));var Zr;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Zr||(Zr={}));var As={[T.PERSONAL_BOOK_SHARE_USER]:[T.PERSONAL_BOOK_USER],[T.HTML_EXPORT_USER]:[T.PERSONAL_BOOK_USER],[T.PDF_EXPORT_USER]:[T.PERSONAL_BOOK_USER],[T.KHUB_ADMIN]:[T.CONTENT_PUBLISHER],[T.ADMIN]:[T.KHUB_ADMIN,T.USERS_ADMIN,T.PORTAL_ADMIN,T.BEHAVIOR_DATA_USER],[T.GENERATIVE_AI_EXPORT_USER]:[T.GENERATIVE_AI_USER]};function en(t,e){return t===e||(As[t]??[]).some(r=>en(r,e))}function Ge(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>en(n,e))}var Jt=E(J());var tn=E(J(),1);var Tt=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function rn(t,e){return(0,tn.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Me(t);try{return JSON.parse(r)}catch{return Me(t)}},toAttribute:r=>JSON.stringify(r)},hasChanged:De,...e??{}})}function Cs(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!$e(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!$e(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let s=a=>Object.keys(a).filter(o=>a[o]!=null),i=s(t);if(r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!$e(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function $e(t,e){try{return Cs(t,e)}catch{return!1}}function De(t,e){return!$e(t,e)}function Me(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function ze(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var nn=E(J(),1);var wt=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:De,attribute:!1,...e};(0,nn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var We=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var ie=E(J(),1);var Qe=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);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 an=E(me(),1);var Ye=globalThis,xs=Ye.ShadowRoot&&(Ye.ShadyCSS===void 0||Ye.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var sn=(t,e)=>{if(xs)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),s=Ye.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=r.cssText,t.appendChild(n)}};var Je=class extends an.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return sn(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){Tt(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function on(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Se=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},dn,un=Symbol("constructorPrototype"),cn=Symbol("constructorName"),hn=Symbol("exportpartsDebouncer"),ln=Symbol("dynamicDependenciesLoaded"),ge=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};ge.eventName="exportparts-updated";var V=class extends Je{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[dn]=new Qe(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[hn].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[cn]=this.constructor.name,this[un]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[cn]&&Object.setPrototypeOf(this,this[un])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[ln]||(r[ln]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(ge.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(ge.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new ge)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=on(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){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(e.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(e){var r,n,s,i,a,o;let c=d=>d!=null&&d.trim().length>0,u=e.filter(c).map(d=>d.trim());if(u.length===0){this.exportparts=void 0;return}let l=new Set;for(let d of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let m=(i=(s=d.getAttribute("part"))===null||s===void 0?void 0:s.split(" "))!==null&&i!==void 0?i:[],p=(o=(a=d.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(y=>y.split(":")[1]))!==null&&o!==void 0?o:[],f=[...m,...p].filter(c).map(y=>y.trim());for(let y of f)l.add(y)}if(l.size===0){this.exportparts=void 0;return}let h=[...l.values()].flatMap(d=>u.map(m=>`${d}:${m}--${d}`));this.exportparts=[...this.part,...h].join(", ")}};dn=hn;Se([(0,ie.property)()],V.prototype,"exportpartsPrefix",void 0);Se([rn([])],V.prototype,"exportpartsPrefixes",void 0);Se([(0,ie.property)({reflect:!0})],V.prototype,"exportparts",void 0);Se([(0,ie.property)()],V.prototype,"customStylesheet",void 0);Se([(0,ie.property)()],V.prototype,"elementToFocus",void 0);Se([(0,ie.state)()],V.prototype,"useAdoptedStyleSheets",void 0);function Xe(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Le=Symbol("internalReduxEventsUnsubscribers"),Z=Symbol("internalStoresUnsubscribers"),ae=Symbol("internalStores"),Os=ze(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ae].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ae].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ae].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ae].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ae].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ae].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let u=this.getStore(a.store);u&&(a.store?this[Z].has(a.store):this[Z].size>0)&&(this[o]=a.selector(u.getState(),this))}})}subscribeToStore(a,o){var c;this[Z].set(a,o.subscribe(()=>this.updateFromStores())),this[Le].set(a,[]),Xe(o)&&o.eventBus&&((c=this.reduxConstructor.reduxEventListeners)===null||c===void 0||c.forEach((u,l)=>{if(typeof this[l]=="function"&&(!u.store||o.name===u.store)){let h=d=>this[l](d);o.addEventListener(u.eventName,h),this[Le].get(a).push(()=>o.removeEventListener(u.eventName,h))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[Z].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[Z].has(a)&&this[Z].get(a)(),this[Z].delete(a),(o=this[Le].get(a))===null||o===void 0||o.forEach(c=>c()),this[Le].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Z,r=ae,n=Le,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),pn=class extends Os(V){};function F(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var s,i;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(a){return"'"+a+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function z(t){return!!t&&!!t[C]}function B(t){var e;return!!t&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var s=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===Ds})(t)||Array.isArray(t)||!!t[En]||!!(!((e=t.constructor)===null||e===void 0)&&e[En])||Nt(t)||Ut(t))}function oe(t,e,r){r===void 0&&(r=!1),Ae(t)===0?(r?Object.keys:be)(t).forEach((function(n){r&&typeof n=="symbol"||e(n,t[n],t)})):t.forEach((function(n,s){return e(s,n,t)}))}function Ae(t){var e=t[C];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Nt(t)?2:Ut(t)?3:0}function Ee(t,e){return Ae(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Ts(t,e){return Ae(t)===2?t.get(e):t[e]}function bn(t,e,r){var n=Ae(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function An(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Nt(t){return ks&&t instanceof Map}function Ut(t){return Ms&&t instanceof Set}function ee(t){return t.o||t.t}function Ft(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=On(t);delete e[C];for(var r=be(e),n=0;n<r.length;n++){var s=r[n],i=e[s];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[s]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[s]})}return Object.create(Object.getPrototypeOf(t),e)}function jt(t,e){return e===void 0&&(e=!1),qt(t)||z(t)||!B(t)||(Ae(t)>1&&(t.set=t.add=t.clear=t.delete=ws),Object.freeze(t),e&&oe(t,(function(r,n){return jt(n,!0)}),!0)),t}function ws(){F(2)}function qt(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function K(t){var e=Pt[t];return e||F(18,t),e}function Rs(t,e){Pt[t]||(Pt[t]=e)}function Mt(){return Ne}function Rt(t,e){e&&(K("Patches"),t.u=[],t.s=[],t.v=e)}function Ze(t){Dt(t),t.p.forEach(_s),t.p=null}function Dt(t){t===Ne&&(Ne=t.l)}function fn(t){return Ne={p:[],l:Ne,h:t,m:!0,_:0}}function _s(t){var e=t[C];e.i===0||e.i===1?e.j():e.g=!0}function _t(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||K("ES5").S(e,t,n),n?(r[C].P&&(Ze(e),F(4)),B(t)&&(t=et(e,t),e.l||tt(e,t)),e.u&&K("Patches").M(r[C].t,t,e.u,e.s)):t=et(e,r,[]),Ze(e),e.u&&e.v(e.u,e.s),t!==xn?t:void 0}function et(t,e,r){if(qt(e))return e;var n=e[C];if(!n)return oe(e,(function(o,c){return mn(t,n,e,o,c,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return tt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var s=n.i===4||n.i===5?n.o=Ft(n.k):n.o,i=s,a=!1;n.i===3&&(i=new Set(s),s.clear(),a=!0),oe(i,(function(o,c){return mn(t,n,s,o,c,r,a)})),tt(t,s,!1),r&&t.u&&K("Patches").N(n,r,t.u,t.s)}return n.o}function mn(t,e,r,n,s,i,a){if(z(s)){var o=et(t,s,i&&e&&e.i!==3&&!Ee(e.R,n)?i.concat(n):void 0);if(bn(r,n,o),!z(o))return;t.m=!1}else a&&r.add(s);if(B(s)&&!qt(s)){if(!t.h.D&&t._<1)return;et(t,s),e&&e.A.l||tt(t,s)}}function tt(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&jt(e,r)}function It(t,e){var r=t[C];return(r?ee(r):t)[e]}function vn(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function te(t){t.P||(t.P=!0,t.l&&te(t.l))}function kt(t){t.o||(t.o=Ft(t.t))}function Lt(t,e,r){var n=Nt(e)?K("MapSet").F(e,r):Ut(e)?K("MapSet").T(e,r):t.O?(function(s,i){var a=Array.isArray(s),o={i:a?1:0,A:i?i.A:Mt(),P:!1,I:!1,R:{},l:i,t:s,k:null,o:null,j:null,C:!1},c=o,u=Ue;a&&(c=[o],u=Pe);var l=Proxy.revocable(c,u),h=l.revoke,d=l.proxy;return o.k=d,o.j=h,d})(e,r):K("ES5").J(e,r);return(r?r.A:Mt()).p.push(n),n}function Is(t){return z(t)||F(22,t),(function e(r){if(!B(r))return r;var n,s=r[C],i=Ae(r);if(s){if(!s.P&&(s.i<4||!K("ES5").K(s)))return s.t;s.I=!0,n=yn(r,i),s.I=!1}else n=yn(r,i);return oe(n,(function(a,o){s&&Ts(s.t,a)===o||bn(n,a,e(o))})),i===3?new Set(n):n})(t)}function yn(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ft(t)}function Cn(){function t(a,o){var c=i[a];return c?c.enumerable=o:i[a]=c={configurable:!0,enumerable:o,get:function(){var u=this[C];return Ue.get(u,a)},set:function(u){var l=this[C];Ue.set(l,a,u)}},c}function e(a){for(var o=a.length-1;o>=0;o--){var c=a[o][C];if(!c.P)switch(c.i){case 5:n(c)&&te(c);break;case 4:r(c)&&te(c)}}}function r(a){for(var o=a.t,c=a.k,u=be(c),l=u.length-1;l>=0;l--){var h=u[l];if(h!==C){var d=o[h];if(d===void 0&&!Ee(o,h))return!0;var m=c[h],p=m&&m[C];if(p?p.t!==d:!An(m,d))return!0}}var f=!!o[C];return u.length!==be(o).length+(f?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var c=Object.getOwnPropertyDescriptor(o,o.length-1);if(c&&!c.get)return!0;for(var u=0;u<o.length;u++)if(!o.hasOwnProperty(u))return!0;return!1}function s(a){a.g&&F(3,JSON.stringify(ee(a)))}var i={};Rs("ES5",{J:function(a,o){var c=Array.isArray(a),u=(function(h,d){if(h){for(var m=Array(d.length),p=0;p<d.length;p++)Object.defineProperty(m,""+p,t(p,!0));return m}var f=On(d);delete f[C];for(var y=be(f),g=0;g<y.length;g++){var S=y[g];f[S]=t(S,h||!!f[S].enumerable)}return Object.create(Object.getPrototypeOf(d),f)})(c,a),l={i:c?5:4,A:o?o.A:Mt(),P:!1,I:!1,R:{},l:o,t:a,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,C,{value:l,writable:!0}),u},S:function(a,o,c){c?z(o)&&o[C].A===a&&e(a.p):(a.u&&(function u(l){if(l&&typeof l=="object"){var h=l[C];if(h){var d=h.t,m=h.k,p=h.R,f=h.i;if(f===4)oe(m,(function(b){b!==C&&(d[b]!==void 0||Ee(d,b)?p[b]||u(m[b]):(p[b]=!0,te(h)))})),oe(d,(function(b){m[b]!==void 0||Ee(m,b)||(p[b]=!1,te(h))}));else if(f===5){if(n(h)&&(te(h),p.length=!0),m.length<d.length)for(var y=m.length;y<d.length;y++)p[y]=!1;else for(var g=d.length;g<m.length;g++)p[g]=!0;for(var S=Math.min(m.length,d.length),x=0;x<S;x++)m.hasOwnProperty(x)||(p[x]=!0),p[x]===void 0&&u(m[x])}}}})(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var gn,Ne,Bt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ks=typeof Map<"u",Ms=typeof Set<"u",Sn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",xn=Bt?Symbol.for("immer-nothing"):((gn={})["immer-nothing"]=!0,gn),En=Bt?Symbol.for("immer-draftable"):"__$immer_draftable",C=Bt?Symbol.for("immer-state"):"__$immer_state";var Ds=""+Object.prototype.constructor,be=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,On=Object.getOwnPropertyDescriptors||function(t){var e={};return be(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},Pt={},Ue={get:function(t,e){if(e===C)return t;var r=ee(t);if(!Ee(r,e))return(function(s,i,a){var o,c=vn(i,a);return c?"value"in c?c.value:(o=c.get)===null||o===void 0?void 0:o.call(s.k):void 0})(t,r,e);var n=r[e];return t.I||!B(n)?n:n===It(t.t,e)?(kt(t),t.o[e]=Lt(t.A.h,n,t)):n},has:function(t,e){return e in ee(t)},ownKeys:function(t){return Reflect.ownKeys(ee(t))},set:function(t,e,r){var n=vn(ee(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var s=It(ee(t),e),i=s?.[C];if(i&&i.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(An(r,s)&&(r!==void 0||Ee(t.t,e)))return!0;kt(t),te(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return It(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,kt(t),te(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ee(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){F(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){F(12)}},Pe={};oe(Ue,(function(t,e){Pe[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Pe.deleteProperty=function(t,e){return Pe.set.call(this,t,e,void 0)},Pe.set=function(t,e,r){return Ue.set.call(this,t[0],e,r,t[0])};var Ls=(function(){function t(r){var n=this;this.O=Sn,this.D=!0,this.produce=function(s,i,a){if(typeof s=="function"&&typeof i!="function"){var o=i;i=s;var c=n;return function(f){var y=this;f===void 0&&(f=o);for(var g=arguments.length,S=Array(g>1?g-1:0),x=1;x<g;x++)S[x-1]=arguments[x];return c.produce(f,(function(b){var Y;return(Y=i).call.apply(Y,[y,b].concat(S))}))}}var u;if(typeof i!="function"&&F(6),a!==void 0&&typeof a!="function"&&F(7),B(s)){var l=fn(n),h=Lt(n,s,void 0),d=!0;try{u=i(h),d=!1}finally{d?Ze(l):Dt(l)}return typeof Promise<"u"&&u instanceof Promise?u.then((function(f){return Rt(l,a),_t(f,l)}),(function(f){throw Ze(l),f})):(Rt(l,a),_t(u,l))}if(!s||typeof s!="object"){if((u=i(s))===void 0&&(u=s),u===xn&&(u=void 0),n.D&&jt(u,!0),a){var m=[],p=[];K("Patches").M(s,u,m,p),a(m,p)}return u}F(21,s)},this.produceWithPatches=function(s,i){if(typeof s=="function")return function(u){for(var l=arguments.length,h=Array(l>1?l-1:0),d=1;d<l;d++)h[d-1]=arguments[d];return n.produceWithPatches(u,(function(m){return s.apply(void 0,[m].concat(h))}))};var a,o,c=n.produce(s,i,(function(u,l){a=u,o=l}));return typeof Promise<"u"&&c instanceof Promise?c.then((function(u){return[u,a,o]})):[c,a,o]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){B(r)||F(8),z(r)&&(r=Is(r));var n=fn(this),s=Lt(this,r,void 0);return s[C].C=!0,Dt(n),s},e.finishDraft=function(r,n){var s=r&&r[C],i=s.A;return Rt(i,n),_t(void 0,i)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Sn&&F(20),this.O=r},e.applyPatches=function(r,n){var s;for(s=n.length-1;s>=0;s--){var i=n[s];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}s>-1&&(n=n.slice(s+1));var a=K("Patches").$;return z(r)?a(r,n):this.produce(r,(function(o){return a(o,n)}))},t})(),N=new Ls,Ps=N.produce,ma=N.produceWithPatches.bind(N),va=N.setAutoFreeze.bind(N),ya=N.setUseProxies.bind(N),ga=N.applyPatches.bind(N),Sa=N.createDraft.bind(N),Ea=N.finishDraft.bind(N),rt=Ps;function ue(t){"@babel/helpers - typeof";return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(t)}function Tn(t,e){if(ue(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ue(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wn(t){var e=Tn(t,"string");return ue(e)=="symbol"?e:e+""}function Rn(t,e,r){return(e=wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(r),!0).forEach(function(n){Rn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function k(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var In=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Vt=function(){return Math.random().toString(36).substring(7).split("").join(".")},nt={INIT:"@@redux/INIT"+Vt(),REPLACE:"@@redux/REPLACE"+Vt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Vt()}};function Ns(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Kt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(k(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(k(1));return r(Kt)(t,e)}if(typeof t!="function")throw new Error(k(2));var s=t,i=e,a=[],o=a,c=!1;function u(){o===a&&(o=a.slice())}function l(){if(c)throw new Error(k(3));return i}function h(f){if(typeof f!="function")throw new Error(k(4));if(c)throw new Error(k(5));var y=!0;return u(),o.push(f),function(){if(y){if(c)throw new Error(k(6));y=!1,u();var S=o.indexOf(f);o.splice(S,1),a=null}}}function d(f){if(!Ns(f))throw new Error(k(7));if(typeof f.type>"u")throw new Error(k(8));if(c)throw new Error(k(9));try{c=!0,i=s(i,f)}finally{c=!1}for(var y=a=o,g=0;g<y.length;g++){var S=y[g];S()}return f}function m(f){if(typeof f!="function")throw new Error(k(10));s=f,d({type:nt.REPLACE})}function p(){var f,y=h;return f={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(k(11));function x(){S.next&&S.next(l())}x();var b=y(x);return{unsubscribe:b}}},f[In]=function(){return this},f}return d({type:nt.INIT}),n={dispatch:d,subscribe:h,getState:l,replaceReducer:m},n[In]=p,n}function Us(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:nt.INIT});if(typeof n>"u")throw new Error(k(12));if(typeof r(void 0,{type:nt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(k(13))})}function kn(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var s=e[n];typeof t[s]=="function"&&(r[s]=t[s])}var i=Object.keys(r),a,o;try{Us(r)}catch(c){o=c}return function(u,l){if(u===void 0&&(u={}),o)throw o;if(0)var h;for(var d=!1,m={},p=0;p<i.length;p++){var f=i[p],y=r[f],g=u[f],S=y(g,l);if(typeof S>"u"){var x=l&&l.type;throw new Error(k(14))}m[f]=S,d=d||S!==g}return d=d||i.length!==Object.keys(u).length,d?m:u}}function Ce(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,s){return function(){return n(s.apply(void 0,arguments))}})}function Mn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var s=n.apply(void 0,arguments),i=function(){throw new Error(k(15))},a={getState:s.getState,dispatch:function(){return i.apply(void 0,arguments)}},o=e.map(function(c){return c(a)});return i=Ce.apply(void 0,o)(s.dispatch),Ht(Ht({},s),{},{dispatch:i})}}}function Dn(t){var e=function(n){var s=n.dispatch,i=n.getState;return function(a){return function(o){return typeof o=="function"?o(s,i,t):a(o)}}};return e}var Ln=Dn();Ln.withExtraArgument=Dn;var Gt=Ln;var jn=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Fs=function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},xe=function(t,e){for(var r=0,n=e.length,s=t.length;r<n;r++,s++)t[s]=e[r];return t},js=Object.defineProperty,qs=Object.defineProperties,Bs=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,Hs=Object.prototype.hasOwnProperty,Vs=Object.prototype.propertyIsEnumerable,Nn=function(t,e,r){return e in t?js(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},re=function(t,e){for(var r in e||(e={}))Hs.call(e,r)&&Nn(t,r,e[r]);if(Pn)for(var n=0,s=Pn(e);n<s.length;n++){var r=s[n];Vs.call(e,r)&&Nn(t,r,e[r])}return t},$t=function(t,e){return qs(t,Bs(e))},Ks=function(t,e,r){return new Promise(function(n,s){var i=function(c){try{o(r.next(c))}catch(u){s(u)}},a=function(c){try{o(r.throw(c))}catch(u){s(u)}},o=function(c){return c.done?n(c.value):Promise.resolve(c.value).then(i,a)};o((r=r.apply(t,e)).next())})};var Gs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ce:Ce.apply(null,arguments)},Fa=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function $s(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}function ne(t,e){function r(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return re(re({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}var zs=(function(t){jn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var s=t.apply(this,r)||this;return Object.setPrototypeOf(s,e.prototype),s}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,xe([void 0],r[0].concat(this)))):new(e.bind.apply(e,xe([void 0],r.concat(this))))},e})(Array),Ws=(function(t){jn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var s=t.apply(this,r)||this;return Object.setPrototypeOf(s,e.prototype),s}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,xe([void 0],r[0].concat(this)))):new(e.bind.apply(e,xe([void 0],r.concat(this))))},e})(Array);function Qt(t){return B(t)?rt(t,function(){}):t}function Qs(t){return typeof t=="boolean"}function Ys(){return function(e){return Js(e)}}function Js(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,s=n===void 0?!0:n,i=t.serializableCheck,a=i===void 0?!0:i,o=t.actionCreatorCheck,c=o===void 0?!0:o,u=new zs;if(r&&(Qs(r)?u.push(Gt):u.push(Gt.withExtraArgument(r.extraArgument))),0){if(s)var l;if(a)var h;if(c)var d}return u}var zt=!0;function qn(t){var e=Ys(),r=t||{},n=r.reducer,s=n===void 0?void 0:n,i=r.middleware,a=i===void 0?e():i,o=r.devTools,c=o===void 0?!0:o,u=r.preloadedState,l=u===void 0?void 0:u,h=r.enhancers,d=h===void 0?void 0:h,m;if(typeof s=="function")m=s;else if($s(s))m=kn(s);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var p=a;if(typeof p=="function"&&(p=p(e),!zt&&!Array.isArray(p)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!zt&&p.some(function(b){return typeof b!="function"}))throw new Error("each middleware provided to configureStore must be a function");var f=Mn.apply(void 0,p),y=Ce;c&&(y=Gs(re({trace:!zt},typeof c=="object"&&c)));var g=new Ws(f),S=g;Array.isArray(d)?S=xe([f],d):typeof d=="function"&&(S=d(g));var x=y.apply(void 0,S);return Kt(m,l,x)}function Bn(t){var e={},r=[],n,s={addCase:function(i,a){var o=typeof i=="string"?i:i.type;if(!o)throw new Error("`builder.addCase` cannot be called with an empty action type");if(o in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[o]=a,s},addMatcher:function(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase:function(i){return n=i,s}};return t(s),[e,r,n]}function Xs(t){return typeof t=="function"}function Zs(t,e,r,n){r===void 0&&(r=[]);var s=typeof e=="function"?Bn(e):[e,r,n],i=s[0],a=s[1],o=s[2],c;if(Xs(t))c=function(){return Qt(t())};else{var u=Qt(t);c=function(){return u}}function l(h,d){h===void 0&&(h=c());var m=xe([i[d.type]],a.filter(function(p){var f=p.matcher;return f(d)}).map(function(p){var f=p.reducer;return f}));return m.filter(function(p){return!!p}).length===0&&(m=[o]),m.reduce(function(p,f){if(f)if(z(p)){var y=p,g=f(y,d);return g===void 0?p:g}else{if(B(p))return rt(p,function(S){return f(S,d)});var g=f(p,d);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return p},h)}return l.getInitialState=c,l}function ei(t,e){return t+"/"+e}function Hn(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:Qt(t.initialState),n=t.reducers||{},s=Object.keys(n),i={},a={},o={};s.forEach(function(l){var h=n[l],d=ei(e,l),m,p;"reducer"in h?(m=h.reducer,p=h.prepare):m=h,i[l]=m,a[d]=m,o[l]=p?ne(d,p):ne(d)});function c(){var l=typeof t.extraReducers=="function"?Bn(t.extraReducers):[t.extraReducers],h=l[0],d=h===void 0?{}:h,m=l[1],p=m===void 0?[]:m,f=l[2],y=f===void 0?void 0:f,g=re(re({},d),a);return Zs(r,function(S){for(var x in g)S.addCase(x,g[x]);for(var b=0,Y=p;b<Y.length;b++){var $=Y[b];S.addMatcher($.matcher,$.reducer)}y&&S.addDefaultCase(y)})}var u;return{name:e,reducer:function(l,h){return u||(u=c()),u(l,h)},actions:o,caseReducers:i,getInitialState:function(){return u||(u=c()),u.getInitialState()}}}var ti="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ri=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=ti[Math.random()*64|0];return e},ni=["name","message","stack","code"],Wt=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),Un=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),si=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=ni;r<n.length;r++){var s=n[r];typeof t[s]=="string"&&(e[s]=t[s])}return e}return{message:String(t)}},Ha=(function(){function t(e,r,n){var s=ne(e+"/fulfilled",function(l,h,d,m){return{payload:l,meta:$t(re({},m||{}),{arg:d,requestId:h,requestStatus:"fulfilled"})}}),i=ne(e+"/pending",function(l,h,d){return{payload:void 0,meta:$t(re({},d||{}),{arg:h,requestId:l,requestStatus:"pending"})}}),a=ne(e+"/rejected",function(l,h,d,m,p){return{payload:m,error:(n&&n.serializeError||si)(l||"Rejected"),meta:$t(re({},p||{}),{arg:d,requestId:h,rejectedWithValue:!!m,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"})}}),o=!1,c=typeof AbortController<"u"?AbortController:(function(){function l(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return l.prototype.abort=function(){},l})();function u(l){return function(h,d,m){var p=n?.idGenerator?n.idGenerator(l):ri(),f=new c,y,g=!1;function S(b){y=b,f.abort()}var x=(function(){return Ks(this,null,function(){var b,Y,$,Re,dr,_e,hr;return Fs(this,function(fe){switch(fe.label){case 0:return fe.trys.push([0,4,,5]),Re=(b=n?.condition)==null?void 0:b.call(n,l,{getState:d,extra:m}),ai(Re)?[4,Re]:[3,2];case 1:Re=fe.sent(),fe.label=2;case 2:if(Re===!1||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,dr=new Promise(function(q,Ie){return f.signal.addEventListener("abort",function(){return Ie({name:"AbortError",message:y||"Aborted"})})}),h(i(p,l,(Y=n?.getPendingMeta)==null?void 0:Y.call(n,{requestId:p,arg:l},{getState:d,extra:m}))),[4,Promise.race([dr,Promise.resolve(r(l,{dispatch:h,getState:d,extra:m,requestId:p,signal:f.signal,abort:S,rejectWithValue:function(q,Ie){return new Wt(q,Ie)},fulfillWithValue:function(q,Ie){return new Un(q,Ie)}})).then(function(q){if(q instanceof Wt)throw q;return q instanceof Un?s(q.payload,p,l,q.meta):s(q,p,l)})])];case 3:return $=fe.sent(),[3,5];case 4:return _e=fe.sent(),$=_e instanceof Wt?a(null,p,l,_e.payload,_e.meta):a(_e,p,l),[3,5];case 5:return hr=n&&!n.dispatchConditionRejection&&a.match($)&&$.meta.condition,hr||h($),[2,$]}})})})();return Object.assign(x,{abort:S,requestId:p,arg:l,unwrap:function(){return x.then(ii)}})}}return Object.assign(u,{pending:i,rejected:a,fulfilled:s,typePrefix:e})}return t.withTypes=function(){return t},t})();function ii(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ai(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Vn="listener",Kn="completed",Gn="cancelled",Va="task-"+Gn,Ka="task-"+Kn,Ga=Vn+"-"+Gn,$a=Vn+"-"+Kn;var Yt="listenerMiddleware";var za=ne(Yt+"/add"),Wa=ne(Yt+"/removeAll"),Qa=ne(Yt+"/remove");var Fn,Ya=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Fn||(Fn=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},oi=function(t){return function(e){setTimeout(e,t)}},Ja=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:oi(10);Cn();var ui=ze(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??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)}}}),st=class extends ui(Object){};window.ftReduxStores||(window.ftReduxStores={});var $n=class t extends st{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(Xe(i))return i;if(s==null)return;let a=Hn({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=qn({reducer:(c,u)=>{if(u.type==="CLEAR_FT_REDUX_STORE"){let l=Me(a.getInitialState());for(let h of u.keeping)l[h]=(c??l)[h];return l}else if(typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...u.overwrites};return a.reducer(c,u)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new We;let s=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,a,o)=>{let c=a,u=i[c];return u?(...l)=>{let h=u(...l.map(s));return this.reduxStore.dispatch(h),h}:l=>{this.setState({[c]:s(l)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var it=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var at=E(w()),ci="ft-app-info",W=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};W.eventName="authentication-change";var Fe=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Fe.eventName="ui-locale-changed";var li={session:(t,e)=>{(0,at.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>v.dispatchEvent(new W(e.payload)),0))}},v=at.FtReduxStore.get({name:ci,reducers:li,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,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var zn=E(w()),ot=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},To=(0,zn.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(v)}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(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>it.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ot([(0,Jt.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ot([(0,Jt.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ot([wt({store:v.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),ot([wt({store:v.name})],e.prototype,"uiLocale",void 0),e});var ht=E(w());var Xt=E(w());var ce=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=v.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=v.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var Oe=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ce.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ce.await()}};var M=class extends Oe{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Xt.CacheRegistry,this.cache=e?s.commonCache:new Xt.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var ut=class extends M{async listMySearches(){let{session:e}=v.getState();return Ge(e,T.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var ct=class extends M{async listMyBookmarks(){let e=v.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var lt=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var dt=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var di="ft-user-assets",hi={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(U).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:s}=e.payload;er(t,r,[...Zt(t,r),s]),Wn(t,r,1,n),Qn(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;er(t,r,Zt(t,r).map(s=>s.id===n.id?n:s)),Qn(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;er(t,r,Zt(t,r).filter(i=>i.id!==s)),Wn(t,r,-1,n)}},Yn={[U.SEARCHES]:"savedSearches",[U.BOOKMARKS]:"bookmarks",[U.BOOKS]:void 0,[U.COLLECTIONS]:void 0},Zt=(t,e)=>{var r;let n=Yn[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},er=(t,e,r)=>{let n=Yn[e];n&&(t[n]=r)},Wn=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===U.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Qn=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},D=ht.FtReduxStore.get({name:di,reducers:hi,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(U).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),tr=class{constructor(e=new lt,r=new dt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ct,this.savedSearchesService=new ut,v.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=v.getState();(0,ht.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),D.actions.clearAssetCount(),D.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),D.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),D.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();D.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();D.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&D.getState().assetCounts.allAsset[e]!==r.count&&D.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&D.getState().assetCounts.bookmarkByMap[e]!==r.count&&D.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(D.getState().assetCounts.bookmarkByMap).length!==0;e===U.BOOKMARKS&&r&&D.actions.clearBookmarkCountByMap(),D.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;D.actions.bookmarks(r)}}},pi=new tr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=pi);var rr=class{addCommand(e,r=!1){v.commands.add(e,r)}consumeCommand(e){return v.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new rr;var j=E(w());var Jn,Te=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},fi=Symbol("clearAfterUnitTest"),pt=class extends(0,j.withEventBus)(M){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Jn]=()=>{this.defaultMessages={},this.cache=new j.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=v.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,j.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var s;let i=e.toLowerCase(),a=this.resolveContext(i);return new j.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof j.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Te({loadedContexts:e})),this.dispatchEvent(new Te({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Te({loadedContexts:[e]})),this.dispatchEvent(new Te({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,j.delay)(0).then(()=>n()).catch(()=>null)))}};Jn=fi;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends pt{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends pt{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Xn=window.FluidTopicsI18nService,ou=window.FluidTopicsCustomI18nService;var Zn=E(w()),nr=class{highlightHtml(e,r,n){(0,Zn.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new nr;var es=E(w());var sr=class{isDate(e){var r,n,s,i;return(i=(s=((n=(r=v.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return es.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:v.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new sr;var ts=E(w());var je=class{static get(e,r){var n,s,i,a;let o=v.getState(),{lang:c,region:u}=(i=(s=(n=o.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||s===void 0?void 0:s.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new ts.SearchPlaceConverter(o.baseUrl,e??20,(a=o.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed,r??`${c}-${u}`)}};var ft=class extends M{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var ir=class{urlToSearchRequest(e){return je.get().parse(e)}searchRequestToUrl(e){return je.get().serialize(e)}};window.FluidTopicsUrlService=new ir;var Q=E(w());var le=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};le.eventName="change";var ar=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},rs=new ar;var mt=class t extends Q.WithEventBus{static build(){return new t(window.history,rs,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Q.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new le(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=r(),u={...c===this.currentIndex?this.currentState:void 0,...i,index:c,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(s,[u,a,o]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(le.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(le.eventName,e)}currentItem(){return(0,Q.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Q.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,Q.deepCopy)(r.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(0,Q.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=mt.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)});var ns=E(me());var ss=ns.css`
3
- `;var as=E(me()),P=E(J()),pe=E(w());var de=E(w());function is(t,e){let{authenticationRequired:r,session:n}=v.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var vt=class extends Oe{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var or=class t extends de.FtStateManager{static build(e){return new t(v,e)}constructor(e,r){super(),this.store=e,this.cache=new de.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new vt,this.cleanSessionDebouncer=new de.Debouncer,this.reloadDebouncer=new de.Debouncer(500),this.apiProvider=r??(()=>ce.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(W.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 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(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 r=await this.cache.get("availableContentLocales",()=>is(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}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,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Fe(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)}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)}},qe=or.build();var he=class extends Event{constructor(e,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var Be=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let a=s.deref(),o=i.deref();a===void 0||o===void 0||a.dispatchEvent(new he(e.context,a,o,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,s=this.pendingContextRequests.get(e.context);s===void 0&&this.pendingContextRequests.set(e.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(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 I=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},O=class extends pe.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.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=qe,this.contextRoot=new Be}render(){return as.html`
1
+ "use strict";(()=>{var Ts=Object.create;var gr=Object.defineProperty;var Os=Object.getOwnPropertyDescriptor;var Rs=Object.getOwnPropertyNames;var Is=Object.getPrototypeOf,Ms=Object.prototype.hasOwnProperty;var Nt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var ks=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Rs(e))!Ms.call(t,s)&&s!==r&&gr(t,s,{get:()=>e[s],enumerable:!(n=Os(e,s))||n.enumerable});return t};var y=(t,e,r)=>(r=t!=null?Ts(Is(t)):{},ks(e||!t||!t.__esModule?gr(r,"default",{value:t,enumerable:!0}):r,t));var w=Nt((zi,Er)=>{Er.exports=ftGlobals.wcUtils});var pe=Nt((Gi,Sr)=>{Sr.exports=ftGlobals.lit});var Z=Nt((Qi,vr)=>{vr.exports=ftGlobals.litDecorators});var Cs=y(w());var bs=y(pe()),Q=y(Z()),P=y(w());var Ar=y(pe());var br=Ar.css`
2
+ `;var be=y(w()),fr=y(Z());var _e;(function(t){t.CLUSTERED_SEARCH="CLUSTERED_SEARCH"})(_e||(_e={}));var T=y(w());var _r=y(w()),Ds={setRequest:(t,e)=>{t.request=e.payload}},Cr=t=>_r.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],sortId:void 0,paging:{page:1,perPage:20},keywordMatch:void 0},liveQuery:"",recentQueries:[],paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,announcements:void 0,suggestResults:void 0,configuration:void 0},reducers:Ds});var xr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(xr||(xr={}));var wr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(wr||(wr={}));var Tr;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Tr||(Tr={}));var ee;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(ee||(ee={}));var Or;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Or||(Or={}));var Rr;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Rr||(Rr={}));var Ir;(function(t){t.OFFICIAL="OFFICIAL",t.AI="AI"})(Ir||(Ir={}));var ne;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(ne||(ne={}));var Mr;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Mr||(Mr={}));var kr;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(kr||(kr={}));var Dr;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(Dr||(Dr={}));var Nr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Nr||(Nr={}));var Lr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Lr||(Lr={}));var Pr;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Pr||(Pr={}));var Ur;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ur||(Ur={}));var Fr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Fr||(Fr={}));var Ve;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Ve||(Ve={}));var Vr;(function(t){t.ASC="ASC",t.DESC="DESC"})(Vr||(Vr={}));var jr;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(jr||(jr={}));var he;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(he||(he={}));var Br;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Br||(Br={}));var qr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(qr||(qr={}));var Hr;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Hr||(Hr={}));var $r;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})($r||($r={}));var K;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(K||(K={}));var fe;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(fe||(fe={}));var Kr;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Kr||(Kr={}));var _;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(_||(_={}));var B;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(B||(B={}));var zr;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(zr||(zr={}));var Gr;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Gr||(Gr={}));var Qr;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Qr||(Qr={}));var Wr;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Wr||(Wr={}));var Yr;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Yr||(Yr={}));var Xr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Xr||(Xr={}));var Jr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Jr||(Jr={}));var Zr;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Zr||(Zr={}));var en;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(en||(en={}));var tn;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(tn||(tn={}));var rn;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(rn||(rn={}));var nn;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(nn||(nn={}));var Ns={[_.PERSONAL_BOOK_SHARE_USER]:[_.PERSONAL_BOOK_USER],[_.HTML_EXPORT_USER]:[_.PERSONAL_BOOK_USER],[_.PDF_EXPORT_USER]:[_.PERSONAL_BOOK_USER],[_.KHUB_ADMIN]:[_.CONTENT_PUBLISHER],[_.ADMIN]:[_.KHUB_ADMIN,_.USERS_ADMIN,_.PORTAL_ADMIN,_.BEHAVIOR_DATA_USER],[_.GENERATIVE_AI_EXPORT_USER]:[_.GENERATIVE_AI_USER]};function sn(t,e){return t===e||(Ns[t]??[]).some(r=>sn(r,e))}function je(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>sn(n,e))}var rr=y(Z());var an=y(Z(),1);var Lt=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function on(t,e){return(0,an.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Ce(t);try{return JSON.parse(r)}catch{return Ce(t)}},toAttribute:r=>JSON.stringify(r)},hasChanged:xe,...e??{}})}function Ls(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!me(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!me(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let s=a=>Object.keys(a).filter(o=>a[o]!=null),i=s(t);if(r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!me(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function me(t,e){try{return Ls(t,e)}catch{return!1}}function xe(t,e){return!me(t,e)}function Ce(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function Be(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var cn=y(Z(),1);var Pt=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:xe,attribute:!1,...e};(0,cn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var qe=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var se=y(Z(),1);var He=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);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 ln=y(pe(),1);var $e=globalThis,Ps=$e.ShadowRoot&&($e.ShadyCSS===void 0||$e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var un=(t,e)=>{if(Ps)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),s=$e.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=r.cssText,t.appendChild(n)}};var Ke=class extends ln.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return un(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){Lt(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function dn(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var ge=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},mn,pn=Symbol("constructorPrototype"),hn=Symbol("constructorName"),yn=Symbol("exportpartsDebouncer"),fn=Symbol("dynamicDependenciesLoaded"),ye=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};ye.eventName="exportparts-updated";var z=class extends Ke{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[mn]=new He(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[yn].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[hn]=this.constructor.name,this[pn]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[hn]&&Object.setPrototypeOf(this,this[pn])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[fn]||(r[fn]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(ye.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(ye.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new ye)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=dn(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){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(e.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(e){var r,n,s,i,a,o;let c=h=>h!=null&&h.trim().length>0,u=e.filter(c).map(h=>h.trim());if(u.length===0){this.exportparts=void 0;return}let l=new Set;for(let h of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(i=(s=h.getAttribute("part"))===null||s===void 0?void 0:s.split(" "))!==null&&i!==void 0?i:[],C=(o=(a=h.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(m=>m.split(":")[1]))!==null&&o!==void 0?o:[],R=[...v,...C].filter(c).map(m=>m.trim());for(let m of R)l.add(m)}if(l.size===0){this.exportparts=void 0;return}let p=[...l.values()].flatMap(h=>u.map(v=>`${h}:${v}--${h}`));this.exportparts=[...this.part,...p].join(", ")}};mn=yn;ge([(0,se.property)()],z.prototype,"exportpartsPrefix",void 0);ge([on([])],z.prototype,"exportpartsPrefixes",void 0);ge([(0,se.property)({reflect:!0})],z.prototype,"exportparts",void 0);ge([(0,se.property)()],z.prototype,"customStylesheet",void 0);ge([(0,se.property)()],z.prototype,"elementToFocus",void 0);ge([(0,se.state)()],z.prototype,"useAdoptedStyleSheets",void 0);function ze(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var we=Symbol("internalReduxEventsUnsubscribers"),te=Symbol("internalStoresUnsubscribers"),ie=Symbol("internalStores"),Us=Be(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ie].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ie].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ie].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ie].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ie].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ie].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let u=this.getStore(a.store);u&&(a.store?this[te].has(a.store):this[te].size>0)&&(this[o]=a.selector(u.getState(),this))}})}subscribeToStore(a,o){var c;this[te].set(a,o.subscribe(()=>this.updateFromStores())),this[we].set(a,[]),ze(o)&&o.eventBus&&((c=this.reduxConstructor.reduxEventListeners)===null||c===void 0||c.forEach((u,l)=>{if(typeof this[l]=="function"&&(!u.store||o.name===u.store)){let p=h=>this[l](h);o.addEventListener(u.eventName,p),this[we].get(a).push(()=>o.removeEventListener(u.eventName,p))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[te].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[te].has(a)&&this[te].get(a)(),this[te].delete(a),(o=this[we].get(a))===null||o===void 0||o.forEach(c=>c()),this[we].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=te,r=ie,n=we,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),gn=class extends Us(z){};function M(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Fs=typeof Symbol=="function"&&Symbol.observable||"@@observable",En=Fs,Ut=()=>Math.random().toString(36).substring(7).split("").join("."),Vs={INIT:`@@redux/INIT${Ut()}`,REPLACE:`@@redux/REPLACE${Ut()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ut()}`},Ge=Vs;function Qe(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Ft(t,e,r){if(typeof t!="function")throw new Error(M(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(M(1));return r(Ft)(t,e)}let n=t,s=e,i=new Map,a=i,o=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((m,I)=>{a.set(I,m)}))}function l(){if(c)throw new Error(M(3));return s}function p(m){if(typeof m!="function")throw new Error(M(4));if(c)throw new Error(M(5));let I=!0;u();let F=o++;return a.set(F,m),function(){if(I){if(c)throw new Error(M(6));I=!1,u(),a.delete(F),i=null}}}function h(m){if(!Qe(m))throw new Error(M(7));if(typeof m.type>"u")throw new Error(M(8));if(typeof m.type!="string")throw new Error(M(17));if(c)throw new Error(M(9));try{c=!0,s=n(s,m)}finally{c=!1}return(i=a).forEach(F=>{F()}),m}function v(m){if(typeof m!="function")throw new Error(M(10));n=m,h({type:Ge.REPLACE})}function C(){let m=p;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(M(11));function F(){let g=I;g.next&&g.next(l())}return F(),{unsubscribe:m(F)}},[En](){return this}}}return h({type:Ge.INIT}),{dispatch:h,subscribe:p,getState:l,replaceReducer:v,[En]:C}}function js(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:Ge.INIT})>"u")throw new Error(M(12));if(typeof r(void 0,{type:Ge.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(M(13))})}function Sn(t){let e=Object.keys(t),r={};for(let a=0;a<e.length;a++){let o=e[a];typeof t[o]=="function"&&(r[o]=t[o])}let n=Object.keys(r),s,i;try{js(r)}catch(a){i=a}return function(o={},c){if(i)throw i;let u=!1,l={};for(let p=0;p<n.length;p++){let h=n[p],v=r[h],C=o[h],R=v(C,c);if(typeof R>"u"){let m=c&&c.type;throw new Error(M(14))}l[h]=R,u=u||R!==C}return u=u||n.length!==Object.keys(o).length,u?l:o}}function Te(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function vn(...t){return e=>(r,n)=>{let s=e(r,n),i=()=>{throw new Error(M(15))},a={getState:s.getState,dispatch:(c,...u)=>i(c,...u)},o=t.map(c=>c(a));return i=Te(...o)(s.dispatch),{...s,dispatch:i}}}function An(t){return Qe(t)&&"type"in t&&typeof t.type=="string"}var In=Symbol.for("immer-nothing"),bn=Symbol.for("immer-draftable"),D=Symbol.for("immer-state");function H(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var V=Object,Se=V.getPrototypeOf,Je="constructor",st="prototype",qt="configurable",Ze="enumerable",Ye="writable",Oe="value",G=t=>!!t&&!!t[D];function j(t){return t?Mn(t)||at(t)||!!t[bn]||!!t[Je]?.[bn]||ot(t)||ct(t):!1}var Bs=V[st][Je].toString(),_n=new WeakMap;function Mn(t){if(!t||!Yt(t))return!1;let e=Se(t);if(e===null||e===V[st])return!0;let r=V.hasOwnProperty.call(e,Je)&&e[Je];if(r===Object)return!0;if(!Ee(r))return!1;let n=_n.get(r);return n===void 0&&(n=Function.toString.call(r),_n.set(r,n)),n===Bs}function it(t,e,r=!0){Me(t)===0?(r?Reflect.ownKeys(t):V.keys(t)).forEach(s=>{e(s,t[s],t)}):t.forEach((n,s)=>e(s,n,t))}function Me(t){let e=t[D];return e?e.type_:at(t)?1:ot(t)?2:ct(t)?3:0}var Vt=(t,e,r=Me(t))=>r===2?t.has(e):V[st].hasOwnProperty.call(t,e),Ht=(t,e,r=Me(t))=>r===2?t.get(e):t[e],et=(t,e,r,n=Me(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function qs(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var at=Array.isArray,ot=t=>t instanceof Map,ct=t=>t instanceof Set,Yt=t=>typeof t=="object",Ee=t=>typeof t=="function",jt=t=>typeof t=="boolean";function Hs(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var W=t=>t.copy_||t.base_;var Xt=t=>t.modified_?t.copy_:t.base_;function $t(t,e){if(ot(t))return new Map(t);if(ct(t))return new Set(t);if(at(t))return Array[st].slice.call(t);let r=Mn(t);if(e===!0||e==="class_only"&&!r){let n=V.getOwnPropertyDescriptors(t);delete n[D];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let a=s[i],o=n[a];o[Ye]===!1&&(o[Ye]=!0,o[qt]=!0),(o.get||o.set)&&(n[a]={[qt]:!0,[Ye]:!0,[Ze]:o[Ze],[Oe]:t[a]})}return V.create(Se(t),n)}else{let n=Se(t);if(n!==null&&r)return{...t};let s=V.create(n);return V.assign(s,t)}}function Jt(t,e=!1){return ut(t)||G(t)||!j(t)||(Me(t)>1&&V.defineProperties(t,{set:We,add:We,clear:We,delete:We}),V.freeze(t),e&&it(t,(r,n)=>{Jt(n,!0)},!1)),t}function $s(){H(2)}var We={[Oe]:$s};function ut(t){return t===null||!Yt(t)?!0:V.isFrozen(t)}var tt="MapSet",Kt="Patches",Cn="ArrayMethods",kn={};function ae(t){let e=kn[t];return e||H(0,t),e}var xn=t=>!!kn[t];var Re,Dn=()=>Re,Ks=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:xn(tt)?ae(tt):void 0,arrayMethodsPlugin_:xn(Cn)?ae(Cn):void 0});function wn(t,e){e&&(t.patchPlugin_=ae(Kt),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function zt(t){Gt(t),t.drafts_.forEach(zs),t.drafts_=null}function Gt(t){t===Re&&(Re=t.parent_)}var Tn=t=>Re=Ks(Re,t);function zs(t){let e=t[D];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function On(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[D].modified_&&(zt(e),H(4)),j(t)&&(t=Rn(e,t));let{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(r[D].base_,t,e)}else t=Rn(e,r);return Gs(e,t,!0),zt(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==In?t:void 0}function Rn(t,e){if(ut(e))return e;let r=e[D];if(!r)return rt(e,t.handledSet_,t);if(!lt(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);Pn(r,t)}return r.copy_}function Gs(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Jt(e,r)}function Nn(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var lt=(t,e)=>t.scope_===e,Qs=[];function Ln(t,e,r,n){let s=W(t),i=t.type_;if(n!==void 0&&Ht(s,n,i)===e){et(s,n,r,i);return}if(!t.draftLocations_){let o=t.draftLocations_=new Map;it(s,(c,u)=>{if(G(u)){let l=o.get(u)||[];l.push(c),o.set(u,l)}})}let a=t.draftLocations_.get(e)??Qs;for(let o of a)et(s,o,r,i)}function Ws(t,e,r){t.callbacks_.push(function(s){let i=e;if(!i||!lt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let a=Xt(i);Ln(t,i.draft_??i,a,r),Pn(i,s)})}function Pn(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:n}=e;if(n){let s=n.getPath(t);s&&n.generatePatches_(t,s,e)}Nn(t)}}function Ys(t,e,r){let{scope_:n}=t;if(G(r)){let s=r[D];lt(s,n)&&s.callbacks_.push(function(){Xe(t);let a=Xt(s);Ln(t,r,a,e)})}else j(r)&&t.callbacks_.push(function(){let i=W(t);t.type_===3?i.has(r)&&rt(r,n.handledSet_,n):Ht(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&rt(Ht(t.copy_,e,t.type_),n.handledSet_,n)})}function rt(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||G(t)||e.has(t)||!j(t)||ut(t)||(e.add(t),it(t,(n,s)=>{if(G(s)){let i=s[D];if(lt(i,r)){let a=Xt(i);et(t,n,a,t.type_),Nn(i)}}else j(s)&&rt(s,e,r)})),t}function Xs(t,e){let r=at(t),n={type_:r?1:0,scope_:e?e.scope_:Dn(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=nt;r&&(s=[n],i=Ie);let{revoke:a,proxy:o}=Proxy.revocable(s,i);return n.draft_=o,n.revoke_=a,[o,n]}var nt={get(t,e){if(e===D)return t;let r=t.scope_.arrayMethodsPlugin_,n=t.type_===1&&typeof e=="string";if(n&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let s=W(t);if(!Vt(s,e,t.type_))return Zs(t,s,e);let i=s[e];if(t.finalized_||!j(i)||n&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Hs(e))return i;if(i===Bt(t.base_,e)||Js(t,e,i)){Xe(t);let a=t.type_===1?+e:e,o=Wt(t.scope_,i,t,a);return t.copy_[a]=o}return i},has(t,e){return e in W(t)},ownKeys(t){return Reflect.ownKeys(W(t))},set(t,e,r){let n=Un(W(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let s=Bt(W(t),e),i=s?.[D];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.set(e,!1),!0;if(qs(r,s)&&(r!==void 0||Vt(t.base_,e,t.type_)))return!0;Xe(t),Qt(t)}return t.copy_[e]===r&&(r!==void 0||Vt(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Ys(t,e,r)),!0},deleteProperty(t,e){return Xe(t),Bt(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),Qt(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=W(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[Ye]:!0,[qt]:t.type_!==1||e!=="length",[Ze]:n[Ze],[Oe]:r[e]}},defineProperty(){H(11)},getPrototypeOf(t){return Se(t.base_)},setPrototypeOf(){H(12)}},Ie={};for(let t in nt){let e=nt[t];Ie[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Ie.deleteProperty=function(t,e){return Ie.set.call(this,t,e,void 0)};Ie.set=function(t,e,r){return nt.set.call(this,t[0],e,r,t[0])};function Bt(t,e){let r=t[D];return(r?W(r):t)[e]}function Js(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||t.assigned_?.get(e)||!j(r)||r[D]?!1:t.baseRefs_.has(r)}function Zs(t,e,r){let n=Un(e,r);return n?Oe in n?n[Oe]:n.get?.call(t.draft_):void 0}function Un(t,e){if(!(e in t))return;let r=Se(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Se(r)}}function Qt(t){t.modified_||(t.modified_=!0,t.parent_&&Qt(t.parent_))}function Xe(t){t.copy_||(t.assigned_=new Map,t.copy_=$t(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var ei=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,n)=>{if(Ee(e)&&!Ee(r)){let i=r;r=e;let a=this;return function(c=i,...u){return a.produce(c,l=>r.call(this,l,...u))}}Ee(r)||H(6),n!==void 0&&!Ee(n)&&H(7);let s;if(j(e)){let i=Tn(this),a=Wt(i,e,void 0),o=!0;try{s=r(a),o=!1}finally{o?zt(i):Gt(i)}return wn(i,n),On(s,i)}else if(!e||!Yt(e)){if(s=r(e),s===void 0&&(s=e),s===In&&(s=void 0),this.autoFreeze_&&Jt(s,!0),n){let i=[],a=[];ae(Kt).generateReplacementPatches_(e,s,{patches_:i,inversePatches_:a}),n(i,a)}return s}else H(1,e)},this.produceWithPatches=(e,r)=>{if(Ee(e))return(a,...o)=>this.produceWithPatches(a,c=>e(c,...o));let n,s;return[this.produce(e,r,(a,o)=>{n=a,s=o}),n,s]},jt(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),jt(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),jt(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){j(t)||H(8),G(t)&&(t=Fn(t));let e=Tn(this),r=Wt(e,t,void 0);return r[D].isManual_=!0,Gt(e),r}finishDraft(t,e){let r=t&&t[D];(!r||!r.isManual_)&&H(9);let{scope_:n}=r;return wn(n,e),On(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let s=e[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(e=e.slice(r+1));let n=ae(Kt).applyPatches_;return G(t)?n(t,e):this.produce(t,s=>n(s,e))}};function Wt(t,e,r,n){let[s,i]=ot(e)?ae(tt).proxyMap_(e,r):ct(e)?ae(tt).proxySet_(e,r):Xs(e,r);return(r?.scope_??Dn()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Ws(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),s}function Fn(t){return G(t)||H(10,t),Vn(t)}function Vn(t){if(!j(t)||ut(t))return t;let e=t[D],r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=$t(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=$t(t,!0);return it(r,(s,i)=>{et(r,s,Vn(i))},n),e&&(e.finalized_=!1),r}var ti=new ei,Zt=ti.produce;function jn(t){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,t):s(i)}var Bn=jn(),qn=jn;var ri=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Te:Te.apply(null,arguments)},Ka=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}},ni=t=>t&&typeof t.match=="function";function re(t,e){function r(...n){if(e){let s=e(...n);if(!s)throw new Error(Y(0));return{type:t,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:t,payload:n[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=n=>An(n)&&n.type===t,r}var Gn=class ke extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,ke.prototype)}static get[Symbol.species](){return ke}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new ke(...e[0].concat(this)):new ke(...e.concat(this))}};function Hn(t){return j(t)?Zt(t,()=>{}):t}function dt(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function si(t){return typeof t=="boolean"}var ii=()=>function(e){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=e??{},a=new Gn;return r&&(si(r)?a.push(Bn):a.push(qn(r.extraArgument))),a},ai="RTK_autoBatch";var $n=t=>e=>{setTimeout(e,t)},oi=(t,e)=>r=>{let n=!1,s=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=t(s),a=setTimeout(s,e)},ci=(t={type:"raf"})=>e=>(...r)=>{let n=e(...r),s=!0,i=!1,a=!1,o=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?oi(window.requestAnimationFrame,100):$n(10):t.type==="callback"?t.queueNotification:$n(t.timeout),u=()=>{a=!1,i&&(i=!1,o.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let p=()=>s&&l(),h=n.subscribe(p);return o.add(l),()=>{h(),o.delete(l)}},dispatch(l){try{return s=!l?.meta?.[ai],i=!s,i&&(a||(a=!0,c(u))),n.dispatch(l)}finally{s=!0}}})},ui=t=>function(r){let{autoBatch:n=!0}=r??{},s=new Gn(t);return n&&s.push(ci(typeof n=="object"?n:void 0)),s};function Qn(t){let e=ii(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=t||{},c;if(typeof r=="function")c=r;else if(Qe(r))c=Sn(r);else throw new Error(Y(1));let u;typeof n=="function"?u=n(e):u=e();let l=Te;s&&(l=ri({trace:!1,...typeof s=="object"&&s}));let p=vn(...u),h=ui(p),v=typeof o=="function"?o(h):h(),C=l(...v);return Ft(c,a,C)}function Wn(t){let e={},r=[],n,s={addCase(i,a){let o=typeof i=="string"?i:i.type;if(!o)throw new Error(Y(28));if(o in e)throw new Error(Y(29));return e[o]=a,s},addAsyncThunk(i,a){return a.pending&&(e[i.pending.type]=a.pending),a.rejected&&(e[i.rejected.type]=a.rejected),a.fulfilled&&(e[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){return n=i,s}};return t(s),[e,r,n]}function li(t){return typeof t=="function"}function di(t,e){let[r,n,s]=Wn(e),i;if(li(t))i=()=>Hn(t());else{let o=Hn(t);i=()=>o}function a(o=i(),c){let u=[r[c.type],...n.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[s]),u.reduce((l,p)=>{if(p)if(G(l)){let v=p(l,c);return v===void 0?l:v}else{if(j(l))return Zt(l,h=>p(h,c));{let h=p(l,c);if(h===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return l},o)}return a.getInitialState=i,a}var pi=(t,e)=>ni(t)?t.match(e):t(e);function hi(...t){return e=>t.some(r=>pi(r,e))}var fi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mi=(t=21)=>{let e="",r=t;for(;r--;)e+=fi[Math.random()*64|0];return e},yi=["name","message","stack","code"],er=class{constructor(t,e){this.payload=t,this.meta=e}payload;meta;_type},Kn=class{constructor(t,e){this.payload=t,this.meta=e}payload;meta;_type},gi=t=>{if(typeof t=="object"&&t!==null){let e={};for(let r of yi)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},zn="External signal was aborted",Ei=(()=>{function t(e,r,n){let s=re(e+"/fulfilled",(c,u,l,p)=>({payload:c,meta:{...p||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),i=re(e+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),a=re(e+"/rejected",(c,u,l,p,h)=>({payload:p,error:(n&&n.serializeError||gi)(c||"Rejected"),meta:{...h||{},arg:l,requestId:u,rejectedWithValue:!!p,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function o(c,{signal:u}={}){return(l,p,h)=>{let v=n?.idGenerator?n.idGenerator(c):mi(),C=new AbortController,R,m;function I(f){m=f,C.abort()}u&&(u.aborted?I(zn):u.addEventListener("abort",()=>I(zn),{once:!0}));let F=(async function(){let f;try{let E=n?.condition?.(c,{getState:p,extra:h});if(vi(E)&&(E=await E),E===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let $=new Promise((b,x)=>{R=()=>{x({name:"AbortError",message:m||"Aborted"})},C.signal.addEventListener("abort",R,{once:!0})});l(i(v,c,n?.getPendingMeta?.({requestId:v,arg:c},{getState:p,extra:h}))),f=await Promise.race([$,Promise.resolve(r(c,{dispatch:l,getState:p,extra:h,requestId:v,signal:C.signal,abort:I,rejectWithValue:((b,x)=>new er(b,x)),fulfillWithValue:((b,x)=>new Kn(b,x))})).then(b=>{if(b instanceof er)throw b;return b instanceof Kn?s(b.payload,v,c,b.meta):s(b,v,c)})])}catch(E){f=E instanceof er?a(null,v,c,E.payload,E.meta):a(E,v,c)}finally{R&&C.signal.removeEventListener("abort",R)}return n&&!n.dispatchConditionRejection&&a.match(f)&&f.meta.condition||l(f),f})();return Object.assign(F,{abort:I,requestId:v,arg:c,unwrap(){return F.then(Si)}})}}return Object.assign(o,{pending:i,rejected:a,fulfilled:s,settled:hi(a,s),typePrefix:e})}return t.withTypes=()=>t,t})();function Si(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function vi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Yn=Symbol.for("rtk-slice-createasyncthunk"),Ga={[Yn]:Ei};function Ai(t,e){return`${t}/${e}`}function bi({creators:t}={}){let e=t?.asyncThunk?.[Yn];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(Y(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Ci()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(f,g){let E=typeof f=="string"?f:f.type;if(!E)throw new Error(Y(12));if(E in c.sliceCaseReducersByType)throw new Error(Y(13));return c.sliceCaseReducersByType[E]=g,u},addMatcher(f,g){return c.sliceMatchers.push({matcher:f,reducer:g}),u},exposeAction(f,g){return c.actionCreators[f]=g,u},exposeCaseReducer(f,g){return c.sliceCaseReducersByName[f]=g,u}};o.forEach(f=>{let g=a[f],E={reducerName:f,type:Ai(s,f),createNotation:typeof n.reducers=="function"};wi(g)?Oi(E,g,u,e):xi(E,g,u)});function l(){let[f={},g=[],E=void 0]=typeof n.extraReducers=="function"?Wn(n.extraReducers):[n.extraReducers],$={...f,...c.sliceCaseReducersByType};return di(n.initialState,b=>{for(let x in $)b.addCase(x,$[x]);for(let x of c.sliceMatchers)b.addMatcher(x.matcher,x.reducer);for(let x of g)b.addMatcher(x.matcher,x.reducer);E&&b.addDefaultCase(E)})}let p=f=>f,h=new Map,v=new WeakMap,C;function R(f,g){return C||(C=l()),C(f,g)}function m(){return C||(C=l()),C.getInitialState()}function I(f,g=!1){function E(b){let x=b[f];return typeof x>"u"&&g&&(x=dt(v,E,m)),x}function $(b=p){let x=dt(h,g,()=>new WeakMap);return dt(x,b,()=>{let yr={};for(let[xs,ws]of Object.entries(n.selectors??{}))yr[xs]=_i(ws,b,()=>dt(v,b,m),g);return yr})}return{reducerPath:f,getSelectors:$,get selectors(){return $(E)},selectSlice:E}}let F={name:s,reducer:R,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:m,...I(i),injectInto(f,{reducerPath:g,...E}={}){let $=g??i;return f.inject({reducerPath:$,reducer:R},E),{...F,...I($,!0)}}};return F}}function _i(t,e,r,n){function s(i,...a){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...a)}return s.unwrapped=t,s}var Xn=bi();function Ci(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function xi({type:t,reducerName:e,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!Ti(n))throw new Error(Y(17));i=n.reducer,a=n.prepare}else i=n;s.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,a?re(t,a):re(t))}function wi(t){return t._reducerDefinitionType==="asyncThunk"}function Ti(t){return t._reducerDefinitionType==="reducerWithPrepare"}function Oi({type:t,reducerName:e},r,n,s){if(!s)throw new Error(Y(18));let{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:u,options:l}=r,p=s(t,i,l);n.exposeAction(e,p),a&&n.addCase(p.fulfilled,a),o&&n.addCase(p.pending,o),c&&n.addCase(p.rejected,c),u&&n.addMatcher(p.settled,u),n.exposeCaseReducer(e,{fulfilled:a||pt,pending:o||pt,rejected:c||pt,settled:u||pt})}function pt(){}var Jn="listener",Zn="completed",es="cancelled",Qa=`task-${es}`,Wa=`task-${Zn}`,Ya=`${Jn}-${es}`,Xa=`${Jn}-${Zn}`;var{assign:ts}=Object;var tr="listenerMiddleware";var Ri=ts(re(`${tr}/add`),{withTypes:()=>Ri}),Ja=re(`${tr}/removeAll`),Ii=ts(re(`${tr}/remove`),{withTypes:()=>Ii});function Y(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Mi=Be(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??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)}}}),ht=class extends Mi(Object){};window.ftReduxStores||(window.ftReduxStores={});var rs=class t extends ht{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(ze(i))return i;if(s==null)return;let a=Xn({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=Qn({reducer:(c,u)=>{if(u.type==="CLEAR_FT_REDUX_STORE"){let l=Ce(a.getInitialState());for(let p of u.keeping)l[p]=(c??l)[p];return l}else if(typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...u.overwrites};return a.reducer(c,u)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new qe,this.injectInto=(i,a)=>this.reduxSlice.injectInto(i,a),this.selectSlice=i=>this.reduxSlice.selectSlice(i);let s=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,a,o)=>{let c=a,u=i[c];return u?(...l)=>{let p=u(...l.map(s));return this.reduxStore.dispatch(p),p}:l=>{let p=c,h=this.getState()[p];me(h,l)||this.setState({[p]:s(l)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var ft=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var mt=y(w()),ki="ft-app-info",X=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};X.eventName="authentication-change";var De=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};De.eventName="ui-locale-changed";var Di={session:(t,e)=>{(0,mt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>d.dispatchEvent(new X(e.payload)),0))}},d=mt.FtReduxStore.get({name:ki,reducers:Di,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,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var ns=y(w()),yt=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},Ro=(0,ns.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(d)}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(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>ft.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return yt([(0,rr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),yt([(0,rr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),yt([Pt({store:d.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),yt([Pt({store:d.name})],e.prototype,"uiLocale",void 0),e});var At=y(w());var nr=y(w());var oe=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=d.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=d.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var ve=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:oe.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):oe.await()}};var N=class extends ve{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new nr.CacheRegistry,this.cache=e?s.commonCache:new nr.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var gt=class extends N{async listMySearches(){let{session:e}=d.getState();return je(e,_.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Et=class extends N{async listMyBookmarks(){let e=d.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var St=class extends N{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var vt=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("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var Ni="ft-user-assets",Li={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(B).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:s}=e.payload;ir(t,r,[...sr(t,r),s]),ss(t,r,1,n),is(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;ir(t,r,sr(t,r).map(s=>s.id===n.id?n:s)),is(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;ir(t,r,sr(t,r).filter(i=>i.id!==s)),ss(t,r,-1,n)}},as={[B.SEARCHES]:"savedSearches",[B.BOOKMARKS]:"bookmarks",[B.BOOKS]:void 0,[B.COLLECTIONS]:void 0},sr=(t,e)=>{var r;let n=as[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},ir=(t,e,r)=>{let n=as[e];n&&(t[n]=r)},ss=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===B.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},is=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},L=At.FtReduxStore.get({name:Ni,reducers:Li,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(B).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),ar=class{constructor(e=new St,r=new vt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=d.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Et,this.savedSearchesService=new gt,d.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=d.getState();(0,At.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),L.actions.clearAssetCount(),L.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),L.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),L.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();L.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();L.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&L.getState().assetCounts.allAsset[e]!==r.count&&L.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&L.getState().assetCounts.bookmarkByMap[e]!==r.count&&L.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(L.getState().assetCounts.bookmarkByMap).length!==0;e===B.BOOKMARKS&&r&&L.actions.clearBookmarkCountByMap(),L.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;L.actions.bookmarks(r)}}},Pi=new ar;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Pi);var or=class{addCommand(e,r=!1){d.commands.add(e,r)}consumeCommand(e){return d.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new or;var q=y(w());var os,Ae=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Ui=Symbol("clearAfterUnitTest"),bt=class extends(0,q.withEventBus)(N){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[os]=()=>{this.defaultMessages={},this.cache=new q.CacheRegistry,this.listeners={}},this.currentUiLocale=d.getState().uiLocale,d.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=d.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,q.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var s;let i=e.toLowerCase(),a=this.resolveContext(i);return new q.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof q.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ae({loadedContexts:e})),this.dispatchEvent(new Ae({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ae({loadedContexts:[e]})),this.dispatchEvent(new Ae({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,q.delay)(0).then(()=>n()).catch(()=>null)))}};os=Ui;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends bt{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends bt{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var cs=window.FluidTopicsI18nService,lc=window.FluidTopicsCustomI18nService;var us=y(w()),cr=class{highlightHtml(e,r,n){(0,us.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new cr;var ls=y(w());var ur=class{isDate(e){var r,n,s,i;return(i=(s=((n=(r=d.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return ls.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:d.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new ur;var ds=y(w());var Ne=class{static get(e,r){var n,s,i,a;let o=d.getState(),{lang:c,region:u}=(i=(s=(n=o.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||s===void 0?void 0:s.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new ds.SearchPlaceConverter(o.baseUrl,e??20,(a=o.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed,r??`${c}-${u}`)}};var _t=class extends N{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var lr=class{urlToSearchRequest(e){return Ne.get().parse(e)}searchRequestToUrl(e){return Ne.get().serialize(e)}};window.FluidTopicsUrlService=new lr;var J=y(w());var ce=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ce.eventName="change";var dr=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},ps=new dr;var Ct=class t extends J.WithEventBus{static build(){return new t(window.history,ps,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,J.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ce(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=r(),u={...c===this.currentIndex?this.currentState:void 0,...i,index:c,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(s,[u,a,o]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(ce.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ce.eventName,e)}currentItem(){return(0,J.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,J.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,J.deepCopy)(r.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(0,J.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Ct.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)});var hs=y(pe());var fs=hs.css`
3
+ `;var ys=y(pe()),U=y(Z()),de=y(w());var ue=y(w());function ms(t,e){let{authenticationRequired:r,session:n}=d.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var xt=class extends ve{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var pr=class t extends ue.FtStateManager{static build(e){return new t(d,e)}constructor(e,r){super(),this.store=e,this.cache=new ue.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new xt,this.cleanSessionDebouncer=new ue.Debouncer,this.reloadDebouncer=new ue.Debouncer(500),this.apiProvider=r??(()=>oe.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(X.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 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(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 r=await this.cache.get("availableContentLocales",()=>ms(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}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,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new De(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)}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)}},Le=pr.build();var le=class extends Event{constructor(e,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var Pe=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let a=s.deref(),o=i.deref();a===void 0||o===void 0||a.dispatchEvent(new le(e.context,a,o,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,s=this.pendingContextRequests.get(e.context);s===void 0&&this.pendingContextRequests.set(e.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(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 k=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},A=class extends de.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.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Le,this.contextRoot=new Pe}render(){return ys.html`
4
4
  <slot></slot>
5
- `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;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("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Xn.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")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};O.elementDefinitions={};O.styles=ss;I([(0,P.property)()],O.prototype,"baseUrl",void 0);I([(0,P.property)()],O.prototype,"tenantId",void 0);I([(0,P.property)()],O.prototype,"apiIntegrationIdentifier",void 0);I([(0,P.property)()],O.prototype,"apiIntegrationAppVersion",void 0);I([(0,P.property)()],O.prototype,"uiLocale",void 0);I([(0,pe.jsonProperty)(null)],O.prototype,"availableUiLocales",void 0);I([(0,pe.jsonProperty)(null)],O.prototype,"metadataConfiguration",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"editorMode",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"noCustom",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"openExternalDocumentInNewTab",void 0);I([(0,P.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],O.prototype,"noCustomComponent",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"withManualResources",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"navigatorOnline",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"forcedOffline",void 0);I([(0,P.property)({type:Boolean})],O.prototype,"authenticationRequired",void 0);I([(0,pe.jsonProperty)([])],O.prototype,"messageContexts",void 0);I([(0,pe.jsonProperty)(void 0)],O.prototype,"session",void 0);var us=E(w());var os={"ft-app-context":O};(0,us.customElements)(os);var yt=class extends M{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,s)=>n.id.localeCompare(s.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),120*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),120*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}async getConfiguration(){return this.cache.get("search-configuration")}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,s)=>n.localeCompare(s))}}).sort((r,n)=>r.key.localeCompare(n.key))}};var gt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e,composed:!0,bubbles:!0})}},St=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e,composed:!0,bubbles:!0})}},Et=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n},composed:!0,bubbles:!0})}},He=class t extends Event{constructor(){super(t.eventName)}};He.eventName="search-context-clear-all-filters";var yi=t=>t.request.virtualField===ve.TITLE_ONLY&&t.request.scope===ye.DOCUMENTS,gi=t=>t.request.keywordMatch==Ke.MANDATORY,Si=20,Ve=class t extends R.FtStateManager{static build(e,r){return new t(Er(e.trim()||"context"),r)}constructor(e,r){super(),this.store=e,this.ignoreEmptyQuery=!1,this.canUpdateUiLocale=!1,this.openExternalDocumentInNewTab=!1,this.onNewNeededRequest=n=>{n==ke.CLUSTERED_SEARCH&&this.launchSearch(this.buildSearchRequest(this.store.getState()))},this.onStorageEvent=n=>{n.key===this.recentQueriesStorageKey?this.loadRecentQueries():n.key===this.taruqaConfigStorageKey&&this.loadTaruqaTemplate()},this.loadTaruqaTemplate=()=>{var n;let s;if(Ge(v.getState().session,T.DEBUG_USER)){let i=JSON.parse((n=window.localStorage.getItem(this.taruqaConfigStorageKey))!==null&&n!==void 0?n:"{}");s=i.overrideEnabled?i.template:void 0}this.updateSearchRequest({taruqaTemplateOverride:s,changedByConfiguration:!0})},this.localesDebouncer=new R.Debouncer(10),this.searchDebouncer=new R.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(s=>({id:s}))}),this.suggestDebouncer=new R.Debouncer(1e3),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>{var s;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(s=n.request.sort)!==null&&s!==void 0?s:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope,keywordMatch:n.request.keywordMatch}},this.service=r??new yt,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,R.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,R.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>{this.store.actions.configuration(e),this.setSortId(this.store.getState().request.sortId)}),this.loadRecentQueries(),this.loadTaruqaTemplate(),this.launchSearch()}addListeners(){window.addEventListener("storage",this.onStorageEvent),v.addEventListener(W.eventName,this.loadTaruqaTemplate)}removeListeners(){window.removeEventListener("storage",this.onStorageEvent),v.removeEventListener(W.eventName,this.loadTaruqaTemplate)}get recentQueriesStorageKey(){return v.getState().tenantId+"-ft-recent-queries"}get taruqaConfigStorageKey(){return v.getState().tenantId+"-taruqa-experiment-conf"}updateSearchRequest(e,r=!1){let n=(0,R.deepCopy)(this.store.getState().request);delete n.changedByConfiguration,this.store.actions.setRequest({...n,paging:{perPage:n.paging.perPage,page:r?1:n.paging.page},...e})}setQuery(e){this.updateSearchRequest({query:e},!0),this.setLiveQuery(e)}setContentLocale(e){var r,n;let s=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(s.length>0){let a=o=>s.some(c=>c.lang==o);a(e)||(e=a(i)?i:s[0].lang)}this.updateSearchRequest({contentLocale:e,metadataFilters:[]},!0),this.canUpdateUiLocale&&(!((n=qe.store.getState().localesConfiguration)===null||n===void 0)&&n.searchLanguageSetsUiLanguage)&&e&&qe.requestUiLocaleUpdate(e,e)}return e}forceContentLocale(e){this.updateSearchRequest({contentLocale:e})}setPageSize(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,perPage:isNaN(e)?20:(0,R.minmax)(1,e,1e3)}})}setPageNumber(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,page:isNaN(e)?1:Math.max(1,e)}})}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.updateSearchRequest({sort:e},!0)}setSortId(e,r=!1){var n;let s=r?{changedByConfiguration:!0}:{};if(e==null||this.sortOptions.length==0)return this.updateSearchRequest({sortId:e,...s},!0),e;let i=(n=this.sortOptions.find(a=>a.id==e))!==null&&n!==void 0?n:this.sortOptions[0];return this.updateSearchRequest({sortId:i.id,...s},!0),i.id}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.updateSearchRequest({metadataFilters:r},!0)}setClusterSortCriterion(e){this.updateSearchRequest({clusterSortCriterions:e})}setSearchInDocumentTitlesOnly(e){e?this.updateSearchRequest({virtualField:ve.TITLE_ONLY,scope:ye.DOCUMENTS},!0):this.updateSearchRequest({virtualField:ve.EVERYWHERE,scope:ye.DEFAULT},!0)}setKeywordMatch(e){this.updateSearchRequest({keywordMatch:e},!0)}setVirtualField(e){this.updateSearchRequest({virtualField:e},!0)}get searchInDocumentTitlesOnly(){return yi(this.store.getState())}get keywordMatch(){return gi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new He)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(s=>s!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(s=>({id:s}));this.updateSearchRequest({facets:n})}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,valueFilter:{values:r,negative:!1}},i=[...n.filter(a=>!a.valueFilter),...n.filter(a=>a.valueFilter&&a.key!==s.key),s];this.setFilters(i)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,dateFilter:{type:r}},i=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==s.key),s];this.setFilters(i)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.dateFilter),...r.filter(s=>s.dateFilter&&s.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let s=this.store.getState().request.metadataFilters,i={key:e,rangeFilter:{from:r,to:n}},a=[...s.filter(o=>!o.rangeFilter),...s.filter(o=>o.rangeFilter&&o.key!==i.key),i];this.setFilters(a)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.rangeFilter),...r.filter(s=>s.rangeFilter&&s.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.updateSearchRequest({...e,facets:this.store.getState().request.facets},!0),this.setLiveQuery(e.query)}setScope(e){this.updateSearchRequest({scope:e})}setOtherQueryParams(e){this.updateSearchRequest({otherQueryParams:e})}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}setCanUpdateUiLocale(e){this.canUpdateUiLocale=e}loadRecentQueries(){var e;this.store.actions.recentQueries(JSON.parse((e=window.localStorage.getItem(this.recentQueriesStorageKey))!==null&&e!==void 0?e:"[]"))}addRecentQuery(e){if(e=e.trim(),e.length===0)return;let r=e.toLowerCase(),n=this.store.getState().recentQueries.filter(s=>s.toLowerCase()!==r).slice(0,Si-1);n.unshift(e),this.setRecentQueries(n)}removeRecentQuery(e){let r=e.trim().toLowerCase(),n=this.store.getState().recentQueries,s=n.filter(i=>i.toLowerCase()!==r);n.length!==s.length&&this.setRecentQueries(s)}setRecentQueries(e){let r=JSON.stringify(e);window.localStorage.setItem(this.recentQueriesStorageKey,r),window.dispatchEvent(new StorageEvent("storage",{key:this.recentQueriesStorageKey,newValue:r,storageArea:window.localStorage,url:window.location.href}))}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,s,i,a;if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),!!this.isRequestNeeded(ke.CLUSTERED_SEARCH))try{if(this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{!((n=this.store.getState().results)===null||n===void 0)&&n.length||this.store.actions.results(void 0),this.cancelableSearch=(0,R.cancelable)(this.service.launchSearch(e));let o=await this.cancelableSearch;if(this.store.actions.announcements(o.announcements),o.paging.currentPage<=1)this.store.actions.results(o.results),this.store.actions.facets(o.facets),this.store.actions.spellcheck(o.spellcheck);else{let c=((s=this.store.getState().results)!==null&&s!==void 0?s:[]).concat(o.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(o.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(o.paging)}}catch(o){o instanceof R.CanceledPromiseError||(console.error(o),(a=this.errorHandler)===null||a===void 0||a.call(this,o))}}async fetchSuggestData(e){var r;try{if((r=this.cancelableSuggest)===null||r===void 0||r.cancel(),e.input.length<3){this.store.actions.suggestResults([]);return}this.cancelableSuggest=(0,R.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof R.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var cs=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},lr=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},ls=Symbol("registerInterval"),ur=Symbol("registerAttempts"),Ei=40,bi=(0,we.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class e extends t{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var s,i,a;super.willUpdate(n),n.has("neededSearchRequests")&&((s=this.stateManager)===null||s===void 0||s.unregisterComponent(this,(i=n.get("neededSearchRequests"))!==null&&i!==void 0?i:[]),(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[ur]=0,this.tryToRegisterToContext(),this[ls]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[ur]>Ei?window.clearInterval(this[ls]):(this[ur]++,this.dispatchEvent(new lr))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return cs([(0,cr.state)()],e.prototype,"stateManager",void 0),cs([(0,cr.state)({hasChanged:we.hasChanged})],e.prototype,"neededSearchRequests",void 0),e}),ds=class extends bi(we.FtLitElementRedux){};var xt=E(w());function bt(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function At(t){var e,r;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values,negative:(r=t.valueFilter)===null||r===void 0?void 0:r.negative}}var Ct=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=([n,s])=>{if(!this.canSendEvent()||!n||!s)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n,s):this.sendDocumentSearchEvent(i,n,s)},this.eventsService=r??new ft,this.resultsWatcher=(0,xt.watch)(e,n=>[n.results,n.paging],this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.eventsService.convertMapToAnalyticsDocument(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=v.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=v.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r,n){let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:bt(e.metadataFilters),facets:e.metadataFilters.map(i=>At(i))}};this.eventsService.sendKhubSearchEvent(s)}sendDocumentSearchEvent(e,r,n){if(e.metadataFilters.find(i=>{var a;return i.key==="ft:publicationId"&&((a=i.valueFilter)===null||a===void 0?void 0:a.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==H.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:bt(n.metadataFilters),facets:n.metadataFilters.map(a=>At(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(i)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==H.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:se.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:bt(n.metadataFilters),facets:n.metadataFilters.map(a=>At(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(i)}convertDocument(e){switch(e.type){case H.MAP:return{id:e.map.mapId,title:e.map.title,type:X.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case H.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:X.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case H.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:X.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};case H.HTML_PACKAGE:return{id:e.htmlPackage.packageId,title:e.htmlPackage.title,type:X.HTML_PACKAGE,metadata:e.htmlPackage.metadata};case H.HTML_PACKAGE_PAGE:return{id:e.htmlPackagePage.packageId,title:e.htmlPackagePage.title,type:X.HTML_PACKAGE,metadata:e.htmlPackagePage.metadata};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r;return(r=(0,xt.accessResult)(e))===null||r===void 0?void 0:r.originUrl}};var _=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},A=class extends L.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Ve.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new Ct(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this._appIntegrationInfoReady=!1,this.addStore(v)}render(){return hs.html`
5
+ `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;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("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>cs.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")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};A.elementDefinitions={};A.styles=fs;k([(0,U.property)()],A.prototype,"baseUrl",void 0);k([(0,U.property)()],A.prototype,"tenantId",void 0);k([(0,U.property)()],A.prototype,"apiIntegrationIdentifier",void 0);k([(0,U.property)()],A.prototype,"apiIntegrationAppVersion",void 0);k([(0,U.property)()],A.prototype,"uiLocale",void 0);k([(0,de.jsonProperty)(null)],A.prototype,"availableUiLocales",void 0);k([(0,de.jsonProperty)(null)],A.prototype,"metadataConfiguration",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"editorMode",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"noCustom",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"openExternalDocumentInNewTab",void 0);k([(0,U.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],A.prototype,"noCustomComponent",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"withManualResources",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"navigatorOnline",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"forcedOffline",void 0);k([(0,U.property)({type:Boolean})],A.prototype,"authenticationRequired",void 0);k([(0,de.jsonProperty)([])],A.prototype,"messageContexts",void 0);k([(0,de.jsonProperty)(void 0)],A.prototype,"session",void 0);var Es=y(w());var gs={"ft-app-context":A};(0,Es.customElements)(gs);var wt=class extends N{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,s)=>n.id.localeCompare(s.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),120*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),120*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}async getConfiguration(){return this.cache.get("search-configuration")}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,s)=>n.localeCompare(s))}}).sort((r,n)=>r.key.localeCompare(n.key))}};var Tt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e,composed:!0,bubbles:!0})}},Ot=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e,composed:!0,bubbles:!0})}},Rt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n},composed:!0,bubbles:!0})}},Ue=class t extends Event{constructor(){super(t.eventName)}};Ue.eventName="search-context-clear-all-filters";var ji=t=>t.request.virtualField===he.TITLE_ONLY&&t.request.scope===fe.DOCUMENTS,Bi=t=>t.request.keywordMatch==Ve.MANDATORY,qi=20,Fe=class t extends T.FtStateManager{static build(e,r){return new t(Cr(e.trim()||"context"),r)}constructor(e,r){super(),this.store=e,this.ignoreEmptyQuery=!1,this.canUpdateUiLocale=!1,this.openExternalDocumentInNewTab=!1,this.onNewNeededRequest=n=>{n==_e.CLUSTERED_SEARCH&&this.launchSearch(this.buildSearchRequest(this.store.getState()))},this.onStorageEvent=n=>{n.key===this.recentQueriesStorageKey?this.loadRecentQueries():n.key===this.taruqaConfigStorageKey&&this.loadTaruqaTemplate()},this.loadTaruqaTemplate=()=>{var n;let s;if(je(d.getState().session,_.DEBUG_USER)){let i=JSON.parse((n=window.localStorage.getItem(this.taruqaConfigStorageKey))!==null&&n!==void 0?n:"{}");s=i.overrideEnabled?i.template:void 0}this.updateSearchRequest({taruqaTemplateOverride:s,changedByConfiguration:!0})},this.localesDebouncer=new T.Debouncer(10),this.searchDebouncer=new T.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(s=>({id:s}))}),this.suggestDebouncer=new T.Debouncer(1e3),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>{var s;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(s=n.request.sort)!==null&&s!==void 0?s:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope,keywordMatch:n.request.keywordMatch}},this.service=r??new wt,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,T.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,T.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>{this.store.actions.configuration(e),this.setSortId(this.store.getState().request.sortId)}),this.loadRecentQueries(),this.loadTaruqaTemplate(),this.launchSearch()}addListeners(){window.addEventListener("storage",this.onStorageEvent),d.addEventListener(X.eventName,this.loadTaruqaTemplate)}removeListeners(){window.removeEventListener("storage",this.onStorageEvent),d.removeEventListener(X.eventName,this.loadTaruqaTemplate)}get recentQueriesStorageKey(){return d.getState().tenantId+"-ft-recent-queries"}get taruqaConfigStorageKey(){return d.getState().tenantId+"-taruqa-experiment-conf"}updateSearchRequest(e,r=!1){let n=(0,T.deepCopy)(this.store.getState().request);delete n.changedByConfiguration,this.store.actions.setRequest({...n,paging:{perPage:n.paging.perPage,page:r?1:n.paging.page},...e})}setQuery(e){this.updateSearchRequest({query:e},!0),this.setLiveQuery(e)}setContentLocale(e){var r,n;let s=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(s.length>0){let a=o=>s.some(c=>c.lang==o);a(e)||(e=a(i)?i:s[0].lang)}this.updateSearchRequest({contentLocale:e,metadataFilters:[]},!0),this.canUpdateUiLocale&&(!((n=Le.store.getState().localesConfiguration)===null||n===void 0)&&n.searchLanguageSetsUiLanguage)&&e&&Le.requestUiLocaleUpdate(e,e)}return e}forceContentLocale(e){this.updateSearchRequest({contentLocale:e})}setPageSize(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,perPage:isNaN(e)?20:(0,T.minmax)(1,e,1e3)}})}setPageNumber(e){let r=this.store.getState().request;this.updateSearchRequest({paging:{...r.paging,page:isNaN(e)?1:Math.max(1,e)}})}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.updateSearchRequest({sort:e},!0)}setSortId(e,r=!1){var n;let s=r?{changedByConfiguration:!0}:{};if(e==null||this.sortOptions.length==0)return this.updateSearchRequest({sortId:e,...s},!0),e;let i=(n=this.sortOptions.find(a=>a.id==e))!==null&&n!==void 0?n:this.sortOptions[0];return this.updateSearchRequest({sortId:i.id,...s},!0),i.id}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.updateSearchRequest({metadataFilters:r},!0)}setClusterSortCriterion(e){this.updateSearchRequest({clusterSortCriterions:e})}setSearchInDocumentTitlesOnly(e){e?this.updateSearchRequest({virtualField:he.TITLE_ONLY,scope:fe.DOCUMENTS},!0):this.updateSearchRequest({virtualField:he.EVERYWHERE,scope:fe.DEFAULT},!0)}setKeywordMatch(e){this.updateSearchRequest({keywordMatch:e},!0)}setVirtualField(e){this.updateSearchRequest({virtualField:e},!0)}get searchInDocumentTitlesOnly(){return ji(this.store.getState())}get keywordMatch(){return Bi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new Ue)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(s=>s!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(s=>({id:s}));this.updateSearchRequest({facets:n})}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,valueFilter:{values:r,negative:!1}},i=[...n.filter(a=>!a.valueFilter),...n.filter(a=>a.valueFilter&&a.key!==s.key),s];this.setFilters(i)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,s={key:e,dateFilter:{type:r}},i=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==s.key),s];this.setFilters(i)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.dateFilter),...r.filter(s=>s.dateFilter&&s.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let s=this.store.getState().request.metadataFilters,i={key:e,rangeFilter:{from:r,to:n}},a=[...s.filter(o=>!o.rangeFilter),...s.filter(o=>o.rangeFilter&&o.key!==i.key),i];this.setFilters(a)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(s=>!s.rangeFilter),...r.filter(s=>s.rangeFilter&&s.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.updateSearchRequest({...e,facets:this.store.getState().request.facets},!0),this.setLiveQuery(e.query)}setScope(e){this.updateSearchRequest({scope:e})}setOtherQueryParams(e){this.updateSearchRequest({otherQueryParams:e})}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}setCanUpdateUiLocale(e){this.canUpdateUiLocale=e}loadRecentQueries(){var e;this.store.actions.recentQueries(JSON.parse((e=window.localStorage.getItem(this.recentQueriesStorageKey))!==null&&e!==void 0?e:"[]"))}addRecentQuery(e){if(e=e.trim(),e.length===0)return;let r=e.toLowerCase(),n=this.store.getState().recentQueries.filter(s=>s.toLowerCase()!==r).slice(0,qi-1);n.unshift(e),this.setRecentQueries(n)}removeRecentQuery(e){let r=e.trim().toLowerCase(),n=this.store.getState().recentQueries,s=n.filter(i=>i.toLowerCase()!==r);n.length!==s.length&&this.setRecentQueries(s)}setRecentQueries(e){let r=JSON.stringify(e);window.localStorage.setItem(this.recentQueriesStorageKey,r),window.dispatchEvent(new StorageEvent("storage",{key:this.recentQueriesStorageKey,newValue:r,storageArea:window.localStorage,url:window.location.href}))}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,s,i,a;if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),!!this.isRequestNeeded(_e.CLUSTERED_SEARCH))try{if(this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{!((n=this.store.getState().results)===null||n===void 0)&&n.length||this.store.actions.results(void 0),this.cancelableSearch=(0,T.cancelable)(this.service.launchSearch(e));let o=await this.cancelableSearch;if(this.store.actions.announcements(o.announcements),o.paging.currentPage<=1)this.store.actions.results(o.results),this.store.actions.facets(o.facets),this.store.actions.spellcheck(o.spellcheck);else{let c=((s=this.store.getState().results)!==null&&s!==void 0?s:[]).concat(o.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(o.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(o.paging)}}catch(o){o instanceof T.CanceledPromiseError||(console.error(o),(a=this.errorHandler)===null||a===void 0||a.call(this,o))}}async fetchSuggestData(e){var r;try{if((r=this.cancelableSuggest)===null||r===void 0||r.cancel(),e.input.length<3){this.store.actions.suggestResults([]);return}this.cancelableSuggest=(0,T.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof T.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Ss=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},mr=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},vs=Symbol("registerInterval"),hr=Symbol("registerAttempts"),Hi=40,$i=(0,be.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class e extends t{constructor(){super(...arguments),this.neededSearchRequests=[]}willUpdate(n){var s,i,a;super.willUpdate(n),n.has("neededSearchRequests")&&((s=this.stateManager)===null||s===void 0||s.unregisterComponent(this,(i=n.get("neededSearchRequests"))!==null&&i!==void 0?i:[]),(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[hr]=0,this.tryToRegisterToContext(),this[vs]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[hr]>Hi?window.clearInterval(this[vs]):(this[hr]++,this.dispatchEvent(new mr))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Ss([(0,fr.state)()],e.prototype,"stateManager",void 0),Ss([(0,fr.state)({hasChanged:be.hasChanged})],e.prototype,"neededSearchRequests",void 0),e}),As=class extends $i(be.FtLitElementRedux){};var Dt=y(w());function It(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function Mt(t){var e,r;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values,negative:(r=t.valueFilter)===null||r===void 0?void 0:r.negative}}var kt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=([n,s])=>{if(!this.canSendEvent()||!n||!s)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n,s):this.sendDocumentSearchEvent(i,n,s)},this.eventsService=r??new _t,this.resultsWatcher=(0,Dt.watch)(e,n=>[n.results,n.paging],this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.eventsService.convertMapToAnalyticsDocument(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=d.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=d.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r,n){let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ne.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:It(e.metadataFilters),facets:e.metadataFilters.map(i=>Mt(i))}};this.eventsService.sendKhubSearchEvent(s)}sendDocumentSearchEvent(e,r,n){if(e.metadataFilters.find(i=>{var a;return i.key==="ft:publicationId"&&((a=i.valueFilter)===null||a===void 0?void 0:a.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ne.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:n.totalClustersCount},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==K.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ne.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:It(n.metadataFilters),facets:n.metadataFilters.map(a=>Mt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(i)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,s;e.type==K.TOPIC&&(s={tocId:e.topic.tocId,title:e.topic.title});let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:ne.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:It(n.metadataFilters),facets:n.metadataFilters.map(a=>Mt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:s},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(i)}convertDocument(e){switch(e.type){case K.MAP:return{id:e.map.mapId,title:e.map.title,type:ee.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case K.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:ee.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case K.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:ee.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};case K.HTML_PACKAGE:return{id:e.htmlPackage.packageId,title:e.htmlPackage.title,type:ee.HTML_PACKAGE,metadata:e.htmlPackage.metadata};case K.HTML_PACKAGE_PAGE:return{id:e.htmlPackagePage.packageId,title:e.htmlPackagePage.title,type:ee.HTML_PACKAGE,metadata:e.htmlPackagePage.metadata};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r;return(r=(0,Dt.accessResult)(e))===null||r===void 0?void 0:r.originUrl}};var O=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},S=class extends P.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Fe.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new kt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this._appIntegrationInfoReady=!1,this.addStore(d)}render(){return bs.html`
6
6
  <slot @register-ft-search-component=${this.registerComponent} @ft-search-result-click=${this.onResultClicked}
7
7
  @ft-search-result-open-context-menu=${this.onResultContextMenuOpened}></slot>
8
- `}willUpdate(e){super.willUpdate(e),e.has("_appIntegrationInfoReady")&&this._appIntegrationInfoReady&&this.eventManager.initAppInfo(),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("keywordMatch")&&this.stateManager.setKeywordMatch(this.keywordMatch),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams),this.stateManager.addListeners()}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new St(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Et(this.request,this.paging,this.spellcheckAutocorrect))}registerComponent(e){e.stopPropagation();let r=e.composedPath()[0];this.register(r)}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new gt(e))}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}onResultContextMenuOpened(e){this.eventManager.sendResultContextMenuOpenedEvent(e.detail.result,e.detail.rank)}};A.elementDefinitions={};A.styles=gr;_([(0,L.redux)({store:v.name})],A.prototype,"session",void 0);_([(0,G.property)()],A.prototype,"query",void 0);_([(0,G.property)()],A.prototype,"contentLocale",void 0);_([(0,L.numberProperty)()],A.prototype,"pageSize",void 0);_([(0,G.property)({type:Boolean})],A.prototype,"searchInDocumentTitlesOnly",void 0);_([(0,G.property)()],A.prototype,"keywordMatch",void 0);_([(0,G.property)()],A.prototype,"scope",void 0);_([(0,G.property)()],A.prototype,"virtualField",void 0);_([(0,G.property)({type:Boolean})],A.prototype,"ignoreEmptyQuery",void 0);_([(0,L.redux)({store:v.name})],A.prototype,"openExternalDocumentInNewTab",void 0);_([(0,L.jsonProperty)([])],A.prototype,"filters",void 0);_([(0,G.property)()],A.prototype,"sortId",void 0);_([(0,L.jsonProperty)([])],A.prototype,"sort",void 0);_([(0,L.jsonProperty)({})],A.prototype,"otherQueryParams",void 0);_([(0,L.redux)({store:"search"})],A.prototype,"request",void 0);_([(0,L.redux)({store:"search"})],A.prototype,"paging",void 0);_([(0,L.redux)({store:"search",selector:t=>t.spellcheck})],A.prototype,"spellcheckAutocorrect",void 0);_([(0,L.redux)({store:v.name,selector:t=>t.apiIntegrationIdentifier!==void 0&&t.apiIntegrationAppVersion!==void 0})],A.prototype,"_appIntegrationInfoReady",void 0);_([(0,G.property)({attribute:!1})],A.prototype,"searchServiceProvider",void 0);var ps={"ft-search-context":A};(0,fs.customElements)(ps);})();
8
+ `}willUpdate(e){super.willUpdate(e),e.has("_appIntegrationInfoReady")&&this._appIntegrationInfoReady&&this.eventManager.initAppInfo(),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("keywordMatch")&&this.stateManager.setKeywordMatch(this.keywordMatch),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams),this.stateManager.addListeners()}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new Ot(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Rt(this.request,this.paging,this.spellcheckAutocorrect))}registerComponent(e){e.stopPropagation();let r=e.composedPath()[0];this.register(r)}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new Tt(e))}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}onResultContextMenuOpened(e){this.eventManager.sendResultContextMenuOpenedEvent(e.detail.result,e.detail.rank)}};S.elementDefinitions={};S.styles=br;O([(0,P.redux)({store:d.name})],S.prototype,"session",void 0);O([(0,Q.property)()],S.prototype,"query",void 0);O([(0,Q.property)()],S.prototype,"contentLocale",void 0);O([(0,P.numberProperty)()],S.prototype,"pageSize",void 0);O([(0,Q.property)({type:Boolean})],S.prototype,"searchInDocumentTitlesOnly",void 0);O([(0,Q.property)()],S.prototype,"keywordMatch",void 0);O([(0,Q.property)()],S.prototype,"scope",void 0);O([(0,Q.property)()],S.prototype,"virtualField",void 0);O([(0,Q.property)({type:Boolean})],S.prototype,"ignoreEmptyQuery",void 0);O([(0,P.redux)({store:d.name})],S.prototype,"openExternalDocumentInNewTab",void 0);O([(0,P.jsonProperty)([])],S.prototype,"filters",void 0);O([(0,Q.property)()],S.prototype,"sortId",void 0);O([(0,P.jsonProperty)([])],S.prototype,"sort",void 0);O([(0,P.jsonProperty)({})],S.prototype,"otherQueryParams",void 0);O([(0,P.redux)({store:"search"})],S.prototype,"request",void 0);O([(0,P.redux)({store:"search"})],S.prototype,"paging",void 0);O([(0,P.redux)({store:"search",selector:t=>t.spellcheck})],S.prototype,"spellcheckAutocorrect",void 0);O([(0,P.redux)({store:d.name,selector:t=>t.apiIntegrationIdentifier!==void 0&&t.apiIntegrationAppVersion!==void 0})],S.prototype,"_appIntegrationInfoReady",void 0);O([(0,Q.property)({attribute:!1})],S.prototype,"searchServiceProvider",void 0);var _s={"ft-search-context":S};(0,Cs.customElements)(_s);})();
9
9
  /*! Bundled license information:
10
10
 
11
11
  @lit/reactive-element/css-tag.js: