@preline/tooltip 2.6.0 → 3.1.0

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.
package/index.d.ts CHANGED
@@ -26,11 +26,11 @@ declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip {
26
26
  private readonly toggle;
27
27
  content: HTMLElement | null;
28
28
  readonly eventMode: string;
29
- private readonly preventPopper;
30
- private popperInstance;
29
+ private readonly preventFloatingUI;
31
30
  private readonly placement;
32
31
  private readonly strategy;
33
32
  private readonly scope;
33
+ cleanupAutoUpdate: (() => void) | null;
34
34
  private onToggleClickListener;
35
35
  private onToggleFocusListener;
36
36
  private onToggleMouseEnterListener;
@@ -47,16 +47,17 @@ declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip {
47
47
  private leave;
48
48
  private click;
49
49
  private focus;
50
- private buildPopper;
50
+ private buildFloatingUI;
51
51
  private _show;
52
52
  show(): void;
53
53
  hide(): void;
54
54
  destroy(): void;
55
+ private static findInCollection;
55
56
  static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSTooltip>;
56
57
  static autoInit(): void;
57
- static show(target: HTMLElement): void;
58
- static hide(target: HTMLElement): void;
59
- static on(evt: string, target: HTMLElement, cb: Function): void;
58
+ static show(target: HSTooltip | HTMLElement | string): void;
59
+ static hide(target: HSTooltip | HTMLElement | string): void;
60
+ static on(evt: string, target: HSTooltip | HTMLElement | string, cb: Function): void;
60
61
  }
61
62
 
62
63
  export {
package/index.js CHANGED
@@ -1,16 +1,16 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(()=>(()=>{"use strict";var e={170:(e,t,n)=>{n.r(t),n.d(t,{afterMain:()=>E,afterRead:()=>w,afterWrite:()=>L,applyStyles:()=>M,arrow:()=>G,auto:()=>a,basePlacements:()=>l,beforeMain:()=>b,beforeRead:()=>m,beforeWrite:()=>O,bottom:()=>r,clippingParents:()=>u,computeStyles:()=>ne,createPopper:()=>Me,createPopperBase:()=>_e,createPopperLite:()=>je,detectOverflow:()=>ye,end:()=>f,eventListeners:()=>re,flip:()=>we,hide:()=>Ee,left:()=>s,main:()=>x,modifierPhases:()=>S,offset:()=>Oe,placements:()=>g,popper:()=>d,popperGenerator:()=>Ae,popperOffsets:()=>Te,preventOverflow:()=>Le,read:()=>y,reference:()=>h,right:()=>i,start:()=>c,top:()=>o,variationPlacements:()=>v,viewport:()=>p,write:()=>T});var o="top",r="bottom",i="right",s="left",a="auto",l=[o,r,i,s],c="start",f="end",u="clippingParents",p="viewport",d="popper",h="reference",v=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+f])}),[]),g=[].concat(l,[a]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+f])}),[]),m="beforeRead",y="read",w="afterRead",b="beforeMain",x="main",E="afterMain",O="beforeWrite",T="write",L="afterWrite",S=[m,y,w,b,x,E,O,T,L];function C(e){return e?(e.nodeName||"").toLowerCase():null}function P(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof P(e).Element||e instanceof Element}function A(e){return e instanceof P(e).HTMLElement||e instanceof HTMLElement}function _(e){return"undefined"!=typeof ShadowRoot&&(e instanceof P(e).ShadowRoot||e instanceof ShadowRoot)}const M={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];A(r)&&C(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});A(o)&&C(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};function j(e){return e.split("-")[0]}var H=Math.max,k=Math.min,D=Math.round;function B(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function R(){return!/^((?!chrome|android).)*safari/i.test(B())}function Y(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&A(e)&&(r=e.offsetWidth>0&&D(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&D(o.height)/e.offsetHeight||1);var s=(I(e)?P(e):window).visualViewport,a=!R()&&n,l=(o.left+(a&&s?s.offsetLeft:0))/r,c=(o.top+(a&&s?s.offsetTop:0))/i,f=o.width/r,u=o.height/i;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l,x:l,y:c}}function W(e){var t=Y(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function V(e){return P(e).getComputedStyle(e)}function q(e){return["table","td","th"].indexOf(C(e))>=0}function F(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function $(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||F(e)}function K(e){return A(e)&&"fixed"!==V(e).position?e.offsetParent:null}function U(e){for(var t=P(e),n=K(e);n&&q(n)&&"static"===V(n).position;)n=K(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===V(n).position)?t:n||function(e){var t=/firefox/i.test(B());if(/Trident/i.test(B())&&A(e)&&"fixed"===V(e).position)return null;var n=$(e);for(_(n)&&(n=n.host);A(n)&&["html","body"].indexOf(C(n))<0;){var o=V(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return H(e,k(t,n))}function J(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,a=e.name,c=e.options,f=n.elements.arrow,u=n.modifiersData.popperOffsets,p=j(n.placement),d=z(p),h=[s,i].indexOf(p)>=0?"height":"width";if(f&&u){var v=function(e,t){return J("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(c.padding,n),g=W(f),m="y"===d?o:s,y="y"===d?r:i,w=n.rects.reference[h]+n.rects.reference[d]-u[d]-n.rects.popper[h],b=u[d]-n.rects.reference[d],x=U(f),E=x?"y"===d?x.clientHeight||0:x.clientWidth||0:0,O=w/2-b/2,T=v[m],L=E-g[h]-v[y],S=E/2-g[h]/2+O,C=X(T,S,L),P=d;n.modifiersData[a]=((t={})[P]=C,t.centerOffset=C-S,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&N(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,a=e.popperRect,l=e.placement,c=e.variation,u=e.offsets,p=e.position,d=e.gpuAcceleration,h=e.adaptive,v=e.roundOffsets,g=e.isFixed,m=u.x,y=void 0===m?0:m,w=u.y,b=void 0===w?0:w,x="function"==typeof v?v({x:y,y:b}):{x:y,y:b};y=x.x,b=x.y;var E=u.hasOwnProperty("x"),O=u.hasOwnProperty("y"),T=s,L=o,S=window;if(h){var C=U(n),I="clientHeight",A="clientWidth";if(C===P(n)&&"static"!==V(C=F(n)).position&&"absolute"===p&&(I="scrollHeight",A="scrollWidth"),l===o||(l===s||l===i)&&c===f)L=r,b-=(g&&C===S&&S.visualViewport?S.visualViewport.height:C[I])-a.height,b*=d?1:-1;if(l===s||(l===o||l===r)&&c===f)T=i,y-=(g&&C===S&&S.visualViewport?S.visualViewport.width:C[A])-a.width,y*=d?1:-1}var _,M=Object.assign({position:p},h&&ee),j=!0===v?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:D(n*r)/r||0,y:D(o*r)/r||0}}({x:y,y:b},P(n)):{x:y,y:b};return y=j.x,b=j.y,d?Object.assign({},M,((_={})[L]=O?"0":"",_[T]=E?"0":"",_.transform=(S.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",_)):Object.assign({},M,((t={})[L]=O?b+"px":"",t[T]=E?y+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:j(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,s=o.resize,a=void 0===s||s,l=P(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),a&&l.addEventListener("resize",n.update,oe),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),a&&l.removeEventListener("resize",n.update,oe)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var ae={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return ae[e]}))}function ce(e){var t=P(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fe(e){return Y(F(e)).left+ce(e).scrollLeft}function ue(e){var t=V(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function pe(e){return["html","body","#document"].indexOf(C(e))>=0?e.ownerDocument.body:A(e)&&ue(e)?e:pe($(e))}function de(e,t){var n;void 0===t&&(t=[]);var o=pe(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=P(o),s=r?[i].concat(i.visualViewport||[],ue(o)?o:[]):o,a=t.concat(s);return r?a:a.concat(de($(s)))}function he(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t,n){return t===p?he(function(e,t){var n=P(e),o=F(e),r=n.visualViewport,i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;var c=R();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a+fe(e),y:l}}(e,n)):I(t)?function(e,t){var n=Y(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):he(function(e){var t,n=F(e),o=ce(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=H(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=H(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+fe(e),l=-o.scrollTop;return"rtl"===V(r||n).direction&&(a+=H(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(F(e)))}function ge(e,t,n,o){var r="clippingParents"===t?function(e){var t=de($(e)),n=["absolute","fixed"].indexOf(V(e).position)>=0&&A(e)?U(e):e;return I(n)?t.filter((function(e){return I(e)&&N(e,n)&&"body"!==C(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),s=i[0],a=i.reduce((function(t,n){var r=ve(e,n,o);return t.top=H(r.top,t.top),t.right=k(r.right,t.right),t.bottom=k(r.bottom,t.bottom),t.left=H(r.left,t.left),t}),ve(e,s,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function me(e){var t,n=e.reference,a=e.element,l=e.placement,u=l?j(l):null,p=l?Q(l):null,d=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2;switch(u){case o:t={x:d,y:n.y-a.height};break;case r:t={x:d,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:h};break;case s:t={x:n.x-a.width,y:h};break;default:t={x:n.x,y:n.y}}var v=u?z(u):null;if(null!=v){var g="y"===v?"height":"width";switch(p){case c:t[v]=t[v]-(n[g]/2-a[g]/2);break;case f:t[v]=t[v]+(n[g]/2-a[g]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,s=n.placement,a=void 0===s?e.placement:s,c=n.strategy,f=void 0===c?e.strategy:c,v=n.boundary,g=void 0===v?u:v,m=n.rootBoundary,y=void 0===m?p:m,w=n.elementContext,b=void 0===w?d:w,x=n.altBoundary,E=void 0!==x&&x,O=n.padding,T=void 0===O?0:O,L=J("number"!=typeof T?T:Z(T,l)),S=b===d?h:d,C=e.rects.popper,P=e.elements[E?S:b],A=ge(I(P)?P:P.contextElement||F(e.elements.popper),g,y,f),_=Y(e.elements.reference),M=me({reference:_,element:C,strategy:"absolute",placement:a}),j=he(Object.assign({},C,M)),H=b===d?j:_,k={top:A.top-H.top+L.top,bottom:H.bottom-A.bottom+L.bottom,left:A.left-H.left+L.left,right:H.right-A.right+L.right},D=e.modifiersData.offset;if(b===d&&D){var B=D[a];Object.keys(k).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[o,r].indexOf(e)>=0?"y":"x";k[e]+=B[n]*t}))}return k}const we={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,f=e.name;if(!t.modifiersData[f]._skip){for(var u=n.mainAxis,p=void 0===u||u,d=n.altAxis,h=void 0===d||d,m=n.fallbackPlacements,y=n.padding,w=n.boundary,b=n.rootBoundary,x=n.altBoundary,E=n.flipVariations,O=void 0===E||E,T=n.allowedAutoPlacements,L=t.options.placement,S=j(L),C=m||(S===L||!O?[se(L)]:function(e){if(j(e)===a)return[];var t=se(e);return[le(e),t,le(t)]}(L)),P=[L].concat(C).reduce((function(e,n){return e.concat(j(n)===a?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,f=void 0===c?g:c,u=Q(o),p=u?a?v:v.filter((function(e){return Q(e)===u})):l,d=p.filter((function(e){return f.indexOf(e)>=0}));0===d.length&&(d=p);var h=d.reduce((function(t,n){return t[n]=ye(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[j(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:w,rootBoundary:b,padding:y,flipVariations:O,allowedAutoPlacements:T}):n)}),[]),I=t.rects.reference,A=t.rects.popper,_=new Map,M=!0,H=P[0],k=0;k<P.length;k++){var D=P[k],B=j(D),R=Q(D)===c,Y=[o,r].indexOf(B)>=0,W=Y?"width":"height",N=ye(t,{placement:D,boundary:w,rootBoundary:b,altBoundary:x,padding:y}),V=Y?R?i:s:R?r:o;I[W]>A[W]&&(V=se(V));var q=se(V),F=[];if(p&&F.push(N[B]<=0),h&&F.push(N[V]<=0,N[q]<=0),F.every((function(e){return e}))){H=D,M=!1;break}_.set(D,F)}if(M)for(var $=function(e){var t=P.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return H=t,"break"},K=O?3:1;K>0;K--){if("break"===$(K))break}t.placement!==H&&(t.modifiersData[f]._skip=!0,t.placement=H,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[o,i,r,s].some((function(t){return e[t]>=0}))}const Ee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=ye(t,{elementContext:"reference"}),a=ye(t,{altBoundary:!0}),l=be(s,o),c=be(a,r,i),f=xe(l),u=xe(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":u})}};const Oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,l=void 0===a?[0,0]:a,c=g.reduce((function(e,n){return e[n]=function(e,t,n){var r=j(e),a=[s,o].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],f=l[1];return c=c||0,f=(f||0)*a,[s,i].indexOf(r)>=0?{x:f,y:c}:{x:c,y:f}}(n,t.rects,l),e}),{}),f=c[t.placement],u=f.x,p=f.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}};const Te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=me({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Le={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,a=e.name,l=n.mainAxis,f=void 0===l||l,u=n.altAxis,p=void 0!==u&&u,d=n.boundary,h=n.rootBoundary,v=n.altBoundary,g=n.padding,m=n.tether,y=void 0===m||m,w=n.tetherOffset,b=void 0===w?0:w,x=ye(t,{boundary:d,rootBoundary:h,padding:g,altBoundary:v}),E=j(t.placement),O=Q(t.placement),T=!O,L=z(E),S="x"===L?"y":"x",C=t.modifiersData.popperOffsets,P=t.rects.reference,I=t.rects.popper,A="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,_="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(C){if(f){var B,R="y"===L?o:s,Y="y"===L?r:i,N="y"===L?"height":"width",V=C[L],q=V+x[R],F=V-x[Y],$=y?-I[N]/2:0,K=O===c?P[N]:I[N],J=O===c?-I[N]:-P[N],Z=t.elements.arrow,G=y&&Z?W(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[R],ne=ee[Y],oe=X(0,P[N],G[N]),re=T?P[N]/2-$-oe-te-_.mainAxis:K-oe-te-_.mainAxis,ie=T?-P[N]/2+$+oe+ne+_.mainAxis:J+oe+ne+_.mainAxis,se=t.elements.arrow&&U(t.elements.arrow),ae=se?"y"===L?se.clientTop||0:se.clientLeft||0:0,le=null!=(B=null==M?void 0:M[L])?B:0,ce=V+ie-le,fe=X(y?k(q,V+re-le-ae):q,V,y?H(F,ce):F);C[L]=fe,D[L]=fe-V}if(p){var ue,pe="x"===L?o:s,de="x"===L?r:i,he=C[S],ve="y"===S?"height":"width",ge=he+x[pe],me=he-x[de],we=-1!==[o,s].indexOf(E),be=null!=(ue=null==M?void 0:M[S])?ue:0,xe=we?ge:he-P[ve]-I[ve]-be+_.altAxis,Ee=we?he+P[ve]+I[ve]-be-_.altAxis:me,Oe=y&&we?function(e,t,n){var o=X(e,t,n);return o>n?n:o}(xe,he,Ee):X(y?xe:ge,he,y?Ee:me);C[S]=Oe,D[S]=Oe-he}t.modifiersData[a]=D}},requiresIfExists:["offset"]};function Se(e,t,n){void 0===n&&(n=!1);var o,r,i=A(t),s=A(t)&&function(e){var t=e.getBoundingClientRect(),n=D(t.width)/e.offsetWidth||1,o=D(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),a=F(t),l=Y(e,s,n),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(i||!i&&!n)&&(("body"!==C(t)||ue(a))&&(c=(o=t)!==P(o)&&A(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:ce(o)),A(t)?((f=Y(t,!0)).x+=t.clientLeft,f.y+=t.clientTop):a&&(f.x=fe(a))),{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}function Ce(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var Pe={placement:"bottom",modifiers:[],strategy:"absolute"};function Ie(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Ae(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?Pe:r;return function(e,t,n){void 0===n&&(n=i);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Pe,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,f={state:a,setOptions:function(n){var r="function"==typeof n?n(a.options):n;u(),a.options=Object.assign({},i,a.options,r),a.scrollParents={reference:I(e)?de(e):e.contextElement?de(e.contextElement):[],popper:de(t)};var s,c,p=function(e){var t=Ce(e);return S.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,a.options.modifiers),c=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return a.orderedModifiers=p.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,r=e.effect;if("function"==typeof r){var i=r({state:a,name:t,instance:f,options:o}),s=function(){};l.push(i||s)}})),f.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(Ie(t,n)){a.rects={reference:Se(t,U(n),"fixed"===a.options.strategy),popper:W(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var o=0;o<a.orderedModifiers.length;o++)if(!0!==a.reset){var r=a.orderedModifiers[o],i=r.fn,s=r.options,l=void 0===s?{}:s,u=r.name;"function"==typeof i&&(a=i({state:a,options:l,name:u,instance:f})||a)}else a.reset=!1,o=-1}}},update:(r=function(){return new Promise((function(e){f.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(r())}))}))),s}),destroy:function(){u(),c=!0}};if(!Ie(e,t))return f;function u(){l.forEach((function(e){return e()})),l=[]}return f.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),f}}var _e=Ae(),Me=Ae({defaultModifiers:[re,Te,ne,M,Oe,we,Le,G,Ee]}),je=Ae({defaultModifiers:[re,Te,ne,M]})},223:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},961:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}return e.prototype.createCollection=function(e,t){var n;e.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||e.length+1,element:t})},e.prototype.fireEvent=function(e,t){if(void 0===t&&(t=null),this.events.hasOwnProperty(e))return this.events[e](t)},e.prototype.on=function(e,t){this.events[e]=t},e}();t.default=n},969:function(e,t,n){
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={223:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},292:function(t,e){
2
2
  /*
3
- * HSTooltip
4
- * @version: 2.6.0
3
+ * @version: 3.1.0
5
4
  * @author: Preline Labs Ltd.
6
5
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
6
  * Copyright 2024 Preline Labs Ltd.
8
7
  */
9
- var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n(170),c=n(292),f=a(n(961)),u=n(223),p=function(e){function t(t,n,o){var r=e.call(this,t,n,o)||this;return r.el&&(r.toggle=r.el.querySelector(".hs-tooltip-toggle")||r.el,r.content=r.el.querySelector(".hs-tooltip-content"),r.eventMode=(0,c.getClassProperty)(r.el,"--trigger")||"hover",r.preventPopper=(0,c.getClassProperty)(r.el,"--prevent-popper","false"),r.placement=(0,c.getClassProperty)(r.el,"--placement"),r.strategy=(0,c.getClassProperty)(r.el,"--strategy"),r.scope=(0,c.getClassProperty)(r.el,"--scope")||"parent"),r.el&&r.toggle&&r.content&&r.init(),r}return r(t,e),t.prototype.toggleClick=function(){this.click()},t.prototype.toggleFocus=function(){this.focus()},t.prototype.toggleMouseEnter=function(){this.enter()},t.prototype.toggleMouseLeave=function(){this.leave()},t.prototype.toggleHandle=function(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)},t.prototype.init=function(){var e=this;this.createCollection(window.$hsTooltipCollection,this),"click"===this.eventMode?(this.onToggleClickListener=function(){return e.toggleClick()},this.toggle.addEventListener("click",this.onToggleClickListener)):"focus"===this.eventMode?(this.onToggleFocusListener=function(){return e.toggleFocus()},this.toggle.addEventListener("click",this.onToggleFocusListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=function(){return e.toggleMouseEnter()},this.onToggleMouseLeaveListener=function(){return e.toggleMouseLeave()},this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener)),"false"===this.preventPopper&&this.buildPopper()},t.prototype.enter=function(){this._show()},t.prototype.leave=function(){this.hide()},t.prototype.click=function(){var e=this;if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=function(){setTimeout((function(){return e.toggleHandle()}))},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)},t.prototype.focus=function(){var e=this;this._show();var t=function(){e.hide(),e.toggle.removeEventListener("blur",t,!0)};this.toggle.addEventListener("blur",t,!0)},t.prototype.buildPopper=function(){"window"===this.scope&&document.body.appendChild(this.content),this.popperInstance=(0,l.createPopper)(this.toggle,this.content,{placement:u.POSITIONS[this.placement]||"top",strategy:this.strategy||"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]})},t.prototype._show=function(){var e=this;this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"===this.preventPopper&&(this.popperInstance.setOptions((function(e){return i(i({},e),{modifiers:s(s([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})})),this.popperInstance.update()),setTimeout((function(){e.el.classList.add("show"),e.fireEvent("show",e.el),(0,c.dispatch)("show.hs.tooltip",e.el,e.el)}))},t.prototype.show=function(){switch(this.eventMode){case"click":this.click();break;case"focus":this.focus();break;default:this.enter()}this.toggle.focus(),this.toggle.style.outline="none"},t.prototype.hide=function(){var e=this;this.el.classList.remove("show"),"window"===this.scope&&this.content.classList.remove("show"),"false"===this.preventPopper&&this.popperInstance.setOptions((function(e){return i(i({},e),{modifiers:s(s([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})})),this.fireEvent("hide",this.el),(0,c.dispatch)("hide.hs.tooltip",this.el,this.el),(0,c.afterTransition)(this.content,(function(){if(e.el.classList.contains("show"))return!1;e.content.classList.add("hidden"),e.toggle.style.outline=""}))},t.prototype.destroy=function(){var e=this;this.el.classList.remove("show"),this.content.classList.add("hidden"),"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"focus"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleFocusListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.popperInstance.destroy(),this.popperInstance=null,window.$hsTooltipCollection=window.$hsTooltipCollection.filter((function(t){return t.element.el!==e.el}))},t.getInstance=function(e,t){void 0===t&&(t=!1);var n=window.$hsTooltipCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));return n?t?n:n.element.el:null},t.autoInit=function(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter((function(e){var t=e.element;return document.contains(t.el)}))),document.querySelectorAll(".hs-tooltip").forEach((function(e){window.$hsTooltipCollection.find((function(t){var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new t(e)}))},t.show=function(e){var t=window.$hsTooltipCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&t.element.show()},t.hide=function(e){var t=window.$hsTooltipCollection.find((function(t){return t.element.el===("string"==typeof e?document.querySelector(e):e)}));t&&t.element.hide()},t.on=function(e,t,n){var o=window.$hsTooltipCollection.find((function(e){return e.element.el===("string"==typeof t?document.querySelector(t):t)}));o&&(o.element.events[e]=n)},t}(f.default);window.addEventListener("load",(function(){p.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=p),t.default=p},292:function(e,t){
8
+ Object.defineProperty(e,"__esModule",{value:!0}),e.menuSearchHistory=e.classToClassList=e.htmlToElement=e.afterTransition=e.dispatch=e.debounce=e.isScrollable=e.isParentOrElementHidden=e.isJson=e.isIpadOS=e.isIOS=e.isDirectChild=e.isFormElement=e.isFocused=e.isEnoughSpace=e.getHighestZIndex=e.getZIndex=e.getClassPropertyAlt=e.getClassProperty=e.stringToBoolean=void 0;e.stringToBoolean=t=>"true"===t;e.getClassProperty=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","");e.getClassPropertyAlt=(t,e,n="")=>{let o="";return t.classList.forEach((t=>{t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=t=>window.getComputedStyle(t).getPropertyValue("z-index");e.getZIndex=n;e.getHighestZIndex=t=>{let e=Number.NEGATIVE_INFINITY;return t.forEach((t=>{let o=n(t);"auto"!==o&&(o=parseInt(o,10),o>e&&(e=o))})),e};e.isDirectChild=(t,e)=>{const n=t.children;for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return!1};e.isEnoughSpace=(t,e,n="auto",o=10,i=null)=>{const r=e.getBoundingClientRect(),l=i?i.getBoundingClientRect():null,s=window.innerHeight,c=l?r.top-l.top:r.top,a=(i?l.bottom:s)-r.bottom,f=t.clientHeight+o;return"bottom"===n?a>=f:"top"===n?c>=f:c>=f||a>=f};e.isFocused=t=>document.activeElement===t;e.isFormElement=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement;e.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isJson=t=>{if("string"!=typeof t)return!1;const e=t.trim()[0],n=t.trim().slice(-1);if("{"===e&&"}"===n||"["===e&&"]"===n)try{return JSON.parse(t),!0}catch(t){return!1}return!1};const o=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||o(t.parentElement)};e.isParentOrElementHidden=o;e.isScrollable=t=>{const e=window.getComputedStyle(t),n=e.overflowY,o=e.overflowX,i=("scroll"===n||"auto"===n)&&t.scrollHeight>t.clientHeight,r=("scroll"===o||"auto"===o)&&t.scrollWidth>t.clientWidth;return i||r};e.debounce=(t,e=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout((()=>{t.apply(this,o)}),e)}};e.dispatch=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)};e.afterTransition=(t,e)=>{const n=()=>{e(),t.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(t),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=(t,e,n=" ",o="add")=>{t.split(n).forEach((t=>"add"===o?e.classList.add(t):e.classList.remove(t)))};const i={historyIndex:-1,addHistory(t){this.historyIndex=t},existsInHistory(t){return t>this.historyIndex},clearHistory(){this.historyIndex=-1}};e.menuSearchHistory=i},949:(t,e,n)=>{n.r(e),n.d(e,{arrow:()=>bt,autoPlacement:()=>mt,autoUpdate:()=>dt,computePosition:()=>Lt,detectOverflow:()=>gt,flip:()=>yt,getOverflowAncestors:()=>X,hide:()=>xt,inline:()=>Et,limitShift:()=>Tt,offset:()=>pt,platform:()=>ut,shift:()=>wt,size:()=>vt});const o=["top","right","bottom","left"],i=["start","end"],r=o.reduce(((t,e)=>t.concat(e,e+"-"+i[0],e+"-"+i[1])),[]),l=Math.min,s=Math.max,c=Math.round,a=Math.floor,f=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},h={start:"end",end:"start"};function d(t,e,n){return s(t,l(e,n))}function g(t,e){return"function"==typeof t?t(e):t}function p(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function w(t){return"x"===t?"y":"x"}function y(t){return"y"===t?"height":"width"}function v(t){return["top","bottom"].includes(p(t))?"y":"x"}function x(t){return w(v(t))}function b(t,e,n){void 0===n&&(n=!1);const o=m(t),i=x(t),r=y(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=T(l)),[l,T(l)]}function E(t){return t.replace(/start|end/g,(t=>h[t]))}function T(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}function L(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function C(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function S(t,e,n){let{reference:o,floating:i}=t;const r=v(e),l=x(e),s=y(l),c=p(e),a="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let d;switch(c){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(m(e)){case"start":d[l]-=h*(n&&a?-1:1);break;case"end":d[l]+=h*(n&&a?-1:1)}return d}async function A(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=g(e,t),p=L(d),m=s[h?"floating"===u?"reference":"floating":u],w=C(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:a,rootBoundary:f,strategy:c})),y="floating"===u?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),x=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},b=C(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:c}):y);return{top:(w.top-b.top+p.top)/x.y,bottom:(b.bottom-w.bottom+p.bottom)/x.y,left:(w.left-b.left+p.left)/x.x,right:(b.right-w.right+p.right)/x.x}}function I(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function O(t){return o.some((e=>t[e]>=0))}function P(t){const e=l(...t.map((t=>t.left))),n=l(...t.map((t=>t.top)));return{x:e,y:n,width:s(...t.map((t=>t.right)))-e,height:s(...t.map((t=>t.bottom)))-n}}function R(){return"undefined"!=typeof window}function _(t){return B(t)?(t.nodeName||"").toLowerCase():"#document"}function H(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function M(t){var e;return null==(e=(B(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function B(t){return!!R()&&(t instanceof Node||t instanceof H(t).Node)}function D(t){return!!R()&&(t instanceof Element||t instanceof H(t).Element)}function k(t){return!!R()&&(t instanceof HTMLElement||t instanceof H(t).HTMLElement)}function F(t){return!(!R()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof H(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=j(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function U(t){return["table","td","th"].includes(_(t))}function N(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function W(t){const e=$(),n=D(t)?j(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function $(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(_(t))}function j(t){return H(t).getComputedStyle(t)}function K(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if("html"===_(t))return t;const e=t.assignedSlot||t.parentNode||F(t)&&t.host||M(t);return F(e)?e.host:e}function q(t){const e=z(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:k(e)&&Y(e)?e:q(e)}function X(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=q(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=H(i);if(r){const t=Z(l);return e.concat(l,l.visualViewport||[],Y(i)?i:[],t&&n?X(t):[])}return e.concat(i,X(i,[],n))}function Z(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J(t){const e=j(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=k(t),r=i?t.offsetWidth:n,l=i?t.offsetHeight:o,s=c(n)!==r||c(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function G(t){return D(t)?t:t.contextElement}function Q(t){const e=G(t);if(!k(e))return f(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=J(e);let l=(r?c(n.width):n.width)/o,s=(r?c(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const tt=f(0);function et(t){const e=H(t);return $()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:tt}function nt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=G(t);let l=f(1);e&&(o?D(o)&&(l=Q(o)):l=Q(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==H(t))&&e}(r,n,o)?et(r):f(0);let c=(i.left+s.x)/l.x,a=(i.top+s.y)/l.y,u=i.width/l.x,h=i.height/l.y;if(r){const t=H(r),e=o&&D(o)?H(o):o;let n=t,i=Z(n);for(;i&&o&&e!==n;){const t=Q(i),e=i.getBoundingClientRect(),o=j(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,a*=t.y,u*=t.x,h*=t.y,c+=r,a+=l,n=H(i),i=Z(n)}}return C({width:u,height:h,x:c,y:a})}function ot(t,e){const n=K(t).scrollLeft;return e?e.left+n:nt(M(t)).left+n}function it(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:ot(t,o)),y:o.top+e.scrollTop}}function rt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=H(t),o=M(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,c=0;if(i){r=i.width,l=i.height;const t=$();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:r,height:l,x:s,y:c}}(t,n);else if("document"===e)o=function(t){const e=M(t),n=K(t),o=t.ownerDocument.body,i=s(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=s(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+ot(t);const c=-n.scrollTop;return"rtl"===j(o).direction&&(l+=s(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:c}}(M(t));else if(D(e))o=function(t,e){const n=nt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=k(t)?Q(t):f(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return C(o)}function lt(t,e){const n=z(t);return!(n===e||!D(n)||V(n))&&("fixed"===j(n).position||lt(n,e))}function st(t,e,n){const o=k(e),i=M(e),r="fixed"===n,l=nt(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const c=f(0);if(o||!o&&!r)if(("body"!==_(e)||Y(i))&&(s=K(e)),o){const t=nt(e,!0,r,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&(c.x=ot(i));const a=!i||o||r?f(0):it(i,s);return{x:l.left+s.scrollLeft-c.x-a.x,y:l.top+s.scrollTop-c.y-a.y,width:l.width,height:l.height}}function ct(t){return"static"===j(t).position}function at(t,e){if(!k(t)||"fixed"===j(t).position)return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function ft(t,e){const n=H(t);if(N(t))return n;if(!k(t)){let e=z(t);for(;e&&!V(e);){if(D(e)&&!ct(e))return e;e=z(e)}return n}let o=at(t,e);for(;o&&U(o)&&ct(o);)o=at(o,e);return o&&V(o)&&ct(o)&&!W(o)?n:o||function(t){let e=z(t);for(;k(e)&&!V(e);){if(W(e))return e;if(N(e))return null;e=z(e)}return null}(t)||n}const ut={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=M(o),s=!!e&&N(e.floating);if(o===l||s&&r)return n;let c={scrollLeft:0,scrollTop:0},a=f(1);const u=f(0),h=k(o);if((h||!h&&!r)&&(("body"!==_(o)||Y(l))&&(c=K(o)),k(o))){const t=nt(o);a=Q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!l||h||r?f(0):it(l,c,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}},getDocumentElement:M,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?N(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=X(t,[],!1).filter((t=>D(t)&&"body"!==_(t))),i=null;const r="fixed"===j(t).position;let l=r?z(t):t;for(;D(l)&&!V(l);){const e=j(l),n=W(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||Y(l)&&!n&&lt(t,l))?o=o.filter((t=>t!==l)):i=e,l=z(l)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=r[0],a=r.reduce(((t,n)=>{const o=rt(e,n,i);return t.top=s(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),rt(e,c,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ft,getElementRects:async function(t){const e=this.getOffsetParent||ft,n=this.getDimensions,o=await n(t.floating);return{reference:st(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=J(t);return{width:e,height:n}},getScale:Q,isElement:D,isRTL:function(t){return"rtl"===j(t).direction}};function ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,h=G(t),d=i||r?[...h?X(h):[],...X(e)]:[];d.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const g=h&&f?function(t,e){let n,o=null;const i=M(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function c(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),r();const h=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=h;if(f||e(),!p||!m)return;const w={rootMargin:-a(g)+"px "+-a(i.clientWidth-(d+p))+"px "+-a(i.clientHeight-(g+m))+"px "+-a(d)+"px",threshold:s(0,l(1,u))||1};let y=!0;function v(e){const o=e[0].intersectionRatio;if(o!==u){if(!y)return c();o?c(!1,o):n=setTimeout((()=>{c(!1,1e-7)}),1e3)}1!==o||ht(h,t.getBoundingClientRect())||c(),y=!1}try{o=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(v,w)}o.observe(t)}(!0),r}(h,n):null;let p,m=-1,w=null;c&&(w=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(e)}))),n()})),h&&!u&&w.observe(h),w.observe(e));let y=u?nt(t):null;return u&&function e(){const o=nt(t);y&&!ht(y,o)&&n();y=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==g||g(),null==(t=w)||t.disconnect(),w=null,u&&cancelAnimationFrame(p)}}const gt=A,pt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=p(n),s=m(n),c="y"===v(n),a=["left","top"].includes(l)?-1:1,f=r&&c?-1:1,u=g(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:w}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof w&&(d="end"===s?-1*w:w),c?{x:d*f,y:h*a}:{x:h*a,y:d*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:l}}}}},mt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:s,placement:c,platform:a,elements:f}=e,{crossAxis:u=!1,alignment:h,allowedPlacements:d=r,autoAlignment:w=!0,...y}=g(t,e),v=void 0!==h||d===r?function(t,e,n){return(t?[...n.filter((e=>m(e)===t)),...n.filter((e=>m(e)!==t))]:n.filter((t=>p(t)===t))).filter((n=>!t||m(n)===t||!!e&&E(n)!==n))}(h||null,w,d):d,x=await A(e,y),T=(null==(n=s.autoPlacement)?void 0:n.index)||0,L=v[T];if(null==L)return{};const C=b(L,l,await(null==a.isRTL?void 0:a.isRTL(f.floating)));if(c!==L)return{reset:{placement:v[0]}};const S=[x[p(L)],x[C[0]],x[C[1]]],I=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:S}],O=v[T+1];if(O)return{data:{index:T+1,overflows:I},reset:{placement:O}};const P=I.map((t=>{const e=m(t.placement);return[t.placement,e&&u?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),R=(null==(i=P.filter((t=>t[2].slice(0,m(t[0])?2:3).every((t=>t<=0))))[0])?void 0:i[0])||P[0][0];return R!==c?{data:{index:T+1,overflows:I},reset:{placement:R}}:{}}}},wt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=g(t,e),a={x:n,y:o},f=await A(e,c),u=v(p(i)),h=w(u);let m=a[h],y=a[u];if(r){const t="y"===h?"bottom":"right";m=d(m+f["y"===h?"top":"left"],m,m-f[t])}if(l){const t="y"===u?"bottom":"right";y=d(y+f["y"===u?"top":"left"],y,y-f[t])}const x=s.fn({...e,[h]:m,[u]:y});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[h]:r,[u]:l}}}}}},yt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...x}=g(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=p(i),C=v(s),S=p(s)===s,I=await(null==c.isRTL?void 0:c.isRTL(a.floating)),O=h||(S||!y?[T(s)]:function(t){const e=T(t);return[E(t),e,E(e)]}(s)),P="none"!==w;!h&&P&&O.push(...function(t,e,n,o){const i=m(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:l;default:return[]}}(p(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,y,w,I));const R=[s,...O],_=await A(e,x),H=[];let M=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&H.push(_[L]),u){const t=b(i,l,I);H.push(_[t[0]],_[t[1]])}if(M=[...M,{placement:i,overflows:H}],!H.every((t=>t<=0))){var B,D;const t=((null==(B=r.flip)?void 0:B.index)||0)+1,e=R[t];if(e)return{data:{index:t,overflows:M},reset:{placement:e}};let n=null==(D=M.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(d){case"bestFit":{var k;const t=null==(k=M.filter((t=>{if(P){const e=v(t.placement);return e===C||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},vt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:c,elements:a}=e,{apply:f=()=>{},...u}=g(t,e),h=await A(e,u),d=p(i),w=m(i),y="y"===v(i),{width:x,height:b}=r.floating;let E,T;"top"===d||"bottom"===d?(E=d,T=w===(await(null==c.isRTL?void 0:c.isRTL(a.floating))?"start":"end")?"left":"right"):(T=d,E="end"===w?"top":"bottom");const L=b-h.top-h.bottom,C=x-h.left-h.right,S=l(b-h[E],L),I=l(x-h[T],C),O=!e.middlewareData.shift;let P=S,R=I;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(R=C),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(P=L),O&&!w){const t=s(h.left,0),e=s(h.right,0),n=s(h.top,0),o=s(h.bottom,0);y?R=x-2*(0!==t||0!==e?t+e:s(h.left,h.right)):P=b-2*(0!==n||0!==o?n+o:s(h.top,h.bottom))}await f({...e,availableWidth:R,availableHeight:P});const _=await c.getDimensions(a.floating);return x!==_.width||b!==_.height?{reset:{rects:!0}}:{}}}},xt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=g(t,e);switch(o){case"referenceHidden":{const t=I(await A(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:O(t)}}}case"escaped":{const t=I(await A(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:O(t)}}}default:return{}}}}},bt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:a}=e,{element:f,padding:u=0}=g(t,e)||{};if(null==f)return{};const h=L(u),p={x:n,y:o},w=x(i),v=y(w),b=await s.getDimensions(f),E="y"===w,T=E?"top":"left",C=E?"bottom":"right",S=E?"clientHeight":"clientWidth",A=r.reference[v]+r.reference[w]-p[w]-r.floating[v],I=p[w]-r.reference[w],O=await(null==s.getOffsetParent?void 0:s.getOffsetParent(f));let P=O?O[S]:0;P&&await(null==s.isElement?void 0:s.isElement(O))||(P=c.floating[S]||r.floating[v]);const R=A/2-I/2,_=P/2-b[v]/2-1,H=l(h[T],_),M=l(h[C],_),B=H,D=P-b[v]-M,k=P/2-b[v]/2+R,F=d(B,k,D),Y=!a.arrow&&null!=m(i)&&k!==F&&r.reference[v]/2-(k<B?H:M)-b[v]/2<0,U=Y?k<B?k-B:k-D:0;return{[w]:p[w]+U,data:{[w]:F,centerOffset:k-F-U,...Y&&{alignmentOffset:U}},reset:Y}}}),Et=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:c}=e,{padding:a=2,x:f,y:u}=g(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),d=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map((t=>C(P(t))))}(h),m=C(P(h)),w=L(a);const y=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=f&&null!=u)return d.find((t=>f>t.left-w.left&&f<t.right+w.right&&u>t.top-w.top&&u<t.bottom+w.bottom))||m;if(d.length>=2){if("y"===v(n)){const t=d[0],e=d[d.length-1],o="top"===p(n),i=t.top,r=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:i,bottom:r,left:l,right:s,width:s-l,height:r-i,x:l,y:i}}const t="left"===p(n),e=s(...d.map((t=>t.right))),o=l(...d.map((t=>t.left))),i=d.filter((n=>t?n.left===o:n.right===e)),r=i[0].top,c=i[i.length-1].bottom;return{top:r,bottom:c,left:o,right:e,width:e-o,height:c-r,x:o,y:r}}return m}},floating:o.floating,strategy:c});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},Tt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=e,{offset:s=0,mainAxis:c=!0,crossAxis:a=!0}=g(t,e),f={x:n,y:o},u=v(i),h=w(u);let d=f[h],m=f[u];const y=g(s,e),x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+x.mainAxis,n=r.reference[h]+r.reference[t]-x.mainAxis;d<e?d=e:d>n&&(d=n)}if(a){var b,E;const t="y"===h?"width":"height",e=["top","left"].includes(p(i)),n=r.reference[u]-r.floating[t]+(e&&(null==(b=l.offset)?void 0:b[u])||0)+(e?0:x.crossAxis),o=r.reference[u]+r.reference[t]+(e?0:(null==(E=l.offset)?void 0:E[u])||0)-(e?x.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[h]:d,[u]:m}}}},Lt=(t,e,n)=>{const o=new Map,i={platform:ut,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=S(a,o,c),h=o,d={},g=0;for(let n=0;n<s.length;n++){const{name:r,fn:p}=s[n],{x:m,y:w,data:y,reset:v}=await p({x:f,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:d,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=m?m:f,u=null!=w?w:u,d={...d,[r]:{...d[r],...y}},v&&g<=50&&(g++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(a=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):v.rects),({x:f,y:u}=S(a,h,c))),n=-1)}return{x:f,y:u,placement:h,strategy:i,middlewareData:d}})(t,e,{...i,platform:r})}},961:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(t,e){var n;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},969:function(t,e,n){
10
9
  /*
11
- * @version: 2.6.0
10
+ * HSTooltip
11
+ * @version: 3.1.0
12
12
  * @author: Preline Labs Ltd.
13
13
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
14
  * Copyright 2024 Preline Labs Ltd.
15
15
  */
16
- var n=this;Object.defineProperty(t,"__esModule",{value:!0}),t.menuSearchHistory=t.classToClassList=t.htmlToElement=t.afterTransition=t.dispatch=t.debounce=t.isJson=t.isDirectChild=t.isFormElement=t.isParentOrElementHidden=t.isEnoughSpace=t.isIpadOS=t.isIOS=t.getZIndex=t.getClassPropertyAlt=t.getClassProperty=t.stringToBoolean=void 0,t.getHighestZIndex=function(e){var t=Number.NEGATIVE_INFINITY;return e.forEach((function(e){var n=o(e);"auto"!==n&&(n=parseInt(n,10))>t&&(t=n)})),t};t.stringToBoolean=function(e){return"true"===e};t.getClassProperty=function(e,t,n){return void 0===n&&(n=""),(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","")};t.getClassPropertyAlt=function(e,t,n){void 0===n&&(n="");var o="";return e.classList.forEach((function(e){e.includes(t)&&(o=e)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};var o=function(e){return window.getComputedStyle(e).getPropertyValue("z-index")};t.getZIndex=o;t.isIOS=function(){return!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isIpadOS=function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)};t.isDirectChild=function(e,t){for(var n=e.children,o=0;o<n.length;o++)if(n[o]===t)return!0;return!1};t.isEnoughSpace=function(e,t,n,o,r){void 0===n&&(n="auto"),void 0===o&&(o=10),void 0===r&&(r=null);var i=t.getBoundingClientRect(),s=r?r.getBoundingClientRect():null,a=window.innerHeight,l=s?i.top-s.top:i.top,c=(r?s.bottom:a)-i.bottom,f=e.clientHeight+o;return"bottom"===n?c>=f:"top"===n?l>=f:l>=f||c>=f};t.isFormElement=function(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement};var r=function(e){return!!e&&("none"===window.getComputedStyle(e).display||r(e.parentElement))};t.isParentOrElementHidden=r;t.isJson=function(e){if("string"!=typeof e)return!1;var t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};t.debounce=function(e,t){var o;return void 0===t&&(t=200),function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];clearTimeout(o),o=setTimeout((function(){e.apply(n,r)}),t)}};t.dispatch=function(e,t,n){void 0===n&&(n=null);var o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)};t.afterTransition=function(e,t){var n=function(){t(),e.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(e),r=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(r)>0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=function(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=function(e,t,n,o){void 0===n&&(n=" "),void 0===o&&(o="add"),e.split(n).forEach((function(e){return"add"===o?t.classList.add(e):t.classList.remove(e)}))};t.menuSearchHistory={historyIndex:-1,addHistory:function(e){this.historyIndex=e},existsInHistory:function(e){return e>this.historyIndex},clearHistory:function(){this.historyIndex=-1}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(969)})()));
16
+ var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(949),r=n(292),l=o(n(961)),s=n(223);class c extends l.default{constructor(t,e,n){super(t,e,n),this.cleanupAutoUpdate=null,this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,r.getClassProperty)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,r.getClassProperty)(this.el,"--prevent-popper","false"),this.placement=(0,r.getClassProperty)(this.el,"--placement"),this.strategy=(0,r.getClassProperty)(this.el,"--strategy"),this.scope=(0,r.getClassProperty)(this.el,"--scope")||"parent"),this.el&&this.toggle&&this.content&&this.init()}toggleClick(){this.click()}toggleFocus(){this.focus()}toggleMouseEnter(){this.enter()}toggleMouseLeave(){this.leave()}toggleHandle(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)}init(){this.createCollection(window.$hsTooltipCollection,this),"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"focus"===this.eventMode?(this.onToggleFocusListener=()=>this.toggleFocus(),this.toggle.addEventListener("click",this.onToggleFocusListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener)),"false"===this.preventFloatingUI&&this.buildFloatingUI()}enter(){this._show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=()=>{setTimeout((()=>this.toggleHandle()))},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)}focus(){this._show();const t=()=>{this.hide(),this.toggle.removeEventListener("blur",t,!0)};this.toggle.addEventListener("blur",t,!0)}buildFloatingUI(){"window"===this.scope&&document.body.appendChild(this.content);const t=(t,e,n)=>{const o=this.content.getBoundingClientRect(),i=window.innerWidth,r=window.innerHeight,l=i-(window.innerWidth-document.documentElement.clientWidth),s=this.toggle.getBoundingClientRect();let c=t,a=e,f=n;return n.includes("right")&&t+o.width>l?(f=n.replace("right","left"),c=s.left-o.width-5):n.includes("left")&&t<0&&(f=n.replace("left","right"),c=s.right+5),n.includes("top")&&e-o.height<0?(f=n.replace("top","bottom"),a=s.bottom+5):n.includes("bottom")&&e+o.height>r&&(f=n.replace("bottom","top"),a=s.top-o.height-5),{x:c,y:a,placement:f}};(0,i.computePosition)(this.toggle,this.content,{placement:s.POSITIONS[this.placement]||"top",strategy:this.strategy||"fixed",middleware:[(0,i.offset)(5)]}).then((({x:e,y:n,placement:o})=>{const i=t(e,n,o);Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${i.x}px`,top:`${i.y}px`}),this.content.setAttribute("data-placement",i.placement)})),this.cleanupAutoUpdate=(0,i.autoUpdate)(this.toggle,this.content,(()=>{(0,i.computePosition)(this.toggle,this.content,{placement:s.POSITIONS[this.placement]||"top",strategy:this.strategy||"fixed",middleware:[(0,i.offset)(5)]}).then((({x:e,y:n,placement:o})=>{const i=t(e,n,o);Object.assign(this.content.style,{left:`${i.x}px`,top:`${i.y}px`}),this.content.setAttribute("data-placement",i.placement)}))}))}_show(){this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"!==this.preventFloatingUI||this.cleanupAutoUpdate||this.buildFloatingUI(),setTimeout((()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,r.dispatch)("show.hs.tooltip",this.el,this.el)}))}show(){switch(this.eventMode){case"click":this.click();break;case"focus":this.focus();break;default:this.enter()}this.toggle.focus(),this.toggle.style.outline="none"}hide(){this.el.classList.remove("show"),"window"===this.scope&&this.content.classList.remove("show"),"false"===this.preventFloatingUI&&this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.fireEvent("hide",this.el),(0,r.dispatch)("hide.hs.tooltip",this.el,this.el),(0,r.afterTransition)(this.content,(()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden"),this.toggle.style.outline=""}))}destroy(){this.el.classList.remove("show"),this.content.classList.add("hidden"),"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"focus"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleFocusListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:t})=>t.el!==this.el))}static findInCollection(t){return window.$hsTooltipCollection.find((e=>t instanceof c?e.element.el===t.el:"string"==typeof t?e.element.el===document.querySelector(t):e.element.el===t))||null}static getInstance(t,e=!1){const n=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return n?e?n:n.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:t})=>document.contains(t.el)))),document.querySelectorAll(".hs-tooltip:not(.--prevent-on-load-init)").forEach((t=>{window.$hsTooltipCollection.find((e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new c(t)}))}static show(t){const e=c.findInCollection(t);e&&e.element.show()}static hide(t){const e=c.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=c.findInCollection(e);o&&(o.element.events[t]=n)}}window.addEventListener("load",(()=>{c.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=c),e.default=c}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(969)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preline/tooltip",
3
- "version": "2.6.0",
3
+ "version": "3.1.0",
4
4
  "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -11,5 +11,8 @@
11
11
  "license": "Licensed under MIT and Preline UI Fair Use License",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@floating-ui/dom": "^1.6.13"
14
17
  }
15
18
  }
package/variants.css ADDED
@@ -0,0 +1,9 @@
1
+ @custom-variant hs-tooltip-shown {
2
+ &.hs-tooltip-content.show {
3
+ @slot;
4
+ }
5
+
6
+ .hs-tooltip.show & {
7
+ @slot;
8
+ }
9
+ }