@fluid-topics/ft-search-input 1.3.54 → 1.3.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -540,7 +540,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
540
540
  word-break: break-word;
541
541
  }
542
542
  `;var fc=["top","right","bottom","left"],uc=["start","end"],Da=fc.reduce((t,e)=>t.concat(e,e+"-"+uc[0],e+"-"+uc[1]),[]),hc=Math.min,gc=Math.max;var Mf={left:"right",right:"left",bottom:"top",top:"bottom"},zf={start:"end",end:"start"};function Fa(t,e,r){return gc(t,hc(e,r))}function Gi(t,e){return typeof t=="function"?t(e):t}function _o(t){return t.split("-")[0]}function Lr(t){return t.split("-")[1]}function Ma(t){return t==="x"?"y":"x"}function za(t){return t==="y"?"height":"width"}function ji(t){return["top","bottom"].includes(_o(t))?"y":"x"}function Ua(t){return Ma(ji(t))}function yc(t,e,r){r===void 0&&(r=!1);let i=Lr(t),n=Ua(t),a=za(n),s=n==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=Ba(s)),[s,Ba(s)]}function mc(t){return t.replace(/start|end/g,e=>zf[e])}function Ba(t){return t.replace(/left|right|bottom|top/g,e=>Mf[e])}function Uf(t){return{top:0,right:0,bottom:0,left:0,...t}}function bc(t){return typeof t!="number"?Uf(t):{top:t,right:t,bottom:t,left:t}}function oo(t){let{x:e,y:r,width:i,height:n}=t;return{width:i,height:n,top:r,left:e,right:e+i,bottom:r+n,x:e,y:r}}function xc(t,e,r){let{reference:i,floating:n}=t,a=ji(e),s=Ua(e),c=za(s),p=_o(e),u=a==="y",y=i.x+i.width/2-n.width/2,g=i.y+i.height/2-n.height/2,b=i[c]/2-n[c]/2,C;switch(p){case"top":C={x:y,y:i.y-n.height};break;case"bottom":C={x:y,y:i.y+i.height};break;case"right":C={x:i.x+i.width,y:g};break;case"left":C={x:i.x-n.width,y:g};break;default:C={x:i.x,y:i.y}}switch(Lr(e)){case"start":C[s]-=b*(r&&u?-1:1);break;case"end":C[s]+=b*(r&&u?-1:1);break}return C}var vc=async(t,e,r)=>{let{placement:i="bottom",strategy:n="absolute",middleware:a=[],platform:s}=r,c=a.filter(Boolean),p=await(s.isRTL==null?void 0:s.isRTL(e)),u=await s.getElementRects({reference:t,floating:e,strategy:n}),{x:y,y:g}=xc(u,i,p),b=i,C={},S=0;for(let E=0;E<c.length;E++){let{name:$,fn:T}=c[E],{x:P,y:z,data:Y,reset:X}=await T({x:y,y:g,initialPlacement:i,placement:b,strategy:n,middlewareData:C,rects:u,platform:s,elements:{reference:t,floating:e}});y=P??y,g=z??g,C={...C,[$]:{...C[$],...Y}},X&&S<=50&&(S++,typeof X=="object"&&(X.placement&&(b=X.placement),X.rects&&(u=X.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:n}):X.rects),{x:y,y:g}=xc(u,b,p)),E=-1)}return{x:y,y:g,placement:b,strategy:n,middlewareData:C}};async function Ha(t,e){var r;e===void 0&&(e={});let{x:i,y:n,platform:a,rects:s,elements:c,strategy:p}=t,{boundary:u="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:b=!1,padding:C=0}=Gi(e,t),S=bc(C),$=c[b?g==="floating"?"reference":"floating":g],T=oo(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement($)))==null||r?$:$.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:y,strategy:p})),P=g==="floating"?{x:i,y:n,width:s.floating.width,height:s.floating.height}:s.reference,z=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),Y=await(a.isElement==null?void 0:a.isElement(z))?await(a.getScale==null?void 0:a.getScale(z))||{x:1,y:1}:{x:1,y:1},X=oo(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:P,offsetParent:z,strategy:p}):P);return{top:(T.top-X.top+S.top)/Y.y,bottom:(X.bottom-T.bottom+S.bottom)/Y.y,left:(T.left-X.left+S.left)/Y.x,right:(X.right-T.right+S.right)/Y.x}}function Hf(t,e,r){return(t?[...r.filter(n=>Lr(n)===t),...r.filter(n=>Lr(n)!==t)]:r.filter(n=>_o(n)===n)).filter(n=>t?Lr(n)===t||(e?mc(n)!==n:!1):!0)}var Wa=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,i,n;let{rects:a,middlewareData:s,placement:c,platform:p,elements:u}=e,{crossAxis:y=!1,alignment:g,allowedPlacements:b=Da,autoAlignment:C=!0,...S}=Gi(t,e),E=g!==void 0||b===Da?Hf(g||null,C,b):b,$=await Ha(e,S),T=((r=s.autoPlacement)==null?void 0:r.index)||0,P=E[T];if(P==null)return{};let z=yc(P,a,await(p.isRTL==null?void 0:p.isRTL(u.floating)));if(c!==P)return{reset:{placement:E[0]}};let Y=[$[_o(P)],$[z[0]],$[z[1]]],X=[...((i=s.autoPlacement)==null?void 0:i.overflows)||[],{placement:P,overflows:Y}],nt=E[T+1];if(nt)return{data:{index:T+1,overflows:X},reset:{placement:nt}};let Zt=X.map(He=>{let m=Lr(He.placement);return[He.placement,m&&y?He.overflows.slice(0,2).reduce((v,N)=>v+N,0):He.overflows[0],He.overflows]}).sort((He,m)=>He[1]-m[1]),Yt=((n=Zt.filter(He=>He[2].slice(0,Lr(He[0])?2:3).every(m=>m<=0))[0])==null?void 0:n[0])||Zt[0][0];return Yt!==c?{data:{index:T+1,overflows:X},reset:{placement:Yt}}:{}}}};var Va=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:i,placement:n}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:$=>{let{x:T,y:P}=$;return{x:T,y:P}}},...p}=Gi(t,e),u={x:r,y:i},y=await Ha(e,p),g=ji(_o(n)),b=Ma(g),C=u[b],S=u[g];if(a){let $=b==="y"?"top":"left",T=b==="y"?"bottom":"right",P=C+y[$],z=C-y[T];C=Fa(P,C,z)}if(s){let $=g==="y"?"top":"left",T=g==="y"?"bottom":"right",P=S+y[$],z=S-y[T];S=Fa(P,S,z)}let E=c.fn({...e,[b]:C,[g]:S});return{...E,data:{x:E.x-r,y:E.y-i,enabled:{[b]:a,[g]:s}}}}}};var Ga=Math.min,No=Math.max,ui=Math.round;var mr=t=>({x:t,y:t});function br(t){return Cc(t)?(t.nodeName||"").toLowerCase():"#document"}function st(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function xr(t){var e;return(e=(Cc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Cc(t){return t instanceof Node||t instanceof st(t).Node}function tr(t){return t instanceof Element||t instanceof st(t).Element}function zt(t){return t instanceof HTMLElement||t instanceof st(t).HTMLElement}function Sc(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof st(t).ShadowRoot}function Bo(t){let{overflow:e,overflowX:r,overflowY:i,display:n}=ht(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(n)}function Oc(t){return["table","td","th"].includes(br(t))}function qi(t){let e=Zi(),r=ht(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function wc(t){let e=io(t);for(;zt(e)&&!fi(e);){if(qi(e))return e;e=io(e)}return null}function Zi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fi(t){return["html","body","#document"].includes(br(t))}function ht(t){return st(t).getComputedStyle(t)}function hi(t){return tr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function io(t){if(br(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Sc(t)&&t.host||xr(t);return Sc(e)?e.host:e}function Ec(t){let e=io(t);return fi(e)?t.ownerDocument?t.ownerDocument.body:t.body:zt(e)&&Bo(e)?e:Ec(e)}function Ki(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);let n=Ec(t),a=n===((i=t.ownerDocument)==null?void 0:i.body),s=st(n);return a?e.concat(s,s.visualViewport||[],Bo(n)?n:[],s.frameElement&&r?Ki(s.frameElement):[]):e.concat(n,Ki(n,[],r))}function Lc(t){let e=ht(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=zt(t),a=n?t.offsetWidth:r,s=n?t.offsetHeight:i,c=ui(r)!==a||ui(i)!==s;return c&&(r=a,i=s),{width:r,height:i,$:c}}function Ic(t){return tr(t)?t:t.contextElement}function Do(t){let e=Ic(t);if(!zt(e))return mr(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:a}=Lc(e),s=(a?ui(r.width):r.width)/i,c=(a?ui(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var Gf=mr(0);function kc(t){let e=st(t);return!Zi()||!e.visualViewport?Gf:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jf(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==st(t)?!1:e}function gi(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);let n=t.getBoundingClientRect(),a=Ic(t),s=mr(1);e&&(i?tr(i)&&(s=Do(i)):s=Do(t));let c=jf(a,r,i)?kc(a):mr(0),p=(n.left+c.x)/s.x,u=(n.top+c.y)/s.y,y=n.width/s.x,g=n.height/s.y;if(a){let b=st(a),C=i&&tr(i)?st(i):i,S=b.frameElement;for(;S&&i&&C!==b;){let E=Do(S),$=S.getBoundingClientRect(),T=ht(S),P=$.left+(S.clientLeft+parseFloat(T.paddingLeft))*E.x,z=$.top+(S.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,u*=E.y,y*=E.x,g*=E.y,p+=P,u+=z,S=st(S).frameElement}}return oo({width:y,height:g,x:p,y:u})}function Kf(t){let{rect:e,offsetParent:r,strategy:i}=t,n=zt(r),a=xr(r);if(r===a)return e;let s={scrollLeft:0,scrollTop:0},c=mr(1),p=mr(0);if((n||!n&&i!=="fixed")&&((br(r)!=="body"||Bo(a))&&(s=hi(r)),zt(r))){let u=gi(r);c=Do(r),p.x=u.x+r.clientLeft,p.y=u.y+r.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-s.scrollLeft*c.x+p.x,y:e.y*c.y-s.scrollTop*c.y+p.y}}function qf(t){return Array.from(t.getClientRects())}function Tc(t){return gi(xr(t)).left+hi(t).scrollLeft}function Zf(t){let e=xr(t),r=hi(t),i=t.ownerDocument.body,n=No(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=No(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+Tc(t),c=-r.scrollTop;return ht(i).direction==="rtl"&&(s+=No(e.clientWidth,i.clientWidth)-n),{width:n,height:a,x:s,y:c}}function Yf(t,e){let r=st(t),i=xr(t),n=r.visualViewport,a=i.clientWidth,s=i.clientHeight,c=0,p=0;if(n){a=n.width,s=n.height;let u=Zi();(!u||u&&e==="fixed")&&(c=n.offsetLeft,p=n.offsetTop)}return{width:a,height:s,x:c,y:p}}function Xf(t,e){let r=gi(t,!0,e==="fixed"),i=r.top+t.clientTop,n=r.left+t.clientLeft,a=zt(t)?Do(t):mr(1),s=t.clientWidth*a.x,c=t.clientHeight*a.y,p=n*a.x,u=i*a.y;return{width:s,height:c,x:p,y:u}}function Ac(t,e,r){let i;if(e==="viewport")i=Yf(t,r);else if(e==="document")i=Zf(xr(t));else if(tr(e))i=Xf(e,r);else{let n=kc(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return oo(i)}function $c(t,e){let r=io(t);return r===e||!tr(r)||fi(r)?!1:ht(r).position==="fixed"||$c(r,e)}function Qf(t,e){let r=e.get(t);if(r)return r;let i=Ki(t,[],!1).filter(c=>tr(c)&&br(c)!=="body"),n=null,a=ht(t).position==="fixed",s=a?io(t):t;for(;tr(s)&&!fi(s);){let c=ht(s),p=qi(s);!p&&c.position==="fixed"&&(n=null),(a?!p&&!n:!p&&c.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Bo(s)&&!p&&$c(t,s))?i=i.filter(y=>y!==s):n=c,s=io(s)}return e.set(t,i),i}function Jf(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[...r==="clippingAncestors"?Qf(e,this._c):[].concat(r),i],c=s[0],p=s.reduce((u,y)=>{let g=Ac(e,y,n);return u.top=No(g.top,u.top),u.right=Ga(g.right,u.right),u.bottom=Ga(g.bottom,u.bottom),u.left=No(g.left,u.left),u},Ac(e,c,n));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function eh(t){return Lc(t)}function th(t,e,r){let i=zt(e),n=xr(e),a=r==="fixed",s=gi(t,!0,a,e),c={scrollLeft:0,scrollTop:0},p=mr(0);if(i||!i&&!a)if((br(e)!=="body"||Bo(n))&&(c=hi(e)),i){let u=gi(e,!0,a,e);p.x=u.x+e.clientLeft,p.y=u.y+e.clientTop}else n&&(p.x=Tc(n));return{x:s.left+c.scrollLeft-p.x,y:s.top+c.scrollTop-p.y,width:s.width,height:s.height}}function Rc(t,e){return!zt(t)||ht(t).position==="fixed"?null:e?e(t):t.offsetParent}function Pc(t,e){let r=st(t);if(!zt(t))return r;let i=Rc(t,e);for(;i&&Oc(i)&&ht(i).position==="static";)i=Rc(i,e);return i&&(br(i)==="html"||br(i)==="body"&&ht(i).position==="static"&&!qi(i))?r:i||wc(t)||r}var rh=async function(t){let{reference:e,floating:r,strategy:i}=t,n=this.getOffsetParent||Pc,a=this.getDimensions;return{reference:th(e,await n(r),i),floating:{x:0,y:0,...await a(r)}}};function oh(t){return ht(t).direction==="rtl"}var Yi={convertOffsetParentRelativeRectToViewportRelativeRect:Kf,getDocumentElement:xr,getClippingRect:Jf,getOffsetParent:Pc,getElementRects:rh,getClientRects:qf,getDimensions:eh,getScale:Do,isElement:tr,isRTL:oh};var _c=(t,e,r)=>{let i=new Map,n={platform:Yi,...r},a={...n.platform,_c:i};return vc(t,e,{...n,platform:a})};function Nc(t){return ih(t)}function ja(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function ih(t){for(let e=t;e;e=ja(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=ja(t);e;e=ja(e)){if(!(e instanceof Element))continue;let r=getComputedStyle(e);if(r.display!=="contents"&&(r.position!=="static"||r.filter!=="none"||e.tagName==="BODY"))return e}return null}async function Bc(t,e,r){return _c(t,e,{platform:{...Yi,getOffsetParent:i=>Yi.getOffsetParent(i,Nc)},middleware:[Va({crossAxis:!0}),Wa({allowedPlacements:[r]})]})}var Zo=f(O());var xp=f(O());var Od=f(L()),Ge=f(J()),Ut=f(O());var Dc=f(L());var Fc=Dc.css`
