(function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Popper=t()})(this,function(){"use strict";function ut(n){return n&&"[object Function]"==={}.toString.call(n)}function e(n,t){if(1!==n.nodeType)return[];var i=window.getComputedStyle(n,null);return t?i[t]:i}function y(n){return"HTML"===n.nodeName?n:n.parentNode||n.host}function o(n){if(!n||-1!==["HTML","BODY","#document"].indexOf(n.nodeName))return window.document.body;var t=e(n),i=t.overflow,r=t.overflowX,u=t.overflowY;return/(auto|scroll)/.test(i+u+r)?n:o(y(n))}function r(n){var t=n&&n.offsetParent,i=t&&t.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===e(t,"position")?r(t):t:window.document.documentElement}function ri(n){var t=n.nodeName;return"BODY"!==t&&("HTML"===t||r(n.firstElementChild)===n)}function p(n){return null===n.parentNode?n:p(n.parentNode)}function h(n,t){var i,f;if(!n||!n.nodeType||!t||!t.nodeType)return window.document.documentElement;var e=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=e?n:t,s=e?t:n,u=document.createRange();return(u.setStart(o,0),u.setEnd(s,0),i=u.commonAncestorContainer,n!==i&&t!==i||o.contains(s))?ri(i)?i:r(i):(f=p(n),f.host?h(f.host,t):h(n,p(t).host))}function u(n){var f=1=r.clientWidth&&i>=r.clientHeight}),a=0e[n]&&!u.escapeWithReference&&(i=dt(f[t],e[n]-("right"===n?f.width:f.height))),a({},t,i)}};return s.forEach(function(t){var i=-1===["left","top"].indexOf(t)?"secondary":"primary";f=n({},f,h[i](t))}),t.offsets.popper=f,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(n){var s=n.offsets,u=s.popper,i=s.reference,h=n.placement.split("-")[0],r=f,e=-1!==["top","bottom"].indexOf(h),o=e?"right":"bottom",t=e?"left":"top",c=e?"width":"height";return u[o]r(i[o])&&(n.offsets.popper[t]=r(i[o])),n}},arrow:{order:500,enabled:!0,fn:function(n,r){var f,y,l;if(!bt(n.instance.modifiers,"arrow","keepTogether"))return n;if(f=r.element,"string"==typeof f){if(f=n.instance.popper.querySelector(f),!f)return n}else if(!n.instance.popper.contains(f))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),n;var p=n.placement.split("-")[0],v=n.offsets,s=v.popper,e=v.reference,h=-1!==["left","right"].indexOf(p),a=h?"height":"width",u=h?"top":"left",w=h?"left":"top",c=h?"bottom":"right",o=lt(f)[a];return e[c]-os[c]&&(n.offsets.popper[u]+=e[u]+o-s[c]),y=e[u]+e[a]/2-o/2,l=y-t(n.offsets.popper)[u],l=i(dt(s[a]-o,l),0),n.arrowElement=f,n.offsets.arrow={},n.offsets.arrow[u]=Math.round(l),n.offsets.arrow[w]="",n},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,i){if(yt(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var o=k(t.instance.popper,t.instance.reference,i.padding,i.boundariesElement),r=t.placement.split("-")[0],s=c(r),u=t.placement.split("-")[1]||"",e=[];switch(i.behavior){case rt.FLIP:e=[r,s];break;case rt.CLOCKWISE:e=kt(r);break;case rt.COUNTERCLOCKWISE:e=kt(r,!0);break;default:e=i.behavior}return e.forEach(function(h,l){if(r!==h||e.length===l+1)return t;r=t.placement.split("-")[0];s=c(r);var v=t.offsets.popper,y=t.offsets.reference,a=f,w="left"===r&&a(v.right)>a(y.left)||"right"===r&&a(v.left)a(y.top)||"bottom"===r&&a(v.top)a(o.right),d=a(v.top)a(o.bottom),nt="left"===r&&b||"right"===r&&k||"top"===r&&d||"bottom"===r&&g,p=-1!==["top","bottom"].indexOf(r),tt=!!i.flipVariations&&(p&&"start"===u&&b||p&&"end"===u&&k||!p&&"start"===u&&d||!p&&"end"===u&&g);(w||nt||tt)&&(t.flipped=!0,(w||nt)&&(r=e[l+1]),tt&&(u=pi(u)),t.placement=r+(u?"-"+u:""),t.offsets.popper=n({},t.offsets.popper,at(t.instance.popper,t.offsets.reference,t.placement)),t=vt(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(n){var i=n.placement,u=i.split("-")[0],f=n.offsets,r=f.popper,o=f.reference,e=-1!==["left","right"].indexOf(u),s=-1===["top","left"].indexOf(u);return r[e?"left":"top"]=o[i]-(s?r[e?"width":"height"]:0),n.placement=c(i),n.offsets.popper=t(r),n}},hide:{order:800,enabled:!0,fn:function(n){if(!bt(n.instance.modifiers,"hide","preventOverflow"))return n;var t=n.offsets.reference,i=s(n.instance.modifiers,function(n){return"preventOverflow"===n.name}).boundaries;if(t.bottomi.right||t.top>i.bottom||t.right