Comparing version 0.7.0 to 0.8.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tippy=t()}(this,function(){"use strict";function e(e){var t=!1,n=0,i=document.createElement("span");return new MutationObserver(function(){e(),t=!1}).observe(i,{attributes:!0}),function(){t||(t=!0,i.setAttribute("x-index",n),n+=1)}}function t(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},ve))}}function n(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function i(e,t){Object.keys(t).forEach(function(i){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(i)&&n(t[i])&&(r="px"),e.style[i]=t[i]+r})}function r(e){for(var t=[!1,"ms","webkit","moz","o"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length-1;i++){var r=t[i],o=r?""+r+n:e;if(void 0!==window.document.body.style[o])return o}return null}function o(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||e.firstElementChild.offsetParent===e)}function s(e){return null!==e.parentNode?s(e.parentNode):e}function a(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?t:window.document.documentElement}function l(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return window.document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,p=document.createRange();p.setStart(i,0),p.setEnd(r,0);var f=p.commonAncestorContainer;if(e!==f&&t!==f)return o(f)?f:a(f);var d=s(e);return d.host?l(d.host,t):l(e,s(t).host)}function p(e,t){if(1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=window.document.documentElement;return(window.document.scrollingElement||r)[n]}return e[n]}function d(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=f(t,"top"),r=f(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function u(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e||-1!==["HTML","BODY","#document"].indexOf(e.nodeName))return window.document.body;var t=p(e),n=t.overflow,i=t.overflowX;return/(auto|scroll)/.test(n+t.overflowY+i)?e:c(u(e))}function h(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return+e["border"+n+"Width"].split("px")[0]+ +e["border"+i+"Width"].split("px")[0]}function m(){var e=window.document.body,t=window.document.documentElement;return{height:Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight),width:Math.max(e.scrollWidth,e.offsetWidth,t.clientWidth,t.scrollWidth,t.offsetWidth)}}function v(e){return xe({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var t={};if(Ae)try{t=e.getBoundingClientRect();var n=f(e,"top"),i=f(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}catch(e){}else t=e.getBoundingClientRect();var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?m():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,l=e.offsetWidth-s,d=e.offsetHeight-a;if(l||d){var u=p(e);l-=h(u,"x"),d-=h(u,"y"),r.width-=l,r.height-=d}return v(r)}function b(e,t){var n="HTML"===t.nodeName,i=g(e),r=g(t),o=c(e),s=v({top:i.top-r.top,left:i.left-r.left,width:i.width,height:i.height});if(n||"BODY"===t.nodeName){var a=p(t),l=Te&&n?0:+a.borderTopWidth.split("px")[0],f=Te&&n?0:+a.borderLeftWidth.split("px")[0],u=Te&&n?0:+a.marginTop.split("px")[0],h=Te&&n?0:+a.marginLeft.split("px")[0];s.top-=l-u,s.bottom-=l-u,s.left-=f-h,s.right-=f-h,s.marginTop=u,s.marginLeft=h}return t.contains(o)&&(Te||"BODY"!==o.nodeName)&&(s=d(s,t)),s}function w(e,t,n){return b(n,l(t,n))}function y(e){var t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function E(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function O(e,t,n,i){i=i.split("-")[0];var r=y(t),o={position:e,width:r.width,height:r.height},s=-1!==["right","left"].indexOf(i),a=s?"top":"left",l=s?"left":"top",p=s?"height":"width",f=s?"width":"height";return o[a]=n[a]+n[p]/2-r[p]/2,o[l]=i===l?n[l]-r[f]:n[E(l)],o}function x(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function L(e,t,n,i){var r="BODY"===e.nodeName,o=r?window:e;o.addEventListener(t,n,{passive:!0}),r||L(c(o.parentNode),t,n,i),i.push(o)}function A(e,t,n,i){n.updateBound=i,window.addEventListener("resize",n.updateBound,{passive:!0});var r=c(e);return L(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function T(e,t){return window.removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function k(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function C(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=k(e,function(e){return e[t]===n});return e.indexOf(i)}function M(e,t,n){return(void 0===n?e:e.slice(0,C(e,"name",n))).forEach(function(e){e.enabled&&x(e.function)&&(t=e.function(t,e))}),t}function S(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function H(e){var t=window.document.documentElement,n=b(e,t),i=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),o=f(t),s=f(t,"left");return v({top:o-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r})}function D(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===p(e,"position")||D(u(e)))}function N(e,t,n,i){var r={top:0,left:0},o=l(e,t);if("viewport"===i)r=H(o);else{var s=void 0;"scrollParent"===i?(s=c(u(e)),"BODY"===s.nodeName&&(s=window.document.documentElement)):s="window"===i?window.document.documentElement:i;var a=b(s,o);if("HTML"!==s.nodeName||D(o))r=a;else{var p=m(),f=p.height,d=p.width;r.top+=a.top-a.marginTop,r.bottom=f+a.top,r.left+=a.left-a.marginLeft,r.right=d+a.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function F(e,t,n,i){if(-1===e.indexOf("auto"))return e;var r=N(n,i,0,"scrollParent"),o={top:t.top-r.top,right:r.right-t.right,bottom:r.bottom-t.bottom,left:t.left-r.left},s=Object.keys(o).sort(function(e,t){return o[t]-o[e]})[0],a=e.split("-")[1];return s+(a?"-"+a:"")}function W(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function I(e,t){var n={position:e.offsets.popper.position},o={"x-placement":e.placement},s=Math.round(e.offsets.popper.left),a=Math.round(e.offsets.popper.top),l=r("transform");return t.gpuAcceleration&&l?(n[l]="translate3d("+s+"px, "+a+"px, 0)",n.top=0,n.left=0,n.willChange="transform"):(n.left=s,n.top=a,n.willChange="top, left"),i(e.instance.popper,xe({},n,e.styles)),W(e.instance.popper,xe({},o,e.attributes)),e.offsets.arrow&&i(e.arrowElement,e.offsets.arrow),e}function B(e,t,n,i,r){var o=w(r,t,e);return n.placement=F(n.placement,o,t,e),t.setAttribute("x-placement",n.placement),n}function P(e,t,n){var i=k(e,function(e){return e.name===t});return!!i&&e.some(function(e){return e.name===n&&e.enabled&&e.order<i.order})}function j(e,t){if(!P(e.instance.modifiers,"arrow","keepTogether"))return console.warn("WARNING: `keepTogether` modifier is required by arrow modifier in order to work, be sure to include it before `arrow`!"),e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],r=v(e.offsets.popper),o=e.offsets.reference,s=-1!==["left","right"].indexOf(i),a=s?"height":"width",l=s?"top":"left",p=s?"left":"top",f=s?"bottom":"right",d=y(n)[a];o[f]-d<r[l]&&(e.offsets.popper[l]-=r[l]-(o[f]-d)),o[l]+d>r[f]&&(e.offsets.popper[l]+=o[l]+d-r[f]);var u=o[l]+o[a]/2-d/2,c=u-v(e.offsets.popper)[l];return c=Math.max(Math.min(r[a]-d,c),0),e.arrowElement=n,e.offsets.arrow={},e.offsets.arrow[l]=c,e.offsets.arrow[p]="",e}function z(e){return"end"===e?"start":"start"===e?"end":e}function Y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ce.indexOf(e),i=Ce.slice(n+1).concat(Ce.slice(0,n));return t?i.reverse():i}function q(e,t){if(S(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=N(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split("-")[0],r=E(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Me.FLIP:s=[i,r];break;case Me.CLOCKWISE:s=Y(i);break;case Me.COUNTERCLOCKWISE:s=Y(i,!0);break;default:s=t.behavior}return s.forEach(function(a,l){if(i!==a||s.length===l+1)return e;i=e.placement.split("-")[0],r=E(i);var p=v(e.offsets.popper),f=e.offsets.reference,d=Math.floor,u="left"===i&&d(p.right)>d(f.left)||"right"===i&&d(p.left)<d(f.right)||"top"===i&&d(p.bottom)>d(f.top)||"bottom"===i&&d(p.top)<d(f.bottom),c=d(p.left)<d(n.left),h=d(p.right)>d(n.right),m=d(p.top)<d(n.top),g=d(p.bottom)>d(n.bottom),b="left"===i&&c||"right"===i&&h||"top"===i&&m||"bottom"===i&&g,w=-1!==["top","bottom"].indexOf(i),y=!!t.flipVariations&&(w&&"start"===o&&c||w&&"end"===o&&h||!w&&"start"===o&&m||!w&&"end"===o&&g);(u||b||y)&&(e.flipped=!0,(u||b)&&(i=s[l+1]),y&&(o=z(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=O(e.instance.state.position,e.instance.popper,e.offsets.reference,e.placement),e=M(e.instance.modifiers,e,"flip"))}),e}function R(e){var t=v(e.offsets.popper),n=e.offsets.reference,i=e.placement.split("-")[0],r=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",a=o?"left":"top",l=o?"width":"height";return t[s]<r(n[a])&&(e.offsets.popper[a]=r(n[a])-t[l]),t[a]>r(n[s])&&(e.offsets.popper[a]=r(n[s])),e}function U(e,t){var i=e.placement,r=e.offsets.popper,o=void 0;return n(t.offset)?o=[t.offset,0]:(o=t.offset.split(" "),o=o.map(function(t,n){var r=t.match(/(\d*\.?\d*)(.*)/),o=+r[1],s=r[2],a=-1!==i.indexOf("right")||-1!==i.indexOf("left");1===n&&(a=!a);var l=a?"height":"width";if(0===s.indexOf("%")){var p=void 0;switch(s){case"%p":p=e.offsets.popper;break;case"%":case"$r":default:p=e.offsets.reference}return v(p)[l]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return"px"===s?+o:+t})),-1!==e.placement.indexOf("left")?(r.top+=o[0],r.left-=o[1]||0):-1!==e.placement.indexOf("right")?(r.top+=o[0],r.left+=o[1]||0):-1!==e.placement.indexOf("top")?(r.left+=o[0],r.top-=o[1]||0):-1!==e.placement.indexOf("bottom")&&(r.left+=o[0],r.top+=o[1]||0),e}function _(e,t){var n=t.boundariesElement||a(e.instance.popper),i=N(e.instance.popper,e.instance.reference,t.padding,n);t.boundaries=i;var r=t.priority,o=v(e.offsets.popper),s={primary:function(e){var n=o[e];return o[e]<i[e]&&!t.escapeWithReference&&(n=Math.max(o[e],i[e])),Oe({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=o[n];return o[e]>i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Oe({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=xe({},o,s[t](e))}),e.offsets.popper=o,e}function G(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets.reference,o=v(e.offsets.popper),s=-1!==["bottom","top"].indexOf(n),a=s?"left":"top",l=s?"width":"height",p={start:Oe({},a,r[a]),end:Oe({},a,r[a]+r[l]-o[l])};e.offsets.popper=xe({},o,p[i])}return e}function K(e){if(!P(e.instance.modifiers,"hide","preventOverflow"))return console.warn("WARNING: preventOverflow modifier is required by hide modifier in order to work, be sure to include it before hide!"),e;var t=e.offsets.reference,n=k(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function X(e){var t=e.placement,n=t.split("-")[0],i=v(e.offsets.popper),r=v(e.offsets.reference),o=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[o?"left":"top"]=r[t]-(s?i[o?"width":"height"]:0),e.placement=E(t),e.offsets.popper=v(i),e}function J(){Ie=!0,document.body.classList.add("tippy-touch"),document.removeEventListener("touchstart",J)}function V(e){var t=Q(e.target,je.el),n=Q(e.target,je.popper);if(n){if(Be.refs[Be.poppers.indexOf(n)].settings.interactive)return}if(t){var i=Be.refs[Be.els.indexOf(t)];if(!i.settings.multiple&&Ie||!i.settings.multiple&&-1!==i.settings.trigger.indexOf("click"))return ue(i);if(!0!==i.settings.hideOnClick||-1!==i.settings.trigger.indexOf("click"))return}!Q(e.target,je.controller)&&document.body.querySelector(".tippy-popper")&&ue()}function $(e){for(var t=[!1,"webkit"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length;i++){var r=t[i],o=r?""+r+n:e;if(void 0!==window.document.body.style[o])return o}return null}function Q(e,t){if(!Element.prototype.matches)if(e.matchesSelector)Element.prototype.matches=Element.prototype.matchesSelector;else if(e.webkitMatchesSelector)Element.prototype.matches=Element.prototype.webkitMatchesSelector;else if(e.mozMatchesSelector)Element.prototype.matches=Element.prototype.mozMatchesSelector;else{if(!e.msMatchesSelector)return e;Element.prototype.matches=Element.prototype.msMatchesSelector}return Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),e.closest(t)}function Z(e,t,n){var i=We({placement:n.position},n.popperOptions||{},{modifiers:We({},n.popperOptions?n.popperOptions.modifiers:{},{flip:We({padding:15},n.popperOptions&&n.popperOptions.modifiers?n.popperOptions.modifiers.flip:{}),offset:We({offset:parseInt(n.offset)},n.popperOptions&&n.popperOptions.modifiers?n.popperOptions.modifiers.offset:{})})});document.body.appendChild(t);var r=new De(e,t,i);return r.disableEventListeners(),document.body.removeChild(t),r}function ee(e,t){var n=document.createElement("div");n.setAttribute("class","tippy-popper");var i=document.createElement("div");if(i.setAttribute("class","tippy-tooltip tippy-tooltip--"+t.size+" "+t.theme+" leave"),i.setAttribute("data-animation",t.animation),t.arrow){var r=document.createElement("div");r.setAttribute("class","arrow-"+t.arrowSize),r.setAttribute("x-arrow",""),i.appendChild(r)}if(t.animateFill){i.setAttribute("data-animatefill","");var o=document.createElement("div");o.setAttribute("class","leave"),o.setAttribute("x-circle",""),i.appendChild(o)}t.inertia&&i.setAttribute("data-inertia","");var s=document.createElement("div");if(s.setAttribute("class","tippy-tooltip-content"),t.html){var a=void 0;t.html instanceof Element?(s.innerHTML=t.html.innerHTML,a=t.html.id||"tippy-html-template"):(s.innerHTML=document.getElementById(t.html.replace("#","")).innerHTML,a=t.html),n.classList.add("html-template"),n.setAttribute("tabindex","0"),i.setAttribute("data-template-id",a)}else s.innerHTML=e;return i.appendChild(s),n.appendChild(i),n}function te(e,t,n){if("manual"!==e){var i=[];return t.addEventListener(e,n.handleTrigger),i.push({event:e,handler:n.handleTrigger}),"mouseenter"===e&&(t.addEventListener("mouseleave",n.handleMouseleave),i.push({event:"mouseleave",handler:n.handleMouseleave})),"focus"===e&&(t.addEventListener("blur",n.handleBlur),i.push({event:"blur",handler:n.handleBlur})),i}}function ne(e){Be.refs.push(e),Be.els.push(e.el),Be.poppers.push(e.popper)}function ie(e){var t=e.getAttribute("title");e.setAttribute("data-original-title",t||"html"),e.removeAttribute("title")}function re(e){var t=Be.refs[Be.els.indexOf(this)],n=t.popper.getAttribute("x-placement"),i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,r=Math.round(t.popper.offsetWidth/2),o=Math.round(t.popper.offsetHeight/2),s=e.clientX-r,a=e.clientY+i-2.5*o;"left"===n?(s=e.clientX-2*r-15,a=e.clientY+i-o):"right"===n?(s=e.clientX+o,a=e.clientY+i-o):"bottom"===n&&(a=e.clientY+i+o/1.5),t.popper.style[$("transform")]="translate3d("+s+"px, "+a+"px, 0)"}function oe(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function se(e,t){t?window.getComputedStyle(t)[$("transform")]:window.getComputedStyle(e).opacity}function ae(e,t){e.forEach(function(e){e&&t(e.classList)})}function le(e,t){e.forEach(function(e){e&&(e.style[$("transitionDuration")]=t+"ms")})}function pe(e,t){setTimeout(function(){e.settings.position!==e.popper.getAttribute("x-placement")?(e.flipped=!0,t()):e.flipped&&e.settings.position===e.popper.getAttribute("x-placement")&&(e.flipped=!1,t())},0)}function fe(e,t,n){var i=function i(){t||(e.popper.removeEventListener("webkitTransitionEnd",i),e.popper.removeEventListener("transitionend",i)),n()};if(t)return i();e.popper.addEventListener("webkitTransitionEnd",i),e.popper.addEventListener("transitionend",i)}function de(e){document.body.appendChild(e.popper),e.popper.style.visibility="visible",e.instance.update(),e.settings.followCursor&&!Ie?e.hasFollowCursorListener||(e.hasFollowCursorListener=!0,e.el.addEventListener("mousemove",re)):e.instance.enableEventListeners()}function ue(e){Be.refs.forEach(function(t){document.body.contains(t.popper)&&(!0!==t.settings.hideOnClick||e&&t.popper===e.popper||Ye.hide(t.popper,t.settings.hideDuration))})}for(var ce=["native code","[object MutationObserverConstructor]"],he="undefined"!=typeof window,me=["Edge","Trident","Firefox"],ve=0,ge=0;ge<me.length;ge+=1)if(he&&navigator.userAgent.indexOf(me[ge])>=0){ve=1;break}var be=he&&function(e){return ce.some(function(t){return(e||"").toString().indexOf(t)>-1})}(window.MutationObserver),we=be?e:t,ye=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ee=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Oe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Le=function(){return-1!==navigator.appVersion.indexOf("MSIE 10")},Ae=Le(),Te=Le(),ke=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Ce=ke.slice(3),Me={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},Se={shift:{order:100,enabled:!0,function:G},offset:{order:200,enabled:!0,function:U,offset:0},preventOverflow:{order:300,enabled:!0,function:_,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,function:R},arrow:{order:500,enabled:!0,function:j,element:"[x-arrow]"},flip:{order:600,enabled:!0,function:q,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,function:X},hide:{order:800,enabled:!0,function:K},applyStyle:{order:900,enabled:!0,function:I,onLoad:B,gpuAcceleration:!0}},He={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Se},De=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ye(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=we(this.update.bind(this)),this.options=xe({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=n.jquery?n[0]:n,i(this.popper,{position:"absolute"}),this.modifiers=Object.keys(e.Defaults.modifiers).map(function(t){return xe({name:t},e.Defaults.modifiers[t])}),this.modifiers=this.modifiers.map(function(e){var t=o.modifiers&&o.modifiers[e.name]||{};return xe({},e,t)}),o.modifiers&&(this.options.modifiers=xe({},e.Defaults.modifiers,o.modifiers),Object.keys(o.modifiers).forEach(function(t){if(void 0===e.Defaults.modifiers[t]){var n=o.modifiers[t];n.name=t,r.modifiers.push(n)}})),this.modifiers=this.modifiers.sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&x(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return Ee(e,[{key:"update",value:function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=w(this.state,this.popper,this.reference),e.placement=F(this.options.placement,e.offsets.reference,this.popper,this.reference),e.originalPlacement=this.options.placement,e.offsets.popper=O(this.state,this.popper,e.offsets.reference,e.placement),e=M(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}},{key:"destroy",value:function(){return this.state.isDestroyed=!0,S(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[r("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}},{key:"enableEventListeners",value:function(){this.state.eventsEnabled||(this.state=A(this.reference,this.options,this.state,this.scheduleUpdate))}},{key:"disableEventListeners",value:function(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=T(this.reference,this.state))}}]),e}();De.Utils=window.PopperUtils,De.placements=ke,De.Defaults=He;var Ne=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Fe=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ie=!1,Be={refs:[],els:[],poppers:[]},Pe={html:!1,position:"top",animation:"shift",animateFill:!0,arrow:!1,arrowSize:"regular",delay:0,hideDelay:0,trigger:"mouseenter focus",duration:375,hideDuration:375,interactive:!1,theme:"dark",size:"regular",offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,transitionFlip:!0,popperOptions:{}},je={popper:".tippy-popper",tooltip:".tippy-tooltip",content:".tippy-tooltip-content",circle:"[x-circle]",arrow:"[x-arrow]",el:"[data-tooltipped]",controller:"[data-tippy-controller]"};document.addEventListener("click",V),document.addEventListener("touchstart",J);var ze=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ne(this,e),"addEventListener"in window&&!/MSIE 9/i.test(navigator.userAgent)&&!window.operamini&&(this.settings=We(JSON.parse(JSON.stringify(Pe)),n),this.callbacks={wait:n.wait,beforeShown:n.beforeShown||new Function,shown:n.shown||new Function,beforeHidden:n.beforeHidden||new Function,hidden:n.hidden||new Function},this.els=t instanceof Element?[t]:[].slice.call(document.querySelectorAll(t)),this._createTooltips())}return Fe(e,[{key:"_applyIndividualSettings",value:function(e){var t=e.getAttribute("data-html")||this.settings.html;t&&"false"!==t||(t=!1);var n=e.getAttribute("data-position")||this.settings.position,i=e.getAttribute("data-animation")||this.settings.animation,r=e.getAttribute("data-animatefill")||this.settings.animateFill;"false"===r&&(r=!1);var o=e.getAttribute("data-arrow")||this.settings.arrow;o&&"false"!==o?r=!1:o=!1;var s=e.getAttribute("data-arrowsize")||this.settings.arrowSize,a=e.getAttribute("data-trigger")||this.settings.trigger;a&&(a=a.trim().split(" "));var l=e.getAttribute("data-theme")||this.settings.theme;l&&(l+="-theme");var p=e.getAttribute("data-size")||this.settings.size,f=parseInt(e.getAttribute("data-delay"));f||0===f||(f=this.settings.delay);var d=parseInt(e.getAttribute("data-hidedelay"));d||0===d||(d=this.settings.hideDelay);var u=parseInt(e.getAttribute("data-duration"));u||0===u||(u=this.settings.duration);var c=parseInt(e.getAttribute("data-hideduration"));c||0===c||(c=this.settings.hideDuration);var h=e.getAttribute("data-interactive")||this.settings.interactive;"false"===h&&(h=!1);var m=parseInt(e.getAttribute("data-offset"));m||0===m||(m=this.settings.offset);var v=e.getAttribute("data-hideonclick")||this.settings.hideOnClick;"false"===v&&(v=!1);var g=e.getAttribute("data-multiple")||this.settings.multiple;"false"===g&&(g=!1);var b=e.getAttribute("data-followcursor")||this.settings.followCursor;"false"===b&&(b=!1);var w=e.getAttribute("data-inertia")||this.settings.inertia;"false"===w&&(w=!1);var y=e.getAttribute("data-transitionflip")||this.settings.transitionFlip;return"false"===y&&(y=!1),{html:t,position:n,animation:i,animateFill:r,arrow:o,arrowSize:s,delay:f,hideDelay:d,trigger:a,duration:u,hideDuration:c,interactive:h,theme:l,size:p,offset:m,hideOnClick:v,multiple:g,followCursor:b,inertia:w,transitionFlip:y,popperOptions:this.settings.popperOptions}}},{key:"_getEventListenerHandlers",value:function(e,t,n){var i=this,r=function(){if(clearTimeout(t.getAttribute("data-delay")),clearTimeout(t.getAttribute("data-hidedelay")),n.delay){var e=setTimeout(function(){return i.show(t,n.duration)},n.delay);t.setAttribute("data-delay",e)}else i.show(t,n.duration)},o=function(){return i.callbacks.wait?i.callbacks.wait(r):r()},s=function(){if(clearTimeout(t.getAttribute("data-hidedelay")),clearTimeout(t.getAttribute("data-delay")),n.hideDelay){var e=setTimeout(function(){return i.hide(t,n.hideDuration)},n.hideDelay);t.setAttribute("data-hidedelay",e)}else i.hide(t,n.hideDuration)};return{handleTrigger:function(e){if(n.interactive&&e.target.classList.add("active"),"click"===e.type&&"visible"===t.style.visibility&&"persistent"!==n.hideOnClick)return s();o()},handleMouseleave:function(i){if(n.interactive){var r=function i(r){Q(r.target,je.popper)!==t&&Q(r.target,je.el)!==e&&-1===n.trigger.indexOf("click")&&(document.removeEventListener("mousemove",i),s())};return document.addEventListener("mousemove",r)}s()},handleBlur:function(e){!Ie&&e.relatedTarget&&(Q(e.relatedTarget,je.popper)||s())}}}},{key:"_createTooltips",value:function(){var t=this;this.els.forEach(function(e){e.setAttribute("data-tooltipped","");var n=t._applyIndividualSettings(e),i=e.getAttribute("title");if(i||n.html){ie(e);var r=ee(i,n),o=Z(e,r,n),s=t._getEventListenerHandlers(e,r,n),a=[];n.trigger.forEach(function(t){return a=a.concat(te(t,e,s))}),ne({el:e,popper:r,settings:n,listeners:a,instance:o})}}),e.store=Be}},{key:"getPopperElement",value:function(e){try{return Be.refs[Be.els.indexOf(e)].popper}catch(e){throw new Error("[Tippy error]: Element does not exist in any Tippy instances")}}},{key:"getTooltippedElement",value:function(e){try{return Be.refs[Be.poppers.indexOf(e)].el}catch(e){throw new Error("[Tippy error]: Popper does not exist in any Tippy instances")}}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("visible"!==e.style.visibility){var r=Be.refs[Be.poppers.indexOf(e)],o=e.querySelector(je.tooltip),s=e.querySelector(je.circle);i&&(this.callbacks.beforeShown(),pe(r,function(){t.hide(e,0,!1),setTimeout(function(){return t.show(e,n,!1)},0)})),de(r),se(o,s),ae([o,s],function(e){e.remove("leave"),e.add("enter")}),le([o,s],n),fe(r,n<20,function(){"hidden"===e.style.visibility||r.onShownFired||(r.settings.transitionFlip||o.classList.add("tippy-notransition"),r.settings.interactive&&-1!==r.settings.trigger.indexOf("click")&&e.focus(),r.onShownFired=!0,i&&t.callbacks.shown())})}}},{key:"hide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(document.body.contains(e)){var r=Be.refs[Be.poppers.indexOf(e)],o=e.querySelector(je.tooltip),s=e.querySelector(je.circle);i&&(this.callbacks.beforeHidden(),r.el.classList.remove("active"),r.onShownFired=!1,r.settings.transitionFlip||o.classList.remove("tippy-notransition"),r.flipped=r.settings.position!==e.getAttribute("x-placement")),e.style.visibility="hidden",n===Pe.hideDuration?n=parseInt(o.style[$("transitionDuration")]):le([o,s],n),ae([o,s],function(e){e.remove("enter"),e.add("leave")}),r.settings.html&&-1!==r.settings.trigger.indexOf("click")&&oe(r.el)&&r.el.focus(),fe(r,n<20,function(){"visible"!==e.style.visibility&&document.body.contains(e)&&(r.hasFollowCursorListener&&(r.el.removeEventListener("mousemove",re),r.hasFollowCursorListener=!1),r.instance.disableEventListeners(),document.body.removeChild(e),i&&t.callbacks.hidden())})}}},{key:"destroy",value:function(e){var t=Be.poppers.indexOf(e),n=Be.refs[t];n.listeners.forEach(function(e){return n.el.removeEventListener(e.event,e.handler)}),n.el.removeAttribute("data-tooltipped"),n.instance.destroy(),Be.refs.splice(t,1),Be.els.splice(t,1),Be.poppers.splice(t,1)}},{key:"update",value:function(e){var t=Be.refs[Be.poppers.indexOf(e)],n=e.querySelector(je.content),i=t.settings.html;i?n.innerHTML=i instanceof Element?i.innerHTML:document.getElementById(i.replace("#","")).innerHTML:(n.innerHTML=t.el.getAttribute("title")||t.el.getAttribute("data-original-title"),ie(t.el))}}]),e}(),Ye=new ze;return ze}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tippy=t()}(this,function(){"use strict";function e(e){var t=!1,n=0,i=document.createElement("span");return new MutationObserver(function(){e(),t=!1}).observe(i,{attributes:!0}),function(){t||(t=!0,i.setAttribute("x-index",n),n+=1)}}function t(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},ve))}}function n(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function i(e,t){Object.keys(t).forEach(function(i){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(i)&&n(t[i])&&(r="px"),e.style[i]=t[i]+r})}function r(e){for(var t=[!1,"ms","webkit","moz","o"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length-1;i++){var r=t[i],o=r?""+r+n:e;if(void 0!==window.document.body.style[o])return o}return null}function o(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||e.firstElementChild.offsetParent===e)}function s(e){return null!==e.parentNode?s(e.parentNode):e}function a(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?t:window.document.documentElement}function p(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return window.document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,l=document.createRange();l.setStart(i,0),l.setEnd(r,0);var f=l.commonAncestorContainer;if(e!==f&&t!==f)return o(f)?f:a(f);var d=s(e);return d.host?p(d.host,t):p(e,s(t).host)}function l(e,t){if(1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var r=window.document.documentElement;return(window.document.scrollingElement||r)[n]}return e[n]}function d(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=f(t,"top"),r=f(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function u(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e||-1!==["HTML","BODY","#document"].indexOf(e.nodeName))return window.document.body;var t=l(e),n=t.overflow,i=t.overflowX;return/(auto|scroll)/.test(n+t.overflowY+i)?e:c(u(e))}function h(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return+e["border"+n+"Width"].split("px")[0]+ +e["border"+i+"Width"].split("px")[0]}function m(){var e=window.document.body,t=window.document.documentElement;return{height:Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight),width:Math.max(e.scrollWidth,e.offsetWidth,t.clientWidth,t.scrollWidth,t.offsetWidth)}}function v(e){return xe({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var t={};if(Te)try{t=e.getBoundingClientRect();var n=f(e,"top"),i=f(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}catch(e){}else t=e.getBoundingClientRect();var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?m():{},s=o.width||e.clientWidth||r.right-r.left,a=o.height||e.clientHeight||r.bottom-r.top,p=e.offsetWidth-s,d=e.offsetHeight-a;if(p||d){var u=l(e);p-=h(u,"x"),d-=h(u,"y"),r.width-=p,r.height-=d}return v(r)}function b(e,t){var n="HTML"===t.nodeName,i=g(e),r=g(t),o=c(e),s=v({top:i.top-r.top,left:i.left-r.left,width:i.width,height:i.height});if(n||"BODY"===t.nodeName){var a=l(t),p=ke&&n?0:+a.borderTopWidth.split("px")[0],f=ke&&n?0:+a.borderLeftWidth.split("px")[0],u=ke&&n?0:+a.marginTop.split("px")[0],h=ke&&n?0:+a.marginLeft.split("px")[0];s.top-=p-u,s.bottom-=p-u,s.left-=f-h,s.right-=f-h,s.marginTop=u,s.marginLeft=h}return t.contains(o)&&(ke||"BODY"!==o.nodeName)&&(s=d(s,t)),s}function w(e,t,n){return b(n,p(t,n))}function y(e){var t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function E(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function O(e,t,n,i){i=i.split("-")[0];var r=y(t),o={position:e,width:r.width,height:r.height},s=-1!==["right","left"].indexOf(i),a=s?"top":"left",p=s?"left":"top",l=s?"height":"width",f=s?"width":"height";return o[a]=n[a]+n[l]/2-r[l]/2,o[p]=i===p?n[p]-r[f]:n[E(p)],o}function x(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function L(e,t,n,i){var r="BODY"===e.nodeName,o=r?window:e;o.addEventListener(t,n,{passive:!0}),r||L(c(o.parentNode),t,n,i),i.push(o)}function T(e,t,n,i){n.updateBound=i,window.addEventListener("resize",n.updateBound,{passive:!0});var r=c(e);return L(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function k(e,t){return window.removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function A(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function C(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=A(e,function(e){return e[t]===n});return e.indexOf(i)}function M(e,t,n){return(void 0===n?e:e.slice(0,C(e,"name",n))).forEach(function(e){e.enabled&&x(e.function)&&(t=e.function(t,e))}),t}function S(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function H(e){var t=window.document.documentElement,n=b(e,t),i=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),o=f(t),s=f(t,"left");return v({top:o-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r})}function N(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===l(e,"position")||N(u(e)))}function D(e,t,n,i){var r={top:0,left:0},o=p(e,t);if("viewport"===i)r=H(o);else{var s=void 0;"scrollParent"===i?(s=c(u(e)),"BODY"===s.nodeName&&(s=window.document.documentElement)):s="window"===i?window.document.documentElement:i;var a=b(s,o);if("HTML"!==s.nodeName||N(o))r=a;else{var l=m(),f=l.height,d=l.width;r.top+=a.top-a.marginTop,r.bottom=f+a.top,r.left+=a.left-a.marginLeft,r.right=d+a.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function W(e,t,n,i){if(-1===e.indexOf("auto"))return e;var r=D(n,i,0,"scrollParent"),o={top:t.top-r.top,right:r.right-t.right,bottom:r.bottom-t.bottom,left:t.left-r.left},s=Object.keys(o).sort(function(e,t){return o[t]-o[e]})[0],a=e.split("-")[1];return s+(a?"-"+a:"")}function F(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function B(e,t){var n={position:e.offsets.popper.position},o={"x-placement":e.placement},s=Math.round(e.offsets.popper.left),a=Math.round(e.offsets.popper.top),p=r("transform");return t.gpuAcceleration&&p?(n[p]="translate3d("+s+"px, "+a+"px, 0)",n.top=0,n.left=0,n.willChange="transform"):(n.left=s,n.top=a,n.willChange="top, left"),i(e.instance.popper,xe({},n,e.styles)),F(e.instance.popper,xe({},o,e.attributes)),e.offsets.arrow&&i(e.arrowElement,e.offsets.arrow),e}function P(e,t,n,i,r){var o=w(r,t,e);return n.placement=W(n.placement,o,t,e),t.setAttribute("x-placement",n.placement),n}function I(e,t,n){var i=A(e,function(e){return e.name===t});return!!i&&e.some(function(e){return e.name===n&&e.enabled&&e.order<i.order})}function j(e,t){if(!I(e.instance.modifiers,"arrow","keepTogether"))return console.warn("WARNING: `keepTogether` modifier is required by arrow modifier in order to work, be sure to include it before `arrow`!"),e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],r=v(e.offsets.popper),o=e.offsets.reference,s=-1!==["left","right"].indexOf(i),a=s?"height":"width",p=s?"top":"left",l=s?"left":"top",f=s?"bottom":"right",d=y(n)[a];o[f]-d<r[p]&&(e.offsets.popper[p]-=r[p]-(o[f]-d)),o[p]+d>r[f]&&(e.offsets.popper[p]+=o[p]+d-r[f]);var u=o[p]+o[a]/2-d/2,c=u-v(e.offsets.popper)[p];return c=Math.max(Math.min(r[a]-d,c),0),e.arrowElement=n,e.offsets.arrow={},e.offsets.arrow[p]=c,e.offsets.arrow[l]="",e}function q(e){return"end"===e?"start":"start"===e?"end":e}function Y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ce.indexOf(e),i=Ce.slice(n+1).concat(Ce.slice(0,n));return t?i.reverse():i}function R(e,t){if(S(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=D(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split("-")[0],r=E(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Me.FLIP:s=[i,r];break;case Me.CLOCKWISE:s=Y(i);break;case Me.COUNTERCLOCKWISE:s=Y(i,!0);break;default:s=t.behavior}return s.forEach(function(a,p){if(i!==a||s.length===p+1)return e;i=e.placement.split("-")[0],r=E(i);var l=v(e.offsets.popper),f=e.offsets.reference,d=Math.floor,u="left"===i&&d(l.right)>d(f.left)||"right"===i&&d(l.left)<d(f.right)||"top"===i&&d(l.bottom)>d(f.top)||"bottom"===i&&d(l.top)<d(f.bottom),c=d(l.left)<d(n.left),h=d(l.right)>d(n.right),m=d(l.top)<d(n.top),g=d(l.bottom)>d(n.bottom),b="left"===i&&c||"right"===i&&h||"top"===i&&m||"bottom"===i&&g,w=-1!==["top","bottom"].indexOf(i),y=!!t.flipVariations&&(w&&"start"===o&&c||w&&"end"===o&&h||!w&&"start"===o&&m||!w&&"end"===o&&g);(u||b||y)&&(e.flipped=!0,(u||b)&&(i=s[p+1]),y&&(o=q(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=O(e.instance.state.position,e.instance.popper,e.offsets.reference,e.placement),e=M(e.instance.modifiers,e,"flip"))}),e}function U(e){var t=v(e.offsets.popper),n=e.offsets.reference,i=e.placement.split("-")[0],r=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",a=o?"left":"top",p=o?"width":"height";return t[s]<r(n[a])&&(e.offsets.popper[a]=r(n[a])-t[p]),t[a]>r(n[s])&&(e.offsets.popper[a]=r(n[s])),e}function z(e,t){var i=e.placement,r=e.offsets.popper,o=void 0;return n(t.offset)?o=[t.offset,0]:(o=t.offset.split(" "),o=o.map(function(t,n){var r=t.match(/(\d*\.?\d*)(.*)/),o=+r[1],s=r[2],a=-1!==i.indexOf("right")||-1!==i.indexOf("left");1===n&&(a=!a);var p=a?"height":"width";if(0===s.indexOf("%")){var l=void 0;switch(s){case"%p":l=e.offsets.popper;break;case"%":case"$r":default:l=e.offsets.reference}return v(l)[p]/100*o}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return"px"===s?+o:+t})),-1!==e.placement.indexOf("left")?(r.top+=o[0],r.left-=o[1]||0):-1!==e.placement.indexOf("right")?(r.top+=o[0],r.left+=o[1]||0):-1!==e.placement.indexOf("top")?(r.left+=o[0],r.top-=o[1]||0):-1!==e.placement.indexOf("bottom")&&(r.left+=o[0],r.top+=o[1]||0),e}function _(e,t){var n=t.boundariesElement||a(e.instance.popper),i=D(e.instance.popper,e.instance.reference,t.padding,n);t.boundaries=i;var r=t.priority,o=v(e.offsets.popper),s={primary:function(e){var n=o[e];return o[e]<i[e]&&!t.escapeWithReference&&(n=Math.max(o[e],i[e])),Oe({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=o[n];return o[e]>i[e]&&!t.escapeWithReference&&(r=Math.min(o[n],i[e]-("right"===e?o.width:o.height))),Oe({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";o=xe({},o,s[t](e))}),e.offsets.popper=o,e}function G(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets.reference,o=v(e.offsets.popper),s=-1!==["bottom","top"].indexOf(n),a=s?"left":"top",p=s?"width":"height",l={start:Oe({},a,r[a]),end:Oe({},a,r[a]+r[p]-o[p])};e.offsets.popper=xe({},o,l[i])}return e}function J(e){if(!I(e.instance.modifiers,"hide","preventOverflow"))return console.warn("WARNING: preventOverflow modifier is required by hide modifier in order to work, be sure to include it before hide!"),e;var t=e.offsets.reference,n=A(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function K(e){var t=e.placement,n=t.split("-")[0],i=v(e.offsets.popper),r=v(e.offsets.reference),o=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[o?"left":"top"]=r[t]-(s?i[o?"width":"height"]:0),e.placement=E(t),e.offsets.popper=v(i),e}function X(){Be=!0,document.body.classList.add("tippy-touch"),document.removeEventListener("touchstart",X)}function V(e){var t=Q(e.target,qe.el),n=Q(e.target,qe.popper);if(n){if(Pe.refs[Pe.poppers.indexOf(n)].settings.interactive)return}if(t){var i=Pe.refs[Pe.els.indexOf(t)];if(!i.settings.multiple&&Be||!i.settings.multiple&&-1!==i.settings.trigger.indexOf("click"))return ue(i);if(!0!==i.settings.hideOnClick||-1!==i.settings.trigger.indexOf("click"))return}!Q(e.target,qe.controller)&&document.body.querySelector(qe.popper)&&ue()}function $(e){for(var t=[!1,"webkit"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length;i++){var r=t[i],o=r?""+r+n:e;if(void 0!==window.document.body.style[o])return o}return null}function Q(e,t){return Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1}),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),e.closest(t)}function Z(e){var t=e.settings,n=Fe({placement:t.position},t.popperOptions||{},{modifiers:Fe({},t.popperOptions?t.popperOptions.modifiers:{},{flip:Fe({padding:15},t.popperOptions&&t.popperOptions.modifiers?t.popperOptions.modifiers.flip:{}),offset:Fe({offset:parseInt(t.offset)},t.popperOptions&&t.popperOptions.modifiers?t.popperOptions.modifiers.offset:{})})});return new Ne(e.el,e.popper,n)}function ee(e,t){var n=document.createElement("div");n.setAttribute("class","tippy-popper");var i=document.createElement("div");if(i.setAttribute("class","tippy-tooltip tippy-tooltip--"+t.size+" "+t.theme+"-theme leave"),i.setAttribute("data-animation",t.animation),t.arrow){var r=document.createElement("div");r.setAttribute("class","arrow-"+t.arrowSize),r.setAttribute("x-arrow",""),i.appendChild(r)}if(t.animateFill){i.setAttribute("data-animatefill","");var o=document.createElement("div");o.setAttribute("class","leave"),o.setAttribute("x-circle",""),i.appendChild(o)}t.inertia&&i.setAttribute("data-inertia","");var s=document.createElement("div");if(s.setAttribute("class","tippy-tooltip-content"),t.html){var a=void 0;t.html instanceof Element?(s.innerHTML=t.html.innerHTML,a=t.html.id||"tippy-html-template"):(s.innerHTML=document.getElementById(t.html.replace("#","")).innerHTML,a=t.html),n.classList.add("html-template"),n.setAttribute("tabindex","0"),i.setAttribute("data-template-id",a)}else s.innerHTML=e;return i.appendChild(s),n.appendChild(i),n}function te(e,t,n){var i=[];return"manual"===e?i:(t.addEventListener(e,n.handleTrigger),i.push({event:e,handler:n.handleTrigger}),"mouseenter"===e&&(t.addEventListener("mouseleave",n.handleMouseleave),i.push({event:"mouseleave",handler:n.handleMouseleave})),"focus"===e&&(t.addEventListener("blur",n.handleBlur),i.push({event:"blur",handler:n.handleBlur})),i)}function ne(e){Pe.refs.push(e),Pe.els.push(e.el),Pe.poppers.push(e.popper)}function ie(e){var t=e.getAttribute("title");e.setAttribute("data-original-title",t||"html"),e.removeAttribute("title")}function re(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function oe(e){var t=Pe.refs[Pe.els.indexOf(this)],n=t.popper.getAttribute("x-placement"),i=Math.round(t.popper.offsetWidth/2),r=Math.round(t.popper.offsetHeight/2),o=e.pageX-i,s=e.pageY-2.5*r;"left"===n?(o=e.pageX-2*i-15,s=e.pageY-r):"right"===n?(o=e.pageX+r,s=e.pageY-r):"bottom"===n&&(s=e.pageY+r/1.5),t.popper.style[$("transform")]="translate3d("+o+"px, "+s+"px, 0)"}function se(e,t){t?window.getComputedStyle(t)[$("transform")]:window.getComputedStyle(e).opacity}function ae(e,t){e.forEach(function(e){e&&t(e.classList)})}function pe(e,t){e.forEach(function(e){e&&(e.hasAttribute("x-circle")&&(t=Math.round(t/1.25)),e.style[$("transitionDuration")]=t+"ms")})}function le(e,t){setTimeout(function(){e.settings.position!==e.popper.getAttribute("x-placement")?(e.flipped=!0,t()):e.flipped&&e.settings.position===e.popper.getAttribute("x-placement")&&(e.flipped=!1,t())},0)}function fe(e,t,n){var i=function i(){t||(e.popper.removeEventListener("webkitTransitionEnd",i),e.popper.removeEventListener("transitionend",i)),n()};if(t)return i();e.popper.addEventListener("webkitTransitionEnd",i),e.popper.addEventListener("transitionend",i)}function de(e){document.body.appendChild(e.popper),e.popper.style.visibility="visible",!e.settings.followCursor||e.hasFollowCursorListener||Be||(e.hasFollowCursorListener=!0,e.el.addEventListener("mousemove",oe)),e.instance?(e.instance.update(),e.settings.followCursor||e.instance.enableEventListeners()):(e.instance=Z(e),e.settings.followCursor&&!Be&&e.instance.disableEventListeners())}function ue(e){Pe.refs.forEach(function(t){document.body.contains(t.popper)&&(!0!==t.settings.hideOnClick||e&&t.popper===e.popper||Re.hide(t.popper,t.settings.hideDuration))})}for(var ce=["native code","[object MutationObserverConstructor]"],he="undefined"!=typeof window,me=["Edge","Trident","Firefox"],ve=0,ge=0;ge<me.length;ge+=1)if(he&&navigator.userAgent.indexOf(me[ge])>=0){ve=1;break}var be=he&&function(e){return ce.some(function(t){return(e||"").toString().indexOf(t)>-1})}(window.MutationObserver),we=be?e:t,ye=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ee=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Oe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Le=function(){return-1!==navigator.appVersion.indexOf("MSIE 10")},Te=Le(),ke=Le(),Ae=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Ce=Ae.slice(3),Me={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},Se={shift:{order:100,enabled:!0,function:G},offset:{order:200,enabled:!0,function:z,offset:0},preventOverflow:{order:300,enabled:!0,function:_,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,function:U},arrow:{order:500,enabled:!0,function:j,element:"[x-arrow]"},flip:{order:600,enabled:!0,function:R,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,function:K},hide:{order:800,enabled:!0,function:J},applyStyle:{order:900,enabled:!0,function:B,onLoad:P,gpuAcceleration:!0}},He={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Se},Ne=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ye(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=we(this.update.bind(this)),this.options=xe({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=n.jquery?n[0]:n,i(this.popper,{position:"absolute"}),this.modifiers=Object.keys(e.Defaults.modifiers).map(function(t){return xe({name:t},e.Defaults.modifiers[t])}),this.modifiers=this.modifiers.map(function(e){var t=o.modifiers&&o.modifiers[e.name]||{};return xe({},e,t)}),o.modifiers&&(this.options.modifiers=xe({},e.Defaults.modifiers,o.modifiers),Object.keys(o.modifiers).forEach(function(t){if(void 0===e.Defaults.modifiers[t]){var n=o.modifiers[t];n.name=t,r.modifiers.push(n)}})),this.modifiers=this.modifiers.sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&x(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return Ee(e,[{key:"update",value:function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=w(this.state,this.popper,this.reference),e.placement=W(this.options.placement,e.offsets.reference,this.popper,this.reference),e.originalPlacement=this.options.placement,e.offsets.popper=O(this.state,this.popper,e.offsets.reference,e.placement),e=M(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}},{key:"destroy",value:function(){return this.state.isDestroyed=!0,S(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[r("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}},{key:"enableEventListeners",value:function(){this.state.eventsEnabled||(this.state=T(this.reference,this.options,this.state,this.scheduleUpdate))}},{key:"disableEventListeners",value:function(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=k(this.reference,this.state))}}]),e}();Ne.Utils=window.PopperUtils,Ne.placements=Ae,Ne.Defaults=He;var De=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},We=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Fe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Be=!1,Pe={refs:[],els:[],poppers:[]},Ie={html:!1,position:"top",animation:"shift",animateFill:!0,arrow:!1,arrowSize:"regular",delay:0,hideDelay:0,trigger:"mouseenter focus",duration:375,hideDuration:375,interactive:!1,theme:"dark",size:"regular",offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,transitionFlip:!0,popperOptions:{}},je=Object.keys(Ie),qe={popper:".tippy-popper",tooltip:".tippy-tooltip",content:".tippy-tooltip-content",circle:"[x-circle]",arrow:"[x-arrow]",el:"[data-tooltipped]",controller:"[data-tippy-controller]"};document.addEventListener("click",V),document.addEventListener("touchstart",X);var Ye=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(De(this,e),"addEventListener"in window&&!/MSIE 9/i.test(navigator.userAgent)&&!window.operamini){this.settings=Fe(JSON.parse(JSON.stringify(Ie)),n),this.callbacks={wait:n.wait,beforeShown:n.beforeShown||new Function,shown:n.shown||new Function,beforeHidden:n.beforeHidden||new Function,hidden:n.hidden||new Function};var i=t instanceof Element?[t]:[].slice.call(document.querySelectorAll(t));this._createTooltips(i)}}return We(e,[{key:"_applyIndividualSettings",value:function(e){var t=this,n={};return je.forEach(function(i){var r=e.getAttribute("data-"+i.toLowerCase())||t.settings[i];null!==r&&"false"!==r||(r=!1),n[i]=r}),n.arrow&&(n.animateFill=!1),Fe(JSON.parse(JSON.stringify(this.settings)),n)}},{key:"_getEventListenerHandlers",value:function(e,t,n){var i=this,r=function(){if(clearTimeout(t.getAttribute("data-delay")),clearTimeout(t.getAttribute("data-hidedelay")),n.delay){var e=setTimeout(function(){return i.show(t,n.duration)},n.delay);t.setAttribute("data-delay",e)}else i.show(t,n.duration)},o=function(){return i.callbacks.wait?i.callbacks.wait(r):r()},s=function(){if(clearTimeout(t.getAttribute("data-hidedelay")),clearTimeout(t.getAttribute("data-delay")),n.hideDelay){var e=setTimeout(function(){return i.hide(t,n.hideDuration)},n.hideDelay);t.setAttribute("data-hidedelay",e)}else i.hide(t,n.hideDuration)};return{handleTrigger:function(e){if(n.interactive&&e.target.classList.add("active"),"click"===e.type&&"visible"===t.style.visibility&&"persistent"!==n.hideOnClick)return s();o()},handleMouseleave:function(i){if(n.interactive){var r=function i(r){Q(r.target,qe.popper)!==t&&Q(r.target,qe.el)!==e&&-1===n.trigger.indexOf("click")&&(document.removeEventListener("mousemove",i),s())};return document.addEventListener("mousemove",r)}s()},handleBlur:function(e){!Be&&e.relatedTarget&&(Q(e.relatedTarget,qe.popper)||s())}}}},{key:"_createTooltips",value:function(t){var n=this;t.forEach(function(e){e.setAttribute("data-tooltipped","");var t=n._applyIndividualSettings(e),i=e.getAttribute("title");if(i||t.html){ie(e);var r=ee(i,t),o=n._getEventListenerHandlers(e,r,t),s=[];t.trigger.trim().split(" ").forEach(function(t){return s=s.concat(te(t,e,o))}),ne({el:e,popper:r,settings:t,listeners:s})}}),e.store=Pe}},{key:"getPopperElement",value:function(e){try{return Pe.refs[Pe.els.indexOf(e)].popper}catch(e){throw new Error("[Tippy error]: Element does not exist in any Tippy instances")}}},{key:"getTooltippedElement",value:function(e){try{return Pe.refs[Pe.poppers.indexOf(e)].el}catch(e){throw new Error("[Tippy error]: Popper does not exist in any Tippy instances")}}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Pe.refs[Pe.poppers.indexOf(e)],o=e.querySelector(qe.tooltip),s=e.querySelector(qe.circle);i&&(this.callbacks.beforeShown(),n>=20&&le(r,function(){t.hide(e,0,!1),setTimeout(function(){r.hidden||t.show(e,n,!1)},0)})),r.hidden=!1,de(r),se(o,s),ae([o,s],function(e){e.remove("leave"),e.add("enter")}),pe([o,s],n),fe(r,n<20,function(){"hidden"===e.style.visibility||r.onShownFired||(r.settings.transitionFlip||o.classList.add("tippy-notransition"),r.settings.interactive&&-1!==r.settings.trigger.indexOf("click")&&e.focus(),r.onShownFired=!0,i&&t.callbacks.shown())})}},{key:"hide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Pe.refs[Pe.poppers.indexOf(e)],o=e.querySelector(qe.tooltip),s=e.querySelector(qe.circle);i&&(this.callbacks.beforeHidden(),r.hidden=!0,r.el.classList.remove("active"),r.onShownFired=!1,r.settings.transitionFlip||o.classList.remove("tippy-notransition"),r.flipped=r.settings.position!==e.getAttribute("x-placement")),e.style.visibility="hidden",n===Ie.hideDuration?n=parseInt(o.style[$("transitionDuration")]):pe([o,s],n),ae([o,s],function(e){e.remove("enter"),e.add("leave")}),r.settings.html&&-1!==r.settings.trigger.indexOf("click")&&re(r.el)&&r.el.focus(),fe(r,n<20,function(){"visible"!==e.style.visibility&&document.body.contains(e)&&(r.instance.disableEventListeners(),document.body.removeChild(e),i&&t.callbacks.hidden())})}},{key:"destroy",value:function(e){var t=Pe.poppers.indexOf(e),n=Pe.refs[t];n.listeners.forEach(function(e){return n.el.removeEventListener(e.event,e.handler)}),n.el.removeAttribute("data-tooltipped"),n.instance&&n.instance.destroy(),Pe.refs.splice(t,1),Pe.els.splice(t,1),Pe.poppers.splice(t,1)}},{key:"update",value:function(e){var t=Pe.refs[Pe.poppers.indexOf(e)],n=e.querySelector(qe.content),i=t.settings.html;i?n.innerHTML=i instanceof Element?i.innerHTML:document.getElementById(i.replace("#","")).innerHTML:(n.innerHTML=t.el.getAttribute("title")||t.el.getAttribute("data-original-title"),ie(t.el))}}]),e}(),Re=new Ye;return Ye}); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("popper.js")):"function"==typeof define&&define.amd?define(["popper.js"],t):e.Tippy=t(e.Popper)}(this,function(e){"use strict";function t(){A=!0,document.body.classList.add("tippy-touch"),document.removeEventListener("touchstart",t)}function i(e){var t=r(e.target,k.el),i=r(e.target,k.popper);if(i){if(L.refs[L.poppers.indexOf(i)].settings.interactive)return}if(t){var n=L.refs[L.els.indexOf(t)];if(!n.settings.multiple&&A||!n.settings.multiple&&-1!==n.settings.trigger.indexOf("click"))return y(n);if(!0!==n.settings.hideOnClick||-1!==n.settings.trigger.indexOf("click"))return}!r(e.target,k.controller)&&document.body.querySelector(".tippy-popper")&&y()}function n(e){for(var t=[!1,"webkit"],i=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var r=t[n],o=r?""+r+i:e;if(void 0!==window.document.body.style[o])return o}return null}function r(e,t){if(!Element.prototype.matches)if(e.matchesSelector)Element.prototype.matches=Element.prototype.matchesSelector;else if(e.webkitMatchesSelector)Element.prototype.matches=Element.prototype.webkitMatchesSelector;else if(e.mozMatchesSelector)Element.prototype.matches=Element.prototype.mozMatchesSelector;else{if(!e.msMatchesSelector)return e;Element.prototype.matches=Element.prototype.msMatchesSelector}return Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),e.closest(t)}function o(t,i,n){var r=E({placement:n.position},n.popperOptions||{},{modifiers:E({},n.popperOptions?n.popperOptions.modifiers:{},{flip:E({padding:15},n.popperOptions&&n.popperOptions.modifiers?n.popperOptions.modifiers.flip:{}),offset:E({offset:parseInt(n.offset)},n.popperOptions&&n.popperOptions.modifiers?n.popperOptions.modifiers.offset:{})})});document.body.appendChild(i);var o=new e(t,i,r);return o.disableEventListeners(),document.body.removeChild(i),o}function s(e,t){var i=document.createElement("div");i.setAttribute("class","tippy-popper");var n=document.createElement("div");if(n.setAttribute("class","tippy-tooltip tippy-tooltip--"+t.size+" "+t.theme+" leave"),n.setAttribute("data-animation",t.animation),t.arrow){var r=document.createElement("div");r.setAttribute("class","arrow-"+t.arrowSize),r.setAttribute("x-arrow",""),n.appendChild(r)}if(t.animateFill){n.setAttribute("data-animatefill","");var o=document.createElement("div");o.setAttribute("class","leave"),o.setAttribute("x-circle",""),n.appendChild(o)}t.inertia&&n.setAttribute("data-inertia","");var s=document.createElement("div");if(s.setAttribute("class","tippy-tooltip-content"),t.html){var a=void 0;t.html instanceof Element?(s.innerHTML=t.html.innerHTML,a=t.html.id||"tippy-html-template"):(s.innerHTML=document.getElementById(t.html.replace("#","")).innerHTML,a=t.html),i.classList.add("html-template"),i.setAttribute("tabindex","0"),n.setAttribute("data-template-id",a)}else s.innerHTML=e;return n.appendChild(s),i.appendChild(n),i}function a(e,t,i){if("manual"!==e){var n=[];return t.addEventListener(e,i.handleTrigger),n.push({event:e,handler:i.handleTrigger}),"mouseenter"===e&&(t.addEventListener("mouseleave",i.handleMouseleave),n.push({event:"mouseleave",handler:i.handleMouseleave})),"focus"===e&&(t.addEventListener("blur",i.handleBlur),n.push({event:"blur",handler:i.handleBlur})),n}}function l(e){L.refs.push(e),L.els.push(e.el),L.poppers.push(e.popper)}function p(e){var t=e.getAttribute("title");e.setAttribute("data-original-title",t||"html"),e.removeAttribute("title")}function d(e){var t=L.refs[L.els.indexOf(this)],i=t.popper.getAttribute("x-placement"),r=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,o=Math.round(t.popper.offsetWidth/2),s=Math.round(t.popper.offsetHeight/2),a=e.clientX-o,l=e.clientY+r-2.5*s;"left"===i?(a=e.clientX-2*o-15,l=e.clientY+r-s):"right"===i?(a=e.clientX+s,l=e.clientY+r-s):"bottom"===i&&(l=e.clientY+r+s/1.5),t.popper.style[n("transform")]="translate3d("+a+"px, "+l+"px, 0)"}function u(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function c(e,t){t?window.getComputedStyle(t)[n("transform")]:window.getComputedStyle(e).opacity}function f(e,t){e.forEach(function(e){e&&t(e.classList)})}function h(e,t){e.forEach(function(e){e&&(e.style[n("transitionDuration")]=t+"ms")})}function m(e,t){setTimeout(function(){e.settings.position!==e.popper.getAttribute("x-placement")?(e.flipped=!0,t()):e.flipped&&e.settings.position===e.popper.getAttribute("x-placement")&&(e.flipped=!1,t())},0)}function v(e,t,i){var n=function n(){t||(e.popper.removeEventListener("webkitTransitionEnd",n),e.popper.removeEventListener("transitionend",n)),i()};if(t)return n();e.popper.addEventListener("webkitTransitionEnd",n),e.popper.addEventListener("transitionend",n)}function g(e){document.body.appendChild(e.popper),e.popper.style.visibility="visible",e.instance.update(),e.settings.followCursor&&!A?e.hasFollowCursorListener||(e.hasFollowCursorListener=!0,e.el.addEventListener("mousemove",d)):e.instance.enableEventListeners()}function y(e){L.refs.forEach(function(t){document.body.contains(t.popper)&&(!0!==t.settings.hideOnClick||e&&t.popper===e.popper||S.hide(t.popper,t.settings.hideDuration))})}e="default"in e?e.default:e;var b=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},A=!1,L={refs:[],els:[],poppers:[]},O={html:!1,position:"top",animation:"shift",animateFill:!0,arrow:!1,arrowSize:"regular",delay:0,hideDelay:0,trigger:"mouseenter focus",duration:375,hideDuration:375,interactive:!1,theme:"dark",size:"regular",offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,transitionFlip:!0,popperOptions:{}},k={popper:".tippy-popper",tooltip:".tippy-tooltip",content:".tippy-tooltip-content",circle:"[x-circle]",arrow:"[x-arrow]",el:"[data-tooltipped]",controller:"[data-tippy-controller]"};document.addEventListener("click",i),document.addEventListener("touchstart",t);var T=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b(this,e),"addEventListener"in window&&!/MSIE 9/i.test(navigator.userAgent)&&!window.operamini&&(this.settings=E(JSON.parse(JSON.stringify(O)),i),this.callbacks={wait:i.wait,beforeShown:i.beforeShown||new Function,shown:i.shown||new Function,beforeHidden:i.beforeHidden||new Function,hidden:i.hidden||new Function},this.els=t instanceof Element?[t]:[].slice.call(document.querySelectorAll(t)),this._createTooltips())}return w(e,[{key:"_applyIndividualSettings",value:function(e){var t=e.getAttribute("data-html")||this.settings.html;t&&"false"!==t||(t=!1);var i=e.getAttribute("data-position")||this.settings.position,n=e.getAttribute("data-animation")||this.settings.animation,r=e.getAttribute("data-animatefill")||this.settings.animateFill;"false"===r&&(r=!1);var o=e.getAttribute("data-arrow")||this.settings.arrow;o&&"false"!==o?r=!1:o=!1;var s=e.getAttribute("data-arrowsize")||this.settings.arrowSize,a=e.getAttribute("data-trigger")||this.settings.trigger;a&&(a=a.trim().split(" "));var l=e.getAttribute("data-theme")||this.settings.theme;l&&(l+="-theme");var p=e.getAttribute("data-size")||this.settings.size,d=parseInt(e.getAttribute("data-delay"));d||0===d||(d=this.settings.delay);var u=parseInt(e.getAttribute("data-hidedelay"));u||0===u||(u=this.settings.hideDelay);var c=parseInt(e.getAttribute("data-duration"));c||0===c||(c=this.settings.duration);var f=parseInt(e.getAttribute("data-hideduration"));f||0===f||(f=this.settings.hideDuration);var h=e.getAttribute("data-interactive")||this.settings.interactive;"false"===h&&(h=!1);var m=parseInt(e.getAttribute("data-offset"));m||0===m||(m=this.settings.offset);var v=e.getAttribute("data-hideonclick")||this.settings.hideOnClick;"false"===v&&(v=!1);var g=e.getAttribute("data-multiple")||this.settings.multiple;"false"===g&&(g=!1);var y=e.getAttribute("data-followcursor")||this.settings.followCursor;"false"===y&&(y=!1);var b=e.getAttribute("data-inertia")||this.settings.inertia;"false"===b&&(b=!1);var w=e.getAttribute("data-transitionflip")||this.settings.transitionFlip;return"false"===w&&(w=!1),{html:t,position:i,animation:n,animateFill:r,arrow:o,arrowSize:s,delay:d,hideDelay:u,trigger:a,duration:c,hideDuration:f,interactive:h,theme:l,size:p,offset:m,hideOnClick:v,multiple:g,followCursor:y,inertia:b,transitionFlip:w,popperOptions:this.settings.popperOptions}}},{key:"_getEventListenerHandlers",value:function(e,t,i){var n=this,o=function(){if(clearTimeout(t.getAttribute("data-delay")),clearTimeout(t.getAttribute("data-hidedelay")),i.delay){var e=setTimeout(function(){return n.show(t,i.duration)},i.delay);t.setAttribute("data-delay",e)}else n.show(t,i.duration)},s=function(){return n.callbacks.wait?n.callbacks.wait(o):o()},a=function(){if(clearTimeout(t.getAttribute("data-hidedelay")),clearTimeout(t.getAttribute("data-delay")),i.hideDelay){var e=setTimeout(function(){return n.hide(t,i.hideDuration)},i.hideDelay);t.setAttribute("data-hidedelay",e)}else n.hide(t,i.hideDuration)};return{handleTrigger:function(e){if(i.interactive&&e.target.classList.add("active"),"click"===e.type&&"visible"===t.style.visibility&&"persistent"!==i.hideOnClick)return a();s()},handleMouseleave:function(n){if(i.interactive){var o=function n(o){r(o.target,k.popper)!==t&&r(o.target,k.el)!==e&&-1===i.trigger.indexOf("click")&&(document.removeEventListener("mousemove",n),a())};return document.addEventListener("mousemove",o)}a()},handleBlur:function(e){!A&&e.relatedTarget&&(r(e.relatedTarget,k.popper)||a())}}}},{key:"_createTooltips",value:function(){var t=this;this.els.forEach(function(e){e.setAttribute("data-tooltipped","");var i=t._applyIndividualSettings(e),n=e.getAttribute("title");if(n||i.html){p(e);var r=s(n,i),d=o(e,r,i),u=t._getEventListenerHandlers(e,r,i),c=[];i.trigger.forEach(function(t){return c=c.concat(a(t,e,u))}),l({el:e,popper:r,settings:i,listeners:c,instance:d})}}),e.store=L}},{key:"getPopperElement",value:function(e){try{return L.refs[L.els.indexOf(e)].popper}catch(e){throw new Error("[Tippy error]: Element does not exist in any Tippy instances")}}},{key:"getTooltippedElement",value:function(e){try{return L.refs[L.poppers.indexOf(e)].el}catch(e){throw new Error("[Tippy error]: Popper does not exist in any Tippy instances")}}},{key:"show",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("visible"!==e.style.visibility){var r=L.refs[L.poppers.indexOf(e)],o=e.querySelector(k.tooltip),s=e.querySelector(k.circle);n&&(this.callbacks.beforeShown(),m(r,function(){t.hide(e,0,!1),setTimeout(function(){return t.show(e,i,!1)},0)})),g(r),c(o,s),f([o,s],function(e){e.remove("leave"),e.add("enter")}),h([o,s],i),v(r,i<20,function(){"hidden"===e.style.visibility||r.onShownFired||(r.settings.transitionFlip||o.classList.add("tippy-notransition"),r.settings.interactive&&-1!==r.settings.trigger.indexOf("click")&&e.focus(),r.onShownFired=!0,n&&t.callbacks.shown())})}}},{key:"hide",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(document.body.contains(e)){var o=L.refs[L.poppers.indexOf(e)],s=e.querySelector(k.tooltip),a=e.querySelector(k.circle);r&&(this.callbacks.beforeHidden(),o.el.classList.remove("active"),o.onShownFired=!1,o.settings.transitionFlip||s.classList.remove("tippy-notransition"),o.flipped=o.settings.position!==e.getAttribute("x-placement")),e.style.visibility="hidden",i===O.hideDuration?i=parseInt(s.style[n("transitionDuration")]):h([s,a],i),f([s,a],function(e){e.remove("enter"),e.add("leave")}),o.settings.html&&-1!==o.settings.trigger.indexOf("click")&&u(o.el)&&o.el.focus(),v(o,i<20,function(){"visible"!==e.style.visibility&&document.body.contains(e)&&(o.hasFollowCursorListener&&(o.el.removeEventListener("mousemove",d),o.hasFollowCursorListener=!1),o.instance.disableEventListeners(),document.body.removeChild(e),r&&t.callbacks.hidden())})}}},{key:"destroy",value:function(e){var t=L.poppers.indexOf(e),i=L.refs[t];i.listeners.forEach(function(e){return i.el.removeEventListener(e.event,e.handler)}),i.el.removeAttribute("data-tooltipped"),i.instance.destroy(),L.refs.splice(t,1),L.els.splice(t,1),L.poppers.splice(t,1)}},{key:"update",value:function(e){var t=L.refs[L.poppers.indexOf(e)],i=e.querySelector(k.content),n=t.settings.html;n?i.innerHTML=n instanceof Element?n.innerHTML:document.getElementById(n.replace("#","")).innerHTML:(i.innerHTML=t.el.getAttribute("title")||t.el.getAttribute("data-original-title"),p(t.el))}}]),e}(),S=new T;return T}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("popper.js")):"function"==typeof define&&define.amd?define(["popper.js"],t):e.Tippy=t(e.Popper)}(this,function(e){"use strict";function t(){L=!0,document.body.classList.add("tippy-touch"),document.removeEventListener("touchstart",t)}function i(e){var t=r(e.target,T.el),i=r(e.target,T.popper);if(i){if(O.refs[O.poppers.indexOf(i)].settings.interactive)return}if(t){var n=O.refs[O.els.indexOf(t)];if(!n.settings.multiple&&L||!n.settings.multiple&&-1!==n.settings.trigger.indexOf("click"))return y(n);if(!0!==n.settings.hideOnClick||-1!==n.settings.trigger.indexOf("click"))return}!r(e.target,T.controller)&&document.body.querySelector(T.popper)&&y()}function n(e){for(var t=[!1,"webkit"],i=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var r=t[n],o=r?""+r+i:e;if(void 0!==window.document.body.style[o])return o}return null}function r(e,t){return Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),i=t.length;--i>=0&&t.item(i)!==this;);return i>-1}),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),e.closest(t)}function o(t){var i=t.settings,n=E({placement:i.position},i.popperOptions||{},{modifiers:E({},i.popperOptions?i.popperOptions.modifiers:{},{flip:E({padding:15},i.popperOptions&&i.popperOptions.modifiers?i.popperOptions.modifiers.flip:{}),offset:E({offset:parseInt(i.offset)},i.popperOptions&&i.popperOptions.modifiers?i.popperOptions.modifiers.offset:{})})});return new e(t.el,t.popper,n)}function s(e,t){var i=document.createElement("div");i.setAttribute("class","tippy-popper");var n=document.createElement("div");if(n.setAttribute("class","tippy-tooltip tippy-tooltip--"+t.size+" "+t.theme+"-theme leave"),n.setAttribute("data-animation",t.animation),t.arrow){var r=document.createElement("div");r.setAttribute("class","arrow-"+t.arrowSize),r.setAttribute("x-arrow",""),n.appendChild(r)}if(t.animateFill){n.setAttribute("data-animatefill","");var o=document.createElement("div");o.setAttribute("class","leave"),o.setAttribute("x-circle",""),n.appendChild(o)}t.inertia&&n.setAttribute("data-inertia","");var s=document.createElement("div");if(s.setAttribute("class","tippy-tooltip-content"),t.html){var a=void 0;t.html instanceof Element?(s.innerHTML=t.html.innerHTML,a=t.html.id||"tippy-html-template"):(s.innerHTML=document.getElementById(t.html.replace("#","")).innerHTML,a=t.html),i.classList.add("html-template"),i.setAttribute("tabindex","0"),n.setAttribute("data-template-id",a)}else s.innerHTML=e;return n.appendChild(s),i.appendChild(n),i}function a(e,t,i){var n=[];return"manual"===e?n:(t.addEventListener(e,i.handleTrigger),n.push({event:e,handler:i.handleTrigger}),"mouseenter"===e&&(t.addEventListener("mouseleave",i.handleMouseleave),n.push({event:"mouseleave",handler:i.handleMouseleave})),"focus"===e&&(t.addEventListener("blur",i.handleBlur),n.push({event:"blur",handler:i.handleBlur})),n)}function l(e){O.refs.push(e),O.els.push(e.el),O.poppers.push(e.popper)}function p(e){var t=e.getAttribute("title");e.setAttribute("data-original-title",t||"html"),e.removeAttribute("title")}function c(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function d(e){var t=O.refs[O.els.indexOf(this)],i=t.popper.getAttribute("x-placement"),r=Math.round(t.popper.offsetWidth/2),o=Math.round(t.popper.offsetHeight/2),s=e.pageX-r,a=e.pageY-2.5*o;"left"===i?(s=e.pageX-2*r-15,a=e.pageY-o):"right"===i?(s=e.pageX+o,a=e.pageY-o):"bottom"===i&&(a=e.pageY+o/1.5),t.popper.style[n("transform")]="translate3d("+s+"px, "+a+"px, 0)"}function u(e,t){t?window.getComputedStyle(t)[n("transform")]:window.getComputedStyle(e).opacity}function f(e,t){e.forEach(function(e){e&&t(e.classList)})}function h(e,t){e.forEach(function(e){e&&(e.hasAttribute("x-circle")&&(t=Math.round(t/1.25)),e.style[n("transitionDuration")]=t+"ms")})}function m(e,t){setTimeout(function(){e.settings.position!==e.popper.getAttribute("x-placement")?(e.flipped=!0,t()):e.flipped&&e.settings.position===e.popper.getAttribute("x-placement")&&(e.flipped=!1,t())},0)}function v(e,t,i){var n=function n(){t||(e.popper.removeEventListener("webkitTransitionEnd",n),e.popper.removeEventListener("transitionend",n)),i()};if(t)return n();e.popper.addEventListener("webkitTransitionEnd",n),e.popper.addEventListener("transitionend",n)}function g(e){document.body.appendChild(e.popper),e.popper.style.visibility="visible",!e.settings.followCursor||e.hasFollowCursorListener||L||(e.hasFollowCursorListener=!0,e.el.addEventListener("mousemove",d)),e.instance?(e.instance.update(),e.settings.followCursor||e.instance.enableEventListeners()):(e.instance=o(e),e.settings.followCursor&&!L&&e.instance.disableEventListeners())}function y(e){O.refs.forEach(function(t){document.body.contains(t.popper)&&(!0!==t.settings.hideOnClick||e&&t.popper===e.popper||S.hide(t.popper,t.settings.hideDuration))})}e="default"in e?e.default:e;var b=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},L=!1,O={refs:[],els:[],poppers:[]},A={html:!1,position:"top",animation:"shift",animateFill:!0,arrow:!1,arrowSize:"regular",delay:0,hideDelay:0,trigger:"mouseenter focus",duration:375,hideDuration:375,interactive:!1,theme:"dark",size:"regular",offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,transitionFlip:!0,popperOptions:{}},k=Object.keys(A),T={popper:".tippy-popper",tooltip:".tippy-tooltip",content:".tippy-tooltip-content",circle:"[x-circle]",arrow:"[x-arrow]",el:"[data-tooltipped]",controller:"[data-tippy-controller]"};document.addEventListener("click",i),document.addEventListener("touchstart",t);var x=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),"addEventListener"in window&&!/MSIE 9/i.test(navigator.userAgent)&&!window.operamini){this.settings=E(JSON.parse(JSON.stringify(A)),i),this.callbacks={wait:i.wait,beforeShown:i.beforeShown||new Function,shown:i.shown||new Function,beforeHidden:i.beforeHidden||new Function,hidden:i.hidden||new Function};var n=t instanceof Element?[t]:[].slice.call(document.querySelectorAll(t));this._createTooltips(n)}}return w(e,[{key:"_applyIndividualSettings",value:function(e){var t=this,i={};return k.forEach(function(n){var r=e.getAttribute("data-"+n.toLowerCase())||t.settings[n];null!==r&&"false"!==r||(r=!1),i[n]=r}),i.arrow&&(i.animateFill=!1),E(JSON.parse(JSON.stringify(this.settings)),i)}},{key:"_getEventListenerHandlers",value:function(e,t,i){var n=this,o=function(){if(clearTimeout(t.getAttribute("data-delay")),clearTimeout(t.getAttribute("data-hidedelay")),i.delay){var e=setTimeout(function(){return n.show(t,i.duration)},i.delay);t.setAttribute("data-delay",e)}else n.show(t,i.duration)},s=function(){return n.callbacks.wait?n.callbacks.wait(o):o()},a=function(){if(clearTimeout(t.getAttribute("data-hidedelay")),clearTimeout(t.getAttribute("data-delay")),i.hideDelay){var e=setTimeout(function(){return n.hide(t,i.hideDuration)},i.hideDelay);t.setAttribute("data-hidedelay",e)}else n.hide(t,i.hideDuration)};return{handleTrigger:function(e){if(i.interactive&&e.target.classList.add("active"),"click"===e.type&&"visible"===t.style.visibility&&"persistent"!==i.hideOnClick)return a();s()},handleMouseleave:function(n){if(i.interactive){var o=function n(o){r(o.target,T.popper)!==t&&r(o.target,T.el)!==e&&-1===i.trigger.indexOf("click")&&(document.removeEventListener("mousemove",n),a())};return document.addEventListener("mousemove",o)}a()},handleBlur:function(e){!L&&e.relatedTarget&&(r(e.relatedTarget,T.popper)||a())}}}},{key:"_createTooltips",value:function(t){var i=this;t.forEach(function(e){e.setAttribute("data-tooltipped","");var t=i._applyIndividualSettings(e),n=e.getAttribute("title");if(n||t.html){p(e);var r=s(n,t),o=i._getEventListenerHandlers(e,r,t),c=[];t.trigger.trim().split(" ").forEach(function(t){return c=c.concat(a(t,e,o))}),l({el:e,popper:r,settings:t,listeners:c})}}),e.store=O}},{key:"getPopperElement",value:function(e){try{return O.refs[O.els.indexOf(e)].popper}catch(e){throw new Error("[Tippy error]: Element does not exist in any Tippy instances")}}},{key:"getTooltippedElement",value:function(e){try{return O.refs[O.poppers.indexOf(e)].el}catch(e){throw new Error("[Tippy error]: Popper does not exist in any Tippy instances")}}},{key:"show",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=O.refs[O.poppers.indexOf(e)],o=e.querySelector(T.tooltip),s=e.querySelector(T.circle);n&&(this.callbacks.beforeShown(),i>=20&&m(r,function(){t.hide(e,0,!1),setTimeout(function(){r.hidden||t.show(e,i,!1)},0)})),r.hidden=!1,g(r),u(o,s),f([o,s],function(e){e.remove("leave"),e.add("enter")}),h([o,s],i),v(r,i<20,function(){"hidden"===e.style.visibility||r.onShownFired||(r.settings.transitionFlip||o.classList.add("tippy-notransition"),r.settings.interactive&&-1!==r.settings.trigger.indexOf("click")&&e.focus(),r.onShownFired=!0,n&&t.callbacks.shown())})}},{key:"hide",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.settings.duration,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=O.refs[O.poppers.indexOf(e)],s=e.querySelector(T.tooltip),a=e.querySelector(T.circle);r&&(this.callbacks.beforeHidden(),o.hidden=!0,o.el.classList.remove("active"),o.onShownFired=!1,o.settings.transitionFlip||s.classList.remove("tippy-notransition"),o.flipped=o.settings.position!==e.getAttribute("x-placement")),e.style.visibility="hidden",i===A.hideDuration?i=parseInt(s.style[n("transitionDuration")]):h([s,a],i),f([s,a],function(e){e.remove("enter"),e.add("leave")}),o.settings.html&&-1!==o.settings.trigger.indexOf("click")&&c(o.el)&&o.el.focus(),v(o,i<20,function(){"visible"!==e.style.visibility&&document.body.contains(e)&&(o.instance.disableEventListeners(),document.body.removeChild(e),r&&t.callbacks.hidden())})}},{key:"destroy",value:function(e){var t=O.poppers.indexOf(e),i=O.refs[t];i.listeners.forEach(function(e){return i.el.removeEventListener(e.event,e.handler)}),i.el.removeAttribute("data-tooltipped"),i.instance&&i.instance.destroy(),O.refs.splice(t,1),O.els.splice(t,1),O.poppers.splice(t,1)}},{key:"update",value:function(e){var t=O.refs[O.poppers.indexOf(e)],i=e.querySelector(T.content),n=t.settings.html;n?i.innerHTML=n instanceof Element?n.innerHTML:document.getElementById(n.replace("#","")).innerHTML:(i.innerHTML=t.el.getAttribute("title")||t.el.getAttribute("data-original-title"),p(t.el))}}]),e}(),S=new x;return x}); |
{ | ||
"name": "tippy.js", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Pure JS Tooltip Library", | ||
@@ -20,3 +20,5 @@ "main": "dist/tippy.js", | ||
"babel-preset-es2015": "^6.24.1", | ||
"chai": "^3.5.0", | ||
"cssnano": "^3.10.0", | ||
"mocha": "^3.2.0", | ||
"postcss": "^5.2.16", | ||
@@ -23,0 +25,0 @@ "rollup-plugin-babel": "^2.7.1", |
@@ -5,3 +5,3 @@ import Popper from 'popper.js' | ||
* @file tippy.js | Pure JS Tooltip Library | ||
* @version 0.7.0 | ||
* @version 0.8.0 | ||
* @license MIT | ||
@@ -45,2 +45,4 @@ */ | ||
const DEFAULTS_KEYS = Object.keys(DEFAULTS) | ||
const SELECTORS = { | ||
@@ -96,3 +98,3 @@ popper: '.tippy-popper', | ||
if (!closest(event.target, SELECTORS.controller) | ||
&& document.body.querySelector('.tippy-popper')) { | ||
&& document.body.querySelector(SELECTORS.popper)) { | ||
hideAllPoppers() | ||
@@ -133,12 +135,12 @@ } | ||
if (!Element.prototype.matches) { | ||
if (element.matchesSelector) { | ||
Element.prototype.matches = Element.prototype.matchesSelector | ||
} else if (element.webkitMatchesSelector) { | ||
Element.prototype.matches = Element.prototype.webkitMatchesSelector | ||
} else if (element.mozMatchesSelector) { | ||
Element.prototype.matches = Element.prototype.mozMatchesSelector | ||
} else if (element.msMatchesSelector) { | ||
Element.prototype.matches = Element.prototype.msMatchesSelector | ||
} else { | ||
return element | ||
Element.prototype.matches = | ||
Element.prototype.matchesSelector || | ||
Element.prototype.webkitMatchesSelector || | ||
Element.prototype.mozMatchesSelector || | ||
Element.prototype.msMatchesSelector || | ||
function(s) { | ||
var matches = (this.document || this.ownerDocument).querySelectorAll(s), | ||
i = matches.length; | ||
while (--i >= 0 && matches.item(i) !== this) {} | ||
return i > -1; | ||
} | ||
@@ -160,8 +162,9 @@ } | ||
* Creates a new popper instance | ||
* @param {Element} el | ||
* @param {Element} popper | ||
* @param {Object} settings | ||
* @param {Object} ref | ||
* @return {Object} - the popper instance | ||
*/ | ||
function createPopperInstance(el, popper, settings) { | ||
function createPopperInstance(ref) { | ||
const settings = ref.settings | ||
const config = { | ||
@@ -183,11 +186,3 @@ placement: settings.position, | ||
// Temporarily append popper for Popper.js | ||
document.body.appendChild(popper) | ||
const instance = new Popper(el, popper, config) | ||
instance.disableEventListeners() | ||
document.body.removeChild(popper) | ||
return instance | ||
return new Popper(ref.el, ref.popper, config) | ||
} | ||
@@ -206,3 +201,3 @@ | ||
const tooltip = document.createElement('div') | ||
tooltip.setAttribute('class', `tippy-tooltip tippy-tooltip--${settings.size} ${settings.theme} leave`) | ||
tooltip.setAttribute('class', `tippy-tooltip tippy-tooltip--${settings.size} ${settings.theme}-theme leave`) | ||
tooltip.setAttribute('data-animation', settings.animation) | ||
@@ -270,6 +265,6 @@ | ||
function createTrigger(event, el, handlers) { | ||
if (event === 'manual') return | ||
const listeners = [] | ||
if (event === 'manual') return listeners | ||
// Enter | ||
@@ -323,2 +318,18 @@ el.addEventListener(event, handlers.handleTrigger) | ||
/** | ||
* Determines if an element is visible in the viewport | ||
* @param {Element} el | ||
* @return {Boolean} | ||
*/ | ||
function elementIsInViewport(el) { | ||
const rect = el.getBoundingClientRect() | ||
return ( | ||
rect.top >= 0 && | ||
rect.left >= 0 && | ||
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | ||
rect.right <= (window.innerWidth || document.documentElement.clientWidth) | ||
) | ||
} | ||
/** | ||
* Mousemove event listener callback method for follow cursor setting | ||
@@ -330,3 +341,2 @@ * @param {Object} e (event) | ||
const position = ref.popper.getAttribute('x-placement') | ||
const offset = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop | ||
const halfPopperWidth = Math.round( ref.popper.offsetWidth / 2 ) | ||
@@ -336,13 +346,13 @@ const halfPopperHeight = Math.round( ref.popper.offsetHeight / 2 ) | ||
// Default = top | ||
let x = e.clientX - halfPopperWidth | ||
let y = e.clientY + offset - 2.5 * halfPopperHeight | ||
let x = e.pageX - halfPopperWidth | ||
let y = e.pageY - 2.5 * halfPopperHeight | ||
if (position === 'left') { | ||
x = e.clientX - ( 2 * halfPopperWidth ) - 15 | ||
y = e.clientY + offset - halfPopperHeight | ||
x = e.pageX - ( 2 * halfPopperWidth ) - 15 | ||
y = e.pageY - halfPopperHeight | ||
} else if (position === 'right') { | ||
x = e.clientX + halfPopperHeight | ||
y = e.clientY + offset - halfPopperHeight | ||
x = e.pageX + halfPopperHeight | ||
y = e.pageY - halfPopperHeight | ||
} else if (position === 'bottom') { | ||
y = e.clientY + offset + halfPopperHeight/1.5 | ||
y = e.pageY + halfPopperHeight/1.5 | ||
} | ||
@@ -354,18 +364,2 @@ | ||
/** | ||
* Determines if an element is visible in the viewport | ||
* @param {Element} el | ||
* @return {Boolean} | ||
*/ | ||
function elementIsInViewport(el) { | ||
const rect = el.getBoundingClientRect() | ||
return ( | ||
rect.top >= 0 && | ||
rect.left >= 0 && | ||
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | ||
rect.right <= (window.innerWidth || document.documentElement.clientWidth) | ||
) | ||
} | ||
/** | ||
* Triggers a document repaint or reflow for CSS transition | ||
@@ -400,2 +394,3 @@ * @param {Element} el | ||
if (!el) return | ||
if (el.hasAttribute('x-circle')) duration = Math.round(duration/1.25) | ||
el.style[prefix('transitionDuration')] = duration + 'ms' | ||
@@ -446,3 +441,4 @@ }) | ||
/** | ||
* Appends the popper, updates its position and enables event listeners | ||
* Creates a popper instance if one does not exist, then appends the popper | ||
* Also updates its position if need be and enables event listeners | ||
* @param {Object} ref - the element/popper reference | ||
@@ -454,11 +450,18 @@ */ | ||
ref.instance.update() | ||
if (ref.settings.followCursor && !ref.hasFollowCursorListener && !touchUser) { | ||
ref.hasFollowCursorListener = true | ||
ref.el.addEventListener('mousemove', followCursor) | ||
} | ||
if (ref.settings.followCursor && !touchUser) { | ||
if (!ref.hasFollowCursorListener) { | ||
ref.hasFollowCursorListener = true | ||
ref.el.addEventListener('mousemove', followCursor) | ||
if (!ref.instance) { | ||
// Create instance if it hasn't been created yet | ||
ref.instance = createPopperInstance(ref) | ||
if (ref.settings.followCursor && !touchUser) { | ||
ref.instance.disableEventListeners() | ||
} | ||
} else { | ||
ref.instance.enableEventListeners() | ||
ref.instance.update() | ||
if (!ref.settings.followCursor) { | ||
ref.instance.enableEventListeners() | ||
} | ||
} | ||
@@ -514,7 +517,7 @@ } | ||
// Check if selector is a DOM element | ||
this.els = (selector instanceof Element) | ||
const els = (selector instanceof Element) | ||
? [selector] | ||
: [].slice.call(document.querySelectorAll(selector)) | ||
this._createTooltips() | ||
this._createTooltips(els) | ||
} | ||
@@ -528,107 +531,15 @@ | ||
_applyIndividualSettings(el) { | ||
// Some falsy values require more verbose defining | ||
const settings = {} | ||
// false, 'false', or a template id | ||
let html = el.getAttribute('data-html') || this.settings.html | ||
if (!html || html === 'false') html = false | ||
DEFAULTS_KEYS.forEach(key => { | ||
let val = el.getAttribute(`data-${ key.toLowerCase() }`) || this.settings[key] | ||
if (val === null || val === 'false') val = false | ||
// 'top', 'bottom', 'left', 'right' | ||
let position = el.getAttribute('data-position') || this.settings.position | ||
settings[key] = val | ||
}) | ||
// 'shift', 'perspective', 'scale', 'fade' | ||
let animation = el.getAttribute('data-animation') || this.settings.animation | ||
// animateFill is disabled if an arrow is true | ||
if (settings.arrow) settings['animateFill'] = false | ||
// 'true', true, 'false', false | ||
let animateFill = el.getAttribute('data-animatefill') || this.settings.animateFill | ||
if (animateFill === 'false') animateFill = false | ||
// 'true', true, 'false', false | ||
let arrow = el.getAttribute('data-arrow') || this.settings.arrow | ||
if (!arrow || arrow === 'false') arrow = false | ||
else animateFill = false | ||
// 'small', 'regular', 'big' | ||
let arrowSize = el.getAttribute('data-arrowsize') || this.settings.arrowSize | ||
// 'mouseenter focus' string to array | ||
let trigger = el.getAttribute('data-trigger') || this.settings.trigger | ||
if (trigger) trigger = trigger.trim().split(' ') | ||
// 'dark', 'light', '{custom}' | ||
let theme = el.getAttribute('data-theme') || this.settings.theme | ||
if (theme) theme += '-theme' | ||
// 'small', 'regular', 'big' | ||
let size = el.getAttribute('data-size') || this.settings.size | ||
// 0, '0' | ||
let delay = parseInt(el.getAttribute('data-delay')) | ||
if (!delay && delay !== 0) delay = this.settings.delay | ||
// 0, '0' | ||
let hideDelay = parseInt(el.getAttribute('data-hidedelay')) | ||
if (!hideDelay && hideDelay !== 0) hideDelay = this.settings.hideDelay | ||
// 0, '0' | ||
let duration = parseInt(el.getAttribute('data-duration')) | ||
if (!duration && duration !== 0) duration = this.settings.duration | ||
// 0, '0' | ||
let hideDuration = parseInt(el.getAttribute('data-hideduration')) | ||
if (!hideDuration && hideDuration !== 0) hideDuration = this.settings.hideDuration | ||
// 'true', true, 'false', false | ||
let interactive = el.getAttribute('data-interactive') || this.settings.interactive | ||
if (interactive === 'false') interactive = false | ||
// '0', 0 | ||
let offset = parseInt(el.getAttribute('data-offset')) | ||
if (!offset && offset !== 0) offset = this.settings.offset | ||
// 'true', true, 'false', false | ||
let hideOnClick = el.getAttribute('data-hideonclick') || this.settings.hideOnClick | ||
if (hideOnClick === 'false') hideOnClick = false | ||
// 'true', true, 'false', false | ||
let multiple = el.getAttribute('data-multiple') || this.settings.multiple | ||
if (multiple === 'false') multiple = false | ||
// 'true', true, 'false', false | ||
let followCursor = el.getAttribute('data-followcursor') || this.settings.followCursor | ||
if (followCursor === 'false') followCursor = false | ||
// 'true', true, 'false', false | ||
let inertia = el.getAttribute('data-inertia') || this.settings.inertia | ||
if (inertia === 'false') inertia = false | ||
// 'true', true, 'false', false | ||
let transitionFlip = el.getAttribute('data-transitionflip') || this.settings.transitionFlip | ||
if (transitionFlip === 'false') transitionFlip = false | ||
// just take the provided value | ||
const popperOptions = this.settings.popperOptions | ||
return { | ||
html, | ||
position, | ||
animation, | ||
animateFill, | ||
arrow, | ||
arrowSize, | ||
delay, | ||
hideDelay, | ||
trigger, | ||
duration, | ||
hideDuration, | ||
interactive, | ||
theme, | ||
size, | ||
offset, | ||
hideOnClick, | ||
multiple, | ||
followCursor, | ||
inertia, | ||
transitionFlip, | ||
popperOptions | ||
} | ||
return Object.assign(JSON.parse(JSON.stringify(this.settings)), settings) | ||
} | ||
@@ -651,3 +562,2 @@ | ||
if (settings.delay) { | ||
const delay = setTimeout( | ||
@@ -746,4 +656,4 @@ () => this.show(popper, settings.duration), | ||
*/ | ||
_createTooltips() { | ||
this.els.forEach(el => { | ||
_createTooltips(els) { | ||
els.forEach(el => { | ||
@@ -760,7 +670,6 @@ el.setAttribute('data-tooltipped', '') | ||
const popper = createPopperElement(title, settings) | ||
const instance = createPopperInstance(el, popper, settings) | ||
const handlers = this._getEventListenerHandlers(el, popper, settings) | ||
let listeners = [] | ||
settings.trigger.forEach( | ||
settings.trigger.trim().split(' ').forEach( | ||
event => listeners = listeners.concat(createTrigger(event, el, handlers)) | ||
@@ -773,4 +682,3 @@ ) | ||
settings, | ||
listeners, | ||
instance | ||
listeners | ||
}) | ||
@@ -816,5 +724,2 @@ | ||
show(popper, duration = this.settings.duration, enableCallback = true) { | ||
// Already visible | ||
if (popper.style.visibility === 'visible') return | ||
const ref = STORE.refs[STORE.poppers.indexOf(popper)] | ||
@@ -827,8 +732,20 @@ const tooltip = popper.querySelector(SELECTORS.tooltip) | ||
// Flipping causes CSS transition to go haywire | ||
correctTransition(ref, () => { | ||
this.hide(popper, 0, false) | ||
setTimeout(() => this.show(popper, duration, false), 0) | ||
}) | ||
if (duration >= 20) { | ||
correctTransition(ref, () => { | ||
this.hide(popper, 0, false) | ||
setTimeout(() => { | ||
// Under fast-moving cursor cases, the tooltip can stay stuck because | ||
// the mouseleave triggered before this show | ||
// hidden only becomes `true` in the `hide` method if callback is enabled | ||
// (i.e. legitimate hide, not triggered by this correcttransition function) | ||
if (ref.hidden) return | ||
this.show(popper, duration, false) | ||
}, 0) | ||
}) | ||
} | ||
} | ||
ref.hidden = false | ||
awakenPopper(ref) | ||
@@ -870,5 +787,2 @@ | ||
hide(popper, duration = this.settings.duration, enableCallback = true) { | ||
// Hidden anyway | ||
if (!document.body.contains(popper)) return | ||
const ref = STORE.refs[STORE.poppers.indexOf(popper)] | ||
@@ -881,2 +795,6 @@ const tooltip = popper.querySelector(SELECTORS.tooltip) | ||
// flag needed for correctTransition, popper.style.visibility must be used by | ||
// correctTransition | ||
ref.hidden = true | ||
ref.el.classList.remove('active') | ||
@@ -889,3 +807,2 @@ | ||
ref.flipped = (ref.settings.position !== popper.getAttribute('x-placement')) | ||
? true : false | ||
} | ||
@@ -922,8 +839,2 @@ | ||
// Follow cursor setting | ||
if (ref.hasFollowCursorListener) { | ||
ref.el.removeEventListener('mousemove', followCursor) | ||
ref.hasFollowCursorListener = false | ||
} | ||
ref.instance.disableEventListeners() | ||
@@ -952,3 +863,3 @@ | ||
ref.instance.destroy() | ||
if (ref.instance) ref.instance.destroy() | ||
@@ -955,0 +866,0 @@ // Remove from storage |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
192465
18
3455