tailtip 1.0.3 → 1.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/README.md +25 -2
- package/dist/tailtip.cjs +1 -1
- package/dist/tailtip.iife.js +1 -0
- package/dist/tailtip.mjs +801 -880
- package/package.json +14 -8
- package/dist/tailtip.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailtip",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Tailtip - A tiny Tailwind friendly tooltip library",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"tailwind tooltips"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"main": "dist/tailtip.
|
|
15
|
+
"main": "dist/tailtip.cjs",
|
|
16
16
|
"unpkg": "dist/tailtip.iife.js",
|
|
17
17
|
"jsdelivr": "dist/tailtip.iife.js",
|
|
18
|
-
"module": "./dist/tailtip.
|
|
18
|
+
"module": "./dist/tailtip.mjs",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"import": "./dist/tailtip.
|
|
22
|
-
"require": "./dist/tailtip.
|
|
21
|
+
"import": "./dist/tailtip.mjs",
|
|
22
|
+
"require": "./dist/tailtip.cjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
@@ -35,13 +35,19 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "vite",
|
|
38
|
-
"build": "vite build"
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"fmt": "oxfmt",
|
|
40
|
+
"fmt:check": "oxfmt --check",
|
|
41
|
+
"lint": "oxlint",
|
|
42
|
+
"lint:fix": "oxlint --fix"
|
|
39
43
|
},
|
|
40
44
|
"dependencies": {
|
|
41
|
-
"@floating-ui/dom": "1.5
|
|
45
|
+
"@floating-ui/dom": "1.7.5"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
44
|
-
"
|
|
48
|
+
"oxfmt": "^0.32.0",
|
|
49
|
+
"oxlint": "^1.47.0",
|
|
50
|
+
"vite": "v8.0.0-beta.13"
|
|
45
51
|
},
|
|
46
52
|
"author": "Versoly"
|
|
47
53
|
}
|
package/dist/tailtip.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Tailtip=function(){"use strict";var fe=Object.defineProperty,ae=Object.defineProperties;var ue=Object.getOwnPropertyDescriptors;var st=Object.getOwnPropertySymbols;var Pt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var St=(h,w,v)=>w in h?fe(h,w,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[w]=v,C=(h,w)=>{for(var v in w||(w={}))Pt.call(w,v)&&St(h,v,w[v]);if(st)for(var v of st(w))kt.call(w,v)&&St(h,v,w[v]);return h},B=(h,w)=>ae(h,ue(w));var mt=(h,w)=>{var v={};for(var E in h)Pt.call(h,E)&&w.indexOf(E)<0&&(v[E]=h[E]);if(h!=null&&st)for(var E of st(h))w.indexOf(E)<0&&kt.call(h,E)&&(v[E]=h[E]);return v};const h=Math.min,w=Math.max,v=Math.round,E=t=>({x:t,y:t}),Dt={left:"right",right:"left",bottom:"top",top:"bottom"},Nt={start:"end",end:"start"};function rt(t,e,n){return w(t,h(e,n))}function I(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function z(t){return t.split("-")[1]}function pt(t){return t==="x"?"y":"x"}function ct(t){return t==="y"?"height":"width"}function tt(t){return["top","bottom"].includes($(t))?"y":"x"}function lt(t){return pt(tt(t))}function Vt(t,e,n){n===void 0&&(n=!1);const o=z(t),i=lt(t),r=ct(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=et(s)),[s,et(s)]}function Bt(t){const e=et(t);return[ft(t),e,ft(e)]}function ft(t){return t.replace(/start|end/g,e=>Nt[e])}function Ft(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function Wt(t,e,n,o){const i=z(t);let r=Ft($(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(ft)))),r}function et(t){return t.replace(/left|right|bottom|top/g,e=>Dt[e])}function Mt(t){return C({top:0,right:0,bottom:0,left:0},t)}function gt(t){return typeof t!="number"?Mt(t):{top:t,right:t,bottom:t,left:t}}function nt(t){return B(C({},t),{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}function ht(t,e,n){let{reference:o,floating:i}=t;const r=tt(e),s=lt(e),c=ct(s),l=$(e),f=r==="y",p=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let a;switch(l){case"top":a={x:p,y:o.y-i.height};break;case"bottom":a={x:p,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:d};break;case"left":a={x:o.x-i.width,y:d};break;default:a={x:o.x,y:o.y}}switch(z(e)){case"start":a[s]-=m*(n&&f?-1:1);break;case"end":a[s]+=m*(n&&f?-1:1);break}return a}const Ht=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=ht(f,o,l),m=o,a={},u=0;for(let g=0;g<c.length;g++){const{name:y,fn:x}=c[g],{x:A,y:b,data:T,reset:O}=await x({x:p,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:a,rects:f,platform:s,elements:{reference:t,floating:e}});if(p=A!=null?A:p,d=b!=null?b:d,a=B(C({},a),{[y]:C(C({},a[y]),T)}),O&&u<=50){u++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(f=O.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:d}=ht(f,m,l)),g=-1;continue}}return{x:p,y:d,placement:m,strategy:i,middlewareData:a}};async function wt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:m=!1,padding:a=0}=I(e,t),u=gt(a),y=c[m?d==="floating"?"reference":"floating":d],x=nt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:l})),A=d==="floating"?B(C({},s.floating),{x:o,y:i}):s.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),T=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},O=nt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:A,offsetParent:b,strategy:l}):A);return{top:(x.top-O.top+u.top)/T.y,bottom:(O.bottom-x.bottom+u.bottom)/T.y,left:(x.left-O.left+u.left)/T.x,right:(O.right-x.right+u.right)/T.x}}const $t=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:p=0}=I(t,e)||{};if(f==null)return{};const d=gt(p),m={x:n,y:o},a=lt(i),u=ct(a),g=await s.getDimensions(f),y=a==="y",x=y?"top":"left",A=y?"bottom":"right",b=y?"clientHeight":"clientWidth",T=r.reference[u]+r.reference[a]-m[a]-r.floating[u],O=m[a]-r.reference[a],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let P=j?j[b]:0;(!P||!await(s.isElement==null?void 0:s.isElement(j)))&&(P=c.floating[b]||r.floating[u]);const _=T/2-O/2,J=P/2-g[u]/2-1,Q=h(d[x],J),U=h(d[A],J),X=Q,k=P-g[u]-U,D=P/2-g[u]/2+_,W=rt(X,D,k),N=!l.arrow&&z(i)!=null&&D!=W&&r.reference[u]/2-(D<X?Q:U)-g[u]/2<0,V=N?D<X?D-X:D-k:0;return{[a]:m[a]+V,data:C({[a]:W,centerOffset:D-W-V},N&&{alignmentOffset:V}),reset:N}}}),jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:f}=e,X=I(t,e),{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0}=X,y=mt(X,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=$(i),A=$(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(f.floating)),T=m||(A||!g?[et(c)]:Bt(c));!m&&u!=="none"&&T.push(...Wt(c,g,u,b));const O=[c,...T],j=await wt(e,y),P=[];let _=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&P.push(j[x]),d){const k=Vt(i,s,b);P.push(j[k[0]],j[k[1]])}if(_=[..._,{placement:i,overflows:P}],!P.every(k=>k<=0)){var J,Q;const k=(((J=r.flip)==null?void 0:J.index)||0)+1,D=O[k];if(D)return{data:{index:k,overflows:_},reset:{placement:D}};let W=(Q=_.filter(N=>N.overflows[0]<=0).sort((N,V)=>N.overflows[1]-V.overflows[1])[0])==null?void 0:Q.placement;if(!W)switch(a){case"bestFit":{var U;const N=(U=_.map(V=>[V.placement,V.overflows.filter(Z=>Z>0).reduce((Z,le)=>Z+le,0)]).sort((V,Z)=>V[1]-Z[1])[0])==null?void 0:U[0];N&&(W=N);break}case"initialPlacement":W=c;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function _t(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=$(n),c=z(n),l=tt(n)==="y",f=["left","top"].includes(s)?-1:1,p=r&&l?-1:1,d=I(e,t);let{mainAxis:m,crossAxis:a,alignmentAxis:u}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:C({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return c&&typeof u=="number"&&(a=c==="end"?u*-1:u),l?{x:a*p,y:m*f}:{x:m*f,y:a*p}}const Xt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,l=await _t(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:B(C({},l),{placement:s})}}}},Yt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,y=I(t,e),{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:x=>{let{x:A,y:b}=x;return{x:A,y:b}}}}=y,l=mt(y,["mainAxis","crossAxis","limiter"]),f={x:n,y:o},p=await wt(e,l),d=tt($(i)),m=pt(d);let a=f[m],u=f[d];if(r){const x=m==="y"?"top":"left",A=m==="y"?"bottom":"right",b=a+p[x],T=a-p[A];a=rt(b,a,T)}if(s){const x=d==="y"?"top":"left",A=d==="y"?"bottom":"right",b=u+p[x],T=u-p[A];u=rt(b,u,T)}const g=c.fn(B(C({},e),{[m]:a,[d]:u}));return B(C({},g),{data:{x:g.x-n,y:g.y-o}})}}};function M(t){return xt(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function H(t){var e;return(e=(xt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xt(t){return t instanceof Node||t instanceof R(t).Node}function F(t){return t instanceof Element||t instanceof R(t).Element}function S(t){return t instanceof HTMLElement||t instanceof R(t).HTMLElement}function yt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function K(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function qt(t){return["table","td","th"].includes(M(t))}function at(t){const e=ut(),n=L(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function It(t){let e=Y(t);for(;S(e)&&!ot(e);){if(at(e))return e;e=Y(e)}return null}function ut(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ot(t){return["html","body","#document"].includes(M(t))}function L(t){return R(t).getComputedStyle(t)}function it(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Y(t){if(M(t)==="html")return t;const e=t.assignedSlot||t.parentNode||yt(t)&&t.host||H(t);return yt(e)?e.host:e}function bt(t){const e=Y(t);return ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:S(e)&&K(e)?e:bt(e)}function dt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=bt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=R(i);return r?e.concat(s,s.visualViewport||[],K(i)?i:[],s.frameElement&&n?dt(s.frameElement):[]):e.concat(i,dt(i,[],n))}function vt(t){const e=L(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=S(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=v(n)!==r||v(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function At(t){return F(t)?t:t.contextElement}function q(t){const e=At(t);if(!S(e))return E(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=vt(e);let s=(r?v(n.width):n.width)/o,c=(r?v(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const zt=E(0);function Et(t){const e=R(t);return!ut()||!e.visualViewport?zt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Kt(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=At(t);let s=E(1);e&&(o?F(o)&&(s=q(o)):s=q(t));const c=Kt(r,n,o)?Et(r):E(0);let l=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,p=i.width/s.x,d=i.height/s.y;if(r){const m=R(r),a=o&&F(o)?R(o):o;let u=m.frameElement;for(;u&&o&&a!==m;){const g=q(u),y=u.getBoundingClientRect(),x=L(u),A=y.left+(u.clientLeft+parseFloat(x.paddingLeft))*g.x,b=y.top+(u.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,f*=g.y,p*=g.x,d*=g.y,l+=A,f+=b,u=R(u).frameElement}}return nt({width:p,height:d,x:l,y:f})}function Gt(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=S(n),r=H(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},c=E(1);const l=E(0);if((i||!i&&o!=="fixed")&&((M(n)!=="body"||K(r))&&(s=it(n)),S(n))){const f=G(n);c=q(n),l.x=f.x+n.clientLeft,l.y=f.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-s.scrollLeft*c.x+l.x,y:e.y*c.y-s.scrollTop*c.y+l.y}}function Jt(t){return Array.from(t.getClientRects())}function Ct(t){return G(H(t)).left+it(t).scrollLeft}function Qt(t){const e=H(t),n=it(t),o=t.ownerDocument.body,i=w(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=w(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ct(t);const c=-n.scrollTop;return L(o).direction==="rtl"&&(s+=w(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Ut(t,e){const n=R(t),o=H(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;const f=ut();(!f||f&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:r,height:s,x:c,y:l}}function Zt(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=S(t)?q(t):E(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,f=o*r.y;return{width:s,height:c,x:l,y:f}}function Ot(t,e,n){let o;if(e==="viewport")o=Ut(t,n);else if(e==="document")o=Qt(H(t));else if(F(e))o=Zt(e,n);else{const i=Et(t);o=B(C({},e),{x:e.x-i.x,y:e.y-i.y})}return nt(o)}function Tt(t,e){const n=Y(t);return n===e||!F(n)||ot(n)?!1:L(n).position==="fixed"||Tt(n,e)}function te(t,e){const n=e.get(t);if(n)return n;let o=dt(t,[],!1).filter(c=>F(c)&&M(c)!=="body"),i=null;const r=L(t).position==="fixed";let s=r?Y(t):t;for(;F(s)&&!ot(s);){const c=L(s),l=at(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||K(s)&&!l&&Tt(t,s))?o=o.filter(p=>p!==s):i=c,s=Y(s)}return e.set(t,o),o}function ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?te(e,this._c):[].concat(n),o],c=s[0],l=s.reduce((f,p)=>{const d=Ot(e,p,i);return f.top=w(d.top,f.top),f.right=h(d.right,f.right),f.bottom=h(d.bottom,f.bottom),f.left=w(d.left,f.left),f},Ot(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ne(t){return vt(t)}function oe(t,e,n){const o=S(e),i=H(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=E(0);if(o||!o&&!r)if((M(e)!=="body"||K(i))&&(c=it(e)),o){const f=G(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Ct(i));return{x:s.left+c.scrollLeft-l.x,y:s.top+c.scrollTop-l.y,width:s.width,height:s.height}}function Rt(t,e){return!S(t)||L(t).position==="fixed"?null:e?e(t):t.offsetParent}function Lt(t,e){const n=R(t);if(!S(t))return n;let o=Rt(t,e);for(;o&&qt(o)&&L(o).position==="static";)o=Rt(o,e);return o&&(M(o)==="html"||M(o)==="body"&&L(o).position==="static"&&!at(o))?n:o||It(t)||n}const ie=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Lt,r=this.getDimensions;return{reference:oe(e,await i(n),o),floating:C({x:0,y:0},await r(n))}};function se(t){return L(t).direction==="rtl"}const re={convertOffsetParentRelativeRectToViewportRelativeRect:Gt,getDocumentElement:H,getClippingRect:ee,getOffsetParent:Lt,getElementRects:ie,getClientRects:Jt,getDimensions:ne,getScale:q,isElement:F,isRTL:se},ce=(t,e,n)=>{const o=new Map,i=C({platform:re},n),r=B(C({},i.platform),{_c:o});return Ht(t,e,B(C({},i),{platform:r}))};return function(t,e={}){const n=t.nextElementSibling,o=n.querySelector(".tooltip-arrow"),i=[Xt(6),jt(),Yt({padding:5})];o&&i.push($t({element:o}));function r(){ce(t,n,{placement:e.placement||"top",middleware:i}).then(({x:m,y:a,placement:u,middlewareData:g})=>{if(Object.assign(n.style,{left:"".concat(m,"px"),top:"".concat(a,"px")}),g.arrow){const{x:y,y:x}=g.arrow,A={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(o.style,{left:y!=null?"".concat(y,"px"):"",top:x!=null?"".concat(x,"px"):"",right:"",bottom:"",[A]:"-4px"})}})}const s=()=>{n.style.display="block",requestAnimationFrame(()=>{n.classList.add("opacity-100","visible")}),r()},c=()=>{n.style.display="",n.classList.remove("opacity-100","visible")},l=()=>{if(n.style.display==="block"){c();return}s()};let f=["mouseenter","focus"],p=["mouseleave","blur"],d=[];e.trigger==="click"&&(f=[],p=["blur"],d=["click"]),f.forEach(m=>{t.addEventListener(m,s)}),p.forEach(m=>{t.addEventListener(m,c)}),d.forEach(m=>{t.addEventListener(m,l)})}}();
|