@fluid-topics/ft-tooltip 2.2.27 → 2.2.28

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.
@@ -81,7 +81,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
81
81
  <li>${this.helperText}</li>
82
82
  `)}
83
83
  </ul>
84
- `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?ze.error:this.warningMessages.length?ze.warning:ze.default}}return H([w()],e.prototype,"warningRules",void 0),H([w()],e.prototype,"errorRules",void 0),H([w()],e.prototype,"validateOn",void 0),H([w({type:Boolean})],e.prototype,"validateAtRender",void 0),H([w()],e.prototype,"label",void 0),H([w({type:Boolean})],e.prototype,"hideLabel",void 0),H([w()],e.prototype,"name",void 0),H([w({type:Boolean})],e.prototype,"disabled",void 0),H([w()],e.prototype,"helperText",void 0),H([w()],e.prototype,"forceStatus",void 0),H([w({reflect:!0})],e.prototype,"value",void 0),H([W()],e.prototype,"errorMessages",void 0),H([W()],e.prototype,"warningMessages",void 0),H([W()],e.prototype,"status",void 0),H([W()],e.prototype,"focused",void 0),H([W()],e.prototype,"additionalWarningRules",void 0),H([W()],e.prototype,"additionalErrorRules",void 0),H([W()],e.prototype,"forceErrorMessages",void 0),e});var Rr=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),Rr(n,e);return!0},Ro=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},gl=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),gf(e)}};function mf(t){this._$AN!==void 0?(Ro(this),this._$AM=t,gl(this)):this._$AM=t}function yf(t,e=!1,o=0){let n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let a=o;a<n.length;a++)Rr(n[a],!1),Ro(n[a]);else n!=null&&(Rr(n,!1),Ro(n));else Rr(this,t)}var gf=t=>{t.type==ge.CHILD&&(t._$AP??=yf,t._$AQ??=mf)},Vt=class extends ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),gl(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(Rr(this,e),Ro(this))}setValue(e){if(Ra(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Hi=class extends Vt{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return z}update(e){return this.part=e,this.ensureFocusTrap(e.element),z}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var o,n;this.isElementTrappable(e)&&(((o=this.firstTrap)===null||o===void 0?void 0:o.parentElement)===e&&((n=this.lastTrap)===null||n===void 0?void 0:n.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,o,n,i;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(o=this.lastTrap)===null||o===void 0||o.removeEventListener("focus",this.onLastTrapFocus),(n=this.firstTrap)===null||n===void 0||n.remove(),(i=this.lastTrap)===null||i===void 0||i.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=0;n<o.length;n++){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusFirstDescendant(i)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=o.length-1;n>=0;n--){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusLastDescendant(i)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof ie&&await e.updateComplete}isInsideElement(e,o){for(let n=e;n;n=n.parentNode){if(n===o)return!0;n instanceof ShadowRoot?n=n.host:n.assignedSlot&&(n=n.assignedSlot)}return!1}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},bv=ee(Hi);var bl;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(bl||(bl={}));var bf={sm:640,md:768,lg:1024,xl:1280},Vi=class extends Vt{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,i]){return this.lastArgs=[o,n,i],this.render(o,n,i)}render(e,o,n){let i=this.resolveThreshold(e),a=n??(()=>M);return this.size>i?o():a()}resolveThreshold(e){return typeof e=="number"?e:bf[e]}},Ev=ee(Vi);var Wi,Gi,ji,Ki,xf=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((ji=(Gi=(Wi=window.safari)===null||Wi===void 0?void 0:Wi.pushNotification)===null||Gi===void 0?void 0:Gi.toString())!==null&&ji!==void 0?ji:"")==="[object SafariRemoteNotification]",vf="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ki=window.ftGlobals)!==null&&Ki!==void 0?Ki:{lit:Xo,litDecorators:en,litRepeat:tn,litClassMap:rn,litStyleMap:on,litUnsafeHTML:nn,wcUtils:{...an,...yn,...cn,...An,...Ii,...Rn,...ln,...Ln,...mn,...Gn,...Ni,...fl,...Ai,...jn,...Tn,...Xn,..._i,...Yn,...Pi,...Fi,...Ac,...pn,...ti,...Bi,...kn,...ri,...hl,..._c,...oi,...Ci,...Li,...Kn,...qn,...vn,...Cn,...Di,isSafari:xf,isTouchScreen:vf,setVariable:Tt}};var vl=Symbol.for(""),Sf=t=>{if(t?.r===vl)return t?._$litStatic$},Zi=t=>({_$litStatic$:t,r:vl});var xl=new Map,qi=t=>(e,...o)=>{let n=o.length,i,a,s=[],l=[],d,p=0,h=!1;for(;p<n;){for(d=e[p];p<n&&(a=o[p],(i=Sf(a))!==void 0);)d+=i+e[++p],h=!0;p!==n&&l.push(a),s.push(d),p++}if(p===n&&s.push(e[n]),h){let f=s.join("$$lit$$");(e=xl.get(f))===void 0&&(s.raw=s,xl.set(f,e=s)),o=l}return t(e,...o)},Yi=qi(X),ES=qi(Ko),CS=qi(Zo);var Wt;(function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"})(Wt||(Wt={}));var Sl=r.extend("--ft-typography-font-family","",Te.titleFont),Pe=r.extend("--ft-typography-font-family","",Te.contentFont),O={fontFamily:Pe,fontSize:r.create("--ft-typography-font-size","","SIZE","16px"),fontWeight:r.create("--ft-typography-font-weight","","UNKNOWN","normal"),letterSpacing:r.create("--ft-typography-letter-spacing","","SIZE","0.496px"),lineHeight:r.create("--ft-typography-line-height","","NUMBER","1.5"),textTransform:r.create("--ft-typography-text-transform","","UNKNOWN","inherit"),textDecoration:r.create("--ft-typography-text-decoration","","UNKNOWN","inherit")},ct={fontFamily:r.extend("--ft-typography-title-font-family","",Sl),fontSize:r.extend("--ft-typography-title-font-size","",O.fontSize,"20px"),fontWeight:r.extend("--ft-typography-title-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-title-letter-spacing","",O.letterSpacing,"0.15px"),lineHeight:r.extend("--ft-typography-title-line-height","",O.lineHeight,"1.2"),textTransform:r.extend("--ft-typography-title-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-title-text-decoration","",O.textDecoration,"inherit")},lt={fontFamily:r.extend("--ft-typography-title-dense-font-family","",Sl),fontSize:r.extend("--ft-typography-title-dense-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-title-dense-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-title-dense-letter-spacing","",O.letterSpacing,"0.105px"),lineHeight:r.extend("--ft-typography-title-dense-line-height","",O.lineHeight,"1.7"),textTransform:r.extend("--ft-typography-title-dense-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-title-dense-text-decoration","",O.textDecoration,"inherit")},dt={fontFamily:r.extend("--ft-typography-subtitle1-font-family","",Pe),fontSize:r.extend("--ft-typography-subtitle1-font-size","",O.fontSize,"16px"),fontWeight:r.extend("--ft-typography-subtitle1-font-weight","",O.fontWeight,"600"),letterSpacing:r.extend("--ft-typography-subtitle1-letter-spacing","",O.letterSpacing,"0.144px"),lineHeight:r.extend("--ft-typography-subtitle1-line-height","",O.lineHeight,"1.5"),textTransform:r.extend("--ft-typography-subtitle1-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-subtitle1-text-decoration","",O.textDecoration,"inherit")},ut={fontFamily:r.extend("--ft-typography-subtitle2-font-family","",Pe),fontSize:r.extend("--ft-typography-subtitle2-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-subtitle2-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-subtitle2-letter-spacing","",O.letterSpacing,"0.098px"),lineHeight:r.extend("--ft-typography-subtitle2-line-height","",O.lineHeight,"1.7"),textTransform:r.extend("--ft-typography-subtitle2-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-subtitle2-text-decoration","",O.textDecoration,"inherit")},pt={fontFamily:r.extend("--ft-typography-body1-font-family","",Pe),fontSize:r.extend("--ft-typography-body1-font-size","",O.fontSize,"16px"),fontWeight:r.extend("--ft-typography-body1-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-body1-letter-spacing","",O.letterSpacing,"0.496px"),lineHeight:r.extend("--ft-typography-body1-line-height","",O.lineHeight,"1.5"),textTransform:r.extend("--ft-typography-body1-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-body1-text-decoration","",O.textDecoration,"inherit")},ft={fontFamily:r.extend("--ft-typography-body2-font-family","",Pe),fontSize:r.extend("--ft-typography-body2-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-body2-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-body2-letter-spacing","",O.letterSpacing,"0.252px"),lineHeight:r.extend("--ft-typography-body2-line-height","",O.lineHeight,"1.4"),textTransform:r.extend("--ft-typography-body2-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-body2-text-decoration","",O.textDecoration,"inherit")},ht={fontFamily:r.extend("--ft-typography-caption-font-family","",Pe),fontSize:r.extend("--ft-typography-caption-font-size","",O.fontSize,"12px"),fontWeight:r.extend("--ft-typography-caption-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-caption-letter-spacing","",O.letterSpacing,"0.396px"),lineHeight:r.extend("--ft-typography-caption-line-height","",O.lineHeight,"1.33"),textTransform:r.extend("--ft-typography-caption-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-caption-text-decoration","",O.textDecoration,"inherit")},mt={fontFamily:r.extend("--ft-typography-breadcrumb-font-family","",Pe),fontSize:r.extend("--ft-typography-breadcrumb-font-size","",O.fontSize,"10px"),fontWeight:r.extend("--ft-typography-breadcrumb-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-breadcrumb-letter-spacing","",O.letterSpacing,"0.33px"),lineHeight:r.extend("--ft-typography-breadcrumb-line-height","",O.lineHeight,"1.6"),textTransform:r.extend("--ft-typography-breadcrumb-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-breadcrumb-text-decoration","",O.textDecoration,"inherit")},yt={fontFamily:r.extend("--ft-typography-overline-font-family","",Pe),fontSize:r.extend("--ft-typography-overline-font-size","",O.fontSize,"10px"),fontWeight:r.extend("--ft-typography-overline-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-overline-letter-spacing","",O.letterSpacing,"1.5px"),lineHeight:r.extend("--ft-typography-overline-line-height","",O.lineHeight,"1.6"),textTransform:r.extend("--ft-typography-overline-text-transform","",O.textTransform,"uppercase"),textDecoration:r.extend("--ft-typography-overline-text-decoration","",O.textDecoration,"inherit")},gt={fontFamily:r.extend("--ft-typography-button-font-family","",Pe),fontSize:r.extend("--ft-typography-button-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-button-font-weight","",O.fontWeight,"600"),letterSpacing:r.extend("--ft-typography-button-letter-spacing","",O.letterSpacing,"1.246px"),lineHeight:r.extend("--ft-typography-button-line-height","",O.lineHeight,"1.15"),textTransform:r.extend("--ft-typography-button-text-transform","",O.textTransform,"uppercase"),textDecoration:r.extend("--ft-typography-button-text-decoration","",O.textDecoration,"inherit")},El=N`
84
+ `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?ze.error:this.warningMessages.length?ze.warning:ze.default}}return H([w()],e.prototype,"warningRules",void 0),H([w()],e.prototype,"errorRules",void 0),H([w()],e.prototype,"validateOn",void 0),H([w({type:Boolean})],e.prototype,"validateAtRender",void 0),H([w()],e.prototype,"label",void 0),H([w({type:Boolean})],e.prototype,"hideLabel",void 0),H([w()],e.prototype,"name",void 0),H([w({type:Boolean})],e.prototype,"disabled",void 0),H([w()],e.prototype,"helperText",void 0),H([w()],e.prototype,"forceStatus",void 0),H([w({reflect:!0})],e.prototype,"value",void 0),H([W()],e.prototype,"errorMessages",void 0),H([W()],e.prototype,"warningMessages",void 0),H([W()],e.prototype,"status",void 0),H([W()],e.prototype,"focused",void 0),H([W()],e.prototype,"additionalWarningRules",void 0),H([W()],e.prototype,"additionalErrorRules",void 0),H([W()],e.prototype,"forceErrorMessages",void 0),e});var Rr=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),Rr(n,e);return!0},Ro=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},gl=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),gf(e)}};function mf(t){this._$AN!==void 0?(Ro(this),this._$AM=t,gl(this)):this._$AM=t}function yf(t,e=!1,o=0){let n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let a=o;a<n.length;a++)Rr(n[a],!1),Ro(n[a]);else n!=null&&(Rr(n,!1),Ro(n));else Rr(this,t)}var gf=t=>{t.type==ge.CHILD&&(t._$AP??=yf,t._$AQ??=mf)},Vt=class extends ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),gl(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(Rr(this,e),Ro(this))}setValue(e){if(Ra(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Hi=class extends Vt{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async o=>{if(!this.element||!o.relatedTarget)return;let n=o.relatedTarget;this.isInsideElement(n,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return z}update(e){return this.part=e,this.ensureFocusTrap(e.element),z}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var o,n;this.isElementTrappable(e)&&(((o=this.firstTrap)===null||o===void 0?void 0:o.parentElement)===e&&((n=this.lastTrap)===null||n===void 0?void 0:n.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,o,n,i;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(o=this.lastTrap)===null||o===void 0||o.removeEventListener("focus",this.onLastTrapFocus),(n=this.firstTrap)===null||n===void 0||n.remove(),(i=this.lastTrap)===null||i===void 0||i.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=0;n<o.length;n++){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusFirstDescendant(i)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let o=this.getChildren(e);for(let n=o.length-1;n>=0;n--){let i=o[n];if(i instanceof HTMLElement&&(this.attemptFocus(i)||await this.focusLastDescendant(i)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof ie&&await e.updateComplete}isInsideElement(e,o){for(let n=e;n;n=n.parentNode){if(n===o)return!0;n instanceof ShadowRoot?n=n.host:n.assignedSlot&&(n=n.assignedSlot)}return!1}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},Sv=ee(Hi);var bl;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(bl||(bl={}));var bf={sm:640,md:768,lg:1024,xl:1280},Vi=class extends Vt{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,i]){return this.lastArgs=[o,n,i],this.render(o,n,i)}render(e,o,n){let i=this.resolveThreshold(e),a=n??(()=>M);return this.size>i?o():a()}resolveThreshold(e){return typeof e=="number"?e:bf[e]}},Ov=ee(Vi);var Wi,Gi,ji,Ki,xf=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((ji=(Gi=(Wi=window.safari)===null||Wi===void 0?void 0:Wi.pushNotification)===null||Gi===void 0?void 0:Gi.toString())!==null&&ji!==void 0?ji:"")==="[object SafariRemoteNotification]",vf="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ki=window.ftGlobals)!==null&&Ki!==void 0?Ki:{lit:Xo,litDecorators:en,litRepeat:tn,litClassMap:rn,litStyleMap:on,litUnsafeHTML:nn,wcUtils:{...an,...yn,...cn,...An,...Ii,...Rn,...ln,...Ln,...mn,...Gn,...Ni,...fl,...Ai,...jn,...Tn,...Xn,..._i,...Yn,...Pi,...Fi,...Ac,...pn,...ti,...Bi,...kn,...ri,...hl,..._c,...oi,...Ci,...Li,...Kn,...qn,...vn,...Cn,...Di,isSafari:xf,isTouchScreen:vf,setVariable:Tt}};var vl=Symbol.for(""),Sf=t=>{if(t?.r===vl)return t?._$litStatic$},Zi=t=>({_$litStatic$:t,r:vl});var xl=new Map,qi=t=>(e,...o)=>{let n=o.length,i,a,s=[],l=[],d,p=0,h=!1;for(;p<n;){for(d=e[p];p<n&&(a=o[p],(i=Sf(a))!==void 0);)d+=i+e[++p],h=!0;p!==n&&l.push(a),s.push(d),p++}if(p===n&&s.push(e[n]),h){let f=s.join("$$lit$$");(e=xl.get(f))===void 0&&(s.raw=s,xl.set(f,e=s)),o=l}return t(e,...o)},Yi=qi(X),AS=qi(Ko),RS=qi(Zo);var Wt;(function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"})(Wt||(Wt={}));var Sl=r.extend("--ft-typography-font-family","",Te.titleFont),Pe=r.extend("--ft-typography-font-family","",Te.contentFont),O={fontFamily:Pe,fontSize:r.create("--ft-typography-font-size","","SIZE","16px"),fontWeight:r.create("--ft-typography-font-weight","","UNKNOWN","normal"),letterSpacing:r.create("--ft-typography-letter-spacing","","SIZE","0.496px"),lineHeight:r.create("--ft-typography-line-height","","NUMBER","1.5"),textTransform:r.create("--ft-typography-text-transform","","UNKNOWN","inherit"),textDecoration:r.create("--ft-typography-text-decoration","","UNKNOWN","inherit")},ct={fontFamily:r.extend("--ft-typography-title-font-family","",Sl),fontSize:r.extend("--ft-typography-title-font-size","",O.fontSize,"20px"),fontWeight:r.extend("--ft-typography-title-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-title-letter-spacing","",O.letterSpacing,"0.15px"),lineHeight:r.extend("--ft-typography-title-line-height","",O.lineHeight,"1.2"),textTransform:r.extend("--ft-typography-title-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-title-text-decoration","",O.textDecoration,"inherit")},lt={fontFamily:r.extend("--ft-typography-title-dense-font-family","",Sl),fontSize:r.extend("--ft-typography-title-dense-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-title-dense-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-title-dense-letter-spacing","",O.letterSpacing,"0.105px"),lineHeight:r.extend("--ft-typography-title-dense-line-height","",O.lineHeight,"1.7"),textTransform:r.extend("--ft-typography-title-dense-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-title-dense-text-decoration","",O.textDecoration,"inherit")},dt={fontFamily:r.extend("--ft-typography-subtitle1-font-family","",Pe),fontSize:r.extend("--ft-typography-subtitle1-font-size","",O.fontSize,"16px"),fontWeight:r.extend("--ft-typography-subtitle1-font-weight","",O.fontWeight,"600"),letterSpacing:r.extend("--ft-typography-subtitle1-letter-spacing","",O.letterSpacing,"0.144px"),lineHeight:r.extend("--ft-typography-subtitle1-line-height","",O.lineHeight,"1.5"),textTransform:r.extend("--ft-typography-subtitle1-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-subtitle1-text-decoration","",O.textDecoration,"inherit")},ut={fontFamily:r.extend("--ft-typography-subtitle2-font-family","",Pe),fontSize:r.extend("--ft-typography-subtitle2-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-subtitle2-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-subtitle2-letter-spacing","",O.letterSpacing,"0.098px"),lineHeight:r.extend("--ft-typography-subtitle2-line-height","",O.lineHeight,"1.7"),textTransform:r.extend("--ft-typography-subtitle2-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-subtitle2-text-decoration","",O.textDecoration,"inherit")},pt={fontFamily:r.extend("--ft-typography-body1-font-family","",Pe),fontSize:r.extend("--ft-typography-body1-font-size","",O.fontSize,"16px"),fontWeight:r.extend("--ft-typography-body1-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-body1-letter-spacing","",O.letterSpacing,"0.496px"),lineHeight:r.extend("--ft-typography-body1-line-height","",O.lineHeight,"1.5"),textTransform:r.extend("--ft-typography-body1-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-body1-text-decoration","",O.textDecoration,"inherit")},ft={fontFamily:r.extend("--ft-typography-body2-font-family","",Pe),fontSize:r.extend("--ft-typography-body2-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-body2-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-body2-letter-spacing","",O.letterSpacing,"0.252px"),lineHeight:r.extend("--ft-typography-body2-line-height","",O.lineHeight,"1.4"),textTransform:r.extend("--ft-typography-body2-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-body2-text-decoration","",O.textDecoration,"inherit")},ht={fontFamily:r.extend("--ft-typography-caption-font-family","",Pe),fontSize:r.extend("--ft-typography-caption-font-size","",O.fontSize,"12px"),fontWeight:r.extend("--ft-typography-caption-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-caption-letter-spacing","",O.letterSpacing,"0.396px"),lineHeight:r.extend("--ft-typography-caption-line-height","",O.lineHeight,"1.33"),textTransform:r.extend("--ft-typography-caption-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-caption-text-decoration","",O.textDecoration,"inherit")},mt={fontFamily:r.extend("--ft-typography-breadcrumb-font-family","",Pe),fontSize:r.extend("--ft-typography-breadcrumb-font-size","",O.fontSize,"10px"),fontWeight:r.extend("--ft-typography-breadcrumb-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-breadcrumb-letter-spacing","",O.letterSpacing,"0.33px"),lineHeight:r.extend("--ft-typography-breadcrumb-line-height","",O.lineHeight,"1.6"),textTransform:r.extend("--ft-typography-breadcrumb-text-transform","",O.textTransform,"inherit"),textDecoration:r.extend("--ft-typography-breadcrumb-text-decoration","",O.textDecoration,"inherit")},yt={fontFamily:r.extend("--ft-typography-overline-font-family","",Pe),fontSize:r.extend("--ft-typography-overline-font-size","",O.fontSize,"10px"),fontWeight:r.extend("--ft-typography-overline-font-weight","",O.fontWeight,"normal"),letterSpacing:r.extend("--ft-typography-overline-letter-spacing","",O.letterSpacing,"1.5px"),lineHeight:r.extend("--ft-typography-overline-line-height","",O.lineHeight,"1.6"),textTransform:r.extend("--ft-typography-overline-text-transform","",O.textTransform,"uppercase"),textDecoration:r.extend("--ft-typography-overline-text-decoration","",O.textDecoration,"inherit")},gt={fontFamily:r.extend("--ft-typography-button-font-family","",Pe),fontSize:r.extend("--ft-typography-button-font-size","",O.fontSize,"14px"),fontWeight:r.extend("--ft-typography-button-font-weight","",O.fontWeight,"600"),letterSpacing:r.extend("--ft-typography-button-letter-spacing","",O.letterSpacing,"1.246px"),lineHeight:r.extend("--ft-typography-button-line-height","",O.lineHeight,"1.15"),textTransform:r.extend("--ft-typography-button-text-transform","",O.textTransform,"uppercase"),textDecoration:r.extend("--ft-typography-button-text-decoration","",O.textDecoration,"inherit")},El=N`
85
85
  .ft-typography--title {
86
86
  font-family: ${ct.fontFamily};
87
87
  font-size: ${ct.fontSize};
@@ -225,7 +225,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
225
225
  position: relative;
226
226
  word-break: break-word;
227
227
  }
228
- `;var Ef="ft-app-info",bt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};bt.eventName="authentication-change";var Ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ir.eventName="ui-locale-changed";var Cf={session:(t,e)=>{Y(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>L.dispatchEvent(new bt(e.payload)),0))}},L=it.get({name:Ef,reducers:Cf,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 _o=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},rE=G(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(L)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>at.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return _o([w({type:Boolean})],e.prototype,"useLongDateFormat",void 0),_o([w({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),_o([Ut({store:L.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),_o([Ut({store:L.name})],e.prototype,"uiLocale",void 0),e});var xt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=L.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=L.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Gt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):xt.await()}};var ne=class extends Gt{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new xe,this.cache=e?i.commonCache:new xe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Io=class extends ne{async listMySearches(){let{session:e}=L.getState();return xn(e,B.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var To=class extends ne{async listMyBookmarks(){let e=L.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Lo=class extends ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=L.getState().session;return!!e?.sessionAuthenticated}};var ko=class extends ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=L.getState().session;return!!e?.sessionAuthenticated}};var wf="ft-user-assets",Of={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(se).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Xi(t,o,[...Ji(t,o),i]),Ml(t,o,1,n),Dl(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Xi(t,o,Ji(t,o).map(i=>i.id===n.id?n:i)),Dl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Xi(t,o,Ji(t,o).filter(a=>a.id!==i)),Ml(t,o,-1,n)}},Ul={[se.SEARCHES]:"savedSearches",[se.BOOKMARKS]:"bookmarks",[se.BOOKS]:void 0,[se.COLLECTIONS]:void 0},Ji=(t,e)=>{var o;let n=Ul[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Xi=(t,e,o)=>{let n=Ul[e];n&&(t[n]=o)},Ml=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===se.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Dl=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},J=it.get({name:wf,reducers:Of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(se).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Qi=class{constructor(e=new Lo,o=new ko){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=L.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new To,this.savedSearchesService=new Io,L.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=L.getState();Y((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),J.actions.clearAssetCount(),J.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),J.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),J.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();J.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();J.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&J.getState().assetCounts.allAsset[e]!==o.count&&J.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&J.getState().assetCounts.bookmarkByMap[e]!==o.count&&J.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(J.getState().assetCounts.bookmarkByMap).length!==0;e===se.BOOKMARKS&&o&&J.actions.clearBookmarkCountByMap(),J.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 o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;J.actions.bookmarks(o)}}},Af=new Qi;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Af);var ea=class{addCommand(e,o=!1){L.commands.add(e,o)}consumeCommand(e){return L.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ea;var Bl,jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Rf=Symbol("clearAfterUnitTest"),No=class extends qr(ne){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Bl]=()=>{this.defaultMessages={},this.cache=new xe,this.listeners={}},this.currentUiLocale=L.getState().uiLocale,L.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=L.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};Y(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new gr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof Ke)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new jt({loadedContexts:e})),this.dispatchEvent(new jt({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new jt({loadedContexts:[e]})),this.dispatchEvent(new jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Zr(0).then(()=>n()).catch(()=>null)))}};Bl=Rf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends No{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends No{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Tr=window.FluidTopicsI18nService,ta=window.FluidTopicsCustomI18nService;var ra=class{highlightHtml(e,o,n){ei(e,o,n)}};window.FluidTopicsHighlightHtmlService=new ra;var oa=class{isDate(e){var o,n,i,a;return(a=(n=((i=(o=L.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&i!==void 0?i:[]).find(l=>l.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a,s;if(e==null)return"";try{return at.format(e,(n=o?.locale)!==null&&n!==void 0?n:L.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1,(s=o?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new oa;var Lr=class{static get(e,o,{baseUrl:n,localesConfiguration:i,availableContentLocales:a}=L.getState()){var s;if(!o||a.length>0&&!a.some(l=>l.lang===o)){let l=i?.defaultLocales.defaultContentLocale;o=l?`${l.lang}-${l.region}`:(s=a[0])===null||s===void 0?void 0:s.lang}return new Ie(n,e??20,i?.allLanguagesAllowed,o,a)}};var na=class{urlToSearchRequest(e){return Lr.get().parse(e)}searchRequestToUrl(e){return Lr.get().serialize(e)}};window.FluidTopicsUrlService=new na;var vt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};vt.eventName="before-location-change";var St=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};St.eventName="change";var ia=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},$l=new ia;var Po=class t extends _e{static build(){return new t(window.history,$l,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&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),Y(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new St(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let d=new vt(new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin));this.dispatchEvent(d);let p=o(),h={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:d.detail.nextLocation.href};n.apply(i,[h,s,h.href]),this.setCurrentState(h,!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 o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(vt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(vt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(St.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(St.eventName,e)}currentItem(){return de(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 de(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let o=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return de(o.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 de(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 o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Po.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 zl=N`
228
+ `;var Ef="ft-app-info",bt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};bt.eventName="authentication-change";var Ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ir.eventName="ui-locale-changed";var Cf={session:(t,e)=>{Y(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>L.dispatchEvent(new bt(e.payload)),0))}},L=it.get({name:Ef,reducers:Cf,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 _o=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},aE=G(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(L)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>at.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return _o([w({type:Boolean})],e.prototype,"useLongDateFormat",void 0),_o([w({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),_o([Ut({store:L.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),_o([Ut({store:L.name})],e.prototype,"uiLocale",void 0),e});var xt=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=L.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=L.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var Gt=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:xt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):xt.await()}};var ne=class extends Gt{constructor(e=!0,o){var n;super(o),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[d])=>l.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new xe,this.cache=e?i.commonCache:new xe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var Io=class extends ne{async listMySearches(){let{session:e}=L.getState();return xn(e,B.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var To=class extends ne{async listMyBookmarks(){let e=L.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Lo=class extends ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=L.getState().session;return!!e?.sessionAuthenticated}};var ko=class extends ne{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=L.getState().session;return!!e?.sessionAuthenticated}};var wf="ft-user-assets",Of={setAssetCount:(t,e)=>{let{userAssetType:o,count:n}=e.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(se).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let o=e.payload.mapId;t.assetCounts.bookmarkByMap[o]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:o,mapId:n,asset:i}=e.payload;Xi(t,o,[...Ji(t,o),i]),Ml(t,o,1,n),Dl(t,i)},editAsset:(t,e)=>{let{assetType:o,asset:n}=e.payload;Xi(t,o,Ji(t,o).map(i=>i.id===n.id?n:i)),Dl(t,n)},removeAsset:(t,e)=>{let{assetType:o,mapId:n,assetId:i}=e.payload;Xi(t,o,Ji(t,o).filter(a=>a.id!==i)),Ml(t,o,-1,n)}},Ul={[se.SEARCHES]:"savedSearches",[se.BOOKMARKS]:"bookmarks",[se.BOOKS]:void 0,[se.COLLECTIONS]:void 0},Ji=(t,e)=>{var o;let n=Ul[e];return n?(o=t[n])!==null&&o!==void 0?o:[]:[]},Xi=(t,e,o)=>{let n=Ul[e];n&&(t[n]=o)},Ml=(t,e,o,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+o),e===se.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+o)}},Dl=(t,e)=>{let o=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!o.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},J=it.get({name:wf,reducers:Of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(se).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Qi=class{constructor(e=new Lo,o=new ko){this.assetCountsService=e,this.assetLabelsService=o,this.currentSession=L.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new To,this.savedSearchesService=new Io,L.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=L.getState();Y((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),J.actions.clearAssetCount(),J.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),J.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),J.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();J.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();J.actions.assetLabels(e)}async loadAssetCount(e){let o=await this.assetCountsService.getUserAssetCount(e);o&&J.getState().assetCounts.allAsset[e]!==o.count&&J.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(e){let o=await this.assetCountsService.getUserBookmarkCountByMap(e);o&&J.getState().assetCounts.bookmarkByMap[e]!==o.count&&J.actions.setBookmarkCountByMap({count:o.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let o=Object.keys(J.getState().assetCounts.bookmarkByMap).length!==0;e===se.BOOKMARKS&&o&&J.actions.clearBookmarkCountByMap(),J.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 o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;J.actions.bookmarks(o)}}},Af=new Qi;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Af);var ea=class{addCommand(e,o=!1){L.commands.add(e,o)}consumeCommand(e){return L.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ea;var Bl,jt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Rf=Symbol("clearAfterUnitTest"),No=class extends qr(ne){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Bl]=()=>{this.defaultMessages={},this.cache=new xe,this.listeners={}},this.currentUiLocale=L.getState().uiLocale,L.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=L.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};Y(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new gr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),o&&await this.notify(e)}catch(i){!(i instanceof Ke)&&o&&console.error(i)}return n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new jt({loadedContexts:e})),this.dispatchEvent(new jt({loadedContexts:e})),await Promise.all(e.map(o=>this.notify(o,!1)))}async notify(e,o=!0){o&&(document.body.dispatchEvent(new jt({loadedContexts:[e]})),this.dispatchEvent(new jt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Zr(0).then(()=>n()).catch(()=>null)))}};Bl=Rf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends No{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends No{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Tr=window.FluidTopicsI18nService,ta=window.FluidTopicsCustomI18nService;var ra=class{highlightHtml(e,o,n){ei(e,o,n)}};window.FluidTopicsHighlightHtmlService=new ra;var oa=class{isDate(e){var o,n,i,a;return(a=(n=((i=(o=L.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&i!==void 0?i:[]).find(l=>l.key===e))===null||n===void 0?void 0:n.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a,s;if(e==null)return"";try{return at.format(e,(n=o?.locale)!==null&&n!==void 0?n:L.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1,(s=o?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(e)} is not valid`,l),l}}};window.FluidTopicsDateService=new oa;var Lr=class{static get(e,o,{baseUrl:n,localesConfiguration:i,availableContentLocales:a}=L.getState()){var s;if(!o||a.length>0&&!a.some(l=>l.lang===o)){let l=i?.defaultLocales.defaultContentLocale;o=l?`${l.lang}-${l.region}`:(s=a[0])===null||s===void 0?void 0:s.lang}return new Ie(n,e??20,i?.allLanguagesAllowed,o,a)}};var na=class{urlToSearchRequest(e){return Lr.get().parse(e)}searchRequestToUrl(e){return Lr.get().serialize(e)}};window.FluidTopicsUrlService=new na;var vt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};vt.eventName="before-location-change";var St=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};St.eventName="change";var ia=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},$l=new ia;var Po=class t extends _e{static build(){return new t(window.history,$l,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&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),Y(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new St(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,l])=>{let d=new vt(new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin));this.dispatchEvent(d);let p=o(),h={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:d.detail.nextLocation.href};n.apply(i,[h,s,h.href]),this.setCurrentState(h,!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 o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(vt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(vt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(St.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(St.eventName,e)}currentItem(){return de(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 de(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let o=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return de(o.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 de(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 o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Po.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 zl=N`
229
229
  `;function Hl(t,e){let{authenticationRequired:o,session:n}=L.getState();return o&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Fo=class extends Gt{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var aa=class t extends Ar{static build(e){return new t(L,e)}constructor(e,o){super(),this.store=e,this.cache=new xe,this.withManualResources=!0,this.userLocaleService=new Fo,this.cleanSessionDebouncer=new ue,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new ue(500),this.apiProvider=o??(()=>xt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(bt.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(bt.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 o=await this.apiProvider().getCurrentSession();return o.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},o.idleTimeoutInMillis),o});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 o=await this.cache.get("availableContentLocales",()=>Hl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=o.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,o){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:o}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ir(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 As(L.getState().session,...e)}},Vl=aa.build();var Et=class extends Event{constructor(e,o,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=o,this.callback=n,this.subscribe=i??!1}};var kr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let o=this.pendingContextRequests.get(e.context);if(o===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=o;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),l=a.deref();s===void 0||l===void 0||s.dispatchEvent(new Et(e.context,s,l,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let o=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(o);a===void 0&&i.callbacks.set(o,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(o),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 V=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},D=class extends ot{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 kr}render(){return X`
230
230
  <slot></slot>
231
231
  `}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 o;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=>Tr.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")&&((o=this.stateManager)===null||o===void 0||o.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};D.elementDefinitions={};D.styles=zl;V([w()],D.prototype,"baseUrl",void 0);V([w()],D.prototype,"tenantId",void 0);V([w()],D.prototype,"apiIntegrationIdentifier",void 0);V([w()],D.prototype,"apiIntegrationAppVersion",void 0);V([w()],D.prototype,"uiLocale",void 0);V([te(null)],D.prototype,"availableUiLocales",void 0);V([te(null)],D.prototype,"metadataConfiguration",void 0);V([w({type:Boolean})],D.prototype,"editorMode",void 0);V([w({type:Boolean})],D.prototype,"noCustom",void 0);V([w({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);V([w({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomComponent",void 0);V([w({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],D.prototype,"noCustomCode",void 0);V([w({type:Boolean})],D.prototype,"withManualResources",void 0);V([w({type:Boolean})],D.prototype,"navigatorOnline",void 0);V([w({type:Boolean})],D.prototype,"forcedOffline",void 0);V([w({type:Boolean})],D.prototype,"authenticationRequired",void 0);V([te([])],D.prototype,"messageContexts",void 0);V([te(void 0)],D.prototype,"session",void 0);var Wl={"ft-app-context":D};Re(Wl);var sa=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[o,n]=e.split(".");return{context:o,key:n,custom:o!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Kt=new sa;var Tf=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},Pr=Symbol("i18nAttributes"),Gl=Symbol("i18nListAttributes"),jl=Symbol("i18nProperties"),Mo=Symbol("i18nContexts"),Nr=Symbol("i18nUnsubs"),Kl=G(Symbol("withI18n"),function(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?ta:Tr}i18n(a){let{context:s,key:l,message:d}=a,{custom:p,args:h,argsProvider:f}=a;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,l,...m)}return d}async awaitI18n(a){let{context:s,custom:l}=a;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Kt.isI18nKey(a)){let[l,d]=a.split(".");return this.i18n({custom:!0,context:l,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,l,d)=>a.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,l,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,l;let d=this,p=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[Pr])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(l=this[Gl])===null||l===void 0||l.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(b=>p(h,f,b))})}updateI18nProperties(a){var s;(s=this[jl])===null||s===void 0||s.forEach((l,d)=>{a(l,d)&&(this[d]=this.i18n(l))})}addI18nMessages(a,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,l)}addI18nContext(a,s,l){let d=(typeof a=="string"?a:a.name).toLowerCase();l=typeof a=="string"?l:a.custom,this[Mo].set(d,{isCustomContext:l}),this[Nr].has(d)||this[Nr].set(d,this.getI18nService(l).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(l).prepareContext(d,s)}hasI18nContext(a){return this[Mo].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Mo].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Nr].forEach(a=>a()),this[Nr].clear()}}return e=Mo,o=Nr,Tf([w({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Do=class extends Kl(j){},Uo=class extends Kl(ot){};var ca=class{fromAttribute(e){if(!e)return[];try{let o=JSON.parse(e);return Array.isArray(o)?o.map(n=>typeof n=="string"?Kt.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},Lf=new ca;var Zl=(t,e)=>(o,n)=>{var i;o.constructor.createProperty(n,{type:Object,hasChanged:be,converter:Kt,...e}),o[Pr]=(i=o[Pr])!==null&&i!==void 0?i:new Map,o[Pr].set(n,t??{})};var ql=N`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tooltip",
3
- "version": "2.2.27",
3
+ "version": "2.2.28",
4
4
  "description": "A simple tooltip component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,10 +19,10 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-i18n": "2.2.27",
23
- "@fluid-topics/ft-typography": "2.2.27",
24
- "@fluid-topics/ft-wc-utils": "2.2.27",
22
+ "@fluid-topics/ft-i18n": "2.2.28",
23
+ "@fluid-topics/ft-typography": "2.2.28",
24
+ "@fluid-topics/ft-wc-utils": "2.2.28",
25
25
  "lit": "3.3.3"
26
26
  },
27
- "gitHead": "1f823223901cc0b24d6063df625485133b9516f8"
27
+ "gitHead": "8ca1d190ac34fad2ecec7ad3b03890913f865eb7"
28
28
  }