UNPKG

sveltejs-tippy

Version:
3 lines (2 loc) 32.7 kB
function e(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function t(e){if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t?t.defaultView:window}return e}function n(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function r(e){return e instanceof t(e).Element||e instanceof Element}function o(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function i(e){return e?(e.nodeName||"").toLowerCase():null}function a(e){return(r(e)?e.ownerDocument:e.document).documentElement}function s(t){return e(a(t)).left+n(t).scrollLeft}function p(r,p,c){var u;void 0===c&&(c=!1);var f,d,l=e(r),m={scrollLeft:0,scrollTop:0},h={x:0,y:0};return c||("body"!==i(p)&&(m=(f=p)!==t(f)&&o(f)?{scrollLeft:(d=f).scrollLeft,scrollTop:d.scrollTop}:n(f)),o(p)?((h=e(p)).x+=p.clientLeft,h.y+=p.clientTop):(u=a(p))&&(h.x=s(u))),{x:l.left+m.scrollLeft-h.x,y:l.top+m.scrollTop-h.y,width:l.width,height:l.height}}function c(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function u(e){return"html"===i(e)?e:e.parentNode||e.host||document.ownerDocument||document.documentElement}function f(e){return t(e).getComputedStyle(e)}function d(e,n){void 0===n&&(n=[]);var r=function e(t){if(["html","body","#document"].indexOf(i(t))>=0)return t.ownerDocument.body;if(o(t)){var n=f(t),r=n.overflow,a=n.overflowX,s=n.overflowY;if(/auto|scroll|overlay|hidden/.test(r+s+a))return t}return e(u(t))}(e),a="body"===i(r),s=a?t(r):r,p=n.concat(s);return a?p:p.concat(d(u(s)))}function l(e){return["table","td","th"].indexOf(i(e))>=0}function m(e){var t;return!o(e)||!(t=e.offsetParent)||void 0!==window.InstallTrigger&&"fixed"===f(t).position?null:t}function h(e){for(var n=t(e),r=m(e);r&&l(r);)r=m(r);return r&&"body"===i(r)&&"static"===f(r).position?n:r||n}var v="top",b="bottom",g="right",y="left",x=[v,b,g,y],w=x.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),O=[].concat(x,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),E=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function T(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=t.get(r);o&&e(o)}})),r.push(o)}(e)})),r}function A(e){return e.split("-")[0]}var D={placement:"bottom",modifiers:[],strategy:"absolute"};function j(){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 L(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,i=t.defaultOptions,a=void 0===i?D:i;return function(e,t,n){void 0===n&&(n=a);var i,s,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},D,{},a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],l=!1,m={state:u,setOptions:function(n){v(),u.options=Object.assign({},a,{},u.options,{},n),u.scrollParents={reference:r(e)?d(e):[],popper:d(t)};var i,s,p=function(e){var t=T(e);return E.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((i=[].concat(o,u.options.modifiers),s=i.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(s).map((function(e){return s[e]}))));return u.orderedModifiers=p.filter((function(e){return e.enabled})),u.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:u,name:t,instance:m,options:r});f.push(i||function(){})}})),m.update()},forceUpdate:function(){if(!l){var e=u.elements,t=e.reference,n=e.popper;if(j(t,n)){u.rects={reference:p(t,h(n),"fixed"===u.options.strategy),popper:c(n)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(e){return u.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var o=u.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,f=o.name;"function"==typeof i&&(u=i({state:u,options:s,name:f,instance:m})||u)}else u.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){m.forceUpdate(),e(u)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){v(),l=!0}};if(!j(e,t))return m;function v(){f.forEach((function(e){return e()})),f=[]}return m.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),m}}var M={passive:!0};function k(e){return e.split("-")[1]}function C(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function S(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?A(o):null,a=o?k(o):null,s=n.x+n.width/2-r.width/2,p=n.y+n.height/2-r.height/2;switch(i){case v:t={x:s,y:n.y-r.height};break;case b:t={x:s,y:n.y+n.height};break;case g:t={x:n.x+n.width,y:p};break;case y:t={x:n.x-r.width,y:p};break;default:t={x:n.x,y:n.y}}var c=i?C(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case"start":t[c]=Math.floor(t[c])-Math.floor(n[u]/2-r[u]/2);break;case"end":t[c]=Math.floor(t[c])+Math.ceil(n[u]/2-r[u]/2)}}return t}var B={top:"auto",right:"auto",bottom:"auto",left:"auto"};function P(e){var n,r=e.popper,o=e.popperRect,i=e.placement,s=e.offsets,p=e.position,c=e.gpuAcceleration,u=e.adaptive,f=function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Math.round(t*r)/r||0,y:Math.round(n*r)/r||0}}(s),d=f.x,l=f.y,m=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),w=y,O=v,E=window;if(u){var T=h(r);T===t(r)&&(T=a(r)),i===v&&(O=b,l-=T.clientHeight-o.height,l*=c?1:-1),i===y&&(w=g,d-=T.clientWidth-o.width,d*=c?1:-1)}var A,D=Object.assign({position:p},u&&B);return c?Object.assign({},D,((A={})[O]=x?"0":"",A[w]=m?"0":"",A.transform=(E.devicePixelRatio||1)<2?"translate("+d+"px, "+l+"px)":"translate3d("+d+"px, "+l+"px, 0)",A)):Object.assign({},D,((n={})[O]=x?l+"px":"",n[w]=m?d+"px":"",n.transform="",n))}var V={left:"right",right:"left",bottom:"top",top:"bottom"};function H(e){return e.replace(/left|right|bottom|top/g,(function(e){return V[e]}))}var W={start:"end",end:"start"};function R(e){return e.replace(/start|end/g,(function(e){return W[e]}))}function N(e){return parseFloat(e)||0}function I(e){var n=t(e),r=function(e){var t=o(e)?f(e):{};return{top:N(t.borderTopWidth),right:N(t.borderRightWidth),bottom:N(t.borderBottomWidth),left:N(t.borderLeftWidth)}}(e),a="html"===i(e),p=s(e),c=e.clientWidth+r.right,u=e.clientHeight+r.bottom;return a&&n.innerHeight-e.clientHeight>50&&(u=n.innerHeight-r.bottom),{top:a?0:e.clientTop,right:e.clientLeft>r.left?r.right:a?n.innerWidth-c-p:e.offsetWidth-c,bottom:a?n.innerHeight-u:e.offsetHeight-u,left:a?p:e.clientLeft}}function q(e,t){var n=Boolean(t.getRootNode&&t.getRootNode().host);if(e.contains(t))return!0;if(n){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function U(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(r,i){return"viewport"===i?U(function(e){var n=t(e);return{width:n.innerWidth,height:n.innerHeight,x:0,y:0}}(r)):o(i)?e(i):U(function(e){var r=t(e),o=n(e),i=p(a(e),r);return i.height=Math.max(i.height,r.innerHeight),i.width=Math.max(i.width,r.innerWidth),i.x=-o.scrollLeft,i.y=-o.scrollTop,i}(a(r)))}function z(e,t,n){var i="clippingParents"===t?function(e){var t=d(e),n=["absolute","fixed"].indexOf(f(e).position)>=0&&o(e)?h(e):e;return r(n)?t.filter((function(e){return r(e)&&q(e,n)})):[]}(e):[].concat(t),s=[].concat(i,[n]),p=s[0],c=s.reduce((function(t,n){var r=_(e,n),i=I(o(n)?n:a(e));return t.top=Math.max(r.top+i.top,t.top),t.right=Math.min(r.right-i.right,t.right),t.bottom=Math.min(r.bottom-i.bottom,t.bottom),t.left=Math.max(r.left+i.left,t.left),t}),_(e,p));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function F(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},{},e)}function $(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function X(t,n){void 0===n&&(n={});var o=n,i=o.placement,s=void 0===i?t.placement:i,p=o.boundary,c=void 0===p?"clippingParents":p,u=o.rootBoundary,f=void 0===u?"viewport":u,d=o.elementContext,l=void 0===d?"popper":d,m=o.altBoundary,h=void 0!==m&&m,y=o.padding,w=void 0===y?0:y,O=F("number"!=typeof w?w:$(w,x)),E="popper"===l?"reference":"popper",T=t.elements.reference,A=t.rects.popper,D=t.elements[h?E:l],j=z(r(D)?D:a(t.elements.popper),c,f),L=e(T),M=S({reference:L,element:A,strategy:"absolute",placement:s}),k=U(Object.assign({},A,{},M)),C="popper"===l?k:L,B={top:j.top-C.top+O.top,bottom:C.bottom-j.bottom+O.bottom,left:j.left-C.left+O.left,right:C.right-j.right+O.right},P=t.modifiersData.offset;if("popper"===l&&P){var V=P[s];Object.keys(B).forEach((function(e){var t=[g,b].indexOf(e)>=0?1:-1,n=[v,b].indexOf(e)>=0?"y":"x";B[e]+=V[n]*t}))}return B}function Y(e,t,n){return Math.max(e,Math.min(t,n))}function J(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 G(e){return[v,g,b,y].some((function(t){return e[t]>=0}))}var K=L({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,p=void 0===s||s,c=t(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",r.update,M)})),p&&c.addEventListener("resize",r.update,M),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",r.update,M)})),p&&c.removeEventListener("resize",r.update,M)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=S({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s={placement:A(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};t.styles.popper=Object.assign({},t.styles.popper,{},P(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a}))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,{},P(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{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]||{},r=t.attributes[e]||{},a=t.elements[e];o(a)&&i(a)&&(Object.assign(a.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:"absolute",left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],a=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});o(r)&&i(r)&&(Object.assign(r.style,s),Object.keys(a).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=O.reduce((function(e,n){return e[n]=function(e,t,n){var r=A(e),o=[y,v].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[y,g].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],p=s.x,c=s.y;t.modifiersData.popperOffsets.x+=p,t.modifiersData.popperOffsets.y+=c,t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.fallbackPlacements,i=n.padding,a=n.boundary,s=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,u=void 0===c||c,f=t.options.placement,d=A(f),l=o||(d===f||!u?[H(f)]:function(e){if("auto"===A(e))return[];var t=H(e);return[R(e),t,R(t)]}(f)),m=[f].concat(l).reduce((function(e,n){return e.concat("auto"===A(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,p=k(r),c=(p?s?w:w.filter((function(e){return k(e)===p})):x).reduce((function(t,n){return t[n]=X(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[A(n)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}(t,{placement:n,boundary:a,rootBoundary:s,padding:i,flipVariations:u}):n)}),[]),h=t.rects.reference,O=t.rects.popper,E=new Map,T=!0,D=m[0],j=0;j<m.length;j++){var L=m[j],M=A(L),C="start"===k(L),S=[v,b].indexOf(M)>=0,B=S?"width":"height",P=X(t,{placement:L,boundary:a,rootBoundary:s,altBoundary:p,padding:i}),V=S?C?g:y:C?b:v;h[B]>O[B]&&(V=H(V));var W=H(V),N=[P[M]<=0,P[V]<=0,P[W]<=0];if(N.every((function(e){return e}))){D=L,T=!1;break}E.set(L,N)}if(T)for(var I=function(e){var t=m.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},q=u?3:1;q>0;q--){if("break"===I(q))break}t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,p=n.boundary,u=n.rootBoundary,f=n.altBoundary,d=n.padding,l=n.tether,m=void 0===l||l,h=n.tetherOffset,x=void 0===h?0:h,w=X(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:f}),O=A(t.placement),E=k(t.placement),T=!E,D=C(O),j="x"===D?"y":"x",L=t.modifiersData.popperOffsets,M=t.rects.reference,S=t.rects.popper,B="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,P={x:0,y:0};if(i){var V="y"===D?v:y,H="y"===D?b:g,W="y"===D?"height":"width",R=L[D],N=L[D]+w[V],I=L[D]-w[H],q=m?-S[W]/2:0,U="start"===E?M[W]:S[W],_="start"===E?-S[W]:-M[W],z=t.elements.arrow,F=m&&z?c(z):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=$[V],G=$[H],K=Y(0,M[W],F[W]),Q=T?M[W]/2-q-K-J-B:U-K-J-B,Z=T?-M[W]/2+q+K+G+B:_+K+G+B,ee=z?"y"===D?t.elements.popper.clientTop:t.elements.popper.clientLeft:0,te=t.modifiersData.offset?t.modifiersData.offset[t.placement][D]:0,ne=L[D]+Q-te-ee,re=L[D]+Z-te,oe=Y(m?Math.min(N,ne):N,R,m?Math.max(I,re):I);L[D]=oe,P[D]=oe-R}if(s){var ie="x"===D?v:y,ae="x"===D?b:g,se=L[j],pe=Y(se+w[ie],se,se-w[ae]);t.modifiersData.popperOffsets[j]=pe,P[j]=pe-se}t.modifiersData[r]=P},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=n.elements.arrow,i=n.modifiersData.popperOffsets,a=A(n.placement),s=C(a),p=[y,g].indexOf(a)>=0?"height":"width";if(o){var u=n.modifiersData[r+"#persistent"].padding,f=c(o),d="y"===s?v:y,l="y"===s?b:g,m=(n.rects.reference[p]+n.rects.reference[s]-i[s]-n.rects.popper[p])/2-(i[s]-n.rects.reference[s])/2-("y"===s?n.elements.popper.clientLeft:n.elements.popper.clientTop),h=Y(u[d],n.rects.popper[p]/2-f[p]/2+m,n.rects.popper[p]-f[p]-u[l]),x=s;n.modifiersData[r]=((t={})[x]=h,t)}},effect:function(e){var t=e.state,n=e.options,r=e.name,o=n.element,i=void 0===o?"[data-popper-arrow]":o,a=n.padding,s=void 0===a?0:a;("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&q(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[r+"#persistent"]={padding:F("number"!=typeof s?s:$(s,x))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=X(t,{elementContext:"reference"}),s=X(t,{altBoundary:!0}),p=J(a,r),c=J(s,o,i),u=G(p),f=G(c);t.modifiersData[n]={referenceClippingOffsets:p,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}}]}),Q={passive:!0};function Z(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function ee(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function te(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ne(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function re(e){return[].concat(e)}function oe(e,t){-1===e.indexOf(t)&&e.push(t)}function ie(e){return[].slice.call(e)}function ae(){return document.createElement("div")}function se(e){return ee(e,"Element")}function pe(e){return se(e)?[e]:function(e){return ee(e,"NodeList")}(e)?ie(e):Array.isArray(e)?e:ie(document.querySelectorAll(e))}function ce(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function ue(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function fe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var de={isTouch:!1},le=0;function me(){de.isTouch||(de.isTouch=!0,window.performance&&document.addEventListener("mousemove",he))}function he(){var e=performance.now();e-le<20&&(de.isTouch=!1,document.removeEventListener("mousemove",he)),le=e}function ve(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var be="undefined"!=typeof window&&"undefined"!=typeof document,ge=be?navigator.userAgent:"",ye=/MSIE |Trident\//.test(ge),xe=be&&/iPhone|iPad|iPod/.test(navigator.platform),we=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},content:"",delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oe=Object.keys(we);function Ee(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:o),t}),{});return Object.assign({},e,{},t)}function Te(e,t){var n=Object.assign({},t,{content:te(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ee(Object.assign({},we,{plugins:t}))):Oe).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},we.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Ae(e,t){e.innerHTML=t}function De(e){var t=ae();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",se(e)?t.appendChild(e):Ae(t,e)),t}function je(e,t){se(t.content)?(Ae(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ae(e,t.content):e.textContent=t.content)}function Le(e){var t=e.firstElementChild,n=ie(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Me(e){var t=ae(),n=ae();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ae();function o(n,r){var o=Le(t),i=o.box,a=o.content,s=o.arrow;t.style.zIndex=""+r.zIndex,r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content!==r.content&&je(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(De(r.arrow))):i.appendChild(De(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),je(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Me.$$tippy=!0;var ke=1,Ce=[],Se=[];function Be(e,t){var n,r,o,i,a,s,p,c,u,f,d=Te(e,Object.assign({},we,{},Ee(t))),l=!1,m=!1,h=!1,v=[],b=ne(X,d.interactiveDebounce),g=(c=d.triggerTarget||e,(u=re(c)[0])&&u.ownerDocument||document),y=ke++,x=(f=d.plugins).filter((function(e,t){return f.indexOf(e)===t})),w={id:y,reference:e,popper:ae(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:x,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(w.state.isDestroyed)return;V("onBeforeUpdate",[w,t]),F();var n=w.props,r=Te(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,z(),n.interactiveDebounce!==r.interactiveDebounce&&(R(),b=ne(X,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?re(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");W(),B(),T&&T(n,r);w.popperInstance&&se();V("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=de.isTouch&&!w.props.touch,o=Z(w.props.duration,0,we.duration);if(e||t||n||r)return;if(k().hasAttribute("disabled"))return;if(V("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,M()&&(E.style.visibility="visible");B(),I(),w.state.isMounted||(E.style.transition="none");s=function(){if(w.state.isVisible&&!h){if(h=!0,E.offsetHeight,E.style.transition=w.props.moveTransition,M()){var e=C(),t=e.box,n=e.content;w.props.animation&&(ce([t,n],o),ue([t,n],"visible"))}H(),W(),oe(Se,w),P(!0),w.state.isMounted=!0,V("onMount",[w]),w.props.animation&&M()&&function(e,t){U(e,t)}(o,(function(){w.state.isShown=!0,V("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=k();e=w.props.interactive&&t===we.appendTo||"parent"===t?n.parentNode:te(t,[n]);e.contains(E)||e.appendChild(E);se()}()},hide:function(){var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Z(w.props.duration,1,we.duration);if(e||t||n)return;if(V("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,h=!1,M()&&(E.style.visibility="hidden");if(R(),q(),B(),M()){var o=C(),i=o.box,a=o.content;w.props.animation&&(ce([i,a],r),ue([i,a],"hidden"))}H(),W(),w.props.animation?M()&&function(e,t){U(e,(function(){!w.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(r,w.unmount):w.unmount()},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){pe(),le().forEach((function(e){var t=e._tippy;t.hide(),t.unmount()})),E.parentNode&&E.parentNode.removeChild(E);0===(Se=Se.filter((function(e){return e!==w}))).length&&P(!1);w.state.isMounted=!1,V("onHidden",[w])},destroy:function(){if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.hide(),w.state.isMounted&&w.unmount();F(),delete e._tippy,w.state.isDestroyed=!0,V("onDestroy",[w])}};if(!d.render)return w;var O=d.render(w),E=O.popper,T=O.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+w.id,w.popper=E,e._tippy=w,E._tippy=w;var A=x.map((function(e){return e.fn(w)})),D=e.hasAttribute("aria-expanded");return z(),W(),V("onCreate",[w]),d.showOnCreate&&me(),E.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(g.addEventListener("mousemove",b),b(e))})),w;function j(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===j()[0]}function M(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function k(){return p||e}function C(){return Le(E)}function S(e){return w.state.isMounted&&!w.state.isVisible||de.isTouch||i&&"focus"===i.type?0:Z(w.props.delay,e?0:1,we.delay)}function B(){E.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none"}function P(e){var t=e&&xe&&de.isTouch;g.body.classList[t?"add":"remove"]("tippy-iOS")}function V(e,t,n){var r;(void 0===n&&(n=!0),A.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function H(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=E.id;re(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function W(){!D&&w.props.aria.expanded&&re(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")}))}function R(){g.body.removeEventListener("mouseleave",he),g.removeEventListener("mousemove",b),Ce=Ce.filter((function(e){return e!==b}))}function N(e){if(!w.props.interactive||!E.contains(e.target)){if(k().contains(e.target)){if(de.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}!0===w.props.hideOnClick&&(l=!1,w.clearDelayTimeouts(),w.hide(),m=!0,setTimeout((function(){m=!1})),w.state.isMounted||q())}}function I(){g.addEventListener("mousedown",N,!0)}function q(){g.removeEventListener("mousedown",N,!0)}function U(e,t){var n=C().box;function r(e){e.target===n&&(fe(n,"remove",r),t())}if(0===e)return t();fe(n,"remove",a),fe(n,"add",r),a=r}function _(t,n,r){void 0===r&&(r=!1),re(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function z(){var e;L()&&(_("touchstart",$,Q),_("touchend",Y,Q)),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_(e,$),e){case"mouseenter":_("mouseleave",Y);break;case"focus":_(ye?"focusout":"blur",J);break;case"focusin":_("focusout",J)}}))}function F(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),v=[]}function $(e){var t=!1;if(w.state.isEnabled&&!G(e)&&!m){if(i=e,p=e.currentTarget,W(),!w.state.isVisible&&function(e){return ee(e,"MouseEvent")}(e)&&Ce.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||l)&&!1!==w.props.hideOnClick&&w.state.isVisible)t=!0;else{var r=j(),o=r[0],a=r[1];de.isTouch&&"hold"===o&&a?n=setTimeout((function(){me(e)}),a):me(e)}"click"===e.type&&(l=!t),t&&he(e)}}function X(t){var n=t.target,r=e.contains(n)||E.contains(n);"mousemove"===t.type&&r||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=o.placement.split("-")[0],s=o.modifiersData.offset;if(!s)return!0;var p="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+p>i,l=r-t.bottom-c>i,m=t.left-n+u>i,h=n-t.right-f>i;return d||l||m||h}))}(le().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),t)&&(R(),he(t))}function Y(e){if(!(G(e)||w.props.trigger.indexOf("click")>=0&&l))return w.props.interactive?(g.body.addEventListener("mouseleave",he),g.addEventListener("mousemove",b),oe(Ce,b),void b(e)):void he(e)}function J(e){w.props.trigger.indexOf("focusin")<0&&e.target!==k()||w.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||he(e)}function G(e){return!!de.isTouch&&L()!==e.type.indexOf("touch")>=0}function se(){pe();var t=w.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,p=M()?Le(E).arrow:null,c=i?{getBoundingClientRect:i}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(M()){var n=C().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},f={name:"arrow",enabled:!!p,options:{element:p,padding:3}},d=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}}].concat(M()?[f]:[],(null==n?void 0:n.modifiers)||[],[u]);w.popperInstance=K(c,E,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:d}))}function pe(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function le(){return ie(E.querySelectorAll("[data-tippy-root]"))}function me(e){w.clearDelayTimeouts(),e&&V("onTrigger",[w,e]),I();var t=S(!0);t?n=setTimeout((function(){w.show()}),t):w.show()}function he(e){if(w.clearDelayTimeouts(),V("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&l)){var t=S(!1);t?r=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function Pe(e,t){void 0===t&&(t={});var n=we.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",me,Object.assign({},Q,{capture:!0})),window.addEventListener("blur",ve);var r=Object.assign({},t,{plugins:n}),o=pe(e).reduce((function(e,t){var n=t&&Be(t,r);return n&&e.push(n),e}),[]);return se(e)?o[0]:o}Pe.defaultProps=we,Pe.setDefaultProps=function(e){Object.keys(e).forEach((function(t){we[t]=e[t]}))},Pe.currentInput=de,Pe.setDefaultProps({render:Me});!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:#333;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:#333;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:#333;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:#333;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}');export default function(e,t){Pe(e,t)} //# sourceMappingURL=index.min.mjs.map