@fluid-topics/ft-combobox 2.1.19 → 2.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { I18nMessageContext } from "@fluid-topics/ft-i18n";
1
+ import { I18nMessageContext, } from "@fluid-topics/ft-i18n";
2
2
  export const comboboxContext = I18nMessageContext.build("ftCombobox");
3
3
  export const defaultComboboxMessages = {
4
4
  "ariaLiveOptions": "{0} options",
@@ -916,7 +916,7 @@
916
916
  word-break: break-word;
917
917
  }
918
918
  `;var Rs=["top","right","bottom","left"],_s=["start","end"],un=Rs.reduce((t,e)=>t.concat(e,e+"-"+_s[0],e+"-"+_s[1]),[]),Er=Math.min,ct=Math.max,Cr=Math.round;var Ge=t=>({x:t,y:t}),Vc={left:"right",right:"left",bottom:"top",top:"bottom"};function Ls(t,e,r){return ct(t,Er(e,r))}function Qr(t,e){return typeof t=="function"?t(e):t}function wr(t){return t.split("-")[0]}function ut(t){return t.split("-")[1]}function dn(t){return t==="x"?"y":"x"}function pn(t){return t==="y"?"height":"width"}function ei(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function fn(t){return dn(ei(t))}function Ps(t,e,r){r===void 0&&(r=!1);let i=ut(t),n=fn(t),o=pn(n),s=n==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=cn(s)),[s,cn(s)]}function Ns(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}function cn(t){let e=wr(t);return Vc[e]+t.slice(e.length)}function jc(t){var e,r,i,n;return{top:(e=t.top)!=null?e:0,right:(r=t.right)!=null?r:0,bottom:(i=t.bottom)!=null?i:0,left:(n=t.left)!=null?n:0}}function Ds(t){return typeof t!="number"?jc(t):{top:t,right:t,bottom:t,left:t}}function wt(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 Is(t,e,r){let{reference:i,floating:n}=t,o=ei(e),s=fn(e),a=pn(s),l=wr(e),c=o==="y",u=i.x+i.width/2-n.width/2,d=i.y+i.height/2-n.height/2,p=i[a]/2-n[a]/2,h;switch(l){case"top":h={x:u,y:i.y-n.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-n.width,y:d};break;default:h={x:i.x,y:i.y}}let m=ut(e);return m&&(h[s]+=p*(m==="end"?1:-1)*(r&&c?-1:1)),h}async function ks(t,e){var r;e===void 0&&(e={});let{x:i,y:n,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Qr(e,t),m=Ds(h),b=a[p?d==="floating"?"reference":"floating":d],x=wt(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{x:i,y:n,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(_))&&await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1},ee=wt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:_,strategy:l}):S);return{top:(x.top-ee.top+m.top)/P.y,bottom:(ee.bottom-x.bottom+m.bottom)/P.y,left:(x.left-ee.left+m.left)/P.x,right:(ee.right-x.right+m.right)/P.x}}var Fc=50,Ms=async(t,e,r)=>{let{placement:i="bottom",strategy:n="absolute",middleware:o=[],platform:s}=r,a=s.detectOverflow?s:{...s,detectOverflow:ks},l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:n}),{x:u,y:d}=Is(c,i,l),p=i,h=0,m={};for(let g=0;g<o.length;g++){let b=o[g];if(!b)continue;let{name:x,fn:S}=b,{x:_,y:P,data:ee,reset:X}=await S({x:u,y:d,initialPlacement:i,placement:p,strategy:n,middlewareData:m,rects:c,platform:a,elements:{reference:t,floating:e}});u=_??u,d=P??d,m[x]={...m[x],...ee},X&&h<Fc&&(h++,typeof X=="object"&&(X.placement&&(p=X.placement),X.rects&&(c=X.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:n}):X.rects),{x:u,y:d}=Is(c,p,l)),g=-1)}return{x:u,y:d,placement:p,strategy:n,middlewareData:m}};function zc(t,e,r){return(t?[...r.filter(n=>ut(n)===t),...r.filter(n=>ut(n)!==t)]:r.filter(n=>wr(n)===n)).filter(n=>t?ut(n)===t||(e?Ns(n)!==n:!1):!0)}var $s=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,i,n;let{rects:o,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:p=un,autoAlignment:h=!0,...m}=Qr(t,e),g=d!==void 0||p===un?zc(d||null,h,p):p,b=((r=s.autoPlacement)==null?void 0:r.index)||0,x=g[b];if(x==null)return{};if(a!==x)return{reset:{placement:g[0]}};let S=await l.detectOverflow(e,m),_=Ps(x,o,await(l.isRTL==null?void 0:l.isRTL(c.floating))),P=[S[wr(x)],S[_[0]],S[_[1]]],ee=[...((i=s.autoPlacement)==null?void 0:i.overflows)||[],{placement:x,overflows:P}],X=g[b+1];if(X)return{data:{index:b+1,overflows:ee},reset:{placement:X}};let rt=ee.map(xe=>{let Re=ut(xe.placement);return[xe.placement,Re&&u?xe.overflows.slice(0,2).reduce((Se,yt)=>Se+yt,0):xe.overflows[0],xe.overflows]}).sort((xe,Re)=>xe[1]-Re[1]),it=((n=rt.filter(xe=>xe[2].slice(0,ut(xe[0])?2:3).every(Re=>Re<=0))[0])==null?void 0:n[0])||rt[0][0];return it!==a?{data:{index:b+1,overflows:ee},reset:{placement:it}}:{}}}};var Us=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:i,placement:n,platform:o}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:_,y:P}=S;return{x:_,y:P}}},...c}=Qr(t,e),u={x:r,y:i},d=await o.detectOverflow(e,c),p=ei(n),h=dn(p),m=u[h],g=u[p],b=(S,_)=>Ls(_+d[S==="y"?"top":"left"],_,_-d[S==="y"?"bottom":"right"]);s&&(m=b(h,m)),a&&(g=b(p,g));let x=l.fn({...e,[h]:m,[p]:g});return{...x,data:{x:x.x-r,y:x.y-i,enabled:{[h]:s,[p]:a}}}}}};function ri(){return typeof window<"u"}function Tt(t){return Bs(t)?(t.nodeName||"").toLowerCase():"#document"}function ve(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Je(t){var e;return(e=(Bs(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Bs(t){return ri()?t instanceof Node||t instanceof ve(t).Node:!1}function Be(t){return ri()?t instanceof Element||t instanceof ve(t).Element:!1}function Qe(t){return ri()?t instanceof HTMLElement||t instanceof ve(t).HTMLElement:!1}function Hs(t){return!ri()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ve(t).ShadowRoot}function Or(t){let{overflow:e,overflowX:r,overflowY:i,display:n}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&n!=="inline"&&n!=="contents"}function Vs(t){return/^(table|td|th)$/.test(Tt(t))}function Tr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Wc=/transform|translate|scale|rotate|perspective|filter/,Kc=/paint|layout|strict|content/,Ot=t=>!!t&&t!=="none",hn;function Xt(t){let e=Be(t)?Ve(t):t;return Ot(e.transform)||Ot(e.translate)||Ot(e.scale)||Ot(e.rotate)||Ot(e.perspective)||!ii()&&(Ot(e.backdropFilter)||Ot(e.filter))||Wc.test(e.willChange||"")||Kc.test(e.contain||"")}function js(t){let e=dt(t);for(;Qe(e)&&!Zt(e);){if(Xt(e))return e;if(Tr(e))return null;e=dt(e)}return null}function ii(){return hn==null&&(hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hn}function Zt(t){return/^(html|body|#document)$/.test(Tt(t))}function Ve(t){return ve(t).getComputedStyle(t)}function _r(t){return Be(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dt(t){if(Tt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Hs(t)&&t.host||Je(t);return Hs(e)?e.host:e}function Fs(t){let e=dt(t);return Zt(e)?(t.ownerDocument||t).body:Qe(e)&&Or(e)?e:Fs(e)}function ti(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);let n=Fs(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=ve(n);if(o){let a=ni(s);return e.concat(s,s.visualViewport||[],Or(n)?n:[],a&&r?ti(a):[])}else return e.concat(n,ti(n,[],r))}function ni(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ks(t){let e=Ve(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=Qe(t),o=n?t.offsetWidth:r,s=n?t.offsetHeight:i,a=Cr(r)!==o||Cr(i)!==s;return a&&(r=o,i=s),{width:r,height:i,$:a}}function Gs(t){return Be(t)?t:t.contextElement}function Jt(t){let e=Gs(t);if(!Qe(e))return Ge(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:o}=Ks(e),s=(o?Cr(r.width):r.width)/i,a=(o?Cr(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Gc=Ge(0);function qs(t){let e=ve(t);return!ii()||!e.visualViewport?Gc:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qc(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===ve(t)}function Rr(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);let n=t.getBoundingClientRect(),o=Gs(t),s=Ge(1);e&&(i?Be(i)&&(s=Jt(i)):s=Jt(t));let a=qc(o,r,i)?qs(o):Ge(0),l=(n.left+a.x)/s.x,c=(n.top+a.y)/s.y,u=n.width/s.x,d=n.height/s.y;if(o&&i){let p=ve(o),h=Be(i)?ve(i):i,m=p,g=ni(m);for(;g&&h!==m;){let b=Jt(g),x=g.getBoundingClientRect(),S=Ve(g),_=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*b.x,P=x.top+(g.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=_,c+=P,m=ve(g),g=ni(m)}}return wt({width:u,height:d,x:l,y:c})}function oi(t,e){let r=_r(t).scrollLeft;return e?e.left+r:Rr(Je(t)).left+r}function Ys(t,e){let r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-oi(t,r),n=r.top+e.scrollTop;return{x:i,y:n}}function Yc(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t,o=n==="fixed",s=Je(i),a=e?Tr(e.floating):!1;if(i===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Ge(1),u=Ge(0),d=Qe(i);if((d||!o)&&((Tt(i)!=="body"||Or(s))&&(l=_r(i)),d)){let h=Rr(i);c=Jt(i),u.x=h.x+i.clientLeft,u.y=h.y+i.clientTop}let p=s&&!d&&!o?Ys(s,l):Ge(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Xc(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Zc(t){let e=_r(t),r=t.ownerDocument.body,i=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),n=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-e.scrollLeft+oi(t),s=-e.scrollTop;return Ve(r).direction==="rtl"&&(o+=ct(t.clientWidth,r.clientWidth)-i),{width:i,height:n,x:o,y:s}}var Jc=25;function Qc(t,e,r){r===void 0&&(r="viewport");let i=r==="layoutViewport",n=ve(t),o=Je(t),s=n.visualViewport,a=o.clientWidth,l=o.clientHeight,c=0,u=0;if(s){let p=!ii()||e==="fixed";i?p||(c=-s.offsetLeft,u=-s.offsetTop):(a=s.width,l=s.height,p&&(c=s.offsetLeft,u=s.offsetTop))}if(oi(o)<=0){let p=o.ownerDocument,h=p.body,m=getComputedStyle(h),g=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(o.clientWidth-h.clientWidth-g),x=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;x<=Jc&&(a-=x)}return{width:a,height:l,x:c,y:u}}function eu(t,e){let r=Rr(t,!0,e==="fixed"),i=r.top+t.clientTop,n=r.left+t.clientLeft,o=Jt(t),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=n*o.x,c=i*o.y;return{width:s,height:a,x:l,y:c}}function zs(t,e,r){let i;if(e==="viewport"||e==="layoutViewport")i=Qc(t,r,e);else if(e==="document")i=Zc(Je(t));else if(Be(e))i=eu(e,r);else{let n=qs(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return wt(i)}function tu(t,e){let r=e.get(t);if(r)return r;let i=ti(t,[],!1).filter(a=>Be(a)&&Tt(a)!=="body"),n=null,o=Ve(t).position==="fixed",s=o?dt(t):t;for(;Be(s)&&!Zt(s);){let a=Ve(s),l=Xt(s),c=n?n.position:o?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?i=i.filter(d=>d!==s):n=a,s=dt(s)}return e.set(t,i),i}function ru(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[...r==="clippingAncestors"?Tr(e)?[]:tu(e,this._c):[].concat(r),i],a=zs(e,s[0],n),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let p=1;p<s.length;p++){let h=zs(e,s[p],n);l=ct(h.top,l),c=Er(h.right,c),u=Er(h.bottom,u),d=ct(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function iu(t){let{width:e,height:r}=Ks(t);return{width:e,height:r}}function nu(t,e,r){let i=Qe(e),n=Je(e),o=r==="fixed",s=Rr(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Ge(0);if((i||!o)&&((Tt(e)!=="body"||Or(n))&&(a=_r(e)),i)){let p=Rr(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}!i&&n&&(l.x=oi(n));let c=n&&!i&&!o?Ys(n,a):Ge(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function mn(t){return Ve(t).position==="static"}function Ws(t,e){if(!Qe(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Je(t)===r&&(r=r.ownerDocument.body),r}function Xs(t,e){let r=ve(t);if(Tr(t))return r;if(!Qe(t)){let n=dt(t);for(;n&&!Zt(n);){if(Be(n)&&!mn(n))return n;n=dt(n)}return r}let i=Ws(t,e);for(;i&&Vs(i)&&mn(i);)i=Ws(i,e);return i&&Zt(i)&&mn(i)&&!Xt(i)?r:i||js(t)||r}var ou=async function(t){let e=this.getOffsetParent||Xs,r=this.getDimensions,i=await r(t.floating);return{reference:nu(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function su(t){return Ve(t).direction==="rtl"}var si={convertOffsetParentRelativeRectToViewportRelativeRect:Yc,getDocumentElement:Je,getClippingRect:ru,getOffsetParent:Xs,getElementRects:ou,getClientRects:Xc,getDimensions:iu,getScale:Jt,isElement:Be,isRTL:su};var Zs=$s,Js=Us;var Qs=(t,e,r)=>{let i=new Map,n=r??{},o={...si,...n.platform,_c:i};return Ms(t,e,{...n,platform:o})};function ea(t){return au(t)}function gn(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function au(t){for(let e=t;e;e=gn(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=gn(t);e;e=gn(e)){if(!(e instanceof Element))continue;let r=getComputedStyle(e);if(r.display!=="contents"&&(r.position!=="static"||Xt(r)||e.tagName==="BODY"))return e}return null}async function ta(t,e,r){let i;return typeof r=="object"?i=r:i={placement:r},Qs(t,e,{strategy:i.strategy,platform:{...si,getOffsetParent:n=>si.getOffsetParent(n,ea)},middleware:[Js({crossAxis:!0}),Zs({allowedPlacements:[i.placement]})]})}var dr=f(E());var jn=f(te());var ra=f(te(),1);var vn=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function ia(t,e){return(0,ra.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Lr(t);try{return JSON.parse(r)}catch{return Lr(t)}},toAttribute:r=>JSON.stringify(r)},hasChanged:Pr,...e??{}})}function lu(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;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(!ai(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(!ai(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 n=s=>Object.keys(s).filter(a=>s[a]!=null),o=n(t);if(r=o.length,r!==n(e).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[i]))return!1;for(i=r;i--!==0;){let s=o[i];if(!ai(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function ai(t,e){try{return lu(t,e)}catch{return!1}}function Pr(t,e){return!ai(t,e)}function Lr(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function li(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 na=f(te(),1);var yn=t=>{let e=t??{};return(r,i)=>{var n;let o={hasChanged:Pr,attribute:!1,...e};(0,na.property)(o)(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:(a=>a[i]),store:e.store})}};var ci=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 _t=f(te(),1);var ui=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),o=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let s of i)try{await s()}catch(a){n(a);return}o(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var sa=f(V(),1);var di=globalThis,cu=di.ShadowRoot&&(di.ShadyCSS===void 0||di.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var oa=(t,e)=>{if(cu)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=di.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}};var pi=class extends sa.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(r);return oa(i,e.elementStyles),i}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,i])=>this.defineScopedElement(r,i))}static defineScopedElement(e,r){vn(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function aa(t,e,...r){var i;let n=t.querySelector(e);for(let o of r)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(o);return n}var er=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},da,la=Symbol("constructorPrototype"),ca=Symbol("constructorName"),pa=Symbol("exportpartsDebouncer"),ua=Symbol("dynamicDependenciesLoaded"),Qt=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Qt.eventName="exportparts-updated";var qe=class extends pi{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[da]=new ui(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[pa].run(()=>{var n,o;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[ca]=this.constructor.name,this[la]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[ca]&&Object.setPrototypeOf(this,this[la])}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[ua]||(r[ua]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Qt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Qt.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 Qt)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let o=[...n??[],i];r=aa(this.shadowRoot,...o)}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(o=>o.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(o){console.error(o,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let o=document.createElement("style");o.classList.add("ft-lit-element--custom-stylesheet"),o.innerHTML=this.customStylesheet,this.shadowRoot.append(o)}}setExportpartsAttribute(e){var r,i,n,o,s,a;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let h=(o=(n=p.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&o!==void 0?o:[],m=(a=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(b=>b.split(":")[1]))!==null&&a!==void 0?a:[],g=[...h,...m].filter(l).map(b=>b.trim());for(let b of g)u.add(b)}if(u.size===0){this.exportparts=void 0;return}let d=[...u.values()].flatMap(p=>c.map(h=>`${p}:${h}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};da=pa;er([(0,_t.property)()],qe.prototype,"exportpartsPrefix",void 0);er([ia([])],qe.prototype,"exportpartsPrefixes",void 0);er([(0,_t.property)({reflect:!0})],qe.prototype,"exportparts",void 0);er([(0,_t.property)()],qe.prototype,"customStylesheet",void 0);er([(0,_t.property)()],qe.prototype,"elementToFocus",void 0);er([(0,_t.state)()],qe.prototype,"useAdoptedStyleSheets",void 0);function fi(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Nr=Symbol("internalReduxEventsUnsubscribers"),pt=Symbol("internalStoresUnsubscribers"),Rt=Symbol("internalStores"),uu=li(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(a=>s.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Rt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Rt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Rt].get(s)}addStore(s,a){var l;a=(l=a??s.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Rt].set(a,s),this.subscribeToStore(a,s),this.updateFromStores()}removeStore(s){let a=typeof s=="string"?s:s.name;this.unsubscribeFromStore(a),this[Rt].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Rt].forEach((s,a)=>this.subscribeToStore(a,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let c=this.getStore(s.store);c&&(s.store?this[pt].has(s.store):this[pt].size>0)&&(this[a]=s.selector(c.getState(),this))}})}subscribeToStore(s,a){var l;this[pt].set(s,a.subscribe(()=>this.updateFromStores())),this[Nr].set(s,[]),fi(a)&&a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((c,u)=>{if(typeof this[u]=="function"&&(!c.store||a.name===c.store)){let d=p=>this[u](p);a.addEventListener(c.eventName,d),this[Nr].get(s).push(()=>a.removeEventListener(c.eventName,d))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[pt].forEach((s,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(s){var a;this[pt].has(s)&&this[pt].get(s)(),this[pt].delete(s),(a=this[Nr].get(s))===null||a===void 0||a.forEach(l=>l()),this[Nr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=pt,r=Rt,i=Nr,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),fa=class extends uu(qe){};function De(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,o;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 et(t){return!!t&&!!t[z]}function je(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)===yu})(t)||Array.isArray(t)||!!t[xa]||!!(!((e=t.constructor)===null||e===void 0)&&e[xa])||Tn(t)||_n(t))}function Lt(t,e,r){r===void 0&&(r=!1),ir(t)===0?(r?Object.keys:rr)(t).forEach((function(i){r&&typeof i=="symbol"||e(i,t[i],t)})):t.forEach((function(i,n){return e(n,i,t)}))}function ir(t){var e=t[z];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Tn(t)?2:_n(t)?3:0}function tr(t,e){return ir(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function du(t,e){return ir(t)===2?t.get(e):t[e]}function Sa(t,e,r){var i=ir(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function Aa(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Tn(t){return gu&&t instanceof Map}function _n(t){return vu&&t instanceof Set}function ft(t){return t.o||t.t}function Rn(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=wa(t);delete e[z];for(var r=rr(e),i=0;i<r.length;i++){var n=r[i],o=e[n];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function Ln(t,e){return e===void 0&&(e=!1),Pn(t)||et(t)||!je(t)||(ir(t)>1&&(t.set=t.add=t.clear=t.delete=pu),Object.freeze(t),e&&Lt(t,(function(r,i){return Ln(i,!0)}),!0)),t}function pu(){De(2)}function Pn(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Ye(t){var e=On[t];return e||De(18,t),e}function fu(t,e){On[t]||(On[t]=e)}function En(){return Ir}function bn(t,e){e&&(Ye("Patches"),t.u=[],t.s=[],t.v=e)}function hi(t){Cn(t),t.p.forEach(hu),t.p=null}function Cn(t){t===Ir&&(Ir=t.l)}function ha(t){return Ir={p:[],l:Ir,h:t,m:!0,_:0}}function hu(t){var e=t[z];e.i===0||e.i===1?e.j():e.g=!0}function xn(t,e){e._=e.p.length;var r=e.p[0],i=t!==void 0&&t!==r;return e.h.O||Ye("ES5").S(e,t,i),i?(r[z].P&&(hi(e),De(4)),je(t)&&(t=mi(e,t),e.l||gi(e,t)),e.u&&Ye("Patches").M(r[z].t,t,e.u,e.s)):t=mi(e,r,[]),hi(e),e.u&&e.v(e.u,e.s),t!==Ca?t:void 0}function mi(t,e,r){if(Pn(e))return e;var i=e[z];if(!i)return Lt(e,(function(a,l){return ma(t,i,e,a,l,r)}),!0),e;if(i.A!==t)return e;if(!i.P)return gi(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=Rn(i.k):i.o,o=n,s=!1;i.i===3&&(o=new Set(n),n.clear(),s=!0),Lt(o,(function(a,l){return ma(t,i,n,a,l,r,s)})),gi(t,n,!1),r&&t.u&&Ye("Patches").N(i,r,t.u,t.s)}return i.o}function ma(t,e,r,i,n,o,s){if(et(n)){var a=mi(t,n,o&&e&&e.i!==3&&!tr(e.R,i)?o.concat(i):void 0);if(Sa(r,i,a),!et(a))return;t.m=!1}else s&&r.add(n);if(je(n)&&!Pn(n)){if(!t.h.D&&t._<1)return;mi(t,n),e&&e.A.l||gi(t,n)}}function gi(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Ln(e,r)}function Sn(t,e){var r=t[z];return(r?ft(r):t)[e]}function ga(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 ht(t){t.P||(t.P=!0,t.l&&ht(t.l))}function An(t){t.o||(t.o=Rn(t.t))}function wn(t,e,r){var i=Tn(e)?Ye("MapSet").F(e,r):_n(e)?Ye("MapSet").T(e,r):t.O?(function(n,o){var s=Array.isArray(n),a={i:s?1:0,A:o?o.A:En(),P:!1,I:!1,R:{},l:o,t:n,k:null,o:null,j:null,C:!1},l=a,c=kr;s&&(l=[a],c=Dr);var u=Proxy.revocable(l,c),d=u.revoke,p=u.proxy;return a.k=p,a.j=d,p})(e,r):Ye("ES5").J(e,r);return(r?r.A:En()).p.push(i),i}function mu(t){return et(t)||De(22,t),(function e(r){if(!je(r))return r;var i,n=r[z],o=ir(r);if(n){if(!n.P&&(n.i<4||!Ye("ES5").K(n)))return n.t;n.I=!0,i=va(r,o),n.I=!1}else i=va(r,o);return Lt(i,(function(s,a){n&&du(n.t,s)===a||Sa(i,s,e(a))})),o===3?new Set(i):i})(t)}function va(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Rn(t)}function Ea(){function t(s,a){var l=o[s];return l?l.enumerable=a:o[s]=l={configurable:!0,enumerable:a,get:function(){var c=this[z];return kr.get(c,s)},set:function(c){var u=this[z];kr.set(u,s,c)}},l}function e(s){for(var a=s.length-1;a>=0;a--){var l=s[a][z];if(!l.P)switch(l.i){case 5:i(l)&&ht(l);break;case 4:r(l)&&ht(l)}}}function r(s){for(var a=s.t,l=s.k,c=rr(l),u=c.length-1;u>=0;u--){var d=c[u];if(d!==z){var p=a[d];if(p===void 0&&!tr(a,d))return!0;var h=l[d],m=h&&h[z];if(m?m.t!==p:!Aa(h,p))return!0}}var g=!!a[z];return c.length!==rr(a).length+(g?0:1)}function i(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var c=0;c<a.length;c++)if(!a.hasOwnProperty(c))return!0;return!1}function n(s){s.g&&De(3,JSON.stringify(ft(s)))}var o={};fu("ES5",{J:function(s,a){var l=Array.isArray(s),c=(function(d,p){if(d){for(var h=Array(p.length),m=0;m<p.length;m++)Object.defineProperty(h,""+m,t(m,!0));return h}var g=wa(p);delete g[z];for(var b=rr(g),x=0;x<b.length;x++){var S=b[x];g[S]=t(S,d||!!g[S].enumerable)}return Object.create(Object.getPrototypeOf(p),g)})(l,s),u={i:l?5:4,A:a?a.A:En(),P:!1,I:!1,R:{},l:a,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,z,{value:u,writable:!0}),c},S:function(s,a,l){l?et(a)&&a[z].A===s&&e(s.p):(s.u&&(function c(u){if(u&&typeof u=="object"){var d=u[z];if(d){var p=d.t,h=d.k,m=d.R,g=d.i;if(g===4)Lt(h,(function(P){P!==z&&(p[P]!==void 0||tr(p,P)?m[P]||c(h[P]):(m[P]=!0,ht(d)))})),Lt(p,(function(P){h[P]!==void 0||tr(h,P)||(m[P]=!1,ht(d))}));else if(g===5){if(i(d)&&(ht(d),m.length=!0),h.length<p.length)for(var b=h.length;b<p.length;b++)m[b]=!1;else for(var x=p.length;x<h.length;x++)m[x]=!0;for(var S=Math.min(h.length,p.length),_=0;_<S;_++)h.hasOwnProperty(_)||(m[_]=!0),m[_]===void 0&&c(h[_])}}}})(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):i(s)}})}var ya,Ir,Nn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",gu=typeof Map<"u",vu=typeof Set<"u",ba=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ca=Nn?Symbol.for("immer-nothing"):((ya={})["immer-nothing"]=!0,ya),xa=Nn?Symbol.for("immer-draftable"):"__$immer_draftable",z=Nn?Symbol.for("immer-state"):"__$immer_state";var yu=""+Object.prototype.constructor,rr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,wa=Object.getOwnPropertyDescriptors||function(t){var e={};return rr(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},On={},kr={get:function(t,e){if(e===z)return t;var r=ft(t);if(!tr(r,e))return(function(n,o,s){var a,l=ga(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(n.k):void 0})(t,r,e);var i=r[e];return t.I||!je(i)?i:i===Sn(t.t,e)?(An(t),t.o[e]=wn(t.A.h,i,t)):i},has:function(t,e){return e in ft(t)},ownKeys:function(t){return Reflect.ownKeys(ft(t))},set:function(t,e,r){var i=ga(ft(t),e);if(i?.set)return i.set.call(t.k,r),!0;if(!t.P){var n=Sn(ft(t),e),o=n?.[z];if(o&&o.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Aa(r,n)&&(r!==void 0||tr(t.t,e)))return!0;An(t),ht(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 Sn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,An(t),ht(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ft(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty:function(){De(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){De(12)}},Dr={};Lt(kr,(function(t,e){Dr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Dr.deleteProperty=function(t,e){return Dr.set.call(this,t,e,void 0)},Dr.set=function(t,e,r){return kr.set.call(this,t[0],e,r,t[0])};var bu=(function(){function t(r){var i=this;this.O=ba,this.D=!0,this.produce=function(n,o,s){if(typeof n=="function"&&typeof o!="function"){var a=o;o=n;var l=i;return function(g){var b=this;g===void 0&&(g=a);for(var x=arguments.length,S=Array(x>1?x-1:0),_=1;_<x;_++)S[_-1]=arguments[_];return l.produce(g,(function(P){var ee;return(ee=o).call.apply(ee,[b,P].concat(S))}))}}var c;if(typeof o!="function"&&De(6),s!==void 0&&typeof s!="function"&&De(7),je(n)){var u=ha(i),d=wn(i,n,void 0),p=!0;try{c=o(d),p=!1}finally{p?hi(u):Cn(u)}return typeof Promise<"u"&&c instanceof Promise?c.then((function(g){return bn(u,s),xn(g,u)}),(function(g){throw hi(u),g})):(bn(u,s),xn(c,u))}if(!n||typeof n!="object"){if((c=o(n))===void 0&&(c=n),c===Ca&&(c=void 0),i.D&&Ln(c,!0),s){var h=[],m=[];Ye("Patches").M(n,c,h,m),s(h,m)}return c}De(21,n)},this.produceWithPatches=function(n,o){if(typeof n=="function")return function(c){for(var u=arguments.length,d=Array(u>1?u-1:0),p=1;p<u;p++)d[p-1]=arguments[p];return i.produceWithPatches(c,(function(h){return n.apply(void 0,[h].concat(d))}))};var s,a,l=i.produce(n,o,(function(c,u){s=c,a=u}));return typeof Promise<"u"&&l instanceof Promise?l.then((function(c){return[c,s,a]})):[l,s,a]},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){je(r)||De(8),et(r)&&(r=mu(r));var i=ha(this),n=wn(this,r,void 0);return n[z].C=!0,Cn(i),n},e.finishDraft=function(r,i){var n=r&&r[z],o=n.A;return bn(o,i),xn(void 0,o)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!ba&&De(20),this.O=r},e.applyPatches=function(r,i){var n;for(n=i.length-1;n>=0;n--){var o=i[n];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}n>-1&&(i=i.slice(n+1));var s=Ye("Patches").$;return et(r)?s(r,i):this.produce(r,(function(a){return s(a,i)}))},t})(),Oe=new bu,xu=Oe.produce,gh=Oe.produceWithPatches.bind(Oe),vh=Oe.setAutoFreeze.bind(Oe),yh=Oe.setUseProxies.bind(Oe),bh=Oe.applyPatches.bind(Oe),xh=Oe.createDraft.bind(Oe),Sh=Oe.finishDraft.bind(Oe),vi=xu;function Pt(t){"@babel/helpers - typeof";return Pt=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},Pt(t)}function Oa(t,e){if(Pt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(Pt(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ta(t){var e=Oa(t,"string");return Pt(e)=="symbol"?e:e+""}function _a(t,e,r){return(e=Ta(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ra(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 Dn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ra(Object(r),!0).forEach(function(i){_a(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function de(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 La=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),In=function(){return Math.random().toString(36).substring(7).split("").join(".")},yi={INIT:"@@redux/INIT"+In(),REPLACE:"@@redux/REPLACE"+In(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+In()}};function Su(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 kn(t,e,r){var i;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(de(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(de(1));return r(kn)(t,e)}if(typeof t!="function")throw new Error(de(2));var n=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(de(3));return o}function d(g){if(typeof g!="function")throw new Error(de(4));if(l)throw new Error(de(5));var b=!0;return c(),a.push(g),function(){if(b){if(l)throw new Error(de(6));b=!1,c();var S=a.indexOf(g);a.splice(S,1),s=null}}}function p(g){if(!Su(g))throw new Error(de(7));if(typeof g.type>"u")throw new Error(de(8));if(l)throw new Error(de(9));try{l=!0,o=n(o,g)}finally{l=!1}for(var b=s=a,x=0;x<b.length;x++){var S=b[x];S()}return g}function h(g){if(typeof g!="function")throw new Error(de(10));n=g,p({type:yi.REPLACE})}function m(){var g,b=d;return g={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(de(11));function _(){S.next&&S.next(u())}_();var P=b(_);return{unsubscribe:P}}},g[La]=function(){return this},g}return p({type:yi.INIT}),i={dispatch:p,subscribe:d,getState:u,replaceReducer:h},i[La]=m,i}function Au(t){Object.keys(t).forEach(function(e){var r=t[e],i=r(void 0,{type:yi.INIT});if(typeof i>"u")throw new Error(de(12));if(typeof r(void 0,{type:yi.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(de(13))})}function Pa(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 o=Object.keys(r),s,a;try{Au(r)}catch(l){a=l}return function(c,u){if(c===void 0&&(c={}),a)throw a;if(0)var d;for(var p=!1,h={},m=0;m<o.length;m++){var g=o[m],b=r[g],x=c[g],S=b(x,u);if(typeof S>"u"){var _=u&&u.type;throw new Error(de(14))}h[g]=S,p=p||S!==x}return p=p||o.length!==Object.keys(c).length,p?h:c}}function nr(){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 Na(){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),o=function(){throw new Error(de(15))},s={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=nr.apply(void 0,a)(n.dispatch),Dn(Dn({},n),{},{dispatch:o})}}}function Da(t){var e=function(i){var n=i.dispatch,o=i.getState;return function(s){return function(a){return typeof a=="function"?a(n,o,t):s(a)}}};return e}var Ia=Da();Ia.withExtraArgument=Da;var Mn=Ia;var Ha=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])},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)}})(),Eu=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},or=function(t,e){for(var r=0,i=e.length,n=t.length;r<i;r++,n++)t[n]=e[r];return t},Cu=Object.defineProperty,wu=Object.defineProperties,Ou=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,Ma=function(t,e,r){return e in t?Cu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},mt=function(t,e){for(var r in e||(e={}))Tu.call(e,r)&&Ma(t,r,e[r]);if(ka)for(var i=0,n=ka(e);i<n.length;i++){var r=n[i];_u.call(e,r)&&Ma(t,r,e[r])}return t},$n=function(t,e){return wu(t,Ou(e))},Ru=function(t,e,r){return new Promise(function(i,n){var o=function(l){try{a(r.next(l))}catch(c){n(c)}},s=function(l){try{a(r.throw(l))}catch(c){n(c)}},a=function(l){return l.done?i(l.value):Promise.resolve(l.value).then(o,s)};a((r=r.apply(t,e)).next())})};var Lu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?nr:nr.apply(null,arguments)},Hh=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Pu(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}function gt(t,e){function r(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(e){var o=e.apply(void 0,i);if(!o)throw new Error("prepareAction did not return an object");return mt(mt({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.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}var Nu=(function(t){Ha(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,or([void 0],r[0].concat(this)))):new(e.bind.apply(e,or([void 0],r.concat(this))))},e})(Array),Du=(function(t){Ha(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,or([void 0],r[0].concat(this)))):new(e.bind.apply(e,or([void 0],r.concat(this))))},e})(Array);function Bn(t){return je(t)?vi(t,function(){}):t}function Iu(t){return typeof t=="boolean"}function ku(){return function(e){return Mu(e)}}function Mu(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,i=t.immutableCheck,n=i===void 0?!0:i,o=t.serializableCheck,s=o===void 0?!0:o,a=t.actionCreatorCheck,l=a===void 0?!0:a,c=new Nu;if(r&&(Iu(r)?c.push(Mn):c.push(Mn.withExtraArgument(r.extraArgument))),0){if(n)var u;if(s)var d;if(l)var p}return c}var Un=!0;function Ba(t){var e=ku(),r=t||{},i=r.reducer,n=i===void 0?void 0:i,o=r.middleware,s=o===void 0?e():o,a=r.devTools,l=a===void 0?!0:a,c=r.preloadedState,u=c===void 0?void 0:c,d=r.enhancers,p=d===void 0?void 0:d,h;if(typeof n=="function")h=n;else if(Pu(n))h=Pa(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 m=s;if(typeof m=="function"&&(m=m(e),!Un&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Un&&m.some(function(P){return typeof P!="function"}))throw new Error("each middleware provided to configureStore must be a function");var g=Na.apply(void 0,m),b=nr;l&&(b=Lu(mt({trace:!Un},typeof l=="object"&&l)));var x=new Du(g),S=x;Array.isArray(p)?S=or([g],p):typeof p=="function"&&(S=p(x));var _=b.apply(void 0,S);return kn(h,u,_)}function Va(t){var e={},r=[],i,n={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[a]=s,n},addMatcher:function(o,s){return r.push({matcher:o,reducer:s}),n},addDefaultCase:function(o){return i=o,n}};return t(n),[e,r,i]}function $u(t){return typeof t=="function"}function Uu(t,e,r,i){r===void 0&&(r=[]);var n=typeof e=="function"?Va(e):[e,r,i],o=n[0],s=n[1],a=n[2],l;if($u(t))l=function(){return Bn(t())};else{var c=Bn(t);l=function(){return c}}function u(d,p){d===void 0&&(d=l());var h=or([o[p.type]],s.filter(function(m){var g=m.matcher;return g(p)}).map(function(m){var g=m.reducer;return g}));return h.filter(function(m){return!!m}).length===0&&(h=[a]),h.reduce(function(m,g){if(g)if(et(m)){var b=m,x=g(b,p);return x===void 0?m:x}else{if(je(m))return vi(m,function(S){return g(S,p)});var x=g(m,p);if(x===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}return m},d)}return u.getInitialState=l,u}function Hu(t,e){return t+"/"+e}function ja(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:Bn(t.initialState),i=t.reducers||{},n=Object.keys(i),o={},s={},a={};n.forEach(function(u){var d=i[u],p=Hu(e,u),h,m;"reducer"in d?(h=d.reducer,m=d.prepare):h=d,o[u]=h,s[p]=h,a[u]=m?gt(p,m):gt(p)});function l(){var u=typeof t.extraReducers=="function"?Va(t.extraReducers):[t.extraReducers],d=u[0],p=d===void 0?{}:d,h=u[1],m=h===void 0?[]:h,g=u[2],b=g===void 0?void 0:g,x=mt(mt({},p),s);return Uu(r,function(S){for(var _ in x)S.addCase(_,x[_]);for(var P=0,ee=m;P<ee.length;P++){var X=ee[P];S.addMatcher(X.matcher,X.reducer)}b&&S.addDefaultCase(b)})}var c;return{name:e,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:o,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var Bu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Vu=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Bu[Math.random()*64|0];return e},ju=["name","message","stack","code"],Hn=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),$a=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),Fu=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,i=ju;r<i.length;r++){var n=i[r];typeof t[n]=="string"&&(e[n]=t[n])}return e}return{message:String(t)}},Fh=(function(){function t(e,r,i){var n=gt(e+"/fulfilled",function(u,d,p,h){return{payload:u,meta:$n(mt({},h||{}),{arg:p,requestId:d,requestStatus:"fulfilled"})}}),o=gt(e+"/pending",function(u,d,p){return{payload:void 0,meta:$n(mt({},p||{}),{arg:d,requestId:u,requestStatus:"pending"})}}),s=gt(e+"/rejected",function(u,d,p,h,m){return{payload:h,error:(i&&i.serializeError||Fu)(u||"Rejected"),meta:$n(mt({},m||{}),{arg:p,requestId:d,rejectedWithValue:!!h,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:(function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u})();function c(u){return function(d,p,h){var m=i?.idGenerator?i.idGenerator(u):Vu(),g=new l,b,x=!1;function S(P){b=P,g.abort()}var _=(function(){return Ru(this,null,function(){var P,ee,X,rt,Fi,it,xe;return Eu(this,function(Re){switch(Re.label){case 0:return Re.trys.push([0,4,,5]),rt=(P=i?.condition)==null?void 0:P.call(i,u,{getState:p,extra:h}),Wu(rt)?[4,rt]:[3,2];case 1:rt=Re.sent(),Re.label=2;case 2:if(rt===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return x=!0,Fi=new Promise(function(Se,yt){return g.signal.addEventListener("abort",function(){return yt({name:"AbortError",message:b||"Aborted"})})}),d(o(m,u,(ee=i?.getPendingMeta)==null?void 0:ee.call(i,{requestId:m,arg:u},{getState:p,extra:h}))),[4,Promise.race([Fi,Promise.resolve(r(u,{dispatch:d,getState:p,extra:h,requestId:m,signal:g.signal,abort:S,rejectWithValue:function(Se,yt){return new Hn(Se,yt)},fulfillWithValue:function(Se,yt){return new $a(Se,yt)}})).then(function(Se){if(Se instanceof Hn)throw Se;return Se instanceof $a?n(Se.payload,m,u,Se.meta):n(Se,m,u)})])];case 3:return X=Re.sent(),[3,5];case 4:return it=Re.sent(),X=it instanceof Hn?s(null,m,u,it.payload,it.meta):s(it,m,u),[3,5];case 5:return xe=i&&!i.dispatchConditionRejection&&s.match(X)&&X.meta.condition,xe||d(X),[2,X]}})})})();return Object.assign(_,{abort:S,requestId:m,arg:u,unwrap:function(){return _.then(zu)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:n,typePrefix:e})}return t.withTypes=function(){return t},t})();function zu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Wu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Fa="listener",za="completed",Wa="cancelled",zh="task-"+Wa,Wh="task-"+za,Kh=Fa+"-"+Wa,Gh=Fa+"-"+za;var Vn="listenerMiddleware";var qh=gt(Vn+"/add"),Yh=gt(Vn+"/removeAll"),Xh=gt(Vn+"/remove");var Ua,Zh=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Ua||(Ua=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ku=function(t){return function(e){setTimeout(e,t)}},Jh=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ku(10);Ea();var Gu=li(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)}}}),bi=class extends Gu(Object){};window.ftReduxStores||(window.ftReduxStores={});var Ka=class t extends bi{static get(e){var r;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,o=window.ftReduxStores[i];if(fi(o))return o;if(n==null)return;let s=ja({...n,reducers:(r=n.reducers)!==null&&r!==void 0?r:{}}),a=Ba({reducer:(l,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let u=Lr(s.getInitialState());for(let d of c.keeping)u[d]=(l??u)[d];return u}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...c.overwrites};return s.reducer(l,c)}});return window.ftReduxStores[n.name]=new t(s,a,n.eventBus)}constructor(e,r,i){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new ci;let n=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,s,a)=>{let l=s,c=o[l];return c?(...u)=>{let d=c(...u.map(n));return this.reduxStore.dispatch(d),d}:u=>{this.setState({[l]:n(u)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var xi=class{static format(e,r,i,n,o){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(i,n,!!o)):this.getIntlDateTime(e,r,i,n,!!o)}static getMomentDateFormat(e,r,i){return i?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,i,n,o){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:i?"medium":"short"}).format(s),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return o?l:n?`${a} ${l}`:a}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 Si=f(E()),qu="ft-app-info",sr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};sr.eventName="authentication-change";var Mr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Mr.eventName="ui-locale-changed";var Yu={session:(t,e)=>{(0,Si.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>N.dispatchEvent(new sr(e.payload)),0))}},N=Si.FtReduxStore.get({name:qu,reducers:Yu,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Ga=f(E()),Ai=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},Om=(0,Ga.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(N)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,o;return((o=(n=this.metadataDescriptors.find(a=>a.key===i))===null||n===void 0?void 0:n.date)!==null&&o!==void 0?o:!1)?a=>xi.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Ai([(0,jn.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Ai([(0,jn.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Ai([yn({store:N.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),Ai([yn({store:N.name})],e.prototype,"uiLocale",void 0),e});var qa;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(qa||(qa={}));var Ya;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Ya||(Ya={}));var Xa;(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"})(Xa||(Xa={}));var Za;(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"})(Za||(Za={}));var Ja;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Ja||(Ja={}));var Qa;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Qa||(Qa={}));var el;(function(t){t.OFFICIAL="OFFICIAL",t.AI="AI"})(el||(el={}));var tl;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(tl||(tl={}));var rl;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(rl||(rl={}));var il;(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"})(il||(il={}));var nl;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(nl||(nl={}));var ol;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(ol||(ol={}));var sl;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(sl||(sl={}));var al;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(al||(al={}));var ll;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(ll||(ll={}));var cl;(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"})(cl||(cl={}));var ul;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(ul||(ul={}));var dl;(function(t){t.ASC="ASC",t.DESC="DESC"})(dl||(dl={}));var pl;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(pl||(pl={}));var fl;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(fl||(fl={}));var hl;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(hl||(hl={}));var ml;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ml||(ml={}));var gl;(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"})(gl||(gl={}));var vl;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(vl||(vl={}));var yl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(yl||(yl={}));var bl;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(bl||(bl={}));var xl;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(xl||(xl={}));var Q;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Q||(Q={}));var Ie;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(Ie||(Ie={}));var Sl;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Sl||(Sl={}));var Al;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Al||(Al={}));var El;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(El||(El={}));var Cl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Cl||(Cl={}));var wl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(wl||(wl={}));var Ol;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Ol||(Ol={}));var Tl;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Tl||(Tl={}));var _l;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(_l||(_l={}));var Rl;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(Rl||(Rl={}));var Ll;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Ll||(Ll={}));var Pl;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(Pl||(Pl={}));var Nl;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Nl||(Nl={}));var Xu={[Q.PERSONAL_BOOK_SHARE_USER]:[Q.PERSONAL_BOOK_USER],[Q.HTML_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.PDF_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.KHUB_ADMIN]:[Q.CONTENT_PUBLISHER],[Q.ADMIN]:[Q.KHUB_ADMIN,Q.USERS_ADMIN,Q.PORTAL_ADMIN,Q.BEHAVIOR_DATA_USER],[Q.GENERATIVE_AI_EXPORT_USER]:[Q.GENERATIVE_AI_USER]};function Dl(t,e){return t===e||(Xu[t]??[]).some(r=>Dl(r,e))}function Il(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=>Dl(i,e))}var Ti=f(E());var Fn=f(E());var Nt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=N.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=N.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var ar=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Nt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Nt.await()}};var Te=class extends ar{constructor(e=!0,r){var i;super(r),this.sortObjectFields=(o,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([a],[l])=>a.localeCompare(l)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Fn.CacheRegistry,this.cache=e?n.commonCache:new Fn.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 Ei=class extends Te{async listMySearches(){let{session:e}=N.getState();return Il(e,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Ci=class extends Te{async listMyBookmarks(){let e=N.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var wi=class extends Te{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=N.getState().session;return!!e?.sessionAuthenticated}};var Oi=class extends Te{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=N.getState().session;return!!e?.sessionAuthenticated}};var Zu="ft-user-assets",Ju={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(Ie).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;Wn(t,r,[...zn(t,r),n]),kl(t,r,1,i),Ml(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;Wn(t,r,zn(t,r).map(n=>n.id===i.id?i:n)),Ml(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;Wn(t,r,zn(t,r).filter(o=>o.id!==n)),kl(t,r,-1,i)}},$l={[Ie.SEARCHES]:"savedSearches",[Ie.BOOKMARKS]:"bookmarks",[Ie.BOOKS]:void 0,[Ie.COLLECTIONS]:void 0},zn=(t,e)=>{var r;let i=$l[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},Wn=(t,e,r)=>{let i=$l[e];i&&(t[i]=r)},kl=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===Ie.BOOKMARKS&&i)){let o=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,o+r)}},Ml=(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)},pe=Ti.FtReduxStore.get({name:Zu,reducers:Ju,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ie).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Kn=class{constructor(e=new wi,r=new Oi){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=N.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ci,this.savedSearchesService=new Ei,N.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=N.getState();(0,Ti.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(),pe.actions.clearAssetCount(),pe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();pe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();pe.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&pe.getState().assetCounts.allAsset[e]!==r.count&&pe.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&pe.getState().assetCounts.bookmarkByMap[e]!==r.count&&pe.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(pe.getState().assetCounts.bookmarkByMap).length!==0;e===Ie.BOOKMARKS&&r&&pe.actions.clearBookmarkCountByMap(),pe.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;pe.actions.bookmarks(r)}}},Qu=new Kn;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Qu);var Gn=class{addCommand(e,r=!1){N.commands.add(e,r)}consumeCommand(e){return N.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Gn;var ke=f(E());var Ul,lr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ed=Symbol("clearAfterUnitTest"),_i=class extends(0,ke.withEventBus)(Te){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ul]=()=>{this.defaultMessages={},this.cache=new ke.CacheRegistry,this.listeners={}},this.currentUiLocale=N.getState().uiLocale,N.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=N.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,ke.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 o=e.toLowerCase(),s=this.resolveContext(o);return new ke.ParametrizedLabelResolver((n=this.defaultMessages[o])!==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 ke.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 lr({loadedContexts:e})),this.dispatchEvent(new lr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new lr({loadedContexts:[e]})),this.dispatchEvent(new lr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,ke.delay)(0).then(()=>i()).catch(()=>null)))}};Ul=ed;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends _i{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends _i{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var cr=window.FluidTopicsI18nService,Ri=window.FluidTopicsCustomI18nService;var Hl=f(E()),qn=class{highlightHtml(e,r,i){(0,Hl.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new qn;var Bl=f(E());var Yn=class{isDate(e){var r,i,n,o;return(o=(n=((i=(r=N.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&i!==void 0?i:[]).find(a=>a.key===e))===null||n===void 0?void 0:n.date)!==null&&o!==void 0?o:!1}format(e,r){var i,n,o,s;if(e==null)return"";try{return Bl.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:N.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(o=r?.withTime)!==null&&o!==void 0?o:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new Yn;var Vl=f(E());var $r=class{static get(e,r){var i,n,o,s;let a=N.getState(),{lang:l,region:c}=(o=(n=(i=a.localesConfiguration)===null||i===void 0?void 0:i.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&o!==void 0?o:{lang:"en",region:"US"};return new Vl.SearchPlaceConverter(a.baseUrl,e??20,(s=a.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${l}-${c}`)}};var Xn=class{urlToSearchRequest(e){return $r.get().parse(e)}searchRequestToUrl(e){return $r.get().serialize(e)}};window.FluidTopicsUrlService=new Xn;var tt=f(E());var Dt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Dt.eventName="change";var Zn=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))}},jl=new Zn;var Li=class t extends tt.WithEventBus{static build(){return new t(window.history,jl,()=>window.location,!1)}constructor(e,r,i,n){var o,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(o=e.state)===null||o===void 0?void 0:o.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,tt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Dt(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[o,s,a])=>{let l=r(),c={...l===this.currentIndex?this.currentState:void 0,...o,index:l,href:typeof a=="string"?a:(a??this.windowLocation()).href};i.apply(n,[c,s,a]),this.setCurrentState(c,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let 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(Dt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Dt.eventName,e)}currentItem(){return(0,tt.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,tt.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(i=>!!i).filter(i=>i.index<this.currentIndex).reverse();return(0,tt.deepCopy)(r.find(i=>e(i)))}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,tt.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,o=e+1;for(;this.states.length>o&&!this.isDifferentMajorState(o,i);)this.hasState(o)&&(n=o),o++;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,o=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return o==null||o!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Li.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var Fl=f(V());var zl=Fl.css`
919
- `;var Gl=f(V()),ye=f(te()),Mt=f(E());var It=f(E());function Wl(t,e){let{authenticationRequired:r,session:i}=N.getState();return r&&!i?.sessionAuthenticated?Promise.resolve(e):t()}var Pi=class extends ar{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Jn=class t extends It.FtStateManager{static build(e){return new t(N,e)}constructor(e,r){super(),this.store=e,this.cache=new It.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Pi,this.cleanSessionDebouncer=new It.Debouncer,this.reloadDebouncer=new It.Debouncer(500),this.apiProvider=r??(()=>Nt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(sr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Wl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Mr(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},Kl=Jn.build();var kt=class extends Event{constructor(e,r,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=i,this.subscribe=n??!1}};var Ur=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:i}=r;for(let{elementRef:n,callbackRef:o}of i){let s=n.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new kt(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],i=e.callback,n=this.pendingContextRequests.get(e.context);n===void 0&&this.pendingContextRequests.set(e.context,n={callbacks:new WeakMap,requests:[]});let o=n.callbacks.get(r);o===void 0&&n.callbacks.set(r,o=new WeakSet),o.has(i)||(o.add(i),n.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(i)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var le=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},W=class extends Mt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Kl,this.contextRoot=new Ur}render(){return Gl.html`
919
+ `;var Gl=f(V()),ye=f(te()),Mt=f(E());var It=f(E());function Wl(t,e){let{authenticationRequired:r,session:i}=N.getState();return r&&!i?.sessionAuthenticated?Promise.resolve(e):t()}var Pi=class extends ar{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Jn=class t extends It.FtStateManager{static build(e){return new t(N,e)}constructor(e,r){super(),this.store=e,this.cache=new It.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Pi,this.cleanSessionDebouncer=new It.Debouncer,this.reloadDebouncer=new It.Debouncer(500),this.apiProvider=r??(()=>Nt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(sr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Wl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(i=>{i.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Mr(i)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},Kl=Jn.build();var kt=class extends Event{constructor(e,r,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=i,this.subscribe=n??!1}};var Ur=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:i}=r;for(let{elementRef:n,callbackRef:o}of i){let s=n.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new kt(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],i=e.callback,n=this.pendingContextRequests.get(e.context);n===void 0&&this.pendingContextRequests.set(e.context,n={callbacks:new WeakMap,requests:[]});let o=n.callbacks.get(r);o===void 0&&n.callbacks.set(r,o=new WeakSet),o.has(i)||(o.add(i),n.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(i)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var le=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},W=class extends Mt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Kl,this.contextRoot=new Ur}render(){return Gl.html`
920
920
  <slot></slot>
921
921
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(i=>cr.addContext(i)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};W.elementDefinitions={};W.styles=zl;le([(0,ye.property)()],W.prototype,"baseUrl",void 0);le([(0,ye.property)()],W.prototype,"tenantId",void 0);le([(0,ye.property)()],W.prototype,"apiIntegrationIdentifier",void 0);le([(0,ye.property)()],W.prototype,"apiIntegrationAppVersion",void 0);le([(0,ye.property)()],W.prototype,"uiLocale",void 0);le([(0,Mt.jsonProperty)(null)],W.prototype,"availableUiLocales",void 0);le([(0,Mt.jsonProperty)(null)],W.prototype,"metadataConfiguration",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"editorMode",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"noCustom",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"openExternalDocumentInNewTab",void 0);le([(0,ye.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],W.prototype,"noCustomComponent",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"withManualResources",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"navigatorOnline",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"forcedOffline",void 0);le([(0,ye.property)({type:Boolean})],W.prototype,"authenticationRequired",void 0);le([(0,Mt.jsonProperty)([])],W.prototype,"messageContexts",void 0);le([(0,Mt.jsonProperty)(void 0)],W.prototype,"session",void 0);var Yl=f(E());var ql={"ft-app-context":W};(0,Yl.customElements)(ql);var Xl=f(te());var Qn=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[r,i]=e.split(".");return{context:r,key:i,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},ur=new Qn;var id=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},Br=Symbol("i18nAttributes"),Zl=Symbol("i18nListAttributes"),Jl=Symbol("i18nProperties"),Ni=Symbol("i18nContexts"),Hr=Symbol("i18nUnsubs"),ki=(0,dr.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(o){return o??this.useCustomMessageContexts?Ri:cr}i18n(o){let{context:s,key:a,message:l}=o,{custom:c,args:u,argsProvider:d}=o;if(s&&a){this.hasI18nContext(s)||this.addI18nContext(s,void 0,c);let p=u??(d?d(this):[]);return this.getI18nService(c).resolveMessage(s,a,...p)}return l}async awaitI18n(o){let{context:s,custom:a}=o;return s&&await this.getI18nService(a).prepareContext(s),this.i18n(o)}customI18n(o,s){if(ur.isI18nKey(o)){let[a,l]=o.split(".");return this.i18n({custom:!0,context:a,key:l,...s})||o}return o}firstUpdated(o){super.firstUpdated(o),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(o){super.update(o),this.updateI18nAttributes((s,a,l)=>o.has(a)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(o){this.updateI18nAttributes((s,a,l)=>{var c;return((c=l?.context)===null||c===void 0?void 0:c.toLowerCase())===o}),this.updateI18nProperties(s=>s.context.toLowerCase()===o),this.requestUpdate()}updateI18nAttributes(o){var s,a;let l=this,c=(u,d,p)=>p?.context&&p.key&&o(u,d,p)?{...p,message:this.i18n({context:p.context,key:p.key,custom:p.custom,...u})}:p;(s=this[Br])===null||s===void 0||s.forEach((u,d)=>l[d]=c(u,d,l[d])),(a=this[Zl])===null||a===void 0||a.forEach((u,d)=>{var p;return l[d]=(p=l[d])===null||p===void 0?void 0:p.map(h=>c(u,d,h))})}updateI18nProperties(o){var s;(s=this[Jl])===null||s===void 0||s.forEach((a,l)=>{o(a,l)&&(this[l]=this.i18n(a))})}addI18nMessages(o,s,a){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(o,s,a)}addI18nContext(o,s,a){let l=(typeof o=="string"?o:o.name).toLowerCase();a=typeof o=="string"?a:o.custom,this[Ni].set(l,{isCustomContext:a}),this[Hr].has(l)||this[Hr].set(l,this.getI18nService(a).subscribe(l,()=>this.onI18nUpdate(l))),this.getI18nService(a).prepareContext(l,s)}hasI18nContext(o){return this[Ni].has(o.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ni].forEach((o,s)=>this.addI18nContext(s,void 0,o.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Hr].forEach(o=>o()),this[Hr].clear()}}return e=Ni,r=Hr,id([(0,Xl.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),Di=class extends ki(dr.FtLitElement){},Ii=class extends ki(dr.FtLitElementRedux){};var Ql=f(E());var eo=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(i=>typeof i=="string"?ur.fromAttribute(i):i):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},nd=new eo;var ec=(t,e)=>(r,i)=>{var n;r.constructor.createProperty(i,{type:Object,hasChanged:Ql.hasChanged,converter:ur,...e}),r[Br]=(n=r[Br])!==null&&n!==void 0?n:new Map,r[Br].set(i,t??{})};var Mi=class t{static build(e){return new t(e)}static buildCustom(e){return new t(e,!0)}static fromGwt(e){return new t(e)}get service(){return this.custom?Ri:cr}constructor(e,r=!1){this.name=e,this.custom=r,this.properties=new Proxy({},{get:(i,n)=>{let o=n;return s=>({context:this.name,key:o,custom:this.custom,args:typeof s=="function"?void 0:s,argsProvider:typeof s=="function"?s:void 0})}}),this.messages=new Proxy({},{get:(i,n)=>(...o)=>this.service.resolveMessage(this.name,n,...o)}),this.rawMessages=new Proxy({},{get:(i,n)=>this.service.resolveRawMessage(this.name,n)}),this.keys=new Proxy({},{get:(i,n)=>()=>n}),this.attributes=new Proxy({},{get:(i,n)=>()=>({context:this.name,key:n,message:this.service.resolveRawMessage(this.name,n)})})}};var tc=f(V());var rc=tc.css`
922
922
  `;var $i=f(V()),Ui=f(te()),Hi=f(E());var Vr=function(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},Fe=class extends Ii{constructor(){super(),this.editorMode=!1,this.addStore(N)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":$i.nothing:$i.html`
@@ -5,7 +5,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
5
5
  .highlight-html-match {
6
6
  background: ${Sl};
7
7
  }
8
- `;function Pi(t,e,r){var n,i;let a=t.getAttribute("data-highlight-html-query");if((a??"")!==(e??"")){let s=new Fp(t);if(s.unmark(),e&&e.trim()){let c={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(c.each=(p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])})),s.mark(e.replace(/"[^"]+"/g,""),{...c,separateWordSearch:!0}),((i=e.match(/"[^"]+"/g))!==null&&i!==void 0?i:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...c,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var Di={};K(Di,{noTextInputDefaultClearButton:()=>Ni,noTextSelect:()=>Ut,safariEllipsisFix:()=>ki,wordWrap:()=>Hp});var Ut=_`
8
+ `;function Pi(t,e,r){var n,i;let a=t.getAttribute("data-highlight-html-query");if((a??"")!==(e??"")){let s=new Fp(t);if(s.unmark(),e&&e.trim()){let c={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(c.each=p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])}),s.mark(e.replace(/"[^"]+"/g,""),{...c,separateWordSearch:!0}),((i=e.match(/"[^"]+"/g))!==null&&i!==void 0?i:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...c,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var Di={};K(Di,{noTextInputDefaultClearButton:()=>Ni,noTextSelect:()=>Ut,safariEllipsisFix:()=>ki,wordWrap:()=>Hp});var Ut=_`
9
9
  .ft-no-text-select {
10
10
  -webkit-touch-callout: none;
11
11
  -webkit-user-select: none;
@@ -997,7 +997,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
997
997
  word-break: break-word;
998
998
  }
999
999
  `;var Gf="ft-app-info",Nr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Nr.eventName="authentication-change";var xo=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};xo.eventName="ui-locale-changed";var jf={session:(t,e)=>{Le(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>W.dispatchEvent(new Nr(e.payload)),0))}},W=Vt.get({name:Gf,reducers:jf,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var nn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},HO=he(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(W)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>Wt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return nn([g({type:Boolean})],e.prototype,"useLongDateFormat",void 0),nn([g({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),nn([mr({store:W.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),nn([mr({store:W.name})],e.prototype,"uiLocale",void 0),e});var Yt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=W.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=W.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var Dr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Yt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Yt.await()}};var Ne=class extends Dr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Je,this.cache=e?i.commonCache:new Je}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var an=class extends Ne{async listMySearches(){let{session:e}=W.getState();return Hc(e,le.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var sn=class extends Ne{async listMyBookmarks(){let e=W.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var ln=class extends Ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=W.getState().session;return!!e?.sessionAuthenticated}};var cn=class extends Ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=W.getState().session;return!!e?.sessionAuthenticated}};var Kf="ft-user-assets",Zf={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Ue).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;Da(t,r,[...Na(t,r),i]),Ad(t,r,1,n),wd(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;Da(t,r,Na(t,r).map(i=>i.id===n.id?n:i)),wd(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;Da(t,r,Na(t,r).filter(a=>a.id!==i)),Ad(t,r,-1,n)}},Rd={[Ue.SEARCHES]:"savedSearches",[Ue.BOOKMARKS]:"bookmarks",[Ue.BOOKS]:void 0,[Ue.COLLECTIONS]:void 0},Na=(t,e)=>{var r;let n=Rd[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},Da=(t,e,r)=>{let n=Rd[e];n&&(t[n]=r)},Ad=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===Ue.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+r)}},wd=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},Se=Vt.get({name:Kf,reducers:Zf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ue).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ma=class{constructor(e=new ln,r=new cn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=W.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new sn,this.savedSearchesService=new an,W.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=W.getState();Le((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(),Se.actions.clearAssetCount(),Se.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Se.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Se.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Se.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();Se.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&Se.getState().assetCounts.allAsset[e]!==r.count&&Se.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&Se.getState().assetCounts.bookmarkByMap[e]!==r.count&&Se.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(Se.getState().assetCounts.bookmarkByMap).length!==0;e===Ue.BOOKMARKS&&r&&Se.actions.clearBookmarkCountByMap(),Se.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;Se.actions.bookmarks(r)}}},qf=new Ma;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=qf);var $a=class{addCommand(e,r=!1){W.commands.add(e,r)}consumeCommand(e){return W.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new $a;var Td,Mr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Yf=Symbol("clearAfterUnitTest"),dn=class extends $o(Ne){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Td]=()=>{this.defaultMessages={},this.cache=new Je,this.listeners={}},this.currentUiLocale=W.getState().uiLocale,W.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=W.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};Le(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new ao((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof Tt)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Mr({loadedContexts:e})),this.dispatchEvent(new Mr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Mr({loadedContexts:[e]})),this.dispatchEvent(new Mr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Mo(0).then(()=>n()).catch(()=>null)))}};Td=Yf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends dn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends dn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var $r=window.FluidTopicsI18nService,un=window.FluidTopicsCustomI18nService;var Ua=class{highlightHtml(e,r,n){Pi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Ua;var Fa=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=W.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a,s;if(e==null)return"";try{return Wt.format(e,(n=r?.locale)!==null&&n!==void 0?n:W.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new Fa;var vo=class{static get(e,r){var n,i,a,s;let c=W.getState(),{lang:d,region:p}=(a=(i=(n=c.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Or(c.baseUrl,e??20,(s=c.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${d}-${p}`)}};var Ba=class{urlToSearchRequest(e){return vo.get().parse(e)}searchRequestToUrl(e){return vo.get().serialize(e)}};window.FluidTopicsUrlService=new Ba;var Xt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Xt.eventName="change";var Ha=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))}},Ld=new Ha;var pn=class t extends st{static build(){return new t(window.history,Ld,()=>window.location,!1)}constructor(e,r,n,i){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Le(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Xt(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[a,s,c])=>{let d=r(),p={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[p,s,c]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Xt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Xt.eventName,e)}currentItem(){return ze(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 ze(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return ze(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return ze(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=pn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var _d=_`
1000
- `;function Pd(t,e){let{authenticationRequired:r,session:n}=W.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var fn=class extends Dr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var za=class t extends fo{static build(e){return new t(W,e)}constructor(e,r){super(),this.store=e,this.cache=new Je,this.withManualResources=!0,this.userLocaleService=new fn,this.cleanSessionDebouncer=new xe,this.reloadDebouncer=new xe(500),this.apiProvider=r??(()=>Yt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Nr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Pd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new xo(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},Id=za.build();var Jt=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var So=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),c=a.deref();s===void 0||c===void 0||s.dispatchEvent(new Jt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(r);a===void 0&&i.callbacks.set(r,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var ye=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},oe=class extends Bt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Id,this.contextRoot=new So}render(){return R`
1000
+ `;function Pd(t,e){let{authenticationRequired:r,session:n}=W.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var fn=class extends Dr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var za=class t extends fo{static build(e){return new t(W,e)}constructor(e,r){super(),this.store=e,this.cache=new Je,this.withManualResources=!0,this.userLocaleService=new fn,this.cleanSessionDebouncer=new xe,this.reloadDebouncer=new xe(500),this.apiProvider=r??(()=>Yt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Nr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Pd(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new xo(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},Id=za.build();var Jt=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var So=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),c=a.deref();s===void 0||c===void 0||s.dispatchEvent(new Jt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(r);a===void 0&&i.callbacks.set(r,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var ye=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},oe=class extends Bt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Id,this.contextRoot=new So}render(){return R`
1001
1001
  <slot></slot>
1002
1002
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>$r.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};oe.elementDefinitions={};oe.styles=_d;ye([g()],oe.prototype,"baseUrl",void 0);ye([g()],oe.prototype,"tenantId",void 0);ye([g()],oe.prototype,"apiIntegrationIdentifier",void 0);ye([g()],oe.prototype,"apiIntegrationAppVersion",void 0);ye([g()],oe.prototype,"uiLocale",void 0);ye([Te(null)],oe.prototype,"availableUiLocales",void 0);ye([Te(null)],oe.prototype,"metadataConfiguration",void 0);ye([g({type:Boolean})],oe.prototype,"editorMode",void 0);ye([g({type:Boolean})],oe.prototype,"noCustom",void 0);ye([g({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);ye([g({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);ye([g({type:Boolean})],oe.prototype,"withManualResources",void 0);ye([g({type:Boolean})],oe.prototype,"navigatorOnline",void 0);ye([g({type:Boolean})],oe.prototype,"forcedOffline",void 0);ye([g({type:Boolean})],oe.prototype,"authenticationRequired",void 0);ye([Te([])],oe.prototype,"messageContexts",void 0);ye([Te(void 0)],oe.prototype,"session",void 0);var kd={"ft-app-context":oe};te(kd);var Va=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[r,n]=e.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Ur=new Va;var Qf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Eo=Symbol("i18nAttributes"),Nd=Symbol("i18nListAttributes"),Dd=Symbol("i18nProperties"),hn=Symbol("i18nContexts"),Co=Symbol("i18nUnsubs"),yn=he(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?un:$r}i18n(a){let{context:s,key:c,message:d}=a,{custom:p,args:h,argsProvider:f}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,c,...m)}return d}async awaitI18n(a){let{context:s,custom:c}=a;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Ur.isI18nKey(a)){let[c,d]=a.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,c,d)=>a.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,c,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,c;let d=this,p=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Eo])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(c=this[Nd])===null||c===void 0||c.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(y=>p(h,f,y))})}updateI18nProperties(a){var s;(s=this[Dd])===null||s===void 0||s.forEach((c,d)=>{a(c,d)&&(this[d]=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 d=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[hn].set(d,{isCustomContext:c}),this[Co].has(d)||this[Co].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(a){return this[hn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[hn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Co].forEach(a=>a()),this[Co].clear()}}return e=hn,r=Co,Qf([g({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),mn=class extends yn(Z){},gn=class extends yn(Bt){};var Wa=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?Ur.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},eh=new Wa;var Md=(t,e)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:at,converter:Ur,...e}),r[Eo]=(i=r[Eo])!==null&&i!==void 0?i:new Map,r[Eo].set(n,t??{})};var bn=class t{static build(e){return new t(e)}static buildCustom(e){return new t(e,!0)}static fromGwt(e){return new t(e)}get service(){return this.custom?un:$r}constructor(e,r=!1){this.name=e,this.custom=r,this.properties=new Proxy({},{get:(n,i)=>{let a=i;return s=>({context:this.name,key:a,custom:this.custom,args:typeof s=="function"?void 0:s,argsProvider:typeof s=="function"?s:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...a)=>this.service.resolveMessage(this.name,i,...a)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)}),this.keys=new Proxy({},{get:(n,i)=>()=>i}),this.attributes=new Proxy({},{get:(n,i)=>()=>({context:this.name,key:i,message:this.service.resolveRawMessage(this.name,i)})})}};var $d=_`
1003
1003
  `;var Oo=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},je=class extends gn{constructor(){super(),this.editorMode=!1,this.addStore(W)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":D:R`
@@ -1,5 +1,5 @@
1
1
  import { css } from "lit";
2
- import { foundation, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
2
+ import { foundation, FtCssVariableFactory, setVariable, } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtInputLabelCssVariables } from "@fluid-topics/ft-input-label/build/ft-input-label.styles";
4
4
  import { FtTextFieldCssVariables } from "@fluid-topics/ft-text-field";
5
5
  import { FtIconCssVariables } from "@fluid-topics/ft-icon";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-combobox",
3
- "version": "2.1.19",
3
+ "version": "2.1.21",
4
4
  "description": "A",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "2.1.19",
22
+ "@fluid-topics/ft-wc-utils": "2.1.21",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/ft-wc-test-utils": "2.1.19"
26
+ "@fluid-topics/ft-wc-test-utils": "2.1.21"
27
27
  },
28
- "gitHead": "c2c202986d05fbee1378d8dbb74fa609e89260ec"
28
+ "gitHead": "a0f619df74c0665183d73df09e75b1eddc2a2a1f"
29
29
  }