!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Popper=b()}(this,function(){"use strict";function a(a,b,c){var d=a.find(function(a){return a[b]===c});return a.indexOf(d)}function b(a){var b=a.offsetParent;return b!==window.document.body&&b?b:window.document.documentElement}function c(a,b){var c=window.getComputedStyle(a,null);return c[b]}function d(a){return a===window.document?window.document.body.scrollTop?window.document.body:window.document.documentElement:["scroll","auto"].indexOf(c(a,"overflow"))!==-1||["scroll","auto"].indexOf(c(a,"overflow-x"))!==-1||["scroll","auto"].indexOf(c(a,"overflow-y"))!==-1?a===window.document.body?d(a.parentNode):a:a.parentNode?d(a.parentNode):a}function e(a){var b={width:a.offsetWidth,height:a.offsetHeight,left:a.offsetLeft,top:a.offsetTop};return b.right=b.left+b.width,b.bottom=b.top+b.height,b}function f(a,c,f,g){var h={};if("window"===g){var i=window.document.body,j=window.document.documentElement,k=Math.max(i.scrollHeight,i.offsetHeight,j.clientHeight,j.scrollHeight,j.offsetHeight),l=Math.max(i.scrollWidth,i.offsetWidth,j.clientWidth,j.scrollWidth,j.offsetWidth);h={top:0,right:l,bottom:k,left:0}}else if("viewport"===g){var m=b(a),n=d(a),o=e(m),p="fixed"===c.offsets.popper.position?0:n.scrollTop,q="fixed"===c.offsets.popper.position?0:n.scrollLeft;h={top:0-(o.top-p),right:window.document.documentElement.clientWidth-(o.left-q),bottom:window.document.documentElement.clientHeight-(o.top-p),left:0-(o.left-q)}}else h=b(a)===g?{top:0,left:0,right:g.clientWidth,bottom:g.clientHeight}:e(g);return h.left+=f,h.right-=f,h.top=h.top+f,h.bottom=h.bottom-f,h}function g(a){var b=a.getBoundingClientRect();return{left:b.left,top:b.top,right:b.right,bottom:b.bottom,width:b.right-b.left,height:b.bottom-b.top}}function h(a,b,c,e){var f=g(a),h=g(b);if(c&&!e){var i=d(b);h.top+=i.scrollTop,h.bottom+=i.scrollTop,h.left+=i.scrollLeft,h.right+=i.scrollLeft}var j={top:f.top-h.top,left:f.left-h.left,bottom:f.top-h.top+f.height,right:f.left-h.left+f.width,width:f.width,height:f.height};return j}function i(a){var b=a.style.display,c=a.style.visibility;a.style.display="block",a.style.visibility="hidden";var d=(a.offsetWidth,window.getComputedStyle(a)),e=parseFloat(d.marginTop)+parseFloat(d.marginBottom),f=parseFloat(d.marginLeft)+parseFloat(d.marginRight),g={width:a.offsetWidth+f,height:a.offsetHeight+e};return a.style.display=b,a.style.visibility=c,g}function j(a){return Object.assign({},a,{right:a.left+a.width,bottom:a.top+a.height})}function k(a){return a!==window.document.body&&("fixed"===c(a,"position")||(a.parentNode?k(a.parentNode):a))}function l(a,c){var d=b(c),e=k(c,d);return e?"fixed":"absolute"}function m(a){for(var b=["","ms","webkit","moz","o"],c=0;cb.order?1:0}function x(a){var b={position:a.offsets.popper.position},c=Math.round(a.offsets.popper.left),d=Math.round(a.offsets.popper.top),e=m("transform");return a.instance.options.gpuAcceleration&&e?(b[e]="translate3d("+c+"px, "+d+"px, 0)",b.top=0,b.left=0):(b.left=c,b.top=d),Object.assign(b,a.styles),s(a.instance.popper,b),a.instance.popper.setAttribute("x-placement",a.placement),o(a.instance.modifiers,"applyStyle","arrow")&&a.offsets.arrow&&s(a.arrowElement,a.offsets.arrow),a}function y(a,b,c){b.setAttribute("x-placement",c.placement)}function z(a,b){var c=b.element;if("string"==typeof c&&(c=a.instance.popper.querySelector(c)),!c)return a;if(!a.instance.popper.contains(c))return console.warn("WARNING: `arrowElement` must be child of its popper element!"),a;if(!o(a.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!"),a;var d={},e=a.placement.split("-")[0],f=j(a.offsets.popper),g=a.offsets.reference,h=["left","right"].indexOf(e)!==-1,k=h?"height":"width",l=h?"top":"left",m=h?"left":"top",n=h?"bottom":"right",p=i(c)[k];g[n]-pf[n]&&(a.offsets.popper[l]+=g[l]+p-f[n]);var q=g[l]+g[k]/2-p/2,r=q-j(a.offsets.popper)[l];return r=Math.max(Math.min(f[k]-p,r),0),d[l]=r,d[m]="",a.offsets.arrow=d,a.arrowElement=c,a}function A(a){var b={left:"right",right:"left",bottom:"top",top:"bottom"};return a.replace(/left|right|bottom|top/g,function(a){return b[a]})}function B(a,b){if(!o(a.instance.modifiers,"flip","preventOverflow"))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),a;if(a.flipped&&a.placement===a.originalPlacement)return a;var c=a.placement.split("-")[0],d=A(c),e=a.placement.split("-")[1]||"",f=[];return f="flip"===b.behavior?[c,d]:b.behavior,f.forEach(function(b,g){if(c!==b||f.length===g+1)return a;c=a.placement.split("-")[0],d=A(c);var h=j(a.offsets.popper),i=["right","bottom"].indexOf(c)!==-1;(i&&Math.floor(a.offsets.reference[c])>Math.floor(h[d])||!i&&Math.floor(a.offsets.reference[c])d(c.right)&&(a.offsets.popper.left=d(c.right)),b.bottomd(c.bottom)&&(a.offsets.popper.top=d(c.bottom)),a}function D(a,b){var c=b.offset,d=a.offsets.popper;return a.placement.indexOf("left")!==-1?d.top-=c:a.placement.indexOf("right")!==-1?d.top+=c:a.placement.indexOf("top")!==-1?d.left-=c:a.placement.indexOf("bottom")!==-1&&(d.left+=c),a}function E(a,b){var c=b.priority,d=j(a.offsets.popper),e={left:function(){var b=d.left;return d.lefta.boundaries.right&&(b=Math.min(d.left,a.boundaries.right-d.width)),{left:b}},top:function(){var b=d.top;return d.topa.boundaries.bottom&&(b=Math.min(d.top,a.boundaries.bottom-d.height)),{top:b}}};return c.forEach(function(b){a.offsets.popper=Object.assign(d,e[b]())}),a}function F(a){var b=a.placement,c=b.split("-")[0],d=b.split("-")[1];if(d){var e=a.offsets.reference,f=j(a.offsets.popper),g={y:{start:{top:e.top},end:{top:e.top+e.height-f.height}},x:{start:{left:e.left},end:{left:e.left+e.width-f.width}}},h=["bottom","top"].indexOf(c)!==-1?"x":"y";a.offsets.popper=Object.assign(f,g[h][d])}return a}if(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(void 0===a||null===a)throw new TypeError("Cannot convert first argument to object");for(var b=Object(a),c=1;c