wcs-core 2.5.2 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +17 -1
  3. package/dist/cjs/component-fc28ed16.js +1074 -0
  4. package/dist/cjs/helpers-6abce594.js +86 -0
  5. package/dist/cjs/{index-e05c3e1f.js → index-3cb9d725.js} +165 -87
  6. package/dist/cjs/loader.cjs.js +3 -3
  7. package/dist/{esm/wcs-action-bar_47.entry.js → cjs/lodash-776d6f03.js} +12499 -22628
  8. package/dist/cjs/popper-6a290c40.js +1731 -0
  9. package/dist/cjs/select-arrow-76ccf86d.js +36 -0
  10. package/dist/cjs/wcs-action-bar.cjs.entry.js +24 -0
  11. package/dist/cjs/wcs-app.cjs.entry.js +2 -2
  12. package/dist/cjs/wcs-badge.cjs.entry.js +27 -0
  13. package/dist/cjs/wcs-button.cjs.entry.js +86 -0
  14. package/dist/cjs/wcs-card-body.cjs.entry.js +19 -0
  15. package/dist/cjs/wcs-card.cjs.entry.js +20 -0
  16. package/dist/cjs/wcs-checkbox.cjs.entry.js +47 -0
  17. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +63 -0
  18. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +69 -0
  19. package/dist/cjs/wcs-com-nav.cjs.entry.js +19 -0
  20. package/dist/cjs/wcs-divider.cjs.entry.js +19 -0
  21. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  22. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  23. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +23 -0
  24. package/dist/cjs/wcs-dropdown.cjs.entry.js +90 -0
  25. package/dist/cjs/wcs-editable-field.cjs.entry.js +225 -0
  26. package/dist/cjs/wcs-error_2.cjs.entry.js +137 -0
  27. package/dist/cjs/wcs-field-content.cjs.entry.js +16 -0
  28. package/dist/cjs/wcs-field-label.cjs.entry.js +16 -0
  29. package/dist/cjs/wcs-field.cjs.entry.js +19 -0
  30. package/dist/cjs/wcs-footer.cjs.entry.js +19 -0
  31. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +58 -0
  32. package/dist/cjs/wcs-galactic.cjs.entry.js +41 -0
  33. package/dist/cjs/wcs-grid-column.cjs.entry.js +77 -0
  34. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +16 -0
  35. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +4 -4
  36. package/dist/cjs/wcs-grid.cjs.entry.js +332 -0
  37. package/dist/cjs/wcs-header.cjs.entry.js +25 -0
  38. package/dist/cjs/wcs-hint.cjs.entry.js +20 -0
  39. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +114 -0
  40. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  41. package/dist/cjs/wcs-input.cjs.entry.js +228 -0
  42. package/dist/cjs/wcs-label.cjs.entry.js +20 -0
  43. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +19 -0
  44. package/dist/cjs/wcs-list-item-property.cjs.entry.js +19 -0
  45. package/dist/cjs/wcs-list-item.cjs.entry.js +23 -0
  46. package/dist/cjs/wcs-mat-icon.cjs.entry.js +73 -0
  47. package/dist/cjs/wcs-modal.cjs.entry.js +45 -0
  48. package/dist/cjs/wcs-nav-item.cjs.entry.js +23 -0
  49. package/dist/cjs/wcs-nav.cjs.entry.js +19 -0
  50. package/dist/cjs/wcs-progress-bar.cjs.entry.js +47 -0
  51. package/dist/cjs/wcs-progress-radial.cjs.entry.js +30 -0
  52. package/dist/cjs/wcs-radio-group.cjs.entry.js +65 -0
  53. package/dist/cjs/wcs-radio.cjs.entry.js +49 -0
  54. package/dist/cjs/wcs-select_2.cjs.entry.js +4916 -0
  55. package/dist/cjs/wcs-spinner.cjs.entry.js +21 -0
  56. package/dist/cjs/wcs-switch.cjs.entry.js +42 -0
  57. package/dist/cjs/wcs-tab.cjs.entry.js +20 -0
  58. package/dist/cjs/wcs-tabs.cjs.entry.js +159 -0
  59. package/dist/cjs/wcs-textarea.cjs.entry.js +224 -0
  60. package/dist/cjs/wcs-tooltip.cjs.entry.js +129 -0
  61. package/dist/cjs/wcs.cjs.js +3 -3
  62. package/dist/collection/collection-manifest.json +5 -2
  63. package/dist/collection/components/button/button.css +79 -75
  64. package/dist/collection/components/button/button.js +23 -11
  65. package/dist/collection/components/checkbox/checkbox.css +18 -7
  66. package/dist/collection/components/checkbox/checkbox.js +24 -2
  67. package/dist/collection/components/com-nav/com-nav.css +1 -2
  68. package/dist/collection/components/com-nav-category/com-nav-category.css +5 -6
  69. package/dist/collection/components/com-nav-category/com-nav-category.js +31 -1
  70. package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +1 -2
  71. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +21 -1
  72. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  73. package/dist/collection/components/dropdown/dropdown.css +46 -38
  74. package/dist/collection/components/dropdown/dropdown.js +90 -29
  75. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  76. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  77. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  78. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  79. package/dist/collection/components/footer/footer.css +1 -1
  80. package/dist/collection/components/form-field/form-field.css +1 -1
  81. package/dist/collection/components/grid/grid.js +75 -13
  82. package/dist/collection/components/grid-column/grid-column.css +5 -0
  83. package/dist/collection/components/grid-column/grid-column.js +69 -3
  84. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +45 -0
  85. package/dist/collection/components/grid-pagination/grid-pagination.js +4 -4
  86. package/dist/collection/components/header/header.css +1 -1
  87. package/dist/collection/components/input/input.css +48 -0
  88. package/dist/collection/components/input/input.js +40 -4
  89. package/dist/collection/components/radio/radio.component.js +1 -1
  90. package/dist/collection/components/radio/radio.css +18 -4
  91. package/dist/collection/components/radio-group/radio-group.js +7 -2
  92. package/dist/collection/components/select/select.css +81 -77
  93. package/dist/collection/components/select/select.js +2 -2
  94. package/dist/collection/components/select-option/select-option.css +79 -75
  95. package/dist/collection/components/select-option/select-option.js +6 -7
  96. package/dist/collection/components/switch/switch.css +53 -16
  97. package/dist/collection/components/switch/switch.js +55 -6
  98. package/dist/collection/components/tab/tab.js +4 -4
  99. package/dist/collection/components/tabs/tabs.js +1 -1
  100. package/dist/collection/components/textarea/textarea.css +4 -0
  101. package/dist/collection/components/textarea/textarea.js +2 -2
  102. package/dist/collection/components/tooltip/tooltip.js +2 -2
  103. package/dist/collection/utils/helpers.js +4 -0
  104. package/dist/esm/component-6b4d470f.js +1072 -0
  105. package/dist/esm/helpers-e2993152.js +77 -0
  106. package/dist/esm/{index-c619b1fa.js → index-b982604a.js} +165 -88
  107. package/dist/esm/loader.js +3 -3
  108. package/dist/{cjs/wcs-action-bar_47.cjs.entry.js → esm/lodash-d6d9d079.js} +12610 -22791
  109. package/dist/esm/popper-e5fdfb6a.js +1729 -0
  110. package/dist/esm/select-arrow-73ac4016.js +34 -0
  111. package/dist/esm/wcs-action-bar.entry.js +20 -0
  112. package/dist/esm/wcs-app.entry.js +2 -2
  113. package/dist/esm/wcs-badge.entry.js +23 -0
  114. package/dist/esm/wcs-button.entry.js +82 -0
  115. package/dist/esm/wcs-card-body.entry.js +15 -0
  116. package/dist/esm/wcs-card.entry.js +16 -0
  117. package/dist/esm/wcs-checkbox.entry.js +43 -0
  118. package/dist/esm/wcs-com-nav-category.entry.js +59 -0
  119. package/dist/esm/wcs-com-nav-submenu.entry.js +65 -0
  120. package/dist/esm/wcs-com-nav.entry.js +15 -0
  121. package/dist/esm/wcs-divider.entry.js +15 -0
  122. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  123. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  124. package/dist/esm/wcs-dropdown-item.entry.js +19 -0
  125. package/dist/esm/wcs-dropdown.entry.js +86 -0
  126. package/dist/esm/wcs-editable-field.entry.js +221 -0
  127. package/dist/esm/wcs-error_2.entry.js +132 -0
  128. package/dist/esm/wcs-field-content.entry.js +12 -0
  129. package/dist/esm/wcs-field-label.entry.js +12 -0
  130. package/dist/esm/wcs-field.entry.js +15 -0
  131. package/dist/esm/wcs-footer.entry.js +15 -0
  132. package/dist/esm/wcs-galactic-menu.entry.js +54 -0
  133. package/dist/esm/wcs-galactic.entry.js +37 -0
  134. package/dist/esm/wcs-grid-column.entry.js +73 -0
  135. package/dist/esm/wcs-grid-custom-cell.entry.js +12 -0
  136. package/dist/esm/wcs-grid-pagination.entry.js +4 -4
  137. package/dist/esm/wcs-grid.entry.js +328 -0
  138. package/dist/esm/wcs-header.entry.js +21 -0
  139. package/dist/esm/wcs-hint.entry.js +16 -0
  140. package/dist/esm/wcs-horizontal-stepper.entry.js +110 -0
  141. package/dist/esm/wcs-icon.entry.js +2 -2
  142. package/dist/esm/wcs-input.entry.js +224 -0
  143. package/dist/esm/wcs-label.entry.js +16 -0
  144. package/dist/esm/wcs-list-item-properties.entry.js +15 -0
  145. package/dist/esm/wcs-list-item-property.entry.js +15 -0
  146. package/dist/esm/wcs-list-item.entry.js +19 -0
  147. package/dist/esm/wcs-mat-icon.entry.js +69 -0
  148. package/dist/esm/wcs-modal.entry.js +41 -0
  149. package/dist/esm/wcs-nav-item.entry.js +19 -0
  150. package/dist/esm/wcs-nav.entry.js +15 -0
  151. package/dist/esm/wcs-progress-bar.entry.js +43 -0
  152. package/dist/esm/wcs-progress-radial.entry.js +26 -0
  153. package/dist/esm/wcs-radio-group.entry.js +61 -0
  154. package/dist/esm/wcs-radio.entry.js +45 -0
  155. package/dist/esm/wcs-select_2.entry.js +4911 -0
  156. package/dist/esm/wcs-spinner.entry.js +17 -0
  157. package/dist/esm/wcs-switch.entry.js +38 -0
  158. package/dist/esm/wcs-tab.entry.js +16 -0
  159. package/dist/esm/wcs-tabs.entry.js +155 -0
  160. package/dist/esm/wcs-textarea.entry.js +220 -0
  161. package/dist/esm/wcs-tooltip.entry.js +125 -0
  162. package/dist/esm/wcs.js +3 -3
  163. package/dist/types/components/button/button.d.ts +7 -3
  164. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  165. package/dist/types/components/com-nav-category/com-nav-category.d.ts +7 -0
  166. package/dist/types/components/com-nav-submenu/com-nav-submenu.d.ts +7 -0
  167. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  168. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  169. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  170. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  171. package/dist/types/components/grid/grid.d.ts +18 -0
  172. package/dist/types/components/grid-column/grid-column.d.ts +5 -0
  173. package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +12 -0
  174. package/dist/types/components/input/input.d.ts +8 -0
  175. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  176. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  177. package/dist/types/components/select-option/select-option.d.ts +2 -0
  178. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  179. package/dist/types/components/switch/switch.d.ts +10 -2
  180. package/dist/types/components.d.ts +148 -4
  181. package/dist/types/stencil-public-runtime.d.ts +183 -182
  182. package/dist/types/utils/helpers.d.ts +1 -0
  183. package/dist/wcs/p-03b2e238.entry.js +1 -0
  184. package/dist/wcs/p-15008e35.entry.js +1 -0
  185. package/dist/wcs/p-16dfbae8.js +127 -0
  186. package/dist/wcs/p-17c6db7f.entry.js +1 -0
  187. package/dist/wcs/p-1dce7e63.entry.js +1 -0
  188. package/dist/wcs/p-1f5aed36.entry.js +1 -0
  189. package/dist/wcs/p-214236db.entry.js +1 -0
  190. package/dist/wcs/p-26b5c0a3.entry.js +1 -0
  191. package/dist/wcs/p-2e6265dc.entry.js +1 -0
  192. package/dist/wcs/p-384068f7.entry.js +1 -0
  193. package/dist/wcs/p-41037455.entry.js +1 -0
  194. package/dist/wcs/p-474d6601.entry.js +1 -0
  195. package/dist/wcs/p-55fdc284.entry.js +1 -0
  196. package/dist/wcs/p-57247184.entry.js +1 -0
  197. package/dist/wcs/p-5b35b232.entry.js +1 -0
  198. package/dist/wcs/p-600a9cc0.entry.js +1 -0
  199. package/dist/wcs/p-60b51967.entry.js +1 -0
  200. package/dist/wcs/p-64523291.entry.js +1 -0
  201. package/dist/wcs/p-65c5ccc5.entry.js +1 -0
  202. package/dist/wcs/p-688fea65.entry.js +1 -0
  203. package/dist/wcs/p-716d5921.entry.js +1 -0
  204. package/dist/wcs/p-7206e492.entry.js +1 -0
  205. package/dist/wcs/p-7219c04b.js +1 -0
  206. package/dist/wcs/p-8137f075.entry.js +1 -0
  207. package/dist/wcs/p-8864a491.entry.js +1 -0
  208. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  209. package/dist/wcs/p-91a2de07.entry.js +1 -0
  210. package/dist/wcs/p-94a31f64.entry.js +1 -0
  211. package/dist/wcs/p-979dfd78.entry.js +1 -0
  212. package/dist/wcs/p-9ba52bc4.entry.js +1 -0
  213. package/dist/wcs/p-a1ee1551.entry.js +1 -0
  214. package/dist/wcs/p-a92d369e.entry.js +1 -0
  215. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  216. package/dist/wcs/p-adef7aaf.js +1 -0
  217. package/dist/wcs/p-b5138986.js +1 -0
  218. package/dist/wcs/p-b7184d59.entry.js +1 -0
  219. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  220. package/dist/wcs/p-c7d6d3e1.entry.js +15 -0
  221. package/dist/wcs/p-cf4d7a83.js +1 -0
  222. package/dist/wcs/p-d7dec082.entry.js +1 -0
  223. package/dist/wcs/p-db68379f.entry.js +1 -0
  224. package/dist/wcs/p-dbbc3f58.entry.js +1 -0
  225. package/dist/wcs/p-dc817204.entry.js +1 -0
  226. package/dist/wcs/p-e0163de8.entry.js +1 -0
  227. package/dist/wcs/p-e4236d32.entry.js +1 -0
  228. package/dist/wcs/p-e43358e4.entry.js +1 -0
  229. package/dist/wcs/p-e65d1c27.entry.js +1 -0
  230. package/dist/wcs/p-e9ce507c.entry.js +1 -0
  231. package/dist/wcs/p-ea3e93e9.entry.js +1 -0
  232. package/dist/wcs/p-ed6e8541.entry.js +1 -0
  233. package/dist/wcs/p-f46e6c3c.js +1 -0
  234. package/dist/wcs/p-f9944bde.entry.js +1 -0
  235. package/dist/wcs/p-fa173947.entry.js +1 -0
  236. package/dist/wcs/p-fb1577b5.entry.js +1 -0
  237. package/dist/wcs/p-fbaf299d.entry.js +1 -0
  238. package/dist/wcs/p-febe9ccc.entry.js +1 -0
  239. package/dist/wcs/p-ff6d0dfd.entry.js +1 -0
  240. package/dist/wcs/wcs.esm.js +1 -1
  241. package/loader/index.d.ts +0 -1
  242. package/package.json +22 -21
  243. package/dist/wcs/p-16dca526.entry.js +0 -1
  244. package/dist/wcs/p-4f228fcb.entry.js +0 -134
  245. package/dist/wcs/p-66520e5a.entry.js +0 -1
  246. package/dist/wcs/p-d31287c6.entry.js +0 -1
  247. package/dist/wcs/p-f73f235b.js +0 -1
  248. package/schematics/.gitignore +0 -18
  249. package/schematics/.npmignore +0 -4
  250. package/schematics/collection.json +0 -9
  251. package/schematics/src/ng-add/files/fonts/avenir-black.woff +0 -0
  252. package/schematics/src/ng-add/files/fonts/avenir-book.woff +0 -0
  253. package/schematics/src/ng-add/files/fonts/avenir-lighter.woff +0 -0
  254. package/schematics/src/ng-add/files/fonts/avenir-medium.woff +0 -0
  255. package/schematics/src/ng-add/files/sncf-logo.png +0 -0
  256. package/schematics/src/ng-add/index.d.ts +0 -3
  257. package/schematics/src/ng-add/index.js +0 -119
  258. package/schematics/src/ng-add/index.js.map +0 -1
  259. package/schematics/src/ng-add/schema.json +0 -5
