@fluid-topics/ftds-file-button 2.2.49 → 2.2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -833,7 +833,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
833
833
|
position: relative;
|
|
834
834
|
word-break: break-word;
|
|
835
835
|
}
|
|
836
|
-
`;var Os=["top","right","bottom","left"],Ls=["start","end"],Mo=Os.reduce((e,t)=>e.concat(t,t+"-"+Ls[0],t+"-"+Ls[1]),[]),br=Math.min,Xe=Math.max,xr=Math.round;var we=e=>({x:e,y:e}),N4={left:"right",right:"left",bottom:"top",top:"bottom"};function Rs(e,t,n){return Xe(e,br(t,n))}function rn(e,t){return typeof e=="function"?e(t):e}function vr(e){return e.split("-")[0]}function Qe(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function ko(e){return e==="y"?"height":"width"}function nn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Io(e){return zo(nn(e))}function _s(e,t,n){n===void 0&&(n=!1);let o=Qe(e),a=Io(e),i=ko(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=No(s)),[s,No(s)]}function ws(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function No(e){let t=vr(e);return N4[t]+e.slice(t.length)}function M4(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Ns(e){return typeof e!="number"?M4(e):{top:e,right:e,bottom:e,left:e}}function St(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Ms(e,t,n){let{reference:o,floating:a}=e,i=nn(t),s=Io(t),l=ko(s),f=vr(t),m=i==="y",y=o.x+o.width/2-a.width/2,h=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:y,y:o.y-a.height};break;case"bottom":x={x:y,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:h};break;case"left":x={x:o.x-a.width,y:h};break;default:x={x:o.x,y:o.y}}let O=Qe(t);return O&&(x[s]+=b*(O==="end"?1:-1)*(n&&m?-1:1)),x}async function zs(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=rn(t,e),O=Ns(x),L=l[b?h==="floating"?"reference":"floating":h],M=St(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(L)))==null||n?L:L.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:y,strategy:f})),I=h==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(w))&&await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1},D=St(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:w,strategy:f}):I);return{top:(M.top-D.top+O.top)/k.y,bottom:(D.bottom-M.bottom+O.bottom)/k.y,left:(M.left-D.left+O.left)/k.x,right:(D.right-M.right+O.right)/k.x}}var z4=50,ks=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:zs},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:y,y:h}=Ms(m,o,f),b=o,x=0,O={};for(let R=0;R<i.length;R++){let L=i[R];if(!L)continue;let{name:M,fn:I}=L,{x:w,y:k,data:D,reset:G}=await I({x:y,y:h,initialPlacement:o,placement:b,strategy:a,middlewareData:O,rects:m,platform:l,elements:{reference:e,floating:t}});y=w??y,h=k??h,O[M]={...O[M],...D},G&&x<z4&&(x++,typeof G=="object"&&(G.placement&&(b=G.placement),G.rects&&(m=G.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):G.rects),{x:y,y:h}=Ms(m,b,f)),R=-1)}return{x:y,y:h,placement:b,strategy:a,middlewareData:O}};function k4(e,t,n){return(e?[...n.filter(a=>Qe(a)===e),...n.filter(a=>Qe(a)!==e)]:n.filter(a=>vr(a)===a)).filter(a=>e?Qe(a)===e||(t?ws(a)!==a:!1):!0)}var Is=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:f,elements:m}=t,{crossAxis:y=!1,alignment:h,allowedPlacements:b=Mo,autoAlignment:x=!0,...O}=rn(e,t),R=h!==void 0||b===Mo?k4(h||null,x,b):b,L=((n=s.autoPlacement)==null?void 0:n.index)||0,M=R[L];if(M==null)return{};if(l!==M)return{reset:{placement:R[0]}};let I=await f.detectOverflow(t,O),w=_s(M,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[I[vr(M)],I[w[0]],I[w[1]]],D=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:M,overflows:k}],G=R[L+1];if(G)return{data:{index:L+1,overflows:D},reset:{placement:G}};let ne=D.map(me=>{let lr=Qe(me.placement);return[me.placement,lr&&y?me.overflows.slice(0,2).reduce((h4,y4)=>h4+y4,0):me.overflows[0],me.overflows]}).sort((me,lr)=>me[1]-lr[1]),Pt=((a=ne.filter(me=>me[2].slice(0,Qe(me[0])?2:3).every(lr=>lr<=0))[0])==null?void 0:a[0])||ne[0][0];return Pt!==l?{data:{index:L+1,overflows:D},reset:{placement:Pt}}:{}}}};var Ts=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:f={fn:I=>{let{x:w,y:k}=I;return{x:w,y:k}}},...m}=rn(e,t),y={x:n,y:o},h=await i.detectOverflow(t,m),b=nn(a),x=zo(b),O=y[x],R=y[b],L=(I,w)=>Rs(w+h[I==="y"?"top":"left"],w,w-h[I==="y"?"bottom":"right"]);s&&(O=L(x,O)),l&&(R=L(b,R));let M=f.fn({...t,[x]:O,[b]:R});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[x]:s,[b]:l}}}}}};function an(){return typeof window<"u"}function Et(e){return Ds(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(Ds(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ds(e){return an()?e instanceof Node||e instanceof ce(e).Node:!1}function Ee(e){return an()?e instanceof Element||e instanceof ce(e).Element:!1}function Be(e){return an()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Ps(e){return!an()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function Sr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Us(e){return/^(table|td|th)$/.test(Et(e))}function Cr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var I4=/transform|translate|scale|rotate|perspective|filter/,T4=/paint|layout|strict|content/,Ct=e=>!!e&&e!=="none",To;function Wt(e){let t=Ee(e)?Ae(e):e;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!sn()&&(Ct(t.backdropFilter)||Ct(t.filter))||I4.test(t.willChange||"")||T4.test(t.contain||"")}function Fs(e){let t=Je(e);for(;Be(t)&&!Vt(t);){if(Wt(t))return t;if(Cr(t))return null;t=Je(t)}return null}function sn(){return To==null&&(To=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),To}function Vt(e){return/^(html|body|#document)$/.test(Et(e))}function Ae(e){return ce(e).getComputedStyle(e)}function Er(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(Et(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ps(e)&&e.host||Fe(e);return Ps(t)?t.host:t}function Bs(e){let t=Je(e);return Vt(t)?(e.ownerDocument||e).body:Be(t)&&Sr(t)?t:Bs(t)}function on(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Bs(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=cn(s);return t.concat(s,s.visualViewport||[],Sr(a)?a:[],l&&n?on(l):[])}else return t.concat(a,on(a,[],n))}function cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hs(e){let t=Ae(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Be(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=xr(n)!==i||xr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ws(e){return Ee(e)?e:e.contextElement}function jt(e){let t=Ws(e);if(!Be(t))return we(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Hs(t),s=(i?xr(n.width):n.width)/o,l=(i?xr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var P4=we(0);function Vs(e){let t=ce(e);return!sn()||!t.visualViewport?P4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ce(e)}function Ar(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ws(e),s=we(1);t&&(o?Ee(o)&&(s=jt(o)):s=jt(e));let l=D4(i,n,o)?Vs(i):we(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,y=a.width/s.x,h=a.height/s.y;if(i&&o){let b=ce(i),x=Ee(o)?ce(o):o,O=b,R=cn(O);for(;R&&x!==O;){let L=jt(R),M=R.getBoundingClientRect(),I=Ae(R),w=M.left+(R.clientLeft+parseFloat(I.paddingLeft))*L.x,k=M.top+(R.clientTop+parseFloat(I.paddingTop))*L.y;f*=L.x,m*=L.y,y*=L.x,h*=L.y,f+=w,m+=k,O=ce(R),R=cn(O)}}return St({width:y,height:h,x:f,y:m})}function ln(e,t){let n=Er(e).scrollLeft;return t?t.left+n:Ar(Fe(e)).left+n}function js(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ln(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function U4(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Fe(o),l=t?Cr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=we(1),y=we(0),h=Be(o);if((h||!i)&&((Et(o)!=="body"||Sr(s))&&(f=Er(o)),h)){let x=Ar(o);m=jt(o),y.x=x.x+o.clientLeft,y.y=x.y+o.clientTop}let b=s&&!h&&!i?js(s,f):we(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+y.x+b.x,y:n.y*m.y-f.scrollTop*m.y+y.y+b.y}}function F4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function B4(e){let t=Er(e),n=e.ownerDocument.body,o=Xe(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Xe(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+ln(e),s=-t.scrollTop;return Ae(n).direction==="rtl"&&(i+=Xe(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var $4=25;function G4(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=ce(e),i=Fe(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,y=0;if(s){let b=!sn()||t==="fixed";o?b||(m=-s.offsetLeft,y=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,y=s.offsetTop))}if(ln(i)<=0){let b=i.ownerDocument,x=b.body,O=getComputedStyle(x),R=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,L=Math.abs(i.clientWidth-x.clientWidth-R),M=getComputedStyle(i).scrollbarGutter==="stable both-edges"?L/2:L;M<=$4&&(l-=M)}return{width:l,height:f,x:m,y}}function H4(e,t){let n=Ar(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=jt(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function $s(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=G4(e,n,t);else if(t==="document")o=B4(Fe(e));else if(Ee(t))o=H4(t,n);else{let a=Vs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return St(o)}function W4(e,t){let n=t.get(e);if(n)return n;let o=on(e,[],!1).filter(l=>Ee(l)&&Et(l)!=="body"),a=null,i=Ae(e).position==="fixed",s=i?Je(e):e;for(;Ee(s)&&!Vt(s);){let l=Ae(s),f=Wt(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(h=>h!==s):a=l,s=Je(s)}return t.set(e,o),o}function V4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Cr(t)?[]:W4(t,this._c):[].concat(n),o],l=$s(t,s[0],a),f=l.top,m=l.right,y=l.bottom,h=l.left;for(let b=1;b<s.length;b++){let x=$s(t,s[b],a);f=Xe(x.top,f),m=br(x.right,m),y=br(x.bottom,y),h=Xe(x.left,h)}return{width:m-h,height:y-f,x:h,y:f}}function j4(e){let{width:t,height:n}=Hs(e);return{width:t,height:n}}function K4(e,t,n){let o=Be(t),a=Fe(t),i=n==="fixed",s=Ar(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=we(0);if((o||!i)&&((Et(t)!=="body"||Sr(a))&&(l=Er(t)),o)){let b=Ar(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=ln(a));let m=a&&!o&&!i?js(a,l):we(0),y=s.left+l.scrollLeft-f.x-m.x,h=s.top+l.scrollTop-f.y-m.y;return{x:y,y:h,width:s.width,height:s.height}}function Po(e){return Ae(e).position==="static"}function Gs(e,t){if(!Be(e)||Ae(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function Ks(e,t){let n=ce(e);if(Cr(e))return n;if(!Be(e)){let a=Je(e);for(;a&&!Vt(a);){if(Ee(a)&&!Po(a))return a;a=Je(a)}return n}let o=Gs(e,t);for(;o&&Us(o)&&Po(o);)o=Gs(o,t);return o&&Vt(o)&&Po(o)&&!Wt(o)?n:o||Fs(e)||n}var Z4=async function(e){let t=this.getOffsetParent||Ks,n=this.getDimensions,o=await n(e.floating);return{reference:K4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function q4(e){return Ae(e).direction==="rtl"}var dn={convertOffsetParentRelativeRectToViewportRelativeRect:U4,getDocumentElement:Fe,getClippingRect:V4,getOffsetParent:Ks,getElementRects:Z4,getClientRects:F4,getDimensions:j4,getScale:jt,isElement:Ee,isRTL:q4};var Zs=Is,qs=Ts;var Ys=(e,t,n)=>{let o=new Map,a=n??{},i={...dn,...a.platform,_c:o};return ks(e,t,{...a,platform:i})};function Xs(e){return Y4(e)}function Do(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function Y4(e){for(let t=e;t;t=Do(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Do(e);t;t=Do(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||Wt(n)||t.tagName==="BODY"))return t}return null}async function Qs(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Ys(e,t,{strategy:o.strategy,platform:{...dn,getOffsetParent:a=>dn.getOffsetParent(a,Xs)},middleware:[qs({crossAxis:!0}),Zs({allowedPlacements:[o.placement]})]})}var tr=E(P());var oa=E(oe());var Js=E(oe(),1);var Uo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},X4=e=>({fromAttribute:t=>{if(t==null)return Lr(e);try{return JSON.parse(t)}catch{return Lr(e)}},toAttribute:t=>JSON.stringify(t)});function ec(e,t){return(0,Js.property)({type:Object,converter:X4(e),hasChanged:Or,...t??{}})}function Q4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Kt(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Kt(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Kt(e,t){try{return Q4(e,t)}catch{return!1}}function Or(e,t){return!Kt(e,t)}function Lr(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function fn(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var tc=E(oe(),1);var Fo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Or,attribute:!1,...t};(0,tc.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var un=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var At=E(oe(),1);var pn=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var hn=E(V(),1);var mn=class extends hn.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return(0,hn.adoptStyles)(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){Uo(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function rc(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var qt=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},ic,nc=Symbol("constructorPrototype"),oc=Symbol("constructorName"),sc=Symbol("exportpartsDebouncer"),ac=Symbol("dynamicDependenciesLoaded"),Zt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Zt.eventName="exportparts-updated";var Ne=class extends mn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ic]=new pn(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[sc].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[oc]=this.constructor.name,this[nc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[oc]&&Object.setPrototypeOf(this,this[nc])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[ac]||(n[ac]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Zt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Zt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Zt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=rc(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var n,o,a,i,s,l;let f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let y=new Set;for(let b of(i=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let x=(s=(o=b.getAttribute("part"))===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:[],O=(l=(a=b.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(L=>L.split(":")[1]))!==null&&l!==void 0?l:[],R=[...x,...O].filter(f).map(L=>L.trim());for(let L of R)y.add(L)}if(y.size===0){this.exportparts=void 0;return}let h=[...y.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...h].join(", ")}};ic=sc;qt([(0,At.property)()],Ne.prototype,"exportpartsPrefix",void 0);qt([ec([])],Ne.prototype,"exportpartsPrefixes",void 0);qt([(0,At.property)({reflect:!0})],Ne.prototype,"exportparts",void 0);qt([(0,At.property)()],Ne.prototype,"customStylesheet",void 0);qt([(0,At.property)()],Ne.prototype,"elementToFocus",void 0);qt([(0,At.state)()],Ne.prototype,"useAdoptedStyleSheets",void 0);function yn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Rr=Symbol("internalReduxEventsUnsubscribers"),et=Symbol("internalStoresUnsubscribers"),Lt=Symbol("internalStores"),J4=fn(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Lt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Lt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Lt].get(s)}addStore(s,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Lt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Lt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Lt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[et].has(s.store):this[et].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f,m;this[et].set(s,l.subscribe(()=>this.updateFromStores())),this[Rr].set(s,[]),yn(l)&&(!((f=l.deprecatedKeys)===null||f===void 0)&&f.length&&this.reduxConstructor.reduxProperties.forEach((y,h)=>{this.getStore(y.store)===l&&l.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",l.name)}),l.eventBus&&((m=this.reduxConstructor.reduxEventListeners)===null||m===void 0||m.forEach((y,h)=>{if(typeof this[h]=="function"&&(!y.store||l.name===y.store)){let b=x=>this[h](x);l.addEventListener(y.eventName,b),this[Rr].get(s).push(()=>l.removeEventListener(y.eventName,b))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[et].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[et].has(s)&&this[et].get(s)(),this[et].delete(s),(l=this[Rr].get(s))===null||l===void 0||l.forEach(f=>f()),this[Rr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=et,n=Lt,o=Rr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),cc=class extends J4(Ne){};function ee(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var e0=typeof Symbol=="function"&&Symbol.observable||"@@observable",lc=e0,Bo=()=>Math.random().toString(36).substring(7).split("").join("."),t0={INIT:`@@redux/INIT${Bo()}`,REPLACE:`@@redux/REPLACE${Bo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bo()}`},gn=t0;function bn(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $o(e,t,n){if(typeof e!="function")throw new Error(ee(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ee(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ee(1));return n($o)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((L,M)=>{s.set(M,L)}))}function y(){if(f)throw new Error(ee(3));return a}function h(L){if(typeof L!="function")throw new Error(ee(4));if(f)throw new Error(ee(5));let M=!0;m();let I=l++;return s.set(I,L),function(){if(M){if(f)throw new Error(ee(6));M=!1,m(),s.delete(I),i=null}}}function b(L){if(!bn(L))throw new Error(ee(7));if(typeof L.type>"u")throw new Error(ee(8));if(typeof L.type!="string")throw new Error(ee(17));if(f)throw new Error(ee(9));try{f=!0,a=o(a,L)}finally{f=!1}return(i=s).forEach(I=>{I()}),L}function x(L){if(typeof L!="function")throw new Error(ee(10));o=L,b({type:gn.REPLACE})}function O(){let L=h;return{subscribe(M){if(typeof M!="object"||M===null)throw new Error(ee(11));function I(){let k=M;k.next&&k.next(y())}return I(),{unsubscribe:L(I)}},[lc](){return this}}}return b({type:gn.INIT}),{dispatch:b,subscribe:h,getState:y,replaceReducer:x,[lc]:O}}function r0(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:gn.INIT})>"u")throw new Error(ee(12));if(typeof n(void 0,{type:gn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ee(13))})}function Go(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{r0(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,y={};for(let h=0;h<o.length;h++){let b=o[h],x=n[b],O=l[b],R=x(O,f);if(typeof R>"u"){let L=f&&f.type;throw new Error(ee(14))}y[b]=R,m=m||R!==O}return m=m||o.length!==Object.keys(l).length,m?y:l}}function _r(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function dc(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(ee(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=_r(...l)(a.dispatch),{...a,dispatch:i}}}function fc(e){return bn(e)&&"type"in e&&typeof e.type=="string"}var vc=Symbol.for("immer-nothing"),uc=Symbol.for("immer-draftable"),re=Symbol.for("immer-state");function Le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object,Xt=de.getPrototypeOf,Cn="constructor",_n="prototype",jo="configurable",En="enumerable",vn="writable",wr="value",Me=e=>!!e&&!!e[re];function fe(e){return e?Sc(e)||Nn(e)||!!e[uc]||!!e[Cn]?.[uc]||Mn(e)||kr(e):!1}var n0=de[_n][Cn].toString(),pc=new WeakMap;function Sc(e){if(!e||!ea(e))return!1;let t=Xt(e);if(t===null||t===de[_n])return!0;let n=de.hasOwnProperty.call(t,Cn)&&t[Cn];if(n===Object)return!0;if(!Yt(n))return!1;let o=pc.get(n);return o===void 0&&(o=Function.toString.call(n),pc.set(n,o)),o===n0}function wn(e,t,n=!0){zr(e)===0?(n?Reflect.ownKeys(e):de.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function zr(e){let t=e[re];return t?t.type_:Nn(e)?1:Mn(e)?2:kr(e)?3:0}var Ho=(e,t,n=zr(e))=>n===2?e.has(t):de[_n].hasOwnProperty.call(e,t),Ko=(e,t,n=zr(e))=>n===2?e.get(t):e[t],An=(e,t,n,o=zr(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function o0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Nn=Array.isArray,Mn=e=>e instanceof Map,kr=e=>e instanceof Set,ea=e=>typeof e=="object",Yt=e=>typeof e=="function",Wo=e=>typeof e=="boolean";function a0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var $e=e=>e.copy_||e.base_;var ta=e=>e.modified_?e.copy_:e.base_;function Zo(e,t){if(Mn(e))return new Map(e);if(kr(e))return new Set(e);if(Nn(e))return Array[_n].slice.call(e);let n=Sc(e);if(t===!0||t==="class_only"&&!n){let o=de.getOwnPropertyDescriptors(e);delete o[re];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[vn]===!1&&(l[vn]=!0,l[jo]=!0),(l.get||l.set)&&(o[s]={[jo]:!0,[vn]:!0,[En]:l[En],[wr]:e[s]})}return de.create(Xt(e),o)}else{let o=Xt(e);if(o!==null&&n)return{...e};let a=de.create(o);return de.assign(a,e)}}function zn(e,t=!1){return kn(e)||Me(e)||!fe(e)||(zr(e)>1&&de.defineProperties(e,{set:xn,add:xn,clear:xn,delete:xn}),de.freeze(e),t&&wn(e,(n,o)=>{zn(o,!0)},!1)),e}function i0(){Le(2)}var xn={[wr]:i0};function kn(e){return e===null||!ea(e)?!0:de.isFrozen(e)}var Ln="MapSet",qo="Patches",mc="ArrayMethods",Cc={};function Ot(e){let t=Cc[e];return t||Le(0,e),t}var hc=e=>!!Cc[e];var Nr,Ec=()=>Nr,s0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:hc(Ln)?Ot(Ln):void 0,arrayMethodsPlugin_:hc(mc)?Ot(mc):void 0});function yc(e,t){t&&(e.patchPlugin_=Ot(qo),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yo(e){Xo(e),e.drafts_.forEach(c0),e.drafts_=null}function Xo(e){e===Nr&&(Nr=e.parent_)}var gc=e=>Nr=s0(Nr,e);function c0(e){let t=e[re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[re].modified_&&(Yo(t),Le(4)),fe(e)&&(e=xc(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[re].base_,e,t)}else e=xc(t,n);return l0(t,e,!0),Yo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vc?e:void 0}function xc(e,t){if(kn(t))return t;let n=t[re];if(!n)return On(t,e.handledSet_,e);if(!In(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);Oc(n,e)}return n.copy_}function l0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&zn(t,n)}function Ac(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var In=(e,t)=>e.scope_===t,d0=[];function Lc(e,t,n,o){let a=$e(e),i=e.type_;if(o!==void 0&&Ko(a,o,i)===t){An(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;wn(a,(f,m)=>{if(Me(m)){let y=l.get(m)||[];y.push(f),l.set(m,y)}})}let s=e.draftLocations_.get(t)??d0;for(let l of s)An(a,l,n,i)}function f0(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!In(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=ta(i);Lc(e,i.draft_??i,s,n),Oc(i,a)})}function Oc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}Ac(e)}}function u0(e,t,n){let{scope_:o}=e;if(Me(n)){let a=n[re];In(a,o)&&a.callbacks_.push(function(){Sn(e);let s=ta(a);Lc(e,n,s,t)})}else fe(n)&&e.callbacks_.push(function(){let i=$e(e);e.type_===3?i.has(n)&&On(n,o.handledSet_,o):Ko(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&On(Ko(e.copy_,t,e.type_),o.handledSet_,o)})}function On(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Me(e)||t.has(e)||!fe(e)||kn(e)||(t.add(e),wn(e,(o,a)=>{if(Me(a)){let i=a[re];if(In(i,n)){let s=ta(i);An(e,o,s,e.type_),Ac(i)}}else fe(a)&&On(a,t,n)})),e}function p0(e,t){let n=Nn(e),o={type_:n?1:0,scope_:t?t.scope_:Ec(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Rn;n&&(a=[o],i=Mr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Rn={get(e,t){if(t===re)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=$e(e);if(!Ho(a,t,e.type_))return h0(e,a,t);let i=a[t];if(e.finalized_||!fe(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&a0(t))return i;if(i===Vo(e.base_,t)||m0(e,t,i)){Sn(e);let s=e.type_===1?+t:t,l=Jo(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in $e(e)},ownKeys(e){return Reflect.ownKeys($e(e))},set(e,t,n){let o=Rc($e(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Vo($e(e),t),i=a?.[re];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(o0(n,a)&&(n!==void 0||Ho(e.base_,t,e.type_)))return!0;Sn(e),Qo(e)}return e.copy_[t]===n&&(n!==void 0||Ho(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),u0(e,t,n)),!0},deleteProperty(e,t){return Sn(e),Vo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=$e(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[vn]:!0,[jo]:e.type_!==1||t!=="length",[En]:o[En],[wr]:n[t]}},defineProperty(){Le(11)},getPrototypeOf(e){return Xt(e.base_)},setPrototypeOf(){Le(12)}},Mr={};for(let e in Rn){let t=Rn[e];Mr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Mr.deleteProperty=function(e,t){return Mr.set.call(this,e,t,void 0)};Mr.set=function(e,t,n){return Rn.set.call(this,e[0],t,n,e[0])};function Vo(e,t){let n=e[re];return(n?$e(n):e)[t]}function m0(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!fe(n)||n[re]?!1:e.baseRefs_.has(n)}function h0(e,t,n){let o=Rc(t,n);return o?wr in o?o[wr]:o.get?.call(e.draft_):void 0}function Rc(e,t){if(!(t in e))return;let n=Xt(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Xt(n)}}function Qo(e){e.modified_||(e.modified_=!0,e.parent_&&Qo(e.parent_))}function Sn(e){e.copy_||(e.assigned_=new Map,e.copy_=Zo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var y0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Yt(t)&&!Yt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,y=>n.call(this,y,...m))}}Yt(n)||Le(6),o!==void 0&&!Yt(o)&&Le(7);let a;if(fe(t)){let i=gc(this),s=Jo(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?Yo(i):Xo(i)}return yc(i,o),bc(a,i)}else if(!t||!ea(t)){if(a=n(t),a===void 0&&(a=t),a===vc&&(a=void 0),this.autoFreeze_&&zn(a,!0),o){let i=[],s=[];Ot(qo).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else Le(1,t)},this.produceWithPatches=(t,n)=>{if(Yt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Wo(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Wo(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Wo(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){fe(e)||Le(8),Me(e)&&(e=_c(e));let t=gc(this),n=Jo(t,e,void 0);return n[re].isManual_=!0,Xo(t),n}finishDraft(e,t){let n=e&&e[re];(!n||!n.isManual_)&&Le(9);let{scope_:o}=n;return yc(o,t),bc(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=Ot(qo).applyPatches_;return Me(e)?o(e,t):this.produce(e,a=>o(a,t))}};function Jo(e,t,n,o){let[a,i]=Mn(t)?Ot(Ln).proxyMap_(t,n):kr(t)?Ot(Ln).proxySet_(t,n):p0(t,n);return(n?.scope_??Ec()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?f0(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function _c(e){return Me(e)||Le(10,e),wc(e)}function wc(e){if(!fe(e)||kn(e))return e;let t=e[re],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Zo(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=Zo(e,!0);let a=n;return kr(n)&&(n=new Set),wn(a,(i,s)=>{An(n,i,wc(s))},o),t&&(t.finalized_=!1),n}var g0=globalThis.Iterator,T7=typeof g0?.from=="function";var b0=new y0,ra=b0.produce;function Nc(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var Mc=Nc(),zc=Nc;var x0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_r:_r.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Tr(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(ze(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>o!=null&&o.type===e&&fc(o),n}var Tc=class Ir extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ir.prototype)}static get[Symbol.species](){return Ir}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ir(...t[0].concat(this)):new Ir(...t.concat(this))}};function kc(e){return fe(e)?ra(e,()=>{}):e}function Tn(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function v0(e){return typeof e=="boolean"}var S0=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new Tc;return n&&(v0(n)?s.push(Mc):s.push(zc(n.extraArgument))),s},C0="RTK_autoBatch";var Ic=e=>t=>{setTimeout(t,e)},E0=(e,t,n)=>o=>{let a=!1,i,s,l=()=>{a||(a=!0,t?.(i),clearTimeout(s),o())};i=e(l),s=setTimeout(l,n)},A0=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?E0(window.requestAnimationFrame,window.cancelAnimationFrame,100):Ic(10):e.type==="callback"?e.queueNotification:Ic(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(y=>y()))};return Object.assign({},o,{subscribe(y){let h=()=>a&&y(),b=o.subscribe(h);return l.add(y),()=>{b(),l.delete(y)}},dispatch(y){try{return a=!y?.meta?.[C0],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(y)}finally{a=!0}}})},L0=e=>function(n){let{autoBatch:o=!0}=n??{},a=new Tc(e);return o&&a.push(A0(typeof o=="object"?o:void 0)),a};function Pc(e){let t=S0(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(bn(n))f=Go(n);else throw new Error(ze(1));let m;typeof o=="function"?m=o(t):m=t();let y=_r;a&&(y=x0({trace:!1,...typeof a=="object"&&a}));let h=dc(...m),b=L0(h),x=typeof l=="function"?l(b):b(),O=y(...x);return $o(f,s,O)}function Dc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(ze(28));if(l in t)throw new Error(ze(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function O0(e){return typeof e=="function"}function R0(e,t){let[n,o,a]=Dc(t),i;if(O0(e))i=()=>kc(e());else{let f=kc(e);i=()=>f}function s(f,m,y){if(Me(f)){let h=m(f,y);return h===void 0?f:h}else{if(fe(f))return ra(f,h=>m(h,y));{let h=m(f,y);if(h===void 0){if(f===null)return f;throw new Error(ze(9))}return h}}}function l(f=i(),m){let y=n[m.type],h;for(let{matcher:b,reducer:x}of o)b(m)&&x&&(h??=[]).push(x);if(!y&&!h)return a?s(f,a,m):f;if(y&&(f=s(f,y,m)),h)for(let b of h)f=s(f,b,m);return f}return l.getInitialState=i,l}var _0=Symbol.for("rtk-slice-createasyncthunk");function w0(e,t){return`${e}/${t}`}function N0({creators:e}={}){let t=e?.asyncThunk?.[_0];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(ze(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(z0()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(w,k){let D=typeof w=="string"?w:w.type;if(!D)throw new Error(ze(12));if(D in f.sliceCaseReducersByType)throw new Error(ze(13));return f.sliceCaseReducersByType[D]=k,m},addMatcher(w,k){return f.sliceMatchers.push({matcher:w,reducer:k}),m},exposeAction(w,k){return f.actionCreators[w]=k,m},exposeCaseReducer(w,k){return f.sliceCaseReducersByName[w]=k,m}};l.forEach(w=>{let k=s[w],D={reducerName:w,type:w0(a,w),createNotation:typeof o.reducers=="function"};I0(k)?P0(D,k,m,t):k0(D,k,m)});function y(){let[w={},k=[],D=void 0]=typeof o.extraReducers=="function"?Dc(o.extraReducers):[o.extraReducers],G={...w,...f.sliceCaseReducersByType};return R0(o.initialState,ne=>{for(let K in G)ne.addCase(K,G[K]);for(let K of f.sliceMatchers)ne.addMatcher(K.matcher,K.reducer);for(let K of k)ne.addMatcher(K.matcher,K.reducer);D&&ne.addDefaultCase(D)})}let h=w=>w,b=new Map,x=new WeakMap,O;function R(w,k){return O||(O=y()),O(w,k)}function L(){return O||(O=y()),O.getInitialState()}function M(w,k=!1){function D(ne){let K=ne[w];return typeof K>"u"&&k&&(K=Tn(x,D,L)),K}function G(ne=h){return Tn(Tn(b,k,()=>new WeakMap),ne,()=>{let K={};for(let[Pt,me]of Object.entries(o.selectors??{}))K[Pt]=M0(me,ne,()=>Tn(x,ne,L),k);return K})}return{reducerPath:w,getSelectors:G,get selectors(){return G(D)},selectSlice:D}}let I={name:a,reducer:R,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:L,...M(i),injectInto(w,{reducerPath:k,...D}={}){let G=k??i;return w.inject({reducerPath:G,reducer:R},D),{...I,...M(G,!0)}}};return I}}function M0(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var Uc=N0();function z0(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function k0({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!T0(o))throw new Error(ze(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Tr(e,s):Tr(e))}function I0(e){return e._reducerDefinitionType==="asyncThunk"}function T0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function P0({type:e,reducerName:t},n,o,a){if(!a)throw new Error(ze(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:y}=n,h=a(e,i,y);o.exposeAction(t,h),s&&o.addCase(h.fulfilled,s),l&&o.addCase(h.pending,l),f&&o.addCase(h.rejected,f),m&&o.addMatcher(h.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Pn,pending:l||Pn,rejected:f||Pn,settled:m||Pn})}function Pn(){}var Fc="listener",Bc="completed",$c="cancelled",H7=`task-${$c}`,W7=`task-${Bc}`,V7=`${Fc}-${$c}`,j7=`${Fc}-${Bc}`;var{assign:Gc}=Object;var na="listenerMiddleware";var D0=Gc(Tr(`${na}/add`),{withTypes:()=>D0}),K7=Tr(`${na}/removeAll`),U0=Gc(Tr(`${na}/remove`),{withTypes:()=>U0});function ze(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var F0=fn(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),Dn=class extends F0(Object){};window.ftReduxStores||(window.ftReduxStores={});var Hc=class e extends Dn{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(yn(i))return i;if(a==null)return;let s=Uc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Pc({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let y=Lr(s.getInitialState());for(let h of m.keeping)y[h]=(f??y)[h];return y}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus,a.deprecatedKeys)}constructor(t,n,o,a){super(),this.reduxSlice=t,this.reduxStore=n,this.deprecatedKeys=a,this.isFtReduxStore=!0,this.commands=new un,this.injectInto=(s,l)=>this.reduxSlice.injectInto(s,l),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,f)=>{let m=l,y=s[m];return y?(...h)=>{let b=y(...h.map(i));return this.reduxStore.dispatch(b),b}:h=>{let b=m,x=this.getState()[b];Kt(x,h)||this.setState({[b]:i(h)})}}}),this.eventBus=o??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Un=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var Fn=E(P()),B0="ft-app-info",Rt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Rt.eventName="authentication-change";var Pr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Pr.eventName="ui-locale-changed";var $0={session:(e,t)=>{(0,Fn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>T.dispatchEvent(new Rt(t.payload)),0))}},T=Fn.FtReduxStore.get({name:B0,reducers:$0,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Wc=E(P()),Bn=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Sh=(0,Wc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(T)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>Un.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Bn([(0,oa.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Bn([(0,oa.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Bn([Fo({store:T.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),Bn([Fo({store:T.name})],t.prototype,"uiLocale",void 0),t});var Vc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Vc||(Vc={}));var jc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(jc||(jc={}));var Kc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(Kc||(Kc={}));var Zc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(Zc||(Zc={}));var qc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(qc||(qc={}));var Yc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Yc||(Yc={}));var Xc;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(Xc||(Xc={}));var Qc;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(Qc||(Qc={}));var Jc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Jc||(Jc={}));var el;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(el||(el={}));var tl;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER",e.DOC_DIFF="DOC_DIFF"})(tl||(tl={}));var rl;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(rl||(rl={}));var nl;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(nl||(nl={}));var ol;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(ol||(ol={}));var al;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(al||(al={}));var il;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(il||(il={}));var sl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(sl||(sl={}));var cl;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(cl||(cl={}));var ll;(function(e){e.ASC="ASC",e.DESC="DESC"})(ll||(ll={}));var dl;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(dl||(dl={}));var fl;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(fl||(fl={}));var ul;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ul||(ul={}));var pl;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(pl||(pl={}));var ml;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ml||(ml={}));var hl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(hl||(hl={}));var yl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(yl||(yl={}));var gl;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(gl||(gl={}));var bl;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(bl||(bl={}));var Y;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(Y||(Y={}));var ye;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ye||(ye={}));var xl;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(xl||(xl={}));var vl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(vl||(vl={}));var Sl;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Sl||(Sl={}));var Cl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Cl||(Cl={}));var El;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(El||(El={}));var Al;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Al||(Al={}));var Ll;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ll||(Ll={}));var Ol;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})(Ol||(Ol={}));var Rl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Rl||(Rl={}));var _l;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(_l||(_l={}));var wl;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(wl||(wl={}));var Nl;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Nl||(Nl={}));var Ml;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Ml||(Ml={}));var G0={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN,Y.BEHAVIOR_DATA_USER],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function zl(e,t){return e===t||(G0[e]??[]).some(n=>zl(n,t))}function aa(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(o=>zl(o,t))}function kl(e,...t){return e==null?!1:t.some(n=>aa(e,n))}var Vn=E(P());var ia=E(P());var _t=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=T.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=T.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var Qt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:_t.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):_t.await()}};var ue=class extends Qt{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ia.CacheRegistry,this.cache=t?a.commonCache:new ia.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var $n=class extends ue{async listMySearches(){let{session:t}=T.getState();return aa(t,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Gn=class extends ue{async listMyBookmarks(){let t=T.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Hn=class extends ue{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var Wn=class extends ue{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var H0="ft-user-assets",W0={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(ye).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ca(e,n,[...sa(e,n),a]),Il(e,n,1,o),Tl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ca(e,n,sa(e,n).map(a=>a.id===o.id?o:a)),Tl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ca(e,n,sa(e,n).filter(i=>i.id!==a)),Il(e,n,-1,o)}},Pl={[ye.SEARCHES]:"savedSearches",[ye.BOOKMARKS]:"bookmarks",[ye.BOOKS]:void 0,[ye.COLLECTIONS]:void 0},sa=(e,t)=>{var n;let o=Pl[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ca=(e,t,n)=>{let o=Pl[t];o&&(e[o]=n)},Il=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===ye.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Tl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},ae=Vn.FtReduxStore.get({name:H0,reducers:W0,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ye).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),la=class{constructor(t=new Hn,n=new Wn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Gn,this.savedSearchesService=new $n,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=T.getState();(0,Vn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ae.actions.clearAssetCount(),ae.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ae.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ae.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ae.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ae.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ae.getState().assetCounts.allAsset[t]!==n.count&&ae.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ae.getState().assetCounts.bookmarkByMap[t]!==n.count&&ae.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ae.getState().assetCounts.bookmarkByMap).length!==0;t===ye.BOOKMARKS&&n&&ae.actions.clearBookmarkCountByMap(),ae.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ae.actions.bookmarks(n)}}},V0=new la;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=V0);var da=class{addCommand(t,n=!1){T.commands.add(t,n)}consumeCommand(t){return T.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new da;var ge=E(P());var Dl,Jt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},j0=Symbol("clearAfterUnitTest"),jn=class extends(0,ge.withEventBus)(ue){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Dl]=()=>{this.defaultMessages={},this.cache=new ge.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=T.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,ge.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new ge.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof ge.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Jt({loadedContexts:t})),this.dispatchEvent(new Jt({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new Jt({loadedContexts:[t]})),this.dispatchEvent(new Jt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ge.delay)(0).then(()=>o()).catch(()=>null)))}};Dl=j0;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends jn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends jn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Dr=window.FluidTopicsI18nService,fa=window.FluidTopicsCustomI18nService;var Ul=E(P()),ua=class{highlightHtml(t,n,o){(0,Ul.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ua;var Fl=E(P());var pa=class{isDate(t){var n,o,a,i;return(i=(o=((a=(n=T.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]).find(l=>l.key===t))===null||o===void 0?void 0:o.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Fl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:T.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new pa;var Bl=E(P());var Ur=class{static get(t,n,{baseUrl:o,localesConfiguration:a,availableContentLocales:i}=T.getState()){var s;if(n==="all"&&a?.allLanguagesAllowed)n=void 0;else if(!n||i.length>0&&!i.some(l=>l.lang===n)){let l=a?.defaultLocales.defaultContentLocale;n=l?`${l.lang}-${l.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new Bl.SearchPlaceConverter(o,t??20,a?.allLanguagesAllowed,n,i)}};var ma=class{urlToSearchRequest(t){return Ur.get().parse(t)}searchRequestToUrl(t){return Ur.get().serialize(t)}};window.FluidTopicsUrlService=new ma;var Ge=E(P());var wt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};wt.eventName="before-location-change";var Nt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Nt.eventName="change";var ha=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},$l=new ha;var Kn=class e extends Ge.WithEventBus{static build(){return new e(window.history,$l,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Ge.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Nt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),m=new wt(f);this.dispatchEvent(m);let y=n(),h={...y===this.currentIndex?this.currentState:void 0,...i,index:y,href:m.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addBeforeLocationChangeListener(t){this.addEventListener(wt.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(wt.eventName,t)}addHistoryChangeListener(t){this.addEventListener(Nt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Nt.eventName,t)}currentItem(){return(0,Ge.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Ge.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ge.deepCopy)(n.find(o=>t(o)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,Ge.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Kn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var Gl=E(V());var Hl=Gl.css`
|
|
836
|
+
`;var Os=["top","right","bottom","left"],Ls=["start","end"],Mo=Os.reduce((e,t)=>e.concat(t,t+"-"+Ls[0],t+"-"+Ls[1]),[]),br=Math.min,Xe=Math.max,xr=Math.round;var we=e=>({x:e,y:e}),N4={left:"right",right:"left",bottom:"top",top:"bottom"};function Rs(e,t,n){return Xe(e,br(t,n))}function rn(e,t){return typeof e=="function"?e(t):e}function vr(e){return e.split("-")[0]}function Qe(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function ko(e){return e==="y"?"height":"width"}function nn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Io(e){return zo(nn(e))}function _s(e,t,n){n===void 0&&(n=!1);let o=Qe(e),a=Io(e),i=ko(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=No(s)),[s,No(s)]}function ws(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function No(e){let t=vr(e);return N4[t]+e.slice(t.length)}function M4(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Ns(e){return typeof e!="number"?M4(e):{top:e,right:e,bottom:e,left:e}}function St(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Ms(e,t,n){let{reference:o,floating:a}=e,i=nn(t),s=Io(t),l=ko(s),f=vr(t),m=i==="y",y=o.x+o.width/2-a.width/2,h=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:y,y:o.y-a.height};break;case"bottom":x={x:y,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:h};break;case"left":x={x:o.x-a.width,y:h};break;default:x={x:o.x,y:o.y}}let O=Qe(t);return O&&(x[s]+=b*(O==="end"?1:-1)*(n&&m?-1:1)),x}async function zs(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:h="floating",altBoundary:b=!1,padding:x=0}=rn(t,e),O=Ns(x),L=l[b?h==="floating"?"reference":"floating":h],M=St(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(L)))==null||n?L:L.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:y,strategy:f})),I=h==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(w))&&await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1},D=St(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:w,strategy:f}):I);return{top:(M.top-D.top+O.top)/k.y,bottom:(D.bottom-M.bottom+O.bottom)/k.y,left:(M.left-D.left+O.left)/k.x,right:(D.right-M.right+O.right)/k.x}}var z4=50,ks=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:zs},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:y,y:h}=Ms(m,o,f),b=o,x=0,O={};for(let R=0;R<i.length;R++){let L=i[R];if(!L)continue;let{name:M,fn:I}=L,{x:w,y:k,data:D,reset:G}=await I({x:y,y:h,initialPlacement:o,placement:b,strategy:a,middlewareData:O,rects:m,platform:l,elements:{reference:e,floating:t}});y=w??y,h=k??h,O[M]={...O[M],...D},G&&x<z4&&(x++,typeof G=="object"&&(G.placement&&(b=G.placement),G.rects&&(m=G.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):G.rects),{x:y,y:h}=Ms(m,b,f)),R=-1)}return{x:y,y:h,placement:b,strategy:a,middlewareData:O}};function k4(e,t,n){return(e?[...n.filter(a=>Qe(a)===e),...n.filter(a=>Qe(a)!==e)]:n.filter(a=>vr(a)===a)).filter(a=>e?Qe(a)===e||(t?ws(a)!==a:!1):!0)}var Is=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:f,elements:m}=t,{crossAxis:y=!1,alignment:h,allowedPlacements:b=Mo,autoAlignment:x=!0,...O}=rn(e,t),R=h!==void 0||b===Mo?k4(h||null,x,b):b,L=((n=s.autoPlacement)==null?void 0:n.index)||0,M=R[L];if(M==null)return{};if(l!==M)return{reset:{placement:R[0]}};let I=await f.detectOverflow(t,O),w=_s(M,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[I[vr(M)],I[w[0]],I[w[1]]],D=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:M,overflows:k}],G=R[L+1];if(G)return{data:{index:L+1,overflows:D},reset:{placement:G}};let ne=D.map(me=>{let lr=Qe(me.placement);return[me.placement,lr&&y?me.overflows.slice(0,2).reduce((h4,y4)=>h4+y4,0):me.overflows[0],me.overflows]}).sort((me,lr)=>me[1]-lr[1]),Pt=((a=ne.filter(me=>me[2].slice(0,Qe(me[0])?2:3).every(lr=>lr<=0))[0])==null?void 0:a[0])||ne[0][0];return Pt!==l?{data:{index:L+1,overflows:D},reset:{placement:Pt}}:{}}}};var Ts=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:f={fn:I=>{let{x:w,y:k}=I;return{x:w,y:k}}},...m}=rn(e,t),y={x:n,y:o},h=await i.detectOverflow(t,m),b=nn(a),x=zo(b),O=y[x],R=y[b],L=(I,w)=>Rs(w+h[I==="y"?"top":"left"],w,w-h[I==="y"?"bottom":"right"]);s&&(O=L(x,O)),l&&(R=L(b,R));let M=f.fn({...t,[x]:O,[b]:R});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[x]:s,[b]:l}}}}}};function an(){return typeof window<"u"}function Et(e){return Ds(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(Ds(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ds(e){return an()?e instanceof Node||e instanceof ce(e).Node:!1}function Ee(e){return an()?e instanceof Element||e instanceof ce(e).Element:!1}function Be(e){return an()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Ps(e){return!an()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function Sr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Us(e){return/^(table|td|th)$/.test(Et(e))}function Cr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var I4=/transform|translate|scale|rotate|perspective|filter/,T4=/paint|layout|strict|content/,Ct=e=>!!e&&e!=="none",To;function Wt(e){let t=Ee(e)?Ae(e):e;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!sn()&&(Ct(t.backdropFilter)||Ct(t.filter))||I4.test(t.willChange||"")||T4.test(t.contain||"")}function Fs(e){let t=Je(e);for(;Be(t)&&!Vt(t);){if(Wt(t))return t;if(Cr(t))return null;t=Je(t)}return null}function sn(){return To==null&&(To=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),To}function Vt(e){return/^(html|body|#document)$/.test(Et(e))}function Ae(e){return ce(e).getComputedStyle(e)}function Er(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(Et(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ps(e)&&e.host||Fe(e);return Ps(t)?t.host:t}function Bs(e){let t=Je(e);return Vt(t)?(e.ownerDocument||e).body:Be(t)&&Sr(t)?t:Bs(t)}function on(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=Bs(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=cn(s);return t.concat(s,s.visualViewport||[],Sr(a)?a:[],l&&n?on(l):[])}else return t.concat(a,on(a,[],n))}function cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hs(e){let t=Ae(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Be(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=xr(n)!==i||xr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Ws(e){return Ee(e)?e:e.contextElement}function jt(e){let t=Ws(e);if(!Be(t))return we(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=Hs(t),s=(i?xr(n.width):n.width)/o,l=(i?xr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var P4=we(0);function Vs(e){let t=ce(e);return!sn()||!t.visualViewport?P4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ce(e)}function Ar(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=Ws(e),s=we(1);t&&(o?Ee(o)&&(s=jt(o)):s=jt(e));let l=D4(i,n,o)?Vs(i):we(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,y=a.width/s.x,h=a.height/s.y;if(i&&o){let b=ce(i),x=Ee(o)?ce(o):o,O=b,R=cn(O);for(;R&&x!==O;){let L=jt(R),M=R.getBoundingClientRect(),I=Ae(R),w=M.left+(R.clientLeft+parseFloat(I.paddingLeft))*L.x,k=M.top+(R.clientTop+parseFloat(I.paddingTop))*L.y;f*=L.x,m*=L.y,y*=L.x,h*=L.y,f+=w,m+=k,O=ce(R),R=cn(O)}}return St({width:y,height:h,x:f,y:m})}function ln(e,t){let n=Er(e).scrollLeft;return t?t.left+n:Ar(Fe(e)).left+n}function js(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ln(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function U4(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Fe(o),l=t?Cr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=we(1),y=we(0),h=Be(o);if((h||!i)&&((Et(o)!=="body"||Sr(s))&&(f=Er(o)),h)){let x=Ar(o);m=jt(o),y.x=x.x+o.clientLeft,y.y=x.y+o.clientTop}let b=s&&!h&&!i?js(s,f):we(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+y.x+b.x,y:n.y*m.y-f.scrollTop*m.y+y.y+b.y}}function F4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function B4(e){let t=Er(e),n=e.ownerDocument.body,o=Xe(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Xe(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+ln(e),s=-t.scrollTop;return Ae(n).direction==="rtl"&&(i+=Xe(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var $4=25;function G4(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=ce(e),i=Fe(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,y=0;if(s){let b=!sn()||t==="fixed";o?b||(m=-s.offsetLeft,y=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,y=s.offsetTop))}if(ln(i)<=0){let b=i.ownerDocument,x=b.body,O=getComputedStyle(x),R=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,L=Math.abs(i.clientWidth-x.clientWidth-R),M=getComputedStyle(i).scrollbarGutter==="stable both-edges"?L/2:L;M<=$4&&(l-=M)}return{width:l,height:f,x:m,y}}function H4(e,t){let n=Ar(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=jt(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function $s(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=G4(e,n,t);else if(t==="document")o=B4(Fe(e));else if(Ee(t))o=H4(t,n);else{let a=Vs(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return St(o)}function W4(e,t){let n=t.get(e);if(n)return n;let o=on(e,[],!1).filter(l=>Ee(l)&&Et(l)!=="body"),a=null,i=Ae(e).position==="fixed",s=i?Je(e):e;for(;Ee(s)&&!Vt(s);){let l=Ae(s),f=Wt(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(h=>h!==s):a=l,s=Je(s)}return t.set(e,o),o}function V4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?Cr(t)?[]:W4(t,this._c):[].concat(n),o],l=$s(t,s[0],a),f=l.top,m=l.right,y=l.bottom,h=l.left;for(let b=1;b<s.length;b++){let x=$s(t,s[b],a);f=Xe(x.top,f),m=br(x.right,m),y=br(x.bottom,y),h=Xe(x.left,h)}return{width:m-h,height:y-f,x:h,y:f}}function j4(e){let{width:t,height:n}=Hs(e);return{width:t,height:n}}function K4(e,t,n){let o=Be(t),a=Fe(t),i=n==="fixed",s=Ar(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=we(0);if((o||!i)&&((Et(t)!=="body"||Sr(a))&&(l=Er(t)),o)){let b=Ar(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=ln(a));let m=a&&!o&&!i?js(a,l):we(0),y=s.left+l.scrollLeft-f.x-m.x,h=s.top+l.scrollTop-f.y-m.y;return{x:y,y:h,width:s.width,height:s.height}}function Po(e){return Ae(e).position==="static"}function Gs(e,t){if(!Be(e)||Ae(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function Ks(e,t){let n=ce(e);if(Cr(e))return n;if(!Be(e)){let a=Je(e);for(;a&&!Vt(a);){if(Ee(a)&&!Po(a))return a;a=Je(a)}return n}let o=Gs(e,t);for(;o&&Us(o)&&Po(o);)o=Gs(o,t);return o&&Vt(o)&&Po(o)&&!Wt(o)?n:o||Fs(e)||n}var Z4=async function(e){let t=this.getOffsetParent||Ks,n=this.getDimensions,o=await n(e.floating);return{reference:K4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function q4(e){return Ae(e).direction==="rtl"}var dn={convertOffsetParentRelativeRectToViewportRelativeRect:U4,getDocumentElement:Fe,getClippingRect:V4,getOffsetParent:Ks,getElementRects:Z4,getClientRects:F4,getDimensions:j4,getScale:jt,isElement:Ee,isRTL:q4};var Zs=Is,qs=Ts;var Ys=(e,t,n)=>{let o=new Map,a=n??{},i={...dn,...a.platform,_c:o};return ks(e,t,{...a,platform:i})};function Xs(e){return Y4(e)}function Do(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function Y4(e){for(let t=e;t;t=Do(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Do(e);t;t=Do(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||Wt(n)||t.tagName==="BODY"))return t}return null}async function Qs(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Ys(e,t,{strategy:o.strategy,platform:{...dn,getOffsetParent:a=>dn.getOffsetParent(a,Xs)},middleware:[qs({crossAxis:!0}),Zs({allowedPlacements:[o.placement]})]})}var tr=E(P());var oa=E(oe());var Js=E(oe(),1);var Uo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)},X4=e=>({fromAttribute:t=>{if(t==null)return Lr(e);try{return JSON.parse(t)}catch{return Lr(e)}},toAttribute:t=>JSON.stringify(t)});function ec(e,t){return(0,Js.property)({type:Object,converter:X4(e),hasChanged:Or,...t??{}})}function Q4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Kt(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Kt(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Kt(e,t){try{return Q4(e,t)}catch{return!1}}function Or(e,t){return!Kt(e,t)}function Lr(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function fn(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var tc=E(oe(),1);var Fo=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Or,attribute:!1,...t};(0,tc.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var un=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var At=E(oe(),1);var pn=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var hn=E(V(),1);var mn=class extends hn.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return(0,hn.adoptStyles)(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){Uo(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function rc(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var qt=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},ic,nc=Symbol("constructorPrototype"),oc=Symbol("constructorName"),sc=Symbol("exportpartsDebouncer"),ac=Symbol("dynamicDependenciesLoaded"),Zt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Zt.eventName="exportparts-updated";var Ne=class extends mn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ic]=new pn(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[sc].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[oc]=this.constructor.name,this[nc]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[oc]&&Object.setPrototypeOf(this,this[nc])}connectedCallback(){var t;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[ac]||(n[ac]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Zt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Zt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Zt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=rc(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var n,o,a,i,s,l;let f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let y=new Set;for(let b of(i=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let x=(s=(o=b.getAttribute("part"))===null||o===void 0?void 0:o.split(" "))!==null&&s!==void 0?s:[],O=(l=(a=b.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(L=>L.split(":")[1]))!==null&&l!==void 0?l:[],R=[...x,...O].filter(f).map(L=>L.trim());for(let L of R)y.add(L)}if(y.size===0){this.exportparts=void 0;return}let h=[...y.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...h].join(", ")}};ic=sc;qt([(0,At.property)()],Ne.prototype,"exportpartsPrefix",void 0);qt([ec([])],Ne.prototype,"exportpartsPrefixes",void 0);qt([(0,At.property)({reflect:!0})],Ne.prototype,"exportparts",void 0);qt([(0,At.property)()],Ne.prototype,"customStylesheet",void 0);qt([(0,At.property)()],Ne.prototype,"elementToFocus",void 0);qt([(0,At.state)()],Ne.prototype,"useAdoptedStyleSheets",void 0);function yn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Rr=Symbol("internalReduxEventsUnsubscribers"),et=Symbol("internalStoresUnsubscribers"),Lt=Symbol("internalStores"),J4=fn(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Lt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Lt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Lt].get(s)}addStore(s,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Lt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Lt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Lt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[et].has(s.store):this[et].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f,m;this[et].set(s,l.subscribe(()=>this.updateFromStores())),this[Rr].set(s,[]),yn(l)&&(!((f=l.deprecatedKeys)===null||f===void 0)&&f.length&&this.reduxConstructor.reduxProperties.forEach((y,h)=>{this.getStore(y.store)===l&&l.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",l.name)}),l.eventBus&&((m=this.reduxConstructor.reduxEventListeners)===null||m===void 0||m.forEach((y,h)=>{if(typeof this[h]=="function"&&(!y.store||l.name===y.store)){let b=x=>this[h](x);l.addEventListener(y.eventName,b),this[Rr].get(s).push(()=>l.removeEventListener(y.eventName,b))}}))),this.onStoreAvailable(s)}unsubscribeFromStores(){this[et].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[et].has(s)&&this[et].get(s)(),this[et].delete(s),(l=this[Rr].get(s))===null||l===void 0||l.forEach(f=>f()),this[Rr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=et,n=Lt,o=Rr,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),cc=class extends J4(Ne){};function ee(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var e0=typeof Symbol=="function"&&Symbol.observable||"@@observable",lc=e0,Bo=()=>Math.random().toString(36).substring(7).split("").join("."),t0={INIT:`@@redux/INIT${Bo()}`,REPLACE:`@@redux/REPLACE${Bo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bo()}`},gn=t0;function bn(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $o(e,t,n){if(typeof e!="function")throw new Error(ee(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ee(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ee(1));return n($o)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((L,M)=>{s.set(M,L)}))}function y(){if(f)throw new Error(ee(3));return a}function h(L){if(typeof L!="function")throw new Error(ee(4));if(f)throw new Error(ee(5));let M=!0;m();let I=l++;return s.set(I,L),function(){if(M){if(f)throw new Error(ee(6));M=!1,m(),s.delete(I),i=null}}}function b(L){if(!bn(L))throw new Error(ee(7));if(typeof L.type>"u")throw new Error(ee(8));if(typeof L.type!="string")throw new Error(ee(17));if(f)throw new Error(ee(9));try{f=!0,a=o(a,L)}finally{f=!1}return(i=s).forEach(I=>{I()}),L}function x(L){if(typeof L!="function")throw new Error(ee(10));o=L,b({type:gn.REPLACE})}function O(){let L=h;return{subscribe(M){if(typeof M!="object"||M===null)throw new Error(ee(11));function I(){let k=M;k.next&&k.next(y())}return I(),{unsubscribe:L(I)}},[lc](){return this}}}return b({type:gn.INIT}),{dispatch:b,subscribe:h,getState:y,replaceReducer:x,[lc]:O}}function r0(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:gn.INIT})>"u")throw new Error(ee(12));if(typeof n(void 0,{type:gn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ee(13))})}function Go(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{r0(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,y={};for(let h=0;h<o.length;h++){let b=o[h],x=n[b],O=l[b],R=x(O,f);if(typeof R>"u"){let L=f&&f.type;throw new Error(ee(14))}y[b]=R,m=m||R!==O}return m=m||o.length!==Object.keys(l).length,m?y:l}}function _r(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function dc(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(ee(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=_r(...l)(a.dispatch),{...a,dispatch:i}}}function fc(e){return bn(e)&&"type"in e&&typeof e.type=="string"}var vc=Symbol.for("immer-nothing"),uc=Symbol.for("immer-draftable"),re=Symbol.for("immer-state");function Le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object,Xt=de.getPrototypeOf,Cn="constructor",_n="prototype",jo="configurable",En="enumerable",vn="writable",wr="value",Me=e=>!!e&&!!e[re];function fe(e){return e?Sc(e)||Nn(e)||!!e[uc]||!!e[Cn]?.[uc]||Mn(e)||kr(e):!1}var n0=de[_n][Cn].toString(),pc=new WeakMap;function Sc(e){if(!e||!ea(e))return!1;let t=Xt(e);if(t===null||t===de[_n])return!0;let n=de.hasOwnProperty.call(t,Cn)&&t[Cn];if(n===Object)return!0;if(!Yt(n))return!1;let o=pc.get(n);return o===void 0&&(o=Function.toString.call(n),pc.set(n,o)),o===n0}function wn(e,t,n=!0){zr(e)===0?(n?Reflect.ownKeys(e):de.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function zr(e){let t=e[re];return t?t.type_:Nn(e)?1:Mn(e)?2:kr(e)?3:0}var Ho=(e,t,n=zr(e))=>n===2?e.has(t):de[_n].hasOwnProperty.call(e,t),Ko=(e,t,n=zr(e))=>n===2?e.get(t):e[t],An=(e,t,n,o=zr(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function o0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Nn=Array.isArray,Mn=e=>e instanceof Map,kr=e=>e instanceof Set,ea=e=>typeof e=="object",Yt=e=>typeof e=="function",Wo=e=>typeof e=="boolean";function a0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var $e=e=>e.copy_||e.base_;var ta=e=>e.modified_?e.copy_:e.base_;function Zo(e,t){if(Mn(e))return new Map(e);if(kr(e))return new Set(e);if(Nn(e))return Array[_n].slice.call(e);let n=Sc(e);if(t===!0||t==="class_only"&&!n){let o=de.getOwnPropertyDescriptors(e);delete o[re];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[vn]===!1&&(l[vn]=!0,l[jo]=!0),(l.get||l.set)&&(o[s]={[jo]:!0,[vn]:!0,[En]:l[En],[wr]:e[s]})}return de.create(Xt(e),o)}else{let o=Xt(e);if(o!==null&&n)return{...e};let a=de.create(o);return de.assign(a,e)}}function zn(e,t=!1){return kn(e)||Me(e)||!fe(e)||(zr(e)>1&&de.defineProperties(e,{set:xn,add:xn,clear:xn,delete:xn}),de.freeze(e),t&&wn(e,(n,o)=>{zn(o,!0)},!1)),e}function i0(){Le(2)}var xn={[wr]:i0};function kn(e){return e===null||!ea(e)?!0:de.isFrozen(e)}var Ln="MapSet",qo="Patches",mc="ArrayMethods",Cc={};function Ot(e){let t=Cc[e];return t||Le(0,e),t}var hc=e=>!!Cc[e];var Nr,Ec=()=>Nr,s0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:hc(Ln)?Ot(Ln):void 0,arrayMethodsPlugin_:hc(mc)?Ot(mc):void 0});function yc(e,t){t&&(e.patchPlugin_=Ot(qo),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yo(e){Xo(e),e.drafts_.forEach(c0),e.drafts_=null}function Xo(e){e===Nr&&(Nr=e.parent_)}var gc=e=>Nr=s0(Nr,e);function c0(e){let t=e[re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[re].modified_&&(Yo(t),Le(4)),fe(e)&&(e=xc(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[re].base_,e,t)}else e=xc(t,n);return l0(t,e,!0),Yo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vc?e:void 0}function xc(e,t){if(kn(t))return t;let n=t[re];if(!n)return On(t,e.handledSet_,e);if(!In(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);Oc(n,e)}return n.copy_}function l0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&zn(t,n)}function Ac(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var In=(e,t)=>e.scope_===t,d0=[];function Lc(e,t,n,o){let a=$e(e),i=e.type_;if(o!==void 0&&Ko(a,o,i)===t){An(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;wn(a,(f,m)=>{if(Me(m)){let y=l.get(m)||[];y.push(f),l.set(m,y)}})}let s=e.draftLocations_.get(t)??d0;for(let l of s)An(a,l,n,i)}function f0(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!In(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=ta(i);Lc(e,i.draft_??i,s,n),Oc(i,a)})}function Oc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}Ac(e)}}function u0(e,t,n){let{scope_:o}=e;if(Me(n)){let a=n[re];In(a,o)&&a.callbacks_.push(function(){Sn(e);let s=ta(a);Lc(e,n,s,t)})}else fe(n)&&e.callbacks_.push(function(){let i=$e(e);e.type_===3?i.has(n)&&On(n,o.handledSet_,o):Ko(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&On(Ko(e.copy_,t,e.type_),o.handledSet_,o)})}function On(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Me(e)||t.has(e)||!fe(e)||kn(e)||(t.add(e),wn(e,(o,a)=>{if(Me(a)){let i=a[re];if(In(i,n)){let s=ta(i);An(e,o,s,e.type_),Ac(i)}}else fe(a)&&On(a,t,n)})),e}function p0(e,t){let n=Nn(e),o={type_:n?1:0,scope_:t?t.scope_:Ec(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Rn;n&&(a=[o],i=Mr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Rn={get(e,t){if(t===re)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=$e(e);if(!Ho(a,t,e.type_))return h0(e,a,t);let i=a[t];if(e.finalized_||!fe(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&a0(t))return i;if(i===Vo(e.base_,t)||m0(e,t,i)){Sn(e);let s=e.type_===1?+t:t,l=Jo(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in $e(e)},ownKeys(e){return Reflect.ownKeys($e(e))},set(e,t,n){let o=Rc($e(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Vo($e(e),t),i=a?.[re];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(o0(n,a)&&(n!==void 0||Ho(e.base_,t,e.type_)))return!0;Sn(e),Qo(e)}return e.copy_[t]===n&&(n!==void 0||Ho(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),u0(e,t,n)),!0},deleteProperty(e,t){return Sn(e),Vo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=$e(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[vn]:!0,[jo]:e.type_!==1||t!=="length",[En]:o[En],[wr]:n[t]}},defineProperty(){Le(11)},getPrototypeOf(e){return Xt(e.base_)},setPrototypeOf(){Le(12)}},Mr={};for(let e in Rn){let t=Rn[e];Mr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Mr.deleteProperty=function(e,t){return Mr.set.call(this,e,t,void 0)};Mr.set=function(e,t,n){return Rn.set.call(this,e[0],t,n,e[0])};function Vo(e,t){let n=e[re];return(n?$e(n):e)[t]}function m0(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!fe(n)||n[re]?!1:e.baseRefs_.has(n)}function h0(e,t,n){let o=Rc(t,n);return o?wr in o?o[wr]:o.get?.call(e.draft_):void 0}function Rc(e,t){if(!(t in e))return;let n=Xt(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Xt(n)}}function Qo(e){e.modified_||(e.modified_=!0,e.parent_&&Qo(e.parent_))}function Sn(e){e.copy_||(e.assigned_=new Map,e.copy_=Zo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var y0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Yt(t)&&!Yt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,y=>n.call(this,y,...m))}}Yt(n)||Le(6),o!==void 0&&!Yt(o)&&Le(7);let a;if(fe(t)){let i=gc(this),s=Jo(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?Yo(i):Xo(i)}return yc(i,o),bc(a,i)}else if(!t||!ea(t)){if(a=n(t),a===void 0&&(a=t),a===vc&&(a=void 0),this.autoFreeze_&&zn(a,!0),o){let i=[],s=[];Ot(qo).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else Le(1,t)},this.produceWithPatches=(t,n)=>{if(Yt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Wo(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Wo(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Wo(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){fe(e)||Le(8),Me(e)&&(e=_c(e));let t=gc(this),n=Jo(t,e,void 0);return n[re].isManual_=!0,Xo(t),n}finishDraft(e,t){let n=e&&e[re];(!n||!n.isManual_)&&Le(9);let{scope_:o}=n;return yc(o,t),bc(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=Ot(qo).applyPatches_;return Me(e)?o(e,t):this.produce(e,a=>o(a,t))}};function Jo(e,t,n,o){let[a,i]=Mn(t)?Ot(Ln).proxyMap_(t,n):kr(t)?Ot(Ln).proxySet_(t,n):p0(t,n);return(n?.scope_??Ec()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?f0(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function _c(e){return Me(e)||Le(10,e),wc(e)}function wc(e){if(!fe(e)||kn(e))return e;let t=e[re],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Zo(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=Zo(e,!0);let a=n;return kr(n)&&(n=new Set),wn(a,(i,s)=>{An(n,i,wc(s))},o),t&&(t.finalized_=!1),n}var g0=globalThis.Iterator,T7=typeof g0?.from=="function";var b0=new y0,ra=b0.produce;function Nc(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var Mc=Nc(),zc=Nc;var x0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_r:_r.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Tr(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(ze(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>o!=null&&o.type===e&&fc(o),n}var Tc=class Ir extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ir.prototype)}static get[Symbol.species](){return Ir}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ir(...t[0].concat(this)):new Ir(...t.concat(this))}};function kc(e){return fe(e)?ra(e,()=>{}):e}function Tn(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function v0(e){return typeof e=="boolean"}var S0=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new Tc;return n&&(v0(n)?s.push(Mc):s.push(zc(n.extraArgument))),s},C0="RTK_autoBatch";var Ic=e=>t=>{setTimeout(t,e)},E0=(e,t,n)=>o=>{let a=!1,i,s,l=()=>{a||(a=!0,t?.(i),clearTimeout(s),o())};i=e(l),s=setTimeout(l,n)},A0=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?E0(window.requestAnimationFrame,window.cancelAnimationFrame,100):Ic(10):e.type==="callback"?e.queueNotification:Ic(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(y=>y()))};return Object.assign({},o,{subscribe(y){let h=()=>a&&y(),b=o.subscribe(h);return l.add(y),()=>{b(),l.delete(y)}},dispatch(y){try{return a=!y?.meta?.[C0],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(y)}finally{a=!0}}})},L0=e=>function(n){let{autoBatch:o=!0}=n??{},a=new Tc(e);return o&&a.push(A0(typeof o=="object"?o:void 0)),a};function Pc(e){let t=S0(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(bn(n))f=Go(n);else throw new Error(ze(1));let m;typeof o=="function"?m=o(t):m=t();let y=_r;a&&(y=x0({trace:!1,...typeof a=="object"&&a}));let h=dc(...m),b=L0(h),x=typeof l=="function"?l(b):b(),O=y(...x);return $o(f,s,O)}function Dc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(ze(28));if(l in t)throw new Error(ze(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function O0(e){return typeof e=="function"}function R0(e,t){let[n,o,a]=Dc(t),i;if(O0(e))i=()=>kc(e());else{let f=kc(e);i=()=>f}function s(f,m,y){if(Me(f)){let h=m(f,y);return h===void 0?f:h}else{if(fe(f))return ra(f,h=>m(h,y));{let h=m(f,y);if(h===void 0){if(f===null)return f;throw new Error(ze(9))}return h}}}function l(f=i(),m){let y=n[m.type],h;for(let{matcher:b,reducer:x}of o)b(m)&&x&&(h??=[]).push(x);if(!y&&!h)return a?s(f,a,m):f;if(y&&(f=s(f,y,m)),h)for(let b of h)f=s(f,b,m);return f}return l.getInitialState=i,l}var _0=Symbol.for("rtk-slice-createasyncthunk");function w0(e,t){return`${e}/${t}`}function N0({creators:e}={}){let t=e?.asyncThunk?.[_0];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(ze(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(z0()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(w,k){let D=typeof w=="string"?w:w.type;if(!D)throw new Error(ze(12));if(D in f.sliceCaseReducersByType)throw new Error(ze(13));return f.sliceCaseReducersByType[D]=k,m},addMatcher(w,k){return f.sliceMatchers.push({matcher:w,reducer:k}),m},exposeAction(w,k){return f.actionCreators[w]=k,m},exposeCaseReducer(w,k){return f.sliceCaseReducersByName[w]=k,m}};l.forEach(w=>{let k=s[w],D={reducerName:w,type:w0(a,w),createNotation:typeof o.reducers=="function"};I0(k)?P0(D,k,m,t):k0(D,k,m)});function y(){let[w={},k=[],D=void 0]=typeof o.extraReducers=="function"?Dc(o.extraReducers):[o.extraReducers],G={...w,...f.sliceCaseReducersByType};return R0(o.initialState,ne=>{for(let K in G)ne.addCase(K,G[K]);for(let K of f.sliceMatchers)ne.addMatcher(K.matcher,K.reducer);for(let K of k)ne.addMatcher(K.matcher,K.reducer);D&&ne.addDefaultCase(D)})}let h=w=>w,b=new Map,x=new WeakMap,O;function R(w,k){return O||(O=y()),O(w,k)}function L(){return O||(O=y()),O.getInitialState()}function M(w,k=!1){function D(ne){let K=ne[w];return typeof K>"u"&&k&&(K=Tn(x,D,L)),K}function G(ne=h){return Tn(Tn(b,k,()=>new WeakMap),ne,()=>{let K={};for(let[Pt,me]of Object.entries(o.selectors??{}))K[Pt]=M0(me,ne,()=>Tn(x,ne,L),k);return K})}return{reducerPath:w,getSelectors:G,get selectors(){return G(D)},selectSlice:D}}let I={name:a,reducer:R,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:L,...M(i),injectInto(w,{reducerPath:k,...D}={}){let G=k??i;return w.inject({reducerPath:G,reducer:R},D),{...I,...M(G,!0)}}};return I}}function M0(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var Uc=N0();function z0(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function k0({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!T0(o))throw new Error(ze(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Tr(e,s):Tr(e))}function I0(e){return e._reducerDefinitionType==="asyncThunk"}function T0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function P0({type:e,reducerName:t},n,o,a){if(!a)throw new Error(ze(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:y}=n,h=a(e,i,y);o.exposeAction(t,h),s&&o.addCase(h.fulfilled,s),l&&o.addCase(h.pending,l),f&&o.addCase(h.rejected,f),m&&o.addMatcher(h.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Pn,pending:l||Pn,rejected:f||Pn,settled:m||Pn})}function Pn(){}var Fc="listener",Bc="completed",$c="cancelled",H7=`task-${$c}`,W7=`task-${Bc}`,V7=`${Fc}-${$c}`,j7=`${Fc}-${Bc}`;var{assign:Gc}=Object;var na="listenerMiddleware";var D0=Gc(Tr(`${na}/add`),{withTypes:()=>D0}),K7=Tr(`${na}/removeAll`),U0=Gc(Tr(`${na}/remove`),{withTypes:()=>U0});function ze(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var F0=fn(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),Dn=class extends F0(Object){};window.ftReduxStores||(window.ftReduxStores={});var Hc=class e extends Dn{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(yn(i))return i;if(a==null)return;let s=Uc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=Pc({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let y=Lr(s.getInitialState());for(let h of m.keeping)y[h]=(f??y)[h];return y}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus,a.deprecatedKeys)}constructor(t,n,o,a){super(),this.reduxSlice=t,this.reduxStore=n,this.deprecatedKeys=a,this.isFtReduxStore=!0,this.commands=new un,this.injectInto=(s,l)=>this.reduxSlice.injectInto(s,l),this.selectSlice=s=>this.reduxSlice.selectSlice(s);let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,f)=>{let m=l,y=s[m];return y?(...h)=>{let b=y(...h.map(i));return this.reduxStore.dispatch(b),b}:h=>{let b=m,x=this.getState()[b];Kt(x,h)||this.setState({[b]:i(h)})}}}),this.eventBus=o??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Un=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var Fn=E(P()),B0="ft-app-info",Rt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Rt.eventName="authentication-change";var Pr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Pr.eventName="ui-locale-changed";var $0={session:(e,t)=>{(0,Fn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>T.dispatchEvent(new Rt(t.payload)),0))}},T=Fn.FtReduxStore.get({name:B0,reducers:$0,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Wc=E(P()),Bn=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Sh=(0,Wc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(T)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>Un.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Bn([(0,oa.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Bn([(0,oa.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Bn([Fo({store:T.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),Bn([Fo({store:T.name})],t.prototype,"uiLocale",void 0),t});var Vc;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Vc||(Vc={}));var jc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(jc||(jc={}));var Kc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(Kc||(Kc={}));var Zc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(Zc||(Zc={}));var qc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(qc||(qc={}));var Yc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Yc||(Yc={}));var Xc;(function(e){e.PUBLISHED="PUBLISHED",e.AI="AI"})(Xc||(Xc={}));var Qc;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(Qc||(Qc={}));var Jc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Jc||(Jc={}));var el;(function(e){e.METADATA_FILTER="METADATA_FILTER",e.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(el||(el={}));var tl;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER",e.DOC_DIFF="DOC_DIFF"})(tl||(tl={}));var rl;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(rl||(rl={}));var nl;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(nl||(nl={}));var ol;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(ol||(ol={}));var al;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(al||(al={}));var il;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(il||(il={}));var sl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(sl||(sl={}));var cl;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(cl||(cl={}));var ll;(function(e){e.ASC="ASC",e.DESC="DESC"})(ll||(ll={}));var dl;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(dl||(dl={}));var fl;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(fl||(fl={}));var ul;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ul||(ul={}));var pl;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(pl||(pl={}));var ml;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ml||(ml={}));var hl;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(hl||(hl={}));var yl;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(yl||(yl={}));var gl;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(gl||(gl={}));var bl;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(bl||(bl={}));var Y;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(Y||(Y={}));var ye;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(ye||(ye={}));var xl;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(xl||(xl={}));var vl;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(vl||(vl={}));var Sl;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Sl||(Sl={}));var Cl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Cl||(Cl={}));var El;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(El||(El={}));var Al;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Al||(Al={}));var Ll;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ll||(Ll={}));var Ol;(function(e){e.CHAT="CHAT",e.COMPLETION="COMPLETION",e.RAG="RAG",e.AGENT="AGENT"})(Ol||(Ol={}));var Rl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Rl||(Rl={}));var _l;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(_l||(_l={}));var wl;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(wl||(wl={}));var Nl;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Nl||(Nl={}));var Ml;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Ml||(Ml={}));var G0={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN,Y.BEHAVIOR_DATA_USER],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function zl(e,t){return e===t||(G0[e]??[]).some(n=>zl(n,t))}function aa(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(o=>zl(o,t))}function kl(e,...t){return e==null?!1:t.some(n=>aa(e,n))}var Vn=E(P());var ia=E(P());var _t=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=T.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=T.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var Qt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:_t.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):_t.await()}};var ue=class extends Qt{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ia.CacheRegistry,this.cache=t?a.commonCache:new ia.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var $n=class extends ue{async listMySearches(){let{session:t}=T.getState();return aa(t,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Gn=class extends ue{async listMyBookmarks(){let t=T.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Hn=class extends ue{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var Wn=class extends ue{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let t=T.getState().session;return!!t?.sessionAuthenticated}};var H0="ft-user-assets",W0={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(ye).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ca(e,n,[...sa(e,n),a]),Il(e,n,1,o),Tl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ca(e,n,sa(e,n).map(a=>a.id===o.id?o:a)),Tl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ca(e,n,sa(e,n).filter(i=>i.id!==a)),Il(e,n,-1,o)}},Pl={[ye.SEARCHES]:"savedSearches",[ye.BOOKMARKS]:"bookmarks",[ye.BOOKS]:void 0,[ye.COLLECTIONS]:void 0},sa=(e,t)=>{var n;let o=Pl[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ca=(e,t,n)=>{let o=Pl[t];o&&(e[o]=n)},Il=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===ye.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},Tl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},ae=Vn.FtReduxStore.get({name:H0,reducers:W0,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ye).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),la=class{constructor(t=new Hn,n=new Wn){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Gn,this.savedSearchesService=new $n,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=T.getState();(0,Vn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ae.actions.clearAssetCount(),ae.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ae.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ae.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();ae.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();ae.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&ae.getState().assetCounts.allAsset[t]!==n.count&&ae.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&ae.getState().assetCounts.bookmarkByMap[t]!==n.count&&ae.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(ae.getState().assetCounts.bookmarkByMap).length!==0;t===ye.BOOKMARKS&&n&&ae.actions.clearBookmarkCountByMap(),ae.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ae.actions.bookmarks(n)}}},V0=new la;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=V0);var da=class{addCommand(t,n=!1){T.commands.add(t,n)}consumeCommand(t){return T.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new da;var ge=E(P());var Dl,Jt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},j0=Symbol("clearAfterUnitTest"),jn=class extends(0,ge.withEventBus)(ue){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Dl]=()=>{this.defaultMessages={},this.cache=new ge.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=T.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,ge.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new ge.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof ge.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Jt({loadedContexts:t})),this.dispatchEvent(new Jt({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new Jt({loadedContexts:[t]})),this.dispatchEvent(new Jt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ge.delay)(0).then(()=>o()).catch(()=>null)))}};Dl=j0;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends jn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends jn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Dr=window.FluidTopicsI18nService,fa=window.FluidTopicsCustomI18nService;var Ul=E(P()),ua=class{highlightHtml(t,n,o){(0,Ul.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ua;var Fl=E(P());var pa=class{isDate(t){var n,o,a,i;return(i=(o=((a=(n=T.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]).find(l=>l.key===t))===null||o===void 0?void 0:o.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return Fl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:T.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new pa;var Bl=E(P());var Ur=class{static get(t,n,{baseUrl:o,localesConfiguration:a,availableContentLocales:i}=T.getState()){var s;if(n==="all"&&a?.allLanguagesAllowed)n=void 0;else if(!n||i.length>0&&!i.some(l=>l.lang===n)){let l=a?.defaultLocales.defaultContentLocale;n=l?`${l.lang}-${l.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new Bl.SearchPlaceConverter(o,t??20,a?.allLanguagesAllowed,n,i)}};var ma=class{urlToSearchRequest(t){return Ur.get().parse(t)}searchRequestToUrl(t){return Ur.get().serialize(t)}};window.FluidTopicsUrlService=new ma;var Ge=E(P());var wt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};wt.eventName="before-location-change";var Nt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};Nt.eventName="change";var ha=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},$l=new ha;var Kn=class e extends Ge.WithEventBus{static build(){return new e(window.history,$l,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Ge.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Nt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),m=new wt(f);this.dispatchEvent(m);let y=n(),h={...y===this.currentIndex?this.currentState:void 0,...i,index:y,href:m.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(t){for(let n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addBeforeLocationChangeListener(t){this.addEventListener(wt.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(wt.eventName,t)}addHistoryChangeListener(t){this.addEventListener(Nt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(Nt.eventName,t)}currentItem(){return(0,Ge.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Ge.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ge.deepCopy)(n.find(o=>t(o)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,Ge.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Kn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var Gl=E(V());var Hl=Gl.css`
|
|
837
837
|
`;var jl=E(V()),ie=E(oe()),zt=E(P());var ke=E(P());function Wl(e,t){let{authenticationRequired:n,session:o}=T.getState();return n&&!o?.sessionAuthenticated?Promise.resolve(t):e()}var Zn=class extends Qt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var ya=class e extends ke.FtStateManager{static build(t){return new e(T,t)}constructor(t,n){super(),this.store=t,this.cache=new ke.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Zn,this.knownContexts=new ke.AbstractRegistry,this.knownCustomComponents=new ke.AbstractRegistry,this.cleanSessionDebouncer=new ke.Debouncer,this.reloadConfiguration=()=>{var o;(o=this.cache)===null||o===void 0||o.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new ke.Debouncer(500),this.apiProvider=n??(()=>_t.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}addListeners(){this.store.addEventListener(Rt.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(Rt.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let t=await this.cache.get("session",async()=>{let n=await this.apiProvider().getCurrentSession();return n.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},n.idleTimeoutInMillis),n});this.setSession(t)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var t;let n=await this.cache.get("availableContentLocales",()=>Wl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=n.contentLocales)!==null&&t!==void 0?t:[])}setStickyFilters(t){this.store.actions.stickyFilters(t)}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setTenantId(t){this.store.actions.tenantId(t)}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t,n){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:n}).then(o=>{o.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Pr(o)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setNoCustomCode(t){this.store.actions.noCustomCode(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}userHasAnyRole(...t){return kl(T.getState().session,...t)}},Vl=ya.build();var Mt=class extends Event{constructor(t,n,o,a){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n,this.callback=o,this.subscribe=a??!1}};var Fr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let n=this.pendingContextRequests.get(t.context);if(n===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:o}=n;for(let{elementRef:a,callbackRef:i}of o){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new Mt(t.context,s,l,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let n=t.contextTarget??t.composedPath()[0],o=t.callback,a=this.pendingContextRequests.get(t.context);a===void 0&&this.pendingContextRequests.set(t.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(n);i===void 0&&a.callbacks.set(n,i=new WeakSet),i.has(o)||(i.add(o),a.requests.push({elementRef:new WeakRef(n),callbackRef:new WeakRef(o)}))}}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var Q=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},$=class extends zt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Vl,this.contextRoot=new Fr}render(){return jl.html`
|
|
838
838
|
<slot></slot>
|
|
839
839
|
`}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(t){var n;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(o=>Dr.addContext(o)),t.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),t.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),t.has("withManualResources")&&((n=this.stateManager)===null||n===void 0||n.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};$.elementDefinitions={};$.styles=Hl;Q([(0,ie.property)()],$.prototype,"baseUrl",void 0);Q([(0,ie.property)()],$.prototype,"tenantId",void 0);Q([(0,ie.property)()],$.prototype,"apiIntegrationIdentifier",void 0);Q([(0,ie.property)()],$.prototype,"apiIntegrationAppVersion",void 0);Q([(0,ie.property)()],$.prototype,"uiLocale",void 0);Q([(0,zt.jsonProperty)(null)],$.prototype,"availableUiLocales",void 0);Q([(0,zt.jsonProperty)(null)],$.prototype,"metadataConfiguration",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"editorMode",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"noCustom",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"openExternalDocumentInNewTab",void 0);Q([(0,ie.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],$.prototype,"noCustomComponent",void 0);Q([(0,ie.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],$.prototype,"noCustomCode",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"withManualResources",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"navigatorOnline",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"forcedOffline",void 0);Q([(0,ie.property)({type:Boolean})],$.prototype,"authenticationRequired",void 0);Q([(0,zt.jsonProperty)([])],$.prototype,"messageContexts",void 0);Q([(0,zt.jsonProperty)(void 0)],$.prototype,"session",void 0);var Zl=E(P());var Kl={"ft-app-context":$};(0,Zl.customElements)(Kl);var ql=E(oe());var ga=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,o]=t.split(".");return{context:n,key:o,custom:n!=="officialContext",message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},er=new ga;var q0=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},$r=Symbol("i18nAttributes"),Yl=Symbol("i18nListAttributes"),Xl=Symbol("i18nProperties"),qn=Symbol("i18nContexts"),Br=Symbol("i18nUnsubs"),Ql=(0,tr.applyMixinOnce)(Symbol("withI18n"),function(e){var t,n;class o extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[n]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?fa:Dr}i18n(i){let{context:s,key:l,message:f}=i,{custom:m,args:y,argsProvider:h}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,m);let b=y??(h?h(this):[]);return this.getI18nService(m).resolveMessage(s,l,...b)}return f}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(er.isI18nKey(i)){let[l,f]=i.split(".");return this.i18n({custom:!0,context:l,key:f,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,f)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,f)=>{var m;return((m=f?.context)===null||m===void 0?void 0:m.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let f=this,m=(y,h,b)=>b?.context&&b.key&&i(y,h,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...y})}:b;(s=this[$r])===null||s===void 0||s.forEach((y,h)=>f[h]=m(y,h,f[h])),(l=this[Yl])===null||l===void 0||l.forEach((y,h)=>{var b;return f[h]=(b=f[h])===null||b===void 0?void 0:b.map(x=>m(y,h,x))})}updateI18nProperties(i){var s;(s=this[Xl])===null||s===void 0||s.forEach((l,f)=>{i(l,f)&&(this[f]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let f=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[qn].set(f,{isCustomContext:l}),this[Br].has(f)||this[Br].set(f,this.getI18nService(l).subscribe(f,()=>this.onI18nUpdate(f))),this.getI18nService(l).prepareContext(f,s)}hasI18nContext(i){return this[qn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[qn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Br].forEach(i=>i()),this[Br].clear()}}return t=qn,n=Br,q0([(0,ql.property)({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}),Yn=class extends Ql(tr.FtLitElement){},Xn=class extends Ql(tr.FtLitElementRedux){};var Jl=E(P());var ba=class{fromAttribute(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.map(o=>typeof o=="string"?er.fromAttribute(o):o):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},Y0=new ba;var e2=(e,t)=>(n,o)=>{var a;n.constructor.createProperty(o,{type:Object,hasChanged:Jl.hasChanged,converter:er,...t}),n[$r]=(a=n[$r])!==null&&a!==void 0?a:new Map,n[$r].set(o,e??{})};var t2=E(V());var r2=t2.css`
|
|
@@ -913,7 +913,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
913
913
|
position: relative;
|
|
914
914
|
word-break: break-word;
|
|
915
915
|
}
|
|
916
|
-
`;var dp="ft-app-info",rr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};rr.eventName="authentication-change";var Ln=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ln.eventName="ui-locale-changed";var up={session:(t,e)=>{he(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>U.dispatchEvent(new rr(e.payload)),0))}},U=Bt.get({name:dp,reducers:up,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Io=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},ES=le(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(U)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(c=>c.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?c=>Ht.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Io([C({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Io([C({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Io([Or({store:U.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),Io([Or({store:U.name})],e.prototype,"uiLocale",void 0),e});var nr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=U.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=U.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Pr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:nr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):nr.await()}};var Ae=class extends Pr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new He,this.cache=e?a.commonCache:new He}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 To=class extends Ae{async listMySearches(){let{session:e}=U.getState();return Ua(e,re.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var ko=class extends Ae{async listMyBookmarks(){let e=U.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var zo=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=U.getState().session;return!!e?.sessionAuthenticated}};var Po=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/api/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=U.getState().session;return!!e?.sessionAuthenticated}};var fp="ft-user-assets",pp={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Re).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:a}=e.payload;zs(t,r,[...ks(t,r),a]),j2(t,r,1,n),K2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;zs(t,r,ks(t,r).map(a=>a.id===n.id?n:a)),K2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;zs(t,r,ks(t,r).filter(i=>i.id!==a)),j2(t,r,-1,n)}},q2={[Re.SEARCHES]:"savedSearches",[Re.BOOKMARKS]:"bookmarks",[Re.BOOKS]:void 0,[Re.COLLECTIONS]:void 0},ks=(t,e)=>{var r;let n=q2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},zs=(t,e,r)=>{let n=q2[e];n&&(t[n]=r)},j2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===Re.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},K2=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},me=Bt.get({name:fp,reducers:pp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Re).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ps=class{constructor(e=new zo,r=new Po){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=U.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ko,this.savedSearchesService=new To,U.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=U.getState();he((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(),me.actions.clearAssetCount(),me.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),me.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),me.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();me.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();me.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&me.getState().assetCounts.allAsset[e]!==r.count&&me.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&me.getState().assetCounts.bookmarkByMap[e]!==r.count&&me.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(me.getState().assetCounts.bookmarkByMap).length!==0;e===Re.BOOKMARKS&&r&&me.actions.clearBookmarkCountByMap(),me.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;me.actions.bookmarks(r)}}},hp=new Ps;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=hp);var Ds=class{addCommand(e,r=!1){U.commands.add(e,r)}consumeCommand(e){return U.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ds;var Z2,Dr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},mp=Symbol("clearAfterUnitTest"),Do=class extends Qn(Ae){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Z2]=()=>{this.defaultMessages={},this.cache=new He,this.listeners={}},this.currentUiLocale=U.getState().uiLocale,U.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=U.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 a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};he(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,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 a;let i=e.toLowerCase(),s=this.resolveContext(i);return new dn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},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(a){!(a instanceof Rt)&&r&&console.error(a)}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 a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Dr({loadedContexts:e})),this.dispatchEvent(new Dr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Dr({loadedContexts:[e]})),this.dispatchEvent(new Dr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Xn(0).then(()=>n()).catch(()=>null)))}};Z2=mp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Do{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Do{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var On=window.FluidTopicsI18nService,Fs=window.FluidTopicsCustomI18nService;var Us=class{highlightHtml(e,r,n){zi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Us;var $s=class{isDate(e){var r,n,a,i;return(i=(n=((a=(r=U.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&a!==void 0?a:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return Ht.format(e,(n=r?.locale)!==null&&n!==void 0?n:U.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!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 $s;var wn=class{static get(e,r,{baseUrl:n,localesConfiguration:a,availableContentLocales:i}=U.getState()){var s;if(r==="all"&&a?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(c=>c.lang===r)){let c=a?.defaultLocales.defaultContentLocale;r=c?`${c.lang}-${c.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new Je(n,e??20,a?.allLanguagesAllowed,r,i)}};var Bs=class{urlToSearchRequest(e){return wn.get().parse(e)}searchRequestToUrl(e){return wn.get().serialize(e)}};window.FluidTopicsUrlService=new Bs;var or=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};or.eventName="before-location-change";var ar=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ar.eventName="change";var Hs=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))}},Y2=new Hs;var Fo=class t extends Xe{static build(){return new t(window.history,Y2,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}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),he(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new ar(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=new URL(typeof c=="string"?c:(c??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),f=new or(d);this.dispatchEvent(f);let g=r(),m={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:f.detail.nextLocation.href};n.apply(a,[m,s,m.href]),this.setCurrentState(m,!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)}addBeforeLocationChangeListener(e){this.addEventListener(or.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(or.eventName,e)}addHistoryChangeListener(e){this.addEventListener(ar.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ar.eventName,e)}currentItem(){return Ie(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Ie(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Ie(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 Ie(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}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 a=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var X2=P`
|
|
916
|
+
`;var dp="ft-app-info",rr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};rr.eventName="authentication-change";var Ln=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ln.eventName="ui-locale-changed";var up={session:(t,e)=>{he(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>U.dispatchEvent(new rr(e.payload)),0))}},U=Bt.get({name:dp,reducers:up,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Io=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},ES=le(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(U)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,i;return((i=(a=this.metadataDescriptors.find(c=>c.key===n))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?c=>Ht.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Io([C({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Io([C({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Io([Or({store:U.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),Io([Or({store:U.name})],e.prototype,"uiLocale",void 0),e});var nr=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=U.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let a=U.subscribe(()=>{n=t.get(e),n&&(a(),r(n))})}})}};var Pr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:nr.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):nr.await()}};var Ae=class extends Pr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new He,this.cache=e?a.commonCache:new He}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 To=class extends Ae{async listMySearches(){let{session:e}=U.getState();return Ua(e,re.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var ko=class extends Ae{async listMyBookmarks(){let e=U.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var zo=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/api/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=U.getState().session;return!!e?.sessionAuthenticated}};var Po=class extends Ae{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await(await this.awaitApi).get("/api/user/assets/labels")).labels,this.CACHE_DURATION):[]}isAuthenticated(){let e=U.getState().session;return!!e?.sessionAuthenticated}};var fp="ft-user-assets",pp={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Re).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:a}=e.payload;zs(t,r,[...ks(t,r),a]),j2(t,r,1,n),K2(t,a)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;zs(t,r,ks(t,r).map(a=>a.id===n.id?n:a)),K2(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;zs(t,r,ks(t,r).filter(i=>i.id!==a)),j2(t,r,-1,n)}},q2={[Re.SEARCHES]:"savedSearches",[Re.BOOKMARKS]:"bookmarks",[Re.BOOKS]:void 0,[Re.COLLECTIONS]:void 0},ks=(t,e)=>{var r;let n=q2[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},zs=(t,e,r)=>{let n=q2[e];n&&(t[n]=r)},j2=(t,e,r,n)=>{let a=t.assetCounts.allAsset[e];if(a!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,a+r),e===Re.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},K2=(t,e)=>{let r=t.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));t.assetLabels.push(...n)},me=Bt.get({name:fp,reducers:pp,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Re).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ps=class{constructor(e=new zo,r=new Po){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=U.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ko,this.savedSearchesService=new To,U.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=U.getState();he((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(),me.actions.clearAssetCount(),me.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),me.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),me.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();me.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();me.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&me.getState().assetCounts.allAsset[e]!==r.count&&me.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&me.getState().assetCounts.bookmarkByMap[e]!==r.count&&me.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(me.getState().assetCounts.bookmarkByMap).length!==0;e===Re.BOOKMARKS&&r&&me.actions.clearBookmarkCountByMap(),me.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;me.actions.bookmarks(r)}}},hp=new Ps;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=hp);var Ds=class{addCommand(e,r=!1){U.commands.add(e,r)}consumeCommand(e){return U.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ds;var Z2,Dr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},mp=Symbol("clearAfterUnitTest"),Do=class extends Qn(Ae){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Z2]=()=>{this.defaultMessages={},this.cache=new He,this.listeners={}},this.currentUiLocale=U.getState().uiLocale,U.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=U.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 a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};he(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,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 a;let i=e.toLowerCase(),s=this.resolveContext(i);return new dn((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},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(a){!(a instanceof Rt)&&r&&console.error(a)}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 a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Dr({loadedContexts:e})),this.dispatchEvent(new Dr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Dr({loadedContexts:[e]})),this.dispatchEvent(new Dr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Xn(0).then(()=>n()).catch(()=>null)))}};Z2=mp;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Do{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Do{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var On=window.FluidTopicsI18nService,Fs=window.FluidTopicsCustomI18nService;var Us=class{highlightHtml(e,r,n){zi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Us;var $s=class{isDate(e){var r,n,a,i;return(i=(n=((a=(r=U.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&a!==void 0?a:[]).find(c=>c.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,a,i,s;if(e==null)return"";try{return Ht.format(e,(n=r?.locale)!==null&&n!==void 0?n:U.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(i=r?.withTime)!==null&&i!==void 0?i:!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 $s;var wn=class{static get(e,r,{baseUrl:n,localesConfiguration:a,availableContentLocales:i}=U.getState()){var s;if(r==="all"&&a?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(c=>c.lang===r)){let c=a?.defaultLocales.defaultContentLocale;r=c?`${c.lang}-${c.region}`:(s=i[0])===null||s===void 0?void 0:s.lang}return new Je(n,e??20,a?.allLanguagesAllowed,r,i)}};var Bs=class{urlToSearchRequest(e){return wn.get().parse(e)}searchRequestToUrl(e){return wn.get().serialize(e)}};window.FluidTopicsUrlService=new Bs;var or=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};or.eventName="before-location-change";var ar=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ar.eventName="change";var Hs=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))}},Y2=new Hs;var Fo=class t extends Xe{static build(){return new t(window.history,Y2,()=>window.location,!1)}constructor(e,r,n,a){var i,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}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),he(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new ar(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[i,s,c])=>{let d=new URL(typeof c=="string"?c:(c??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),f=new or(d);this.dispatchEvent(f);let g=r(),m={...g===this.currentIndex?this.currentState:void 0,...i,index:g,href:f.detail.nextLocation.href};n.apply(a,[m,s,m.href]),this.setCurrentState(m,!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)}addBeforeLocationChangeListener(e){this.addEventListener(or.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(or.eventName,e)}addHistoryChangeListener(e){this.addEventListener(ar.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ar.eventName,e)}currentItem(){return Ie(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Ie(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Ie(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 Ie(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}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 a=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Fo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var X2=P`
|
|
917
917
|
`;function J2(t,e){let{authenticationRequired:r,session:n}=U.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Uo=class extends Pr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Gs=class t extends Sn{static build(e){return new t(U,e)}constructor(e,r){super(),this.store=e,this.cache=new He,this.withManualResources=!0,this.userLocaleService=new Uo,this.knownContexts=new mr,this.knownCustomComponents=new mr,this.cleanSessionDebouncer=new ge,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new ge(500),this.apiProvider=r??(()=>nr.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(rr.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(rr.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",()=>J2(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ln(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Gl(U.getState().session,...e)}},Q2=Gs.build();var ir=class extends Event{constructor(e,r,n,a){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=a??!1}};var Rn=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:a,callbackRef:i}of n){let s=a.deref(),c=i.deref();s===void 0||c===void 0||s.dispatchEvent(new ir(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,a=this.pendingContextRequests.get(e.context);a===void 0&&this.pendingContextRequests.set(e.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(r);i===void 0&&a.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),a.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 ce=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},X=class extends Ut{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Q2,this.contextRoot=new Rn}render(){return W`
|
|
918
918
|
<slot></slot>
|
|
919
919
|
`}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var 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("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>On.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())}};X.elementDefinitions={};X.styles=X2;ce([C()],X.prototype,"baseUrl",void 0);ce([C()],X.prototype,"tenantId",void 0);ce([C()],X.prototype,"apiIntegrationIdentifier",void 0);ce([C()],X.prototype,"apiIntegrationAppVersion",void 0);ce([C()],X.prototype,"uiLocale",void 0);ce([Se(null)],X.prototype,"availableUiLocales",void 0);ce([Se(null)],X.prototype,"metadataConfiguration",void 0);ce([C({type:Boolean})],X.prototype,"editorMode",void 0);ce([C({type:Boolean})],X.prototype,"noCustom",void 0);ce([C({type:Boolean})],X.prototype,"openExternalDocumentInNewTab",void 0);ce([C({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],X.prototype,"noCustomComponent",void 0);ce([C({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],X.prototype,"noCustomCode",void 0);ce([C({type:Boolean})],X.prototype,"withManualResources",void 0);ce([C({type:Boolean})],X.prototype,"navigatorOnline",void 0);ce([C({type:Boolean})],X.prototype,"forcedOffline",void 0);ce([C({type:Boolean})],X.prototype,"authenticationRequired",void 0);ce([Se([])],X.prototype,"messageContexts",void 0);ce([Se(void 0)],X.prototype,"session",void 0);var e0={"ft-app-context":X};ee(e0);var Vs=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-]+$/)}},Fr=new Vs;var bp=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Nn=Symbol("i18nAttributes"),t0=Symbol("i18nListAttributes"),r0=Symbol("i18nProperties"),$o=Symbol("i18nContexts"),_n=Symbol("i18nUnsubs"),n0=le(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(i){return i??this.useCustomMessageContexts?Fs:On}i18n(i){let{context:s,key:c,message:d}=i,{custom:f,args:g,argsProvider:m}=i;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,f);let y=g??(m?m(this):[]);return this.getI18nService(f).resolveMessage(s,c,...y)}return d}async awaitI18n(i){let{context:s,custom:c}=i;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Fr.isI18nKey(i)){let[c,d]=i.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,d)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,d)=>{var f;return((f=d?.context)===null||f===void 0?void 0:f.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let d=this,f=(g,m,y)=>y?.context&&y.key&&i(g,m,y)?{...y,message:this.i18n({context:y.context,key:y.key,custom:y.custom,...g})}:y;(s=this[Nn])===null||s===void 0||s.forEach((g,m)=>d[m]=f(g,m,d[m])),(c=this[t0])===null||c===void 0||c.forEach((g,m)=>{var y;return d[m]=(y=d[m])===null||y===void 0?void 0:y.map(x=>f(g,m,x))})}updateI18nProperties(i){var s;(s=this[r0])===null||s===void 0||s.forEach((c,d)=>{i(c,d)&&(this[d]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let d=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[$o].set(d,{isCustomContext:c}),this[_n].has(d)||this[_n].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(i){return this[$o].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[$o].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[_n].forEach(i=>i()),this[_n].clear()}}return e=$o,r=_n,bp([C({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Bo=class extends n0(j){},Ho=class extends n0(Ut){};var Ws=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?Fr.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},xp=new Ws;var o0=(t,e)=>(r,n)=>{var a;r.constructor.createProperty(n,{type:Object,hasChanged:Be,converter:Fr,...e}),r[Nn]=(a=r[Nn])!==null&&a!==void 0?a:new Map,r[Nn].set(n,t??{})};var a0=P`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ftds-file-button",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.50",
|
|
4
4
|
"description": "The design system file button component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,13 +19,13 @@
|
|
|
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.2.
|
|
23
|
-
"@fluid-topics/ftds-button": "2.2.
|
|
24
|
-
"@fluid-topics/ftds-icon": "2.2.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "2.2.50",
|
|
23
|
+
"@fluid-topics/ftds-button": "2.2.50",
|
|
24
|
+
"@fluid-topics/ftds-icon": "2.2.50",
|
|
25
25
|
"lit": "3.3.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@fluid-topics/ft-wc-test-utils": "2.2.
|
|
28
|
+
"@fluid-topics/ft-wc-test-utils": "2.2.50"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "827b5f0b91f05b76d24e8c231411908394c47b4e"
|
|
31
31
|
}
|