@verdocs/web-sdk 1.0.15 → 1.0.19

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 (160) hide show
  1. package/dist/cjs/{Content-986f7a13.js → Content-1d98b2f3.js} +297 -17
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/css-shim-88cc6900.js +6 -0
  4. package/dist/cjs/document-status-indicator.cjs.entry.js +1 -1
  5. package/dist/cjs/dom-95afd968.js +75 -0
  6. package/dist/cjs/dropdown-menu.cjs.entry.js +191 -4
  7. package/dist/cjs/index-0b9c3c7d.js +3064 -0
  8. package/dist/cjs/loader.cjs.js +19 -3
  9. package/dist/cjs/org-popup.cjs.entry.js +1 -1
  10. package/dist/cjs/pdf-viewer.cjs.entry.js +87 -6
  11. package/dist/cjs/search-box.cjs.entry.js +19 -7
  12. package/dist/cjs/search-embed.cjs.entry.js +1 -1
  13. package/dist/cjs/search-quick-functions.cjs.entry.js +1 -1
  14. package/dist/cjs/search-recent.cjs.entry.js +2 -2
  15. package/dist/cjs/search-saved.cjs.entry.js +2 -2
  16. package/dist/cjs/search-starred.cjs.entry.js +1 -1
  17. package/dist/cjs/search-tabs.cjs.entry.js +1 -1
  18. package/dist/cjs/shadow-css-71d0f821.js +391 -0
  19. package/dist/cjs/tags-indicator.cjs.entry.js +1 -1
  20. package/dist/cjs/template-card.cjs.entry.js +1 -1
  21. package/dist/cjs/toggle-icon-buttons.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-web-sdk.cjs.js +113 -5
  23. package/dist/collection/collection-manifest.json +2 -2
  24. package/dist/collection/components/elements/search-box/search-box.css +4 -0
  25. package/dist/collection/components/elements/search-box/search-box.js +73 -14
  26. package/dist/collection/components/elements/search-box/search-box.stories.js +3 -1
  27. package/dist/custom-elements/index.js +597 -34
  28. package/dist/docs.json +40 -5
  29. package/dist/esm/{Content-386637c8.js → Content-0d614ff3.js} +297 -17
  30. package/dist/esm/app-globals-0f993ce5.js +3 -0
  31. package/dist/esm/css-shim-c64026cd.js +4 -0
  32. package/dist/esm/document-status-indicator.entry.js +1 -1
  33. package/dist/esm/dom-a712b575.js +73 -0
  34. package/dist/esm/dropdown-menu.entry.js +191 -4
  35. package/dist/esm/index-81ec66c1.js +3027 -0
  36. package/dist/esm/loader.js +19 -3
  37. package/dist/esm/org-popup.entry.js +1 -1
  38. package/dist/esm/pdf-viewer.entry.js +87 -6
  39. package/dist/esm/search-box.entry.js +19 -7
  40. package/dist/esm/search-embed.entry.js +1 -1
  41. package/dist/esm/search-quick-functions.entry.js +1 -1
  42. package/dist/esm/search-recent.entry.js +2 -2
  43. package/dist/esm/search-saved.entry.js +2 -2
  44. package/dist/esm/search-starred.entry.js +1 -1
  45. package/dist/esm/search-tabs.entry.js +1 -1
  46. package/dist/esm/shadow-css-1e16431b.js +389 -0
  47. package/dist/esm/tags-indicator.entry.js +1 -1
  48. package/dist/esm/template-card.entry.js +1 -1
  49. package/dist/esm/toggle-icon-buttons.entry.js +1 -1
  50. package/dist/esm/verdocs-web-sdk.js +113 -5
  51. package/dist/esm-es5/Content-0d614ff3.js +1 -0
  52. package/dist/esm-es5/app-globals-0f993ce5.js +1 -0
  53. package/dist/esm-es5/css-shim-c64026cd.js +1 -0
  54. package/dist/esm-es5/document-status-indicator.entry.js +1 -1
  55. package/dist/esm-es5/dom-a712b575.js +21 -0
  56. package/dist/esm-es5/dropdown-menu.entry.js +1 -1
  57. package/dist/esm-es5/index-81ec66c1.js +1 -0
  58. package/dist/esm-es5/loader.js +1 -1
  59. package/dist/esm-es5/org-popup.entry.js +1 -1
  60. package/dist/esm-es5/pdf-viewer.entry.js +2 -2
  61. package/dist/esm-es5/search-box.entry.js +1 -1
  62. package/dist/esm-es5/search-embed.entry.js +1 -1
  63. package/dist/esm-es5/search-quick-functions.entry.js +1 -1
  64. package/dist/esm-es5/search-recent.entry.js +1 -1
  65. package/dist/esm-es5/search-saved.entry.js +1 -1
  66. package/dist/esm-es5/search-starred.entry.js +1 -1
  67. package/dist/esm-es5/search-tabs.entry.js +1 -1
  68. package/dist/esm-es5/shadow-css-1e16431b.js +12 -0
  69. package/dist/esm-es5/tags-indicator.entry.js +1 -1
  70. package/dist/esm-es5/template-card.entry.js +1 -1
  71. package/dist/esm-es5/toggle-icon-buttons.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  73. package/dist/types/components/elements/search-box/search-box.d.ts +20 -5
  74. package/dist/types/components/elements/search-box/search-box.stories.d.ts +3 -1
  75. package/dist/types/components.d.ts +23 -1
  76. package/dist/verdocs-web-sdk/Content-0d614ff3.js +2175 -0
  77. package/dist/verdocs-web-sdk/Content-42ddf5ec.system.js +1 -0
  78. package/dist/verdocs-web-sdk/app-globals-0f993ce5.js +3 -0
  79. package/dist/verdocs-web-sdk/app-globals-497eb362.system.js +1 -0
  80. package/dist/verdocs-web-sdk/css-shim-0e9af51a.system.js +1 -0
  81. package/dist/verdocs-web-sdk/css-shim-c64026cd.js +4 -0
  82. package/dist/verdocs-web-sdk/document-status-indicator.entry.js +55 -0
  83. package/dist/verdocs-web-sdk/document-status-indicator.system.entry.js +1 -0
  84. package/dist/verdocs-web-sdk/dom-a712b575.js +73 -0
  85. package/dist/verdocs-web-sdk/dom-f6327147.system.js +21 -0
  86. package/dist/verdocs-web-sdk/dropdown-menu.entry.js +1990 -0
  87. package/dist/verdocs-web-sdk/dropdown-menu.system.entry.js +1 -0
  88. package/dist/verdocs-web-sdk/index-46cb292b.system.js +1 -0
  89. package/dist/verdocs-web-sdk/index-81ec66c1.js +3027 -0
  90. package/dist/verdocs-web-sdk/index.esm.js +1 -0
  91. package/dist/verdocs-web-sdk/{p-50ea2036.system.js → index.system.js} +0 -0
  92. package/dist/verdocs-web-sdk/org-popup.entry.js +21 -0
  93. package/dist/verdocs-web-sdk/org-popup.system.entry.js +1 -0
  94. package/dist/verdocs-web-sdk/pdf-viewer.entry.js +13754 -0
  95. package/dist/verdocs-web-sdk/pdf-viewer.system.entry.js +23 -0
  96. package/dist/verdocs-web-sdk/search-box.entry.js +46 -0
  97. package/dist/verdocs-web-sdk/search-box.system.entry.js +1 -0
  98. package/dist/verdocs-web-sdk/search-embed.entry.js +15 -0
  99. package/dist/verdocs-web-sdk/search-embed.system.entry.js +1 -0
  100. package/dist/verdocs-web-sdk/search-quick-functions.entry.js +27 -0
  101. package/dist/verdocs-web-sdk/search-quick-functions.system.entry.js +1 -0
  102. package/dist/verdocs-web-sdk/search-recent.entry.js +35 -0
  103. package/dist/verdocs-web-sdk/search-recent.system.entry.js +1 -0
  104. package/dist/verdocs-web-sdk/search-saved.entry.js +35 -0
  105. package/dist/verdocs-web-sdk/search-saved.system.entry.js +1 -0
  106. package/dist/verdocs-web-sdk/search-starred.entry.js +42 -0
  107. package/dist/verdocs-web-sdk/search-starred.system.entry.js +1 -0
  108. package/dist/verdocs-web-sdk/search-tabs.entry.js +16 -0
  109. package/dist/verdocs-web-sdk/search-tabs.system.entry.js +1 -0
  110. package/dist/verdocs-web-sdk/shadow-css-1e16431b.js +389 -0
  111. package/dist/verdocs-web-sdk/shadow-css-ef154fe4.system.js +13 -0
  112. package/dist/verdocs-web-sdk/tags-indicator.entry.js +16 -0
  113. package/dist/verdocs-web-sdk/tags-indicator.system.entry.js +1 -0
  114. package/dist/verdocs-web-sdk/template-card.entry.js +24 -0
  115. package/dist/verdocs-web-sdk/template-card.system.entry.js +1 -0
  116. package/dist/verdocs-web-sdk/toggle-icon-buttons.entry.js +28 -0
  117. package/dist/verdocs-web-sdk/toggle-icon-buttons.system.entry.js +1 -0
  118. package/dist/verdocs-web-sdk/verdocs-web-sdk.css +12 -1
  119. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +125 -1
  120. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  121. package/dist/verdocs-web-sdk/verdocs-web-sdk.system.js +1 -0
  122. package/package.json +5 -5
  123. package/dist/cjs/index-e2fb537e.js +0 -1631
  124. package/dist/custom-elements.json +0 -266
  125. package/dist/esm/index-183a8995.js +0 -1602
  126. package/dist/esm-es5/Content-386637c8.js +0 -1
  127. package/dist/esm-es5/index-183a8995.js +0 -1
  128. package/dist/verdocs-web-sdk/p-153879ad.entry.js +0 -1
  129. package/dist/verdocs-web-sdk/p-1d1bc463.system.entry.js +0 -1
  130. package/dist/verdocs-web-sdk/p-29cb7cbc.entry.js +0 -1
  131. package/dist/verdocs-web-sdk/p-2cec77cf.entry.js +0 -1
  132. package/dist/verdocs-web-sdk/p-32a5788a.entry.js +0 -1
  133. package/dist/verdocs-web-sdk/p-33f73371.system.js +0 -1
  134. package/dist/verdocs-web-sdk/p-349248f0.system.entry.js +0 -1
  135. package/dist/verdocs-web-sdk/p-36082c90.entry.js +0 -1
  136. package/dist/verdocs-web-sdk/p-3a032151.entry.js +0 -1
  137. package/dist/verdocs-web-sdk/p-3cc8281f.system.entry.js +0 -1
  138. package/dist/verdocs-web-sdk/p-440d8a73.system.entry.js +0 -1
  139. package/dist/verdocs-web-sdk/p-4d4e090f.system.entry.js +0 -1
  140. package/dist/verdocs-web-sdk/p-55660c24.entry.js +0 -1
  141. package/dist/verdocs-web-sdk/p-63107dd5.system.entry.js +0 -1
  142. package/dist/verdocs-web-sdk/p-6b569aa1.system.entry.js +0 -1
  143. package/dist/verdocs-web-sdk/p-6e033b90.system.entry.js +0 -1
  144. package/dist/verdocs-web-sdk/p-6ee008ff.entry.js +0 -1
  145. package/dist/verdocs-web-sdk/p-7ab216be.system.entry.js +0 -1
  146. package/dist/verdocs-web-sdk/p-7d10b067.system.entry.js +0 -23
  147. package/dist/verdocs-web-sdk/p-89be87e5.js +0 -1
  148. package/dist/verdocs-web-sdk/p-92e7863c.system.entry.js +0 -1
  149. package/dist/verdocs-web-sdk/p-99ebfee7.system.entry.js +0 -1
  150. package/dist/verdocs-web-sdk/p-9af63b8a.system.js +0 -1
  151. package/dist/verdocs-web-sdk/p-9da35744.entry.js +0 -1
  152. package/dist/verdocs-web-sdk/p-b3d5601a.entry.js +0 -1
  153. package/dist/verdocs-web-sdk/p-b466e003.entry.js +0 -1
  154. package/dist/verdocs-web-sdk/p-bb99a203.entry.js +0 -1
  155. package/dist/verdocs-web-sdk/p-cbc784a6.system.js +0 -1
  156. package/dist/verdocs-web-sdk/p-cf030985.js +0 -1
  157. package/dist/verdocs-web-sdk/p-d73f486f.entry.js +0 -23
  158. package/dist/verdocs-web-sdk/p-dea09611.entry.js +0 -1
  159. package/dist/verdocs-web-sdk/p-e34538bd.system.entry.js +0 -1
  160. package/dist/verdocs-web-sdk/p-e59eda0c.system.entry.js +0 -1
