(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<arguments.length&&void 0!==arguments[1]?arguments[1]:"top",t="top"===f?"scrollTop":"scrollLeft",i=n.nodeName,r,u;return"BODY"===i||"HTML"===i?(r=window.document.documentElement,u=window.document.scrollingElement||r,u[t]):n[t]}function ui(n,t){var e=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=u(t,"top"),f=u(t,"left"),i=e?-1:1;return n.top+=r*i,n.bottom+=r*i,n.left+=f*i,n.right+=f*i,n}function ft(n,t){var i="x"===t?"Left":"Top",r="Left"==i?"Right":"Bottom";return+n["border"+i+"Width"].split("px")[0]+ +n["border"+r+"Width"].split("px")[0]}function et(n,t,r,u){return i(t["offset"+n],r["client"+n],r["offset"+n],l()?r["offset"+n]+u["margin"+("Height"===n?"Top":"Left")]+u["margin"+("Height"===n?"Bottom":"Right")]:0)}function ot(){var t=window.document.body,n=window.document.documentElement,i=l()&&window.getComputedStyle(n);return{height:et("Height",t,n,i),width:et("Width",t,n,i)}}function t(t){return n({},t,{right:t.left+t.width,bottom:t.top+t.height})}function w(n){var i={},f,o,c;if(l())try{i=n.getBoundingClientRect();f=u(n,"top");o=u(n,"left");i.top+=f;i.left+=o;i.bottom+=f;i.right+=o}catch(n){}else i=n.getBoundingClientRect();var r={left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top},a="HTML"===n.nodeName?ot():{},v=a.width||n.clientWidth||r.right-r.left,y=a.height||n.clientHeight||r.bottom-r.top,s=n.offsetWidth-v,h=n.offsetHeight-y;return(s||h)&&(c=e(n),s-=ft(c,"x"),h-=ft(c,"y"),r.width-=s,r.height-=h),t(r)}function b(n,i){var y=l(),b="HTML"===i.nodeName,u=w(n),p=w(i),c=o(n),f=e(i),a=+f.borderTopWidth.split("px")[0],v=+f.borderLeftWidth.split("px")[0],r=t({top:u.top-p.top-a,left:u.left-p.left-v,width:u.width,height:u.height}),s,h;return(r.marginTop=0,r.marginLeft=0,!y&&b)&&(s=+f.marginTop.split("px")[0],h=+f.marginLeft.split("px")[0],r.top-=a-s,r.bottom-=a-s,r.left-=v-h,r.right-=v-h,r.marginTop=s,r.marginLeft=h),(y?i.contains(c):i===c&&"BODY"!==c.nodeName)&&(r=ui(r,i)),r}function fi(n){var r=window.document.documentElement,f=b(n,r),e=i(r.clientWidth,window.innerWidth||0),o=i(r.clientHeight,window.innerHeight||0),s=u(r),h=u(r,"left"),c={top:s-f.top+f.marginTop,left:h-f.left+f.marginLeft,width:e,height:o};return t(c)}function st(n){var t=n.nodeName;return"BODY"===t||"HTML"===t?!1:"fixed"===e(n,"position")||st(y(n))}function k(n,t,i,r){var u={top:0,left:0},s=h(n,t),e,f;if("viewport"===r)u=fi(s);else if("scrollParent"===r?(e=o(y(n)),"BODY"===e.nodeName&&(e=window.document.documentElement)):e="window"===r?window.document.documentElement:r,f=b(e,s),"HTML"!==e.nodeName||st(s))u=f;else{var c=ot(),l=c.height,a=c.width;u.top+=f.top-f.marginTop;u.bottom=l+f.top;u.left+=f.left-f.marginLeft;u.right=a+f.left}return u.left+=i,u.top+=i,u.right-=i,u.bottom-=i,u}function ei(n){var t=n.width,i=n.height;return t*i}function ht(t,i,r,u,f){var l=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var e=k(r,u,l,f),o={top:{width:e.width,height:i.top-e.top},right:{width:e.right-i.right,height:e.height},bottom:{width:e.width,height:e.bottom-i.bottom},left:{width:i.left-e.left,height:e.height}},s=Object.keys(o).map(function(t){return n({key:t},o[t],{area:ei(o[t])})}).sort(function(n,t){return t.area-n.area}),h=s.filter(function(n){var t=n.width,i=n.height;return t>=r.clientWidth&&i>=r.clientHeight}),a=0<h.length?h[0].key:s[0].key,c=t.split("-")[1];return a+(c?"-"+c:"")}function ct(n,t,i){var r=h(t,i);return b(i,r)}function lt(n){var t=window.getComputedStyle(n),i=parseFloat(t.marginTop)+parseFloat(t.marginBottom),r=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:n.offsetWidth+r,height:n.offsetHeight+i}}function c(n){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return n.replace(/left|right|bottom|top/g,function(n){return t[n]})}function at(n,t,i){i=i.split("-")[0];var r=lt(n),e={width:r.width,height:r.height},u=-1!==["right","left"].indexOf(i),o=u?"top":"left",f=u?"left":"top",s=u?"height":"width",h=u?"width":"height";return e[o]=t[o]+t[s]/2-r[s]/2,e[f]=i===f?t[f]-r[h]:t[c(f)],e}function s(n,t){return Array.prototype.find?n.find(t):n.filter(t)[0]}function oi(n,t,i){if(Array.prototype.findIndex)return n.findIndex(function(n){return n[t]===i});var r=s(n,function(n){return n[t]===i});return n.indexOf(r)}function vt(n,i,r){var u=void 0===r?n:n.slice(0,oi(n,"name",r));return u.forEach(function(n){n.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var r=n.function||n.fn;n.enabled&&ut(r)&&(i.offsets.popper=t(i.offsets.popper),i.offsets.reference=t(i.offsets.reference),i=r(i,n))}),i}function si(){if(!this.state.isDestroyed){var n={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};n.offsets.reference=ct(this.state,this.popper,this.reference);n.placement=ht(this.options.placement,n.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);n.originalPlacement=n.placement;n.offsets.popper=at(this.popper,n.offsets.reference,n.placement);n.offsets.popper.position="absolute";n=vt(this.modifiers,n);this.state.isCreated?this.options.onUpdate(n):(this.state.isCreated=!0,this.options.onCreate(n))}}function yt(n,t){return n.some(function(n){var i=n.name,r=n.enabled;return r&&i===t})}function pt(n){for(var i,r,u=[!1,"ms","Webkit","Moz","O"],f=n.charAt(0).toUpperCase()+n.slice(1),t=0;t<u.length-1;t++)if(i=u[t],r=i?""+i+f:n,"undefined"!=typeof window.document.body.style[r])return r;return null}function hi(){return this.state.isDestroyed=!0,yt(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[pt("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function wt(n,t,i,r){var f="BODY"===n.nodeName,u=f?window:n;u.addEventListener(t,i,{passive:!0});f||wt(o(u.parentNode),t,i,r);r.push(u)}function ci(n,t,i,r){i.updateBound=r;window.addEventListener("resize",i.updateBound,{passive:!0});var u=o(n);return wt(u,"scroll",i.updateBound,i.scrollParents),i.scrollElement=u,i.eventsEnabled=!0,i}function li(){this.state.eventsEnabled||(this.state=ci(this.reference,this.options,this.state,this.scheduleUpdate))}function ai(n,t){return window.removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(n){n.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function vi(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=ai(this.reference,this.state))}function d(n){return""!==n&&!isNaN(parseFloat(n))&&isFinite(n)}function g(n,t){Object.keys(t).forEach(function(i){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(i)&&d(t[i])&&(r="px");n.style[i]=t[i]+r})}function yi(n,t){Object.keys(t).forEach(function(i){var r=t[i];!1===r?n.removeAttribute(i):n.setAttribute(i,t[i])})}function bt(n,t,i){var u=s(n,function(n){var i=n.name;return i===t}),f=!!u&&n.some(function(n){return n.name===i&&n.enabled&&n.order<u.order}),r;return f||(r="`"+t+"`",console.warn("`"+i+"` modifier is required by "+r+" modifier in order to work, be sure to include it before "+r+"!")),f}function pi(n){return"end"===n?"start":"start"===n?"end":n}function kt(n){var r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],t=it.indexOf(n),i=it.slice(t+1).concat(it.slice(0,t));return r?i.reverse():i}function wi(n,r,u,f){var h=n.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+h[1],e=h[2],s,c,l;if(!o)return n;if(0===e.indexOf("%")){switch(e){case"%p":s=u;break;case"%":case"%r":default:s=f}return c=t(s),c[r]/100*o}return"vh"===e||"vw"===e?(l="vh"===e?i(document.documentElement.clientHeight,window.innerHeight||0):i(document.documentElement.clientWidth,window.innerWidth||0),l/100*o):o}function bi(n,t,i,r){var h=[0,0],c=-1!==["right","left"].indexOf(r),u=n.split(/(\+|\-)/).map(function(n){return n.trim()}),f=u.indexOf(s(u,function(n){return-1!==n.search(/,|\s/)})),o,e;return u[f]&&-1===u[f].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead."),o=/\s*,\s*|\s+/,e=-1===f?[u]:[u.slice(0,f).concat([u[f].split(o)[0]]),[u[f].split(o)[1]].concat(u.slice(f+1))],e=e.map(function(n,r){var f=(1===r?!c:c)?"height":"width",u=!1;return n.reduce(function(n,t){return""===n[n.length-1]&&-1!==["+","-"].indexOf(t)?(n[n.length-1]=t,u=!0,n):u?(n[n.length-1]+=t,u=!1,n):n.concat(t)},[]).map(function(n){return wi(n,f,t,i)})}),e.forEach(function(n,t){n.forEach(function(i,r){d(i)&&(h[t]+=i*("-"===n[r-1]?-1:1))})}),h}for(var dt=Math.min,f=Math.floor,i=Math.max,ki=["native code","[object MutationObserverConstructor]"],di=function(n){return ki.some(function(t){return-1<(n||"").toString().indexOf(t)})},gt="undefined"!=typeof window,ni=["Edge","Trident","Firefox"],ti=0,nt=0;nt<ni.length;nt+=1)if(gt&&0<=navigator.userAgent.indexOf(ni[nt])){ti=1;break}var tt,gi=gt&&di(window.MutationObserver),nr=gi?function(n){var t=!1,i=0,r=document.createElement("span"),u=new MutationObserver(function(){n();t=!1});return u.observe(r,{attributes:!0}),function(){t||(t=!0,r.setAttribute("x-index",i),++i)}}:function(n){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1;n()},ti))}},l=function(){return void 0==tt&&(tt=-1!==navigator.appVersion.indexOf("MSIE 10")),tt},tr=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");},ir=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),a=function(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n},n=Object.assign||function(n){for(var t,r,i=1;i<arguments.length;i++)for(r in t=arguments[i],t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},ii=["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"],it=ii.slice(3),rt={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},v=function(){function t(i,r){var u=this,f=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},e;tr(this,t);this.scheduleUpdate=function(){return requestAnimationFrame(u.update)};this.update=nr(this.update.bind(this));this.options=n({},t.Defaults,f);this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]};this.reference=i.jquery?i[0]:i;this.popper=r.jquery?r[0]:r;this.options.modifiers={};Object.keys(n({},t.Defaults.modifiers,f.modifiers)).forEach(function(i){u.options.modifiers[i]=n({},t.Defaults.modifiers[i]||{},f.modifiers?f.modifiers[i]:{})});this.modifiers=Object.keys(this.options.modifiers).map(function(t){return n({name:t},u.options.modifiers[t])}).sort(function(n,t){return n.order-t.order});this.modifiers.forEach(function(n){n.enabled&&ut(n.onLoad)&&n.onLoad(u.reference,u.popper,u.options,n,u.state)});this.update();e=this.options.eventsEnabled;e&&this.enableEventListeners();this.state.eventsEnabled=e}return ir(t,[{key:"update",value:function(){return si.call(this)}},{key:"destroy",value:function(){return hi.call(this)}},{key:"enableEventListeners",value:function(){return li.call(this)}},{key:"disableEventListeners",value:function(){return vi.call(this)}}]),t}();return v.Utils=("undefined"==typeof window?global:window).PopperUtils,v.placements=ii,v.Defaults={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var u=t.placement,c=u.split("-")[0],f=u.split("-")[1];if(f){var e=t.offsets,r=e.reference,o=e.popper,s=-1!==["bottom","top"].indexOf(c),i=s?"left":"top",h=s?"width":"height",l={start:a({},i,r[i]),end:a({},i,r[i]+r[h]-o[h])};t.offsets.popper=n({},o,l[f])}return t}},offset:{order:200,enabled:!0,fn:function(n,t){var r,f=t.offset,o=n.placement,e=n.offsets,i=e.popper,s=e.reference,u=o.split("-")[0];return r=d(+f)?[+f,0]:bi(f,i,s,u),"left"===u?(i.top+=r[0],i.left-=r[1]):"right"===u?(i.top+=r[0],i.left+=r[1]):"top"===u?(i.left+=r[0],i.top-=r[1]):"bottom"===u&&(i.left+=r[0],i.top+=r[1]),n.popper=i,n},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,u){var o=u.boundariesElement||r(t.instance.popper),e;t.instance.reference===o&&(o=r(o));e=k(t.instance.popper,t.instance.reference,u.padding,o);u.boundaries=e;var s=u.priority,f=t.offsets.popper,h={primary:function(n){var t=f[n];return f[n]<e[n]&&!u.escapeWithReference&&(t=i(f[n],e[n])),a({},n,t)},secondary:function(n){var t="right"===n?"left":"top",i=f[t];return f[n]>e[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[t])&&(n.offsets.popper[t]=r(i[t])-u[c]),u[t]>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]-o<s[u]&&(n.offsets.popper[u]-=s[u]-(e[c]-o)),e[u]+o>s[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.right)||"top"===r&&a(v.bottom)>a(y.top)||"bottom"===r&&a(v.top)<a(y.bottom),b=a(v.left)<a(o.left),k=a(v.right)>a(o.right),d=a(v.top)<a(o.top),g=a(v.bottom)>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.bottom<i.top||t.left>i.right||t.top>i.bottom||t.right<i.left){if(!0===n.hide)return n;n.hide=!0;n.attributes["x-out-of-boundaries"]=""}else{if(!1===n.hide)return n;n.hide=!1;n.attributes["x-out-of-boundaries"]=!1}return n}},computeStyle:{order:850,enabled:!0,fn:function(t,i){var g=i.x,nt=i.y,e=t.offsets.popper,l=s(t.instance.modifiers,function(n){return"applyStyle"===n.name}).gpuAcceleration,b,k,d;void 0!==l&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a,v,tt=void 0===l?i.gpuAcceleration:l,it=r(t.instance.popper),y=w(it),u={position:e.position},c={left:f(e.left),top:f(e.top),bottom:f(e.bottom),right:f(e.right)},o="bottom"===g?"top":"bottom",h="right"===nt?"left":"right",p=pt("transform");return(v="bottom"==o?-y.height+c.bottom:c.top,a="right"==h?-y.width+c.right:c.left,tt&&p)?(u[p]="translate3d("+a+"px, "+v+"px, 0)",u[o]=0,u[h]=0,u.willChange="transform"):(b="bottom"==o?-1:1,k="right"==h?-1:1,u[o]=v*b,u[h]=a*k,u.willChange=o+", "+h),d={"x-placement":t.placement},t.attributes=n({},d,t.attributes),t.styles=n({},u,t.styles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(n){return g(n.instance.popper,n.styles),yi(n.instance.popper,n.attributes),n.offsets.arrow&&g(n.arrowElement,n.offsets.arrow),n},onLoad:function(n,t,i,r,u){var f=ct(u,t,n),e=ht(i.placement,f,t,n,i.modifiers.flip.boundariesElement,i.modifiers.flip.padding);return t.setAttribute("x-placement",e),g(t,{position:"absolute"}),i},gpuAcceleration:void 0}}},v})