cryptpad/www/common/tippy.min.js
2017-07-20 18:23:51 +02:00

1 line
34 KiB
JavaScript

(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){Pe.forEach(function(t){var o=t.popper,i=t.tippyInstance,n=t.settings,r=n.appendTo,s=n.hideOnClick,a=n.trigger;if(r.contains(o)){var p=!0===s||-1!==a.indexOf('focus'),l=!e||o!==e.popper;p&&l&&i.hide(o)}})}function t(e,t){var o=Element.prototype.closest||function(e){for(var t=this;t;){if(Ie.call(t,e))return t;t=t.parentElement}};return o.call(e,t)}function o(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function n(){var i=function(){xe.touch=!0,xe.iOS()&&document.body.classList.add('tippy-touch'),xe.dynamicInputDetection&&document.addEventListener('mousemove',n)},n=function(){var e;return function(){var t=performance&&performance.now();t&&10>t-e&&(xe.touch=!1,document.removeEventListener('mousemove',n),!xe.iOS()&&document.body.classList.contains('tippy-touch')&&document.body.classList.remove('tippy-touch')),e=t}}();document.addEventListener('click',function(i){if(!(i.target instanceof Element))return e();var n=t(i.target,Ce.TOOLTIPPED_EL),r=t(i.target,Ce.POPPER);if(r){var s=o(Pe,function(e){return e.popper===r}),a=s.settings.interactive;if(a)return}if(n){var p=o(Pe,function(e){return e.el===n}),l=p.settings,d=l.hideOnClick,c=l.multiple,f=l.trigger;if(!c&&xe.touch||!c&&-1!==f.indexOf('click'))return e(p);if(!0!==d||-1!==f.indexOf('click'))return}t(i.target,Ce.CONTROLLER)||!document.querySelector(Ce.POPPER)||e()}),document.addEventListener('touchstart',i),window.addEventListener('blur',function(){var e=document,t=e.activeElement;t&&t.blur&&Ie.call(t,Ce.TOOLTIPPED_EL)&&t.blur()}),!xe.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',i)}function r(){return!r.done&&(r.done=!0,Ae.appendTo=document.body,n(),!0)}function s(e){window.requestAnimationFrame(function(){setTimeout(e,0)})}function a(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function p(e,t){return Array.prototype.findIndex?e.findIndex(t):e.indexOf(o(e,t))}function l(e){var t=e.getAttribute('title');e.setAttribute('data-original-title',t||'html'),e.removeAttribute('title')}function d(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function c(e,t){t?window.getComputedStyle(t)[a('transform')]:window.getComputedStyle(e).opacity}function f(e,t){e.forEach(function(e){e&&t(e.classList)})}function m(e,t){e.forEach(function(e){if(e){var o=Ie.call(e,Ce.CONTENT),i=o?Se(t/1.3):t;e.style[a('transitionDuration')]=i+'ms'}})}function h(e){return'visible'===e.style.visibility}function u(){}function g(e){return e.replace(/-.+/,'')}function b(t){var e,i,n=this,r=o(Pe,function(e){return e.el===n}),s=r.popper,p=r.settings.offset,l=g(s.getAttribute('x-placement')),d=Se(s.offsetWidth/2),c=Se(s.offsetHeight/2),f=5,m=document.documentElement.offsetWidth||document.body.offsetWidth,h=t.pageX,u=t.pageY;'top'===l?(e=h-d+p,i=u-2.25*c):'left'===l?(e=h-2*d-10,i=u-c+p):'right'===l?(e=h+c,i=u-c+p):'bottom'===l?(e=h-d+p,i=u+c/1.5):void 0;('top'===l||'bottom'===l)&&(h+f+d+p>m&&(e=m-f-2*d),0>h-f-d+p&&(e=f)),s.style[a('transform')]='translate3d('+e+'px, '+i+'px, 0)'}function y(e){return e instanceof Element||/Element/.test(Object.prototype.toString.call(e))?[e]:[].slice.call(document.querySelectorAll(e))}function v(e,t,o){if(!t)return o();var i=e.popper.querySelector(Ce.TOOLTIP),n=!1,r=function t(r){r.target!==i||(n=!0,i.removeEventListener('webkitTransitionEnd',t),i.removeEventListener('transitionend',t),o())};i.addEventListener('webkitTransitionEnd',r),i.addEventListener('transitionend',r),clearTimeout(e._transitionendTimeout),e._transitionendTimeout=setTimeout(function(){n||o()},t)}function E(e){return e&&'[object Function]'==={}.toString.call(e)}function O(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function w(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function L(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var t=O(e),o=t.overflow,i=t.overflowX,n=t.overflowY;return /(auto|scroll)/.test(o+n+i)?e:L(w(e))}function T(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||e.firstElementChild.offsetParent===e)}function S(e){return null===e.parentNode?e:S(e.parentNode)}function P(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?t:window.document.documentElement}function x(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!==s&&t!==s||i.contains(n))return T(s)?s:P(s);var a=S(e);return a.host?x(a.host,t):x(e,S(t).host)}function C(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){var n=window.document.documentElement,r=window.document.scrollingElement||n;return r[o]}return e[o]}function A(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=C(t,'top'),n=C(t,'left'),r=o?-1:1;return e.top+=i*r,e.bottom+=i*r,e.left+=n*r,e.right+=n*r,e}function k(e,t){var o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return+e['border'+o+'Width'].split('px')[0]+ +e['border'+i+'Width'].split('px')[0]}function I(e,t,o,i){return Te(t['offset'+e],o['client'+e],o['offset'+e],qe()?o['offset'+e]+i['margin'+('Height'===e?'Top':'Left')]+i['margin'+('Height'===e?'Bottom':'Right')]:0)}function D(){var e=window.document.body,t=window.document.documentElement,o=qe()&&window.getComputedStyle(t);return{height:I('Height',e,t,o),width:I('Width',e,t,o)}}function R(e){return ze({},e,{right:e.left+e.width,bottom:e.top+e.height})}function H(e){var t={};if(qe())try{t=e.getBoundingClientRect();var o=C(e,'top'),i=C(e,'left');t.top+=o,t.left+=i,t.bottom+=o,t.right+=i}catch(e){}else t=e.getBoundingClientRect();var n={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},r='HTML'===e.nodeName?D():{},s=r.width||e.clientWidth||n.right-n.left,a=r.height||e.clientHeight||n.bottom-n.top,p=e.offsetWidth-s,l=e.offsetHeight-a;if(p||l){var d=O(e);p-=k(d,'x'),l-=k(d,'y'),n.width-=p,n.height-=l}return R(n)}function N(e,t){var o=qe(),i='HTML'===t.nodeName,n=H(e),r=H(t),s=L(e),a=O(t),p=+a.borderTopWidth.split('px')[0],l=+a.borderLeftWidth.split('px')[0],d=R({top:n.top-r.top-p,left:n.left-r.left-l,width:n.width,height:n.height});if(d.marginTop=0,d.marginLeft=0,!o&&i){var c=+a.marginTop.split('px')[0],f=+a.marginLeft.split('px')[0];d.top-=p-c,d.bottom-=p-c,d.left-=l-f,d.right-=l-f,d.marginTop=c,d.marginLeft=f}return(o?t.contains(s):t===s&&'BODY'!==s.nodeName)&&(d=A(d,t)),d}function B(e){var t=window.document.documentElement,o=N(e,t),i=Te(t.clientWidth,window.innerWidth||0),n=Te(t.clientHeight,window.innerHeight||0),r=C(t),s=C(t,'left'),a={top:r-o.top+o.marginTop,left:s-o.left+o.marginLeft,width:i,height:n};return R(a)}function M(e){var t=e.nodeName;return'BODY'===t||'HTML'===t?!1:'fixed'===O(e,'position')||M(w(e))}function W(e,t,o,i){var n={top:0,left:0},r=x(e,t);if('viewport'===i)n=B(r);else{var s;'scrollParent'===i?(s=L(w(e)),'BODY'===s.nodeName&&(s=window.document.documentElement)):'window'===i?s=window.document.documentElement:s=i;var a=N(s,r);if('HTML'===s.nodeName&&!M(r)){var p=D(),l=p.height,d=p.width;n.top+=a.top-a.marginTop,n.bottom=l+a.top,n.left+=a.left-a.marginLeft,n.right=d+a.left}else n=a}return n.left+=o,n.top+=o,n.right-=o,n.bottom-=o,n}function U(e){var t=e.width,o=e.height;return t*o}function q(e,t,o,i,n){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var s=W(o,i,r,n),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return ze({key:e},a[e],{area:U(a[e])})}).sort(function(e,t){return t.area-e.area}),l=p.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),d=0<l.length?l[0].key:p[0].key,c=e.split('-')[1];return d+(c?'-'+c:'')}function _(e,t,o){var i=x(t,o);return N(o,i)}function F(e){var t=window.getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function Y(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 z(e,t,o){o=o.split('-')[0];var i=F(e),n={width:i.width,height:i.height},r=-1!==['right','left'].indexOf(o),s=r?'top':'left',a=r?'left':'top',p=r?'height':'width',l=r?'width':'height';return n[s]=t[s]+t[p]/2-i[p]/2,n[a]=o===a?t[a]-i[l]:t[Y(a)],n}function j(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function K(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var i=j(e,function(e){return e[t]===o});return e.indexOf(i)}function G(e,t,o){var i=void 0===o?e:e.slice(0,K(e,'name',o));return i.forEach(function(e){e.function&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var o=e.function||e.fn;e.enabled&&E(o)&&(t.offsets.popper=R(t.offsets.popper),t.offsets.reference=R(t.offsets.reference),t=o(t,e))}),t}function X(){if(!this.state.isDestroyed){var e={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=_(this.state,this.popper,this.reference),e.placement=q(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=z(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=G(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function V(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function Q(e){for(var t=[!1,'ms','webkit','moz','o'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function J(){return this.state.isDestroyed=!0,V(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[Q('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Z(e,t,o,i){var n='BODY'===e.nodeName,r=n?window:e;r.addEventListener(t,o,{passive:!0}),n||Z(L(r.parentNode),t,o,i),i.push(r)}function $(e,t,o,i){o.updateBound=i,window.addEventListener('resize',o.updateBound,{passive:!0});var n=L(e);return Z(n,'scroll',o.updateBound,o.scrollParents),o.scrollElement=n,o.eventsEnabled=!0,o}function ee(){this.state.eventsEnabled||(this.state=$(this.reference,this.options,this.state,this.scheduleUpdate))}function te(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 oe(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=te(this.reference,this.state))}function ie(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function ne(e,t){Object.keys(t).forEach(function(o){var i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&ie(t[o])&&(i='px'),e.style[o]=t[o]+i})}function re(e,t){Object.keys(t).forEach(function(o){var i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function se(e,t,o){var i=j(e,function(e){var o=e.name;return o===t}),n=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!n){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return n}function ae(e){return'end'===e?'start':'start'===e?'end':e}function pe(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=Ke.indexOf(e),i=Ke.slice(o+1).concat(Ke.slice(0,o));return t?i.reverse():i}function le(e,t,o,i){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],s=n[2];if(!r)return e;if(0===s.indexOf('%')){var a;switch(s){case'%p':a=o;break;case'%':case'%r':default:a=i;}var p=R(a);return p[t]/100*r}if('vh'===s||'vw'===s){var l;return l='vh'===s?Te(document.documentElement.clientHeight,window.innerHeight||0):Te(document.documentElement.clientWidth,window.innerWidth||0),l/100*r}return r}function de(e,t,o,i){var n=[0,0],r=-1!==['right','left'].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(j(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var p=/\s*,\s*|\s+/,l=-1===a?[s]:[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1]].concat(s.slice(a+1))];return l=l.map(function(e,i){var n=(1===i?!r:r)?'height':'width',s=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return le(e,n,t,o)})}),l.forEach(function(e,t){e.forEach(function(o,i){ie(o)&&(n[t]+=o*('-'===e[i-1]?-1:1))})}),n}function ce(e){return-(e-Ae.distance)+'px'}function fe(e){var t=e.el,o=e.popper,i=e.settings,n=i.position,r=i.popperOptions,s=i.offset,a=i.distance,p=i.flipDuration,l=o.querySelector(Ce.TOOLTIP),d=Je({placement:n},r||{},{modifiers:Je({},r?r.modifiers:{},{flip:Je({padding:a+5},r&&r.modifiers?r.modifiers.flip:{}),offset:Je({offset:s},r&&r.modifiers?r.modifiers.offset:{})}),onUpdate:function(){l.style.top='',l.style.bottom='',l.style.left='',l.style.right='',l.style[g(o.getAttribute('x-placement'))]=ce(a)}});return new Xe(t,o,d)}function me(e){var t=e.el,o=e.popper,i=e.settings,n=i.appendTo,r=i.followCursor,p=i.flipDuration;if(!n.contains(o)){if(n.appendChild(o),!!e.popperInstance)e.popperInstance.update(),(!r||xe.touch)&&e.popperInstance.enableEventListeners();else if(e.popperInstance=fe(e),window.MutationObserver){var l=o.style,d=new MutationObserver(function(){l[a('transitionDuration')]='0ms',e.popperInstance.update(),s(function(){l[a('transitionDuration')]=p+'ms'})});d.observe(o,{childList:!0,subtree:!0,characterData:!0}),e._mutationObserver=d}r&&!xe.touch&&(t.addEventListener('mousemove',b),e.popperInstance.disableEventListeners())}}function he(e){var t=e.popper,o=e.popperInstance,i=e.settings.stickyDuration,n=function(){return t.style[a('transitionDuration')]=i+'ms'},r=function(){return t.style[a('transitionDuration')]=''};s(function e(){o&&o.scheduleUpdate(),n(),h(t)?window.requestAnimationFrame(e):r()})}function ue(e,t){var o=ke.reduce(function(o,i){var n=e.getAttribute('data-'+i.toLowerCase())||t[i];return'false'===n&&(n=!1),'true'===n&&(n=!0),isFinite(n)&&!isNaN(parseFloat(n))&&(n=parseFloat(n)),'string'==typeof n&&'['===n.trim().charAt(0)&&(n=JSON.parse(n)),o[i]=n,o},{});return Je({},t,o)}function ge(e,t,o){var i=o.position,n=o.distance,r=o.arrow,s=o.animateFill,a=o.inertia,p=o.animation,l=o.arrowSize,d=o.size,c=o.theme,f=o.html,m=o.zIndex,h=o.interactive,u=document.createElement('div');u.setAttribute('class','tippy-popper'),u.setAttribute('role','tooltip'),u.setAttribute('aria-hidden','true'),u.setAttribute('id','tippy-tooltip-'+e),u.style.zIndex=m;var b=document.createElement('div');if(b.setAttribute('class','tippy-tooltip tippy-tooltip--'+d+' leave'),b.setAttribute('data-animation',p),c.split(' ').forEach(function(e){b.classList.add(e+'-theme')}),r){var y=document.createElement('div');y.setAttribute('class','arrow-'+l),y.setAttribute('x-arrow',''),b.appendChild(y)}if(s){b.setAttribute('data-animatefill','');var v=document.createElement('div');v.setAttribute('class','leave'),v.setAttribute('x-circle',''),b.appendChild(v)}a&&b.setAttribute('data-inertia',''),h&&b.setAttribute('data-interactive','');var E=document.createElement('div');if(E.setAttribute('class','tippy-tooltip-content'),f){var O;f instanceof Element?(E.appendChild(f),O='#'+f.id||'tippy-html-template'):(E.innerHTML=document.getElementById(f.replace('#','')).innerHTML,O=f),u.classList.add('html-template'),h&&u.setAttribute('tabindex','-1'),b.setAttribute('data-template-id',O)}else E.innerHTML=t;return b.style[g(i)]=ce(n),b.appendChild(E),u.appendChild(b),u}function be(e,t,o,i){var n=[];return'manual'===e?n:(t.addEventListener(e,o.handleTrigger),n.push({event:e,handler:o.handleTrigger}),'mouseenter'===e&&(xe.SUPPORTS_TOUCH&&i&&(t.addEventListener('touchstart',o.handleTrigger),n.push({event:'touchstart',handler:o.handleTrigger}),t.addEventListener('touchend',o.handleMouseleave),n.push({event:'touchend',handler:o.handleMouseleave})),t.addEventListener('mouseleave',o.handleMouseleave),n.push({event:'mouseleave',handler:o.handleMouseleave})),'focus'===e&&(t.addEventListener('blur',o.handleBlur),n.push({event:'blur',handler:o.handleBlur})),n)}function ye(e,t,o){if(!t.getAttribute('x-placement'))return!0;var i=e.clientX,n=e.clientY,r=o.interactiveBorder,s=o.distance,a=t.getBoundingClientRect(),p=g(t.getAttribute('x-placement')),l=r+s,d={top:a.top-n>r,bottom:n-a.bottom>r,left:a.left-i>r,right:i-a.right>r};return'top'===p?d.top=a.top-n>l:'bottom'===p?d.bottom=n-a.bottom>l:'left'===p?d.left=a.left-i>l:'right'===p?d.right=i-a.right>l:void 0,d.top||d.bottom||d.left||d.right}function ve(e,o,i){var n,r,s=this,a=i.position,p=i.delay,l=i.duration,d=i.interactive,c=i.interactiveBorder,f=i.distance,m=i.hideOnClick,u=i.trigger,g=i.touchHold,b=i.touchWait,y=function(){clearTimeout(n),clearTimeout(r)},v=function(){if(y(),!h(o)){var e=Array.isArray(p)?p[0]:p;p?n=setTimeout(function(){return s.show(o)},e):s.show(o)}},E=function(e){return s.callbacks.wait?s.callbacks.wait.call(o,v,e):v()},O=function(){y();var e=Array.isArray(p)?p[1]:p;p?r=setTimeout(function(){return s.hide(o)},e):s.hide(o)};return{handleTrigger:function(t){var i='mouseenter'===t.type&&xe.SUPPORTS_TOUCH&&xe.touch;if(!(i&&g)){var n='click'===t.type;n&&h(o)&&'persistent'!==m?O():E(t),i&&xe.iOS()&&e.click&&e.click()}},handleMouseleave:function(n){if(!('mouseleave'===n.type&&xe.SUPPORTS_TOUCH&&xe.touch&&g)){if(d){var r=function n(r){var s=function(){document.body.removeEventListener('mouseleave',O),document.removeEventListener('mousemove',n),O()},a=t(r.target,Ce.TOOLTIPPED_EL),p=t(r.target,Ce.POPPER)===o,l=-1!==u.indexOf('click');return a&&a!==e?s():void(p||a===e||l||ye(r,o,i)&&s())};return document.body.addEventListener('mouseleave',O),void document.addEventListener('mousemove',r)}O()}},handleBlur:function(e){!e.relatedTarget||xe.touch||t(e.relatedTarget,Ce.POPPER)||O()}}}function Ee(e){var t=this;return e.reduce(function(e,o){var i=t.settings.performance?t.settings:ue(o,t.settings);i.arrow&&(i.animateFill=!1);var n=i.html,r=i.trigger,s=i.touchHold,a=o.getAttribute('title');if(!a&&!n)return e;var p=Ze;o.setAttribute('data-tooltipped',''),o.setAttribute('aria-describedby','tippy-tooltip-'+p),l(o);var d=ge(p,a,i),c=ve.call(t,o,d,i),f=[];return r.trim().split(' ').forEach(function(e){return f=f.concat(be(e,o,c,s))}),e.push({id:p,el:o,popper:d,settings:i,listeners:f,tippyInstance:t}),Ze++,e},[])}function Oe(e,t){return new $e(e,t)}var we=Math.min,Le=Math.floor,Te=Math.max,Se=Math.round,xe={};'undefined'!=typeof window&&(xe.SUPPORTED='requestAnimationFrame'in window,xe.SUPPORTS_TOUCH='ontouchstart'in window,xe.touch=!1,xe.dynamicInputDetection=!0,xe.iOS=function(){return /iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream});for(var Pe=[],Ce={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-tooltip-content',CIRCLE:'[x-circle]',ARROW:'[x-arrow]',TOOLTIPPED_EL:'[data-tooltipped]',CONTROLLER:'[data-tippy-controller]'},Ae={html:!1,position:'top',animation:'shift',animateFill:!0,arrow:!1,arrowSize:'regular',delay:0,trigger:'mouseenter focus',duration:350,interactive:!1,interactiveBorder:2,theme:'dark',size:'regular',distance:10,offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,flipDuration:350,sticky:!1,stickyDuration:200,appendTo:null,zIndex:9999,touchHold:!1,performance:!1,popperOptions:{}},ke=xe.SUPPORTED&&Object.keys(Ae),Ie=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),o=t.length;0<=--o&&t.item(o)!==this;);return-1<o},De=['native code','[object MutationObserverConstructor]'],Re=function(e){return De.some(function(t){return-1<(e||'').toString().indexOf(t)})},He='undefined'!=typeof window,Ne=['Edge','Trident','Firefox'],Be=0,Me=0;Me<Ne.length;Me+=1)if(He&&0<=navigator.userAgent.indexOf(Ne[Me])){Be=1;break}var i,We=He&&Re(window.MutationObserver),Ue=We?function(e){var t=!1,o=0,i=document.createElement('span'),n=new MutationObserver(function(){e(),t=!1});return n.observe(i,{attributes:!0}),function(){t||(t=!0,i.setAttribute('x-index',o),++o)}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Be))}},qe=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},_e=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 o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Ye=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},ze=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},je=['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'],Ke=je.slice(3),Ge={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},Xe=function(){function e(t,o){var i=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};_e(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Ue(this.update.bind(this)),this.options=ze({},e.Defaults,n),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=o.jquery?o[0]:o,this.options.modifiers={},Object.keys(ze({},e.Defaults.modifiers,n.modifiers)).forEach(function(t){i.options.modifiers[t]=ze({},e.Defaults.modifiers[t]||{},n.modifiers?n.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return ze({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&E(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return Fe(e,[{key:'update',value:function(){return X.call(this)}},{key:'destroy',value:function(){return J.call(this)}},{key:'enableEventListeners',value:function(){return ee.call(this)}},{key:'disableEventListeners',value:function(){return oe.call(this)}}]),e}();Xe.Utils=('undefined'==typeof window?global:window).PopperUtils,Xe.placements=je,Xe.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){var n=e.offsets,r=n.reference,s=n.popper,a=-1!==['bottom','top'].indexOf(o),p=a?'left':'top',l=a?'width':'height',d={start:Ye({},p,r[p]),end:Ye({},p,r[p]+r[l]-s[l])};e.offsets.popper=ze({},s,d[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var o,i=t.offset,n=e.placement,r=e.offsets,s=r.popper,a=r.reference,p=n.split('-')[0];return o=ie(+i)?[+i,0]:de(i,s,a,p),'left'===p?(s.top+=o[0],s.left-=o[1]):'right'===p?(s.top+=o[0],s.left+=o[1]):'top'===p?(s.left+=o[0],s.top-=o[1]):'bottom'===p&&(s.left+=o[0],s.top+=o[1]),e.popper=s,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||P(e.instance.popper);e.instance.reference===o&&(o=P(o));var i=W(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var n=t.priority,r=e.offsets.popper,s={primary:function(e){var o=r[e];return r[e]<i[e]&&!t.escapeWithReference&&(o=Te(r[e],i[e])),Ye({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=r[o];return r[e]>i[e]&&!t.escapeWithReference&&(n=we(r[o],i[e]-('right'===e?r.width:r.height))),Ye({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';r=ze({},r,s[t](e))}),e.offsets.popper=r,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=Le,s=-1!==['top','bottom'].indexOf(n),a=s?'right':'bottom',p=s?'left':'top',l=s?'width':'height';return o[a]<r(i[p])&&(e.offsets.popper[p]=r(i[p])-o[l]),o[p]>r(i[a])&&(e.offsets.popper[p]=r(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!se(e.instance.modifiers,'arrow','keepTogether'))return e;var o=t.element;if('string'==typeof o){if(o=e.instance.popper.querySelector(o),!o)return e;}else if(!e.instance.popper.contains(o))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var i=e.placement.split('-')[0],n=e.offsets,r=n.popper,s=n.reference,a=-1!==['left','right'].indexOf(i),p=a?'height':'width',l=a?'top':'left',d=a?'left':'top',c=a?'bottom':'right',f=F(o)[p];s[c]-f<r[l]&&(e.offsets.popper[l]-=r[l]-(s[c]-f)),s[l]+f>r[c]&&(e.offsets.popper[l]+=s[l]+f-r[c]);var m=s[l]+s[p]/2-f/2,h=m-R(e.offsets.popper)[l];return h=Te(we(r[p]-f,h),0),e.arrowElement=o,e.offsets.arrow={},e.offsets.arrow[l]=Se(h),e.offsets.arrow[d]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(V(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=W(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=Y(i),r=e.placement.split('-')[1]||'',s=[];switch(t.behavior){case Ge.FLIP:s=[i,n];break;case Ge.CLOCKWISE:s=pe(i);break;case Ge.COUNTERCLOCKWISE:s=pe(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],n=Y(i);var l=e.offsets.popper,d=e.offsets.reference,c=Le,f='left'===i&&c(l.right)>c(d.left)||'right'===i&&c(l.left)<c(d.right)||'top'===i&&c(l.bottom)>c(d.top)||'bottom'===i&&c(l.top)<c(d.bottom),m=c(l.left)<c(o.left),h=c(l.right)>c(o.right),u=c(l.top)<c(o.top),g=c(l.bottom)>c(o.bottom),b='left'===i&&m||'right'===i&&h||'top'===i&&u||'bottom'===i&&g,y=-1!==['top','bottom'].indexOf(i),v=!!t.flipVariations&&(y&&'start'===r&&m||y&&'end'===r&&h||!y&&'start'===r&&u||!y&&'end'===r&&g);(f||b||v)&&(e.flipped=!0,(f||b)&&(i=s[p+1]),v&&(r=ae(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=ze({},e.offsets.popper,z(e.instance.popper,e.offsets.reference,e.placement)),e=G(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,s=-1!==['left','right'].indexOf(o),a=-1===['top','left'].indexOf(o);return n[s?'left':'top']=r[t]-(a?n[s?'width':'height']:0),e.placement=Y(t),e.offsets.popper=R(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!se(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=j(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.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}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,n=e.offsets.popper,r=j(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,a,p=void 0===r?t.gpuAcceleration:r,l=P(e.instance.popper),d=H(l),c={position:n.position},f={left:Le(n.left),top:Le(n.top),bottom:Le(n.bottom),right:Le(n.right)},m='bottom'===o?'top':'bottom',h='right'===i?'left':'right',u=Q('transform');if(a='bottom'==m?-d.height+f.bottom:f.top,s='right'==h?-d.width+f.right:f.left,p&&u)c[u]='translate3d('+s+'px, '+a+'px, 0)',c[m]=0,c[h]=0,c.willChange='transform';else{var g='bottom'==m?-1:1,b='right'==h?-1:1;c[m]=a*g,c[h]=s*b,c.willChange=m+', '+h}var y={"x-placement":e.placement};return e.attributes=ze({},y,e.attributes),e.styles=ze({},c,e.styles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return ne(e.instance.popper,e.styles),re(e.instance.popper,e.attributes),e.offsets.arrow&&ne(e.arrowElement,e.offsets.arrow),e},onLoad:function(e,t,o,i,n){var r=_(n,t,e),s=q(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',s),ne(t,{position:'absolute'}),o},gpuAcceleration:void 0}}};var Ve=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},Qe=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Je=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ze=1,$e=function(){function e(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};Ve(this,e),xe.SUPPORTED&&(r(),this.state={destroyed:!1},this.selector=t,this.settings=Je({},Ae,o),this.callbacks={wait:o.wait,show:o.onShow||o.show||u,shown:o.onShown||o.shown||u,hide:o.onHide||o.hide||u,hidden:o.onHidden||o.hidden||u},this.store=Ee.call(this,y(t)),Pe.push.apply(Pe,this.store))}return Qe(e,[{key:'getPopperElement',value:function(e){try{return o(this.store,function(t){return t.el===e}).popper}catch(t){console.error('[getPopperElement]: Element passed as the argument does not exist in the instance')}}},{key:'getReferenceElement',value:function(e){try{return o(this.store,function(t){return t.popper===e}).el}catch(t){console.error('[getReferenceElement]: Popper passed as the argument does not exist in the instance')}}},{key:'getReferenceData',value:function(e){return o(this.store,function(t){return t.el===e||t.popper===e})}},{key:'show',value:function(e,t){var i=this;if(!this.state.destroyed){this.callbacks.show.call(e);var n=o(this.store,function(t){return t.popper===e}),r=e.querySelector(Ce.TOOLTIP),a=e.querySelector(Ce.CIRCLE),p=e.querySelector(Ce.CONTENT),l=n.el,d=n.settings,u=d.appendTo,g=d.sticky,b=d.interactive,y=d.followCursor,E=d.flipDuration,O=d.duration,w=void 0===t?Array.isArray(O)?O[0]:O:t;m([e,r,a],0),me(n),e.style.visibility='visible',e.setAttribute('aria-hidden','false'),s(function(){h(e)&&((!y||xe.touch)&&n.popperInstance.update(),m([r,a],w),(!y||xe.touch)&&m([e],E),a&&(p.style.opacity=1),b&&l.classList.add('active'),g&&he(n),c(r,a),f([r,a],function(e){e.contains('tippy-notransition')&&e.remove('tippy-notransition'),e.remove('leave'),e.add('enter')}),v(n,w,function(){!h(e)||n._onShownFired||(b&&e.focus(),r.classList.add('tippy-notransition'),n._onShownFired=!0,i.callbacks.shown.call(e))}))})}}},{key:'hide',value:function(e,t){var i=this;if(!this.state.destroyed){this.callbacks.hide.call(e);var n=o(this.store,function(t){return t.popper===e}),r=e.querySelector(Ce.TOOLTIP),s=e.querySelector(Ce.CIRCLE),a=e.querySelector(Ce.CONTENT),p=n.el,l=n.settings,c=l.appendTo,u=l.sticky,g=l.interactive,y=l.followCursor,E=l.html,O=l.trigger,w=l.duration,L=void 0===t?Array.isArray(w)?w[1]:w:t;n._onShownFired=!1,g&&p.classList.remove('active'),e.style.visibility='hidden',e.setAttribute('aria-hidden','true'),m([r,s,s?a:null],L),s&&(a.style.opacity=0),f([r,s],function(e){e.contains('tippy-tooltip')&&e.remove('tippy-notransition'),e.remove('enter'),e.add('leave')}),E&&-1!==O.indexOf('click')&&d(p)&&p.focus(),v(n,L,function(){h(e)||!c.contains(e)||(p.removeEventListener('mousemove',b),n.popperInstance.disableEventListeners(),c.removeChild(e),i.callbacks.hidden.call(e))})}}},{key:'update',value:function(e){if(!this.state.destroyed){var t=o(this.store,function(t){return t.popper===e}),i=e.querySelector(Ce.CONTENT),n=t.el,r=t.settings.html;return r instanceof Element?void console.warn('Aborted: update() should not be used if `html` is a DOM element'):void(i.innerHTML=r?document.getElementById(r.replace('#','')).innerHTML:n.getAttribute('title')||n.getAttribute('data-original-title'),!r&&l(n))}}},{key:'destroy',value:function(e,t){var i=this;if(!this.state.destroyed){var n=o(this.store,function(t){return t.popper===e}),r=n.el,s=n.popperInstance,a=n.listeners,l=n._mutationObserver;h(e)&&this.hide(e,0),a.forEach(function(e){return r.removeEventListener(e.event,e.handler)}),r.setAttribute('title',r.getAttribute('data-original-title')),r.removeAttribute('data-original-title'),r.removeAttribute('data-tooltipped'),r.removeAttribute('aria-describedby'),s&&s.destroy(),l&&l.disconnect(),Pe.splice(p(Pe,function(t){return t.popper===e}),1),(void 0===t||t)&&(this.store=Pe.filter(function(e){return e.tippyInstance===i}))}}},{key:'destroyAll',value:function(){var e=this;if(!this.state.destroyed){var t=this.store.length;this.store.forEach(function(o,i){var n=o.popper;e.destroy(n,i===t-1)}),this.store=null,this.state.destroyed=!0}}}]),e}();return Oe.Browser=xe,Oe.Defaults=Ae,Oe.disableDynamicInputDetection=function(){return xe.dynamicInputDetection=!1},Oe.enableDynamicInputDetection=function(){return xe.dynamicInputDetection=!0},Oe});