@redsift/table 12.5.3 → 12.5.4-muiv6-alpha.1

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.
@@ -0,0 +1,2469 @@
1
+ import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import * as React$1 from 'react';
3
+ import React__default, { forwardRef } from 'react';
4
+ import { ButtonsColorPalette, IconButton, Button, Checkbox, Icon } from '@redsift/design-system';
5
+ import { mdiFilterVariant, mdiViewColumn, mdiArrowUp, mdiArrowDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronDown, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
6
+ import { m as require$$1, d as generateUtilityClass, g as generateUtilityClasses, i as _objectWithoutPropertiesLoose, o as ownerDocument, n as Portal, h as _extends$1, p as chainPropTypes, P as PropTypes, H as HTMLElementType, l as refType, q as useForkRef, t as useEnhancedEffect, v as useSlotProps, k as composeClasses, f as styled, u as useDefaultProps } from './Portal.js';
7
+ import { j as jsxRuntimeExports } from './jsx-runtime.js';
8
+
9
+ const _excluded$4 = ["children", "color", "onClick", "startIcon"];
10
+ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
11
+ var _props$className;
12
+ const {
13
+ children,
14
+ color: propsColor,
15
+ onClick,
16
+ startIcon
17
+ } = props,
18
+ forwardedProps = _objectWithoutProperties(props, _excluded$4);
19
+ const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
20
+ if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
21
+ return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
22
+ color: color,
23
+ onClick: onClick,
24
+ ref: ref,
25
+ variant: "unstyled",
26
+ isActive: props['aria-expanded'] === 'true',
27
+ icon: typeof startIcon !== 'string' ? /*#__PURE__*/React__default.cloneElement(startIcon, {
28
+ fontSize: 'medium'
29
+ }) : startIcon,
30
+ "aria-label": children,
31
+ size: "medium"
32
+ }));
33
+ }
34
+ return /*#__PURE__*/React__default.createElement(Button, _extends({}, forwardedProps, {
35
+ color: color,
36
+ onClick: onClick,
37
+ ref: ref,
38
+ variant: "unstyled",
39
+ isActive: props['aria-expanded'] === 'true',
40
+ leftIcon: startIcon
41
+ }), children);
42
+ });
43
+
44
+ const _excluded$3 = ["checked", "indeterminate", "disabled", "onChange", "touchRippleRef"];
45
+ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
46
+ const {
47
+ checked,
48
+ indeterminate,
49
+ disabled,
50
+ onChange,
51
+ touchRippleRef: _touchRippleRef
52
+ } = props,
53
+ forwardedProps = _objectWithoutProperties(props, _excluded$3);
54
+ return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, forwardedProps, forwardedProps.inputProps, {
55
+ isSelected: checked && !indeterminate,
56
+ isDisabled: disabled,
57
+ isIndeterminate: indeterminate,
58
+ ref: ref,
59
+ onChange: (isChecked, value, name, event) => onChange(event)
60
+ }));
61
+ });
62
+
63
+ const _excluded$2 = ["displayName"];
64
+ const muiIconToDSIcon = {
65
+ ColumnFilteredIcon: mdiFilterVariant,
66
+ ColumnSelectorIcon: mdiViewColumn,
67
+ ColumnSortedAscendingIcon: mdiArrowUp,
68
+ ColumnSortedDescendingIcon: mdiArrowDown,
69
+ DensityCompactIcon: mdiViewHeadline,
70
+ DensityStandardIcon: mdiViewSequential,
71
+ DensityComfortableIcon: mdiViewStream,
72
+ DetailPanelCollapseIcon: mdiChevronDown,
73
+ DetailPanelExpandIcon: mdiChevronRight,
74
+ ExportIcon: mdiTrayArrowDown,
75
+ OpenFilterButtonIcon: mdiFilterVariant
76
+ };
77
+ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
78
+ const {
79
+ displayName
80
+ } = props,
81
+ forwardedProps = _objectWithoutProperties(props, _excluded$2);
82
+ return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
83
+ ref: ref,
84
+ size: forwardedProps.fontSize,
85
+ icon: muiIconToDSIcon[displayName]
86
+ }));
87
+ });
88
+
89
+ var useThemeWithoutDefault = {};
90
+
91
+ Object.defineProperty(useThemeWithoutDefault, "__esModule", {
92
+ value: true
93
+ });
94
+ var default_1 = useThemeWithoutDefault.default = void 0;
95
+ var React = _interopRequireWildcard(React__default);
96
+ var _styledEngine = require$$1;
97
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
98
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
99
+ function isObjectEmpty(obj) {
100
+ return Object.keys(obj).length === 0;
101
+ }
102
+ function useTheme(defaultTheme = null) {
103
+ const contextTheme = React.useContext(_styledEngine.ThemeContext);
104
+ return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
105
+ }
106
+ default_1 = useThemeWithoutDefault.default = useTheme;
107
+
108
+ var top = 'top';
109
+ var bottom = 'bottom';
110
+ var right = 'right';
111
+ var left = 'left';
112
+ var auto = 'auto';
113
+ var basePlacements = [top, bottom, right, left];
114
+ var start = 'start';
115
+ var end = 'end';
116
+ var clippingParents = 'clippingParents';
117
+ var viewport = 'viewport';
118
+ var popper = 'popper';
119
+ var reference = 'reference';
120
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
121
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
122
+ }, []);
123
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
124
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
125
+ }, []); // modifiers that need to read the DOM
126
+
127
+ var beforeRead = 'beforeRead';
128
+ var read = 'read';
129
+ var afterRead = 'afterRead'; // pure-logic modifiers
130
+
131
+ var beforeMain = 'beforeMain';
132
+ var main = 'main';
133
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
134
+
135
+ var beforeWrite = 'beforeWrite';
136
+ var write = 'write';
137
+ var afterWrite = 'afterWrite';
138
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
139
+
140
+ function getNodeName(element) {
141
+ return element ? (element.nodeName || '').toLowerCase() : null;
142
+ }
143
+
144
+ function getWindow(node) {
145
+ if (node == null) {
146
+ return window;
147
+ }
148
+
149
+ if (node.toString() !== '[object Window]') {
150
+ var ownerDocument = node.ownerDocument;
151
+ return ownerDocument ? ownerDocument.defaultView || window : window;
152
+ }
153
+
154
+ return node;
155
+ }
156
+
157
+ function isElement(node) {
158
+ var OwnElement = getWindow(node).Element;
159
+ return node instanceof OwnElement || node instanceof Element;
160
+ }
161
+
162
+ function isHTMLElement$1(node) {
163
+ var OwnElement = getWindow(node).HTMLElement;
164
+ return node instanceof OwnElement || node instanceof HTMLElement;
165
+ }
166
+
167
+ function isShadowRoot(node) {
168
+ // IE 11 has no ShadowRoot
169
+ if (typeof ShadowRoot === 'undefined') {
170
+ return false;
171
+ }
172
+
173
+ var OwnElement = getWindow(node).ShadowRoot;
174
+ return node instanceof OwnElement || node instanceof ShadowRoot;
175
+ }
176
+
177
+ // and applies them to the HTMLElements such as popper and arrow
178
+
179
+ function applyStyles(_ref) {
180
+ var state = _ref.state;
181
+ Object.keys(state.elements).forEach(function (name) {
182
+ var style = state.styles[name] || {};
183
+ var attributes = state.attributes[name] || {};
184
+ var element = state.elements[name]; // arrow is optional + virtual elements
185
+
186
+ if (!isHTMLElement$1(element) || !getNodeName(element)) {
187
+ return;
188
+ } // Flow doesn't support to extend this property, but it's the most
189
+ // effective way to apply styles to an HTMLElement
190
+ // $FlowFixMe[cannot-write]
191
+
192
+
193
+ Object.assign(element.style, style);
194
+ Object.keys(attributes).forEach(function (name) {
195
+ var value = attributes[name];
196
+
197
+ if (value === false) {
198
+ element.removeAttribute(name);
199
+ } else {
200
+ element.setAttribute(name, value === true ? '' : value);
201
+ }
202
+ });
203
+ });
204
+ }
205
+
206
+ function effect$2(_ref2) {
207
+ var state = _ref2.state;
208
+ var initialStyles = {
209
+ popper: {
210
+ position: state.options.strategy,
211
+ left: '0',
212
+ top: '0',
213
+ margin: '0'
214
+ },
215
+ arrow: {
216
+ position: 'absolute'
217
+ },
218
+ reference: {}
219
+ };
220
+ Object.assign(state.elements.popper.style, initialStyles.popper);
221
+ state.styles = initialStyles;
222
+
223
+ if (state.elements.arrow) {
224
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
225
+ }
226
+
227
+ return function () {
228
+ Object.keys(state.elements).forEach(function (name) {
229
+ var element = state.elements[name];
230
+ var attributes = state.attributes[name] || {};
231
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
232
+
233
+ var style = styleProperties.reduce(function (style, property) {
234
+ style[property] = '';
235
+ return style;
236
+ }, {}); // arrow is optional + virtual elements
237
+
238
+ if (!isHTMLElement$1(element) || !getNodeName(element)) {
239
+ return;
240
+ }
241
+
242
+ Object.assign(element.style, style);
243
+ Object.keys(attributes).forEach(function (attribute) {
244
+ element.removeAttribute(attribute);
245
+ });
246
+ });
247
+ };
248
+ } // eslint-disable-next-line import/no-unused-modules
249
+
250
+
251
+ var applyStyles$1 = {
252
+ name: 'applyStyles',
253
+ enabled: true,
254
+ phase: 'write',
255
+ fn: applyStyles,
256
+ effect: effect$2,
257
+ requires: ['computeStyles']
258
+ };
259
+
260
+ function getBasePlacement(placement) {
261
+ return placement.split('-')[0];
262
+ }
263
+
264
+ var max = Math.max;
265
+ var min = Math.min;
266
+ var round = Math.round;
267
+
268
+ function getUAString() {
269
+ var uaData = navigator.userAgentData;
270
+
271
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
272
+ return uaData.brands.map(function (item) {
273
+ return item.brand + "/" + item.version;
274
+ }).join(' ');
275
+ }
276
+
277
+ return navigator.userAgent;
278
+ }
279
+
280
+ function isLayoutViewport() {
281
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
282
+ }
283
+
284
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
285
+ if (includeScale === void 0) {
286
+ includeScale = false;
287
+ }
288
+
289
+ if (isFixedStrategy === void 0) {
290
+ isFixedStrategy = false;
291
+ }
292
+
293
+ var clientRect = element.getBoundingClientRect();
294
+ var scaleX = 1;
295
+ var scaleY = 1;
296
+
297
+ if (includeScale && isHTMLElement$1(element)) {
298
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
299
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
300
+ }
301
+
302
+ var _ref = isElement(element) ? getWindow(element) : window,
303
+ visualViewport = _ref.visualViewport;
304
+
305
+ var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
306
+ var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
307
+ var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
308
+ var width = clientRect.width / scaleX;
309
+ var height = clientRect.height / scaleY;
310
+ return {
311
+ width: width,
312
+ height: height,
313
+ top: y,
314
+ right: x + width,
315
+ bottom: y + height,
316
+ left: x,
317
+ x: x,
318
+ y: y
319
+ };
320
+ }
321
+
322
+ // means it doesn't take into account transforms.
323
+
324
+ function getLayoutRect(element) {
325
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
326
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
327
+
328
+ var width = element.offsetWidth;
329
+ var height = element.offsetHeight;
330
+
331
+ if (Math.abs(clientRect.width - width) <= 1) {
332
+ width = clientRect.width;
333
+ }
334
+
335
+ if (Math.abs(clientRect.height - height) <= 1) {
336
+ height = clientRect.height;
337
+ }
338
+
339
+ return {
340
+ x: element.offsetLeft,
341
+ y: element.offsetTop,
342
+ width: width,
343
+ height: height
344
+ };
345
+ }
346
+
347
+ function contains(parent, child) {
348
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
349
+
350
+ if (parent.contains(child)) {
351
+ return true;
352
+ } // then fallback to custom implementation with Shadow DOM support
353
+ else if (rootNode && isShadowRoot(rootNode)) {
354
+ var next = child;
355
+
356
+ do {
357
+ if (next && parent.isSameNode(next)) {
358
+ return true;
359
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
360
+
361
+
362
+ next = next.parentNode || next.host;
363
+ } while (next);
364
+ } // Give up, the result is false
365
+
366
+
367
+ return false;
368
+ }
369
+
370
+ function getComputedStyle(element) {
371
+ return getWindow(element).getComputedStyle(element);
372
+ }
373
+
374
+ function isTableElement(element) {
375
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
376
+ }
377
+
378
+ function getDocumentElement(element) {
379
+ // $FlowFixMe[incompatible-return]: assume body is always available
380
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
381
+ element.document) || window.document).documentElement;
382
+ }
383
+
384
+ function getParentNode(element) {
385
+ if (getNodeName(element) === 'html') {
386
+ return element;
387
+ }
388
+
389
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
390
+ // $FlowFixMe[incompatible-return]
391
+ // $FlowFixMe[prop-missing]
392
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
393
+ element.parentNode || ( // DOM Element detected
394
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
395
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
396
+ getDocumentElement(element) // fallback
397
+
398
+ );
399
+ }
400
+
401
+ function getTrueOffsetParent(element) {
402
+ if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
403
+ getComputedStyle(element).position === 'fixed') {
404
+ return null;
405
+ }
406
+
407
+ return element.offsetParent;
408
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
409
+ // return the containing block
410
+
411
+
412
+ function getContainingBlock(element) {
413
+ var isFirefox = /firefox/i.test(getUAString());
414
+ var isIE = /Trident/i.test(getUAString());
415
+
416
+ if (isIE && isHTMLElement$1(element)) {
417
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
418
+ var elementCss = getComputedStyle(element);
419
+
420
+ if (elementCss.position === 'fixed') {
421
+ return null;
422
+ }
423
+ }
424
+
425
+ var currentNode = getParentNode(element);
426
+
427
+ if (isShadowRoot(currentNode)) {
428
+ currentNode = currentNode.host;
429
+ }
430
+
431
+ while (isHTMLElement$1(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
432
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
433
+ // create a containing block.
434
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
435
+
436
+ 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') {
437
+ return currentNode;
438
+ } else {
439
+ currentNode = currentNode.parentNode;
440
+ }
441
+ }
442
+
443
+ return null;
444
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
445
+ // such as table ancestors and cross browser bugs.
446
+
447
+
448
+ function getOffsetParent(element) {
449
+ var window = getWindow(element);
450
+ var offsetParent = getTrueOffsetParent(element);
451
+
452
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
453
+ offsetParent = getTrueOffsetParent(offsetParent);
454
+ }
455
+
456
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
457
+ return window;
458
+ }
459
+
460
+ return offsetParent || getContainingBlock(element) || window;
461
+ }
462
+
463
+ function getMainAxisFromPlacement(placement) {
464
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
465
+ }
466
+
467
+ function within(min$1, value, max$1) {
468
+ return max(min$1, min(value, max$1));
469
+ }
470
+ function withinMaxClamp(min, value, max) {
471
+ var v = within(min, value, max);
472
+ return v > max ? max : v;
473
+ }
474
+
475
+ function getFreshSideObject() {
476
+ return {
477
+ top: 0,
478
+ right: 0,
479
+ bottom: 0,
480
+ left: 0
481
+ };
482
+ }
483
+
484
+ function mergePaddingObject(paddingObject) {
485
+ return Object.assign({}, getFreshSideObject(), paddingObject);
486
+ }
487
+
488
+ function expandToHashMap(value, keys) {
489
+ return keys.reduce(function (hashMap, key) {
490
+ hashMap[key] = value;
491
+ return hashMap;
492
+ }, {});
493
+ }
494
+
495
+ var toPaddingObject = function toPaddingObject(padding, state) {
496
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
497
+ placement: state.placement
498
+ })) : padding;
499
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
500
+ };
501
+
502
+ function arrow(_ref) {
503
+ var _state$modifiersData$;
504
+
505
+ var state = _ref.state,
506
+ name = _ref.name,
507
+ options = _ref.options;
508
+ var arrowElement = state.elements.arrow;
509
+ var popperOffsets = state.modifiersData.popperOffsets;
510
+ var basePlacement = getBasePlacement(state.placement);
511
+ var axis = getMainAxisFromPlacement(basePlacement);
512
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
513
+ var len = isVertical ? 'height' : 'width';
514
+
515
+ if (!arrowElement || !popperOffsets) {
516
+ return;
517
+ }
518
+
519
+ var paddingObject = toPaddingObject(options.padding, state);
520
+ var arrowRect = getLayoutRect(arrowElement);
521
+ var minProp = axis === 'y' ? top : left;
522
+ var maxProp = axis === 'y' ? bottom : right;
523
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
524
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
525
+ var arrowOffsetParent = getOffsetParent(arrowElement);
526
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
527
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
528
+ // outside of the popper bounds
529
+
530
+ var min = paddingObject[minProp];
531
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
532
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
533
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
534
+
535
+ var axisProp = axis;
536
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
537
+ }
538
+
539
+ function effect$1(_ref2) {
540
+ var state = _ref2.state,
541
+ options = _ref2.options;
542
+ var _options$element = options.element,
543
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
544
+
545
+ if (arrowElement == null) {
546
+ return;
547
+ } // CSS selector
548
+
549
+
550
+ if (typeof arrowElement === 'string') {
551
+ arrowElement = state.elements.popper.querySelector(arrowElement);
552
+
553
+ if (!arrowElement) {
554
+ return;
555
+ }
556
+ }
557
+
558
+ if (!contains(state.elements.popper, arrowElement)) {
559
+ return;
560
+ }
561
+
562
+ state.elements.arrow = arrowElement;
563
+ } // eslint-disable-next-line import/no-unused-modules
564
+
565
+
566
+ var arrow$1 = {
567
+ name: 'arrow',
568
+ enabled: true,
569
+ phase: 'main',
570
+ fn: arrow,
571
+ effect: effect$1,
572
+ requires: ['popperOffsets'],
573
+ requiresIfExists: ['preventOverflow']
574
+ };
575
+
576
+ function getVariation(placement) {
577
+ return placement.split('-')[1];
578
+ }
579
+
580
+ var unsetSides = {
581
+ top: 'auto',
582
+ right: 'auto',
583
+ bottom: 'auto',
584
+ left: 'auto'
585
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
586
+ // Zooming can change the DPR, but it seems to report a value that will
587
+ // cleanly divide the values into the appropriate subpixels.
588
+
589
+ function roundOffsetsByDPR(_ref, win) {
590
+ var x = _ref.x,
591
+ y = _ref.y;
592
+ var dpr = win.devicePixelRatio || 1;
593
+ return {
594
+ x: round(x * dpr) / dpr || 0,
595
+ y: round(y * dpr) / dpr || 0
596
+ };
597
+ }
598
+
599
+ function mapToStyles(_ref2) {
600
+ var _Object$assign2;
601
+
602
+ var popper = _ref2.popper,
603
+ popperRect = _ref2.popperRect,
604
+ placement = _ref2.placement,
605
+ variation = _ref2.variation,
606
+ offsets = _ref2.offsets,
607
+ position = _ref2.position,
608
+ gpuAcceleration = _ref2.gpuAcceleration,
609
+ adaptive = _ref2.adaptive,
610
+ roundOffsets = _ref2.roundOffsets,
611
+ isFixed = _ref2.isFixed;
612
+ var _offsets$x = offsets.x,
613
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
614
+ _offsets$y = offsets.y,
615
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
616
+
617
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
618
+ x: x,
619
+ y: y
620
+ }) : {
621
+ x: x,
622
+ y: y
623
+ };
624
+
625
+ x = _ref3.x;
626
+ y = _ref3.y;
627
+ var hasX = offsets.hasOwnProperty('x');
628
+ var hasY = offsets.hasOwnProperty('y');
629
+ var sideX = left;
630
+ var sideY = top;
631
+ var win = window;
632
+
633
+ if (adaptive) {
634
+ var offsetParent = getOffsetParent(popper);
635
+ var heightProp = 'clientHeight';
636
+ var widthProp = 'clientWidth';
637
+
638
+ if (offsetParent === getWindow(popper)) {
639
+ offsetParent = getDocumentElement(popper);
640
+
641
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
642
+ heightProp = 'scrollHeight';
643
+ widthProp = 'scrollWidth';
644
+ }
645
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
646
+
647
+
648
+ offsetParent = offsetParent;
649
+
650
+ if (placement === top || (placement === left || placement === right) && variation === end) {
651
+ sideY = bottom;
652
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
653
+ offsetParent[heightProp];
654
+ y -= offsetY - popperRect.height;
655
+ y *= gpuAcceleration ? 1 : -1;
656
+ }
657
+
658
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
659
+ sideX = right;
660
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
661
+ offsetParent[widthProp];
662
+ x -= offsetX - popperRect.width;
663
+ x *= gpuAcceleration ? 1 : -1;
664
+ }
665
+ }
666
+
667
+ var commonStyles = Object.assign({
668
+ position: position
669
+ }, adaptive && unsetSides);
670
+
671
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
672
+ x: x,
673
+ y: y
674
+ }, getWindow(popper)) : {
675
+ x: x,
676
+ y: y
677
+ };
678
+
679
+ x = _ref4.x;
680
+ y = _ref4.y;
681
+
682
+ if (gpuAcceleration) {
683
+ var _Object$assign;
684
+
685
+ 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));
686
+ }
687
+
688
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
689
+ }
690
+
691
+ function computeStyles(_ref5) {
692
+ var state = _ref5.state,
693
+ options = _ref5.options;
694
+ var _options$gpuAccelerat = options.gpuAcceleration,
695
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
696
+ _options$adaptive = options.adaptive,
697
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
698
+ _options$roundOffsets = options.roundOffsets,
699
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
700
+ var commonStyles = {
701
+ placement: getBasePlacement(state.placement),
702
+ variation: getVariation(state.placement),
703
+ popper: state.elements.popper,
704
+ popperRect: state.rects.popper,
705
+ gpuAcceleration: gpuAcceleration,
706
+ isFixed: state.options.strategy === 'fixed'
707
+ };
708
+
709
+ if (state.modifiersData.popperOffsets != null) {
710
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
711
+ offsets: state.modifiersData.popperOffsets,
712
+ position: state.options.strategy,
713
+ adaptive: adaptive,
714
+ roundOffsets: roundOffsets
715
+ })));
716
+ }
717
+
718
+ if (state.modifiersData.arrow != null) {
719
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
720
+ offsets: state.modifiersData.arrow,
721
+ position: 'absolute',
722
+ adaptive: false,
723
+ roundOffsets: roundOffsets
724
+ })));
725
+ }
726
+
727
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
728
+ 'data-popper-placement': state.placement
729
+ });
730
+ } // eslint-disable-next-line import/no-unused-modules
731
+
732
+
733
+ var computeStyles$1 = {
734
+ name: 'computeStyles',
735
+ enabled: true,
736
+ phase: 'beforeWrite',
737
+ fn: computeStyles,
738
+ data: {}
739
+ };
740
+
741
+ var passive = {
742
+ passive: true
743
+ };
744
+
745
+ function effect(_ref) {
746
+ var state = _ref.state,
747
+ instance = _ref.instance,
748
+ options = _ref.options;
749
+ var _options$scroll = options.scroll,
750
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
751
+ _options$resize = options.resize,
752
+ resize = _options$resize === void 0 ? true : _options$resize;
753
+ var window = getWindow(state.elements.popper);
754
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
755
+
756
+ if (scroll) {
757
+ scrollParents.forEach(function (scrollParent) {
758
+ scrollParent.addEventListener('scroll', instance.update, passive);
759
+ });
760
+ }
761
+
762
+ if (resize) {
763
+ window.addEventListener('resize', instance.update, passive);
764
+ }
765
+
766
+ return function () {
767
+ if (scroll) {
768
+ scrollParents.forEach(function (scrollParent) {
769
+ scrollParent.removeEventListener('scroll', instance.update, passive);
770
+ });
771
+ }
772
+
773
+ if (resize) {
774
+ window.removeEventListener('resize', instance.update, passive);
775
+ }
776
+ };
777
+ } // eslint-disable-next-line import/no-unused-modules
778
+
779
+
780
+ var eventListeners = {
781
+ name: 'eventListeners',
782
+ enabled: true,
783
+ phase: 'write',
784
+ fn: function fn() {},
785
+ effect: effect,
786
+ data: {}
787
+ };
788
+
789
+ var hash$1 = {
790
+ left: 'right',
791
+ right: 'left',
792
+ bottom: 'top',
793
+ top: 'bottom'
794
+ };
795
+ function getOppositePlacement(placement) {
796
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
797
+ return hash$1[matched];
798
+ });
799
+ }
800
+
801
+ var hash = {
802
+ start: 'end',
803
+ end: 'start'
804
+ };
805
+ function getOppositeVariationPlacement(placement) {
806
+ return placement.replace(/start|end/g, function (matched) {
807
+ return hash[matched];
808
+ });
809
+ }
810
+
811
+ function getWindowScroll(node) {
812
+ var win = getWindow(node);
813
+ var scrollLeft = win.pageXOffset;
814
+ var scrollTop = win.pageYOffset;
815
+ return {
816
+ scrollLeft: scrollLeft,
817
+ scrollTop: scrollTop
818
+ };
819
+ }
820
+
821
+ function getWindowScrollBarX(element) {
822
+ // If <html> has a CSS width greater than the viewport, then this will be
823
+ // incorrect for RTL.
824
+ // Popper 1 is broken in this case and never had a bug report so let's assume
825
+ // it's not an issue. I don't think anyone ever specifies width on <html>
826
+ // anyway.
827
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
828
+ // this (e.g. Edge 2019, IE11, Safari)
829
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
830
+ }
831
+
832
+ function getViewportRect(element, strategy) {
833
+ var win = getWindow(element);
834
+ var html = getDocumentElement(element);
835
+ var visualViewport = win.visualViewport;
836
+ var width = html.clientWidth;
837
+ var height = html.clientHeight;
838
+ var x = 0;
839
+ var y = 0;
840
+
841
+ if (visualViewport) {
842
+ width = visualViewport.width;
843
+ height = visualViewport.height;
844
+ var layoutViewport = isLayoutViewport();
845
+
846
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
847
+ x = visualViewport.offsetLeft;
848
+ y = visualViewport.offsetTop;
849
+ }
850
+ }
851
+
852
+ return {
853
+ width: width,
854
+ height: height,
855
+ x: x + getWindowScrollBarX(element),
856
+ y: y
857
+ };
858
+ }
859
+
860
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
861
+
862
+ function getDocumentRect(element) {
863
+ var _element$ownerDocumen;
864
+
865
+ var html = getDocumentElement(element);
866
+ var winScroll = getWindowScroll(element);
867
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
868
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
869
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
870
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
871
+ var y = -winScroll.scrollTop;
872
+
873
+ if (getComputedStyle(body || html).direction === 'rtl') {
874
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
875
+ }
876
+
877
+ return {
878
+ width: width,
879
+ height: height,
880
+ x: x,
881
+ y: y
882
+ };
883
+ }
884
+
885
+ function isScrollParent(element) {
886
+ // Firefox wants us to check `-x` and `-y` variations as well
887
+ var _getComputedStyle = getComputedStyle(element),
888
+ overflow = _getComputedStyle.overflow,
889
+ overflowX = _getComputedStyle.overflowX,
890
+ overflowY = _getComputedStyle.overflowY;
891
+
892
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
893
+ }
894
+
895
+ function getScrollParent(node) {
896
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
897
+ // $FlowFixMe[incompatible-return]: assume body is always available
898
+ return node.ownerDocument.body;
899
+ }
900
+
901
+ if (isHTMLElement$1(node) && isScrollParent(node)) {
902
+ return node;
903
+ }
904
+
905
+ return getScrollParent(getParentNode(node));
906
+ }
907
+
908
+ /*
909
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
910
+ until we get to the top window object. This list is what we attach scroll listeners
911
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
912
+ reference element's position.
913
+ */
914
+
915
+ function listScrollParents(element, list) {
916
+ var _element$ownerDocumen;
917
+
918
+ if (list === void 0) {
919
+ list = [];
920
+ }
921
+
922
+ var scrollParent = getScrollParent(element);
923
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
924
+ var win = getWindow(scrollParent);
925
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
926
+ var updatedList = list.concat(target);
927
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
928
+ updatedList.concat(listScrollParents(getParentNode(target)));
929
+ }
930
+
931
+ function rectToClientRect(rect) {
932
+ return Object.assign({}, rect, {
933
+ left: rect.x,
934
+ top: rect.y,
935
+ right: rect.x + rect.width,
936
+ bottom: rect.y + rect.height
937
+ });
938
+ }
939
+
940
+ function getInnerBoundingClientRect(element, strategy) {
941
+ var rect = getBoundingClientRect(element, false, strategy === 'fixed');
942
+ rect.top = rect.top + element.clientTop;
943
+ rect.left = rect.left + element.clientLeft;
944
+ rect.bottom = rect.top + element.clientHeight;
945
+ rect.right = rect.left + element.clientWidth;
946
+ rect.width = element.clientWidth;
947
+ rect.height = element.clientHeight;
948
+ rect.x = rect.left;
949
+ rect.y = rect.top;
950
+ return rect;
951
+ }
952
+
953
+ function getClientRectFromMixedType(element, clippingParent, strategy) {
954
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
955
+ } // A "clipping parent" is an overflowable container with the characteristic of
956
+ // clipping (or hiding) overflowing elements with a position different from
957
+ // `initial`
958
+
959
+
960
+ function getClippingParents(element) {
961
+ var clippingParents = listScrollParents(getParentNode(element));
962
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
963
+ var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent(element) : element;
964
+
965
+ if (!isElement(clipperElement)) {
966
+ return [];
967
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
968
+
969
+
970
+ return clippingParents.filter(function (clippingParent) {
971
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
972
+ });
973
+ } // Gets the maximum area that the element is visible in due to any number of
974
+ // clipping parents
975
+
976
+
977
+ function getClippingRect(element, boundary, rootBoundary, strategy) {
978
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
979
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
980
+ var firstClippingParent = clippingParents[0];
981
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
982
+ var rect = getClientRectFromMixedType(element, clippingParent, strategy);
983
+ accRect.top = max(rect.top, accRect.top);
984
+ accRect.right = min(rect.right, accRect.right);
985
+ accRect.bottom = min(rect.bottom, accRect.bottom);
986
+ accRect.left = max(rect.left, accRect.left);
987
+ return accRect;
988
+ }, getClientRectFromMixedType(element, firstClippingParent, strategy));
989
+ clippingRect.width = clippingRect.right - clippingRect.left;
990
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
991
+ clippingRect.x = clippingRect.left;
992
+ clippingRect.y = clippingRect.top;
993
+ return clippingRect;
994
+ }
995
+
996
+ function computeOffsets(_ref) {
997
+ var reference = _ref.reference,
998
+ element = _ref.element,
999
+ placement = _ref.placement;
1000
+ var basePlacement = placement ? getBasePlacement(placement) : null;
1001
+ var variation = placement ? getVariation(placement) : null;
1002
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
1003
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
1004
+ var offsets;
1005
+
1006
+ switch (basePlacement) {
1007
+ case top:
1008
+ offsets = {
1009
+ x: commonX,
1010
+ y: reference.y - element.height
1011
+ };
1012
+ break;
1013
+
1014
+ case bottom:
1015
+ offsets = {
1016
+ x: commonX,
1017
+ y: reference.y + reference.height
1018
+ };
1019
+ break;
1020
+
1021
+ case right:
1022
+ offsets = {
1023
+ x: reference.x + reference.width,
1024
+ y: commonY
1025
+ };
1026
+ break;
1027
+
1028
+ case left:
1029
+ offsets = {
1030
+ x: reference.x - element.width,
1031
+ y: commonY
1032
+ };
1033
+ break;
1034
+
1035
+ default:
1036
+ offsets = {
1037
+ x: reference.x,
1038
+ y: reference.y
1039
+ };
1040
+ }
1041
+
1042
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
1043
+
1044
+ if (mainAxis != null) {
1045
+ var len = mainAxis === 'y' ? 'height' : 'width';
1046
+
1047
+ switch (variation) {
1048
+ case start:
1049
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
1050
+ break;
1051
+
1052
+ case end:
1053
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
1054
+ break;
1055
+ }
1056
+ }
1057
+
1058
+ return offsets;
1059
+ }
1060
+
1061
+ function detectOverflow(state, options) {
1062
+ if (options === void 0) {
1063
+ options = {};
1064
+ }
1065
+
1066
+ var _options = options,
1067
+ _options$placement = _options.placement,
1068
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
1069
+ _options$strategy = _options.strategy,
1070
+ strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
1071
+ _options$boundary = _options.boundary,
1072
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
1073
+ _options$rootBoundary = _options.rootBoundary,
1074
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
1075
+ _options$elementConte = _options.elementContext,
1076
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
1077
+ _options$altBoundary = _options.altBoundary,
1078
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
1079
+ _options$padding = _options.padding,
1080
+ padding = _options$padding === void 0 ? 0 : _options$padding;
1081
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
1082
+ var altContext = elementContext === popper ? reference : popper;
1083
+ var popperRect = state.rects.popper;
1084
+ var element = state.elements[altBoundary ? altContext : elementContext];
1085
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
1086
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
1087
+ var popperOffsets = computeOffsets({
1088
+ reference: referenceClientRect,
1089
+ element: popperRect,
1090
+ strategy: 'absolute',
1091
+ placement: placement
1092
+ });
1093
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
1094
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
1095
+ // 0 or negative = within the clipping rect
1096
+
1097
+ var overflowOffsets = {
1098
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
1099
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
1100
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
1101
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
1102
+ };
1103
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
1104
+
1105
+ if (elementContext === popper && offsetData) {
1106
+ var offset = offsetData[placement];
1107
+ Object.keys(overflowOffsets).forEach(function (key) {
1108
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
1109
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
1110
+ overflowOffsets[key] += offset[axis] * multiply;
1111
+ });
1112
+ }
1113
+
1114
+ return overflowOffsets;
1115
+ }
1116
+
1117
+ function computeAutoPlacement(state, options) {
1118
+ if (options === void 0) {
1119
+ options = {};
1120
+ }
1121
+
1122
+ var _options = options,
1123
+ placement = _options.placement,
1124
+ boundary = _options.boundary,
1125
+ rootBoundary = _options.rootBoundary,
1126
+ padding = _options.padding,
1127
+ flipVariations = _options.flipVariations,
1128
+ _options$allowedAutoP = _options.allowedAutoPlacements,
1129
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1130
+ var variation = getVariation(placement);
1131
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1132
+ return getVariation(placement) === variation;
1133
+ }) : basePlacements;
1134
+ var allowedPlacements = placements$1.filter(function (placement) {
1135
+ return allowedAutoPlacements.indexOf(placement) >= 0;
1136
+ });
1137
+
1138
+ if (allowedPlacements.length === 0) {
1139
+ allowedPlacements = placements$1;
1140
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1141
+
1142
+
1143
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
1144
+ acc[placement] = detectOverflow(state, {
1145
+ placement: placement,
1146
+ boundary: boundary,
1147
+ rootBoundary: rootBoundary,
1148
+ padding: padding
1149
+ })[getBasePlacement(placement)];
1150
+ return acc;
1151
+ }, {});
1152
+ return Object.keys(overflows).sort(function (a, b) {
1153
+ return overflows[a] - overflows[b];
1154
+ });
1155
+ }
1156
+
1157
+ function getExpandedFallbackPlacements(placement) {
1158
+ if (getBasePlacement(placement) === auto) {
1159
+ return [];
1160
+ }
1161
+
1162
+ var oppositePlacement = getOppositePlacement(placement);
1163
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1164
+ }
1165
+
1166
+ function flip(_ref) {
1167
+ var state = _ref.state,
1168
+ options = _ref.options,
1169
+ name = _ref.name;
1170
+
1171
+ if (state.modifiersData[name]._skip) {
1172
+ return;
1173
+ }
1174
+
1175
+ var _options$mainAxis = options.mainAxis,
1176
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1177
+ _options$altAxis = options.altAxis,
1178
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1179
+ specifiedFallbackPlacements = options.fallbackPlacements,
1180
+ padding = options.padding,
1181
+ boundary = options.boundary,
1182
+ rootBoundary = options.rootBoundary,
1183
+ altBoundary = options.altBoundary,
1184
+ _options$flipVariatio = options.flipVariations,
1185
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1186
+ allowedAutoPlacements = options.allowedAutoPlacements;
1187
+ var preferredPlacement = state.options.placement;
1188
+ var basePlacement = getBasePlacement(preferredPlacement);
1189
+ var isBasePlacement = basePlacement === preferredPlacement;
1190
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1191
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1192
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1193
+ placement: placement,
1194
+ boundary: boundary,
1195
+ rootBoundary: rootBoundary,
1196
+ padding: padding,
1197
+ flipVariations: flipVariations,
1198
+ allowedAutoPlacements: allowedAutoPlacements
1199
+ }) : placement);
1200
+ }, []);
1201
+ var referenceRect = state.rects.reference;
1202
+ var popperRect = state.rects.popper;
1203
+ var checksMap = new Map();
1204
+ var makeFallbackChecks = true;
1205
+ var firstFittingPlacement = placements[0];
1206
+
1207
+ for (var i = 0; i < placements.length; i++) {
1208
+ var placement = placements[i];
1209
+
1210
+ var _basePlacement = getBasePlacement(placement);
1211
+
1212
+ var isStartVariation = getVariation(placement) === start;
1213
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1214
+ var len = isVertical ? 'width' : 'height';
1215
+ var overflow = detectOverflow(state, {
1216
+ placement: placement,
1217
+ boundary: boundary,
1218
+ rootBoundary: rootBoundary,
1219
+ altBoundary: altBoundary,
1220
+ padding: padding
1221
+ });
1222
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1223
+
1224
+ if (referenceRect[len] > popperRect[len]) {
1225
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1226
+ }
1227
+
1228
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1229
+ var checks = [];
1230
+
1231
+ if (checkMainAxis) {
1232
+ checks.push(overflow[_basePlacement] <= 0);
1233
+ }
1234
+
1235
+ if (checkAltAxis) {
1236
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1237
+ }
1238
+
1239
+ if (checks.every(function (check) {
1240
+ return check;
1241
+ })) {
1242
+ firstFittingPlacement = placement;
1243
+ makeFallbackChecks = false;
1244
+ break;
1245
+ }
1246
+
1247
+ checksMap.set(placement, checks);
1248
+ }
1249
+
1250
+ if (makeFallbackChecks) {
1251
+ // `2` may be desired in some cases – research later
1252
+ var numberOfChecks = flipVariations ? 3 : 1;
1253
+
1254
+ var _loop = function _loop(_i) {
1255
+ var fittingPlacement = placements.find(function (placement) {
1256
+ var checks = checksMap.get(placement);
1257
+
1258
+ if (checks) {
1259
+ return checks.slice(0, _i).every(function (check) {
1260
+ return check;
1261
+ });
1262
+ }
1263
+ });
1264
+
1265
+ if (fittingPlacement) {
1266
+ firstFittingPlacement = fittingPlacement;
1267
+ return "break";
1268
+ }
1269
+ };
1270
+
1271
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1272
+ var _ret = _loop(_i);
1273
+
1274
+ if (_ret === "break") break;
1275
+ }
1276
+ }
1277
+
1278
+ if (state.placement !== firstFittingPlacement) {
1279
+ state.modifiersData[name]._skip = true;
1280
+ state.placement = firstFittingPlacement;
1281
+ state.reset = true;
1282
+ }
1283
+ } // eslint-disable-next-line import/no-unused-modules
1284
+
1285
+
1286
+ var flip$1 = {
1287
+ name: 'flip',
1288
+ enabled: true,
1289
+ phase: 'main',
1290
+ fn: flip,
1291
+ requiresIfExists: ['offset'],
1292
+ data: {
1293
+ _skip: false
1294
+ }
1295
+ };
1296
+
1297
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1298
+ if (preventedOffsets === void 0) {
1299
+ preventedOffsets = {
1300
+ x: 0,
1301
+ y: 0
1302
+ };
1303
+ }
1304
+
1305
+ return {
1306
+ top: overflow.top - rect.height - preventedOffsets.y,
1307
+ right: overflow.right - rect.width + preventedOffsets.x,
1308
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1309
+ left: overflow.left - rect.width - preventedOffsets.x
1310
+ };
1311
+ }
1312
+
1313
+ function isAnySideFullyClipped(overflow) {
1314
+ return [top, right, bottom, left].some(function (side) {
1315
+ return overflow[side] >= 0;
1316
+ });
1317
+ }
1318
+
1319
+ function hide(_ref) {
1320
+ var state = _ref.state,
1321
+ name = _ref.name;
1322
+ var referenceRect = state.rects.reference;
1323
+ var popperRect = state.rects.popper;
1324
+ var preventedOffsets = state.modifiersData.preventOverflow;
1325
+ var referenceOverflow = detectOverflow(state, {
1326
+ elementContext: 'reference'
1327
+ });
1328
+ var popperAltOverflow = detectOverflow(state, {
1329
+ altBoundary: true
1330
+ });
1331
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1332
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1333
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1334
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1335
+ state.modifiersData[name] = {
1336
+ referenceClippingOffsets: referenceClippingOffsets,
1337
+ popperEscapeOffsets: popperEscapeOffsets,
1338
+ isReferenceHidden: isReferenceHidden,
1339
+ hasPopperEscaped: hasPopperEscaped
1340
+ };
1341
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1342
+ 'data-popper-reference-hidden': isReferenceHidden,
1343
+ 'data-popper-escaped': hasPopperEscaped
1344
+ });
1345
+ } // eslint-disable-next-line import/no-unused-modules
1346
+
1347
+
1348
+ var hide$1 = {
1349
+ name: 'hide',
1350
+ enabled: true,
1351
+ phase: 'main',
1352
+ requiresIfExists: ['preventOverflow'],
1353
+ fn: hide
1354
+ };
1355
+
1356
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1357
+ var basePlacement = getBasePlacement(placement);
1358
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1359
+
1360
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1361
+ placement: placement
1362
+ })) : offset,
1363
+ skidding = _ref[0],
1364
+ distance = _ref[1];
1365
+
1366
+ skidding = skidding || 0;
1367
+ distance = (distance || 0) * invertDistance;
1368
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1369
+ x: distance,
1370
+ y: skidding
1371
+ } : {
1372
+ x: skidding,
1373
+ y: distance
1374
+ };
1375
+ }
1376
+
1377
+ function offset(_ref2) {
1378
+ var state = _ref2.state,
1379
+ options = _ref2.options,
1380
+ name = _ref2.name;
1381
+ var _options$offset = options.offset,
1382
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1383
+ var data = placements.reduce(function (acc, placement) {
1384
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1385
+ return acc;
1386
+ }, {});
1387
+ var _data$state$placement = data[state.placement],
1388
+ x = _data$state$placement.x,
1389
+ y = _data$state$placement.y;
1390
+
1391
+ if (state.modifiersData.popperOffsets != null) {
1392
+ state.modifiersData.popperOffsets.x += x;
1393
+ state.modifiersData.popperOffsets.y += y;
1394
+ }
1395
+
1396
+ state.modifiersData[name] = data;
1397
+ } // eslint-disable-next-line import/no-unused-modules
1398
+
1399
+
1400
+ var offset$1 = {
1401
+ name: 'offset',
1402
+ enabled: true,
1403
+ phase: 'main',
1404
+ requires: ['popperOffsets'],
1405
+ fn: offset
1406
+ };
1407
+
1408
+ function popperOffsets(_ref) {
1409
+ var state = _ref.state,
1410
+ name = _ref.name;
1411
+ // Offsets are the actual position the popper needs to have to be
1412
+ // properly positioned near its reference element
1413
+ // This is the most basic placement, and will be adjusted by
1414
+ // the modifiers in the next step
1415
+ state.modifiersData[name] = computeOffsets({
1416
+ reference: state.rects.reference,
1417
+ element: state.rects.popper,
1418
+ strategy: 'absolute',
1419
+ placement: state.placement
1420
+ });
1421
+ } // eslint-disable-next-line import/no-unused-modules
1422
+
1423
+
1424
+ var popperOffsets$1 = {
1425
+ name: 'popperOffsets',
1426
+ enabled: true,
1427
+ phase: 'read',
1428
+ fn: popperOffsets,
1429
+ data: {}
1430
+ };
1431
+
1432
+ function getAltAxis(axis) {
1433
+ return axis === 'x' ? 'y' : 'x';
1434
+ }
1435
+
1436
+ function preventOverflow(_ref) {
1437
+ var state = _ref.state,
1438
+ options = _ref.options,
1439
+ name = _ref.name;
1440
+ var _options$mainAxis = options.mainAxis,
1441
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1442
+ _options$altAxis = options.altAxis,
1443
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1444
+ boundary = options.boundary,
1445
+ rootBoundary = options.rootBoundary,
1446
+ altBoundary = options.altBoundary,
1447
+ padding = options.padding,
1448
+ _options$tether = options.tether,
1449
+ tether = _options$tether === void 0 ? true : _options$tether,
1450
+ _options$tetherOffset = options.tetherOffset,
1451
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1452
+ var overflow = detectOverflow(state, {
1453
+ boundary: boundary,
1454
+ rootBoundary: rootBoundary,
1455
+ padding: padding,
1456
+ altBoundary: altBoundary
1457
+ });
1458
+ var basePlacement = getBasePlacement(state.placement);
1459
+ var variation = getVariation(state.placement);
1460
+ var isBasePlacement = !variation;
1461
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1462
+ var altAxis = getAltAxis(mainAxis);
1463
+ var popperOffsets = state.modifiersData.popperOffsets;
1464
+ var referenceRect = state.rects.reference;
1465
+ var popperRect = state.rects.popper;
1466
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1467
+ placement: state.placement
1468
+ })) : tetherOffset;
1469
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1470
+ mainAxis: tetherOffsetValue,
1471
+ altAxis: tetherOffsetValue
1472
+ } : Object.assign({
1473
+ mainAxis: 0,
1474
+ altAxis: 0
1475
+ }, tetherOffsetValue);
1476
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1477
+ var data = {
1478
+ x: 0,
1479
+ y: 0
1480
+ };
1481
+
1482
+ if (!popperOffsets) {
1483
+ return;
1484
+ }
1485
+
1486
+ if (checkMainAxis) {
1487
+ var _offsetModifierState$;
1488
+
1489
+ var mainSide = mainAxis === 'y' ? top : left;
1490
+ var altSide = mainAxis === 'y' ? bottom : right;
1491
+ var len = mainAxis === 'y' ? 'height' : 'width';
1492
+ var offset = popperOffsets[mainAxis];
1493
+ var min$1 = offset + overflow[mainSide];
1494
+ var max$1 = offset - overflow[altSide];
1495
+ var additive = tether ? -popperRect[len] / 2 : 0;
1496
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1497
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1498
+ // outside the reference bounds
1499
+
1500
+ var arrowElement = state.elements.arrow;
1501
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1502
+ width: 0,
1503
+ height: 0
1504
+ };
1505
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1506
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1507
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1508
+ // to include its full size in the calculation. If the reference is small
1509
+ // and near the edge of a boundary, the popper can overflow even if the
1510
+ // reference is not overflowing as well (e.g. virtual elements with no
1511
+ // width or height)
1512
+
1513
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1514
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1515
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1516
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1517
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1518
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1519
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1520
+ var tetherMax = offset + maxOffset - offsetModifierValue;
1521
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1522
+ popperOffsets[mainAxis] = preventedOffset;
1523
+ data[mainAxis] = preventedOffset - offset;
1524
+ }
1525
+
1526
+ if (checkAltAxis) {
1527
+ var _offsetModifierState$2;
1528
+
1529
+ var _mainSide = mainAxis === 'x' ? top : left;
1530
+
1531
+ var _altSide = mainAxis === 'x' ? bottom : right;
1532
+
1533
+ var _offset = popperOffsets[altAxis];
1534
+
1535
+ var _len = altAxis === 'y' ? 'height' : 'width';
1536
+
1537
+ var _min = _offset + overflow[_mainSide];
1538
+
1539
+ var _max = _offset - overflow[_altSide];
1540
+
1541
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1542
+
1543
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1544
+
1545
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1546
+
1547
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1548
+
1549
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1550
+
1551
+ popperOffsets[altAxis] = _preventedOffset;
1552
+ data[altAxis] = _preventedOffset - _offset;
1553
+ }
1554
+
1555
+ state.modifiersData[name] = data;
1556
+ } // eslint-disable-next-line import/no-unused-modules
1557
+
1558
+
1559
+ var preventOverflow$1 = {
1560
+ name: 'preventOverflow',
1561
+ enabled: true,
1562
+ phase: 'main',
1563
+ fn: preventOverflow,
1564
+ requiresIfExists: ['offset']
1565
+ };
1566
+
1567
+ function getHTMLElementScroll(element) {
1568
+ return {
1569
+ scrollLeft: element.scrollLeft,
1570
+ scrollTop: element.scrollTop
1571
+ };
1572
+ }
1573
+
1574
+ function getNodeScroll(node) {
1575
+ if (node === getWindow(node) || !isHTMLElement$1(node)) {
1576
+ return getWindowScroll(node);
1577
+ } else {
1578
+ return getHTMLElementScroll(node);
1579
+ }
1580
+ }
1581
+
1582
+ function isElementScaled(element) {
1583
+ var rect = element.getBoundingClientRect();
1584
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
1585
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
1586
+ return scaleX !== 1 || scaleY !== 1;
1587
+ } // Returns the composite rect of an element relative to its offsetParent.
1588
+ // Composite means it takes into account transforms as well as layout.
1589
+
1590
+
1591
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1592
+ if (isFixed === void 0) {
1593
+ isFixed = false;
1594
+ }
1595
+
1596
+ var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
1597
+ var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
1598
+ var documentElement = getDocumentElement(offsetParent);
1599
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
1600
+ var scroll = {
1601
+ scrollLeft: 0,
1602
+ scrollTop: 0
1603
+ };
1604
+ var offsets = {
1605
+ x: 0,
1606
+ y: 0
1607
+ };
1608
+
1609
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1610
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1611
+ isScrollParent(documentElement)) {
1612
+ scroll = getNodeScroll(offsetParent);
1613
+ }
1614
+
1615
+ if (isHTMLElement$1(offsetParent)) {
1616
+ offsets = getBoundingClientRect(offsetParent, true);
1617
+ offsets.x += offsetParent.clientLeft;
1618
+ offsets.y += offsetParent.clientTop;
1619
+ } else if (documentElement) {
1620
+ offsets.x = getWindowScrollBarX(documentElement);
1621
+ }
1622
+ }
1623
+
1624
+ return {
1625
+ x: rect.left + scroll.scrollLeft - offsets.x,
1626
+ y: rect.top + scroll.scrollTop - offsets.y,
1627
+ width: rect.width,
1628
+ height: rect.height
1629
+ };
1630
+ }
1631
+
1632
+ function order(modifiers) {
1633
+ var map = new Map();
1634
+ var visited = new Set();
1635
+ var result = [];
1636
+ modifiers.forEach(function (modifier) {
1637
+ map.set(modifier.name, modifier);
1638
+ }); // On visiting object, check for its dependencies and visit them recursively
1639
+
1640
+ function sort(modifier) {
1641
+ visited.add(modifier.name);
1642
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1643
+ requires.forEach(function (dep) {
1644
+ if (!visited.has(dep)) {
1645
+ var depModifier = map.get(dep);
1646
+
1647
+ if (depModifier) {
1648
+ sort(depModifier);
1649
+ }
1650
+ }
1651
+ });
1652
+ result.push(modifier);
1653
+ }
1654
+
1655
+ modifiers.forEach(function (modifier) {
1656
+ if (!visited.has(modifier.name)) {
1657
+ // check for visited object
1658
+ sort(modifier);
1659
+ }
1660
+ });
1661
+ return result;
1662
+ }
1663
+
1664
+ function orderModifiers(modifiers) {
1665
+ // order based on dependencies
1666
+ var orderedModifiers = order(modifiers); // order based on phase
1667
+
1668
+ return modifierPhases.reduce(function (acc, phase) {
1669
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1670
+ return modifier.phase === phase;
1671
+ }));
1672
+ }, []);
1673
+ }
1674
+
1675
+ function debounce(fn) {
1676
+ var pending;
1677
+ return function () {
1678
+ if (!pending) {
1679
+ pending = new Promise(function (resolve) {
1680
+ Promise.resolve().then(function () {
1681
+ pending = undefined;
1682
+ resolve(fn());
1683
+ });
1684
+ });
1685
+ }
1686
+
1687
+ return pending;
1688
+ };
1689
+ }
1690
+
1691
+ function mergeByName(modifiers) {
1692
+ var merged = modifiers.reduce(function (merged, current) {
1693
+ var existing = merged[current.name];
1694
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1695
+ options: Object.assign({}, existing.options, current.options),
1696
+ data: Object.assign({}, existing.data, current.data)
1697
+ }) : current;
1698
+ return merged;
1699
+ }, {}); // IE11 does not support Object.values
1700
+
1701
+ return Object.keys(merged).map(function (key) {
1702
+ return merged[key];
1703
+ });
1704
+ }
1705
+
1706
+ var DEFAULT_OPTIONS = {
1707
+ placement: 'bottom',
1708
+ modifiers: [],
1709
+ strategy: 'absolute'
1710
+ };
1711
+
1712
+ function areValidElements() {
1713
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1714
+ args[_key] = arguments[_key];
1715
+ }
1716
+
1717
+ return !args.some(function (element) {
1718
+ return !(element && typeof element.getBoundingClientRect === 'function');
1719
+ });
1720
+ }
1721
+
1722
+ function popperGenerator(generatorOptions) {
1723
+ if (generatorOptions === void 0) {
1724
+ generatorOptions = {};
1725
+ }
1726
+
1727
+ var _generatorOptions = generatorOptions,
1728
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1729
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1730
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1731
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1732
+ return function createPopper(reference, popper, options) {
1733
+ if (options === void 0) {
1734
+ options = defaultOptions;
1735
+ }
1736
+
1737
+ var state = {
1738
+ placement: 'bottom',
1739
+ orderedModifiers: [],
1740
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1741
+ modifiersData: {},
1742
+ elements: {
1743
+ reference: reference,
1744
+ popper: popper
1745
+ },
1746
+ attributes: {},
1747
+ styles: {}
1748
+ };
1749
+ var effectCleanupFns = [];
1750
+ var isDestroyed = false;
1751
+ var instance = {
1752
+ state: state,
1753
+ setOptions: function setOptions(setOptionsAction) {
1754
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1755
+ cleanupModifierEffects();
1756
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1757
+ state.scrollParents = {
1758
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1759
+ popper: listScrollParents(popper)
1760
+ }; // Orders the modifiers based on their dependencies and `phase`
1761
+ // properties
1762
+
1763
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1764
+
1765
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1766
+ return m.enabled;
1767
+ });
1768
+ runModifierEffects();
1769
+ return instance.update();
1770
+ },
1771
+ // Sync update – it will always be executed, even if not necessary. This
1772
+ // is useful for low frequency updates where sync behavior simplifies the
1773
+ // logic.
1774
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1775
+ // prefer the async Popper#update method
1776
+ forceUpdate: function forceUpdate() {
1777
+ if (isDestroyed) {
1778
+ return;
1779
+ }
1780
+
1781
+ var _state$elements = state.elements,
1782
+ reference = _state$elements.reference,
1783
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1784
+ // anymore
1785
+
1786
+ if (!areValidElements(reference, popper)) {
1787
+ return;
1788
+ } // Store the reference and popper rects to be read by modifiers
1789
+
1790
+
1791
+ state.rects = {
1792
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1793
+ popper: getLayoutRect(popper)
1794
+ }; // Modifiers have the ability to reset the current update cycle. The
1795
+ // most common use case for this is the `flip` modifier changing the
1796
+ // placement, which then needs to re-run all the modifiers, because the
1797
+ // logic was previously ran for the previous placement and is therefore
1798
+ // stale/incorrect
1799
+
1800
+ state.reset = false;
1801
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1802
+ // is filled with the initial data specified by the modifier. This means
1803
+ // it doesn't persist and is fresh on each update.
1804
+ // To ensure persistent data, use `${name}#persistent`
1805
+
1806
+ state.orderedModifiers.forEach(function (modifier) {
1807
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1808
+ });
1809
+
1810
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1811
+ if (state.reset === true) {
1812
+ state.reset = false;
1813
+ index = -1;
1814
+ continue;
1815
+ }
1816
+
1817
+ var _state$orderedModifie = state.orderedModifiers[index],
1818
+ fn = _state$orderedModifie.fn,
1819
+ _state$orderedModifie2 = _state$orderedModifie.options,
1820
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1821
+ name = _state$orderedModifie.name;
1822
+
1823
+ if (typeof fn === 'function') {
1824
+ state = fn({
1825
+ state: state,
1826
+ options: _options,
1827
+ name: name,
1828
+ instance: instance
1829
+ }) || state;
1830
+ }
1831
+ }
1832
+ },
1833
+ // Async and optimistically optimized update – it will not be executed if
1834
+ // not necessary (debounced to run at most once-per-tick)
1835
+ update: debounce(function () {
1836
+ return new Promise(function (resolve) {
1837
+ instance.forceUpdate();
1838
+ resolve(state);
1839
+ });
1840
+ }),
1841
+ destroy: function destroy() {
1842
+ cleanupModifierEffects();
1843
+ isDestroyed = true;
1844
+ }
1845
+ };
1846
+
1847
+ if (!areValidElements(reference, popper)) {
1848
+ return instance;
1849
+ }
1850
+
1851
+ instance.setOptions(options).then(function (state) {
1852
+ if (!isDestroyed && options.onFirstUpdate) {
1853
+ options.onFirstUpdate(state);
1854
+ }
1855
+ }); // Modifiers have the ability to execute arbitrary code before the first
1856
+ // update cycle runs. They will be executed in the same order as the update
1857
+ // cycle. This is useful when a modifier adds some persistent data that
1858
+ // other modifiers need to use, but the modifier is run after the dependent
1859
+ // one.
1860
+
1861
+ function runModifierEffects() {
1862
+ state.orderedModifiers.forEach(function (_ref) {
1863
+ var name = _ref.name,
1864
+ _ref$options = _ref.options,
1865
+ options = _ref$options === void 0 ? {} : _ref$options,
1866
+ effect = _ref.effect;
1867
+
1868
+ if (typeof effect === 'function') {
1869
+ var cleanupFn = effect({
1870
+ state: state,
1871
+ name: name,
1872
+ instance: instance,
1873
+ options: options
1874
+ });
1875
+
1876
+ var noopFn = function noopFn() {};
1877
+
1878
+ effectCleanupFns.push(cleanupFn || noopFn);
1879
+ }
1880
+ });
1881
+ }
1882
+
1883
+ function cleanupModifierEffects() {
1884
+ effectCleanupFns.forEach(function (fn) {
1885
+ return fn();
1886
+ });
1887
+ effectCleanupFns = [];
1888
+ }
1889
+
1890
+ return instance;
1891
+ };
1892
+ }
1893
+
1894
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1895
+ var createPopper = /*#__PURE__*/popperGenerator({
1896
+ defaultModifiers: defaultModifiers
1897
+ }); // eslint-disable-next-line import/no-unused-modules
1898
+
1899
+ function getPopperUtilityClass(slot) {
1900
+ return generateUtilityClass('MuiPopper', slot);
1901
+ }
1902
+ generateUtilityClasses('MuiPopper', ['root']);
1903
+
1904
+ const _excluded$1 = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
1905
+ _excluded2 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
1906
+ function flipPlacement(placement, direction) {
1907
+ if (direction === 'ltr') {
1908
+ return placement;
1909
+ }
1910
+ switch (placement) {
1911
+ case 'bottom-end':
1912
+ return 'bottom-start';
1913
+ case 'bottom-start':
1914
+ return 'bottom-end';
1915
+ case 'top-end':
1916
+ return 'top-start';
1917
+ case 'top-start':
1918
+ return 'top-end';
1919
+ default:
1920
+ return placement;
1921
+ }
1922
+ }
1923
+ function resolveAnchorEl(anchorEl) {
1924
+ return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
1925
+ }
1926
+ function isHTMLElement(element) {
1927
+ return element.nodeType !== undefined;
1928
+ }
1929
+ function isVirtualElement(element) {
1930
+ return !isHTMLElement(element);
1931
+ }
1932
+ const useUtilityClasses = ownerState => {
1933
+ const {
1934
+ classes
1935
+ } = ownerState;
1936
+ const slots = {
1937
+ root: ['root']
1938
+ };
1939
+ return composeClasses(slots, getPopperUtilityClass, classes);
1940
+ };
1941
+ const defaultPopperOptions = {};
1942
+ const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(props, forwardedRef) {
1943
+ var _slots$root;
1944
+ const {
1945
+ anchorEl,
1946
+ children,
1947
+ direction,
1948
+ disablePortal,
1949
+ modifiers,
1950
+ open,
1951
+ placement: initialPlacement,
1952
+ popperOptions,
1953
+ popperRef: popperRefProp,
1954
+ slotProps = {},
1955
+ slots = {},
1956
+ TransitionProps
1957
+ // @ts-ignore internal logic
1958
+ // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1959
+ } = props,
1960
+ other = _objectWithoutPropertiesLoose(props, _excluded$1);
1961
+ const tooltipRef = React$1.useRef(null);
1962
+ const ownRef = useForkRef(tooltipRef, forwardedRef);
1963
+ const popperRef = React$1.useRef(null);
1964
+ const handlePopperRef = useForkRef(popperRef, popperRefProp);
1965
+ const handlePopperRefRef = React$1.useRef(handlePopperRef);
1966
+ useEnhancedEffect(() => {
1967
+ handlePopperRefRef.current = handlePopperRef;
1968
+ }, [handlePopperRef]);
1969
+ React$1.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1970
+ const rtlPlacement = flipPlacement(initialPlacement, direction);
1971
+ /**
1972
+ * placement initialized from prop but can change during lifetime if modifiers.flip.
1973
+ * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
1974
+ */
1975
+ const [placement, setPlacement] = React$1.useState(rtlPlacement);
1976
+ const [resolvedAnchorElement, setResolvedAnchorElement] = React$1.useState(resolveAnchorEl(anchorEl));
1977
+ React$1.useEffect(() => {
1978
+ if (popperRef.current) {
1979
+ popperRef.current.forceUpdate();
1980
+ }
1981
+ });
1982
+ React$1.useEffect(() => {
1983
+ if (anchorEl) {
1984
+ setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1985
+ }
1986
+ }, [anchorEl]);
1987
+ useEnhancedEffect(() => {
1988
+ if (!resolvedAnchorElement || !open) {
1989
+ return undefined;
1990
+ }
1991
+ const handlePopperUpdate = data => {
1992
+ setPlacement(data.placement);
1993
+ };
1994
+ if (process.env.NODE_ENV !== 'production') {
1995
+ if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
1996
+ const box = resolvedAnchorElement.getBoundingClientRect();
1997
+ if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
1998
+ console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
1999
+ }
2000
+ }
2001
+ }
2002
+ let popperModifiers = [{
2003
+ name: 'preventOverflow',
2004
+ options: {
2005
+ altBoundary: disablePortal
2006
+ }
2007
+ }, {
2008
+ name: 'flip',
2009
+ options: {
2010
+ altBoundary: disablePortal
2011
+ }
2012
+ }, {
2013
+ name: 'onUpdate',
2014
+ enabled: true,
2015
+ phase: 'afterWrite',
2016
+ fn: ({
2017
+ state
2018
+ }) => {
2019
+ handlePopperUpdate(state);
2020
+ }
2021
+ }];
2022
+ if (modifiers != null) {
2023
+ popperModifiers = popperModifiers.concat(modifiers);
2024
+ }
2025
+ if (popperOptions && popperOptions.modifiers != null) {
2026
+ popperModifiers = popperModifiers.concat(popperOptions.modifiers);
2027
+ }
2028
+ const popper = createPopper(resolvedAnchorElement, tooltipRef.current, _extends$1({
2029
+ placement: rtlPlacement
2030
+ }, popperOptions, {
2031
+ modifiers: popperModifiers
2032
+ }));
2033
+ handlePopperRefRef.current(popper);
2034
+ return () => {
2035
+ popper.destroy();
2036
+ handlePopperRefRef.current(null);
2037
+ };
2038
+ }, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
2039
+ const childProps = {
2040
+ placement: placement
2041
+ };
2042
+ if (TransitionProps !== null) {
2043
+ childProps.TransitionProps = TransitionProps;
2044
+ }
2045
+ const classes = useUtilityClasses(props);
2046
+ const Root = (_slots$root = slots.root) != null ? _slots$root : 'div';
2047
+ const rootProps = useSlotProps({
2048
+ elementType: Root,
2049
+ externalSlotProps: slotProps.root,
2050
+ externalForwardedProps: other,
2051
+ additionalProps: {
2052
+ role: 'tooltip',
2053
+ ref: ownRef
2054
+ },
2055
+ ownerState: props,
2056
+ className: classes.root
2057
+ });
2058
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Root, _extends$1({}, rootProps, {
2059
+ children: typeof children === 'function' ? children(childProps) : children
2060
+ }));
2061
+ });
2062
+
2063
+ /**
2064
+ * @ignore - internal component.
2065
+ */
2066
+ const Popper$2 = /*#__PURE__*/React$1.forwardRef(function Popper(props, forwardedRef) {
2067
+ const {
2068
+ anchorEl,
2069
+ children,
2070
+ container: containerProp,
2071
+ direction = 'ltr',
2072
+ disablePortal = false,
2073
+ keepMounted = false,
2074
+ modifiers,
2075
+ open,
2076
+ placement = 'bottom',
2077
+ popperOptions = defaultPopperOptions,
2078
+ popperRef,
2079
+ style,
2080
+ transition = false,
2081
+ slotProps = {},
2082
+ slots = {}
2083
+ } = props,
2084
+ other = _objectWithoutPropertiesLoose(props, _excluded2);
2085
+ const [exited, setExited] = React$1.useState(true);
2086
+ const handleEnter = () => {
2087
+ setExited(false);
2088
+ };
2089
+ const handleExited = () => {
2090
+ setExited(true);
2091
+ };
2092
+ if (!keepMounted && !open && (!transition || exited)) {
2093
+ return null;
2094
+ }
2095
+
2096
+ // If the container prop is provided, use that
2097
+ // If the anchorEl prop is provided, use its parent body element as the container
2098
+ // If neither are provided let the Modal take care of choosing the container
2099
+ let container;
2100
+ if (containerProp) {
2101
+ container = containerProp;
2102
+ } else if (anchorEl) {
2103
+ const resolvedAnchorEl = resolveAnchorEl(anchorEl);
2104
+ container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;
2105
+ }
2106
+ const display = !open && keepMounted && (!transition || exited) ? 'none' : undefined;
2107
+ const transitionProps = transition ? {
2108
+ in: open,
2109
+ onEnter: handleEnter,
2110
+ onExited: handleExited
2111
+ } : undefined;
2112
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Portal, {
2113
+ disablePortal: disablePortal,
2114
+ container: container,
2115
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, _extends$1({
2116
+ anchorEl: anchorEl,
2117
+ direction: direction,
2118
+ disablePortal: disablePortal,
2119
+ modifiers: modifiers,
2120
+ ref: forwardedRef,
2121
+ open: transition ? !exited : open,
2122
+ placement: placement,
2123
+ popperOptions: popperOptions,
2124
+ popperRef: popperRef,
2125
+ slotProps: slotProps,
2126
+ slots: slots
2127
+ }, other, {
2128
+ style: _extends$1({
2129
+ // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
2130
+ position: 'fixed',
2131
+ // Fix Popper.js display issue
2132
+ top: 0,
2133
+ left: 0,
2134
+ display
2135
+ }, style),
2136
+ TransitionProps: transitionProps,
2137
+ children: children
2138
+ }))
2139
+ });
2140
+ });
2141
+ process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes */ = {
2142
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
2143
+ // │ These PropTypes are generated from the TypeScript type definitions. │
2144
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2145
+ // └─────────────────────────────────────────────────────────────────────┘
2146
+ /**
2147
+ * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2148
+ * or a function that returns either.
2149
+ * It's used to set the position of the popper.
2150
+ * The return value will passed as the reference object of the Popper instance.
2151
+ */
2152
+ anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {
2153
+ if (props.open) {
2154
+ const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
2155
+ if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
2156
+ const box = resolvedAnchorEl.getBoundingClientRect();
2157
+ if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
2158
+ return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
2159
+ }
2160
+ } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
2161
+ return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\n'));
2162
+ }
2163
+ }
2164
+ return null;
2165
+ }),
2166
+ /**
2167
+ * Popper render function or node.
2168
+ */
2169
+ children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2170
+ /**
2171
+ * An HTML element or function that returns one.
2172
+ * The `container` will have the portal children appended to it.
2173
+ *
2174
+ * You can also provide a callback, which is called in a React layout effect.
2175
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
2176
+ *
2177
+ * By default, it uses the body of the top-level document object,
2178
+ * so it's simply `document.body` most of the time.
2179
+ */
2180
+ container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2181
+ /**
2182
+ * Direction of the text.
2183
+ * @default 'ltr'
2184
+ */
2185
+ direction: PropTypes.oneOf(['ltr', 'rtl']),
2186
+ /**
2187
+ * The `children` will be under the DOM hierarchy of the parent component.
2188
+ * @default false
2189
+ */
2190
+ disablePortal: PropTypes.bool,
2191
+ /**
2192
+ * Always keep the children in the DOM.
2193
+ * This prop can be useful in SEO situation or
2194
+ * when you want to maximize the responsiveness of the Popper.
2195
+ * @default false
2196
+ */
2197
+ keepMounted: PropTypes.bool,
2198
+ /**
2199
+ * Popper.js is based on a "plugin-like" architecture,
2200
+ * most of its features are fully encapsulated "modifiers".
2201
+ *
2202
+ * A modifier is a function that is called each time Popper.js needs to
2203
+ * compute the position of the popper.
2204
+ * For this reason, modifiers should be very performant to avoid bottlenecks.
2205
+ * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2206
+ */
2207
+ modifiers: PropTypes.arrayOf(PropTypes.shape({
2208
+ data: PropTypes.object,
2209
+ effect: PropTypes.func,
2210
+ enabled: PropTypes.bool,
2211
+ fn: PropTypes.func,
2212
+ name: PropTypes.any,
2213
+ options: PropTypes.object,
2214
+ phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2215
+ requires: PropTypes.arrayOf(PropTypes.string),
2216
+ requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2217
+ })),
2218
+ /**
2219
+ * If `true`, the component is shown.
2220
+ */
2221
+ open: PropTypes.bool.isRequired,
2222
+ /**
2223
+ * Popper placement.
2224
+ * @default 'bottom'
2225
+ */
2226
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2227
+ /**
2228
+ * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2229
+ * @default {}
2230
+ */
2231
+ popperOptions: PropTypes.shape({
2232
+ modifiers: PropTypes.array,
2233
+ onFirstUpdate: PropTypes.func,
2234
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2235
+ strategy: PropTypes.oneOf(['absolute', 'fixed'])
2236
+ }),
2237
+ /**
2238
+ * A ref that points to the used popper instance.
2239
+ */
2240
+ popperRef: refType,
2241
+ /**
2242
+ * The props used for each slot inside the Popper.
2243
+ * @default {}
2244
+ */
2245
+ slotProps: PropTypes.shape({
2246
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2247
+ }),
2248
+ /**
2249
+ * The components used for each slot inside the Popper.
2250
+ * Either a string to use a HTML element or a component.
2251
+ * @default {}
2252
+ */
2253
+ slots: PropTypes.shape({
2254
+ root: PropTypes.elementType
2255
+ }),
2256
+ /**
2257
+ * Help supporting a react-transition-group/Transition component.
2258
+ * @default false
2259
+ */
2260
+ transition: PropTypes.bool
2261
+ } : void 0;
2262
+ var BasePopper$1 = Popper$2;
2263
+
2264
+ const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
2265
+ const PopperRoot = styled(BasePopper$1, {
2266
+ name: 'MuiPopper',
2267
+ slot: 'Root',
2268
+ overridesResolver: (props, styles) => styles.root
2269
+ })({});
2270
+
2271
+ /**
2272
+ *
2273
+ * Demos:
2274
+ *
2275
+ * - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
2276
+ * - [Menu](https://mui.com/material-ui/react-menu/)
2277
+ * - [Popper](https://mui.com/material-ui/react-popper/)
2278
+ *
2279
+ * API:
2280
+ *
2281
+ * - [Popper API](https://mui.com/material-ui/api/popper/)
2282
+ */
2283
+ const Popper = /*#__PURE__*/React$1.forwardRef(function Popper(inProps, ref) {
2284
+ var _slots$root;
2285
+ const theme = default_1();
2286
+ const props = useDefaultProps({
2287
+ props: inProps,
2288
+ name: 'MuiPopper'
2289
+ });
2290
+ const {
2291
+ anchorEl,
2292
+ component,
2293
+ components,
2294
+ componentsProps,
2295
+ container,
2296
+ disablePortal,
2297
+ keepMounted,
2298
+ modifiers,
2299
+ open,
2300
+ placement,
2301
+ popperOptions,
2302
+ popperRef,
2303
+ transition,
2304
+ slots,
2305
+ slotProps
2306
+ } = props,
2307
+ other = _objectWithoutPropertiesLoose(props, _excluded);
2308
+ const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
2309
+ const otherProps = _extends$1({
2310
+ anchorEl,
2311
+ container,
2312
+ disablePortal,
2313
+ keepMounted,
2314
+ modifiers,
2315
+ open,
2316
+ placement,
2317
+ popperOptions,
2318
+ popperRef,
2319
+ transition
2320
+ }, other);
2321
+ return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, _extends$1({
2322
+ as: component,
2323
+ direction: theme == null ? void 0 : theme.direction,
2324
+ slots: {
2325
+ root: RootComponent
2326
+ },
2327
+ slotProps: slotProps != null ? slotProps : componentsProps
2328
+ }, otherProps, {
2329
+ ref: ref
2330
+ }));
2331
+ });
2332
+ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
2333
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
2334
+ // │ These PropTypes are generated from the TypeScript type definitions. │
2335
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2336
+ // └─────────────────────────────────────────────────────────────────────┘
2337
+ /**
2338
+ * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2339
+ * or a function that returns either.
2340
+ * It's used to set the position of the popper.
2341
+ * The return value will passed as the reference object of the Popper instance.
2342
+ */
2343
+ anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
2344
+ /**
2345
+ * Popper render function or node.
2346
+ */
2347
+ children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2348
+ /**
2349
+ * The component used for the root node.
2350
+ * Either a string to use a HTML element or a component.
2351
+ */
2352
+ component: PropTypes.elementType,
2353
+ /**
2354
+ * The components used for each slot inside the Popper.
2355
+ * Either a string to use a HTML element or a component.
2356
+ * @default {}
2357
+ */
2358
+ components: PropTypes.shape({
2359
+ Root: PropTypes.elementType
2360
+ }),
2361
+ /**
2362
+ * The props used for each slot inside the Popper.
2363
+ * @default {}
2364
+ */
2365
+ componentsProps: PropTypes.shape({
2366
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2367
+ }),
2368
+ /**
2369
+ * An HTML element or function that returns one.
2370
+ * The `container` will have the portal children appended to it.
2371
+ *
2372
+ * You can also provide a callback, which is called in a React layout effect.
2373
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
2374
+ *
2375
+ * By default, it uses the body of the top-level document object,
2376
+ * so it's simply `document.body` most of the time.
2377
+ */
2378
+ container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2379
+ /**
2380
+ * The `children` will be under the DOM hierarchy of the parent component.
2381
+ * @default false
2382
+ */
2383
+ disablePortal: PropTypes.bool,
2384
+ /**
2385
+ * Always keep the children in the DOM.
2386
+ * This prop can be useful in SEO situation or
2387
+ * when you want to maximize the responsiveness of the Popper.
2388
+ * @default false
2389
+ */
2390
+ keepMounted: PropTypes.bool,
2391
+ /**
2392
+ * Popper.js is based on a "plugin-like" architecture,
2393
+ * most of its features are fully encapsulated "modifiers".
2394
+ *
2395
+ * A modifier is a function that is called each time Popper.js needs to
2396
+ * compute the position of the popper.
2397
+ * For this reason, modifiers should be very performant to avoid bottlenecks.
2398
+ * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2399
+ */
2400
+ modifiers: PropTypes.arrayOf(PropTypes.shape({
2401
+ data: PropTypes.object,
2402
+ effect: PropTypes.func,
2403
+ enabled: PropTypes.bool,
2404
+ fn: PropTypes.func,
2405
+ name: PropTypes.any,
2406
+ options: PropTypes.object,
2407
+ phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2408
+ requires: PropTypes.arrayOf(PropTypes.string),
2409
+ requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2410
+ })),
2411
+ /**
2412
+ * If `true`, the component is shown.
2413
+ */
2414
+ open: PropTypes.bool.isRequired,
2415
+ /**
2416
+ * Popper placement.
2417
+ * @default 'bottom'
2418
+ */
2419
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2420
+ /**
2421
+ * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2422
+ * @default {}
2423
+ */
2424
+ popperOptions: PropTypes.shape({
2425
+ modifiers: PropTypes.array,
2426
+ onFirstUpdate: PropTypes.func,
2427
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2428
+ strategy: PropTypes.oneOf(['absolute', 'fixed'])
2429
+ }),
2430
+ /**
2431
+ * A ref that points to the used popper instance.
2432
+ */
2433
+ popperRef: refType,
2434
+ /**
2435
+ * The props used for each slot inside the Popper.
2436
+ * @default {}
2437
+ */
2438
+ slotProps: PropTypes.shape({
2439
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2440
+ }),
2441
+ /**
2442
+ * The components used for each slot inside the Popper.
2443
+ * Either a string to use a HTML element or a component.
2444
+ * @default {}
2445
+ */
2446
+ slots: PropTypes.shape({
2447
+ root: PropTypes.elementType
2448
+ }),
2449
+ /**
2450
+ * The system prop that allows defining system overrides as well as additional CSS styles.
2451
+ */
2452
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
2453
+ /**
2454
+ * Help supporting a react-transition-group/Transition component.
2455
+ * @default false
2456
+ */
2457
+ transition: PropTypes.bool
2458
+ } : void 0;
2459
+ var Popper$1 = Popper;
2460
+
2461
+ const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
2462
+ return /*#__PURE__*/React__default.createElement(Popper$1, _extends({}, props, {
2463
+ ref: ref,
2464
+ container: () => document.getElementById('redsift-app-container')
2465
+ }));
2466
+ });
2467
+
2468
+ export { BaseButton as B, BaseCheckbox as a, BaseIcon as b, BasePopper as c, muiIconToDSIcon as m };
2469
+ //# sourceMappingURL=BasePopper.js.map