@fluid-topics/ft-search-bar 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.
@@ -563,7 +563,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
563
563
  word-break: break-word;
564
564
  }
565
565
  `;var ec=["top","right","bottom","left"],Jl=["start","end"],wa=ec.reduce((t,e)=>t.concat(e,e+"-"+Jl[0],e+"-"+Jl[1]),[]),tc=Math.min,rc=Math.max;var lf={left:"right",right:"left",bottom:"top",top:"bottom"},cf={start:"end",end:"start"};function Ea(t,e,r){return rc(t,tc(e,r))}function _i(t,e){return typeof t=="function"?t(e):t}function Eo(t){return t.split("-")[0]}function vr(t){return t.split("-")[1]}function Aa(t){return t==="x"?"y":"x"}function Ra(t){return t==="y"?"height":"width"}function Pi(t){return["top","bottom"].includes(Eo(t))?"y":"x"}function La(t){return Aa(Pi(t))}function oc(t,e,r){r===void 0&&(r=!1);let i=vr(t),n=La(t),a=Ra(n),s=n==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=Ca(s)),[s,Ca(s)]}function ic(t){return t.replace(/start|end/g,e=>cf[e])}function Ca(t){return t.replace(/left|right|bottom|top/g,e=>lf[e])}function df(t){return{top:0,right:0,bottom:0,left:0,...t}}function nc(t){return typeof t!="number"?df(t):{top:t,right:t,bottom:t,left:t}}function Zr(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 ac(t,e,r){let{reference:i,floating:n}=t,a=Pi(e),s=La(e),c=Ra(s),p=Eo(e),u=a==="y",m=i.x+i.width/2-n.width/2,y=i.y+i.height/2-n.height/2,b=i[c]/2-n[c]/2,O;switch(p){case"top":O={x:m,y:i.y-n.height};break;case"bottom":O={x:m,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y};break;case"left":O={x:i.x-n.width,y};break;default:O={x:i.x,y:i.y}}switch(vr(e)){case"start":O[s]-=b*(r&&u?-1:1);break;case"end":O[s]+=b*(r&&u?-1:1);break}return O}var sc=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:m,y}=ac(u,i,p),b=i,O={},v=0;for(let E=0;E<c.length;E++){let{name:$,fn:T}=c[E],{x:N,y:z,data:Z,reset:X}=await T({x:m,y,initialPlacement:i,placement:b,strategy:n,middlewareData:O,rects:u,platform:s,elements:{reference:t,floating:e}});m=N??m,y=z??y,O={...O,[$]:{...O[$],...Z}},X&&v<=50&&(v++,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:m,y}=ac(u,b,p)),E=-1)}return{x:m,y,placement:b,strategy:n,middlewareData:O}};async function Ia(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:m="viewport",elementContext:y="floating",altBoundary:b=!1,padding:O=0}=_i(e,t),v=nc(O),$=c[b?y==="floating"?"reference":"floating":y],T=Zr(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:m,strategy:p})),N=y==="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)),Z=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=Zr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:z,strategy:p}):N);return{top:(T.top-X.top+v.top)/Z.y,bottom:(X.bottom-T.bottom+v.bottom)/Z.y,left:(T.left-X.left+v.left)/Z.x,right:(X.right-T.right+v.right)/Z.x}}function pf(t,e,r){return(t?[...r.filter(n=>vr(n)===t),...r.filter(n=>vr(n)!==t)]:r.filter(n=>Eo(n)===n)).filter(n=>t?vr(n)===t||(e?ic(n)!==n:!1):!0)}var ka=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:m=!1,alignment:y,allowedPlacements:b=wa,autoAlignment:O=!0,...v}=_i(t,e),E=y!==void 0||b===wa?pf(y||null,O,b):b,$=await Ia(e,v),T=((r=s.autoPlacement)==null?void 0:r.index)||0,N=E[T];if(N==null)return{};let z=oc(N,a,await(p.isRTL==null?void 0:p.isRTL(u.floating)));if(c!==N)return{reset:{placement:E[0]}};let Z=[$[Eo(N)],$[z[0]],$[z[1]]],X=[...((i=s.autoPlacement)==null?void 0:i.overflows)||[],{placement:N,overflows:Z}],rt=E[T+1];if(rt)return{data:{index:T+1,overflows:X},reset:{placement:rt}};let Wt=X.map(De=>{let g=vr(De.placement);return[De.placement,g&&m?De.overflows.slice(0,2).reduce((x,_)=>x+_,0):De.overflows[0],De.overflows]}).sort((De,g)=>De[1]-g[1]),Vt=((n=Wt.filter(De=>De[2].slice(0,vr(De[0])?2:3).every(g=>g<=0))[0])==null?void 0:n[0])||Wt[0][0];return Vt!==c?{data:{index:T+1,overflows:X},reset:{placement:Vt}}:{}}}};var Ta=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:N}=$;return{x:T,y:N}}},...p}=_i(t,e),u={x:r,y:i},m=await Ia(e,p),y=Pi(Eo(n)),b=Aa(y),O=u[b],v=u[y];if(a){let $=b==="y"?"top":"left",T=b==="y"?"bottom":"right",N=O+m[$],z=O-m[T];O=Ea(N,O,z)}if(s){let $=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=v+m[$],z=v-m[T];v=Ea(N,v,z)}let E=c.fn({...e,[b]:O,[y]:v});return{...E,data:{x:E.x-r,y:E.y-i,enabled:{[b]:a,[y]:s}}}}}};var $a=Math.min,Ao=Math.max,Jo=Math.round;var dr=t=>({x:t,y:t});function pr(t){return cc(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ur(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 it(t).Node}function Zt(t){return t instanceof Element||t instanceof it(t).Element}function _t(t){return t instanceof HTMLElement||t instanceof it(t).HTMLElement}function lc(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof it(t).ShadowRoot}function Ro(t){let{overflow:e,overflowX:r,overflowY:i,display:n}=dt(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(n)}function dc(t){return["table","td","th"].includes(pr(t))}function Di(t){let e=Fi(),r=dt(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 pc(t){let e=qr(t);for(;_t(e)&&!ei(e);){if(Di(e))return e;e=qr(e)}return null}function Fi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ei(t){return["html","body","#document"].includes(pr(t))}function dt(t){return it(t).getComputedStyle(t)}function ti(t){return Zt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function qr(t){if(pr(t)==="html")return t;let e=t.assignedSlot||t.parentNode||lc(t)&&t.host||ur(t);return lc(e)?e.host:e}function uc(t){let e=qr(t);return ei(e)?t.ownerDocument?t.ownerDocument.body:t.body:_t(e)&&Ro(e)?e:uc(e)}function Bi(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);let n=uc(t),a=n===((i=t.ownerDocument)==null?void 0:i.body),s=it(n);return a?e.concat(s,s.visualViewport||[],Ro(n)?n:[],s.frameElement&&r?Bi(s.frameElement):[]):e.concat(n,Bi(n,[],r))}function yc(t){let e=dt(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=_t(t),a=n?t.offsetWidth:r,s=n?t.offsetHeight:i,c=Jo(r)!==a||Jo(i)!==s;return c&&(r=a,i=s),{width:r,height:i,$:c}}function mc(t){return Zt(t)?t:t.contextElement}function Lo(t){let e=mc(t);if(!_t(e))return dr(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:a}=yc(e),s=(a?Jo(r.width):r.width)/i,c=(a?Jo(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var hf=dr(0);function gc(t){let e=it(t);return!Fi()||!e.visualViewport?hf:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function yf(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==it(t)?!1:e}function ri(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);let n=t.getBoundingClientRect(),a=mc(t),s=dr(1);e&&(i?Zt(i)&&(s=Lo(i)):s=Lo(t));let c=yf(a,r,i)?gc(a):dr(0),p=(n.left+c.x)/s.x,u=(n.top+c.y)/s.y,m=n.width/s.x,y=n.height/s.y;if(a){let b=it(a),O=i&&Zt(i)?it(i):i,v=b.frameElement;for(;v&&i&&O!==b;){let E=Lo(v),$=v.getBoundingClientRect(),T=dt(v),N=$.left+(v.clientLeft+parseFloat(T.paddingLeft))*E.x,z=$.top+(v.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,u*=E.y,m*=E.x,y*=E.y,p+=N,u+=z,v=it(v).frameElement}}return Zr({width:m,height:y,x:p,y:u})}function mf(t){let{rect:e,offsetParent:r,strategy:i}=t,n=_t(r),a=ur(r);if(r===a)return e;let s={scrollLeft:0,scrollTop:0},c=dr(1),p=dr(0);if((n||!n&&i!=="fixed")&&((pr(r)!=="body"||Ro(a))&&(s=ti(r)),_t(r))){let u=ri(r);c=Lo(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 gf(t){return Array.from(t.getClientRects())}function bc(t){return ri(ur(t)).left+ti(t).scrollLeft}function bf(t){let e=ur(t),r=ti(t),i=t.ownerDocument.body,n=Ao(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=Ao(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+bc(t),c=-r.scrollTop;return dt(i).direction==="rtl"&&(s+=Ao(e.clientWidth,i.clientWidth)-n),{width:n,height:a,x:s,y:c}}function xf(t,e){let r=it(t),i=ur(t),n=r.visualViewport,a=i.clientWidth,s=i.clientHeight,c=0,p=0;if(n){a=n.width,s=n.height;let u=Fi();(!u||u&&e==="fixed")&&(c=n.offsetLeft,p=n.offsetTop)}return{width:a,height:s,x:c,y:p}}function vf(t,e){let r=ri(t,!0,e==="fixed"),i=r.top+t.clientTop,n=r.left+t.clientLeft,a=_t(t)?Lo(t):dr(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 fc(t,e,r){let i;if(e==="viewport")i=xf(t,r);else if(e==="document")i=bf(ur(t));else if(Zt(e))i=vf(e,r);else{let n=gc(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return Zr(i)}function xc(t,e){let r=qr(t);return r===e||!Zt(r)||ei(r)?!1:dt(r).position==="fixed"||xc(r,e)}function Sf(t,e){let r=e.get(t);if(r)return r;let i=Bi(t,[],!1).filter(c=>Zt(c)&&pr(c)!=="body"),n=null,a=dt(t).position==="fixed",s=a?qr(t):t;for(;Zt(s)&&!ei(s);){let c=dt(s),p=Di(s);!p&&c.position==="fixed"&&(n=null),(a?!p&&!n:!p&&c.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Ro(s)&&!p&&xc(t,s))?i=i.filter(m=>m!==s):n=c,s=qr(s)}return e.set(t,i),i}function Of(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[...r==="clippingAncestors"?Sf(e,this._c):[].concat(r),i],c=s[0],p=s.reduce((u,m)=>{let y=fc(e,m,n);return u.top=Ao(y.top,u.top),u.right=$a(y.right,u.right),u.bottom=$a(y.bottom,u.bottom),u.left=Ao(y.left,u.left),u},fc(e,c,n));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function Cf(t){return yc(t)}function wf(t,e,r){let i=_t(e),n=ur(e),a=r==="fixed",s=ri(t,!0,a,e),c={scrollLeft:0,scrollTop:0},p=dr(0);if(i||!i&&!a)if((pr(e)!=="body"||Ro(n))&&(c=ti(e)),i){let u=ri(e,!0,a,e);p.x=u.x+e.clientLeft,p.y=u.y+e.clientTop}else n&&(p.x=bc(n));return{x:s.left+c.scrollLeft-p.x,y:s.top+c.scrollTop-p.y,width:s.width,height:s.height}}function hc(t,e){return!_t(t)||dt(t).position==="fixed"?null:e?e(t):t.offsetParent}function vc(t,e){let r=it(t);if(!_t(t))return r;let i=hc(t,e);for(;i&&dc(i)&&dt(i).position==="static";)i=hc(i,e);return i&&(pr(i)==="html"||pr(i)==="body"&&dt(i).position==="static"&&!Di(i))?r:i||pc(t)||r}var Ef=async function(t){let{reference:e,floating:r,strategy:i}=t,n=this.getOffsetParent||vc,a=this.getDimensions;return{reference:wf(e,await n(r),i),floating:{x:0,y:0,...await a(r)}}};function Af(t){return dt(t).direction==="rtl"}var Mi={convertOffsetParentRelativeRectToViewportRelativeRect:mf,getDocumentElement:ur,getClippingRect:Of,getOffsetParent:vc,getElementRects:Ef,getClientRects:gf,getDimensions:Cf,getScale:Lo,isElement:Zt,isRTL:Af};var Sc=(t,e,r)=>{let i=new Map,n={platform:Mi,...r},a={...n.platform,_c:i};return sc(t,e,{...n,platform:a})};function Oc(t){return Rf(t)}function Na(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Rf(t){for(let e=t;e;e=Na(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=Na(t);e;e=Na(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 Cc(t,e,r){return Sc(t,e,{platform:{...Mi,getOffsetParent:i=>Mi.getOffsetParent(i,Oc)},middleware:[Ta({crossAxis:!0}),ka({allowedPlacements:[r]})]})}var Mo=f(w());var cp=f(w());var fd=f(k()),ze=f(ee()),Pt=f(w());var wc=f(k());var Ec=wc.css`
