@fluid-topics/ft-tooltip 0.3.31 → 0.3.33

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.
@@ -15,6 +15,8 @@ export declare class FtTooltip extends FtLitElement implements FtTooltipProperti
15
15
  private tooltip?;
16
16
  private tooltipContent?;
17
17
  private visible;
18
+ private readonly validPositions;
19
+ private get validPosition();
18
20
  protected render(): import("lit-html").TemplateResult<1>;
19
21
  protected update(props: PropertyValues): void;
20
22
  protected contentAvailableCallback(props: PropertyValues): void;
@@ -18,9 +18,13 @@ export class FtTooltip extends FtLitElement {
18
18
  this.delay = 500;
19
19
  this.position = "bottom";
20
20
  this.visible = false;
21
+ this.validPositions = new Set(["top", "bottom", "left", "right"]);
21
22
  this.hideDebounce = new Debouncer();
22
23
  this.revealDebouncer = new Debouncer();
23
24
  }
25
+ get validPosition() {
26
+ return this.validPositions.has(this.position) ? this.position : "bottom";
27
+ }
24
28
  render() {
25
29
  return html `
26
30
  <div part="container"
@@ -30,7 +34,7 @@ export class FtTooltip extends FtLitElement {
30
34
  @focusin=${this.onHover}
31
35
  @focusout=${this.onOut}
32
36
  @touchstart=${this.onTouch}>
33
- <div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
37
+ <div part="tooltip" class="ft-tooltip ft-tooltip--${this.validPosition}" ?hidden=${!this.visible}>
34
38
  <div part="tooltip-content" class="ft-tooltip--content">
35
39
  <slot name="text"></slot>
36
40
  <ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
@@ -71,7 +75,7 @@ export class FtTooltip extends FtLitElement {
71
75
  if (this.tooltip && this.tooltipContent) {
72
76
  const style = this.tooltipContent.style;
73
77
  style.transition = "none";
74
- switch (this.position) {
78
+ switch (this.validPosition) {
75
79
  case "top":
76
80
  style.top = this.tooltip.clientHeight + "px";
77
81
  style.left = "0";
@@ -100,7 +104,7 @@ export class FtTooltip extends FtLitElement {
100
104
  const horizontalCenter = (box.width - this.tooltip.clientWidth) / 2;
101
105
  let left = 0;
102
106
  let top = 0;
103
- switch (this.position) {
107
+ switch (this.validPosition) {
104
108
  case "top":
105
109
  top = (-this.tooltip.clientHeight);
106
110
  left = horizontalCenter;
@@ -4,16 +4,16 @@
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- var s;const n=window,r=n.trustedTypes,h=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,l=`lit$${(Math.random()+"").slice(9)}$`,a="?"+l,p=`<${a}>`,f=document,y=(t="")=>f.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,v=/>/g,$=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),b=/'/g,m=/"/g,x=/^(?:script|style|textarea|title)$/i,w=(t=>(i,...o)=>({_$litType$:t,strings:i,values:o}))(1),z=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),A=new WeakMap,N=f.createTreeWalker(f,129,null,!1),_=(t,i)=>{const o=t.length-1,e=[];let s,n=2===i?"<svg>":"",r=d;for(let i=0;i<o;i++){const o=t[i];let h,a,f=-1,y=0;for(;y<o.length&&(r.lastIndex=y,a=r.exec(o),null!==a);)y=r.lastIndex,r===d?"!--"===a[1]?r=u:void 0!==a[1]?r=v:void 0!==a[2]?(x.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=$):void 0!==a[3]&&(r=$):r===$?">"===a[0]?(r=null!=s?s:d,f=-1):void 0===a[1]?f=-2:(f=r.lastIndex-a[2].length,h=a[1],r=void 0===a[3]?$:'"'===a[3]?m:b):r===m||r===b?r=$:r===u||r===v?r=d:(r=$,s=void 0);const g=r===$&&t[i+1].startsWith("/>")?" ":"";n+=r===d?o+p:f>=0?(e.push(h),o.slice(0,f)+"$lit$"+o.slice(f)+l+g):o+l+(-2===f?(e.push(void 0),i):g)}const a=n+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==h?h.createHTML(a):a,e]};class O{constructor({strings:t,_$litType$:i},o){let e;this.parts=[];let s=0,n=0;const h=t.length-1,p=this.parts,[f,g]=_(t,i);if(this.el=O.createElement(f,o),N.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=N.nextNode())&&p.length<h;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(l)){const o=g[n++];if(t.push(i),void 0!==o){const t=e.getAttribute(o.toLowerCase()+"$lit$").split(l),i=/([.?@])?(.*)/.exec(o);p.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?C:"?"===i[1]?R:"@"===i[1]?U:j})}else p.push({type:6,index:s})}for(const i of t)e.removeAttribute(i)}if(x.test(e.tagName)){const t=e.textContent.split(l),i=t.length-1;if(i>0){e.textContent=r?r.emptyScript:"";for(let o=0;o<i;o++)e.append(t[o],y()),N.nextNode(),p.push({type:2,index:++s});e.append(t[i],y())}}}else if(8===e.nodeType)if(e.data===a)p.push({type:2,index:s});else{let t=-1;for(;-1!==(t=e.data.indexOf(l,t+1));)p.push({type:7,index:s}),t+=l.length-1}s++}}static createElement(t,i){const o=f.createElement("template");return o.innerHTML=t,o}}function S(t,i,o=t,e){var s,n,r,h;if(i===z)return i;let l=void 0!==e?null===(s=o._$Co)||void 0===s?void 0:s[e]:o._$Cl;const a=g(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==a&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===a?l=void 0:(l=new a(t),l._$AT(t,o,e)),void 0!==e?(null!==(r=(h=o)._$Co)&&void 0!==r?r:h._$Co=[])[e]=l:o._$Cl=l),void 0!==l&&(i=S(t,l._$AS(t,i.values),l,e)),i}class E{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:o},parts:e}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:f).importNode(o,!0);N.currentNode=s;let n=N.nextNode(),r=0,h=0,l=e[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new T(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new F(n,this,t)),this.u.push(i),l=e[++h]}r!==(null==l?void 0:l.index)&&(n=N.nextNode(),r++)}return s}p(t){let i=0;for(const o of this.u)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}}class T{constructor(t,i,o,e){var s;this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=e,this._$Cm=null===(s=null==e?void 0:e.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),g(t)?t===k||null==t||""===t?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==z&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>c(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==k&&g(this._$AH)?this._$AA.nextSibling.data=t:this.T(f.createTextNode(t)),this._$AH=t}$(t){var i;const{values:o,_$litType$:e}=t,s="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=O.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.p(o);else{const t=new E(s,this),i=t.v(this.options);t.p(o),this.T(i),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new O(t)),i}k(t){c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,e=0;for(const s of t)e===i.length?i.push(o=new T(this.O(y()),this.O(y()),this,this.options)):o=i[e],o._$AI(s),e++;e<i.length&&(this._$AR(o&&o._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var o;for(null===(o=this._$AP)||void 0===o||o.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class j{constructor(t,i,o,e,s){this.type=1,this._$AH=k,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=s,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,e){const s=this.strings;let n=!1;if(void 0===s)t=S(this,t,i,0),n=!g(t)||t!==this._$AH&&t!==z,n&&(this._$AH=t);else{const e=t;let r,h;for(t=s[0],r=0;r<s.length-1;r++)h=S(this,e[o+r],i,r),h===z&&(h=this._$AH[r]),n||(n=!g(h)||h!==this._$AH[r]),h===k?t=k:t!==k&&(t+=(null!=h?h:"")+s[r+1]),this._$AH[r]=h}n&&!e&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class C extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}}const I=r?r.emptyScript:"";class R extends j{constructor(){super(...arguments),this.type=4}j(t){t&&t!==k?this.element.setAttribute(this.name,I):this.element.removeAttribute(this.name)}}class U extends j{constructor(t,i,o,e,s){super(t,i,o,e,s),this.type=5}_$AI(t,i=this){var o;if((t=null!==(o=S(this,t,i,0))&&void 0!==o?o:k)===z)return;const e=this._$AH,s=t===k&&e!==k||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==k&&(e===k||s);s&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;"function"==typeof this._$AH?this._$AH.call(null!==(o=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==o?o:this.element,t):this._$AH.handleEvent(t)}}class F{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const M=n.litHtmlPolyfillSupport;null==M||M(O,T),(null!==(s=n.litHtmlVersions)&&void 0!==s?s:n.litHtmlVersions=[]).push("2.4.0");
7
+ var s;const n=window,r=n.trustedTypes,h=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,l=`lit$${(Math.random()+"").slice(9)}$`,a="?"+l,p=`<${a}>`,f=document,y=(t="")=>f.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,v=/>/g,$=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),b=/'/g,m=/"/g,x=/^(?:script|style|textarea|title)$/i,w=(t=>(i,...o)=>({_$litType$:t,strings:i,values:o}))(1),z=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),A=new WeakMap,N=f.createTreeWalker(f,129,null,!1),_=(t,i)=>{const o=t.length-1,e=[];let s,n=2===i?"<svg>":"",r=d;for(let i=0;i<o;i++){const o=t[i];let h,a,f=-1,y=0;for(;y<o.length&&(r.lastIndex=y,a=r.exec(o),null!==a);)y=r.lastIndex,r===d?"!--"===a[1]?r=u:void 0!==a[1]?r=v:void 0!==a[2]?(x.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=$):void 0!==a[3]&&(r=$):r===$?">"===a[0]?(r=null!=s?s:d,f=-1):void 0===a[1]?f=-2:(f=r.lastIndex-a[2].length,h=a[1],r=void 0===a[3]?$:'"'===a[3]?m:b):r===m||r===b?r=$:r===u||r===v?r=d:(r=$,s=void 0);const g=r===$&&t[i+1].startsWith("/>")?" ":"";n+=r===d?o+p:f>=0?(e.push(h),o.slice(0,f)+"$lit$"+o.slice(f)+l+g):o+l+(-2===f?(e.push(void 0),i):g)}const a=n+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==h?h.createHTML(a):a,e]};class S{constructor({strings:t,_$litType$:i},o){let e;this.parts=[];let s=0,n=0;const h=t.length-1,p=this.parts,[f,g]=_(t,i);if(this.el=S.createElement(f,o),N.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=N.nextNode())&&p.length<h;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(l)){const o=g[n++];if(t.push(i),void 0!==o){const t=e.getAttribute(o.toLowerCase()+"$lit$").split(l),i=/([.?@])?(.*)/.exec(o);p.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?C:"?"===i[1]?R:"@"===i[1]?U:j})}else p.push({type:6,index:s})}for(const i of t)e.removeAttribute(i)}if(x.test(e.tagName)){const t=e.textContent.split(l),i=t.length-1;if(i>0){e.textContent=r?r.emptyScript:"";for(let o=0;o<i;o++)e.append(t[o],y()),N.nextNode(),p.push({type:2,index:++s});e.append(t[i],y())}}}else if(8===e.nodeType)if(e.data===a)p.push({type:2,index:s});else{let t=-1;for(;-1!==(t=e.data.indexOf(l,t+1));)p.push({type:7,index:s}),t+=l.length-1}s++}}static createElement(t,i){const o=f.createElement("template");return o.innerHTML=t,o}}function O(t,i,o=t,e){var s,n,r,h;if(i===z)return i;let l=void 0!==e?null===(s=o._$Co)||void 0===s?void 0:s[e]:o._$Cl;const a=g(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==a&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===a?l=void 0:(l=new a(t),l._$AT(t,o,e)),void 0!==e?(null!==(r=(h=o)._$Co)&&void 0!==r?r:h._$Co=[])[e]=l:o._$Cl=l),void 0!==l&&(i=O(t,l._$AS(t,i.values),l,e)),i}class E{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:o},parts:e}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:f).importNode(o,!0);N.currentNode=s;let n=N.nextNode(),r=0,h=0,l=e[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new T(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new F(n,this,t)),this.u.push(i),l=e[++h]}r!==(null==l?void 0:l.index)&&(n=N.nextNode(),r++)}return s}p(t){let i=0;for(const o of this.u)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}}class T{constructor(t,i,o,e){var s;this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=e,this._$Cm=null===(s=null==e?void 0:e.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=O(this,t,i),g(t)?t===k||null==t||""===t?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==z&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>c(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==k&&g(this._$AH)?this._$AA.nextSibling.data=t:this.T(f.createTextNode(t)),this._$AH=t}$(t){var i;const{values:o,_$litType$:e}=t,s="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=S.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.p(o);else{const t=new E(s,this),i=t.v(this.options);t.p(o),this.T(i),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new S(t)),i}k(t){c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,e=0;for(const s of t)e===i.length?i.push(o=new T(this.O(y()),this.O(y()),this,this.options)):o=i[e],o._$AI(s),e++;e<i.length&&(this._$AR(o&&o._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var o;for(null===(o=this._$AP)||void 0===o||o.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class j{constructor(t,i,o,e,s){this.type=1,this._$AH=k,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=s,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,e){const s=this.strings;let n=!1;if(void 0===s)t=O(this,t,i,0),n=!g(t)||t!==this._$AH&&t!==z,n&&(this._$AH=t);else{const e=t;let r,h;for(t=s[0],r=0;r<s.length-1;r++)h=O(this,e[o+r],i,r),h===z&&(h=this._$AH[r]),n||(n=!g(h)||h!==this._$AH[r]),h===k?t=k:t!==k&&(t+=(null!=h?h:"")+s[r+1]),this._$AH[r]=h}n&&!e&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class C extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}}const I=r?r.emptyScript:"";class R extends j{constructor(){super(...arguments),this.type=4}j(t){t&&t!==k?this.element.setAttribute(this.name,I):this.element.removeAttribute(this.name)}}class U extends j{constructor(t,i,o,e,s){super(t,i,o,e,s),this.type=5}_$AI(t,i=this){var o;if((t=null!==(o=O(this,t,i,0))&&void 0!==o?o:k)===z)return;const e=this._$AH,s=t===k&&e!==k||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==k&&(e===k||s);s&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;"function"==typeof this._$AH?this._$AH.call(null!==(o=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==o?o:this.element,t):this._$AH.handleEvent(t)}}class F{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){O(this,t)}}const M=n.litHtmlPolyfillSupport;null==M||M(S,T),(null!==(s=n.litHtmlVersions)&&void 0!==s?s:n.litHtmlVersions=[]).push("2.4.0");
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2020 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
12
  */
13
- const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t._$litStatic$},B=t=>({_$litStatic$:t,r:Z}),G=new Map,H=(t=>(i,...o)=>{const e=o.length;let s,n;const r=[],h=[];let l,a=0,p=!1;for(;a<e;){for(l=i[a];a<e&&void 0!==(n=o[a],s=W(n));)l+=s+i[++a],p=!0;h.push(n),r.push(l),a++}if(a===e&&r.push(i[e]),p){const t=r.join("$$lit$$");void 0===(i=G.get(t))&&(r.raw=r,G.set(t,i=r)),o=h}return t(i,...o)})(w);var L;!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"}(L||(L={}));const K=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),D=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),q={fontFamily:D,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},J=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",K),P=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",q.fontSize,"20px"),Q=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",q.fontWeight,"normal"),V=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",q.letterSpacing,"0.15px"),X=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",q.lineHeight,"1.2"),Y=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",q.textTransform,"inherit"),tt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",K),it=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",q.fontSize,"14px"),ot=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",q.fontWeight,"normal"),et=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",q.letterSpacing,"0.105px"),st=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",q.lineHeight,"1.7"),nt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",q.textTransform,"inherit"),rt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",D),ht=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",q.fontSize,"16px"),lt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",q.fontWeight,"600"),at=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",q.letterSpacing,"0.144px"),pt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",q.lineHeight,"1.5"),ft=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",q.textTransform,"inherit"),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",D),gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",q.fontSize,"14px"),ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",q.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",q.letterSpacing,"0.098px"),ut=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",q.lineHeight,"1.7"),vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",q.textTransform,"inherit"),$t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",D),bt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",q.fontSize,"16px"),mt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",q.fontWeight,"normal"),xt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",q.letterSpacing,"0.496px"),wt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",q.lineHeight,"1.5"),zt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",q.textTransform,"inherit"),kt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",D),At=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",q.fontSize,"14px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",q.fontWeight,"normal"),_t=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",q.letterSpacing,"0.252px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",q.lineHeight,"1.4"),St=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",q.textTransform,"inherit"),Et=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",D),Tt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",q.fontSize,"12px"),jt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",q.fontWeight,"normal"),Ct=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",q.letterSpacing,"0.396px"),It=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",q.lineHeight,"1.33"),Rt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",q.textTransform,"inherit"),Ut=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",D),Ft=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",q.fontSize,"10px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",q.fontWeight,"normal"),Zt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",q.letterSpacing,"0.33px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",q.lineHeight,"1.6"),Bt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",q.textTransform,"inherit"),Gt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",D),Ht=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",q.fontSize,"10px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",q.fontWeight,"normal"),Kt=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",q.letterSpacing,"1.5px"),Dt=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",q.lineHeight,"1.6"),qt=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",q.textTransform,"uppercase"),Jt=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",D),Pt=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",q.fontSize,"14px"),Qt=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",q.fontWeight,"600"),Vt=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",q.letterSpacing,"1.246px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",q.lineHeight,"1.15"),Yt=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",q.textTransform,"uppercase"),ti=o.css`
13
+ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t._$litStatic$},B=t=>({_$litStatic$:t,r:Z}),G=new Map,H=(t=>(i,...o)=>{const e=o.length;let s,n;const r=[],h=[];let l,a=0,p=!1;for(;a<e;){for(l=i[a];a<e&&void 0!==(n=o[a],s=W(n));)l+=s+i[++a],p=!0;h.push(n),r.push(l),a++}if(a===e&&r.push(i[e]),p){const t=r.join("$$lit$$");void 0===(i=G.get(t))&&(r.raw=r,G.set(t,i=r)),o=h}return t(i,...o)})(w);var L;!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"}(L||(L={}));const K=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),D=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),P={fontFamily:D,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},q=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",K),J=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",P.fontSize,"20px"),Q=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",P.fontWeight,"normal"),V=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",P.letterSpacing,"0.15px"),X=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",P.lineHeight,"1.2"),Y=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",P.textTransform,"inherit"),tt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",K),it=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",P.fontSize,"14px"),ot=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",P.fontWeight,"normal"),et=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",P.letterSpacing,"0.105px"),st=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",P.lineHeight,"1.7"),nt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",P.textTransform,"inherit"),rt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",D),ht=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",P.fontSize,"16px"),lt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",P.fontWeight,"600"),at=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",P.letterSpacing,"0.144px"),pt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",P.lineHeight,"1.5"),ft=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",P.textTransform,"inherit"),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",D),gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",P.fontSize,"14px"),ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",P.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",P.letterSpacing,"0.098px"),ut=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",P.lineHeight,"1.7"),vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",P.textTransform,"inherit"),$t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",D),bt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",P.fontSize,"16px"),mt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",P.fontWeight,"normal"),xt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",P.letterSpacing,"0.496px"),wt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",P.lineHeight,"1.5"),zt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",P.textTransform,"inherit"),kt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",D),At=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",P.fontSize,"14px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",P.fontWeight,"normal"),_t=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",P.letterSpacing,"0.252px"),St=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",P.lineHeight,"1.4"),Ot=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",P.textTransform,"inherit"),Et=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",D),Tt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",P.fontSize,"12px"),jt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",P.fontWeight,"normal"),Ct=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",P.letterSpacing,"0.396px"),It=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",P.lineHeight,"1.33"),Rt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",P.textTransform,"inherit"),Ut=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",D),Ft=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",P.fontSize,"10px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",P.fontWeight,"normal"),Zt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",P.letterSpacing,"0.33px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",P.lineHeight,"1.6"),Bt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",P.textTransform,"inherit"),Gt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",D),Ht=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",P.fontSize,"10px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",P.fontWeight,"normal"),Kt=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",P.letterSpacing,"1.5px"),Dt=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",P.lineHeight,"1.6"),Pt=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",P.textTransform,"uppercase"),qt=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",D),Jt=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",P.fontSize,"14px"),Qt=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",P.fontWeight,"600"),Vt=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",P.letterSpacing,"1.246px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",P.lineHeight,"1.15"),Yt=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",P.textTransform,"uppercase"),ti=o.css`
14
14
  .ft-typography--title {
15
- font-family: ${J};
16
- font-size: ${P};
15
+ font-family: ${q};
16
+ font-size: ${J};
17
17
  font-weight: ${Q};
18
18
  letter-spacing: ${V};
19
19
  line-height: ${X};
@@ -62,8 +62,8 @@ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t
62
62
  font-size: ${At};
63
63
  font-weight: ${Nt};
64
64
  letter-spacing: ${_t};
65
- line-height: ${Ot};
66
- text-transform: ${St};
65
+ line-height: ${St};
66
+ text-transform: ${Ot};
67
67
  }
68
68
  `,ri=o.css`
69
69
  .ft-typography--caption {
@@ -90,12 +90,12 @@ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t
90
90
  font-weight: ${Lt};
91
91
  letter-spacing: ${Kt};
92
92
  line-height: ${Dt};
93
- text-transform: ${qt};
93
+ text-transform: ${Pt};
94
94
  }
95
95
  `,ai=o.css`
96
96
  .ft-typography--button {
97
- font-family: ${Jt};
98
- font-size: ${Pt};
97
+ font-family: ${qt};
98
+ font-size: ${Jt};
99
99
  font-weight: ${Qt};
100
100
  letter-spacing: ${Vt};
101
101
  line-height: ${Xt};
@@ -144,7 +144,7 @@ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t
144
144
  position: relative;
145
145
  word-break: break-word;
146
146
  }
147
- `;var di=function(t,i,o,e){for(var s,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,o):e,h=t.length-1;h>=0;h--)(s=t[h])&&(r=(n<3?s(r):n>3?s(i,o,r):s(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};class ui extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}render(){return o.html`
147
+ `;var di=function(t,i,o,e){for(var s,n=arguments.length,r=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,o):e,h=t.length-1;h>=0;h--)(s=t[h])&&(r=(n<3?s(r):n>3?s(i,o,r):s(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};class ui extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return o.html`
148
148
  <div part="container"
149
149
  class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
150
150
  @mouseenter=${this.onHover}
@@ -152,7 +152,7 @@ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t
152
152
  @focusin=${this.onHover}
153
153
  @focusout=${this.onOut}
154
154
  @touchstart=${this.onTouch}>
155
- <div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
155
+ <div part="tooltip" class="ft-tooltip ft-tooltip--${this.validPosition}" ?hidden=${!this.visible}>
156
156
  <div part="tooltip-content" class="ft-tooltip--content">
157
157
  <slot name="text"></slot>
158
158
  <ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
@@ -160,4 +160,4 @@ const Z=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===Z)return null==t?void 0:t
160
160
  </div>
161
161
  <slot></slot>
162
162
  </div>
163
- `}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),o=(i.height-this.tooltip.clientHeight)/2,e=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=e;break;case"bottom":n=i.height,s=e;break;case"left":n=o,s=-this.tooltip.clientWidth;break;case"right":n=o,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${gi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}ui.elementDefinitions={"ft-typography":yi},ui.styles=ci,di([e.property()],ui.prototype,"text",void 0),di([e.property({type:Boolean})],ui.prototype,"manual",void 0),di([e.property({type:Boolean})],ui.prototype,"inline",void 0),di([e.property({type:Number})],ui.prototype,"delay",void 0),di([e.property()],ui.prototype,"position",void 0),di([e.queryAssignedNodes("",!0)],ui.prototype,"slotNodes",void 0),di([e.query(".ft-tooltip--container")],ui.prototype,"container",void 0),di([e.query("slot")],ui.prototype,"target",void 0),di([e.query(".ft-tooltip")],ui.prototype,"tooltip",void 0),di([e.query(".ft-tooltip--content")],ui.prototype,"tooltipContent",void 0),di([e.state()],ui.prototype,"visible",void 0),i.customElement("ft-tooltip")(ui),t.FtTooltip=ui,t.FtTooltipCssVariables=gi,t.styles=ci,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
163
+ `}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),o=(i.height-this.tooltip.clientHeight)/2,e=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=e;break;case"bottom":n=i.height,s=e;break;case"left":n=o,s=-this.tooltip.clientWidth;break;case"right":n=o,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${gi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}ui.elementDefinitions={"ft-typography":yi},ui.styles=ci,di([e.property()],ui.prototype,"text",void 0),di([e.property({type:Boolean})],ui.prototype,"manual",void 0),di([e.property({type:Boolean})],ui.prototype,"inline",void 0),di([e.property({type:Number})],ui.prototype,"delay",void 0),di([e.property()],ui.prototype,"position",void 0),di([e.queryAssignedNodes("",!0)],ui.prototype,"slotNodes",void 0),di([e.query(".ft-tooltip--container")],ui.prototype,"container",void 0),di([e.query("slot")],ui.prototype,"target",void 0),di([e.query(".ft-tooltip")],ui.prototype,"tooltip",void 0),di([e.query(".ft-tooltip--content")],ui.prototype,"tooltipContent",void 0),di([e.state()],ui.prototype,"visible",void 0),i.customElement("ft-tooltip")(ui),t.FtTooltip=ui,t.FtTooltipCssVariables=gi,t.styles=ci,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
16
16
  */
17
- if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,n=new WeakMap,s=new WeakMap,r=new WeakMap,a=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,n){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=n.prototype.attributeChangedCallback,l=new Set(n.observedAttributes||[]);u(n,l,a);const h={elementClass:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,h),this._definitionsByClass.set(n,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(n,h),h.standInClass=c);const f=this._awaitingUpgrade.get(t);if(f){this._awaitingUpgrade.delete(t);for(const t of f)s.delete(t),d(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(n),this._whenDefinedPromises.delete(t)),n}upgrade(){v.push(this),o.upgrade.apply(o,arguments),v.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=l;if(i)return l=void 0,i;const e=r.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),n.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=v[v.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(i)||(i=a.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const o=c(e)||window.customElements,n=o._getDefinition(i);return n?d(e,n):s.set(e,o),e}connectedCallback(){const t=n.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=n.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){n.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=n.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=n.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=n.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=n.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},u=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,n){const s=t.toLowerCase();if(i.has(s)){const t=this.getAttribute(s);o.call(this,s,n),e.call(this,s,t,n)}else o.call(this,s,n)});const n=t.prototype.removeAttribute;n&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);n.call(this,o),e.call(this,o,t,null)}else n.call(this,o)})},f=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):f(e)},d=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),n.set(t,i),l=t;try{new i.elementClass}catch(t){f(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let v=[document];const g=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){v.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&a.set(t,this),v.pop(),t}};g(ShadowRoot,"createElement",document),g(ShadowRoot,"importNode",document),g(Element,"insertAdjacentHTML");const b=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){v.push(this),e.set.call(this,t),v.pop()}})};if(b(Element,"innerHTML"),b(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==n.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class s{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),n=i.get(o)||[];this[+e]=t,n.push(t),i.set(o,n)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=n.get(e);t&&!0!==t.formAssociated||i.push(e)}return new s(i)}})}}try{window.customElements.define("custom-element",null)}catch(bt){const t=window.customElements.define;window.customElements.define=(i,e,o)=>{try{t.bind(window.customElements)(i,e,o)}catch(t){console.info(i,e,o,t)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){return this.callbacks=[t],this.debounce(i)}queue(t,i){return this.callbacks.push(t),this.debounce(i)}cancel(){this.clearTimeout(),this.reject()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,i)=>{this.resolvePromise=t,this.rejectPromise=i}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,i;const e=[...this.callbacks];this.callbacks=[];const o=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,n=null!==(i=this.resolvePromise)&&void 0!==i?i:()=>null;this.clearPromise();for(let t of e)try{await t()}catch(t){o(t)}n()}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}reject(){this.rejectPromise&&(this.rejectPromise(),this.clearPromise())}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
17
+ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,n=new WeakMap,s=new WeakMap,r=new WeakMap,a=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,n){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=n.prototype.attributeChangedCallback,l=new Set(n.observedAttributes||[]);u(n,l,a);const h={elementClass:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,h),this._definitionsByClass.set(n,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(n,h),h.standInClass=c);const f=this._awaitingUpgrade.get(t);if(f){this._awaitingUpgrade.delete(t);for(const t of f)s.delete(t),d(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(n),this._whenDefinedPromises.delete(t)),n}upgrade(){v.push(this),o.upgrade.apply(o,arguments),v.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=l;if(i)return l=void 0,i;const e=r.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),n.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=v[v.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(i)||(i=a.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const o=c(e)||window.customElements,n=o._getDefinition(i);return n?d(e,n):s.set(e,o),e}connectedCallback(){const t=n.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=n.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){n.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=n.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=n.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=n.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=n.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},u=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,n){const s=t.toLowerCase();if(i.has(s)){const t=this.getAttribute(s);o.call(this,s,n),e.call(this,s,t,n)}else o.call(this,s,n)});const n=t.prototype.removeAttribute;n&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);n.call(this,o),e.call(this,o,t,null)}else n.call(this,o)})},f=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):f(e)},d=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),n.set(t,i),l=t;try{new i.elementClass}catch(t){f(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let v=[document];const g=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){v.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&a.set(t,this),v.pop(),t}};g(ShadowRoot,"createElement",document),g(ShadowRoot,"importNode",document),g(Element,"insertAdjacentHTML");const b=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){v.push(this),e.set.call(this,t),v.pop()}})};if(b(Element,"innerHTML"),b(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==n.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class s{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),n=i.get(o)||[];this[+e]=t,n.push(t),i.set(o,n)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=n.get(e);t&&!0!==t.formAssociated||i.push(e)}return new s(i)}})}}try{window.customElements.define("custom-element",null)}catch(bt){const t=window.customElements.define;window.customElements.define=(i,e,o)=>{try{t.bind(window.customElements)(i,e,o)}catch(t){console.info(i,e,o,t)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){return this.callbacks=[t],this.debounce(i)}queue(t,i){return this.callbacks.push(t),this.debounce(i)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,i)=>{this.resolvePromise=t,this.rejectPromise=i}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,i;const e=[...this.callbacks];this.callbacks=[];const o=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,n=null!==(i=this.resolvePromise)&&void 0!==i?i:()=>null;this.clearPromise();for(let t of e)try{await t()}catch(t){return void o(t)}n(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
@@ -234,7 +234,7 @@ const bt=Symbol.for(""),mt=t=>{if((null==t?void 0:t.r)===bt)return null==t?void
234
234
  position: relative;
235
235
  word-break: break-word;
236
236
  }
237
- `;var Ji=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class qi extends gt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i,this.revealDebouncer=new i}render(){return I`
237
+ `;var Ji=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class qi extends gt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i,this.revealDebouncer=new i}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return I`
238
238
  <div part="container"
239
239
  class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
240
240
  @mouseenter=${this.onHover}
@@ -242,7 +242,7 @@ const bt=Symbol.for(""),mt=t=>{if((null==t?void 0:t.r)===bt)return null==t?void
242
242
  @focusin=${this.onHover}
243
243
  @focusout=${this.onOut}
244
244
  @touchstart=${this.onTouch}>
245
- <div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
245
+ <div part="tooltip" class="ft-tooltip ft-tooltip--${this.validPosition}" ?hidden=${!this.visible}>
246
246
  <div part="tooltip-content" class="ft-tooltip--content">
247
247
  <slot name="text"></slot>
248
248
  <ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
@@ -250,7 +250,7 @@ const bt=Symbol.for(""),mt=t=>{if((null==t?void 0:t.r)===bt)return null==t?void
250
250
  </div>
251
251
  <slot></slot>
252
252
  </div>
253
- `}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.position){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=0);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${Zi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}qi.elementDefinitions={"ft-typography":Ii},qi.styles=Vi,Ji([o()],qi.prototype,"text",void 0),Ji([o({type:Boolean})],qi.prototype,"manual",void 0),Ji([o({type:Boolean})],qi.prototype,"inline",void 0),Ji([o({type:Number})],qi.prototype,"delay",void 0),Ji([o()],qi.prototype,"position",void 0),Ji([
253
+ `}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.validPosition){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=0);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${Zi.maxWidth})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}qi.elementDefinitions={"ft-typography":Ii},qi.styles=Vi,Ji([o()],qi.prototype,"text",void 0),Ji([o({type:Boolean})],qi.prototype,"manual",void 0),Ji([o({type:Boolean})],qi.prototype,"inline",void 0),Ji([o({type:Number})],qi.prototype,"delay",void 0),Ji([o()],qi.prototype,"position",void 0),Ji([
254
254
  /**
255
255
  * @license
256
256
  * Copyright 2017 Google LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-tooltip",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "A simple tooltip component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,9 +19,9 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-typography": "0.3.31",
23
- "@fluid-topics/ft-wc-utils": "0.3.31",
22
+ "@fluid-topics/ft-typography": "0.3.33",
23
+ "@fluid-topics/ft-wc-utils": "0.3.33",
24
24
  "lit": "2.2.8"
25
25
  },
26
- "gitHead": "65117d677b7174e71b6c695661d333e2a9ac8eae"
26
+ "gitHead": "ba3783b220d3a5d359b452072054ab8210b0b45b"
27
27
  }