MediaWiki:Tippy.js

From Elwiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper)}(this,function(t){"use strict";var e,n,r,o="undefined"!=typeof window&&"undefined"!=typeof document,i=!!o&&!!window.msCrypto,a={passive:!0,capture:!0},s=function(){return document.body};function p(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function u(t,e){var n=({}).toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function c(t,e){return"function"==typeof t?t.apply(void 0,e):t}function f(t,e){var n;return 0===e?t:function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function l(t,e){var n=Object.assign({},t);return e.forEach(function(t){delete n[t]}),n}function d(t){return[].concat(t)}function v(t,e){-1===t.indexOf(e)&&t.push(e)}function m(t){return t.split("-")[0]}function g(t){return[].slice.call(t)}function h(t){return Object.keys(t).reduce(function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e},{})}function y(){return document.createElement("div")}function b(t){return["Element","Fragment"].some(function(e){return u(t,e)})}function $(t){return u(t,"MouseEvent")}function w(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function _(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function x(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function E(t){var e,n=d(t)[0];return null!=n&&null!=(e=n.ownerDocument)&&e.body?n.ownerDocument:document}function C(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[r](e,n)})}function T(t,e){for(var n,r=e;r;){if(t.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var A={isTouch:!1},O=0;function L(){A.isTouch||(A.isTouch=!0,window.performance&&document.addEventListener("mousemove",D))}function D(){var t=performance.now();t-O<20&&(A.isTouch=!1,document.removeEventListener("mousemove",D)),O=t}function k(){var t=document.activeElement;if(w(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var R=Object.assign({appendTo:s,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),P=Object.keys(R);function V(t){var e=(t.plugins||[]).reduce(function(e,n){var r,o=n.name,i=n.defaultValue;return o&&(e[o]=void 0!==t[o]?t[o]:null!=(r=R[o])?r:i),e},{});return Object.assign({},t,e)}function M(t,e){var n,r,o=Object.assign({},e,{content:c(e.content,[t])},e.ignoreAttributes?{}:(n=t,((r=e.plugins)?Object.keys(V(Object.assign({},R,{plugins:r}))):P).reduce(function(t,e){var r=(n.getAttribute("data-tippy-"+e)||"").trim();if(!r)return t;if("content"===e){var o=n.querySelector(".content");t[e]=o.innerHTML,o.remove()}else try{t[e]=JSON.parse(r)}catch(i){t[e]=r}return t},{})));return o.aria=Object.assign({},R.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?e.interactive:o.aria.expanded,content:"auto"===o.aria.content?e.interactive?null:"describedby":o.aria.content},o}function I(t,e){t.innerHTML=e}function S(t){var e=y();return!0===t?e.className="tippy-arrow":(e.className="tippy-svg-arrow",b(t)?e.appendChild(t):I(e,t)),e}function H(t,e){b(e.content)?(I(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?I(t,e.content):t.textContent=e.content)}function B(t){var e=t.firstElementChild,n=g(e.children);return{box:e,content:n.find(function(t){return t.classList.contains("tippy-content")}),arrow:n.find(function(t){return t.classList.contains("tippy-arrow")||t.classList.contains("tippy-svg-arrow")}),backdrop:n.find(function(t){return t.classList.contains("tippy-backdrop")})}}function N(t){var e=y(),n=y();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=y();function o(n,r){var o=B(e),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||H(a,t.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(S(r.arrow))):i.appendChild(S(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),H(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}N.$$tippy=!0;var U=1,z=[],W=[];function X(e,n){void 0===n&&(n={});var r,o,l=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",L,a),window.addEventListener("blur",k);var w=Object.assign({},n,{plugins:l}),O=(r=e,b(r)?[r]:(o=r,u(o,"NodeList"))?g(r):Array.isArray(r)?r:g(document.querySelectorAll(r))).reduce(function(e,n){var r=n&&function(e,n){var r,o,u,l,b,w,O,L,D=M(e,Object.assign({},R,V(h(n)))),k=!1,P=!1,I=!1,S=!1,H=[],N=f(t$,D.interactiveDebounce),X=U++,Y=(L=D.plugins).filter(function(t,e){return L.indexOf(t)===e}),q={id:X,reference:e,popper:y(),popperInstance:null,props:D,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(u)},setProps:function(t){if(!q.state.isDestroyed){ta("onBeforeUpdate",[q,t]),ty();var n=q.props,r=M(e,Object.assign({},n,h(t),{ignoreAttributes:!0}));q.props=r,th(),n.interactiveDebounce!==r.interactiveDebounce&&(tu(),N=f(t$,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?d(n.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):r.triggerTarget&&e.removeAttribute("aria-expanded"),tp(),ti(),G&&G(n,r),q.popperInstance&&(tE(),tT().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),ta("onAfterUpdate",[q,t])}},setContent:function(t){q.setProps({content:t})},show:function(){var t=q.state.isVisible,e=q.state.isDestroyed,n=!q.state.isEnabled,r=A.isTouch&&!q.props.touch,o=p(q.props.duration,0,R.duration);if(!(t||e||n||r||te().hasAttribute("disabled"))&&(ta("onShow",[q],!1),!1!==q.props.onShow(q))){if(q.state.isVisible=!0,tt()&&(j.style.visibility="visible"),ti(),td(),q.state.isMounted||(j.style.transition="none"),tt()){var i,a,u,f,l=tr();_([l.box,l.content],0)}w=function(){var t;if(q.state.isVisible&&!S){if(S=!0,j.offsetHeight,j.style.transition=q.props.moveTransition,tt()&&q.props.animation){var e,n,r=tr(),i=r.box,a=r.content;_([i,a],o),x([i,a],"visible")}ts(),tp(),v(W,q),null==(t=q.popperInstance)||t.forceUpdate(),ta("onMount",[q]),q.props.animation&&tt()&&(e=o,tm(e,n=function(){q.state.isShown=!0,ta("onShown",[q])}))}},a=q.props.appendTo,u=te(),(i=q.props.interactive&&a===s||"parent"===a?u.parentNode:c(a,[u])).contains(j)||i.appendChild(j),q.state.isMounted=!0,tE()}},hide:function(){var t=!q.state.isVisible,e=q.state.isDestroyed,n=!q.state.isEnabled,r=p(q.props.duration,1,R.duration);if(!t&&!e&&!n&&(ta("onHide",[q],!1),!1!==q.props.onHide(q))){if(q.state.isVisible=!1,q.state.isShown=!1,S=!1,k=!1,tt()&&(j.style.visibility="hidden"),tu(),tv(),ti(!0),tt()){var o,i,a=tr(),s=a.box,u=a.content;q.props.animation&&(_([s,u],r),x([s,u],"hidden"))}ts(),tp(),q.props.animation?tt()&&(o=r,i=q.unmount,tm(o,function(){!q.state.isVisible&&j.parentNode&&j.parentNode.contains(j)&&i()})):q.unmount()}},hideWithInteractivity:function(t){tn().addEventListener("mousemove",N),v(z,N),N(t)},enable:function(){q.state.isEnabled=!0},disable:function(){q.hide(),q.state.isEnabled=!1},unmount:function(){q.state.isVisible&&q.hide(),q.state.isMounted&&(tC(),tT().forEach(function(t){t._tippy.unmount()}),j.parentNode&&j.parentNode.removeChild(j),W=W.filter(function(t){return t!==q}),q.state.isMounted=!1,ta("onHidden",[q]))},destroy:function(){q.state.isDestroyed||(q.clearDelayTimeouts(),q.unmount(),ty(),delete e._tippy,q.state.isDestroyed=!0,ta("onDestroy",[q]))}};if(!D.render)return q;var F=D.render(q),j=F.popper,G=F.onUpdate;j.setAttribute("data-tippy-root",""),j.id="tippy-"+q.id,q.popper=j,e._tippy=q,j._tippy=q;var J=Y.map(function(t){return t.fn(q)}),K=e.hasAttribute("aria-expanded");return th(),tp(),ti(),ta("onCreate",[q]),D.showOnCreate&&tA(),j.addEventListener("mouseenter",function(){q.props.interactive&&q.state.isVisible&&q.clearDelayTimeouts()}),j.addEventListener("mouseleave",function(){q.props.interactive&&q.props.trigger.indexOf("mouseenter")>=0&&tn().addEventListener("mousemove",N)}),q;function Q(){var t=q.props.touch;return Array.isArray(t)?t:[t,0]}function Z(){return"hold"===Q()[0]}function tt(){var t;return!(null==(t=q.props.render)||!t.$$tippy)}function te(){return O||e}function tn(){var t=te().parentNode;return t?E(t):document}function tr(){return B(j)}function to(t){return q.state.isMounted&&!q.state.isVisible||A.isTouch||l&&"focus"===l.type?0:p(q.props.delay,t?0:1,R.delay)}function ti(t){void 0===t&&(t=!1),j.style.pointerEvents=q.props.interactive&&!t?"":"none",j.style.zIndex=""+q.props.zIndex}function ta(t,e,n){var r;void 0===n&&(n=!0),J.forEach(function(n){n[t]&&n[t].apply(n,e)}),n&&(r=q.props)[t].apply(r,e)}function ts(){var t=q.props.aria;if(t.content){var n="aria-"+t.content,r=j.id;d(q.props.triggerTarget||e).forEach(function(t){var e=t.getAttribute(n);if(q.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}})}}function tp(){!K&&q.props.aria.expanded&&d(q.props.triggerTarget||e).forEach(function(t){q.props.interactive?t.setAttribute("aria-expanded",q.state.isVisible&&t===te()?"true":"false"):t.removeAttribute("aria-expanded")})}function tu(){tn().removeEventListener("mousemove",N),z=z.filter(function(t){return t!==N})}function tc(t){if(!A.isTouch||!I&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!q.props.interactive||!T(j,n)){if(d(q.props.triggerTarget||e).some(function(t){return T(t,n)})){if(A.isTouch||q.state.isVisible&&q.props.trigger.indexOf("click")>=0)return}else ta("onClickOutside",[q,t]);!0===q.props.hideOnClick&&(q.clearDelayTimeouts(),q.hide(),P=!0,setTimeout(function(){P=!1}),q.state.isMounted||tv())}}}function tf(){I=!0}function tl(){I=!1}function td(){var t=tn();t.addEventListener("mousedown",tc,!0),t.addEventListener("touchend",tc,a),t.addEventListener("touchstart",tl,a),t.addEventListener("touchmove",tf,a)}function tv(){var t=tn();t.removeEventListener("mousedown",tc,!0),t.removeEventListener("touchend",tc,a),t.removeEventListener("touchstart",tl,a),t.removeEventListener("touchmove",tf,a)}function tm(t,e){var n=tr().box;function r(t){t.target===n&&(C(n,"remove",r),e())}if(0===t)return e();C(n,"remove",b),C(n,"add",r),b=r}function tg(t,n,r){void 0===r&&(r=!1),d(q.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),H.push({node:e,eventType:t,handler:n,options:r})})}function th(){var t;Z()&&(tg("touchstart",tb,{passive:!0}),tg("touchend",tw,{passive:!0})),(0,q.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch(tg(t,tb),t){case"mouseenter":tg("mouseleave",tw);break;case"focus":tg(i?"focusout":"blur",t_);break;case"focusin":tg("focusout",t_)}})}function ty(){H.forEach(function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)}),H=[]}function tb(t){var e,n=!1;if(q.state.isEnabled&&!tx(t)&&!P){var r="focus"===(null==(e=l)?void 0:e.type);l=t,O=t.currentTarget,tp(),!q.state.isVisible&&$(t)&&z.forEach(function(e){return e(t)}),"click"===t.type&&(0>q.props.trigger.indexOf("mouseenter")||k)&&!1!==q.props.hideOnClick&&q.state.isVisible?n=!0:tA(t),"click"===t.type&&(k=!n),n&&!r&&tO(t)}}function t$(t){var e,n,r,o,i=t.target,a=te().contains(i)||j.contains(i);"mousemove"===t.type&&a||(e=tT().concat(j).map(function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:D}:null}).filter(Boolean),r=(n=t).clientX,o=n.clientY,e.every(function(t){var e=t.popperRect,n=t.popperState,i=t.props.interactiveBorder,a=m(n.placement),s=n.modifiersData.offset;if(!s)return!0;var p="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,f="left"===a?s.right.x:0,l=e.top-o+p>i,d=o-e.bottom-u>i,v=e.left-r+c>i,g=r-e.right-f>i;return l||d||v||g})&&(tu(),tO(t)))}function tw(t){tx(t)||q.props.trigger.indexOf("click")>=0&&k||(q.props.interactive?q.hideWithInteractivity(t):tO(t))}function t_(t){0>q.props.trigger.indexOf("focusin")&&t.target!==te()||q.props.interactive&&t.relatedTarget&&j.contains(t.relatedTarget)||tO(t)}function tx(t){return!!A.isTouch&&Z()!==t.type.indexOf("touch")>=0}function tE(){tC();var n=q.props,r=n.popperOptions,o=n.placement,i=n.offset,a=n.getReferenceClientRect,s=n.moveTransition,p=tt()?B(j).arrow:null,u=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:e,c=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(tt()){var n=tr().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)}),e.attributes.popper={}}}}];tt()&&p&&c.push({name:"arrow",options:{element:p,padding:3}}),c.push.apply(c,(null==r?void 0:r.modifiers)||[]),q.popperInstance=t.createPopper(u,j,Object.assign({},r,{placement:o,onFirstUpdate:w,modifiers:c}))}function tC(){q.popperInstance&&(q.popperInstance.destroy(),q.popperInstance=null)}function tT(){return g(j.querySelectorAll("[data-tippy-root]"))}function tA(t){q.clearDelayTimeouts(),t&&ta("onTrigger",[q,t]),td();var e=to(!0),n=Q(),o=n[0],i=n[1];A.isTouch&&"hold"===o&&i&&(e=i),e?r=setTimeout(function(){q.show()},e):q.show()}function tO(t){if(q.clearDelayTimeouts(),ta("onUntrigger",[q,t]),q.state.isVisible){if(!(q.props.trigger.indexOf("mouseenter")>=0&&q.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&k)){var e=to(!1);e?o=setTimeout(function(){q.state.isVisible&&q.hide()},e):u=requestAnimationFrame(function(){q.hide()})}}else tv()}}(n,w);return r&&e.push(r),e},[]);return b(e)?O[0]:O}X.defaultProps=R,X.setDefaultProps=function(t){Object.keys(t).forEach(function(e){R[e]=t[e]})},X.currentInput=A;var Y=Object.assign({},t.applyStyles,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),q={mouseover:"mouseenter",focusin:"focus",click:"click"},F={clientX:0,clientY:0},j=[];function G(t){var e;F={clientX:t.clientX,clientY:t.clientY}}function J(t,e){return!t||!e||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left}return o&&((e=document.createElement("style")).textContent='.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}',e.setAttribute("data-tippy-stylesheet",""),n=document.head,(r=document.querySelector("head>style,head>link"))?n.insertBefore(e,r):n.appendChild(e)),X.setDefaultProps({plugins:[{name:"animateFill",defaultValue:!1,fn:function(t){if(null==(n=t.props.render)||!n.$$tippy)return{};var e,n,r=B(t.popper),o=r.box,i=r.content,a=t.props.animateFill?((e=y()).className="tippy-backdrop",x([e],"hidden"),e):null;return{onCreate:function(){a&&(o.insertBefore(a,o.firstElementChild),o.setAttribute("data-animatefill",""),o.style.overflow="hidden",t.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(a){var t=o.style.transitionDuration,e=Number(t.replace("ms",""));i.style.transitionDelay=Math.round(e/10)+"ms",a.style.transitionDuration=t,x([a],"visible")}},onShow:function(){a&&(a.style.transitionDuration="0ms")},onHide:function(){a&&x([a],"hidden")}}}},{name:"followCursor",defaultValue:!1,fn:function(t){var e=t.reference,n=E(t.props.triggerTarget||e),r=!1,o=!1,i=!0,a=t.props;function s(){return"initial"===t.props.followCursor&&t.state.isVisible}function p(){n.addEventListener("mousemove",f)}function u(){n.removeEventListener("mousemove",f)}function c(){r=!0,t.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||e.contains(n.target),o=t.props.followCursor,i=n.clientX,a=n.clientY,s=e.getBoundingClientRect(),p=i-s.left,u=a-s.top;!r&&t.props.interactive||t.setProps({getReferenceClientRect:function(){var t=e.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=t.left+p,r=t.top+u);var s="horizontal"===o?t.top:r,c="vertical"===o?t.right:n,f="horizontal"===o?t.bottom:r,l="vertical"===o?t.left:n;return{width:c-l,height:f-s,top:s,right:c,bottom:f,left:l}}})}function l(){t.props.followCursor&&(j.push({instance:t,doc:n}),function(t){t.addEventListener("mousemove",G)}(n))}function d(){0===(j=j.filter(function(e){return e.instance!==t})).filter(function(t){return t.doc===n}).length&&function(t){t.removeEventListener("mousemove",G)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=t.props},onAfterUpdate:function(e,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!t.state.isMounted||o||s()||p()):(u(),c()))},onMount:function(){t.props.followCursor&&!o&&(i&&(f(F),i=!1),s()||p())},onTrigger:function(t,e){$(e)&&(F={clientX:e.clientX,clientY:e.clientY}),o="focus"===e.type},onHidden:function(){t.props.followCursor&&(c(),u(),i=!0)}}}},{name:"inlinePositioning",defaultValue:!1,fn:function(t){var e,n=t.reference,r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;t.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),e!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),t.setProps({getReferenceClientRect:function(){var t;return function(t,e,n,r){if(n.length<2||null===t)return e;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||e;switch(t){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===t,s=o.top,p=i.bottom,u=a?o.left:i.left,c=a?o.right:i.right;return{top:s,bottom:p,left:u,right:c,width:c-u,height:p-s};case"left":case"right":var f=Math.min.apply(Math,n.map(function(t){return t.left})),l=Math.max.apply(Math,n.map(function(t){return t.right})),d=n.filter(function(e){return"left"===t?e.left===f:e.right===l}),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return e}}(m(t=a.placement),n.getBoundingClientRect(),g(n.getClientRects()),r)}})),e=a.placement)}};function s(){var e,n,r,i;o||(e=(n=t.props,r=a,{popperOptions:Object.assign({},n.popperOptions,{modifiers:[].concat(((null==(i=n.popperOptions)?void 0:i.modifiers)||[]).filter(function(t){return t.name!==r.name}),[r])})}),o=!0,t.setProps(e),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(e,n){if($(n)){var o=g(t.reference.getClientRects()),i=o.find(function(t){return t.left-2<=n.clientX&&t.right+2>=n.clientX&&t.top-2<=n.clientY&&t.bottom+2>=n.clientY}),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}},{name:"sticky",defaultValue:!1,fn:function(t){var e=t.reference,n=t.popper;function r(e){return!0===t.props.sticky||t.props.sticky===e}var o=null,i=null;return{onMount:function(){t.props.sticky&&function a(){var s=r("reference")?(t.popperInstance?t.popperInstance.state.elements.reference:e).getBoundingClientRect():null,p=r("popper")?n.getBoundingClientRect():null;(s&&J(o,s)||p&&J(i,p))&&t.popperInstance&&t.popperInstance.update(),o=s,i=p,t.state.isMounted&&requestAnimationFrame(a)}()}}}}],render:N}),X.createSingleton=function(t,e){void 0===e&&(e={});var n,r,o=t,i=[],a=[],s=e.overrides,p=[],u=!1;function c(){a=o.map(function(t){return d(t.props.triggerTarget||t.reference)}).reduce(function(t,e){return t.concat(e)},[])}function f(){i=o.map(function(t){return t.reference})}function v(t){o.forEach(function(e){t?e.enable():e.disable()})}function m(t){return o.map(function(e){var n=e.setProps;return e.setProps=function(o){n(o),e.reference===r&&t.setProps(o)},function(){e.setProps=n}})}function g(t,e){var n=a.indexOf(e);if(e!==r){r=e;var p=(s||[]).concat("content").reduce(function(t,e){return t[e]=o[n].props[e],t},{});t.setProps(Object.assign({},p,{getReferenceClientRect:"function"==typeof p.getReferenceClientRect?p.getReferenceClientRect:function(){var t;return null==(t=i[n])?void 0:t.getBoundingClientRect()}}))}}v(!1),f(),c();var h=X(y(),Object.assign({},l(e,["overrides"]),{plugins:[{fn:function(){return{onDestroy:function(){v(!0)},onHidden:function(){r=null},onClickOutside:function(t){t.props.showOnCreate&&!u&&(u=!0,r=null)},onShow:function(t){t.props.showOnCreate&&!u&&(u=!0,g(t,i[0]))},onTrigger:function(t,e){g(t,e.currentTarget)}}}}].concat(e.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],[Y])})})),b=h.show;h.show=function(t){if(b(),!r&&null==t)return g(h,i[0]);if(!r||null!=t)return"number"==typeof t?i[t]&&g(h,i[t]):o.indexOf(t)>=0?g(h,t.reference):i.indexOf(t)>=0?g(h,t):void 0},h.showNext=function(){var t=i[0];if(!r)return h.show(0);var e=i.indexOf(r);h.show(i[e+1]||t)},h.showPrevious=function(){var t=i[i.length-1];if(!r)return h.show(t);var e=i[i.indexOf(r)-1]||t;h.show(e)};var $=h.setProps;return h.setProps=function(t){s=t.overrides||s,$(t)},h.setInstances=function(t){v(!0),p.forEach(function(t){return t()}),o=t,v(!1),f(),c(),p=m(h),h.setProps({triggerTarget:a})},p=m(h),h},X.delegate=function(t,e){var n=[],r=[],o=!1,i=e.target,s=l(e,["target"]),p=Object.assign({},s,{trigger:"manual",touch:!1}),u=Object.assign({touch:R.touch},s,{showOnCreate:!0}),c=X(t,p);function f(t){if(t.target&&!o){var n=t.target.closest(i);if(n){var a=n.getAttribute("data-tippy-trigger")||e.trigger||R.trigger;if(!n._tippy&&!("touchstart"===t.type&&"boolean"==typeof u.touch||"touchstart"!==t.type&&0>a.indexOf(q[t.type]))){var s=X(n,u);s&&(r=r.concat(s))}}}}function v(t,e,r,o){void 0===o&&(o=!1),t.addEventListener(e,r,o),n.push({node:t,eventType:e,handler:r,options:o})}return d(c).forEach(function(t){var e,i=t.destroy,s=t.enable,p=t.disable;t.destroy=function(t){void 0===t&&(t=!0),t&&r.forEach(function(t){t.destroy()}),r=[],n.forEach(function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)}),n=[],i()},t.enable=function(){s(),r.forEach(function(t){return t.enable()}),o=!1},t.disable=function(){p(),r.forEach(function(t){return t.disable()}),o=!0},v(e=t.reference,"touchstart",f,a),v(e,"mouseover",f),v(e,"focusin",f),v(e,"click",f)}),c},X.hideAll=function(t){var e=void 0===t?{}:t,n=e.exclude,r=e.duration;W.forEach(function(t){var e=!1;if(n&&(e=w(n)?t.reference===n:t.popper===n.popper),!e){var o=t.props.duration;t.setProps({duration:r}),t.hide(),t.state.isDestroyed||t.setProps({duration:o})}})},X.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',X});