566
- `;var zi=f(w()),Lf="ft-app-info",Yr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Yr.eventName="authentication-change";var If={session:(t,e)=>{(0,zi.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new Yr(e.payload)),0))}},I=zi.FtReduxStore.get({name:Lf,reducers:If,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 _a=f(w());var Xr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=I.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=I.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var Ui=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Xr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Xr.await()}};var pt=class extends Ui{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 _a.CacheRegistry,this.cache=e?n.commonCache:new _a.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 Hi=class extends pt{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Pa=class{addCommand(e,r=!1){I.commands.add(e,r)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Pa;var St=f(w());var Ac,Io=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},kf=Symbol("clearAfterUnitTest"),Wi=class extends(0,St.withEventBus)(pt){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ac]=()=>{this.defaultMessages={},this.cache=new St.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let 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,St.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 St.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 St.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 Io({loadedContexts:e})),this.dispatchEvent(new Io({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Io({loadedContexts:[e]})),this.dispatchEvent(new Io({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,St.delay)(0).then(()=>i()).catch(()=>null)))}};Ac=kf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Wi{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Wi{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var oi=window.FluidTopicsI18nService,Ba=window.FluidTopicsCustomI18nService;var Rc=f(w()),Da=class{highlightHtml(e,r,i){(0,Rc.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new Da;var $f=f(Ic(),1);var kc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(kc||(kc={}));var Tc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Tc||(Tc={}));var $c;(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"})($c||($c={}));var Nc;(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"})(Nc||(Nc={}));var _c;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(_c||(_c={}));var Pc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Pc||(Pc={}));var Bc;(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"})(Bc||(Bc={}));var Dc;(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"})(Dc||(Dc={}));var Fc;(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"})(Fc||(Fc={}));var Mc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Mc||(Mc={}));var zc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(zc||(zc={}));var Uc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Uc||(Uc={}));var Hc;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Hc||(Hc={}));var Wc;(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"})(Wc||(Wc={}));var Vc;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Vc||(Vc={}));var Gc;(function(t){t.ASC="ASC",t.DESC="DESC"})(Gc||(Gc={}));var jc;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(jc||(jc={}));var Kc;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Kc||(Kc={}));var Zc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Zc||(Zc={}));var qc;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(qc||(qc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Xc||(Xc={}));var Qc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Qc||(Qc={}));var Jc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Jc||(Jc={}));var ed;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(ed||(ed={}));var ke;(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"})(ke||(ke={}));var Ot;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(Ot||(Ot={}));var td;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(td||(td={}));var rd;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(rd||(rd={}));var od;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(od||(od={}));var id;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(id||(id={}));var nd;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(nd||(nd={}));var Tf={[ke.PERSONAL_BOOK_SHARE_USER]:[ke.PERSONAL_BOOK_USER],[ke.HTML_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.PDF_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.KHUB_ADMIN]:[ke.CONTENT_PUBLISHER],[ke.ADMIN]:[ke.KHUB_ADMIN,ke.USERS_ADMIN,ke.PORTAL_ADMIN],[ke.GENERATIVE_AI_EXPORT_USER]:[ke.GENERATIVE_AI_USER]};function ad(t,e){return t===e||(Tf[t]??[]).some(r=>ad(r,e))}function sd(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=>ad(i,e))}var ji=class extends pt{async listMySearches(){let{session:e}=I.getState();return sd(e,ke.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ld=f(w());var Fa=class{isDate(e){var r,i,n,a;return(a=(n=((i=(r=I.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 ld.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:I.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Fa;var cd=f(w());var ii=class{static get(e,r){var i,n;let a=I.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 cd.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${c}`)}};var Ma=class{urlToSearchRequest(e){return ii.get().parse(e)}searchRequestToUrl(e){return ii.get().serialize(e)}};window.FluidTopicsUrlService=new Ma;var Or=f(w());var Qr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Qr.eventName="change";var za=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))}},dd=new za;var Ki=class t extends Or.WithEventBus{static build(){return new t(window.history,dd,()=>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,Or.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Qr(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(Qr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Qr.eventName,e)}currentItem(){return(0,Or.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,Or.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,Or.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=Ki.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 pd=I;function ud(t,e){var r;return pd.getState().authenticationRequired&&!(!((r=pd.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var Te=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},de=class extends Pt.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=()=>Xr.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Pt.CacheRegistry,this.cleanSessionDebouncer=new Pt.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return fd.html`
566
+ `;var zi=f(w()),Lf="ft-app-info",Yr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Yr.eventName="authentication-change";var If={session:(t,e)=>{(0,zi.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new Yr(e.payload)),0))}},I=zi.FtReduxStore.get({name:Lf,reducers:If,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 _a=f(w());var Xr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=I.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=I.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var Ui=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Xr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Xr.await()}};var pt=class extends Ui{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 _a.CacheRegistry,this.cache=e?n.commonCache:new _a.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 Hi=class extends pt{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Pa=class{addCommand(e,r=!1){I.commands.add(e,r)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Pa;var St=f(w());var Ac,Io=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},kf=Symbol("clearAfterUnitTest"),Wi=class extends(0,St.withEventBus)(pt){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ac]=()=>{this.defaultMessages={},this.cache=new St.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let 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,St.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 St.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 St.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 Io({loadedContexts:e})),this.dispatchEvent(new Io({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Io({loadedContexts:[e]})),this.dispatchEvent(new Io({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,St.delay)(0).then(()=>i()).catch(()=>null)))}};Ac=kf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Wi{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Wi{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var oi=window.FluidTopicsI18nService,Ba=window.FluidTopicsCustomI18nService;var Rc=f(w()),Da=class{highlightHtml(e,r,i){(0,Rc.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new Da;var $f=f(Ic(),1);var kc;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(kc||(kc={}));var Tc;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Tc||(Tc={}));var $c;(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"})($c||($c={}));var Nc;(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"})(Nc||(Nc={}));var _c;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(_c||(_c={}));var Pc;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Pc||(Pc={}));var Bc;(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"})(Bc||(Bc={}));var Dc;(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"})(Dc||(Dc={}));var Fc;(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"})(Fc||(Fc={}));var Mc;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Mc||(Mc={}));var zc;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(zc||(zc={}));var Uc;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Uc||(Uc={}));var Hc;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Hc||(Hc={}));var Wc;(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"})(Wc||(Wc={}));var Vc;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Vc||(Vc={}));var Gc;(function(t){t.ASC="ASC",t.DESC="DESC"})(Gc||(Gc={}));var jc;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(jc||(jc={}));var Kc;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Kc||(Kc={}));var Zc;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Zc||(Zc={}));var qc;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(qc||(qc={}));var Yc;(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"})(Yc||(Yc={}));var Xc;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Xc||(Xc={}));var Qc;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Qc||(Qc={}));var Jc;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Jc||(Jc={}));var ed;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(ed||(ed={}));var ke;(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"})(ke||(ke={}));var Ot;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(Ot||(Ot={}));var td;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(td||(td={}));var rd;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(rd||(rd={}));var od;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(od||(od={}));var id;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(id||(id={}));var nd;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(nd||(nd={}));var ad;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(ad||(ad={}));var Tf={[ke.PERSONAL_BOOK_SHARE_USER]:[ke.PERSONAL_BOOK_USER],[ke.HTML_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.PDF_EXPORT_USER]:[ke.PERSONAL_BOOK_USER],[ke.KHUB_ADMIN]:[ke.CONTENT_PUBLISHER],[ke.ADMIN]:[ke.KHUB_ADMIN,ke.USERS_ADMIN,ke.PORTAL_ADMIN],[ke.GENERATIVE_AI_EXPORT_USER]:[ke.GENERATIVE_AI_USER]};function sd(t,e){return t===e||(Tf[t]??[]).some(r=>sd(r,e))}function ld(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=>sd(i,e))}var ji=class extends pt{async listMySearches(){let{session:e}=I.getState();return ld(e,ke.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var cd=f(w());var Fa=class{isDate(e){var r,i,n,a;return(a=(n=((i=(r=I.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 cd.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:I.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Fa;var dd=f(w());var ii=class{static get(e,r){var i,n;let a=I.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 dd.SearchPlaceConverter(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,r??`${s}-${c}`)}};var Ma=class{urlToSearchRequest(e){return ii.get().parse(e)}searchRequestToUrl(e){return ii.get().serialize(e)}};window.FluidTopicsUrlService=new Ma;var Or=f(w());var Qr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Qr.eventName="change";var za=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))}},pd=new za;var Ki=class t extends Or.WithEventBus{static build(){return new t(window.history,pd,()=>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,Or.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Qr(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(Qr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Qr.eventName,e)}currentItem(){return(0,Or.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,Or.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,Or.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=Ki.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 ud(t,e){let{authenticationRequired:r,session:i}=I.getState();return r&&!i?.sessionAuthenticated?Promise.resolve(e):t()}var Te=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},de=class extends Pt.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=()=>Xr.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Pt.CacheRegistry,this.cleanSessionDebouncer=new Pt.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return fd.html`
567
567
  <slot></slot>
568
568
  `}connectedCallback(){super.connectedCallback(),I.addEventListener(Yr.eventName,this.reloadConfiguration)}disconnectedCallback(){I.addEventListener(Yr.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,i,n,a,s,c,p;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&I.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(u=>oi.addContext(u)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),I.actions.availableUiLocales((n=(i=this.localesConfiguration)===null||i===void 0?void 0:i.availableUiLocales)!==null&&n!==void 0?n:[]),I.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&I.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&I.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",()=>ud(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};de.elementDefinitions={};de.styles=Ec;Te([(0,ze.property)()],de.prototype,"baseUrl",void 0);Te([(0,ze.property)()],de.prototype,"apiIntegrationIdentifier",void 0);Te([(0,ze.property)()],de.prototype,"apiIntegrationAppVersion",void 0);Te([(0,ze.property)()],de.prototype,"uiLocale",void 0);Te([(0,Pt.jsonProperty)(null)],de.prototype,"availableUiLocales",void 0);Te([(0,Pt.jsonProperty)(null)],de.prototype,"metadataConfiguration",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"editorMode",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"noCustom",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"openExternalDocumentInNewTab",void 0);Te([(0,ze.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],de.prototype,"noCustomComponent",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"withManualResources",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"navigatorOnline",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"forcedOffline",void 0);Te([(0,ze.property)({type:Object})],de.prototype,"apiProvider",void 0);Te([(0,ze.property)({type:Boolean})],de.prototype,"authenticationRequired",void 0);Te([(0,Pt.jsonProperty)([])],de.prototype,"messageContexts",void 0);Te([(0,Pt.jsonProperty)(void 0)],de.prototype,"session",void 0);Te([(0,ze.state)()],de.prototype,"localesConfiguration",void 0);Te([(0,ze.state)()],de.prototype,"availableContentLocales",void 0);var ps=f(ee());function Nf(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(!Zi(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(!Zi(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(!Zi(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Zi(t,e){try{return Nf(t,e)}catch{return!1}}function ni(t,e){return!Zi(t,e)}function qi(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 hd=f(ee(),1);var Ua=t=>{let e=t??{};return(r,i)=>{var n;let a={hasChanged:ni,attribute:!1,...e};(0,hd.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 Yi=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 Jr=f(ee(),1);var yd=f(ee(),1);function md(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,yd.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:ni,...e??{}})}var Xi=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 bd=f(k(),1);var Qi=globalThis,_f=Qi.ShadowRoot&&(Qi.ShadyCSS===void 0||Qi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vS=Symbol();var gd=(t,e)=>{if(_f)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=Qi.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}};var Ji=class extends bd.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 gd(i,e.elementStyles),i}};function xd(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 $o=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},Cd,vd=Symbol("constructorPrototype"),Sd=Symbol("constructorName"),wd=Symbol("exportpartsDebouncer"),Od=Symbol("dynamicDependenciesLoaded"),To=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};To.eventName="exportparts-updated";var qt=class extends Ji{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Cd]=new Xi(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[wd].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[Sd]=this.constructor.name,this[vd]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Sd]&&Object.setPrototypeOf(this,this[vd])}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[Od]||(r[Od]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(To.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(To.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 To)})}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=xd(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 m=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 O=(a=(n=b.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],v=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map($=>$.split(":")[1]))!==null&&c!==void 0?c:[],E=[...O,...v].filter(p).map($=>$.trim());for(let $ of E)m.add($)}if(m.size===0){this.exportparts=void 0;return}let y=[...m.values()].flatMap(b=>u.map(O=>`${b}:${O}--${b}`));this.exportparts=[...this.part,...y].join(", ")}};Cd=wd;$o([(0,Jr.property)()],qt.prototype,"exportpartsPrefix",void 0);$o([md([])],qt.prototype,"exportpartsPrefixes",void 0);$o([(0,Jr.property)({reflect:!0})],qt.prototype,"exportparts",void 0);$o([(0,Jr.property)()],qt.prototype,"customStylesheet",void 0);$o([(0,Jr.property)()],qt.prototype,"elementToFocus",void 0);$o([(0,Jr.state)()],qt.prototype,"useAdoptedStyleSheets",void 0);function en(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var ai=Symbol("internalReduxEventsUnsubscribers"),Cr=Symbol("internalStoresUnsubscribers"),eo=Symbol("internalStores"),Pf=qi(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[eo].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[eo].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[eo].get(s)}addStore(s,c){var p;c=(p=c??s.name)!==null&&p!==void 0?p:"default-store",this.unsubscribeFromStore(c),this[eo].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[eo].delete(c)}setupStores(){this.unsubscribeFromStores(),this[eo].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[Cr].has(s.store):this[Cr].size>0)&&(this[c]=s.selector(u.getState(),this))}})}subscribeToStore(s,c){var p;this[Cr].set(s,c.subscribe(()=>this.updateFromStores())),this[ai].set(s,[]),en(c)&&c.eventBus&&((p=this.reduxConstructor.reduxEventListeners)===null||p===void 0||p.forEach((u,m)=>{if(typeof this[m]=="function"&&(!u.store||c.name===u.store)){let y=b=>this[m](b);c.addEventListener(u.eventName,y),this[ai].get(s).push(()=>c.removeEventListener(u.eventName,y))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Cr].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[Cr].has(s)&&this[Cr].get(s)(),this[Cr].delete(s),(c=this[ai].get(s))===null||c===void 0||c.forEach(p=>p()),this[ai].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Cr,r=eo,i=ai,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Ed=class extends Pf(qt){};function Ct(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 fr(t){return!!t&&!!t[me]}function Bt(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)===Wf}(t)||Array.isArray(t)||!!t[$d]||!!(!((e=t.constructor)===null||e===void 0)&&e[$d])||Ya(t)||Xa(t))}function to(t,e,r){r===void 0&&(r=!1),Po(t)===0?(r?Object.keys:_o)(t).forEach(function(i){r&&typeof i=="symbol"||e(i,t[i],t)}):t.forEach(function(i,n){return e(n,i,t)})}function Po(t){var e=t[me];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Ya(t)?2:Xa(t)?3:0}function No(t,e){return Po(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Bf(t,e){return Po(t)===2?t.get(e):t[e]}function Nd(t,e,r){var i=Po(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function _d(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Ya(t){return Uf&&t instanceof Map}function Xa(t){return Hf&&t instanceof Set}function wr(t){return t.o||t.t}function Qa(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Dd(t);delete e[me];for(var r=_o(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 Ja(t,e){return e===void 0&&(e=!1),es(t)||fr(t)||!Bt(t)||(Po(t)>1&&(t.set=t.add=t.clear=t.delete=Df),Object.freeze(t),e&&to(t,function(r,i){return Ja(i,!0)},!0)),t}function Df(){Ct(2)}function es(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Yt(t){var e=qa[t];return e||Ct(18,t),e}function Ff(t,e){qa[t]||(qa[t]=e)}function ja(){return li}function Ha(t,e){e&&(Yt("Patches"),t.u=[],t.s=[],t.v=e)}function tn(t){Ka(t),t.p.forEach(Mf),t.p=null}function Ka(t){t===li&&(li=t.l)}function Ad(t){return li={p:[],l:li,h:t,m:!0,_:0}}function Mf(t){var e=t[me];e.i===0||e.i===1?e.j():e.g=!0}function Wa(t,e){e._=e.p.length;var r=e.p[0],i=t!==void 0&&t!==r;return e.h.O||Yt("ES5").S(e,t,i),i?(r[me].P&&(tn(e),Ct(4)),Bt(t)&&(t=rn(e,t),e.l||on(e,t)),e.u&&Yt("Patches").M(r[me].t,t,e.u,e.s)):t=rn(e,r,[]),tn(e),e.u&&e.v(e.u,e.s),t!==Bd?t:void 0}function rn(t,e,r){if(es(e))return e;var i=e[me];if(!i)return to(e,function(c,p){return Rd(t,i,e,c,p,r)},!0),e;if(i.A!==t)return e;if(!i.P)return on(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=Qa(i.k):i.o,a=n,s=!1;i.i===3&&(a=new Set(n),n.clear(),s=!0),to(a,function(c,p){return Rd(t,i,n,c,p,r,s)}),on(t,n,!1),r&&t.u&&Yt("Patches").N(i,r,t.u,t.s)}return i.o}function Rd(t,e,r,i,n,a,s){if(fr(n)){var c=rn(t,n,a&&e&&e.i!==3&&!No(e.R,i)?a.concat(i):void 0);if(Nd(r,i,c),!fr(c))return;t.m=!1}else s&&r.add(n);if(Bt(n)&&!es(n)){if(!t.h.D&&t._<1)return;rn(t,n),e&&e.A.l||on(t,n)}}function on(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Ja(e,r)}function Va(t,e){var r=t[me];return(r?wr(r):t)[e]}function Ld(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 Er(t){t.P||(t.P=!0,t.l&&Er(t.l))}function Ga(t){t.o||(t.o=Qa(t.t))}function Za(t,e,r){var i=Ya(e)?Yt("MapSet").F(e,r):Xa(e)?Yt("MapSet").T(e,r):t.O?function(n,a){var s=Array.isArray(n),c={i:s?1:0,A:a?a.A:ja(),P:!1,I:!1,R:{},l:a,t:n,k:null,o:null,j:null,C:!1},p=c,u=ci;s&&(p=[c],u=si);var m=Proxy.revocable(p,u),y=m.revoke,b=m.proxy;return c.k=b,c.j=y,b}(e,r):Yt("ES5").J(e,r);return(r?r.A:ja()).p.push(i),i}function zf(t){return fr(t)||Ct(22,t),function e(r){if(!Bt(r))return r;var i,n=r[me],a=Po(r);if(n){if(!n.P&&(n.i<4||!Yt("ES5").K(n)))return n.t;n.I=!0,i=Id(r,a),n.I=!1}else i=Id(r,a);return to(i,function(s,c){n&&Bf(n.t,s)===c||Nd(i,s,e(c))}),a===3?new Set(i):i}(t)}function Id(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Qa(t)}function Pd(){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 ci.get(u,s)},set:function(u){var m=this[me];ci.set(m,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)&&Er(p);break;case 4:r(p)&&Er(p)}}}function r(s){for(var c=s.t,p=s.k,u=_o(p),m=u.length-1;m>=0;m--){var y=u[m];if(y!==me){var b=c[y];if(b===void 0&&!No(c,y))return!0;var O=p[y],v=O&&O[me];if(v?v.t!==b:!_d(O,b))return!0}}var E=!!c[me];return u.length!==_o(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&&Ct(3,JSON.stringify(wr(s)))}var a={};Ff("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(y,b){if(y){for(var O=Array(b.length),v=0;v<b.length;v++)Object.defineProperty(O,""+v,t(v,!0));return O}var E=Dd(b);delete E[me];for(var $=_o(E),T=0;T<$.length;T++){var N=$[T];E[N]=t(N,y||!!E[N].enumerable)}return Object.create(Object.getPrototypeOf(b),E)}(p,s),m={i:p?5:4,A:c?c.A:ja(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,me,{value:m,writable:!0}),u},S:function(s,c,p){p?fr(c)&&c[me].A===s&&e(s.p):(s.u&&function u(m){if(m&&typeof m=="object"){var y=m[me];if(y){var b=y.t,O=y.k,v=y.R,E=y.i;if(E===4)to(O,function(Z){Z!==me&&(b[Z]!==void 0||No(b,Z)?v[Z]||u(O[Z]):(v[Z]=!0,Er(y)))}),to(b,function(Z){O[Z]!==void 0||No(O,Z)||(v[Z]=!1,Er(y))});else if(E===5){if(i(y)&&(Er(y),v.length=!0),O.length<b.length)for(var $=O.length;$<b.length;$++)v[$]=!1;else for(var T=b.length;T<O.length;T++)v[T]=!0;for(var N=Math.min(O.length,b.length),z=0;z<N;z++)O.hasOwnProperty(z)||(v[z]=!0),v[z]===void 0&&u(O[z])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):i(s)}})}var kd,li,ts=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Uf=typeof Map<"u",Hf=typeof Set<"u",Td=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Bd=ts?Symbol.for("immer-nothing"):((kd={})["immer-nothing"]=!0,kd),$d=ts?Symbol.for("immer-draftable"):"__$immer_draftable",me=ts?Symbol.for("immer-state"):"__$immer_state";var Wf=""+Object.prototype.constructor,_o=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Dd=Object.getOwnPropertyDescriptors||function(t){var e={};return _o(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},qa={},ci={get:function(t,e){if(e===me)return t;var r=wr(t);if(!No(r,e))return function(n,a,s){var c,p=Ld(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||!Bt(i)?i:i===Va(t.t,e)?(Ga(t),t.o[e]=Za(t.A.h,i,t)):i},has:function(t,e){return e in wr(t)},ownKeys:function(t){return Reflect.ownKeys(wr(t))},set:function(t,e,r){var i=Ld(wr(t),e);if(i?.set)return i.set.call(t.k,r),!0;if(!t.P){var n=Va(wr(t),e),a=n?.[me];if(a&&a.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(_d(r,n)&&(r!==void 0||No(t.t,e)))return!0;Ga(t),Er(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 Va(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Ga(t),Er(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=wr(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty:function(){Ct(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Ct(12)}},si={};to(ci,function(t,e){si[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),si.deleteProperty=function(t,e){return si.set.call(this,t,e,void 0)},si.set=function(t,e,r){return ci.set.call(this,t[0],e,r,t[0])};var Vf=function(){function t(r){var i=this;this.O=Td,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,N=Array(T>1?T-1:0),z=1;z<T;z++)N[z-1]=arguments[z];return p.produce(E,function(Z){var X;return(X=a).call.apply(X,[$,Z].concat(N))})}}var u;if(typeof a!="function"&&Ct(6),s!==void 0&&typeof s!="function"&&Ct(7),Bt(n)){var m=Ad(i),y=Za(i,n,void 0),b=!0;try{u=a(y),b=!1}finally{b?tn(m):Ka(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(E){return Ha(m,s),Wa(E,m)},function(E){throw tn(m),E}):(Ha(m,s),Wa(u,m))}if(!n||typeof n!="object"){if((u=a(n))===void 0&&(u=n),u===Bd&&(u=void 0),i.D&&Ja(u,!0),s){var O=[],v=[];Yt("Patches").M(n,u,O,v),s(O,v)}return u}Ct(21,n)},this.produceWithPatches=function(n,a){if(typeof n=="function")return function(u){for(var m=arguments.length,y=Array(m>1?m-1:0),b=1;b<m;b++)y[b-1]=arguments[b];return i.produceWithPatches(u,function(O){return n.apply(void 0,[O].concat(y))})};var s,c,p=i.produce(n,a,function(u,m){s=u,c=m});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){Bt(r)||Ct(8),fr(r)&&(r=zf(r));var i=Ad(this),n=Za(this,r,void 0);return n[me].C=!0,Ka(i),n},e.finishDraft=function(r,i){var n=r&&r[me],a=n.A;return Ha(a,i),Wa(void 0,a)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!Td&&Ct(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=Yt("Patches").$;return fr(r)?s(r,i):this.produce(r,function(c){return s(c,i)})},t}(),ut=new Vf,Gf=ut.produce,PS=ut.produceWithPatches.bind(ut),BS=ut.setAutoFreeze.bind(ut),DS=ut.setUseProxies.bind(ut),FS=ut.applyPatches.bind(ut),MS=ut.createDraft.bind(ut),zS=ut.finishDraft.bind(ut),nn=Gf;function ro(t){"@babel/helpers - typeof";return ro=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},ro(t)}function Fd(t,e){if(ro(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(ro(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Md(t){var e=Fd(t,"string");return ro(e)=="symbol"?e:e+""}function zd(t,e,r){return(e=Md(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ud(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 rs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ud(Object(r),!0).forEach(function(i){zd(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ud(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function je(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 Hd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),os=function(){return Math.random().toString(36).substring(7).split("").join(".")},an={INIT:"@@redux/INIT"+os(),REPLACE:"@@redux/REPLACE"+os(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+os()}};function jf(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 is(t,e,r){var i;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(je(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(je(1));return r(is)(t,e)}if(typeof t!="function")throw new Error(je(2));var n=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function m(){if(p)throw new Error(je(3));return a}function y(E){if(typeof E!="function")throw new Error(je(4));if(p)throw new Error(je(5));var $=!0;return u(),c.push(E),function(){if($){if(p)throw new Error(je(6));$=!1,u();var N=c.indexOf(E);c.splice(N,1),s=null}}}function b(E){if(!jf(E))throw new Error(je(7));if(typeof E.type>"u")throw new Error(je(8));if(p)throw new Error(je(9));try{p=!0,a=n(a,E)}finally{p=!1}for(var $=s=c,T=0;T<$.length;T++){var N=$[T];N()}return E}function O(E){if(typeof E!="function")throw new Error(je(10));n=E,b({type:an.REPLACE})}function v(){var E,$=y;return E={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(je(11));function z(){N.next&&N.next(m())}z();var Z=$(z);return{unsubscribe:Z}}},E[Hd]=function(){return this},E}return b({type:an.INIT}),i={dispatch:b,subscribe:y,getState:m,replaceReducer:O},i[Hd]=v,i}function Kf(t){Object.keys(t).forEach(function(e){var r=t[e],i=r(void 0,{type:an.INIT});if(typeof i>"u")throw new Error(je(12));if(typeof r(void 0,{type:an.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(je(13))})}function Wd(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{Kf(r)}catch(p){c=p}return function(u,m){if(u===void 0&&(u={}),c)throw c;if(0)var y;for(var b=!1,O={},v=0;v<a.length;v++){var E=a[v],$=r[E],T=u[E],N=$(T,m);if(typeof N>"u"){var z=m&&m.type;throw new Error(je(14))}O[E]=N,b=b||N!==T}return b=b||a.length!==Object.keys(u).length,b?O:u}}function Bo(){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 Vd(){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(je(15))},s={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=Bo.apply(void 0,c)(n.dispatch),rs(rs({},n),{},{dispatch:a})}}}function Gd(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 jd=Gd();jd.withExtraArgument=Gd;var ns=jd;var Xd=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)}}(),Zf=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(m){return p([u,m])}}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(m){u=[6,m],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Do=function(t,e){for(var r=0,i=e.length,n=t.length;r<i;r++,n++)t[n]=e[r];return t},qf=Object.defineProperty,Yf=Object.defineProperties,Xf=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertySymbols,Qf=Object.prototype.hasOwnProperty,Jf=Object.prototype.propertyIsEnumerable,Zd=function(t,e,r){return e in t?qf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Ar=function(t,e){for(var r in e||(e={}))Qf.call(e,r)&&Zd(t,r,e[r]);if(Kd)for(var i=0,n=Kd(e);i<n.length;i++){var r=n[i];Jf.call(e,r)&&Zd(t,r,e[r])}return t},as=function(t,e){return Yf(t,Xf(e))},eh=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 th=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bo:Bo.apply(null,arguments)},iO=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function rh(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 oh=function(t){Xd(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,Do([void 0],r[0].concat(this)))):new(e.bind.apply(e,Do([void 0],r.concat(this))))},e}(Array),ih=function(t){Xd(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,Do([void 0],r[0].concat(this)))):new(e.bind.apply(e,Do([void 0],r.concat(this))))},e}(Array);function cs(t){return Bt(t)?nn(t,function(){}):t}function nh(t){return typeof t=="boolean"}function ah(){return function(e){return sh(e)}}function sh(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 oh;if(r&&(nh(r)?c.push(ns):c.push(ns.withExtraArgument(r.extraArgument))),0){if(n)var p;if(s)var u}return c}var ss=!0;function Qd(t){var e=ah(),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,m=u===void 0?void 0:u,y=r.enhancers,b=y===void 0?void 0:y,O;if(typeof n=="function")O=n;else if(rh(n))O=Wd(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 v=s;if(typeof v=="function"&&(v=v(e),!ss&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ss&&v.some(function(Z){return typeof Z!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=Vd.apply(void 0,v),$=Bo;p&&($=th(Ar({trace:!ss},typeof p=="object"&&p)));var T=new ih(E),N=T;Array.isArray(b)?N=Do([E],b):typeof b=="function"&&(N=b(T));var z=$.apply(void 0,N);return is(O,m,z)}function Rr(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 Ar(Ar({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 Jd(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 lh(t){return typeof t=="function"}function ch(t,e,r,i){r===void 0&&(r=[]);var n=typeof e=="function"?Jd(e):[e,r,i],a=n[0],s=n[1],c=n[2],p;if(lh(t))p=function(){return cs(t())};else{var u=cs(t);p=function(){return u}}function m(y,b){y===void 0&&(y=p());var O=Do([a[b.type]],s.filter(function(v){var E=v.matcher;return E(b)}).map(function(v){var E=v.reducer;return E}));return O.filter(function(v){return!!v}).length===0&&(O=[c]),O.reduce(function(v,E){if(E)if(fr(v)){var $=v,T=E($,b);return T===void 0?v:T}else{if(Bt(v))return nn(v,function(N){return E(N,b)});var T=E(v,b);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},y)}return m.getInitialState=p,m}function dh(t,e){return t+"/"+e}function ep(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:cs(t.initialState),i=t.reducers||{},n=Object.keys(i),a={},s={},c={};n.forEach(function(m){var y=i[m],b=dh(e,m),O,v;"reducer"in y?(O=y.reducer,v=y.prepare):O=y,a[m]=O,s[b]=O,c[m]=v?Rr(b,v):Rr(b)});function p(){var m=typeof t.extraReducers=="function"?Jd(t.extraReducers):[t.extraReducers],y=m[0],b=y===void 0?{}:y,O=m[1],v=O===void 0?[]:O,E=m[2],$=E===void 0?void 0:E,T=Ar(Ar({},b),s);return ch(r,function(N){for(var z in T)N.addCase(z,T[z]);for(var Z=0,X=v;Z<X.length;Z++){var rt=X[Z];N.addMatcher(rt.matcher,rt.reducer)}$&&N.addDefaultCase($)})}var u;return{name:e,reducer:function(m,y){return u||(u=p()),u(m,y)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var ph="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",uh=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=ph[Math.random()*64|0];return e},fh=["name","message","stack","code"],ls=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),qd=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),hh=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,i=fh;r<i.length;r++){var n=i[r];typeof t[n]=="string"&&(e[n]=t[n])}return e}return{message:String(t)}},lO=function(){function t(e,r,i){var n=Rr(e+"/fulfilled",function(m,y,b,O){return{payload:m,meta:as(Ar({},O||{}),{arg:b,requestId:y,requestStatus:"fulfilled"})}}),a=Rr(e+"/pending",function(m,y,b){return{payload:void 0,meta:as(Ar({},b||{}),{arg:y,requestId:m,requestStatus:"pending"})}}),s=Rr(e+"/rejected",function(m,y,b,O,v){return{payload:O,error:(i&&i.serializeError||hh)(m||"Rejected"),meta:as(Ar({},v||{}),{arg:b,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(y,b,O){var v=i?.idGenerator?i.idGenerator(m):uh(),E=new p,$,T=!1;function N(Z){$=Z,E.abort()}var z=function(){return eh(this,null,function(){var Z,X,rt,Wt,Ye,Vt,De;return Zf(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),Wt=(Z=i?.condition)==null?void 0:Z.call(i,m,{getState:b,extra:O}),mh(Wt)?[4,Wt]:[3,2];case 1:Wt=g.sent(),g.label=2;case 2:if(Wt===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=!0,Ye=new Promise(function(x,_){return E.signal.addEventListener("abort",function(){return _({name:"AbortError",message:$||"Aborted"})})}),y(a(v,m,(X=i?.getPendingMeta)==null?void 0:X.call(i,{requestId:v,arg:m},{getState:b,extra:O}))),[4,Promise.race([Ye,Promise.resolve(r(m,{dispatch:y,getState:b,extra:O,requestId:v,signal:E.signal,abort:N,rejectWithValue:function(x,_){return new ls(x,_)},fulfillWithValue:function(x,_){return new qd(x,_)}})).then(function(x){if(x instanceof ls)throw x;return x instanceof qd?n(x.payload,v,m,x.meta):n(x,v,m)})])];case 3:return rt=g.sent(),[3,5];case 4:return Vt=g.sent(),rt=Vt instanceof ls?s(null,v,m,Vt.payload,Vt.meta):s(Vt,v,m),[3,5];case 5:return De=i&&!i.dispatchConditionRejection&&s.match(rt)&&rt.meta.condition,De||y(rt),[2,rt]}})})}();return Object.assign(z,{abort:N,requestId:v,arg:m,unwrap:function(){return z.then(yh)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:n,typePrefix:e})}return t.withTypes=function(){return t},t}();function yh(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function mh(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var tp="listener",rp="completed",op="cancelled",cO="task-"+op,dO="task-"+rp,pO=tp+"-"+op,uO=tp+"-"+rp;var ds="listenerMiddleware";var fO=Rr(ds+"/add"),hO=Rr(ds+"/removeAll"),yO=Rr(ds+"/remove");var Yd,mO=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Yd||(Yd=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},gh=function(t){return function(e){setTimeout(e,t)}},gO=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:gh(10);Pd();var bh=qi(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)}}}),sn=class extends bh(Object){};window.ftReduxStores||(window.ftReduxStores={});var ip=class t extends sn{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(en(a))return a;if(n==null)return;let s=ep({...n,reducers:(r=n.reducers)!==null&&r!==void 0?r:{}}),c=Qd({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 Yi;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?(...m)=>{let y=u(...m.map(n));return this.reduxStore.dispatch(y),y}:m=>{this.setState({[p]:n(m)})}}}),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 ln=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 np=f(w()),cn=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},WO=(0,np.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(I)}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=>ln.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return cn([(0,ps.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),cn([(0,ps.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),cn([Ua({store:I.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),cn([Ua({store:I.name})],e.prototype,"uiLocale",void 0),e});var un=f(w());var dn=class extends pt{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var pn=class extends pt{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=I.getState().session;return!!e?.sessionAuthenticated}};var xh="ft-user-assets",vh={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(Ot).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;fs(t,r,[...us(t,r),n]),ap(t,r,1,i),sp(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;fs(t,r,us(t,r).map(n=>n.id===i.id?i:n)),sp(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;fs(t,r,us(t,r).filter(a=>a.id!==n)),ap(t,r,-1,i)}},lp={[Ot.SEARCHES]:"savedSearches",[Ot.BOOKMARKS]:"bookmarks",[Ot.BOOKS]:void 0,[Ot.COLLECTIONS]:void 0},us=(t,e)=>{var r;let i=lp[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},fs=(t,e,r)=>{let i=lp[e];i&&(t[i]=r)},ap=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===Ot.BOOKMARKS&&i)){let a=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,a+r)}},sp=(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)},ft=un.FtReduxStore.get({name:xh,reducers:vh,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ot).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),hs=class{constructor(e=new dn,r=new pn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Hi,this.savedSearchesService=new ji,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=I.getState();(0,un.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(),ft.actions.clearAssetCount(),ft.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ft.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ft.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ft.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ft.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ft.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ft.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ft.getState().assetCounts.bookmarkByMap).length!==0;e===Ot.BOOKMARKS&&r&&ft.actions.clearBookmarkCountByMap(),ft.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;ft.actions.bookmarks(r)}}},Sh=new hs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Sh);(0,cp.customElement)("ft-app-context")(de);var dp=f(ee());var ys=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-]+$/)}},Fo=new ys;var Oh=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},pi=Symbol("i18nAttributes"),pp=Symbol("i18nListAttributes"),up=Symbol("i18nProperties"),fn=Symbol("i18nContexts"),di=Symbol("i18nUnsubs"),mn=(0,Mo.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?Ba:oi}i18n(a){let{context:s,key:c,message:p}=a,{custom:u,args:m,argsProvider:y}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,u);let b=m??(y?y(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(Fo.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=(m,y,b)=>b?.context&&b.key&&a(m,y,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...m})}:b;(s=this[pi])===null||s===void 0||s.forEach((m,y)=>p[y]=u(m,y,p[y])),(c=this[pp])===null||c===void 0||c.forEach((m,y)=>{var b;return p[y]=(b=p[y])===null||b===void 0?void 0:b.map(O=>u(m,y,O))})}updateI18nProperties(a){var s;(s=this[up])===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[fn].set(p,{isCustomContext:c}),this[di].has(p)||this[di].set(p,this.getI18nService(c).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(c).prepareContext(p,s)}hasI18nContext(a){return this[fn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[fn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[di].forEach(a=>a()),this[di].clear()}}return e=fn,r=di,Oh([(0,dp.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),hn=class extends mn(Mo.FtLitElement){},yn=class extends mn(Mo.FtLitElementRedux){};var fp=f(w());var ms=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(i=>typeof i=="string"?Fo.fromAttribute(i):i):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},Ch=new ms;var hp=(t,e)=>(r,i)=>{var n;r.constructor.createProperty(i,{type:Object,hasChanged:fp.hasChanged,converter:Fo,...e}),r[pi]=(n=r[pi])!==null&&n!==void 0?n:new Map,r[pi].set(i,t??{})};var gp=f(w());var gn=f(k()),bn=f(ee()),xn=f(w());var yp=f(k());var mp=yp.css`
569
569
  `;var ui=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},Dt=class extends yn{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":gn.nothing:gn.html`