popper.min.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. /*
  2. Copyright (C) Federico Zivolo 2017
  3. Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
  4. */
  5. (function(e, t) {
  6. 'object' == typeof exports && 'undefined' != typeof module ? module.exports = t() : 'function' == typeof define && define.amd ? define(t) : e.Popper = t()
  7. })(this, function() {
  8. 'use strict';
  9. function e(e) {
  10. return e && '[object Function]' === {}.toString.call(e)
  11. }
  12. function t(e, t) {
  13. if (1 !== e.nodeType) return [];
  14. var o = window.getComputedStyle(e, null);
  15. return t ? o[t] : o
  16. }
  17. function o(e) {
  18. return 'HTML' === e.nodeName ? e : e.parentNode || e.host
  19. }
  20. function n(e) {
  21. if (!e || -1 !== ['HTML', 'BODY', '#document'].indexOf(e.nodeName)) return window.document.body;
  22. var i = t(e),
  23. r = i.overflow,
  24. p = i.overflowX,
  25. s = i.overflowY;
  26. return /(auto|scroll)/.test(r + s + p) ? e : n(o(e))
  27. }
  28. function r(e) {
  29. var o = e && e.offsetParent,
  30. i = o && o.nodeName;
  31. return i && 'BODY' !== i && 'HTML' !== i ? -1 !== ['TD', 'TABLE'].indexOf(o.nodeName) && 'static' === t(o, 'position') ? r(o) : o : window.document.documentElement
  32. }
  33. function p(e) {
  34. var t = e.nodeName;
  35. return 'BODY' !== t && ('HTML' === t || r(e.firstElementChild) === e)
  36. }
  37. function s(e) {
  38. return null === e.parentNode ? e : s(e.parentNode)
  39. }
  40. function d(e, t) {
  41. if (!e || !e.nodeType || !t || !t.nodeType) return window.document.documentElement;
  42. var o = e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING,
  43. i = o ? e : t,
  44. n = o ? t : e,
  45. a = document.createRange();
  46. a.setStart(i, 0), a.setEnd(n, 0);
  47. var f = a.commonAncestorContainer;
  48. if (e !== f && t !== f || i.contains(n)) return p(f) ? f : r(f);
  49. var l = s(e);
  50. return l.host ? d(l.host, t) : d(e, s(t).host)
  51. }
  52. function a(e) {
  53. var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 'top',
  54. o = 'top' === t ? 'scrollTop' : 'scrollLeft',
  55. i = e.nodeName;
  56. if ('BODY' === i || 'HTML' === i) {
  57. var n = window.document.documentElement,
  58. r = window.document.scrollingElement || n;
  59. return r[o]
  60. }
  61. return e[o]
  62. }
  63. function f(e, t) {
  64. var o = 2 < arguments.length && void 0 !== arguments[2] && arguments[2],
  65. i = a(t, 'top'),
  66. n = a(t, 'left'),
  67. r = o ? -1 : 1;
  68. return e.top += i * r, e.bottom += i * r, e.left += n * r, e.right += n * r, e
  69. }
  70. function l(e, t) {
  71. var o = 'x' === t ? 'Left' : 'Top',
  72. i = 'Left' == o ? 'Right' : 'Bottom';
  73. return +e['border' + o + 'Width'].split('px')[0] + +e['border' + i + 'Width'].split('px')[0]
  74. }
  75. function m(e, t, o, i) {
  76. return _(t['offset' + e], o['client' + e], o['offset' + e], ie() ? o['offset' + e] + i['margin' + ('Height' === e ? 'Top' : 'Left')] + i['margin' + ('Height' === e ? 'Bottom' : 'Right')] : 0)
  77. }
  78. function h() {
  79. var e = window.document.body,
  80. t = window.document.documentElement,
  81. o = ie() && window.getComputedStyle(t);
  82. return {
  83. height: m('Height', e, t, o),
  84. width: m('Width', e, t, o)
  85. }
  86. }
  87. function c(e) {
  88. return se({}, e, {
  89. right: e.left + e.width,
  90. bottom: e.top + e.height
  91. })
  92. }
  93. function g(e) {
  94. var o = {};
  95. if (ie()) try {
  96. o = e.getBoundingClientRect();
  97. var i = a(e, 'top'),
  98. n = a(e, 'left');
  99. o.top += i, o.left += n, o.bottom += i, o.right += n
  100. } catch (e) {} else o = e.getBoundingClientRect();
  101. var r = {
  102. left: o.left,
  103. top: o.top,
  104. width: o.right - o.left,
  105. height: o.bottom - o.top
  106. },
  107. p = 'HTML' === e.nodeName ? h() : {},
  108. s = p.width || e.clientWidth || r.right - r.left,
  109. d = p.height || e.clientHeight || r.bottom - r.top,
  110. f = e.offsetWidth - s,
  111. m = e.offsetHeight - d;
  112. if (f || m) {
  113. var g = t(e);
  114. f -= l(g, 'x'), m -= l(g, 'y'), r.width -= f, r.height -= m
  115. }
  116. return c(r)
  117. }
  118. function u(e, o) {
  119. var i = ie(),
  120. r = 'HTML' === o.nodeName,
  121. p = g(e),
  122. s = g(o),
  123. d = n(e),
  124. a = t(o),
  125. l = +a.borderTopWidth.split('px')[0],
  126. m = +a.borderLeftWidth.split('px')[0],
  127. h = c({
  128. top: p.top - s.top - l,
  129. left: p.left - s.left - m,
  130. width: p.width,
  131. height: p.height
  132. });
  133. if (h.marginTop = 0, h.marginLeft = 0, !i && r) {
  134. var u = +a.marginTop.split('px')[0],
  135. b = +a.marginLeft.split('px')[0];
  136. h.top -= l - u, h.bottom -= l - u, h.left -= m - b, h.right -= m - b, h.marginTop = u, h.marginLeft = b
  137. }
  138. return (i ? o.contains(d) : o === d && 'BODY' !== d.nodeName) && (h = f(h, o)), h
  139. }
  140. function b(e) {
  141. var t = window.document.documentElement,
  142. o = u(e, t),
  143. i = _(t.clientWidth, window.innerWidth || 0),
  144. n = _(t.clientHeight, window.innerHeight || 0),
  145. r = a(t),
  146. p = a(t, 'left'),
  147. s = {
  148. top: r - o.top + o.marginTop,
  149. left: p - o.left + o.marginLeft,
  150. width: i,
  151. height: n
  152. };
  153. return c(s)
  154. }
  155. function y(e) {
  156. var i = e.nodeName;
  157. return 'BODY' === i || 'HTML' === i ? !1 : 'fixed' === t(e, 'position') || y(o(e))
  158. }
  159. function w(e, t, i, r) {
  160. var p = {
  161. top: 0,
  162. left: 0
  163. },
  164. s = d(e, t);
  165. if ('viewport' === r) p = b(s);
  166. else {
  167. var a;
  168. 'scrollParent' === r ? (a = n(o(e)), 'BODY' === a.nodeName && (a = window.document.documentElement)) : 'window' === r ? a = window.document.documentElement : a = r;
  169. var f = u(a, s);
  170. if ('HTML' === a.nodeName && !y(s)) {
  171. var l = h(),
  172. m = l.height,
  173. c = l.width;
  174. p.top += f.top - f.marginTop, p.bottom = m + f.top, p.left += f.left - f.marginLeft, p.right = c + f.left
  175. } else p = f
  176. }
  177. return p.left += i, p.top += i, p.right -= i, p.bottom -= i, p
  178. }
  179. function v(e) {
  180. var t = e.width,
  181. o = e.height;
  182. return t * o
  183. }
  184. function E(e, t, o, i, n) {
  185. var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : 0;
  186. if (-1 === e.indexOf('auto')) return e;
  187. var p = w(o, i, r, n),
  188. s = {
  189. top: {
  190. width: p.width,
  191. height: t.top - p.top
  192. },
  193. right: {
  194. width: p.right - t.right,
  195. height: p.height
  196. },
  197. bottom: {
  198. width: p.width,
  199. height: p.bottom - t.bottom
  200. },
  201. left: {
  202. width: t.left - p.left,
  203. height: p.height
  204. }
  205. },
  206. d = Object.keys(s).map(function(e) {
  207. return se({
  208. key: e
  209. }, s[e], {
  210. area: v(s[e])
  211. })
  212. }).sort(function(e, t) {
  213. return t.area - e.area
  214. }),
  215. a = d.filter(function(e) {
  216. var t = e.width,
  217. i = e.height;
  218. return t >= o.clientWidth && i >= o.clientHeight
  219. }),
  220. f = 0 < a.length ? a[0].key : d[0].key,
  221. l = e.split('-')[1];
  222. return f + (l ? '-' + l : '')
  223. }
  224. function x(e, t, o) {
  225. var i = d(t, o);
  226. return u(o, i)
  227. }
  228. function O(e) {
  229. var t = window.getComputedStyle(e),
  230. o = parseFloat(t.marginTop) + parseFloat(t.marginBottom),
  231. i = parseFloat(t.marginLeft) + parseFloat(t.marginRight),
  232. n = {
  233. width: e.offsetWidth + i,
  234. height: e.offsetHeight + o
  235. };
  236. return n
  237. }
  238. function L(e) {
  239. var t = {
  240. left: 'right',
  241. right: 'left',
  242. bottom: 'top',
  243. top: 'bottom'
  244. };
  245. return e.replace(/left|right|bottom|top/g, function(e) {
  246. return t[e]
  247. })
  248. }
  249. function S(e, t, o) {
  250. o = o.split('-')[0];
  251. var i = O(e),
  252. n = {
  253. width: i.width,
  254. height: i.height
  255. },
  256. r = -1 !== ['right', 'left'].indexOf(o),
  257. p = r ? 'top' : 'left',
  258. s = r ? 'left' : 'top',
  259. d = r ? 'height' : 'width',
  260. a = r ? 'width' : 'height';
  261. return n[p] = t[p] + t[d] / 2 - i[d] / 2, n[s] = o === s ? t[s] - i[a] : t[L(s)], n
  262. }
  263. function T(e, t) {
  264. return Array.prototype.find ? e.find(t) : e.filter(t)[0]
  265. }
  266. function C(e, t, o) {
  267. if (Array.prototype.findIndex) return e.findIndex(function(e) {
  268. return e[t] === o
  269. });
  270. var i = T(e, function(e) {
  271. return e[t] === o
  272. });
  273. return e.indexOf(i)
  274. }
  275. function N(t, o, i) {
  276. var n = void 0 === i ? t : t.slice(0, C(t, 'name', i));
  277. return n.forEach(function(t) {
  278. t.function && console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  279. var i = t.function || t.fn;
  280. t.enabled && e(i) && (o.offsets.popper = c(o.offsets.popper), o.offsets.reference = c(o.offsets.reference), o = i(o, t))
  281. }), o
  282. }
  283. function k() {
  284. if (!this.state.isDestroyed) {
  285. var e = {
  286. instance: this,
  287. styles: {},
  288. attributes: {},
  289. flipped: !1,
  290. offsets: {}
  291. };
  292. e.offsets.reference = x(this.state, this.popper, this.reference), e.placement = E(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 = S(this.popper, e.offsets.reference, e.placement), e.offsets.popper.position = 'absolute', e = N(this.modifiers, e), this.state.isCreated ? this.options.onUpdate(e) : (this.state.isCreated = !0, this.options.onCreate(e))
  293. }
  294. }
  295. function W(e, t) {
  296. return e.some(function(e) {
  297. var o = e.name,
  298. i = e.enabled;
  299. return i && o === t
  300. })
  301. }
  302. function B(e) {
  303. for (var t = [!1, 'ms', 'Webkit', 'Moz', 'O'], o = e.charAt(0).toUpperCase() + e.slice(1), n = 0; n < t.length - 1; n++) {
  304. var i = t[n],
  305. r = i ? '' + i + o : e;
  306. if ('undefined' != typeof window.document.body.style[r]) return r
  307. }
  308. return null
  309. }
  310. function D() {
  311. return this.state.isDestroyed = !0, W(this.modifiers, 'applyStyle') && (this.popper.removeAttribute('x-placement'), this.popper.style.left = '', this.popper.style.position = '', this.popper.style.top = '', this.popper.style[B('transform')] = ''), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this
  312. }
  313. function H(e, t, o, i) {
  314. var r = 'BODY' === e.nodeName,
  315. p = r ? window : e;
  316. p.addEventListener(t, o, {
  317. passive: !0
  318. }), r || H(n(p.parentNode), t, o, i), i.push(p)
  319. }
  320. function P(e, t, o, i) {
  321. o.updateBound = i, window.addEventListener('resize', o.updateBound, {
  322. passive: !0
  323. });
  324. var r = n(e);
  325. return H(r, 'scroll', o.updateBound, o.scrollParents), o.scrollElement = r, o.eventsEnabled = !0, o
  326. }
  327. function A() {
  328. this.state.eventsEnabled || (this.state = P(this.reference, this.options, this.state, this.scheduleUpdate))
  329. }
  330. function M(e, t) {
  331. return window.removeEventListener('resize', t.updateBound), t.scrollParents.forEach(function(e) {
  332. e.removeEventListener('scroll', t.updateBound)
  333. }), t.updateBound = null, t.scrollParents = [], t.scrollElement = null, t.eventsEnabled = !1, t
  334. }
  335. function I() {
  336. this.state.eventsEnabled && (window.cancelAnimationFrame(this.scheduleUpdate), this.state = M(this.reference, this.state))
  337. }
  338. function R(e) {
  339. return '' !== e && !isNaN(parseFloat(e)) && isFinite(e)
  340. }
  341. function U(e, t) {
  342. Object.keys(t).forEach(function(o) {
  343. var i = ''; - 1 !== ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(o) && R(t[o]) && (i = 'px'), e.style[o] = t[o] + i
  344. })
  345. }
  346. function Y(e, t) {
  347. Object.keys(t).forEach(function(o) {
  348. var i = t[o];
  349. !1 === i ? e.removeAttribute(o) : e.setAttribute(o, t[o])
  350. })
  351. }
  352. function F(e, t, o) {
  353. var i = T(e, function(e) {
  354. var o = e.name;
  355. return o === t
  356. }),
  357. n = !!i && e.some(function(e) {
  358. return e.name === o && e.enabled && e.order < i.order
  359. });
  360. if (!n) {
  361. var r = '`' + t + '`';
  362. console.warn('`' + o + '`' + ' modifier is required by ' + r + ' modifier in order to work, be sure to include it before ' + r + '!')
  363. }
  364. return n
  365. }
  366. function j(e) {
  367. return 'end' === e ? 'start' : 'start' === e ? 'end' : e
  368. }
  369. function K(e) {
  370. var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1],
  371. o = ae.indexOf(e),
  372. i = ae.slice(o + 1).concat(ae.slice(0, o));
  373. return t ? i.reverse() : i
  374. }
  375. function q(e, t, o, i) {
  376. var n = e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),
  377. r = +n[1],
  378. p = n[2];
  379. if (!r) return e;
  380. if (0 === p.indexOf('%')) {
  381. var s;
  382. switch (p) {
  383. case '%p':
  384. s = o;
  385. break;
  386. case '%':
  387. case '%r':
  388. default:
  389. s = i;
  390. }
  391. var d = c(s);
  392. return d[t] / 100 * r
  393. }
  394. if ('vh' === p || 'vw' === p) {
  395. var a;
  396. return a = 'vh' === p ? _(document.documentElement.clientHeight, window.innerHeight || 0) : _(document.documentElement.clientWidth, window.innerWidth || 0), a / 100 * r
  397. }
  398. return r
  399. }
  400. function G(e, t, o, i) {
  401. var n = [0, 0],
  402. r = -1 !== ['right', 'left'].indexOf(i),
  403. p = e.split(/(\+|\-)/).map(function(e) {
  404. return e.trim()
  405. }),
  406. s = p.indexOf(T(p, function(e) {
  407. return -1 !== e.search(/,|\s/)
  408. }));
  409. p[s] && -1 === p[s].indexOf(',') && console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  410. var d = /\s*,\s*|\s+/,
  411. a = -1 === s ? [p] : [p.slice(0, s).concat([p[s].split(d)[0]]), [p[s].split(d)[1]].concat(p.slice(s + 1))];
  412. return a = a.map(function(e, i) {
  413. var n = (1 === i ? !r : r) ? 'height' : 'width',
  414. p = !1;
  415. return e.reduce(function(e, t) {
  416. return '' === e[e.length - 1] && -1 !== ['+', '-'].indexOf(t) ? (e[e.length - 1] = t, p = !0, e) : p ? (e[e.length - 1] += t, p = !1, e) : e.concat(t)
  417. }, []).map(function(e) {
  418. return q(e, n, t, o)
  419. })
  420. }), a.forEach(function(e, t) {
  421. e.forEach(function(o, i) {
  422. R(o) && (n[t] += o * ('-' === e[i - 1] ? -1 : 1))
  423. })
  424. }), n
  425. }
  426. for (var z = Math.min, V = Math.floor, _ = Math.max, X = ['native code', '[object MutationObserverConstructor]'], Q = function(e) {
  427. return X.some(function(t) {
  428. return -1 < (e || '').toString().indexOf(t)
  429. })
  430. }, J = 'undefined' != typeof window, Z = ['Edge', 'Trident', 'Firefox'], $ = 0, ee = 0; ee < Z.length; ee += 1)
  431. if (J && 0 <= navigator.userAgent.indexOf(Z[ee])) {
  432. $ = 1;
  433. break
  434. }
  435. var i, te = J && Q(window.MutationObserver),
  436. oe = te ? function(e) {
  437. var t = !1,
  438. o = 0,
  439. i = document.createElement('span'),
  440. n = new MutationObserver(function() {
  441. e(), t = !1
  442. });
  443. return n.observe(i, {
  444. attributes: !0
  445. }),
  446. function() {
  447. t || (t = !0, i.setAttribute('x-index', o), ++o)
  448. }
  449. } : function(e) {
  450. var t = !1;
  451. return function() {
  452. t || (t = !0, setTimeout(function() {
  453. t = !1, e()
  454. }, $))
  455. }
  456. },
  457. ie = function() {
  458. return void 0 == i && (i = -1 !== navigator.appVersion.indexOf('MSIE 10')), i
  459. },
  460. ne = function(e, t) {
  461. if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
  462. },
  463. re = function() {
  464. function e(e, t) {
  465. 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)
  466. }
  467. return function(t, o, i) {
  468. return o && e(t.prototype, o), i && e(t, i), t
  469. }
  470. }(),
  471. pe = function(e, t, o) {
  472. return t in e ? Object.defineProperty(e, t, {
  473. value: o,
  474. enumerable: !0,
  475. configurable: !0,
  476. writable: !0
  477. }) : e[t] = o, e
  478. },
  479. se = Object.assign || function(e) {
  480. for (var t, o = 1; o < arguments.length; o++)
  481. for (var i in t = arguments[o], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  482. return e
  483. },
  484. de = ['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'],
  485. ae = de.slice(3),
  486. fe = {
  487. FLIP: 'flip',
  488. CLOCKWISE: 'clockwise',
  489. COUNTERCLOCKWISE: 'counterclockwise'
  490. },
  491. le = function() {
  492. function t(o, i) {
  493. var n = this,
  494. r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
  495. ne(this, t), this.scheduleUpdate = function() {
  496. return requestAnimationFrame(n.update)
  497. }, this.update = oe(this.update.bind(this)), this.options = se({}, t.Defaults, r), this.state = {
  498. isDestroyed: !1,
  499. isCreated: !1,
  500. scrollParents: []
  501. }, this.reference = o.jquery ? o[0] : o, this.popper = i.jquery ? i[0] : i, this.options.modifiers = {}, Object.keys(se({}, t.Defaults.modifiers, r.modifiers)).forEach(function(e) {
  502. n.options.modifiers[e] = se({}, t.Defaults.modifiers[e] || {}, r.modifiers ? r.modifiers[e] : {})
  503. }), this.modifiers = Object.keys(this.options.modifiers).map(function(e) {
  504. return se({
  505. name: e
  506. }, n.options.modifiers[e])
  507. }).sort(function(e, t) {
  508. return e.order - t.order
  509. }), this.modifiers.forEach(function(t) {
  510. t.enabled && e(t.onLoad) && t.onLoad(n.reference, n.popper, n.options, t, n.state)
  511. }), this.update();
  512. var p = this.options.eventsEnabled;
  513. p && this.enableEventListeners(), this.state.eventsEnabled = p
  514. }
  515. return re(t, [{
  516. key: 'update',
  517. value: function() {
  518. return k.call(this)
  519. }
  520. }, {
  521. key: 'destroy',
  522. value: function() {
  523. return D.call(this)
  524. }
  525. }, {
  526. key: 'enableEventListeners',
  527. value: function() {
  528. return A.call(this)
  529. }
  530. }, {
  531. key: 'disableEventListeners',
  532. value: function() {
  533. return I.call(this)
  534. }
  535. }]), t
  536. }();
  537. return le.Utils = ('undefined' == typeof window ? global : window).PopperUtils, le.placements = de, le.Defaults = {
  538. placement: 'bottom',
  539. eventsEnabled: !0,
  540. removeOnDestroy: !1,
  541. onCreate: function() {},
  542. onUpdate: function() {},
  543. modifiers: {
  544. shift: {
  545. order: 100,
  546. enabled: !0,
  547. fn: function(e) {
  548. var t = e.placement,
  549. o = t.split('-')[0],
  550. i = t.split('-')[1];
  551. if (i) {
  552. var n = e.offsets,
  553. r = n.reference,
  554. p = n.popper,
  555. s = -1 !== ['bottom', 'top'].indexOf(o),
  556. d = s ? 'left' : 'top',
  557. a = s ? 'width' : 'height',
  558. f = {
  559. start: pe({}, d, r[d]),
  560. end: pe({}, d, r[d] + r[a] - p[a])
  561. };
  562. e.offsets.popper = se({}, p, f[i])
  563. }
  564. return e
  565. }
  566. },
  567. offset: {
  568. order: 200,
  569. enabled: !0,
  570. fn: function(e, t) {
  571. var o, i = t.offset,
  572. n = e.placement,
  573. r = e.offsets,
  574. p = r.popper,
  575. s = r.reference,
  576. d = n.split('-')[0];
  577. return o = R(+i) ? [+i, 0] : G(i, p, s, d), 'left' === d ? (p.top += o[0], p.left -= o[1]) : 'right' === d ? (p.top += o[0], p.left += o[1]) : 'top' === d ? (p.left += o[0], p.top -= o[1]) : 'bottom' === d && (p.left += o[0], p.top += o[1]), e.popper = p, e
  578. },
  579. offset: 0
  580. },
  581. preventOverflow: {
  582. order: 300,
  583. enabled: !0,
  584. fn: function(e, t) {
  585. var o = t.boundariesElement || r(e.instance.popper);
  586. e.instance.reference === o && (o = r(o));
  587. var i = w(e.instance.popper, e.instance.reference, t.padding, o);
  588. t.boundaries = i;
  589. var n = t.priority,
  590. p = e.offsets.popper,
  591. s = {
  592. primary: function(e) {
  593. var o = p[e];
  594. return p[e] < i[e] && !t.escapeWithReference && (o = _(p[e], i[e])), pe({}, e, o)
  595. },
  596. secondary: function(e) {
  597. var o = 'right' === e ? 'left' : 'top',
  598. n = p[o];
  599. return p[e] > i[e] && !t.escapeWithReference && (n = z(p[o], i[e] - ('right' === e ? p.width : p.height))), pe({}, o, n)
  600. }
  601. };
  602. return n.forEach(function(e) {
  603. var t = -1 === ['left', 'top'].indexOf(e) ? 'secondary' : 'primary';
  604. p = se({}, p, s[t](e))
  605. }), e.offsets.popper = p, e
  606. },
  607. priority: ['left', 'right', 'top', 'bottom'],
  608. padding: 5,
  609. boundariesElement: 'scrollParent'
  610. },
  611. keepTogether: {
  612. order: 400,
  613. enabled: !0,
  614. fn: function(e) {
  615. var t = e.offsets,
  616. o = t.popper,
  617. i = t.reference,
  618. n = e.placement.split('-')[0],
  619. r = V,
  620. p = -1 !== ['top', 'bottom'].indexOf(n),
  621. s = p ? 'right' : 'bottom',
  622. d = p ? 'left' : 'top',
  623. a = p ? 'width' : 'height';
  624. return o[s] < r(i[d]) && (e.offsets.popper[d] = r(i[d]) - o[a]), o[d] > r(i[s]) && (e.offsets.popper[d] = r(i[s])), e
  625. }
  626. },
  627. arrow: {
  628. order: 500,
  629. enabled: !0,
  630. fn: function(e, t) {
  631. if (!F(e.instance.modifiers, 'arrow', 'keepTogether')) return e;
  632. var o = t.element;
  633. if ('string' == typeof o) {
  634. if (o = e.instance.popper.querySelector(o), !o) return e;
  635. } else if (!e.instance.popper.contains(o)) return console.warn('WARNING: `arrow.element` must be child of its popper element!'), e;
  636. var i = e.placement.split('-')[0],
  637. n = e.offsets,
  638. r = n.popper,
  639. p = n.reference,
  640. s = -1 !== ['left', 'right'].indexOf(i),
  641. d = s ? 'height' : 'width',
  642. a = s ? 'top' : 'left',
  643. f = s ? 'left' : 'top',
  644. l = s ? 'bottom' : 'right',
  645. m = O(o)[d];
  646. p[l] - m < r[a] && (e.offsets.popper[a] -= r[a] - (p[l] - m)), p[a] + m > r[l] && (e.offsets.popper[a] += p[a] + m - r[l]);
  647. var h = p[a] + p[d] / 2 - m / 2,
  648. g = h - c(e.offsets.popper)[a];
  649. return g = _(z(r[d] - m, g), 0), e.arrowElement = o, e.offsets.arrow = {}, e.offsets.arrow[a] = Math.round(g), e.offsets.arrow[f] = '', e
  650. },
  651. element: '[x-arrow]'
  652. },
  653. flip: {
  654. order: 600,
  655. enabled: !0,
  656. fn: function(e, t) {
  657. if (W(e.instance.modifiers, 'inner')) return e;
  658. if (e.flipped && e.placement === e.originalPlacement) return e;
  659. var o = w(e.instance.popper, e.instance.reference, t.padding, t.boundariesElement),
  660. i = e.placement.split('-')[0],
  661. n = L(i),
  662. r = e.placement.split('-')[1] || '',
  663. p = [];
  664. switch (t.behavior) {
  665. case fe.FLIP:
  666. p = [i, n];
  667. break;
  668. case fe.CLOCKWISE:
  669. p = K(i);
  670. break;
  671. case fe.COUNTERCLOCKWISE:
  672. p = K(i, !0);
  673. break;
  674. default:
  675. p = t.behavior;
  676. }
  677. return p.forEach(function(s, d) {
  678. if (i !== s || p.length === d + 1) return e;
  679. i = e.placement.split('-')[0], n = L(i);
  680. var a = e.offsets.popper,
  681. f = e.offsets.reference,
  682. l = V,
  683. m = 'left' === i && l(a.right) > l(f.left) || 'right' === i && l(a.left) < l(f.right) || 'top' === i && l(a.bottom) > l(f.top) || 'bottom' === i && l(a.top) < l(f.bottom),
  684. h = l(a.left) < l(o.left),
  685. c = l(a.right) > l(o.right),
  686. g = l(a.top) < l(o.top),
  687. u = l(a.bottom) > l(o.bottom),
  688. b = 'left' === i && h || 'right' === i && c || 'top' === i && g || 'bottom' === i && u,
  689. y = -1 !== ['top', 'bottom'].indexOf(i),
  690. w = !!t.flipVariations && (y && 'start' === r && h || y && 'end' === r && c || !y && 'start' === r && g || !y && 'end' === r && u);
  691. (m || b || w) && (e.flipped = !0, (m || b) && (i = p[d + 1]), w && (r = j(r)), e.placement = i + (r ? '-' + r : ''), e.offsets.popper = se({}, e.offsets.popper, S(e.instance.popper, e.offsets.reference, e.placement)), e = N(e.instance.modifiers, e, 'flip'))
  692. }), e
  693. },
  694. behavior: 'flip',
  695. padding: 5,
  696. boundariesElement: 'viewport'
  697. },
  698. inner: {
  699. order: 700,
  700. enabled: !1,
  701. fn: function(e) {
  702. var t = e.placement,
  703. o = t.split('-')[0],
  704. i = e.offsets,
  705. n = i.popper,
  706. r = i.reference,
  707. p = -1 !== ['left', 'right'].indexOf(o),
  708. s = -1 === ['top', 'left'].indexOf(o);
  709. return n[p ? 'left' : 'top'] = r[t] - (s ? n[p ? 'width' : 'height'] : 0), e.placement = L(t), e.offsets.popper = c(n), e
  710. }
  711. },
  712. hide: {
  713. order: 800,
  714. enabled: !0,
  715. fn: function(e) {
  716. if (!F(e.instance.modifiers, 'hide', 'preventOverflow')) return e;
  717. var t = e.offsets.reference,
  718. o = T(e.instance.modifiers, function(e) {
  719. return 'preventOverflow' === e.name
  720. }).boundaries;
  721. if (t.bottom < o.top || t.left > o.right || t.top > o.bottom || t.right < o.left) {
  722. if (!0 === e.hide) return e;
  723. e.hide = !0, e.attributes['x-out-of-boundaries'] = ''
  724. } else {
  725. if (!1 === e.hide) return e;
  726. e.hide = !1, e.attributes['x-out-of-boundaries'] = !1
  727. }
  728. return e
  729. }
  730. },
  731. computeStyle: {
  732. order: 850,
  733. enabled: !0,
  734. fn: function(e, t) {
  735. var o = t.x,
  736. i = t.y,
  737. n = e.offsets.popper,
  738. p = T(e.instance.modifiers, function(e) {
  739. return 'applyStyle' === e.name
  740. }).gpuAcceleration;
  741. void 0 !== p && console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  742. var s, d, a = void 0 === p ? t.gpuAcceleration : p,
  743. f = r(e.instance.popper),
  744. l = g(f),
  745. m = {
  746. position: n.position
  747. },
  748. h = {
  749. left: V(n.left),
  750. top: V(n.top),
  751. bottom: V(n.bottom),
  752. right: V(n.right)
  753. },
  754. c = 'bottom' === o ? 'top' : 'bottom',
  755. u = 'right' === i ? 'left' : 'right',
  756. b = B('transform');
  757. if (d = 'bottom' == c ? -l.height + h.bottom : h.top, s = 'right' == u ? -l.width + h.right : h.left, a && b) m[b] = 'translate3d(' + s + 'px, ' + d + 'px, 0)', m[c] = 0, m[u] = 0, m.willChange = 'transform';
  758. else {
  759. var y = 'bottom' == c ? -1 : 1,
  760. w = 'right' == u ? -1 : 1;
  761. m[c] = d * y, m[u] = s * w, m.willChange = c + ', ' + u
  762. }
  763. var v = {
  764. "x-placement": e.placement
  765. };
  766. return e.attributes = se({}, v, e.attributes), e.styles = se({}, m, e.styles), e
  767. },
  768. gpuAcceleration: !0,
  769. x: 'bottom',
  770. y: 'right'
  771. },
  772. applyStyle: {
  773. order: 900,
  774. enabled: !0,
  775. fn: function(e) {
  776. return U(e.instance.popper, e.styles), Y(e.instance.popper, e.attributes), e.offsets.arrow && U(e.arrowElement, e.offsets.arrow), e
  777. },
  778. onLoad: function(e, t, o, i, n) {
  779. var r = x(n, t, e),
  780. p = E(o.placement, r, t, e, o.modifiers.flip.boundariesElement, o.modifiers.flip.padding);
  781. return t.setAttribute('x-placement', p), U(t, {
  782. position: 'absolute'
  783. }), o
  784. },
  785. gpuAcceleration: void 0
  786. }
  787. }
  788. }, le
  789. });