543
- `;var Xi=f(O()),nh="ft-app-info",no=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};no.eventName="authentication-change";var ah={session:(t,e)=>{(0,Xi.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>k.dispatchEvent(new no(e.payload)),0))}},k=Xi.FtReduxStore.get({name:nh,reducers:ah,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Ka=f(O());var ao=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=k.getState(),n=e??i;if(r&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,n,!0)}static await(e){return new Promise(r=>{let i=t.get(e);if(i)r(i);else{let n=k.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var Qi=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ao.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ao.await()}};var lt=class extends Qi{constructor(e=!0,r){var i;super(r),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[p])=>c.localeCompare(p)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Ka.CacheRegistry,this.cache=e?n.commonCache:new Ka.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,i)=>0|31*r+i.charCodeAt(0),0))}};var Ji=class extends lt{async listMyBookmarks(){let e=k.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var qa=class{addCommand(e,r=!1){k.commands.add(e,r)}consumeCommand(e){return k.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new qa;var Et=f(O());var Mc,Fo=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},sh=Symbol("clearAfterUnitTest"),en=class extends(0,Et.withEventBus)(lt){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Mc]=()=>{this.defaultMessages={},this.cache=new Et.CacheRegistry,this.listeners={}},this.currentUiLocale=k.getState().uiLocale,k.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=k.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 i;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...r};(0,Et.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,i;return this.fetchContext(e),(i=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,r){let i=e.toLowerCase();return this.resolveContext(i)[r]}resolveMessage(e,r,...i){var n;let a=e.toLowerCase(),s=this.resolveContext(a);return new Et.ParametrizedLabelResolver((n=this.defaultMessages[a])!==null&&n!==void 0?n:{},s).resolve(r,...i)}async fetchContext(e){let r=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(n){!(n instanceof Et.CanceledPromiseError)&&r&&console.error(n)}return i}subscribe(e,r){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(r),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Fo({loadedContexts:e})),this.dispatchEvent(new Fo({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Fo({loadedContexts:[e]})),this.dispatchEvent(new Fo({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,Et.delay)(0).then(()=>i()).catch(()=>null)))}};Mc=sh;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends en{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends en{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Mo=window.FluidTopicsI18nService,tn=window.FluidTopicsCustomI18nService;var zc=f(O()),Za=class{highlightHtml(e,r,i){(0,zc.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new Za;var ch=f(Hc(),1);var Wc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Wc||(Wc={}));var Vc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Vc||(Vc={}));var Gc;(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"})(Gc||(Gc={}));var jc;(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"})(jc||(jc={}));var Kc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Kc||(Kc={}));var qc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(qc||(qc={}));var Zc;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",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__DISPLAY="TOPIC__DISPLAY",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"})(Zc||(Zc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(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"})(Xc||(Xc={}));var Qc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Qc||(Qc={}));var Jc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Jc||(Jc={}));var ed;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(ed||(ed={}));var td;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(td||(td={}));var rd;(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"})(rd||(rd={}));var Ya;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Ya||(Ya={}));var od;(function(t){t.ASC="ASC",t.DESC="DESC"})(od||(od={}));var id;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(id||(id={}));var Xa;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Xa||(Xa={}));var nd;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(nd||(nd={}));var ad;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ad||(ad={}));var sd;(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"})(sd||(sd={}));var ld;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ld||(ld={}));var cd;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(cd||(cd={}));var Qa;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Qa||(Qa={}));var dd;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(dd||(dd={}));var Pe;(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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Pe||(Pe={}));var At;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(At||(At={}));var pd;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(pd||(pd={}));var ud;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(ud||(ud={}));var fd;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(fd||(fd={}));var hd;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(hd||(hd={}));var gd;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(gd||(gd={}));var lh={[Pe.PERSONAL_BOOK_SHARE_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.HTML_EXPORT_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.PDF_EXPORT_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.KHUB_ADMIN]:[Pe.CONTENT_PUBLISHER],[Pe.ADMIN]:[Pe.KHUB_ADMIN,Pe.USERS_ADMIN,Pe.PORTAL_ADMIN],[Pe.GENERATIVE_AI_EXPORT_USER]:[Pe.GENERATIVE_AI_USER]};function yd(t,e){return t===e||(lh[t]??[]).some(r=>yd(r,e))}function md(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(i=>yd(i,e))}var nn=class extends lt{async listMySearches(){let{session:e}=k.getState();return md(e,Pe.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var bd=f(O());var Ja=class{isDate(e){var r,i,n,a;return(a=(n=((i=(r=k.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&i!==void 0?i:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,r){var i,n,a;return bd.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:k.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ja;var xd=f(O());var vr=class{static get(e,r){var i,n;let a=k.getState(),{lang:s,region:c}=(n=(i=a.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&n!==void 0?n:{lang:"en",region:"US"};return new xd.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${c}`)}};var es=class{urlToSearchRequest(e){return vr.get().parse(e)}searchRequestToUrl(e){return vr.get().serialize(e)}};window.FluidTopicsUrlService=new es;var kr=f(O());var so=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};so.eventName="change";var ts=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))}},vd=new ts;var an=class t extends kr.WithEventBus{static build(){return new t(window.history,vd,()=>window.location,!1)}constructor(e,r,i,n){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,r=!1){let i=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,kr.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new so(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[a,s,c])=>{let p=r(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};i.apply(n,[u,s,c]),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 i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(i)}addHistoryChangeListener(e){this.addEventListener(so.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(so.eventName,e)}currentItem(){return(0,kr.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,kr.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,kr.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 i=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!i)return e;let n=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,i);)this.hasState(a)&&(n=a),a++;return n}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 i;if(!this.hasState(e))return!1;let n=r??this.currentState.majorStateId,a=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return a==null||a!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=an.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var Sd=k;function Cd(t,e){var r;return Sd.getState().authenticationRequired&&!(!((r=Sd.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var _e=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ue=class extends Ut.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ao.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Ut.CacheRegistry,this.cleanSessionDebouncer=new Ut.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Od.html`
543
+ `;var Xi=f(O()),nh="ft-app-info",no=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};no.eventName="authentication-change";var ah={session:(t,e)=>{(0,Xi.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>k.dispatchEvent(new no(e.payload)),0))}},k=Xi.FtReduxStore.get({name:nh,reducers:ah,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Ka=f(O());var ao=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=k.getState(),n=e??i;if(r&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,n,!0)}static await(e){return new Promise(r=>{let i=t.get(e);if(i)r(i);else{let n=k.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var Qi=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ao.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ao.await()}};var lt=class extends Qi{constructor(e=!0,r){var i;super(r),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[p])=>c.localeCompare(p)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Ka.CacheRegistry,this.cache=e?n.commonCache:new Ka.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,i)=>0|31*r+i.charCodeAt(0),0))}};var Ji=class extends lt{async listMyBookmarks(){let e=k.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var qa=class{addCommand(e,r=!1){k.commands.add(e,r)}consumeCommand(e){return k.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new qa;var Et=f(O());var Mc,Fo=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},sh=Symbol("clearAfterUnitTest"),en=class extends(0,Et.withEventBus)(lt){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Mc]=()=>{this.defaultMessages={},this.cache=new Et.CacheRegistry,this.listeners={}},this.currentUiLocale=k.getState().uiLocale,k.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=k.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 i;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...r};(0,Et.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,i;return this.fetchContext(e),(i=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,r){let i=e.toLowerCase();return this.resolveContext(i)[r]}resolveMessage(e,r,...i){var n;let a=e.toLowerCase(),s=this.resolveContext(a);return new Et.ParametrizedLabelResolver((n=this.defaultMessages[a])!==null&&n!==void 0?n:{},s).resolve(r,...i)}async fetchContext(e){let r=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(n){!(n instanceof Et.CanceledPromiseError)&&r&&console.error(n)}return i}subscribe(e,r){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(r),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Fo({loadedContexts:e})),this.dispatchEvent(new Fo({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Fo({loadedContexts:[e]})),this.dispatchEvent(new Fo({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,Et.delay)(0).then(()=>i()).catch(()=>null)))}};Mc=sh;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends en{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends en{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Mo=window.FluidTopicsI18nService,tn=window.FluidTopicsCustomI18nService;var zc=f(O()),Za=class{highlightHtml(e,r,i){(0,zc.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new Za;var ch=f(Hc(),1);var Wc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Wc||(Wc={}));var Vc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Vc||(Vc={}));var Gc;(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"})(Gc||(Gc={}));var jc;(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"})(jc||(jc={}));var Kc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Kc||(Kc={}));var qc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(qc||(qc={}));var Zc;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",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__DISPLAY="TOPIC__DISPLAY",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"})(Zc||(Zc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(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"})(Xc||(Xc={}));var Qc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Qc||(Qc={}));var Jc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Jc||(Jc={}));var ed;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(ed||(ed={}));var td;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(td||(td={}));var rd;(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"})(rd||(rd={}));var Ya;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Ya||(Ya={}));var od;(function(t){t.ASC="ASC",t.DESC="DESC"})(od||(od={}));var id;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(id||(id={}));var Xa;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Xa||(Xa={}));var nd;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(nd||(nd={}));var ad;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ad||(ad={}));var sd;(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"})(sd||(sd={}));var ld;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ld||(ld={}));var cd;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(cd||(cd={}));var Qa;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Qa||(Qa={}));var dd;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(dd||(dd={}));var Pe;(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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Pe||(Pe={}));var At;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(At||(At={}));var pd;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(pd||(pd={}));var ud;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(ud||(ud={}));var fd;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(fd||(fd={}));var hd;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(hd||(hd={}));var gd;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(gd||(gd={}));var yd;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(yd||(yd={}));var lh={[Pe.PERSONAL_BOOK_SHARE_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.HTML_EXPORT_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.PDF_EXPORT_USER]:[Pe.PERSONAL_BOOK_USER],[Pe.KHUB_ADMIN]:[Pe.CONTENT_PUBLISHER],[Pe.ADMIN]:[Pe.KHUB_ADMIN,Pe.USERS_ADMIN,Pe.PORTAL_ADMIN],[Pe.GENERATIVE_AI_EXPORT_USER]:[Pe.GENERATIVE_AI_USER]};function md(t,e){return t===e||(lh[t]??[]).some(r=>md(r,e))}function bd(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(i=>md(i,e))}var nn=class extends lt{async listMySearches(){let{session:e}=k.getState();return bd(e,Pe.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var xd=f(O());var Ja=class{isDate(e){var r,i,n,a;return(a=(n=((i=(r=k.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&i!==void 0?i:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,r){var i,n,a;return xd.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:k.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ja;var vd=f(O());var vr=class{static get(e,r){var i,n;let a=k.getState(),{lang:s,region:c}=(n=(i=a.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&n!==void 0?n:{lang:"en",region:"US"};return new vd.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${c}`)}};var es=class{urlToSearchRequest(e){return vr.get().parse(e)}searchRequestToUrl(e){return vr.get().serialize(e)}};window.FluidTopicsUrlService=new es;var kr=f(O());var so=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};so.eventName="change";var ts=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))}},Sd=new ts;var an=class t extends kr.WithEventBus{static build(){return new t(window.history,Sd,()=>window.location,!1)}constructor(e,r,i,n){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,r=!1){let i=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,kr.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new so(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[a,s,c])=>{let p=r(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};i.apply(n,[u,s,c]),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 i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(i)}addHistoryChangeListener(e){this.addEventListener(so.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(so.eventName,e)}currentItem(){return(0,kr.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,kr.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,kr.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 i=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!i)return e;let n=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,i);)this.hasState(a)&&(n=a),a++;return n}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 i;if(!this.hasState(e))return!1;let n=r??this.currentState.majorStateId,a=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return a==null||a!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=an.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});function Cd(t,e){let{authenticationRequired:r,session:i}=k.getState();return r&&!i?.sessionAuthenticated?Promise.resolve(e):t()}var _e=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ue=class extends Ut.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ao.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Ut.CacheRegistry,this.cleanSessionDebouncer=new Ut.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Od.html`
544
544
  <slot></slot>
545
545
  `}connectedCallback(){super.connectedCallback(),k.addEventListener(no.eventName,this.reloadConfiguration)}disconnectedCallback(){k.addEventListener(no.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,i,n,a,s,c,p;super.update(e),e.has("baseUrl")&&(k.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&k.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&k.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&k.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&k.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&k.actions.noCustom(this.noCustom),e.has("editorMode")&&k.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&k.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&k.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>Mo.addContext(u)),e.has("openExternalDocumentInNewTab")&&k.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&k.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&k.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(k.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),k.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),k.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&k.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&k.actions.availableContentLocales((p=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&p!==void 0?p:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Cd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};ue.elementDefinitions={};ue.styles=Fc;_e([(0,Ge.property)()],ue.prototype,"baseUrl",void 0);_e([(0,Ge.property)()],ue.prototype,"apiIntegrationIdentifier",void 0);_e([(0,Ge.property)()],ue.prototype,"apiIntegrationAppVersion",void 0);_e([(0,Ge.property)()],ue.prototype,"uiLocale",void 0);_e([(0,Ut.jsonProperty)(null)],ue.prototype,"availableUiLocales",void 0);_e([(0,Ut.jsonProperty)(null)],ue.prototype,"metadataConfiguration",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"editorMode",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"noCustom",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"openExternalDocumentInNewTab",void 0);_e([(0,Ge.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],ue.prototype,"noCustomComponent",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"withManualResources",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"navigatorOnline",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"forcedOffline",void 0);_e([(0,Ge.property)({type:Object})],ue.prototype,"apiProvider",void 0);_e([(0,Ge.property)({type:Boolean})],ue.prototype,"authenticationRequired",void 0);_e([(0,Ut.jsonProperty)([])],ue.prototype,"messageContexts",void 0);_e([(0,Ut.jsonProperty)(void 0)],ue.prototype,"session",void 0);_e([(0,Ge.state)()],ue.prototype,"localesConfiguration",void 0);_e([(0,Ge.state)()],ue.prototype,"availableContentLocales",void 0);var As=f(J());function dh(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,i,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(!sn(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!sn(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[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 a=s=>Object.keys(s).filter(c=>s[c]!=null);if(n=a(t),r=n.length,r!==a(e).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[i]))return!1;for(i=r;i--!==0;){let s=n[i];if(!sn(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function sn(t,e){try{return dh(t,e)}catch{return!1}}function yi(t,e){return!sn(t,e)}function ln(t,e){let r=i=>i[t]===!0;return i=>{if(r(i))return i;let n=e(i);return n[t]=!0,n}}var wd=f(J(),1);var rs=t=>{let e=t??{};return(r,i)=>{var n;let a={hasChanged:yi,attribute:!1,...e};(0,wd.property)(a)(r,i);let s=r.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(i,{selector:(n=e.selector)!==null&&n!==void 0?n:c=>c[i],store:e.store})}};var cn=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(i=>i.type===e);return r&&(this.queue=this.queue.filter(i=>i!==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 lo=f(J(),1);var Ed=f(J(),1);function Ad(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Ed.property)({type:Object,converter:{fromAttribute:i=>{if(i==null)return r();try{return JSON.parse(i)}catch{return r()}},toAttribute:i=>JSON.stringify(i)},hasChanged:yi,...e??{}})}var dn=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,i)=>{this.resolvePromise=r,this.rejectPromise=i})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let i=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let s of i)try{await s()}catch(c){n(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ld=f(L(),1);var pn=globalThis,ph=pn.ShadowRoot&&(pn.ShadyCSS===void 0||pn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,US=Symbol();var Rd=(t,e)=>{if(ph)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=pn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}};var un=class extends Ld.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([n,a])=>e.registry.define(n,a)));let r={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(r);return Rd(i,e.elementStyles),i}};function Id(t,e,...r){var i;let n=t.querySelector(e);for(let a of r)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(a);return n}var Ho=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Pd,kd=Symbol("constructorPrototype"),Td=Symbol("constructorName"),_d=Symbol("exportpartsDebouncer"),$d=Symbol("dynamicDependenciesLoaded"),Uo=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Uo.eventName="exportparts-updated";var rr=class extends un{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Pd]=new dn(5),this.scheduleExportpartsUpdate=()=>{var e,r,i;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(i=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&i!==void 0&&i)&&this[_d].run(()=>{var n,a;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Td]=this.constructor.name,this[kd]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Td]&&Object.setPrototypeOf(this,this[kd])}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(i){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",i)}let r=this.constructor;r[$d]||(r[$d]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Uo.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Uo.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 Uo)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let a=[...n??[],i];r=Id(this.shadowRoot,...a)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,i,n;if(((i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&i!==void 0?i:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}setExportpartsAttribute(e){var r,i,n,a,s,c;let p=b=>b!=null&&b.trim().length>0,u=e.filter(p).map(b=>b.trim());if(u.length===0){this.exportparts=void 0;return}let y=new Set;for(let b of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let C=(a=(n=b.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],S=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map($=>$.split(":")[1]))!==null&&c!==void 0?c:[],E=[...C,...S].filter(p).map($=>$.trim());for(let $ of E)y.add($)}if(y.size===0){this.exportparts=void 0;return}let g=[...y.values()].flatMap(b=>u.map(C=>`${b}:${C}--${b}`));this.exportparts=[...this.part,...g].join(", ")}};Pd=_d;Ho([(0,lo.property)()],rr.prototype,"exportpartsPrefix",void 0);Ho([Ad([])],rr.prototype,"exportpartsPrefixes",void 0);Ho([(0,lo.property)({reflect:!0})],rr.prototype,"exportparts",void 0);Ho([(0,lo.property)()],rr.prototype,"customStylesheet",void 0);Ho([(0,lo.property)()],rr.prototype,"elementToFocus",void 0);Ho([(0,lo.state)()],rr.prototype,"useAdoptedStyleSheets",void 0);function fn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var mi=Symbol("internalReduxEventsUnsubscribers"),Tr=Symbol("internalStoresUnsubscribers"),co=Symbol("internalStores"),uh=ln(Symbol("withRedux"),function(t){var e,r,i;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[i]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[co].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[co].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[co].get(s)}addStore(s,c){var p;c=(p=c??s.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[co].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[co].delete(c)}setupStores(){this.unsubscribeFromStores(),this[co].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let p=this.constructor.getPropertyOptions(c);if(!p?.attribute||!this.hasAttribute(typeof p?.attribute=="string"?p.attribute:c)){let u=this.getStore(s.store);u&&(s.store?this[Tr].has(s.store):this[Tr].size>0)&&(this[c]=s.selector(u.getState(),this))}})}subscribeToStore(s,c){var p;this[Tr].set(s,c.subscribe(()=>this.updateFromStores())),this[mi].set(s,[]),fn(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,y)=>{if(typeof this[y]=="function"&&(!u.store||c.name===u.store)){let g=b=>this[y](b);c.addEventListener(u.eventName,g),this[mi].get(s).push(()=>c.removeEventListener(u.eventName,g))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Tr].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[Tr].has(s)&&this[Tr].get(s)(),this[Tr].delete(s),(c=this[mi].get(s))===null||c===void 0||c.forEach(p=>p()),this[mi].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Tr,r=co,i=mi,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Nd=class extends uh(rr){};function Rt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];if(0)var n,a;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Sr(t){return!!t&&!!t[me]}function Ht(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var i=Object.getPrototypeOf(r);if(i===null)return!0;var n=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===vh}(t)||Array.isArray(t)||!!t[Hd]||!!(!((e=t.constructor)===null||e===void 0)&&e[Hd])||ps(t)||us(t))}function po(t,e,r){r===void 0&&(r=!1),Go(t)===0?(r?Object.keys:Vo)(t).forEach(function(i){r&&typeof i=="symbol"||e(i,t[i],t)}):t.forEach(function(i,n){return e(n,i,t)})}function Go(t){var e=t[me];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ps(t)?2:us(t)?3:0}function Wo(t,e){return Go(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function fh(t,e){return Go(t)===2?t.get(e):t[e]}function Wd(t,e,r){var i=Go(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function Vd(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ps(t){return bh&&t instanceof Map}function us(t){return xh&&t instanceof Set}function $r(t){return t.o||t.t}function fs(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Kd(t);delete e[me];for(var r=Vo(e),i=0;i<r.length;i++){var n=r[i],a=e[n];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[n]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function hs(t,e){return e===void 0&&(e=!1),gs(t)||Sr(t)||!Ht(t)||(Go(t)>1&&(t.set=t.add=t.clear=t.delete=hh),Object.freeze(t),e&&po(t,function(r,i){return hs(i,!0)},!0)),t}function hh(){Rt(2)}function gs(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function or(t){var e=ds[t];return e||Rt(18,t),e}function gh(t,e){ds[t]||(ds[t]=e)}function ss(){return xi}function os(t,e){e&&(or("Patches"),t.u=[],t.s=[],t.v=e)}function hn(t){ls(t),t.p.forEach(yh),t.p=null}function ls(t){t===xi&&(xi=t.l)}function Bd(t){return xi={p:[],l:xi,h:t,m:!0,_:0}}function yh(t){var e=t[me];e.i===0||e.i===1?e.j():e.g=!0}function is(t,e){e._=e.p.length;var r=e.p[0],i=t!==void 0&&t!==r;return e.h.O||or("ES5").S(e,t,i),i?(r[me].P&&(hn(e),Rt(4)),Ht(t)&&(t=gn(e,t),e.l||yn(e,t)),e.u&&or("Patches").M(r[me].t,t,e.u,e.s)):t=gn(e,r,[]),hn(e),e.u&&e.v(e.u,e.s),t!==jd?t:void 0}function gn(t,e,r){if(gs(e))return e;var i=e[me];if(!i)return po(e,function(c,p){return Dd(t,i,e,c,p,r)},!0),e;if(i.A!==t)return e;if(!i.P)return yn(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=fs(i.k):i.o,a=n,s=!1;i.i===3&&(a=new Set(n),n.clear(),s=!0),po(a,function(c,p){return Dd(t,i,n,c,p,r,s)}),yn(t,n,!1),r&&t.u&&or("Patches").N(i,r,t.u,t.s)}return i.o}function Dd(t,e,r,i,n,a,s){if(Sr(n)){var c=gn(t,n,a&&e&&e.i!==3&&!Wo(e.R,i)?a.concat(i):void 0);if(Wd(r,i,c),!Sr(c))return;t.m=!1}else s&&r.add(n);if(Ht(n)&&!gs(n)){if(!t.h.D&&t._<1)return;gn(t,n),e&&e.A.l||yn(t,n)}}function yn(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&hs(e,r)}function ns(t,e){var r=t[me];return(r?$r(r):t)[e]}function Fd(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Object.getPrototypeOf(r)}}function Pr(t){t.P||(t.P=!0,t.l&&Pr(t.l))}function as(t){t.o||(t.o=fs(t.t))}function cs(t,e,r){var i=ps(e)?or("MapSet").F(e,r):us(e)?or("MapSet").T(e,r):t.O?function(n,a){var s=Array.isArray(n),c={i:s?1:0,A:a?a.A:ss(),P:!1,I:!1,R:{},l:a,t:n,k:null,o:null,j:null,C:!1},p=c,u=vi;s&&(p=[c],u=bi);var y=Proxy.revocable(p,u),g=y.revoke,b=y.proxy;return c.k=b,c.j=g,b}(e,r):or("ES5").J(e,r);return(r?r.A:ss()).p.push(i),i}function mh(t){return Sr(t)||Rt(22,t),function e(r){if(!Ht(r))return r;var i,n=r[me],a=Go(r);if(n){if(!n.P&&(n.i<4||!or("ES5").K(n)))return n.t;n.I=!0,i=Md(r,a),n.I=!1}else i=Md(r,a);return po(i,function(s,c){n&&fh(n.t,s)===c||Wd(i,s,e(c))}),a===3?new Set(i):i}(t)}function Md(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return fs(t)}function Gd(){function t(s,c){var p=a[s];return p?p.enumerable=c:a[s]=p={configurable:!0,enumerable:c,get:function(){var u=this[me];return vi.get(u,s)},set:function(u){var y=this[me];vi.set(y,s,u)}},p}function e(s){for(var c=s.length-1;c>=0;c--){var p=s[c][me];if(!p.P)switch(p.i){case 5:i(p)&&Pr(p);break;case 4:r(p)&&Pr(p)}}}function r(s){for(var c=s.t,p=s.k,u=Vo(p),y=u.length-1;y>=0;y--){var g=u[y];if(g!==me){var b=c[g];if(b===void 0&&!Wo(c,g))return!0;var C=p[g],S=C&&C[me];if(S?S.t!==b:!Vd(C,b))return!0}}var E=!!c[me];return u.length!==Vo(c).length+(E?0:1)}function i(s){var c=s.k;if(c.length!==s.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function n(s){s.g&&Rt(3,JSON.stringify($r(s)))}var a={};gh("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(g,b){if(g){for(var C=Array(b.length),S=0;S<b.length;S++)Object.defineProperty(C,""+S,t(S,!0));return C}var E=Kd(b);delete E[me];for(var $=Vo(E),T=0;T<$.length;T++){var P=$[T];E[P]=t(P,g||!!E[P].enumerable)}return Object.create(Object.getPrototypeOf(b),E)}(p,s),y={i:p?5:4,A:c?c.A:ss(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,me,{value:y,writable:!0}),u},S:function(s,c,p){p?Sr(c)&&c[me].A===s&&e(s.p):(s.u&&function u(y){if(y&&typeof y=="object"){var g=y[me];if(g){var b=g.t,C=g.k,S=g.R,E=g.i;if(E===4)po(C,function(Y){Y!==me&&(b[Y]!==void 0||Wo(b,Y)?S[Y]||u(C[Y]):(S[Y]=!0,Pr(g)))}),po(b,function(Y){C[Y]!==void 0||Wo(C,Y)||(S[Y]=!1,Pr(g))});else if(E===5){if(i(g)&&(Pr(g),S.length=!0),C.length<b.length)for(var $=C.length;$<b.length;$++)S[$]=!1;else for(var T=b.length;T<C.length;T++)S[T]=!0;for(var P=Math.min(C.length,b.length),z=0;z<P;z++)C.hasOwnProperty(z)||(S[z]=!0),S[z]===void 0&&u(C[z])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):i(s)}})}var zd,xi,ys=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",bh=typeof Map<"u",xh=typeof Set<"u",Ud=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",jd=ys?Symbol.for("immer-nothing"):((zd={})["immer-nothing"]=!0,zd),Hd=ys?Symbol.for("immer-draftable"):"__$immer_draftable",me=ys?Symbol.for("immer-state"):"__$immer_state";var vh=""+Object.prototype.constructor,Vo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Kd=Object.getOwnPropertyDescriptors||function(t){var e={};return Vo(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},ds={},vi={get:function(t,e){if(e===me)return t;var r=$r(t);if(!Wo(r,e))return function(n,a,s){var c,p=Fd(a,s);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(n.k):void 0}(t,r,e);var i=r[e];return t.I||!Ht(i)?i:i===ns(t.t,e)?(as(t),t.o[e]=cs(t.A.h,i,t)):i},has:function(t,e){return e in $r(t)},ownKeys:function(t){return Reflect.ownKeys($r(t))},set:function(t,e,r){var i=Fd($r(t),e);if(i?.set)return i.set.call(t.k,r),!0;if(!t.P){var n=ns($r(t),e),a=n?.[me];if(a&&a.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Vd(r,n)&&(r!==void 0||Wo(t.t,e)))return!0;as(t),Pr(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 ns(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,as(t),Pr(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=$r(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty:function(){Rt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Rt(12)}},bi={};po(vi,function(t,e){bi[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),bi.deleteProperty=function(t,e){return bi.set.call(this,t,e,void 0)},bi.set=function(t,e,r){return vi.set.call(this,t[0],e,r,t[0])};var Sh=function(){function t(r){var i=this;this.O=Ud,this.D=!0,this.produce=function(n,a,s){if(typeof n=="function"&&typeof a!="function"){var c=a;a=n;var p=i;return function(E){var $=this;E===void 0&&(E=c);for(var T=arguments.length,P=Array(T>1?T-1:0),z=1;z<T;z++)P[z-1]=arguments[z];return p.produce(E,function(Y){var X;return(X=a).call.apply(X,[$,Y].concat(P))})}}var u;if(typeof a!="function"&&Rt(6),s!==void 0&&typeof s!="function"&&Rt(7),Ht(n)){var y=Bd(i),g=cs(i,n,void 0),b=!0;try{u=a(g),b=!1}finally{b?hn(y):ls(y)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(E){return os(y,s),is(E,y)},function(E){throw hn(y),E}):(os(y,s),is(u,y))}if(!n||typeof n!="object"){if((u=a(n))===void 0&&(u=n),u===jd&&(u=void 0),i.D&&hs(u,!0),s){var C=[],S=[];or("Patches").M(n,u,C,S),s(C,S)}return u}Rt(21,n)},this.produceWithPatches=function(n,a){if(typeof n=="function")return function(u){for(var y=arguments.length,g=Array(y>1?y-1:0),b=1;b<y;b++)g[b-1]=arguments[b];return i.produceWithPatches(u,function(C){return n.apply(void 0,[C].concat(g))})};var s,c,p=i.produce(n,a,function(u,y){s=u,c=y});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,s,c]}):[p,s,c]},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){Ht(r)||Rt(8),Sr(r)&&(r=mh(r));var i=Bd(this),n=cs(this,r,void 0);return n[me].C=!0,ls(i),n},e.finishDraft=function(r,i){var n=r&&r[me],a=n.A;return os(a,i),is(void 0,a)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Ud&&Rt(20),this.O=r},e.applyPatches=function(r,i){var n;for(n=i.length-1;n>=0;n--){var a=i[n];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}n>-1&&(i=i.slice(n+1));var s=or("Patches").$;return Sr(r)?s(r,i):this.produce(r,function(c){return s(c,i)})},t}(),gt=new Sh,Ch=gt.produce,rC=gt.produceWithPatches.bind(gt),oC=gt.setAutoFreeze.bind(gt),iC=gt.setUseProxies.bind(gt),nC=gt.applyPatches.bind(gt),aC=gt.createDraft.bind(gt),sC=gt.finishDraft.bind(gt),mn=Ch;function uo(t){"@babel/helpers - typeof";return uo=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},uo(t)}function qd(t,e){if(uo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(uo(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zd(t){var e=qd(t,"string");return uo(e)=="symbol"?e:e+""}function Yd(t,e,r){return(e=Zd(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function ms(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xd(Object(r),!0).forEach(function(i){Yd(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xd(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Xe(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 Qd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),bs=function(){return Math.random().toString(36).substring(7).split("").join(".")},bn={INIT:"@@redux/INIT"+bs(),REPLACE:"@@redux/REPLACE"+bs(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bs()}};function Oh(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 xs(t,e,r){var i;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Xe(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Xe(1));return r(xs)(t,e)}if(typeof t!="function")throw new Error(Xe(2));var n=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function y(){if(p)throw new Error(Xe(3));return a}function g(E){if(typeof E!="function")throw new Error(Xe(4));if(p)throw new Error(Xe(5));var $=!0;return u(),c.push(E),function(){if($){if(p)throw new Error(Xe(6));$=!1,u();var P=c.indexOf(E);c.splice(P,1),s=null}}}function b(E){if(!Oh(E))throw new Error(Xe(7));if(typeof E.type>"u")throw new Error(Xe(8));if(p)throw new Error(Xe(9));try{p=!0,a=n(a,E)}finally{p=!1}for(var $=s=c,T=0;T<$.length;T++){var P=$[T];P()}return E}function C(E){if(typeof E!="function")throw new Error(Xe(10));n=E,b({type:bn.REPLACE})}function S(){var E,$=g;return E={subscribe:function(P){if(typeof P!="object"||P===null)throw new Error(Xe(11));function z(){P.next&&P.next(y())}z();var Y=$(z);return{unsubscribe:Y}}},E[Qd]=function(){return this},E}return b({type:bn.INIT}),i={dispatch:b,subscribe:g,getState:y,replaceReducer:C},i[Qd]=S,i}function wh(t){Object.keys(t).forEach(function(e){var r=t[e],i=r(void 0,{type:bn.INIT});if(typeof i>"u")throw new Error(Xe(12));if(typeof r(void 0,{type:bn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xe(13))})}function Jd(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++){var n=e[i];typeof t[n]=="function"&&(r[n]=t[n])}var a=Object.keys(r),s,c;try{wh(r)}catch(p){c=p}return function(u,y){if(u===void 0&&(u={}),c)throw c;if(0)var g;for(var b=!1,C={},S=0;S<a.length;S++){var E=a[S],$=r[E],T=u[E],P=$(T,y);if(typeof P>"u"){var z=y&&y.type;throw new Error(Xe(14))}C[E]=P,b=b||P!==T}return b=b||a.length!==Object.keys(u).length,b?C:u}}function jo(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,n){return function(){return i(n.apply(void 0,arguments))}})}function ep(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(i){return function(){var n=i.apply(void 0,arguments),a=function(){throw new Error(Xe(15))},s={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=jo.apply(void 0,c)(n.dispatch),ms(ms({},n),{},{dispatch:a})}}}function tp(t){var e=function(i){var n=i.dispatch,a=i.getState;return function(s){return function(c){return typeof c=="function"?c(n,a,t):s(c)}}};return e}var rp=tp();rp.withExtraArgument=tp;var vs=rp;var sp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},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 i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),Eh=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(y){return p([u,y])}}function p(u){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(y){u=[6,y],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ko=function(t,e){for(var r=0,i=e.length,n=t.length;r<i;r++,n++)t[n]=e[r];return t},Ah=Object.defineProperty,Rh=Object.defineProperties,Lh=Object.getOwnPropertyDescriptors,op=Object.getOwnPropertySymbols,Ih=Object.prototype.hasOwnProperty,kh=Object.prototype.propertyIsEnumerable,ip=function(t,e,r){return e in t?Ah(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},_r=function(t,e){for(var r in e||(e={}))Ih.call(e,r)&&ip(t,r,e[r]);if(op)for(var i=0,n=op(e);i<n.length;i++){var r=n[i];kh.call(e,r)&&ip(t,r,e[r])}return t},Ss=function(t,e){return Rh(t,Lh(e))},Th=function(t,e,r){return new Promise(function(i,n){var a=function(p){try{c(r.next(p))}catch(u){n(u)}},s=function(p){try{c(r.throw(p))}catch(u){n(u)}},c=function(p){return p.done?i(p.value):Promise.resolve(p.value).then(a,s)};c((r=r.apply(t,e)).next())})};var $h=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jo:jo.apply(null,arguments)},EC=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ph(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var _h=function(t){sp(e,t);function e(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var n=t.apply(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Ko([void 0],r[0].concat(this)))):new(e.bind.apply(e,Ko([void 0],r.concat(this))))},e}(Array),Nh=function(t){sp(e,t);function e(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var n=t.apply(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Ko([void 0],r[0].concat(this)))):new(e.bind.apply(e,Ko([void 0],r.concat(this))))},e}(Array);function ws(t){return Ht(t)?mn(t,function(){}):t}function Bh(t){return typeof t=="boolean"}function Dh(){return function(e){return Fh(e)}}function Fh(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,i=t.immutableCheck,n=i===void 0?!0:i,a=t.serializableCheck,s=a===void 0?!0:a,c=new _h;if(r&&(Bh(r)?c.push(vs):c.push(vs.withExtraArgument(r.extraArgument))),0){if(n)var p;if(s)var u}return c}var Cs=!0;function lp(t){var e=Dh(),r=t||{},i=r.reducer,n=i===void 0?void 0:i,a=r.middleware,s=a===void 0?e():a,c=r.devTools,p=c===void 0?!0:c,u=r.preloadedState,y=u===void 0?void 0:u,g=r.enhancers,b=g===void 0?void 0:g,C;if(typeof n=="function")C=n;else if(Ph(n))C=Jd(n);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 S=s;if(typeof S=="function"&&(S=S(e),!Cs&&!Array.isArray(S)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Cs&&S.some(function(Y){return typeof Y!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=ep.apply(void 0,S),$=jo;p&&($=$h(_r({trace:!Cs},typeof p=="object"&&p)));var T=new Nh(E),P=T;Array.isArray(b)?P=Ko([E],b):typeof b=="function"&&(P=b(T));var z=$.apply(void 0,P);return xs(C,y,z)}function Nr(t,e){function r(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(e){var a=e.apply(void 0,i);if(!a)throw new Error("prepareAction did not return an object");return _r(_r({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:i[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(i){return i.type===t},r}function cp(t){var e={},r=[],i,n={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,n},addMatcher:function(a,s){return r.push({matcher:a,reducer:s}),n},addDefaultCase:function(a){return i=a,n}};return t(n),[e,r,i]}function Mh(t){return typeof t=="function"}function zh(t,e,r,i){r===void 0&&(r=[]);var n=typeof e=="function"?cp(e):[e,r,i],a=n[0],s=n[1],c=n[2],p;if(Mh(t))p=function(){return ws(t())};else{var u=ws(t);p=function(){return u}}function y(g,b){g===void 0&&(g=p());var C=Ko([a[b.type]],s.filter(function(S){var E=S.matcher;return E(b)}).map(function(S){var E=S.reducer;return E}));return C.filter(function(S){return!!S}).length===0&&(C=[c]),C.reduce(function(S,E){if(E)if(Sr(S)){var $=S,T=E($,b);return T===void 0?S:T}else{if(Ht(S))return mn(S,function(P){return E(P,b)});var T=E(S,b);if(T===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return S},g)}return y.getInitialState=p,y}function Uh(t,e){return t+"/"+e}function dp(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:ws(t.initialState),i=t.reducers||{},n=Object.keys(i),a={},s={},c={};n.forEach(function(y){var g=i[y],b=Uh(e,y),C,S;"reducer"in g?(C=g.reducer,S=g.prepare):C=g,a[y]=C,s[b]=C,c[y]=S?Nr(b,S):Nr(b)});function p(){var y=typeof t.extraReducers=="function"?cp(t.extraReducers):[t.extraReducers],g=y[0],b=g===void 0?{}:g,C=y[1],S=C===void 0?[]:C,E=y[2],$=E===void 0?void 0:E,T=_r(_r({},b),s);return zh(r,function(P){for(var z in T)P.addCase(z,T[z]);for(var Y=0,X=S;Y<X.length;Y++){var nt=X[Y];P.addMatcher(nt.matcher,nt.reducer)}$&&P.addDefaultCase($)})}var u;return{name:e,reducer:function(y,g){return u||(u=p()),u(y,g)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Hh="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wh=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Hh[Math.random()*64|0];return e},Vh=["name","message","stack","code"],Os=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),np=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Gh=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,i=Vh;r<i.length;r++){var n=i[r];typeof t[n]=="string"&&(e[n]=t[n])}return e}return{message:String(t)}},IC=function(){function t(e,r,i){var n=Nr(e+"/fulfilled",function(y,g,b,C){return{payload:y,meta:Ss(_r({},C||{}),{arg:b,requestId:g,requestStatus:"fulfilled"})}}),a=Nr(e+"/pending",function(y,g,b){return{payload:void 0,meta:Ss(_r({},b||{}),{arg:g,requestId:y,requestStatus:"pending"})}}),s=Nr(e+"/rejected",function(y,g,b,C,S){return{payload:C,error:(i&&i.serializeError||Gh)(y||"Rejected"),meta:Ss(_r({},S||{}),{arg:b,requestId:g,rejectedWithValue:!!C,requestStatus:"rejected",aborted:y?.name==="AbortError",condition:y?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function y(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return y.prototype.abort=function(){},y}();function u(y){return function(g,b,C){var S=i?.idGenerator?i.idGenerator(y):Wh(),E=new p,$,T=!1;function P(Y){$=Y,E.abort()}var z=function(){return Th(this,null,function(){var Y,X,nt,Zt,tt,Yt,He;return Eh(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),Zt=(Y=i?.condition)==null?void 0:Y.call(i,y,{getState:b,extra:C}),Kh(Zt)?[4,Zt]:[3,2];case 1:Zt=m.sent(),m.label=2;case 2:if(Zt===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,tt=new Promise(function(v,N){return E.signal.addEventListener("abort",function(){return N({name:"AbortError",message:$||"Aborted"})})}),g(a(S,y,(X=i?.getPendingMeta)==null?void 0:X.call(i,{requestId:S,arg:y},{getState:b,extra:C}))),[4,Promise.race([tt,Promise.resolve(r(y,{dispatch:g,getState:b,extra:C,requestId:S,signal:E.signal,abort:P,rejectWithValue:function(v,N){return new Os(v,N)},fulfillWithValue:function(v,N){return new np(v,N)}})).then(function(v){if(v instanceof Os)throw v;return v instanceof np?n(v.payload,S,y,v.meta):n(v,S,y)})])];case 3:return nt=m.sent(),[3,5];case 4:return Yt=m.sent(),nt=Yt instanceof Os?s(null,S,y,Yt.payload,Yt.meta):s(Yt,S,y),[3,5];case 5:return He=i&&!i.dispatchConditionRejection&&s.match(nt)&&nt.meta.condition,He||g(nt),[2,nt]}})})}();return Object.assign(z,{abort:P,requestId:S,arg:y,unwrap:function(){return z.then(jh)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:n,typePrefix:e})}return t.withTypes=function(){return t},t}();function jh(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Kh(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var pp="listener",up="completed",fp="cancelled",kC="task-"+fp,TC="task-"+up,$C=pp+"-"+fp,PC=pp+"-"+up;var Es="listenerMiddleware";var _C=Nr(Es+"/add"),NC=Nr(Es+"/removeAll"),BC=Nr(Es+"/remove");var ap,DC=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ap||(ap=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},qh=function(t){return function(e){setTimeout(e,t)}},FC=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:qh(10);Gd();var Zh=ln(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,i,n){this.eventBus.addEventListener(r,i,n)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,i,n){this.eventBus.removeEventListener(r,i,n)}}}),xn=class extends Zh(Object){};window.ftReduxStores||(window.ftReduxStores={});var hp=class t extends xn{static get(e){var r;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,a=window.ftReduxStores[i];if(fn(a))return a;if(n==null)return;let s=dp({...n,reducers:(r=n.reducers)!==null&&r!==void 0?r:{}}),c=lp({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:s.reducer(p,u)});return window.ftReduxStores[n.name]=new t(s,c,n.eventBus)}constructor(e,r,i){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new cn;let n=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let p=s,u=a[p];return u?(...y)=>{let g=u(...y.map(n));return this.reduxStore.dispatch(g),g}:y=>{this.setState({[p]:n(y)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var vn=class{static format(e,r,i,n){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(i,n)):this.getIntlDateTime(e,r,i,n)}static getMomentDateFormat(e,r){return e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,i,n){let a=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(r,{dateStyle:i?"medium":"short"}).format(a);if(!n)return s;let c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return`${s} ${c}`}static getTimezoneAsString(){let e=i=>String(Math.floor(i)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var gp=f(O()),Sn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},dO=(0,gp.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(k)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,a;return((a=(n=this.metadataDescriptors.find(c=>c.key===i))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1)?c=>vn.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Sn([(0,As.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Sn([(0,As.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Sn([rs({store:k.name,selector:r=>{var i,n;return(n=(i=r.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),Sn([rs({store:k.name})],e.prototype,"uiLocale",void 0),e});var wn=f(O());var Cn=class extends lt{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var On=class extends lt{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=k.getState().session;return!!e?.sessionAuthenticated}};var Yh="ft-user-assets",Xh={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(At).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:i,asset:n}=e.payload;Ls(t,r,[...Rs(t,r),n]),yp(t,r,1,i),mp(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;Ls(t,r,Rs(t,r).map(n=>n.id===i.id?i:n)),mp(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;Ls(t,r,Rs(t,r).filter(a=>a.id!==n)),yp(t,r,-1,i)}},bp={[At.SEARCHES]:"savedSearches",[At.BOOKMARKS]:"bookmarks",[At.BOOKS]:void 0,[At.COLLECTIONS]:void 0},Rs=(t,e)=>{var r;let i=bp[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},Ls=(t,e,r)=>{let i=bp[e];i&&(t[i]=r)},yp=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===At.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+r)}},mp=(t,e)=>{let r=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!r.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},yt=wn.FtReduxStore.get({name:Yh,reducers:Xh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(At).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Is=class{constructor(e=new Cn,r=new On){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=k.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ji,this.savedSearchesService=new nn,k.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=k.getState();(0,wn.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(),yt.actions.clearAssetCount(),yt.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),yt.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),yt.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();yt.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();yt.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&yt.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&yt.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(yt.getState().assetCounts.bookmarkByMap).length!==0;e===At.BOOKMARKS&&r&&yt.actions.clearBookmarkCountByMap(),yt.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;yt.actions.bookmarks(r)}}},Qh=new Is;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Qh);(0,xp.customElement)("ft-app-context")(ue);var vp=f(J());var ks=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[i,n]=e.split(".");return{context:i,key:n,custom:!0,message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},qo=new ks;var Jh=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ci=Symbol("i18nAttributes"),Sp=Symbol("i18nListAttributes"),Cp=Symbol("i18nProperties"),En=Symbol("i18nContexts"),Si=Symbol("i18nUnsubs"),Yo=(0,Zo.applyMixinOnce)(Symbol("withI18n"),function(t){var e,r;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?tn:Mo}i18n(a){let{context:s,key:c,message:p}=a,{custom:u,args:y,argsProvider:g}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let b=y??(g?g(this):[]);return this.getI18nService(u).resolveMessage(s,c,...b)}return p}async awaitI18n(a){let{context:s,custom:c}=a;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(a)}customI18n(a,s){if(qo.isI18nKey(a)){let[c,p]=a.split(".");return this.i18n({custom:!0,context:c,key:p,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,c,p)=>a.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,c,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,c;let p=this,u=(y,g,b)=>b?.context&&b.key&&a(y,g,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...y})}:b;(s=this[Ci])===null||s===void 0||s.forEach((y,g)=>p[g]=u(y,g,p[g])),(c=this[Sp])===null||c===void 0||c.forEach((y,g)=>{var b;return p[g]=(b=p[g])===null||b===void 0?void 0:b.map(C=>u(y,g,C))})}updateI18nProperties(a){var s;(s=this[Cp])===null||s===void 0||s.forEach((c,p)=>{a(c,p)&&(this[p]=this.i18n(c))})}addI18nMessages(a,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,c)}addI18nContext(a,s,c){let p=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[En].set(p,{isCustomContext:c}),this[Si].has(p)||this[Si].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,s)}hasI18nContext(a){return this[En].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[En].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Si].forEach(a=>a()),this[Si].clear()}}return e=En,r=Si,Jh([(0,vp.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),An=class extends Yo(Zo.FtLitElement){},Rn=class extends Yo(Zo.FtLitElementRedux){};var Op=f(O());var Ts=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(i=>typeof i=="string"?qo.fromAttribute(i):i):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},eg=new Ts;var wp=(t,e)=>(r,i)=>{var n;r.constructor.createProperty(i,{type:Object,hasChanged:Op.hasChanged,converter:qo,...e}),r[Ci]=(n=r[Ci])!==null&&n!==void 0?n:new Map,r[Ci].set(i,t??{})};var Rp=f(O());var Ln=f(L()),In=f(J()),kn=f(O());var Ep=f(L());var Ap=Ep.css`
546
546
  `;var Oi=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Wt=class extends Rn{constructor(){super(),this.editorMode=!1,this.addStore(k)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Ln.nothing:Ln.html`