@@ -0,0 +1,1990 @@
1
+ import { r as registerInstance, e as createEvent, h } from './index-81ec66c1.js';
2
+
3
+ var top = 'top';
4
+ var bottom = 'bottom';
5
+ var right = 'right';
6
+ var left = 'left';
7
+ var auto = 'auto';
8
+ var basePlacements = [top, bottom, right, left];
9
+ var start = 'start';
10
+ var end = 'end';
11
+ var clippingParents = 'clippingParents';
12
+ var viewport = 'viewport';
13
+ var popper = 'popper';
14
+ var reference = 'reference';
15
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
16
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
17
+ }, []);
18
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
19
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
20
+ }, []); // modifiers that need to read the DOM
21
+
22
+ var beforeRead = 'beforeRead';
23
+ var read = 'read';
24
+ var afterRead = 'afterRead'; // pure-logic modifiers
25
+
26
+ var beforeMain = 'beforeMain';
27
+ var main = 'main';
28
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
29
+
30
+ var beforeWrite = 'beforeWrite';
31
+ var write = 'write';
32
+ var afterWrite = 'afterWrite';
33
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
34
+
35
+ function getNodeName(element) {
36
+ return element ? (element.nodeName || '').toLowerCase() : null;
37
+ }
38
+
39
+ function getWindow(node) {
40
+ if (node == null) {
41
+ return window;
42
+ }
43
+
44
+ if (node.toString() !== '[object Window]') {
45
+ var ownerDocument = node.ownerDocument;
46
+ return ownerDocument ? ownerDocument.defaultView || window : window;
47
+ }
48
+
49
+ return node;
50
+ }
51
+
52
+ function isElement(node) {
53
+ var OwnElement = getWindow(node).Element;
54
+ return node instanceof OwnElement || node instanceof Element;
55
+ }
56
+
57
+ function isHTMLElement(node) {
58
+ var OwnElement = getWindow(node).HTMLElement;
59
+ return node instanceof OwnElement || node instanceof HTMLElement;
60
+ }
61
+
62
+ function isShadowRoot(node) {
63
+ // IE 11 has no ShadowRoot
64
+ if (typeof ShadowRoot === 'undefined') {
65
+ return false;
66
+ }
67
+
68
+ var OwnElement = getWindow(node).ShadowRoot;
69
+ return node instanceof OwnElement || node instanceof ShadowRoot;
70
+ }
71
+
72
+ // and applies them to the HTMLElements such as popper and arrow
73
+
74
+ function applyStyles(_ref) {
75
+ var state = _ref.state;
76
+ Object.keys(state.elements).forEach(function (name) {
77
+ var style = state.styles[name] || {};
78
+ var attributes = state.attributes[name] || {};
79
+ var element = state.elements[name]; // arrow is optional + virtual elements
80
+
81
+ if (!isHTMLElement(element) || !getNodeName(element)) {
82
+ return;
83
+ } // Flow doesn't support to extend this property, but it's the most
84
+ // effective way to apply styles to an HTMLElement
85
+ // $FlowFixMe[cannot-write]
86
+
87
+
88
+ Object.assign(element.style, style);
89
+ Object.keys(attributes).forEach(function (name) {
90
+ var value = attributes[name];
91
+
92
+ if (value === false) {
93
+ element.removeAttribute(name);
94
+ } else {
95
+ element.setAttribute(name, value === true ? '' : value);
96
+ }
97
+ });
98
+ });
99
+ }
100
+
101
+ function effect$2(_ref2) {
102
+ var state = _ref2.state;
103
+ var initialStyles = {
104
+ popper: {
105
+ position: state.options.strategy,
106
+ left: '0',
107
+ top: '0',
108
+ margin: '0'
109
+ },
110
+ arrow: {
111
+ position: 'absolute'
112
+ },
113
+ reference: {}
114
+ };
115
+ Object.assign(state.elements.popper.style, initialStyles.popper);
116
+ state.styles = initialStyles;
117
+
118
+ if (state.elements.arrow) {
119
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
120
+ }
121
+
122
+ return function () {
123
+ Object.keys(state.elements).forEach(function (name) {
124
+ var element = state.elements[name];
125
+ var attributes = state.attributes[name] || {};
126
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
127
+
128
+ var style = styleProperties.reduce(function (style, property) {
129
+ style[property] = '';
130
+ return style;
131
+ }, {}); // arrow is optional + virtual elements
132
+
133
+ if (!isHTMLElement(element) || !getNodeName(element)) {
134
+ return;
135
+ }
136
+
137
+ Object.assign(element.style, style);
138
+ Object.keys(attributes).forEach(function (attribute) {
139
+ element.removeAttribute(attribute);
140
+ });
141
+ });
142
+ };
143
+ } // eslint-disable-next-line import/no-unused-modules
144
+
145
+
146
+ const applyStyles$1 = {
147
+ name: 'applyStyles',
148
+ enabled: true,
149
+ phase: 'write',
150
+ fn: applyStyles,
151
+ effect: effect$2,
152
+ requires: ['computeStyles']
153
+ };
154
+
155
+ function getBasePlacement(placement) {
156
+ return placement.split('-')[0];
157
+ }
158
+
159
+ // import { isHTMLElement } from './instanceOf';
160
+ function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
161
+ includeScale) {
162
+ if (includeScale === void 0) {
163
+ includeScale = false;
164
+ }
165
+
166
+ var rect = element.getBoundingClientRect();
167
+ var scaleX = 1;
168
+ var scaleY = 1; // FIXME:
169
+ // `offsetWidth` returns an integer while `getBoundingClientRect`
170
+ // returns a float. This results in `scaleX` or `scaleY` being
171
+ // non-1 when it should be for elements that aren't a full pixel in
172
+ // width or height.
173
+ // if (isHTMLElement(element) && includeScale) {
174
+ // const offsetHeight = element.offsetHeight;
175
+ // const offsetWidth = element.offsetWidth;
176
+ // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
177
+ // // Fallback to 1 in case both values are `0`
178
+ // if (offsetWidth > 0) {
179
+ // scaleX = rect.width / offsetWidth || 1;
180
+ // }
181
+ // if (offsetHeight > 0) {
182
+ // scaleY = rect.height / offsetHeight || 1;
183
+ // }
184
+ // }
185
+
186
+ return {
187
+ width: rect.width / scaleX,
188
+ height: rect.height / scaleY,
189
+ top: rect.top / scaleY,
190
+ right: rect.right / scaleX,
191
+ bottom: rect.bottom / scaleY,
192
+ left: rect.left / scaleX,
193
+ x: rect.left / scaleX,
194
+ y: rect.top / scaleY
195
+ };
196
+ }
197
+
198
+ // means it doesn't take into account transforms.
199
+
200
+ function getLayoutRect(element) {
201
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
202
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
203
+
204
+ var width = element.offsetWidth;
205
+ var height = element.offsetHeight;
206
+
207
+ if (Math.abs(clientRect.width - width) <= 1) {
208
+ width = clientRect.width;
209
+ }
210
+
211
+ if (Math.abs(clientRect.height - height) <= 1) {
212
+ height = clientRect.height;
213
+ }
214
+
215
+ return {
216
+ x: element.offsetLeft,
217
+ y: element.offsetTop,
218
+ width: width,
219
+ height: height
220
+ };
221
+ }
222
+
223
+ function contains(parent, child) {
224
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
225
+
226
+ if (parent.contains(child)) {
227
+ return true;
228
+ } // then fallback to custom implementation with Shadow DOM support
229
+ else if (rootNode && isShadowRoot(rootNode)) {
230
+ var next = child;
231
+
232
+ do {
233
+ if (next && parent.isSameNode(next)) {
234
+ return true;
235
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
236
+
237
+
238
+ next = next.parentNode || next.host;
239
+ } while (next);
240
+ } // Give up, the result is false
241
+
242
+
243
+ return false;
244
+ }
245
+
246
+ function getComputedStyle(element) {
247
+ return getWindow(element).getComputedStyle(element);
248
+ }
249
+
250
+ function isTableElement(element) {
251
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
252
+ }
253
+
254
+ function getDocumentElement(element) {
255
+ // $FlowFixMe[incompatible-return]: assume body is always available
256
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
257
+ element.document) || window.document).documentElement;
258
+ }
259
+
260
+ function getParentNode(element) {
261
+ if (getNodeName(element) === 'html') {
262
+ return element;
263
+ }
264
+
265
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
266
+ // $FlowFixMe[incompatible-return]
267
+ // $FlowFixMe[prop-missing]
268
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
269
+ element.parentNode || ( // DOM Element detected
270
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
271
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
272
+ getDocumentElement(element) // fallback
273
+
274
+ );
275
+ }
276
+
277
+ function getTrueOffsetParent(element) {
278
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
279
+ getComputedStyle(element).position === 'fixed') {
280
+ return null;
281
+ }
282
+
283
+ return element.offsetParent;
284
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
285
+ // return the containing block
286
+
287
+
288
+ function getContainingBlock(element) {
289
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
290
+ var isIE = navigator.userAgent.indexOf('Trident') !== -1;
291
+
292
+ if (isIE && isHTMLElement(element)) {
293
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
294
+ var elementCss = getComputedStyle(element);
295
+
296
+ if (elementCss.position === 'fixed') {
297
+ return null;
298
+ }
299
+ }
300
+
301
+ var currentNode = getParentNode(element);
302
+
303
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
304
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
305
+ // create a containing block.
306
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
307
+
308
+ 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') {
309
+ return currentNode;
310
+ } else {
311
+ currentNode = currentNode.parentNode;
312
+ }
313
+ }
314
+
315
+ return null;
316
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
317
+ // such as table ancestors and cross browser bugs.
318
+
319
+
320
+ function getOffsetParent(element) {
321
+ var window = getWindow(element);
322
+ var offsetParent = getTrueOffsetParent(element);
323
+
324
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
325
+ offsetParent = getTrueOffsetParent(offsetParent);
326
+ }
327
+
328
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
329
+ return window;
330
+ }
331
+
332
+ return offsetParent || getContainingBlock(element) || window;
333
+ }
334
+
335
+ function getMainAxisFromPlacement(placement) {
336
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
337
+ }
338
+
339
+ var max = Math.max;
340
+ var min = Math.min;
341
+ var round = Math.round;
342
+
343
+ function within(min$1, value, max$1) {
344
+ return max(min$1, min(value, max$1));
345
+ }
346
+
347
+ function getFreshSideObject() {
348
+ return {
349
+ top: 0,
350
+ right: 0,
351
+ bottom: 0,
352
+ left: 0
353
+ };
354
+ }
355
+
356
+ function mergePaddingObject(paddingObject) {
357
+ return Object.assign({}, getFreshSideObject(), paddingObject);
358
+ }
359
+
360
+ function expandToHashMap(value, keys) {
361
+ return keys.reduce(function (hashMap, key) {
362
+ hashMap[key] = value;
363
+ return hashMap;
364
+ }, {});
365
+ }
366
+
367
+ var toPaddingObject = function toPaddingObject(padding, state) {
368
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
369
+ placement: state.placement
370
+ })) : padding;
371
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
372
+ };
373
+
374
+ function arrow(_ref) {
375
+ var _state$modifiersData$;
376
+
377
+ var state = _ref.state,
378
+ name = _ref.name,
379
+ options = _ref.options;
380
+ var arrowElement = state.elements.arrow;
381
+ var popperOffsets = state.modifiersData.popperOffsets;
382
+ var basePlacement = getBasePlacement(state.placement);
383
+ var axis = getMainAxisFromPlacement(basePlacement);
384
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
385
+ var len = isVertical ? 'height' : 'width';
386
+
387
+ if (!arrowElement || !popperOffsets) {
388
+ return;
389
+ }
390
+
391
+ var paddingObject = toPaddingObject(options.padding, state);
392
+ var arrowRect = getLayoutRect(arrowElement);
393
+ var minProp = axis === 'y' ? top : left;
394
+ var maxProp = axis === 'y' ? bottom : right;
395
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
396
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
397
+ var arrowOffsetParent = getOffsetParent(arrowElement);
398
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
399
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
400
+ // outside of the popper bounds
401
+
402
+ var min = paddingObject[minProp];
403
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
404
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
405
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
406
+
407
+ var axisProp = axis;
408
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
409
+ }
410
+
411
+ function effect$1(_ref2) {
412
+ var state = _ref2.state,
413
+ options = _ref2.options;
414
+ var _options$element = options.element,
415
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
416
+
417
+ if (arrowElement == null) {
418
+ return;
419
+ } // CSS selector
420
+
421
+
422
+ if (typeof arrowElement === 'string') {
423
+ arrowElement = state.elements.popper.querySelector(arrowElement);
424
+
425
+ if (!arrowElement) {
426
+ return;
427
+ }
428
+ }
429
+
430
+ if ("development" !== "production") {
431
+ if (!isHTMLElement(arrowElement)) {
432
+ console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
433
+ }
434
+ }
435
+
436
+ if (!contains(state.elements.popper, arrowElement)) {
437
+ if ("development" !== "production") {
438
+ console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
439
+ }
440
+
441
+ return;
442
+ }
443
+
444
+ state.elements.arrow = arrowElement;
445
+ } // eslint-disable-next-line import/no-unused-modules
446
+
447
+
448
+ const arrow$1 = {
449
+ name: 'arrow',
450
+ enabled: true,
451
+ phase: 'main',
452
+ fn: arrow,
453
+ effect: effect$1,
454
+ requires: ['popperOffsets'],
455
+ requiresIfExists: ['preventOverflow']
456
+ };
457
+
458
+ function getVariation(placement) {
459
+ return placement.split('-')[1];
460
+ }
461
+
462
+ var unsetSides = {
463
+ top: 'auto',
464
+ right: 'auto',
465
+ bottom: 'auto',
466
+ left: 'auto'
467
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
468
+ // Zooming can change the DPR, but it seems to report a value that will
469
+ // cleanly divide the values into the appropriate subpixels.
470
+
471
+ function roundOffsetsByDPR(_ref) {
472
+ var x = _ref.x,
473
+ y = _ref.y;
474
+ var win = window;
475
+ var dpr = win.devicePixelRatio || 1;
476
+ return {
477
+ x: round(round(x * dpr) / dpr) || 0,
478
+ y: round(round(y * dpr) / dpr) || 0
479
+ };
480
+ }
481
+
482
+ function mapToStyles(_ref2) {
483
+ var _Object$assign2;
484
+
485
+ var popper = _ref2.popper,
486
+ popperRect = _ref2.popperRect,
487
+ placement = _ref2.placement,
488
+ variation = _ref2.variation,
489
+ offsets = _ref2.offsets,
490
+ position = _ref2.position,
491
+ gpuAcceleration = _ref2.gpuAcceleration,
492
+ adaptive = _ref2.adaptive,
493
+ roundOffsets = _ref2.roundOffsets;
494
+
495
+ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
496
+ _ref3$x = _ref3.x,
497
+ x = _ref3$x === void 0 ? 0 : _ref3$x,
498
+ _ref3$y = _ref3.y,
499
+ y = _ref3$y === void 0 ? 0 : _ref3$y;
500
+
501
+ var hasX = offsets.hasOwnProperty('x');
502
+ var hasY = offsets.hasOwnProperty('y');
503
+ var sideX = left;
504
+ var sideY = top;
505
+ var win = window;
506
+
507
+ if (adaptive) {
508
+ var offsetParent = getOffsetParent(popper);
509
+ var heightProp = 'clientHeight';
510
+ var widthProp = 'clientWidth';
511
+
512
+ if (offsetParent === getWindow(popper)) {
513
+ offsetParent = getDocumentElement(popper);
514
+
515
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
516
+ heightProp = 'scrollHeight';
517
+ widthProp = 'scrollWidth';
518
+ }
519
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
520
+
521
+
522
+ offsetParent = offsetParent;
523
+
524
+ if (placement === top || (placement === left || placement === right) && variation === end) {
525
+ sideY = bottom; // $FlowFixMe[prop-missing]
526
+
527
+ y -= offsetParent[heightProp] - popperRect.height;
528
+ y *= gpuAcceleration ? 1 : -1;
529
+ }
530
+
531
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
532
+ sideX = right; // $FlowFixMe[prop-missing]
533
+
534
+ x -= offsetParent[widthProp] - popperRect.width;
535
+ x *= gpuAcceleration ? 1 : -1;
536
+ }
537
+ }
538
+
539
+ var commonStyles = Object.assign({
540
+ position: position
541
+ }, adaptive && unsetSides);
542
+
543
+ if (gpuAcceleration) {
544
+ var _Object$assign;
545
+
546
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
547
+ }
548
+
549
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
550
+ }
551
+
552
+ function computeStyles(_ref4) {
553
+ var state = _ref4.state,
554
+ options = _ref4.options;
555
+ var _options$gpuAccelerat = options.gpuAcceleration,
556
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
557
+ _options$adaptive = options.adaptive,
558
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
559
+ _options$roundOffsets = options.roundOffsets,
560
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
561
+
562
+ if ("development" !== "production") {
563
+ var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
564
+
565
+ if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
566
+ return transitionProperty.indexOf(property) >= 0;
567
+ })) {
568
+ console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
569
+ }
570
+ }
571
+
572
+ var commonStyles = {
573
+ placement: getBasePlacement(state.placement),
574
+ variation: getVariation(state.placement),
575
+ popper: state.elements.popper,
576
+ popperRect: state.rects.popper,
577
+ gpuAcceleration: gpuAcceleration
578
+ };
579
+
580
+ if (state.modifiersData.popperOffsets != null) {
581
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
582
+ offsets: state.modifiersData.popperOffsets,
583
+ position: state.options.strategy,
584
+ adaptive: adaptive,
585
+ roundOffsets: roundOffsets
586
+ })));
587
+ }
588
+
589
+ if (state.modifiersData.arrow != null) {
590
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
591
+ offsets: state.modifiersData.arrow,
592
+ position: 'absolute',
593
+ adaptive: false,
594
+ roundOffsets: roundOffsets
595
+ })));
596
+ }
597
+
598
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
599
+ 'data-popper-placement': state.placement
600
+ });
601
+ } // eslint-disable-next-line import/no-unused-modules
602
+
603
+
604
+ const computeStyles$1 = {
605
+ name: 'computeStyles',
606
+ enabled: true,
607
+ phase: 'beforeWrite',
608
+ fn: computeStyles,
609
+ data: {}
610
+ };
611
+
612
+ var passive = {
613
+ passive: true
614
+ };
615
+
616
+ function effect(_ref) {
617
+ var state = _ref.state,
618
+ instance = _ref.instance,
619
+ options = _ref.options;
620
+ var _options$scroll = options.scroll,
621
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
622
+ _options$resize = options.resize,
623
+ resize = _options$resize === void 0 ? true : _options$resize;
624
+ var window = getWindow(state.elements.popper);
625
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
626
+
627
+ if (scroll) {
628
+ scrollParents.forEach(function (scrollParent) {
629
+ scrollParent.addEventListener('scroll', instance.update, passive);
630
+ });
631
+ }
632
+
633
+ if (resize) {
634
+ window.addEventListener('resize', instance.update, passive);
635
+ }
636
+
637
+ return function () {
638
+ if (scroll) {
639
+ scrollParents.forEach(function (scrollParent) {
640
+ scrollParent.removeEventListener('scroll', instance.update, passive);
641
+ });
642
+ }
643
+
644
+ if (resize) {
645
+ window.removeEventListener('resize', instance.update, passive);
646
+ }
647
+ };
648
+ } // eslint-disable-next-line import/no-unused-modules
649
+
650
+
651
+ const eventListeners = {
652
+ name: 'eventListeners',
653
+ enabled: true,
654
+ phase: 'write',
655
+ fn: function fn() {},
656
+ effect: effect,
657
+ data: {}
658
+ };
659
+
660
+ var hash$1 = {
661
+ left: 'right',
662
+ right: 'left',
663
+ bottom: 'top',
664
+ top: 'bottom'
665
+ };
666
+ function getOppositePlacement(placement) {
667
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
668
+ return hash$1[matched];
669
+ });
670
+ }
671
+
672
+ var hash = {
673
+ start: 'end',
674
+ end: 'start'
675
+ };
676
+ function getOppositeVariationPlacement(placement) {
677
+ return placement.replace(/start|end/g, function (matched) {
678
+ return hash[matched];
679
+ });
680
+ }
681
+
682
+ function getWindowScroll(node) {
683
+ var win = getWindow(node);
684
+ var scrollLeft = win.pageXOffset;
685
+ var scrollTop = win.pageYOffset;
686
+ return {
687
+ scrollLeft: scrollLeft,
688
+ scrollTop: scrollTop
689
+ };
690
+ }
691
+
692
+ function getWindowScrollBarX(element) {
693
+ // If <html> has a CSS width greater than the viewport, then this will be
694
+ // incorrect for RTL.
695
+ // Popper 1 is broken in this case and never had a bug report so let's assume
696
+ // it's not an issue. I don't think anyone ever specifies width on <html>
697
+ // anyway.
698
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
699
+ // this (e.g. Edge 2019, IE11, Safari)
700
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
701
+ }
702
+
703
+ function getViewportRect(element) {
704
+ var win = getWindow(element);
705
+ var html = getDocumentElement(element);
706
+ var visualViewport = win.visualViewport;
707
+ var width = html.clientWidth;
708
+ var height = html.clientHeight;
709
+ var x = 0;
710
+ var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
711
+ // can be obscured underneath it.
712
+ // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
713
+ // if it isn't open, so if this isn't available, the popper will be detected
714
+ // to overflow the bottom of the screen too early.
715
+
716
+ if (visualViewport) {
717
+ width = visualViewport.width;
718
+ height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
719
+ // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
720
+ // errors due to floating point numbers, so we need to check precision.
721
+ // Safari returns a number <= 0, usually < -1 when pinch-zoomed
722
+ // Feature detection fails in mobile emulation mode in Chrome.
723
+ // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
724
+ // 0.001
725
+ // Fallback here: "Not Safari" userAgent
726
+
727
+ if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
728
+ x = visualViewport.offsetLeft;
729
+ y = visualViewport.offsetTop;
730
+ }
731
+ }
732
+
733
+ return {
734
+ width: width,
735
+ height: height,
736
+ x: x + getWindowScrollBarX(element),
737
+ y: y
738
+ };
739
+ }
740
+
741
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
742
+
743
+ function getDocumentRect(element) {
744
+ var _element$ownerDocumen;
745
+
746
+ var html = getDocumentElement(element);
747
+ var winScroll = getWindowScroll(element);
748
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
749
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
750
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
751
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
752
+ var y = -winScroll.scrollTop;
753
+
754
+ if (getComputedStyle(body || html).direction === 'rtl') {
755
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
756
+ }
757
+
758
+ return {
759
+ width: width,
760
+ height: height,
761
+ x: x,
762
+ y: y
763
+ };
764
+ }
765
+
766
+ function isScrollParent(element) {
767
+ // Firefox wants us to check `-x` and `-y` variations as well
768
+ var _getComputedStyle = getComputedStyle(element),
769
+ overflow = _getComputedStyle.overflow,
770
+ overflowX = _getComputedStyle.overflowX,
771
+ overflowY = _getComputedStyle.overflowY;
772
+
773
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
774
+ }
775
+
776
+ function getScrollParent(node) {
777
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
778
+ // $FlowFixMe[incompatible-return]: assume body is always available
779
+ return node.ownerDocument.body;
780
+ }
781
+
782
+ if (isHTMLElement(node) && isScrollParent(node)) {
783
+ return node;
784
+ }
785
+
786
+ return getScrollParent(getParentNode(node));
787
+ }
788
+
789
+ /*
790
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
791
+ until we get to the top window object. This list is what we attach scroll listeners
792
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
793
+ reference element's position.
794
+ */
795
+
796
+ function listScrollParents(element, list) {
797
+ var _element$ownerDocumen;
798
+
799
+ if (list === void 0) {
800
+ list = [];
801
+ }
802
+
803
+ var scrollParent = getScrollParent(element);
804
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
805
+ var win = getWindow(scrollParent);
806
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
807
+ var updatedList = list.concat(target);
808
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
809
+ updatedList.concat(listScrollParents(getParentNode(target)));
810
+ }
811
+
812
+ function rectToClientRect(rect) {
813
+ return Object.assign({}, rect, {
814
+ left: rect.x,
815
+ top: rect.y,
816
+ right: rect.x + rect.width,
817
+ bottom: rect.y + rect.height
818
+ });
819
+ }
820
+
821
+ function getInnerBoundingClientRect(element) {
822
+ var rect = getBoundingClientRect(element);
823
+ rect.top = rect.top + element.clientTop;
824
+ rect.left = rect.left + element.clientLeft;
825
+ rect.bottom = rect.top + element.clientHeight;
826
+ rect.right = rect.left + element.clientWidth;
827
+ rect.width = element.clientWidth;
828
+ rect.height = element.clientHeight;
829
+ rect.x = rect.left;
830
+ rect.y = rect.top;
831
+ return rect;
832
+ }
833
+
834
+ function getClientRectFromMixedType(element, clippingParent) {
835
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
836
+ } // A "clipping parent" is an overflowable container with the characteristic of
837
+ // clipping (or hiding) overflowing elements with a position different from
838
+ // `initial`
839
+
840
+
841
+ function getClippingParents(element) {
842
+ var clippingParents = listScrollParents(getParentNode(element));
843
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
844
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
845
+
846
+ if (!isElement(clipperElement)) {
847
+ return [];
848
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
849
+
850
+
851
+ return clippingParents.filter(function (clippingParent) {
852
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
853
+ });
854
+ } // Gets the maximum area that the element is visible in due to any number of
855
+ // clipping parents
856
+
857
+
858
+ function getClippingRect(element, boundary, rootBoundary) {
859
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
860
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
861
+ var firstClippingParent = clippingParents[0];
862
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
863
+ var rect = getClientRectFromMixedType(element, clippingParent);
864
+ accRect.top = max(rect.top, accRect.top);
865
+ accRect.right = min(rect.right, accRect.right);
866
+ accRect.bottom = min(rect.bottom, accRect.bottom);
867
+ accRect.left = max(rect.left, accRect.left);
868
+ return accRect;
869
+ }, getClientRectFromMixedType(element, firstClippingParent));
870
+ clippingRect.width = clippingRect.right - clippingRect.left;
871
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
872
+ clippingRect.x = clippingRect.left;
873
+ clippingRect.y = clippingRect.top;
874
+ return clippingRect;
875
+ }
876
+
877
+ function computeOffsets(_ref) {
878
+ var reference = _ref.reference,
879
+ element = _ref.element,
880
+ placement = _ref.placement;
881
+ var basePlacement = placement ? getBasePlacement(placement) : null;
882
+ var variation = placement ? getVariation(placement) : null;
883
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
884
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
885
+ var offsets;
886
+
887
+ switch (basePlacement) {
888
+ case top:
889
+ offsets = {
890
+ x: commonX,
891
+ y: reference.y - element.height
892
+ };
893
+ break;
894
+
895
+ case bottom:
896
+ offsets = {
897
+ x: commonX,
898
+ y: reference.y + reference.height
899
+ };
900
+ break;
901
+
902
+ case right:
903
+ offsets = {
904
+ x: reference.x + reference.width,
905
+ y: commonY
906
+ };
907
+ break;
908
+
909
+ case left:
910
+ offsets = {
911
+ x: reference.x - element.width,
912
+ y: commonY
913
+ };
914
+ break;
915
+
916
+ default:
917
+ offsets = {
918
+ x: reference.x,
919
+ y: reference.y
920
+ };
921
+ }
922
+
923
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
924
+
925
+ if (mainAxis != null) {
926
+ var len = mainAxis === 'y' ? 'height' : 'width';
927
+
928
+ switch (variation) {
929
+ case start:
930
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
931
+ break;
932
+
933
+ case end:
934
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
935
+ break;
936
+
937
+ default:
938
+ }
939
+ }
940
+
941
+ return offsets;
942
+ }
943
+
944
+ function detectOverflow(state, options) {
945
+ if (options === void 0) {
946
+ options = {};
947
+ }
948
+
949
+ var _options = options,
950
+ _options$placement = _options.placement,
951
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
952
+ _options$boundary = _options.boundary,
953
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
954
+ _options$rootBoundary = _options.rootBoundary,
955
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
956
+ _options$elementConte = _options.elementContext,
957
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
958
+ _options$altBoundary = _options.altBoundary,
959
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
960
+ _options$padding = _options.padding,
961
+ padding = _options$padding === void 0 ? 0 : _options$padding;
962
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
963
+ var altContext = elementContext === popper ? reference : popper;
964
+ var popperRect = state.rects.popper;
965
+ var element = state.elements[altBoundary ? altContext : elementContext];
966
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
967
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
968
+ var popperOffsets = computeOffsets({
969
+ reference: referenceClientRect,
970
+ element: popperRect,
971
+ strategy: 'absolute',
972
+ placement: placement
973
+ });
974
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
975
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
976
+ // 0 or negative = within the clipping rect
977
+
978
+ var overflowOffsets = {
979
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
980
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
981
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
982
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
983
+ };
984
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
985
+
986
+ if (elementContext === popper && offsetData) {
987
+ var offset = offsetData[placement];
988
+ Object.keys(overflowOffsets).forEach(function (key) {
989
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
990
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
991
+ overflowOffsets[key] += offset[axis] * multiply;
992
+ });
993
+ }
994
+
995
+ return overflowOffsets;
996
+ }
997
+
998
+ function computeAutoPlacement(state, options) {
999
+ if (options === void 0) {
1000
+ options = {};
1001
+ }
1002
+
1003
+ var _options = options,
1004
+ placement = _options.placement,
1005
+ boundary = _options.boundary,
1006
+ rootBoundary = _options.rootBoundary,
1007
+ padding = _options.padding,
1008
+ flipVariations = _options.flipVariations,
1009
+ _options$allowedAutoP = _options.allowedAutoPlacements,
1010
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1011
+ var variation = getVariation(placement);
1012
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1013
+ return getVariation(placement) === variation;
1014
+ }) : basePlacements;
1015
+ var allowedPlacements = placements$1.filter(function (placement) {
1016
+ return allowedAutoPlacements.indexOf(placement) >= 0;
1017
+ });
1018
+
1019
+ if (allowedPlacements.length === 0) {
1020
+ allowedPlacements = placements$1;
1021
+
1022
+ if ("development" !== "production") {
1023
+ console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
1024
+ }
1025
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1026
+
1027
+
1028
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
1029
+ acc[placement] = detectOverflow(state, {
1030
+ placement: placement,
1031
+ boundary: boundary,
1032
+ rootBoundary: rootBoundary,
1033
+ padding: padding
1034
+ })[getBasePlacement(placement)];
1035
+ return acc;
1036
+ }, {});
1037
+ return Object.keys(overflows).sort(function (a, b) {
1038
+ return overflows[a] - overflows[b];
1039
+ });
1040
+ }
1041
+
1042
+ function getExpandedFallbackPlacements(placement) {
1043
+ if (getBasePlacement(placement) === auto) {
1044
+ return [];
1045
+ }
1046
+
1047
+ var oppositePlacement = getOppositePlacement(placement);
1048
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1049
+ }
1050
+
1051
+ function flip(_ref) {
1052
+ var state = _ref.state,
1053
+ options = _ref.options,
1054
+ name = _ref.name;
1055
+
1056
+ if (state.modifiersData[name]._skip) {
1057
+ return;
1058
+ }
1059
+
1060
+ var _options$mainAxis = options.mainAxis,
1061
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1062
+ _options$altAxis = options.altAxis,
1063
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1064
+ specifiedFallbackPlacements = options.fallbackPlacements,
1065
+ padding = options.padding,
1066
+ boundary = options.boundary,
1067
+ rootBoundary = options.rootBoundary,
1068
+ altBoundary = options.altBoundary,
1069
+ _options$flipVariatio = options.flipVariations,
1070
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1071
+ allowedAutoPlacements = options.allowedAutoPlacements;
1072
+ var preferredPlacement = state.options.placement;
1073
+ var basePlacement = getBasePlacement(preferredPlacement);
1074
+ var isBasePlacement = basePlacement === preferredPlacement;
1075
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1076
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1077
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1078
+ placement: placement,
1079
+ boundary: boundary,
1080
+ rootBoundary: rootBoundary,
1081
+ padding: padding,
1082
+ flipVariations: flipVariations,
1083
+ allowedAutoPlacements: allowedAutoPlacements
1084
+ }) : placement);
1085
+ }, []);
1086
+ var referenceRect = state.rects.reference;
1087
+ var popperRect = state.rects.popper;
1088
+ var checksMap = new Map();
1089
+ var makeFallbackChecks = true;
1090
+ var firstFittingPlacement = placements[0];
1091
+
1092
+ for (var i = 0; i < placements.length; i++) {
1093
+ var placement = placements[i];
1094
+
1095
+ var _basePlacement = getBasePlacement(placement);
1096
+
1097
+ var isStartVariation = getVariation(placement) === start;
1098
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1099
+ var len = isVertical ? 'width' : 'height';
1100
+ var overflow = detectOverflow(state, {
1101
+ placement: placement,
1102
+ boundary: boundary,
1103
+ rootBoundary: rootBoundary,
1104
+ altBoundary: altBoundary,
1105
+ padding: padding
1106
+ });
1107
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1108
+
1109
+ if (referenceRect[len] > popperRect[len]) {
1110
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1111
+ }
1112
+
1113
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1114
+ var checks = [];
1115
+
1116
+ if (checkMainAxis) {
1117
+ checks.push(overflow[_basePlacement] <= 0);
1118
+ }
1119
+
1120
+ if (checkAltAxis) {
1121
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1122
+ }
1123
+
1124
+ if (checks.every(function (check) {
1125
+ return check;
1126
+ })) {
1127
+ firstFittingPlacement = placement;
1128
+ makeFallbackChecks = false;
1129
+ break;
1130
+ }
1131
+
1132
+ checksMap.set(placement, checks);
1133
+ }
1134
+
1135
+ if (makeFallbackChecks) {
1136
+ // `2` may be desired in some cases – research later
1137
+ var numberOfChecks = flipVariations ? 3 : 1;
1138
+
1139
+ var _loop = function _loop(_i) {
1140
+ var fittingPlacement = placements.find(function (placement) {
1141
+ var checks = checksMap.get(placement);
1142
+
1143
+ if (checks) {
1144
+ return checks.slice(0, _i).every(function (check) {
1145
+ return check;
1146
+ });
1147
+ }
1148
+ });
1149
+
1150
+ if (fittingPlacement) {
1151
+ firstFittingPlacement = fittingPlacement;
1152
+ return "break";
1153
+ }
1154
+ };
1155
+
1156
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1157
+ var _ret = _loop(_i);
1158
+
1159
+ if (_ret === "break") break;
1160
+ }
1161
+ }
1162
+
1163
+ if (state.placement !== firstFittingPlacement) {
1164
+ state.modifiersData[name]._skip = true;
1165
+ state.placement = firstFittingPlacement;
1166
+ state.reset = true;
1167
+ }
1168
+ } // eslint-disable-next-line import/no-unused-modules
1169
+
1170
+
1171
+ const flip$1 = {
1172
+ name: 'flip',
1173
+ enabled: true,
1174
+ phase: 'main',
1175
+ fn: flip,
1176
+ requiresIfExists: ['offset'],
1177
+ data: {
1178
+ _skip: false
1179
+ }
1180
+ };
1181
+
1182
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1183
+ if (preventedOffsets === void 0) {
1184
+ preventedOffsets = {
1185
+ x: 0,
1186
+ y: 0
1187
+ };
1188
+ }
1189
+
1190
+ return {
1191
+ top: overflow.top - rect.height - preventedOffsets.y,
1192
+ right: overflow.right - rect.width + preventedOffsets.x,
1193
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1194
+ left: overflow.left - rect.width - preventedOffsets.x
1195
+ };
1196
+ }
1197
+
1198
+ function isAnySideFullyClipped(overflow) {
1199
+ return [top, right, bottom, left].some(function (side) {
1200
+ return overflow[side] >= 0;
1201
+ });
1202
+ }
1203
+
1204
+ function hide(_ref) {
1205
+ var state = _ref.state,
1206
+ name = _ref.name;
1207
+ var referenceRect = state.rects.reference;
1208
+ var popperRect = state.rects.popper;
1209
+ var preventedOffsets = state.modifiersData.preventOverflow;
1210
+ var referenceOverflow = detectOverflow(state, {
1211
+ elementContext: 'reference'
1212
+ });
1213
+ var popperAltOverflow = detectOverflow(state, {
1214
+ altBoundary: true
1215
+ });
1216
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1217
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1218
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1219
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1220
+ state.modifiersData[name] = {
1221
+ referenceClippingOffsets: referenceClippingOffsets,
1222
+ popperEscapeOffsets: popperEscapeOffsets,
1223
+ isReferenceHidden: isReferenceHidden,
1224
+ hasPopperEscaped: hasPopperEscaped
1225
+ };
1226
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1227
+ 'data-popper-reference-hidden': isReferenceHidden,
1228
+ 'data-popper-escaped': hasPopperEscaped
1229
+ });
1230
+ } // eslint-disable-next-line import/no-unused-modules
1231
+
1232
+
1233
+ const hide$1 = {
1234
+ name: 'hide',
1235
+ enabled: true,
1236
+ phase: 'main',
1237
+ requiresIfExists: ['preventOverflow'],
1238
+ fn: hide
1239
+ };
1240
+
1241
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1242
+ var basePlacement = getBasePlacement(placement);
1243
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1244
+
1245
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1246
+ placement: placement
1247
+ })) : offset,
1248
+ skidding = _ref[0],
1249
+ distance = _ref[1];
1250
+
1251
+ skidding = skidding || 0;
1252
+ distance = (distance || 0) * invertDistance;
1253
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1254
+ x: distance,
1255
+ y: skidding
1256
+ } : {
1257
+ x: skidding,
1258
+ y: distance
1259
+ };
1260
+ }
1261
+
1262
+ function offset(_ref2) {
1263
+ var state = _ref2.state,
1264
+ options = _ref2.options,
1265
+ name = _ref2.name;
1266
+ var _options$offset = options.offset,
1267
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1268
+ var data = placements.reduce(function (acc, placement) {
1269
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1270
+ return acc;
1271
+ }, {});
1272
+ var _data$state$placement = data[state.placement],
1273
+ x = _data$state$placement.x,
1274
+ y = _data$state$placement.y;
1275
+
1276
+ if (state.modifiersData.popperOffsets != null) {
1277
+ state.modifiersData.popperOffsets.x += x;
1278
+ state.modifiersData.popperOffsets.y += y;
1279
+ }
1280
+
1281
+ state.modifiersData[name] = data;
1282
+ } // eslint-disable-next-line import/no-unused-modules
1283
+
1284
+
1285
+ const offset$1 = {
1286
+ name: 'offset',
1287
+ enabled: true,
1288
+ phase: 'main',
1289
+ requires: ['popperOffsets'],
1290
+ fn: offset
1291
+ };
1292
+
1293
+ function popperOffsets(_ref) {
1294
+ var state = _ref.state,
1295
+ name = _ref.name;
1296
+ // Offsets are the actual position the popper needs to have to be
1297
+ // properly positioned near its reference element
1298
+ // This is the most basic placement, and will be adjusted by
1299
+ // the modifiers in the next step
1300
+ state.modifiersData[name] = computeOffsets({
1301
+ reference: state.rects.reference,
1302
+ element: state.rects.popper,
1303
+ strategy: 'absolute',
1304
+ placement: state.placement
1305
+ });
1306
+ } // eslint-disable-next-line import/no-unused-modules
1307
+
1308
+
1309
+ const popperOffsets$1 = {
1310
+ name: 'popperOffsets',
1311
+ enabled: true,
1312
+ phase: 'read',
1313
+ fn: popperOffsets,
1314
+ data: {}
1315
+ };
1316
+
1317
+ function getAltAxis(axis) {
1318
+ return axis === 'x' ? 'y' : 'x';
1319
+ }
1320
+
1321
+ function preventOverflow(_ref) {
1322
+ var state = _ref.state,
1323
+ options = _ref.options,
1324
+ name = _ref.name;
1325
+ var _options$mainAxis = options.mainAxis,
1326
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1327
+ _options$altAxis = options.altAxis,
1328
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1329
+ boundary = options.boundary,
1330
+ rootBoundary = options.rootBoundary,
1331
+ altBoundary = options.altBoundary,
1332
+ padding = options.padding,
1333
+ _options$tether = options.tether,
1334
+ tether = _options$tether === void 0 ? true : _options$tether,
1335
+ _options$tetherOffset = options.tetherOffset,
1336
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1337
+ var overflow = detectOverflow(state, {
1338
+ boundary: boundary,
1339
+ rootBoundary: rootBoundary,
1340
+ padding: padding,
1341
+ altBoundary: altBoundary
1342
+ });
1343
+ var basePlacement = getBasePlacement(state.placement);
1344
+ var variation = getVariation(state.placement);
1345
+ var isBasePlacement = !variation;
1346
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1347
+ var altAxis = getAltAxis(mainAxis);
1348
+ var popperOffsets = state.modifiersData.popperOffsets;
1349
+ var referenceRect = state.rects.reference;
1350
+ var popperRect = state.rects.popper;
1351
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1352
+ placement: state.placement
1353
+ })) : tetherOffset;
1354
+ var data = {
1355
+ x: 0,
1356
+ y: 0
1357
+ };
1358
+
1359
+ if (!popperOffsets) {
1360
+ return;
1361
+ }
1362
+
1363
+ if (checkMainAxis || checkAltAxis) {
1364
+ var mainSide = mainAxis === 'y' ? top : left;
1365
+ var altSide = mainAxis === 'y' ? bottom : right;
1366
+ var len = mainAxis === 'y' ? 'height' : 'width';
1367
+ var offset = popperOffsets[mainAxis];
1368
+ var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
1369
+ var max$1 = popperOffsets[mainAxis] - overflow[altSide];
1370
+ var additive = tether ? -popperRect[len] / 2 : 0;
1371
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1372
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1373
+ // outside the reference bounds
1374
+
1375
+ var arrowElement = state.elements.arrow;
1376
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1377
+ width: 0,
1378
+ height: 0
1379
+ };
1380
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1381
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1382
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1383
+ // to include its full size in the calculation. If the reference is small
1384
+ // and near the edge of a boundary, the popper can overflow even if the
1385
+ // reference is not overflowing as well (e.g. virtual elements with no
1386
+ // width or height)
1387
+
1388
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1389
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1390
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1391
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1392
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1393
+ var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1394
+ var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1395
+ var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1396
+
1397
+ if (checkMainAxis) {
1398
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1399
+ popperOffsets[mainAxis] = preventedOffset;
1400
+ data[mainAxis] = preventedOffset - offset;
1401
+ }
1402
+
1403
+ if (checkAltAxis) {
1404
+ var _mainSide = mainAxis === 'x' ? top : left;
1405
+
1406
+ var _altSide = mainAxis === 'x' ? bottom : right;
1407
+
1408
+ var _offset = popperOffsets[altAxis];
1409
+
1410
+ var _min = _offset + overflow[_mainSide];
1411
+
1412
+ var _max = _offset - overflow[_altSide];
1413
+
1414
+ var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
1415
+
1416
+ popperOffsets[altAxis] = _preventedOffset;
1417
+ data[altAxis] = _preventedOffset - _offset;
1418
+ }
1419
+ }
1420
+
1421
+ state.modifiersData[name] = data;
1422
+ } // eslint-disable-next-line import/no-unused-modules
1423
+
1424
+
1425
+ const preventOverflow$1 = {
1426
+ name: 'preventOverflow',
1427
+ enabled: true,
1428
+ phase: 'main',
1429
+ fn: preventOverflow,
1430
+ requiresIfExists: ['offset']
1431
+ };
1432
+
1433
+ function getHTMLElementScroll(element) {
1434
+ return {
1435
+ scrollLeft: element.scrollLeft,
1436
+ scrollTop: element.scrollTop
1437
+ };
1438
+ }
1439
+
1440
+ function getNodeScroll(node) {
1441
+ if (node === getWindow(node) || !isHTMLElement(node)) {
1442
+ return getWindowScroll(node);
1443
+ } else {
1444
+ return getHTMLElementScroll(node);
1445
+ }
1446
+ }
1447
+
1448
+ function isElementScaled(element) {
1449
+ var rect = element.getBoundingClientRect();
1450
+ var scaleX = rect.width / element.offsetWidth || 1;
1451
+ var scaleY = rect.height / element.offsetHeight || 1;
1452
+ return scaleX !== 1 || scaleY !== 1;
1453
+ } // Returns the composite rect of an element relative to its offsetParent.
1454
+ // Composite means it takes into account transforms as well as layout.
1455
+
1456
+
1457
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1458
+ if (isFixed === void 0) {
1459
+ isFixed = false;
1460
+ }
1461
+
1462
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
1463
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1464
+ var documentElement = getDocumentElement(offsetParent);
1465
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1466
+ var scroll = {
1467
+ scrollLeft: 0,
1468
+ scrollTop: 0
1469
+ };
1470
+ var offsets = {
1471
+ x: 0,
1472
+ y: 0
1473
+ };
1474
+
1475
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1476
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1477
+ isScrollParent(documentElement)) {
1478
+ scroll = getNodeScroll(offsetParent);
1479
+ }
1480
+
1481
+ if (isHTMLElement(offsetParent)) {
1482
+ offsets = getBoundingClientRect(offsetParent, true);
1483
+ offsets.x += offsetParent.clientLeft;
1484
+ offsets.y += offsetParent.clientTop;
1485
+ } else if (documentElement) {
1486
+ offsets.x = getWindowScrollBarX(documentElement);
1487
+ }
1488
+ }
1489
+
1490
+ return {
1491
+ x: rect.left + scroll.scrollLeft - offsets.x,
1492
+ y: rect.top + scroll.scrollTop - offsets.y,
1493
+ width: rect.width,
1494
+ height: rect.height
1495
+ };
1496
+ }
1497
+
1498
+ function order(modifiers) {
1499
+ var map = new Map();
1500
+ var visited = new Set();
1501
+ var result = [];
1502
+ modifiers.forEach(function (modifier) {
1503
+ map.set(modifier.name, modifier);
1504
+ }); // On visiting object, check for its dependencies and visit them recursively
1505
+
1506
+ function sort(modifier) {
1507
+ visited.add(modifier.name);
1508
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1509
+ requires.forEach(function (dep) {
1510
+ if (!visited.has(dep)) {
1511
+ var depModifier = map.get(dep);
1512
+
1513
+ if (depModifier) {
1514
+ sort(depModifier);
1515
+ }
1516
+ }
1517
+ });
1518
+ result.push(modifier);
1519
+ }
1520
+
1521
+ modifiers.forEach(function (modifier) {
1522
+ if (!visited.has(modifier.name)) {
1523
+ // check for visited object
1524
+ sort(modifier);
1525
+ }
1526
+ });
1527
+ return result;
1528
+ }
1529
+
1530
+ function orderModifiers(modifiers) {
1531
+ // order based on dependencies
1532
+ var orderedModifiers = order(modifiers); // order based on phase
1533
+
1534
+ return modifierPhases.reduce(function (acc, phase) {
1535
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1536
+ return modifier.phase === phase;
1537
+ }));
1538
+ }, []);
1539
+ }
1540
+
1541
+ function debounce(fn) {
1542
+ var pending;
1543
+ return function () {
1544
+ if (!pending) {
1545
+ pending = new Promise(function (resolve) {
1546
+ Promise.resolve().then(function () {
1547
+ pending = undefined;
1548
+ resolve(fn());
1549
+ });
1550
+ });
1551
+ }
1552
+
1553
+ return pending;
1554
+ };
1555
+ }
1556
+
1557
+ function format(str) {
1558
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1559
+ args[_key - 1] = arguments[_key];
1560
+ }
1561
+
1562
+ return [].concat(args).reduce(function (p, c) {
1563
+ return p.replace(/%s/, c);
1564
+ }, str);
1565
+ }
1566
+
1567
+ var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
1568
+ var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
1569
+ var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
1570
+ function validateModifiers(modifiers) {
1571
+ modifiers.forEach(function (modifier) {
1572
+ [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
1573
+ .filter(function (value, index, self) {
1574
+ return self.indexOf(value) === index;
1575
+ }).forEach(function (key) {
1576
+ switch (key) {
1577
+ case 'name':
1578
+ if (typeof modifier.name !== 'string') {
1579
+ console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
1580
+ }
1581
+
1582
+ break;
1583
+
1584
+ case 'enabled':
1585
+ if (typeof modifier.enabled !== 'boolean') {
1586
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
1587
+ }
1588
+
1589
+ break;
1590
+
1591
+ case 'phase':
1592
+ if (modifierPhases.indexOf(modifier.phase) < 0) {
1593
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
1594
+ }
1595
+
1596
+ break;
1597
+
1598
+ case 'fn':
1599
+ if (typeof modifier.fn !== 'function') {
1600
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
1601
+ }
1602
+
1603
+ break;
1604
+
1605
+ case 'effect':
1606
+ if (modifier.effect != null && typeof modifier.effect !== 'function') {
1607
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
1608
+ }
1609
+
1610
+ break;
1611
+
1612
+ case 'requires':
1613
+ if (modifier.requires != null && !Array.isArray(modifier.requires)) {
1614
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
1615
+ }
1616
+
1617
+ break;
1618
+
1619
+ case 'requiresIfExists':
1620
+ if (!Array.isArray(modifier.requiresIfExists)) {
1621
+ console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
1622
+ }
1623
+
1624
+ break;
1625
+
1626
+ case 'options':
1627
+ case 'data':
1628
+ break;
1629
+
1630
+ default:
1631
+ console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
1632
+ return "\"" + s + "\"";
1633
+ }).join(', ') + "; but \"" + key + "\" was provided.");
1634
+ }
1635
+
1636
+ modifier.requires && modifier.requires.forEach(function (requirement) {
1637
+ if (modifiers.find(function (mod) {
1638
+ return mod.name === requirement;
1639
+ }) == null) {
1640
+ console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
1641
+ }
1642
+ });
1643
+ });
1644
+ });
1645
+ }
1646
+
1647
+ function uniqueBy(arr, fn) {
1648
+ var identifiers = new Set();
1649
+ return arr.filter(function (item) {
1650
+ var identifier = fn(item);
1651
+
1652
+ if (!identifiers.has(identifier)) {
1653
+ identifiers.add(identifier);
1654
+ return true;
1655
+ }
1656
+ });
1657
+ }
1658
+
1659
+ function mergeByName(modifiers) {
1660
+ var merged = modifiers.reduce(function (merged, current) {
1661
+ var existing = merged[current.name];
1662
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1663
+ options: Object.assign({}, existing.options, current.options),
1664
+ data: Object.assign({}, existing.data, current.data)
1665
+ }) : current;
1666
+ return merged;
1667
+ }, {}); // IE11 does not support Object.values
1668
+
1669
+ return Object.keys(merged).map(function (key) {
1670
+ return merged[key];
1671
+ });
1672
+ }
1673
+
1674
+ var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
1675
+ var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
1676
+ var DEFAULT_OPTIONS = {
1677
+ placement: 'bottom',
1678
+ modifiers: [],
1679
+ strategy: 'absolute'
1680
+ };
1681
+
1682
+ function areValidElements() {
1683
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1684
+ args[_key] = arguments[_key];
1685
+ }
1686
+
1687
+ return !args.some(function (element) {
1688
+ return !(element && typeof element.getBoundingClientRect === 'function');
1689
+ });
1690
+ }
1691
+
1692
+ function popperGenerator(generatorOptions) {
1693
+ if (generatorOptions === void 0) {
1694
+ generatorOptions = {};
1695
+ }
1696
+
1697
+ var _generatorOptions = generatorOptions,
1698
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1699
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1700
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1701
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1702
+ return function createPopper(reference, popper, options) {
1703
+ if (options === void 0) {
1704
+ options = defaultOptions;
1705
+ }
1706
+
1707
+ var state = {
1708
+ placement: 'bottom',
1709
+ orderedModifiers: [],
1710
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1711
+ modifiersData: {},
1712
+ elements: {
1713
+ reference: reference,
1714
+ popper: popper
1715
+ },
1716
+ attributes: {},
1717
+ styles: {}
1718
+ };
1719
+ var effectCleanupFns = [];
1720
+ var isDestroyed = false;
1721
+ var instance = {
1722
+ state: state,
1723
+ setOptions: function setOptions(setOptionsAction) {
1724
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1725
+ cleanupModifierEffects();
1726
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1727
+ state.scrollParents = {
1728
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1729
+ popper: listScrollParents(popper)
1730
+ }; // Orders the modifiers based on their dependencies and `phase`
1731
+ // properties
1732
+
1733
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1734
+
1735
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1736
+ return m.enabled;
1737
+ }); // Validate the provided modifiers so that the consumer will get warned
1738
+ // if one of the modifiers is invalid for any reason
1739
+
1740
+ if ("development" !== "production") {
1741
+ var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
1742
+ var name = _ref.name;
1743
+ return name;
1744
+ });
1745
+ validateModifiers(modifiers);
1746
+
1747
+ if (getBasePlacement(state.options.placement) === auto) {
1748
+ var flipModifier = state.orderedModifiers.find(function (_ref2) {
1749
+ var name = _ref2.name;
1750
+ return name === 'flip';
1751
+ });
1752
+
1753
+ if (!flipModifier) {
1754
+ console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
1755
+ }
1756
+ }
1757
+
1758
+ var _getComputedStyle = getComputedStyle(popper),
1759
+ marginTop = _getComputedStyle.marginTop,
1760
+ marginRight = _getComputedStyle.marginRight,
1761
+ marginBottom = _getComputedStyle.marginBottom,
1762
+ marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
1763
+ // cause bugs with positioning, so we'll warn the consumer
1764
+
1765
+
1766
+ if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
1767
+ return parseFloat(margin);
1768
+ })) {
1769
+ console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
1770
+ }
1771
+ }
1772
+
1773
+ runModifierEffects();
1774
+ return instance.update();
1775
+ },
1776
+ // Sync update – it will always be executed, even if not necessary. This
1777
+ // is useful for low frequency updates where sync behavior simplifies the
1778
+ // logic.
1779
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1780
+ // prefer the async Popper#update method
1781
+ forceUpdate: function forceUpdate() {
1782
+ if (isDestroyed) {
1783
+ return;
1784
+ }
1785
+
1786
+ var _state$elements = state.elements,
1787
+ reference = _state$elements.reference,
1788
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1789
+ // anymore
1790
+
1791
+ if (!areValidElements(reference, popper)) {
1792
+ if ("development" !== "production") {
1793
+ console.error(INVALID_ELEMENT_ERROR);
1794
+ }
1795
+
1796
+ return;
1797
+ } // Store the reference and popper rects to be read by modifiers
1798
+
1799
+
1800
+ state.rects = {
1801
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1802
+ popper: getLayoutRect(popper)
1803
+ }; // Modifiers have the ability to reset the current update cycle. The
1804
+ // most common use case for this is the `flip` modifier changing the
1805
+ // placement, which then needs to re-run all the modifiers, because the
1806
+ // logic was previously ran for the previous placement and is therefore
1807
+ // stale/incorrect
1808
+
1809
+ state.reset = false;
1810
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1811
+ // is filled with the initial data specified by the modifier. This means
1812
+ // it doesn't persist and is fresh on each update.
1813
+ // To ensure persistent data, use `${name}#persistent`
1814
+
1815
+ state.orderedModifiers.forEach(function (modifier) {
1816
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1817
+ });
1818
+ var __debug_loops__ = 0;
1819
+
1820
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1821
+ if ("development" !== "production") {
1822
+ __debug_loops__ += 1;
1823
+
1824
+ if (__debug_loops__ > 100) {
1825
+ console.error(INFINITE_LOOP_ERROR);
1826
+ break;
1827
+ }
1828
+ }
1829
+
1830
+ if (state.reset === true) {
1831
+ state.reset = false;
1832
+ index = -1;
1833
+ continue;
1834
+ }
1835
+
1836
+ var _state$orderedModifie = state.orderedModifiers[index],
1837
+ fn = _state$orderedModifie.fn,
1838
+ _state$orderedModifie2 = _state$orderedModifie.options,
1839
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1840
+ name = _state$orderedModifie.name;
1841
+
1842
+ if (typeof fn === 'function') {
1843
+ state = fn({
1844
+ state: state,
1845
+ options: _options,
1846
+ name: name,
1847
+ instance: instance
1848
+ }) || state;
1849
+ }
1850
+ }
1851
+ },
1852
+ // Async and optimistically optimized update – it will not be executed if
1853
+ // not necessary (debounced to run at most once-per-tick)
1854
+ update: debounce(function () {
1855
+ return new Promise(function (resolve) {
1856
+ instance.forceUpdate();
1857
+ resolve(state);
1858
+ });
1859
+ }),
1860
+ destroy: function destroy() {
1861
+ cleanupModifierEffects();
1862
+ isDestroyed = true;
1863
+ }
1864
+ };
1865
+
1866
+ if (!areValidElements(reference, popper)) {
1867
+ if ("development" !== "production") {
1868
+ console.error(INVALID_ELEMENT_ERROR);
1869
+ }
1870
+
1871
+ return instance;
1872
+ }
1873
+
1874
+ instance.setOptions(options).then(function (state) {
1875
+ if (!isDestroyed && options.onFirstUpdate) {
1876
+ options.onFirstUpdate(state);
1877
+ }
1878
+ }); // Modifiers have the ability to execute arbitrary code before the first
1879
+ // update cycle runs. They will be executed in the same order as the update
1880
+ // cycle. This is useful when a modifier adds some persistent data that
1881
+ // other modifiers need to use, but the modifier is run after the dependent
1882
+ // one.
1883
+
1884
+ function runModifierEffects() {
1885
+ state.orderedModifiers.forEach(function (_ref3) {
1886
+ var name = _ref3.name,
1887
+ _ref3$options = _ref3.options,
1888
+ options = _ref3$options === void 0 ? {} : _ref3$options,
1889
+ effect = _ref3.effect;
1890
+
1891
+ if (typeof effect === 'function') {
1892
+ var cleanupFn = effect({
1893
+ state: state,
1894
+ name: name,
1895
+ instance: instance,
1896
+ options: options
1897
+ });
1898
+
1899
+ var noopFn = function noopFn() {};
1900
+
1901
+ effectCleanupFns.push(cleanupFn || noopFn);
1902
+ }
1903
+ });
1904
+ }
1905
+
1906
+ function cleanupModifierEffects() {
1907
+ effectCleanupFns.forEach(function (fn) {
1908
+ return fn();
1909
+ });
1910
+ effectCleanupFns = [];
1911
+ }
1912
+
1913
+ return instance;
1914
+ };
1915
+ }
1916
+ var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
1917
+
1918
+ var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
1919
+ var createPopper$1 = /*#__PURE__*/popperGenerator({
1920
+ defaultModifiers: defaultModifiers$1
1921
+ }); // eslint-disable-next-line import/no-unused-modules
1922
+
1923
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1924
+ var createPopper = /*#__PURE__*/popperGenerator({
1925
+ defaultModifiers: defaultModifiers
1926
+ }); // eslint-disable-next-line import/no-unused-modules
1927
+
1928
+ const SortDown = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>
1929
+ `;
1930
+
1931
+ const dropdownMenuCss = "dropdown-menu{font-family:sans-serif;font-family:var(--verdocs-font)}dropdown-menu .arrow{width:32px;height:26px;background:#fff;border-radius:4px;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #ccc;-ms-flex-pack:center;justify-content:center}dropdown-menu .arrow svg{fill:#50be80;-webkit-transition:0.3s;transition:0.3s}dropdown-menu .items{width:200px;display:none;border-radius:5px;background:#33364b;border:1px solid #654dcb}dropdown-menu .items[data-show]{display:block}dropdown-menu .option{width:100%;color:#fff;border:none;display:block;text-align:left;background:none;padding:10px 20px}dropdown-menu .option:hover{cursor:pointer;background:#50be80}dropdown-menu .option[disabled]{color:#aaa}dropdown-menu .option[disabled]:hover{color:#aaa;cursor:inherit;background:transparent}dropdown-menu .open .items{display:block}dropdown-menu .open .arrow{background:#4c56cb;border:1px solid #707ae5}dropdown-menu .open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1);fill:#fff}";
1932
+
1933
+ let DropdownMenu = class {
1934
+ constructor(hostRef) {
1935
+ registerInstance(this, hostRef);
1936
+ this.optionSelected = createEvent(this, "optionSelected", 7);
1937
+ /**
1938
+ * The menu options to display.
1939
+ */
1940
+ this.options = [];
1941
+ }
1942
+ componentWillLoad() {
1943
+ this.isOpen = !!this.open;
1944
+ }
1945
+ componentDidLoad() {
1946
+ this.popper = createPopper(this.dropdownButton, this.dropdownMenu, { placement: 'bottom-start', modifiers: [{ name: 'offset', options: { offset: [0, 10] } }] });
1947
+ }
1948
+ handleSelectOption(option) {
1949
+ this.isOpen = false;
1950
+ this.optionSelected.emit(option);
1951
+ }
1952
+ // See https://popper.js.org/docs/v2/tutorial/
1953
+ // What we're doing here is clearing event listeners when they aren't needed, to increase performance in lists
1954
+ showDropdown() {
1955
+ var _a, _b;
1956
+ this.isOpen = true;
1957
+ this.dropdownMenu.setAttribute('data-show', '');
1958
+ this.dropdownMenu.removeAttribute('aria-hidden');
1959
+ (_a = this.popper) === null || _a === void 0 ? void 0 : _a.setOptions(options => ({
1960
+ ...options,
1961
+ modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],
1962
+ }));
1963
+ (_b = this.popper) === null || _b === void 0 ? void 0 : _b.update();
1964
+ }
1965
+ hideDropdown() {
1966
+ var _a;
1967
+ this.isOpen = false;
1968
+ this.dropdownMenu.removeAttribute('data-show');
1969
+ this.dropdownMenu.setAttribute('aria-hidden', 'true');
1970
+ (_a = this.popper) === null || _a === void 0 ? void 0 : _a.setOptions(options => ({
1971
+ ...options,
1972
+ modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],
1973
+ }));
1974
+ }
1975
+ toggleDropdown() {
1976
+ if (this.isOpen) {
1977
+ this.hideDropdown();
1978
+ }
1979
+ else {
1980
+ this.showDropdown();
1981
+ }
1982
+ }
1983
+ render() {
1984
+ var _a;
1985
+ return (h("div", { class: { open: !!this.isOpen } }, h("button", { class: "arrow", innerHTML: SortDown, "aria-label": "Open Menu", onClick: () => this.toggleDropdown(), onBlur: () => this.hideDropdown(), ref: el => (this.dropdownButton = el) }), h("div", { class: "items", "aria-hidden": !this.open, ref: el => (this.dropdownMenu = el) }, (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(option => (h("button", { onClick: () => this.handleSelectOption(option), class: "option", disabled: option.disabled }, option.label))))));
1986
+ }
1987
+ };
1988
+ DropdownMenu.style = dropdownMenuCss;
1989
+
1990
+ export { DropdownMenu as dropdown_menu };