@@ -0,0 +1,1729 @@
1
+ var top = 'top';
2
+ var bottom = 'bottom';
3
+ var right = 'right';
4
+ var left = 'left';
5
+ var auto = 'auto';
6
+ var basePlacements = [top, bottom, right, left];
7
+ var start = 'start';
8
+ var end = 'end';
9
+ var clippingParents = 'clippingParents';
10
+ var viewport = 'viewport';
11
+ var popper = 'popper';
12
+ var reference = 'reference';
13
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
14
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
15
+ }, []);
16
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
17
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
18
+ }, []); // modifiers that need to read the DOM
19
+
20
+ var beforeRead = 'beforeRead';
21
+ var read = 'read';
22
+ var afterRead = 'afterRead'; // pure-logic modifiers
23
+
24
+ var beforeMain = 'beforeMain';
25
+ var main = 'main';
26
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
27
+
28
+ var beforeWrite = 'beforeWrite';
29
+ var write = 'write';
30
+ var afterWrite = 'afterWrite';
31
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
32
+
33
+ function getNodeName(element) {
34
+ return element ? (element.nodeName || '').toLowerCase() : null;
35
+ }
36
+
37
+ function getWindow(node) {
38
+ if (node == null) {
39
+ return window;
40
+ }
41
+
42
+ if (node.toString() !== '[object Window]') {
43
+ var ownerDocument = node.ownerDocument;
44
+ return ownerDocument ? ownerDocument.defaultView || window : window;
45
+ }
46
+
47
+ return node;
48
+ }
49
+
50
+ function isElement(node) {
51
+ var OwnElement = getWindow(node).Element;
52
+ return node instanceof OwnElement || node instanceof Element;
53
+ }
54
+
55
+ function isHTMLElement(node) {
56
+ var OwnElement = getWindow(node).HTMLElement;
57
+ return node instanceof OwnElement || node instanceof HTMLElement;
58
+ }
59
+
60
+ function isShadowRoot(node) {
61
+ // IE 11 has no ShadowRoot
62
+ if (typeof ShadowRoot === 'undefined') {
63
+ return false;
64
+ }
65
+
66
+ var OwnElement = getWindow(node).ShadowRoot;
67
+ return node instanceof OwnElement || node instanceof ShadowRoot;
68
+ }
69
+
70
+ // and applies them to the HTMLElements such as popper and arrow
71
+
72
+ function applyStyles(_ref) {
73
+ var state = _ref.state;
74
+ Object.keys(state.elements).forEach(function (name) {
75
+ var style = state.styles[name] || {};
76
+ var attributes = state.attributes[name] || {};
77
+ var element = state.elements[name]; // arrow is optional + virtual elements
78
+
79
+ if (!isHTMLElement(element) || !getNodeName(element)) {
80
+ return;
81
+ } // Flow doesn't support to extend this property, but it's the most
82
+ // effective way to apply styles to an HTMLElement
83
+ // $FlowFixMe[cannot-write]
84
+
85
+
86
+ Object.assign(element.style, style);
87
+ Object.keys(attributes).forEach(function (name) {
88
+ var value = attributes[name];
89
+
90
+ if (value === false) {
91
+ element.removeAttribute(name);
92
+ } else {
93
+ element.setAttribute(name, value === true ? '' : value);
94
+ }
95
+ });
96
+ });
97
+ }
98
+
99
+ function effect$2(_ref2) {
100
+ var state = _ref2.state;
101
+ var initialStyles = {
102
+ popper: {
103
+ position: state.options.strategy,
104
+ left: '0',
105
+ top: '0',
106
+ margin: '0'
107
+ },
108
+ arrow: {
109
+ position: 'absolute'
110
+ },
111
+ reference: {}
112
+ };
113
+ Object.assign(state.elements.popper.style, initialStyles.popper);
114
+ state.styles = initialStyles;
115
+
116
+ if (state.elements.arrow) {
117
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
118
+ }
119
+
120
+ return function () {
121
+ Object.keys(state.elements).forEach(function (name) {
122
+ var element = state.elements[name];
123
+ var attributes = state.attributes[name] || {};
124
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
125
+
126
+ var style = styleProperties.reduce(function (style, property) {
127
+ style[property] = '';
128
+ return style;
129
+ }, {}); // arrow is optional + virtual elements
130
+
131
+ if (!isHTMLElement(element) || !getNodeName(element)) {
132
+ return;
133
+ }
134
+
135
+ Object.assign(element.style, style);
136
+ Object.keys(attributes).forEach(function (attribute) {
137
+ element.removeAttribute(attribute);
138
+ });
139
+ });
140
+ };
141
+ } // eslint-disable-next-line import/no-unused-modules
142
+
143
+
144
+ const applyStyles$1 = {
145
+ name: 'applyStyles',
146
+ enabled: true,
147
+ phase: 'write',
148
+ fn: applyStyles,
149
+ effect: effect$2,
150
+ requires: ['computeStyles']
151
+ };
152
+
153
+ function getBasePlacement(placement) {
154
+ return placement.split('-')[0];
155
+ }
156
+
157
+ var round$1 = Math.round;
158
+ function getBoundingClientRect(element, includeScale) {
159
+ if (includeScale === void 0) {
160
+ includeScale = false;
161
+ }
162
+
163
+ var rect = element.getBoundingClientRect();
164
+ var scaleX = 1;
165
+ var scaleY = 1;
166
+
167
+ if (isHTMLElement(element) && includeScale) {
168
+ // Fallback to 1 in case both values are `0`
169
+ scaleX = rect.width / element.offsetWidth || 1;
170
+ scaleY = rect.height / element.offsetHeight || 1;
171
+ }
172
+
173
+ return {
174
+ width: round$1(rect.width / scaleX),
175
+ height: round$1(rect.height / scaleY),
176
+ top: round$1(rect.top / scaleY),
177
+ right: round$1(rect.right / scaleX),
178
+ bottom: round$1(rect.bottom / scaleY),
179
+ left: round$1(rect.left / scaleX),
180
+ x: round$1(rect.left / scaleX),
181
+ y: round$1(rect.top / scaleY)
182
+ };
183
+ }
184
+
185
+ // means it doesn't take into account transforms.
186
+
187
+ function getLayoutRect(element) {
188
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
189
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
190
+
191
+ var width = element.offsetWidth;
192
+ var height = element.offsetHeight;
193
+
194
+ if (Math.abs(clientRect.width - width) <= 1) {
195
+ width = clientRect.width;
196
+ }
197
+
198
+ if (Math.abs(clientRect.height - height) <= 1) {
199
+ height = clientRect.height;
200
+ }
201
+
202
+ return {
203
+ x: element.offsetLeft,
204
+ y: element.offsetTop,
205
+ width: width,
206
+ height: height
207
+ };
208
+ }
209
+
210
+ function contains(parent, child) {
211
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
212
+
213
+ if (parent.contains(child)) {
214
+ return true;
215
+ } // then fallback to custom implementation with Shadow DOM support
216
+ else if (rootNode && isShadowRoot(rootNode)) {
217
+ var next = child;
218
+
219
+ do {
220
+ if (next && parent.isSameNode(next)) {
221
+ return true;
222
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
223
+
224
+
225
+ next = next.parentNode || next.host;
226
+ } while (next);
227
+ } // Give up, the result is false
228
+
229
+
230
+ return false;
231
+ }
232
+
233
+ function getComputedStyle(element) {
234
+ return getWindow(element).getComputedStyle(element);
235
+ }
236
+
237
+ function isTableElement(element) {
238
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
239
+ }
240
+
241
+ function getDocumentElement(element) {
242
+ // $FlowFixMe[incompatible-return]: assume body is always available
243
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
244
+ element.document) || window.document).documentElement;
245
+ }
246
+
247
+ function getParentNode(element) {
248
+ if (getNodeName(element) === 'html') {
249
+ return element;
250
+ }
251
+
252
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
253
+ // $FlowFixMe[incompatible-return]
254
+ // $FlowFixMe[prop-missing]
255
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
256
+ element.parentNode || ( // DOM Element detected
257
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
258
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
259
+ getDocumentElement(element) // fallback
260
+
261
+ );
262
+ }
263
+
264
+ function getTrueOffsetParent(element) {
265
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
266
+ getComputedStyle(element).position === 'fixed') {
267
+ return null;
268
+ }
269
+
270
+ return element.offsetParent;
271
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
272
+ // return the containing block
273
+
274
+
275
+ function getContainingBlock(element) {
276
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
277
+ var isIE = navigator.userAgent.indexOf('Trident') !== -1;
278
+
279
+ if (isIE && isHTMLElement(element)) {
280
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
281
+ var elementCss = getComputedStyle(element);
282
+
283
+ if (elementCss.position === 'fixed') {
284
+ return null;
285
+ }
286
+ }
287
+
288
+ var currentNode = getParentNode(element);
289
+
290
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
291
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
292
+ // create a containing block.
293
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
294
+
295
+ if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
296
+ return currentNode;
297
+ } else {
298
+ currentNode = currentNode.parentNode;
299
+ }
300
+ }
301
+
302
+ return null;
303
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
304
+ // such as table ancestors and cross browser bugs.
305
+
306
+
307
+ function getOffsetParent(element) {
308
+ var window = getWindow(element);
309
+ var offsetParent = getTrueOffsetParent(element);
310
+
311
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
312
+ offsetParent = getTrueOffsetParent(offsetParent);
313
+ }
314
+
315
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
316
+ return window;
317
+ }
318
+
319
+ return offsetParent || getContainingBlock(element) || window;
320
+ }
321
+
322
+ function getMainAxisFromPlacement(placement) {
323
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
324
+ }
325
+
326
+ var max = Math.max;
327
+ var min = Math.min;
328
+ var round = Math.round;
329
+
330
+ function within(min$1, value, max$1) {
331
+ return max(min$1, min(value, max$1));
332
+ }
333
+
334
+ function getFreshSideObject() {
335
+ return {
336
+ top: 0,
337
+ right: 0,
338
+ bottom: 0,
339
+ left: 0
340
+ };
341
+ }
342
+
343
+ function mergePaddingObject(paddingObject) {
344
+ return Object.assign({}, getFreshSideObject(), paddingObject);
345
+ }
346
+
347
+ function expandToHashMap(value, keys) {
348
+ return keys.reduce(function (hashMap, key) {
349
+ hashMap[key] = value;
350
+ return hashMap;
351
+ }, {});
352
+ }
353
+
354
+ var toPaddingObject = function toPaddingObject(padding, state) {
355
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
356
+ placement: state.placement
357
+ })) : padding;
358
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
359
+ };
360
+
361
+ function arrow(_ref) {
362
+ var _state$modifiersData$;
363
+
364
+ var state = _ref.state,
365
+ name = _ref.name,
366
+ options = _ref.options;
367
+ var arrowElement = state.elements.arrow;
368
+ var popperOffsets = state.modifiersData.popperOffsets;
369
+ var basePlacement = getBasePlacement(state.placement);
370
+ var axis = getMainAxisFromPlacement(basePlacement);
371
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
372
+ var len = isVertical ? 'height' : 'width';
373
+
374
+ if (!arrowElement || !popperOffsets) {
375
+ return;
376
+ }
377
+
378
+ var paddingObject = toPaddingObject(options.padding, state);
379
+ var arrowRect = getLayoutRect(arrowElement);
380
+ var minProp = axis === 'y' ? top : left;
381
+ var maxProp = axis === 'y' ? bottom : right;
382
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
383
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
384
+ var arrowOffsetParent = getOffsetParent(arrowElement);
385
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
386
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
387
+ // outside of the popper bounds
388
+
389
+ var min = paddingObject[minProp];
390
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
391
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
392
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
393
+
394
+ var axisProp = axis;
395
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
396
+ }
397
+
398
+ function effect$1(_ref2) {
399
+ var state = _ref2.state,
400
+ options = _ref2.options;
401
+ var _options$element = options.element,
402
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
403
+
404
+ if (arrowElement == null) {
405
+ return;
406
+ } // CSS selector
407
+
408
+
409
+ if (typeof arrowElement === 'string') {
410
+ arrowElement = state.elements.popper.querySelector(arrowElement);
411
+
412
+ if (!arrowElement) {
413
+ return;
414
+ }
415
+ }
416
+
417
+ if (!contains(state.elements.popper, arrowElement)) {
418
+
419
+ return;
420
+ }
421
+
422
+ state.elements.arrow = arrowElement;
423
+ } // eslint-disable-next-line import/no-unused-modules
424
+
425
+
426
+ const arrow$1 = {
427
+ name: 'arrow',
428
+ enabled: true,
429
+ phase: 'main',
430
+ fn: arrow,
431
+ effect: effect$1,
432
+ requires: ['popperOffsets'],
433
+ requiresIfExists: ['preventOverflow']
434
+ };
435
+
436
+ var unsetSides = {
437
+ top: 'auto',
438
+ right: 'auto',
439
+ bottom: 'auto',
440
+ left: 'auto'
441
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
442
+ // Zooming can change the DPR, but it seems to report a value that will
443
+ // cleanly divide the values into the appropriate subpixels.
444
+
445
+ function roundOffsetsByDPR(_ref) {
446
+ var x = _ref.x,
447
+ y = _ref.y;
448
+ var win = window;
449
+ var dpr = win.devicePixelRatio || 1;
450
+ return {
451
+ x: round(round(x * dpr) / dpr) || 0,
452
+ y: round(round(y * dpr) / dpr) || 0
453
+ };
454
+ }
455
+
456
+ function mapToStyles(_ref2) {
457
+ var _Object$assign2;
458
+
459
+ var popper = _ref2.popper,
460
+ popperRect = _ref2.popperRect,
461
+ placement = _ref2.placement,
462
+ offsets = _ref2.offsets,
463
+ position = _ref2.position,
464
+ gpuAcceleration = _ref2.gpuAcceleration,
465
+ adaptive = _ref2.adaptive,
466
+ roundOffsets = _ref2.roundOffsets;
467
+
468
+ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
469
+ _ref3$x = _ref3.x,
470
+ x = _ref3$x === void 0 ? 0 : _ref3$x,
471
+ _ref3$y = _ref3.y,
472
+ y = _ref3$y === void 0 ? 0 : _ref3$y;
473
+
474
+ var hasX = offsets.hasOwnProperty('x');
475
+ var hasY = offsets.hasOwnProperty('y');
476
+ var sideX = left;
477
+ var sideY = top;
478
+ var win = window;
479
+
480
+ if (adaptive) {
481
+ var offsetParent = getOffsetParent(popper);
482
+ var heightProp = 'clientHeight';
483
+ var widthProp = 'clientWidth';
484
+
485
+ if (offsetParent === getWindow(popper)) {
486
+ offsetParent = getDocumentElement(popper);
487
+
488
+ if (getComputedStyle(offsetParent).position !== 'static') {
489
+ heightProp = 'scrollHeight';
490
+ widthProp = 'scrollWidth';
491
+ }
492
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
493
+
494
+
495
+ offsetParent = offsetParent;
496
+
497
+ if (placement === top) {
498
+ sideY = bottom; // $FlowFixMe[prop-missing]
499
+
500
+ y -= offsetParent[heightProp] - popperRect.height;
501
+ y *= gpuAcceleration ? 1 : -1;
502
+ }
503
+
504
+ if (placement === left) {
505
+ sideX = right; // $FlowFixMe[prop-missing]
506
+
507
+ x -= offsetParent[widthProp] - popperRect.width;
508
+ x *= gpuAcceleration ? 1 : -1;
509
+ }
510
+ }
511
+
512
+ var commonStyles = Object.assign({
513
+ position: position
514
+ }, adaptive && unsetSides);
515
+
516
+ if (gpuAcceleration) {
517
+ var _Object$assign;
518
+
519
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
520
+ }
521
+
522
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
523
+ }
524
+
525
+ function computeStyles(_ref4) {
526
+ var state = _ref4.state,
527
+ options = _ref4.options;
528
+ var _options$gpuAccelerat = options.gpuAcceleration,
529
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
530
+ _options$adaptive = options.adaptive,
531
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
532
+ _options$roundOffsets = options.roundOffsets,
533
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
534
+
535
+ var commonStyles = {
536
+ placement: getBasePlacement(state.placement),
537
+ popper: state.elements.popper,
538
+ popperRect: state.rects.popper,
539
+ gpuAcceleration: gpuAcceleration
540
+ };
541
+
542
+ if (state.modifiersData.popperOffsets != null) {
543
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
544
+ offsets: state.modifiersData.popperOffsets,
545
+ position: state.options.strategy,
546
+ adaptive: adaptive,
547
+ roundOffsets: roundOffsets
548
+ })));
549
+ }
550
+
551
+ if (state.modifiersData.arrow != null) {
552
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
553
+ offsets: state.modifiersData.arrow,
554
+ position: 'absolute',
555
+ adaptive: false,
556
+ roundOffsets: roundOffsets
557
+ })));
558
+ }
559
+
560
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
561
+ 'data-popper-placement': state.placement
562
+ });
563
+ } // eslint-disable-next-line import/no-unused-modules
564
+
565
+
566
+ const computeStyles$1 = {
567
+ name: 'computeStyles',
568
+ enabled: true,
569
+ phase: 'beforeWrite',
570
+ fn: computeStyles,
571
+ data: {}
572
+ };
573
+
574
+ var passive = {
575
+ passive: true
576
+ };
577
+
578
+ function effect(_ref) {
579
+ var state = _ref.state,
580
+ instance = _ref.instance,
581
+ options = _ref.options;
582
+ var _options$scroll = options.scroll,
583
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
584
+ _options$resize = options.resize,
585
+ resize = _options$resize === void 0 ? true : _options$resize;
586
+ var window = getWindow(state.elements.popper);
587
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
588
+
589
+ if (scroll) {
590
+ scrollParents.forEach(function (scrollParent) {
591
+ scrollParent.addEventListener('scroll', instance.update, passive);
592
+ });
593
+ }
594
+
595
+ if (resize) {
596
+ window.addEventListener('resize', instance.update, passive);
597
+ }
598
+
599
+ return function () {
600
+ if (scroll) {
601
+ scrollParents.forEach(function (scrollParent) {
602
+ scrollParent.removeEventListener('scroll', instance.update, passive);
603
+ });
604
+ }
605
+
606
+ if (resize) {
607
+ window.removeEventListener('resize', instance.update, passive);
608
+ }
609
+ };
610
+ } // eslint-disable-next-line import/no-unused-modules
611
+
612
+
613
+ const eventListeners = {
614
+ name: 'eventListeners',
615
+ enabled: true,
616
+ phase: 'write',
617
+ fn: function fn() {},
618
+ effect: effect,
619
+ data: {}
620
+ };
621
+
622
+ var hash$1 = {
623
+ left: 'right',
624
+ right: 'left',
625
+ bottom: 'top',
626
+ top: 'bottom'
627
+ };
628
+ function getOppositePlacement(placement) {
629
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
630
+ return hash$1[matched];
631
+ });
632
+ }
633
+
634
+ var hash = {
635
+ start: 'end',
636
+ end: 'start'
637
+ };
638
+ function getOppositeVariationPlacement(placement) {
639
+ return placement.replace(/start|end/g, function (matched) {
640
+ return hash[matched];
641
+ });
642
+ }
643
+
644
+ function getWindowScroll(node) {
645
+ var win = getWindow(node);
646
+ var scrollLeft = win.pageXOffset;
647
+ var scrollTop = win.pageYOffset;
648
+ return {
649
+ scrollLeft: scrollLeft,
650
+ scrollTop: scrollTop
651
+ };
652
+ }
653
+
654
+ function getWindowScrollBarX(element) {
655
+ // If <html> has a CSS width greater than the viewport, then this will be
656
+ // incorrect for RTL.
657
+ // Popper 1 is broken in this case and never had a bug report so let's assume
658
+ // it's not an issue. I don't think anyone ever specifies width on <html>
659
+ // anyway.
660
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
661
+ // this (e.g. Edge 2019, IE11, Safari)
662
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
663
+ }
664
+
665
+ function getViewportRect(element) {
666
+ var win = getWindow(element);
667
+ var html = getDocumentElement(element);
668
+ var visualViewport = win.visualViewport;
669
+ var width = html.clientWidth;
670
+ var height = html.clientHeight;
671
+ var x = 0;
672
+ var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
673
+ // can be obscured underneath it.
674
+ // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
675
+ // if it isn't open, so if this isn't available, the popper will be detected
676
+ // to overflow the bottom of the screen too early.
677
+
678
+ if (visualViewport) {
679
+ width = visualViewport.width;
680
+ height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
681
+ // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
682
+ // errors due to floating point numbers, so we need to check precision.
683
+ // Safari returns a number <= 0, usually < -1 when pinch-zoomed
684
+ // Feature detection fails in mobile emulation mode in Chrome.
685
+ // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
686
+ // 0.001
687
+ // Fallback here: "Not Safari" userAgent
688
+
689
+ if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
690
+ x = visualViewport.offsetLeft;
691
+ y = visualViewport.offsetTop;
692
+ }
693
+ }
694
+
695
+ return {
696
+ width: width,
697
+ height: height,
698
+ x: x + getWindowScrollBarX(element),
699
+ y: y
700
+ };
701
+ }
702
+
703
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
704
+
705
+ function getDocumentRect(element) {
706
+ var _element$ownerDocumen;
707
+
708
+ var html = getDocumentElement(element);
709
+ var winScroll = getWindowScroll(element);
710
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
711
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
712
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
713
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
714
+ var y = -winScroll.scrollTop;
715
+
716
+ if (getComputedStyle(body || html).direction === 'rtl') {
717
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
718
+ }
719
+
720
+ return {
721
+ width: width,
722
+ height: height,
723
+ x: x,
724
+ y: y
725
+ };
726
+ }
727
+
728
+ function isScrollParent(element) {
729
+ // Firefox wants us to check `-x` and `-y` variations as well
730
+ var _getComputedStyle = getComputedStyle(element),
731
+ overflow = _getComputedStyle.overflow,
732
+ overflowX = _getComputedStyle.overflowX,
733
+ overflowY = _getComputedStyle.overflowY;
734
+
735
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
736
+ }
737
+
738
+ function getScrollParent(node) {
739
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
740
+ // $FlowFixMe[incompatible-return]: assume body is always available
741
+ return node.ownerDocument.body;
742
+ }
743
+
744
+ if (isHTMLElement(node) && isScrollParent(node)) {
745
+ return node;
746
+ }
747
+
748
+ return getScrollParent(getParentNode(node));
749
+ }
750
+
751
+ /*
752
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
753
+ until we get to the top window object. This list is what we attach scroll listeners
754
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
755
+ reference element's position.
756
+ */
757
+
758
+ function listScrollParents(element, list) {
759
+ var _element$ownerDocumen;
760
+
761
+ if (list === void 0) {
762
+ list = [];
763
+ }
764
+
765
+ var scrollParent = getScrollParent(element);
766
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
767
+ var win = getWindow(scrollParent);
768
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
769
+ var updatedList = list.concat(target);
770
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
771
+ updatedList.concat(listScrollParents(getParentNode(target)));
772
+ }
773
+
774
+ function rectToClientRect(rect) {
775
+ return Object.assign({}, rect, {
776
+ left: rect.x,
777
+ top: rect.y,
778
+ right: rect.x + rect.width,
779
+ bottom: rect.y + rect.height
780
+ });
781
+ }
782
+
783
+ function getInnerBoundingClientRect(element) {
784
+ var rect = getBoundingClientRect(element);
785
+ rect.top = rect.top + element.clientTop;
786
+ rect.left = rect.left + element.clientLeft;
787
+ rect.bottom = rect.top + element.clientHeight;
788
+ rect.right = rect.left + element.clientWidth;
789
+ rect.width = element.clientWidth;
790
+ rect.height = element.clientHeight;
791
+ rect.x = rect.left;
792
+ rect.y = rect.top;
793
+ return rect;
794
+ }
795
+
796
+ function getClientRectFromMixedType(element, clippingParent) {
797
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
798
+ } // A "clipping parent" is an overflowable container with the characteristic of
799
+ // clipping (or hiding) overflowing elements with a position different from
800
+ // `initial`
801
+
802
+
803
+ function getClippingParents(element) {
804
+ var clippingParents = listScrollParents(getParentNode(element));
805
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
806
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
807
+
808
+ if (!isElement(clipperElement)) {
809
+ return [];
810
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
811
+
812
+
813
+ return clippingParents.filter(function (clippingParent) {
814
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
815
+ });
816
+ } // Gets the maximum area that the element is visible in due to any number of
817
+ // clipping parents
818
+
819
+
820
+ function getClippingRect(element, boundary, rootBoundary) {
821
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
822
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
823
+ var firstClippingParent = clippingParents[0];
824
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
825
+ var rect = getClientRectFromMixedType(element, clippingParent);
826
+ accRect.top = max(rect.top, accRect.top);
827
+ accRect.right = min(rect.right, accRect.right);
828
+ accRect.bottom = min(rect.bottom, accRect.bottom);
829
+ accRect.left = max(rect.left, accRect.left);
830
+ return accRect;
831
+ }, getClientRectFromMixedType(element, firstClippingParent));
832
+ clippingRect.width = clippingRect.right - clippingRect.left;
833
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
834
+ clippingRect.x = clippingRect.left;
835
+ clippingRect.y = clippingRect.top;
836
+ return clippingRect;
837
+ }
838
+
839
+ function getVariation(placement) {
840
+ return placement.split('-')[1];
841
+ }
842
+
843
+ function computeOffsets(_ref) {
844
+ var reference = _ref.reference,
845
+ element = _ref.element,
846
+ placement = _ref.placement;
847
+ var basePlacement = placement ? getBasePlacement(placement) : null;
848
+ var variation = placement ? getVariation(placement) : null;
849
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
850
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
851
+ var offsets;
852
+
853
+ switch (basePlacement) {
854
+ case top:
855
+ offsets = {
856
+ x: commonX,
857
+ y: reference.y - element.height
858
+ };
859
+ break;
860
+
861
+ case bottom:
862
+ offsets = {
863
+ x: commonX,
864
+ y: reference.y + reference.height
865
+ };
866
+ break;
867
+
868
+ case right:
869
+ offsets = {
870
+ x: reference.x + reference.width,
871
+ y: commonY
872
+ };
873
+ break;
874
+
875
+ case left:
876
+ offsets = {
877
+ x: reference.x - element.width,
878
+ y: commonY
879
+ };
880
+ break;
881
+
882
+ default:
883
+ offsets = {
884
+ x: reference.x,
885
+ y: reference.y
886
+ };
887
+ }
888
+
889
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
890
+
891
+ if (mainAxis != null) {
892
+ var len = mainAxis === 'y' ? 'height' : 'width';
893
+
894
+ switch (variation) {
895
+ case start:
896
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
897
+ break;
898
+
899
+ case end:
900
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
901
+ break;
902
+ }
903
+ }
904
+
905
+ return offsets;
906
+ }
907
+
908
+ function detectOverflow(state, options) {
909
+ if (options === void 0) {
910
+ options = {};
911
+ }
912
+
913
+ var _options = options,
914
+ _options$placement = _options.placement,
915
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
916
+ _options$boundary = _options.boundary,
917
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
918
+ _options$rootBoundary = _options.rootBoundary,
919
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
920
+ _options$elementConte = _options.elementContext,
921
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
922
+ _options$altBoundary = _options.altBoundary,
923
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
924
+ _options$padding = _options.padding,
925
+ padding = _options$padding === void 0 ? 0 : _options$padding;
926
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
927
+ var altContext = elementContext === popper ? reference : popper;
928
+ var referenceElement = state.elements.reference;
929
+ var popperRect = state.rects.popper;
930
+ var element = state.elements[altBoundary ? altContext : elementContext];
931
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
932
+ var referenceClientRect = getBoundingClientRect(referenceElement);
933
+ var popperOffsets = computeOffsets({
934
+ reference: referenceClientRect,
935
+ element: popperRect,
936
+ strategy: 'absolute',
937
+ placement: placement
938
+ });
939
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
940
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
941
+ // 0 or negative = within the clipping rect
942
+
943
+ var overflowOffsets = {
944
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
945
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
946
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
947
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
948
+ };
949
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
950
+
951
+ if (elementContext === popper && offsetData) {
952
+ var offset = offsetData[placement];
953
+ Object.keys(overflowOffsets).forEach(function (key) {
954
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
955
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
956
+ overflowOffsets[key] += offset[axis] * multiply;
957
+ });
958
+ }
959
+
960
+ return overflowOffsets;
961
+ }
962
+
963
+ function computeAutoPlacement(state, options) {
964
+ if (options === void 0) {
965
+ options = {};
966
+ }
967
+
968
+ var _options = options,
969
+ placement = _options.placement,
970
+ boundary = _options.boundary,
971
+ rootBoundary = _options.rootBoundary,
972
+ padding = _options.padding,
973
+ flipVariations = _options.flipVariations,
974
+ _options$allowedAutoP = _options.allowedAutoPlacements,
975
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
976
+ var variation = getVariation(placement);
977
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
978
+ return getVariation(placement) === variation;
979
+ }) : basePlacements;
980
+ var allowedPlacements = placements$1.filter(function (placement) {
981
+ return allowedAutoPlacements.indexOf(placement) >= 0;
982
+ });
983
+
984
+ if (allowedPlacements.length === 0) {
985
+ allowedPlacements = placements$1;
986
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
987
+
988
+
989
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
990
+ acc[placement] = detectOverflow(state, {
991
+ placement: placement,
992
+ boundary: boundary,
993
+ rootBoundary: rootBoundary,
994
+ padding: padding
995
+ })[getBasePlacement(placement)];
996
+ return acc;
997
+ }, {});
998
+ return Object.keys(overflows).sort(function (a, b) {
999
+ return overflows[a] - overflows[b];
1000
+ });
1001
+ }
1002
+
1003
+ function getExpandedFallbackPlacements(placement) {
1004
+ if (getBasePlacement(placement) === auto) {
1005
+ return [];
1006
+ }
1007
+
1008
+ var oppositePlacement = getOppositePlacement(placement);
1009
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1010
+ }
1011
+
1012
+ function flip(_ref) {
1013
+ var state = _ref.state,
1014
+ options = _ref.options,
1015
+ name = _ref.name;
1016
+
1017
+ if (state.modifiersData[name]._skip) {
1018
+ return;
1019
+ }
1020
+
1021
+ var _options$mainAxis = options.mainAxis,
1022
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1023
+ _options$altAxis = options.altAxis,
1024
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1025
+ specifiedFallbackPlacements = options.fallbackPlacements,
1026
+ padding = options.padding,
1027
+ boundary = options.boundary,
1028
+ rootBoundary = options.rootBoundary,
1029
+ altBoundary = options.altBoundary,
1030
+ _options$flipVariatio = options.flipVariations,
1031
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1032
+ allowedAutoPlacements = options.allowedAutoPlacements;
1033
+ var preferredPlacement = state.options.placement;
1034
+ var basePlacement = getBasePlacement(preferredPlacement);
1035
+ var isBasePlacement = basePlacement === preferredPlacement;
1036
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1037
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1038
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1039
+ placement: placement,
1040
+ boundary: boundary,
1041
+ rootBoundary: rootBoundary,
1042
+ padding: padding,
1043
+ flipVariations: flipVariations,
1044
+ allowedAutoPlacements: allowedAutoPlacements
1045
+ }) : placement);
1046
+ }, []);
1047
+ var referenceRect = state.rects.reference;
1048
+ var popperRect = state.rects.popper;
1049
+ var checksMap = new Map();
1050
+ var makeFallbackChecks = true;
1051
+ var firstFittingPlacement = placements[0];
1052
+
1053
+ for (var i = 0; i < placements.length; i++) {
1054
+ var placement = placements[i];
1055
+
1056
+ var _basePlacement = getBasePlacement(placement);
1057
+
1058
+ var isStartVariation = getVariation(placement) === start;
1059
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1060
+ var len = isVertical ? 'width' : 'height';
1061
+ var overflow = detectOverflow(state, {
1062
+ placement: placement,
1063
+ boundary: boundary,
1064
+ rootBoundary: rootBoundary,
1065
+ altBoundary: altBoundary,
1066
+ padding: padding
1067
+ });
1068
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1069
+
1070
+ if (referenceRect[len] > popperRect[len]) {
1071
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1072
+ }
1073
+
1074
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1075
+ var checks = [];
1076
+
1077
+ if (checkMainAxis) {
1078
+ checks.push(overflow[_basePlacement] <= 0);
1079
+ }
1080
+
1081
+ if (checkAltAxis) {
1082
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1083
+ }
1084
+
1085
+ if (checks.every(function (check) {
1086
+ return check;
1087
+ })) {
1088
+ firstFittingPlacement = placement;
1089
+ makeFallbackChecks = false;
1090
+ break;
1091
+ }
1092
+
1093
+ checksMap.set(placement, checks);
1094
+ }
1095
+
1096
+ if (makeFallbackChecks) {
1097
+ // `2` may be desired in some cases – research later
1098
+ var numberOfChecks = flipVariations ? 3 : 1;
1099
+
1100
+ var _loop = function _loop(_i) {
1101
+ var fittingPlacement = placements.find(function (placement) {
1102
+ var checks = checksMap.get(placement);
1103
+
1104
+ if (checks) {
1105
+ return checks.slice(0, _i).every(function (check) {
1106
+ return check;
1107
+ });
1108
+ }
1109
+ });
1110
+
1111
+ if (fittingPlacement) {
1112
+ firstFittingPlacement = fittingPlacement;
1113
+ return "break";
1114
+ }
1115
+ };
1116
+
1117
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1118
+ var _ret = _loop(_i);
1119
+
1120
+ if (_ret === "break") break;
1121
+ }
1122
+ }
1123
+
1124
+ if (state.placement !== firstFittingPlacement) {
1125
+ state.modifiersData[name]._skip = true;
1126
+ state.placement = firstFittingPlacement;
1127
+ state.reset = true;
1128
+ }
1129
+ } // eslint-disable-next-line import/no-unused-modules
1130
+
1131
+
1132
+ const flip$1 = {
1133
+ name: 'flip',
1134
+ enabled: true,
1135
+ phase: 'main',
1136
+ fn: flip,
1137
+ requiresIfExists: ['offset'],
1138
+ data: {
1139
+ _skip: false
1140
+ }
1141
+ };
1142
+
1143
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1144
+ if (preventedOffsets === void 0) {
1145
+ preventedOffsets = {
1146
+ x: 0,
1147
+ y: 0
1148
+ };
1149
+ }
1150
+
1151
+ return {
1152
+ top: overflow.top - rect.height - preventedOffsets.y,
1153
+ right: overflow.right - rect.width + preventedOffsets.x,
1154
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1155
+ left: overflow.left - rect.width - preventedOffsets.x
1156
+ };
1157
+ }
1158
+
1159
+ function isAnySideFullyClipped(overflow) {
1160
+ return [top, right, bottom, left].some(function (side) {
1161
+ return overflow[side] >= 0;
1162
+ });
1163
+ }
1164
+
1165
+ function hide(_ref) {
1166
+ var state = _ref.state,
1167
+ name = _ref.name;
1168
+ var referenceRect = state.rects.reference;
1169
+ var popperRect = state.rects.popper;
1170
+ var preventedOffsets = state.modifiersData.preventOverflow;
1171
+ var referenceOverflow = detectOverflow(state, {
1172
+ elementContext: 'reference'
1173
+ });
1174
+ var popperAltOverflow = detectOverflow(state, {
1175
+ altBoundary: true
1176
+ });
1177
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1178
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1179
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1180
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1181
+ state.modifiersData[name] = {
1182
+ referenceClippingOffsets: referenceClippingOffsets,
1183
+ popperEscapeOffsets: popperEscapeOffsets,
1184
+ isReferenceHidden: isReferenceHidden,
1185
+ hasPopperEscaped: hasPopperEscaped
1186
+ };
1187
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1188
+ 'data-popper-reference-hidden': isReferenceHidden,
1189
+ 'data-popper-escaped': hasPopperEscaped
1190
+ });
1191
+ } // eslint-disable-next-line import/no-unused-modules
1192
+
1193
+
1194
+ const hide$1 = {
1195
+ name: 'hide',
1196
+ enabled: true,
1197
+ phase: 'main',
1198
+ requiresIfExists: ['preventOverflow'],
1199
+ fn: hide
1200
+ };
1201
+
1202
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1203
+ var basePlacement = getBasePlacement(placement);
1204
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1205
+
1206
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1207
+ placement: placement
1208
+ })) : offset,
1209
+ skidding = _ref[0],
1210
+ distance = _ref[1];
1211
+
1212
+ skidding = skidding || 0;
1213
+ distance = (distance || 0) * invertDistance;
1214
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1215
+ x: distance,
1216
+ y: skidding
1217
+ } : {
1218
+ x: skidding,
1219
+ y: distance
1220
+ };
1221
+ }
1222
+
1223
+ function offset(_ref2) {
1224
+ var state = _ref2.state,
1225
+ options = _ref2.options,
1226
+ name = _ref2.name;
1227
+ var _options$offset = options.offset,
1228
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1229
+ var data = placements.reduce(function (acc, placement) {
1230
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1231
+ return acc;
1232
+ }, {});
1233
+ var _data$state$placement = data[state.placement],
1234
+ x = _data$state$placement.x,
1235
+ y = _data$state$placement.y;
1236
+
1237
+ if (state.modifiersData.popperOffsets != null) {
1238
+ state.modifiersData.popperOffsets.x += x;
1239
+ state.modifiersData.popperOffsets.y += y;
1240
+ }
1241
+
1242
+ state.modifiersData[name] = data;
1243
+ } // eslint-disable-next-line import/no-unused-modules
1244
+
1245
+
1246
+ const offset$1 = {
1247
+ name: 'offset',
1248
+ enabled: true,
1249
+ phase: 'main',
1250
+ requires: ['popperOffsets'],
1251
+ fn: offset
1252
+ };
1253
+
1254
+ function popperOffsets(_ref) {
1255
+ var state = _ref.state,
1256
+ name = _ref.name;
1257
+ // Offsets are the actual position the popper needs to have to be
1258
+ // properly positioned near its reference element
1259
+ // This is the most basic placement, and will be adjusted by
1260
+ // the modifiers in the next step
1261
+ state.modifiersData[name] = computeOffsets({
1262
+ reference: state.rects.reference,
1263
+ element: state.rects.popper,
1264
+ strategy: 'absolute',
1265
+ placement: state.placement
1266
+ });
1267
+ } // eslint-disable-next-line import/no-unused-modules
1268
+
1269
+
1270
+ const popperOffsets$1 = {
1271
+ name: 'popperOffsets',
1272
+ enabled: true,
1273
+ phase: 'read',
1274
+ fn: popperOffsets,
1275
+ data: {}
1276
+ };
1277
+
1278
+ function getAltAxis(axis) {
1279
+ return axis === 'x' ? 'y' : 'x';
1280
+ }
1281
+
1282
+ function preventOverflow(_ref) {
1283
+ var state = _ref.state,
1284
+ options = _ref.options,
1285
+ name = _ref.name;
1286
+ var _options$mainAxis = options.mainAxis,
1287
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1288
+ _options$altAxis = options.altAxis,
1289
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1290
+ boundary = options.boundary,
1291
+ rootBoundary = options.rootBoundary,
1292
+ altBoundary = options.altBoundary,
1293
+ padding = options.padding,
1294
+ _options$tether = options.tether,
1295
+ tether = _options$tether === void 0 ? true : _options$tether,
1296
+ _options$tetherOffset = options.tetherOffset,
1297
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1298
+ var overflow = detectOverflow(state, {
1299
+ boundary: boundary,
1300
+ rootBoundary: rootBoundary,
1301
+ padding: padding,
1302
+ altBoundary: altBoundary
1303
+ });
1304
+ var basePlacement = getBasePlacement(state.placement);
1305
+ var variation = getVariation(state.placement);
1306
+ var isBasePlacement = !variation;
1307
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1308
+ var altAxis = getAltAxis(mainAxis);
1309
+ var popperOffsets = state.modifiersData.popperOffsets;
1310
+ var referenceRect = state.rects.reference;
1311
+ var popperRect = state.rects.popper;
1312
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1313
+ placement: state.placement
1314
+ })) : tetherOffset;
1315
+ var data = {
1316
+ x: 0,
1317
+ y: 0
1318
+ };
1319
+
1320
+ if (!popperOffsets) {
1321
+ return;
1322
+ }
1323
+
1324
+ if (checkMainAxis || checkAltAxis) {
1325
+ var mainSide = mainAxis === 'y' ? top : left;
1326
+ var altSide = mainAxis === 'y' ? bottom : right;
1327
+ var len = mainAxis === 'y' ? 'height' : 'width';
1328
+ var offset = popperOffsets[mainAxis];
1329
+ var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
1330
+ var max$1 = popperOffsets[mainAxis] - overflow[altSide];
1331
+ var additive = tether ? -popperRect[len] / 2 : 0;
1332
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1333
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1334
+ // outside the reference bounds
1335
+
1336
+ var arrowElement = state.elements.arrow;
1337
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1338
+ width: 0,
1339
+ height: 0
1340
+ };
1341
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1342
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1343
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1344
+ // to include its full size in the calculation. If the reference is small
1345
+ // and near the edge of a boundary, the popper can overflow even if the
1346
+ // reference is not overflowing as well (e.g. virtual elements with no
1347
+ // width or height)
1348
+
1349
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1350
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1351
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1352
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1353
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1354
+ var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1355
+ var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1356
+ var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1357
+
1358
+ if (checkMainAxis) {
1359
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1360
+ popperOffsets[mainAxis] = preventedOffset;
1361
+ data[mainAxis] = preventedOffset - offset;
1362
+ }
1363
+
1364
+ if (checkAltAxis) {
1365
+ var _mainSide = mainAxis === 'x' ? top : left;
1366
+
1367
+ var _altSide = mainAxis === 'x' ? bottom : right;
1368
+
1369
+ var _offset = popperOffsets[altAxis];
1370
+
1371
+ var _min = _offset + overflow[_mainSide];
1372
+
1373
+ var _max = _offset - overflow[_altSide];
1374
+
1375
+ var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
1376
+
1377
+ popperOffsets[altAxis] = _preventedOffset;
1378
+ data[altAxis] = _preventedOffset - _offset;
1379
+ }
1380
+ }
1381
+
1382
+ state.modifiersData[name] = data;
1383
+ } // eslint-disable-next-line import/no-unused-modules
1384
+
1385
+
1386
+ const preventOverflow$1 = {
1387
+ name: 'preventOverflow',
1388
+ enabled: true,
1389
+ phase: 'main',
1390
+ fn: preventOverflow,
1391
+ requiresIfExists: ['offset']
1392
+ };
1393
+
1394
+ function getHTMLElementScroll(element) {
1395
+ return {
1396
+ scrollLeft: element.scrollLeft,
1397
+ scrollTop: element.scrollTop
1398
+ };
1399
+ }
1400
+
1401
+ function getNodeScroll(node) {
1402
+ if (node === getWindow(node) || !isHTMLElement(node)) {
1403
+ return getWindowScroll(node);
1404
+ } else {
1405
+ return getHTMLElementScroll(node);
1406
+ }
1407
+ }
1408
+
1409
+ function isElementScaled(element) {
1410
+ var rect = element.getBoundingClientRect();
1411
+ var scaleX = rect.width / element.offsetWidth || 1;
1412
+ var scaleY = rect.height / element.offsetHeight || 1;
1413
+ return scaleX !== 1 || scaleY !== 1;
1414
+ } // Returns the composite rect of an element relative to its offsetParent.
1415
+ // Composite means it takes into account transforms as well as layout.
1416
+
1417
+
1418
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1419
+ if (isFixed === void 0) {
1420
+ isFixed = false;
1421
+ }
1422
+
1423
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
1424
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1425
+ var documentElement = getDocumentElement(offsetParent);
1426
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1427
+ var scroll = {
1428
+ scrollLeft: 0,
1429
+ scrollTop: 0
1430
+ };
1431
+ var offsets = {
1432
+ x: 0,
1433
+ y: 0
1434
+ };
1435
+
1436
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1437
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1438
+ isScrollParent(documentElement)) {
1439
+ scroll = getNodeScroll(offsetParent);
1440
+ }
1441
+
1442
+ if (isHTMLElement(offsetParent)) {
1443
+ offsets = getBoundingClientRect(offsetParent, true);
1444
+ offsets.x += offsetParent.clientLeft;
1445
+ offsets.y += offsetParent.clientTop;
1446
+ } else if (documentElement) {
1447
+ offsets.x = getWindowScrollBarX(documentElement);
1448
+ }
1449
+ }
1450
+
1451
+ return {
1452
+ x: rect.left + scroll.scrollLeft - offsets.x,
1453
+ y: rect.top + scroll.scrollTop - offsets.y,
1454
+ width: rect.width,
1455
+ height: rect.height
1456
+ };
1457
+ }
1458
+
1459
+ function order(modifiers) {
1460
+ var map = new Map();
1461
+ var visited = new Set();
1462
+ var result = [];
1463
+ modifiers.forEach(function (modifier) {
1464
+ map.set(modifier.name, modifier);
1465
+ }); // On visiting object, check for its dependencies and visit them recursively
1466
+
1467
+ function sort(modifier) {
1468
+ visited.add(modifier.name);
1469
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1470
+ requires.forEach(function (dep) {
1471
+ if (!visited.has(dep)) {
1472
+ var depModifier = map.get(dep);
1473
+
1474
+ if (depModifier) {
1475
+ sort(depModifier);
1476
+ }
1477
+ }
1478
+ });
1479
+ result.push(modifier);
1480
+ }
1481
+
1482
+ modifiers.forEach(function (modifier) {
1483
+ if (!visited.has(modifier.name)) {
1484
+ // check for visited object
1485
+ sort(modifier);
1486
+ }
1487
+ });
1488
+ return result;
1489
+ }
1490
+
1491
+ function orderModifiers(modifiers) {
1492
+ // order based on dependencies
1493
+ var orderedModifiers = order(modifiers); // order based on phase
1494
+
1495
+ return modifierPhases.reduce(function (acc, phase) {
1496
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1497
+ return modifier.phase === phase;
1498
+ }));
1499
+ }, []);
1500
+ }
1501
+
1502
+ function debounce(fn) {
1503
+ var pending;
1504
+ return function () {
1505
+ if (!pending) {
1506
+ pending = new Promise(function (resolve) {
1507
+ Promise.resolve().then(function () {
1508
+ pending = undefined;
1509
+ resolve(fn());
1510
+ });
1511
+ });
1512
+ }
1513
+
1514
+ return pending;
1515
+ };
1516
+ }
1517
+
1518
+ function mergeByName(modifiers) {
1519
+ var merged = modifiers.reduce(function (merged, current) {
1520
+ var existing = merged[current.name];
1521
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1522
+ options: Object.assign({}, existing.options, current.options),
1523
+ data: Object.assign({}, existing.data, current.data)
1524
+ }) : current;
1525
+ return merged;
1526
+ }, {}); // IE11 does not support Object.values
1527
+
1528
+ return Object.keys(merged).map(function (key) {
1529
+ return merged[key];
1530
+ });
1531
+ }
1532
+
1533
+ var DEFAULT_OPTIONS = {
1534
+ placement: 'bottom',
1535
+ modifiers: [],
1536
+ strategy: 'absolute'
1537
+ };
1538
+
1539
+ function areValidElements() {
1540
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1541
+ args[_key] = arguments[_key];
1542
+ }
1543
+
1544
+ return !args.some(function (element) {
1545
+ return !(element && typeof element.getBoundingClientRect === 'function');
1546
+ });
1547
+ }
1548
+
1549
+ function popperGenerator(generatorOptions) {
1550
+ if (generatorOptions === void 0) {
1551
+ generatorOptions = {};
1552
+ }
1553
+
1554
+ var _generatorOptions = generatorOptions,
1555
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1556
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1557
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1558
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1559
+ return function createPopper(reference, popper, options) {
1560
+ if (options === void 0) {
1561
+ options = defaultOptions;
1562
+ }
1563
+
1564
+ var state = {
1565
+ placement: 'bottom',
1566
+ orderedModifiers: [],
1567
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1568
+ modifiersData: {},
1569
+ elements: {
1570
+ reference: reference,
1571
+ popper: popper
1572
+ },
1573
+ attributes: {},
1574
+ styles: {}
1575
+ };
1576
+ var effectCleanupFns = [];
1577
+ var isDestroyed = false;
1578
+ var instance = {
1579
+ state: state,
1580
+ setOptions: function setOptions(options) {
1581
+ cleanupModifierEffects();
1582
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1583
+ state.scrollParents = {
1584
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1585
+ popper: listScrollParents(popper)
1586
+ }; // Orders the modifiers based on their dependencies and `phase`
1587
+ // properties
1588
+
1589
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1590
+
1591
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1592
+ return m.enabled;
1593
+ }); // Validate the provided modifiers so that the consumer will get warned
1594
+
1595
+ runModifierEffects();
1596
+ return instance.update();
1597
+ },
1598
+ // Sync update – it will always be executed, even if not necessary. This
1599
+ // is useful for low frequency updates where sync behavior simplifies the
1600
+ // logic.
1601
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1602
+ // prefer the async Popper#update method
1603
+ forceUpdate: function forceUpdate() {
1604
+ if (isDestroyed) {
1605
+ return;
1606
+ }
1607
+
1608
+ var _state$elements = state.elements,
1609
+ reference = _state$elements.reference,
1610
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1611
+ // anymore
1612
+
1613
+ if (!areValidElements(reference, popper)) {
1614
+
1615
+ return;
1616
+ } // Store the reference and popper rects to be read by modifiers
1617
+
1618
+
1619
+ state.rects = {
1620
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1621
+ popper: getLayoutRect(popper)
1622
+ }; // Modifiers have the ability to reset the current update cycle. The
1623
+ // most common use case for this is the `flip` modifier changing the
1624
+ // placement, which then needs to re-run all the modifiers, because the
1625
+ // logic was previously ran for the previous placement and is therefore
1626
+ // stale/incorrect
1627
+
1628
+ state.reset = false;
1629
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1630
+ // is filled with the initial data specified by the modifier. This means
1631
+ // it doesn't persist and is fresh on each update.
1632
+ // To ensure persistent data, use `${name}#persistent`
1633
+
1634
+ state.orderedModifiers.forEach(function (modifier) {
1635
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1636
+ });
1637
+
1638
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1639
+
1640
+ if (state.reset === true) {
1641
+ state.reset = false;
1642
+ index = -1;
1643
+ continue;
1644
+ }
1645
+
1646
+ var _state$orderedModifie = state.orderedModifiers[index],
1647
+ fn = _state$orderedModifie.fn,
1648
+ _state$orderedModifie2 = _state$orderedModifie.options,
1649
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1650
+ name = _state$orderedModifie.name;
1651
+
1652
+ if (typeof fn === 'function') {
1653
+ state = fn({
1654
+ state: state,
1655
+ options: _options,
1656
+ name: name,
1657
+ instance: instance
1658
+ }) || state;
1659
+ }
1660
+ }
1661
+ },
1662
+ // Async and optimistically optimized update – it will not be executed if
1663
+ // not necessary (debounced to run at most once-per-tick)
1664
+ update: debounce(function () {
1665
+ return new Promise(function (resolve) {
1666
+ instance.forceUpdate();
1667
+ resolve(state);
1668
+ });
1669
+ }),
1670
+ destroy: function destroy() {
1671
+ cleanupModifierEffects();
1672
+ isDestroyed = true;
1673
+ }
1674
+ };
1675
+
1676
+ if (!areValidElements(reference, popper)) {
1677
+
1678
+ return instance;
1679
+ }
1680
+
1681
+ instance.setOptions(options).then(function (state) {
1682
+ if (!isDestroyed && options.onFirstUpdate) {
1683
+ options.onFirstUpdate(state);
1684
+ }
1685
+ }); // Modifiers have the ability to execute arbitrary code before the first
1686
+ // update cycle runs. They will be executed in the same order as the update
1687
+ // cycle. This is useful when a modifier adds some persistent data that
1688
+ // other modifiers need to use, but the modifier is run after the dependent
1689
+ // one.
1690
+
1691
+ function runModifierEffects() {
1692
+ state.orderedModifiers.forEach(function (_ref3) {
1693
+ var name = _ref3.name,
1694
+ _ref3$options = _ref3.options,
1695
+ options = _ref3$options === void 0 ? {} : _ref3$options,
1696
+ effect = _ref3.effect;
1697
+
1698
+ if (typeof effect === 'function') {
1699
+ var cleanupFn = effect({
1700
+ state: state,
1701
+ name: name,
1702
+ instance: instance,
1703
+ options: options
1704
+ });
1705
+
1706
+ var noopFn = function noopFn() {};
1707
+
1708
+ effectCleanupFns.push(cleanupFn || noopFn);
1709
+ }
1710
+ });
1711
+ }
1712
+
1713
+ function cleanupModifierEffects() {
1714
+ effectCleanupFns.forEach(function (fn) {
1715
+ return fn();
1716
+ });
1717
+ effectCleanupFns = [];
1718
+ }
1719
+
1720
+ return instance;
1721
+ };
1722
+ }
1723
+
1724
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1725
+ var createPopper = /*#__PURE__*/popperGenerator({
1726
+ defaultModifiers: defaultModifiers
1727
+ }); // eslint-disable-next-line import/no-unused-modules
1728
+
1729
+ export { createPopper as c };