@inploi/plugin-job-alerts 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1171,163 +1171,87 @@ const compat_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
1171
1171
  useTransition: k,
1172
1172
  version: vn
1173
1173
  }, Symbol.toStringTag, { value: "Module" }));
1174
- function hasWindow() {
1174
+ function hasWindow$1() {
1175
1175
  return typeof window !== "undefined";
1176
1176
  }
1177
- function getNodeName(node) {
1178
- if (isNode(node)) {
1177
+ function getNodeName$1(node) {
1178
+ if (isNode$1(node)) {
1179
1179
  return (node.nodeName || "").toLowerCase();
1180
1180
  }
1181
1181
  return "#document";
1182
1182
  }
1183
- function getWindow(node) {
1183
+ function getWindow$1(node) {
1184
1184
  var _node$ownerDocument;
1185
1185
  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1186
1186
  }
1187
- function getDocumentElement(node) {
1187
+ function getDocumentElement$1(node) {
1188
1188
  var _ref;
1189
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1189
+ return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1190
1190
  }
1191
- function isNode(value) {
1192
- if (!hasWindow()) {
1191
+ function isNode$1(value) {
1192
+ if (!hasWindow$1()) {
1193
1193
  return false;
1194
1194
  }
1195
- return value instanceof Node || value instanceof getWindow(value).Node;
1195
+ return value instanceof Node || value instanceof getWindow$1(value).Node;
1196
1196
  }
1197
- function isElement(value) {
1198
- if (!hasWindow()) {
1197
+ function isElement$1(value) {
1198
+ if (!hasWindow$1()) {
1199
1199
  return false;
1200
1200
  }
1201
- return value instanceof Element || value instanceof getWindow(value).Element;
1201
+ return value instanceof Element || value instanceof getWindow$1(value).Element;
1202
1202
  }
1203
- function isHTMLElement(value) {
1204
- if (!hasWindow()) {
1203
+ function isHTMLElement$1(value) {
1204
+ if (!hasWindow$1()) {
1205
1205
  return false;
1206
1206
  }
1207
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1207
+ return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
1208
1208
  }
1209
- function isShadowRoot(value) {
1210
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
1209
+ function isShadowRoot$1(value) {
1210
+ if (!hasWindow$1() || typeof ShadowRoot === "undefined") {
1211
1211
  return false;
1212
1212
  }
1213
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1213
+ return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
1214
1214
  }
1215
1215
  const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
1216
- function isOverflowElement(element) {
1216
+ function isOverflowElement$1(element) {
1217
1217
  const {
1218
1218
  overflow,
1219
1219
  overflowX,
1220
1220
  overflowY,
1221
1221
  display
1222
- } = getComputedStyle$1(element);
1222
+ } = getComputedStyle$2(element);
1223
1223
  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1224
1224
  }
1225
- const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
1226
- function isTableElement(element) {
1227
- return tableElements.has(getNodeName(element));
1228
- }
1229
- const topLayerSelectors = [":popover-open", ":modal"];
1230
- function isTopLayer(element) {
1231
- return topLayerSelectors.some((selector) => {
1232
- try {
1233
- return element.matches(selector);
1234
- } catch (_e) {
1235
- return false;
1236
- }
1237
- });
1238
- }
1239
- const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
1240
- const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
1241
- const containValues = ["paint", "layout", "strict", "content"];
1242
- function isContainingBlock(elementOrCss) {
1243
- const webkit = isWebKit$1();
1244
- const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
1245
- return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
1246
- }
1247
- function getContainingBlock(element) {
1248
- let currentNode = getParentNode(element);
1249
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1250
- if (isContainingBlock(currentNode)) {
1251
- return currentNode;
1252
- } else if (isTopLayer(currentNode)) {
1253
- return null;
1254
- }
1255
- currentNode = getParentNode(currentNode);
1256
- }
1257
- return null;
1258
- }
1259
- function isWebKit$1() {
1225
+ function isWebKit$2() {
1260
1226
  if (typeof CSS === "undefined" || !CSS.supports)
1261
1227
  return false;
1262
1228
  return CSS.supports("-webkit-backdrop-filter", "none");
1263
1229
  }
1264
1230
  const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1265
- function isLastTraversableNode(node) {
1266
- return lastTraversableNodeNames.has(getNodeName(node));
1231
+ function isLastTraversableNode$1(node) {
1232
+ return lastTraversableNodeNames.has(getNodeName$1(node));
1267
1233
  }
1268
- function getComputedStyle$1(element) {
1269
- return getWindow(element).getComputedStyle(element);
1234
+ function getComputedStyle$2(element) {
1235
+ return getWindow$1(element).getComputedStyle(element);
1270
1236
  }
1271
- function getNodeScroll(element) {
1272
- if (isElement(element)) {
1273
- return {
1274
- scrollLeft: element.scrollLeft,
1275
- scrollTop: element.scrollTop
1276
- };
1277
- }
1278
- return {
1279
- scrollLeft: element.scrollX,
1280
- scrollTop: element.scrollY
1281
- };
1282
- }
1283
- function getParentNode(node) {
1284
- if (getNodeName(node) === "html") {
1237
+ function getParentNode$1(node) {
1238
+ if (getNodeName$1(node) === "html") {
1285
1239
  return node;
1286
1240
  }
1287
1241
  const result = (
1288
1242
  // Step into the shadow DOM of the parent of a slotted node.
1289
1243
  node.assignedSlot || // DOM Element detected.
1290
1244
  node.parentNode || // ShadowRoot detected.
1291
- isShadowRoot(node) && node.host || // Fallback.
1292
- getDocumentElement(node)
1245
+ isShadowRoot$1(node) && node.host || // Fallback.
1246
+ getDocumentElement$1(node)
1293
1247
  );
1294
- return isShadowRoot(result) ? result.host : result;
1295
- }
1296
- function getNearestOverflowAncestor(node) {
1297
- const parentNode = getParentNode(node);
1298
- if (isLastTraversableNode(parentNode)) {
1299
- return node.ownerDocument ? node.ownerDocument.body : node.body;
1300
- }
1301
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1302
- return parentNode;
1303
- }
1304
- return getNearestOverflowAncestor(parentNode);
1305
- }
1306
- function getOverflowAncestors(node, list, traverseIframes) {
1307
- var _node$ownerDocument2;
1308
- if (list === void 0) {
1309
- list = [];
1310
- }
1311
- if (traverseIframes === void 0) {
1312
- traverseIframes = true;
1313
- }
1314
- const scrollableAncestor = getNearestOverflowAncestor(node);
1315
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1316
- const win = getWindow(scrollableAncestor);
1317
- if (isBody) {
1318
- const frameElement = getFrameElement(win);
1319
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1320
- }
1321
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1322
- }
1323
- function getFrameElement(win) {
1324
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1248
+ return isShadowRoot$1(result) ? result.host : result;
1325
1249
  }
1326
1250
  const hasNavigator = typeof navigator !== "undefined";
1327
1251
  const nav = getNavigatorData();
1328
1252
  const platform$1 = getPlatform();
1329
1253
  const userAgent = getUserAgent();
1330
- const isWebKit = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none");
1254
+ const isWebKit$1 = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none");
1331
1255
  const isIOS = (
1332
1256
  // iPads can claim to be MacIntel
1333
1257
  nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform)
@@ -1534,14 +1458,14 @@ function hasInsetScrollbars(referenceElement) {
1534
1458
  return false;
1535
1459
  }
1536
1460
  const doc = ownerDocument(referenceElement);
1537
- const win = getWindow(doc);
1461
+ const win = getWindow$1(doc);
1538
1462
  return win.innerWidth - doc.documentElement.clientWidth > 0;
1539
1463
  }
1540
1464
  function preventScrollOverlayScrollbars(referenceElement) {
1541
1465
  const doc = ownerDocument(referenceElement);
1542
1466
  const html = doc.documentElement;
1543
1467
  const body = doc.body;
1544
- const elementToLock = isOverflowElement(html) ? html : body;
1468
+ const elementToLock = isOverflowElement$1(html) ? html : body;
1545
1469
  const originalOverflow = elementToLock.style.overflow;
1546
1470
  elementToLock.style.overflow = "hidden";
1547
1471
  return () => {
@@ -1553,12 +1477,12 @@ function preventScrollInsetScrollbars(referenceElement) {
1553
1477
  const doc = ownerDocument(referenceElement);
1554
1478
  const html = doc.documentElement;
1555
1479
  const body = doc.body;
1556
- const win = getWindow(html);
1480
+ const win = getWindow$1(html);
1557
1481
  let scrollTop = 0;
1558
1482
  let scrollLeft = 0;
1559
1483
  const resizeFrame = AnimationFrame.create();
1560
1484
  const supportsStableScrollbarGutter = typeof CSS !== "undefined" && ((_a = CSS.supports) == null ? void 0 : _a.call(CSS, "scrollbar-gutter", "stable"));
1561
- if (isWebKit && (((_b = win.visualViewport) == null ? void 0 : _b.scale) ?? 1) !== 1) {
1485
+ if (isWebKit$1 && (((_b = win.visualViewport) == null ? void 0 : _b.scale) ?? 1) !== 1) {
1562
1486
  return () => {
1563
1487
  };
1564
1488
  }
@@ -1593,7 +1517,7 @@ function preventScrollInsetScrollbars(referenceElement) {
1593
1517
  const scrollbarHeight = Math.max(0, win.innerHeight - html.clientHeight);
1594
1518
  const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
1595
1519
  const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
1596
- const elementToLock = isOverflowElement(html) ? html : body;
1520
+ const elementToLock = isOverflowElement$1(html) ? html : body;
1597
1521
  if (supportsStableScrollbarGutter) {
1598
1522
  html.style.scrollbarGutter = scrollbarGutterValue;
1599
1523
  elementToLock.style.overflowY = "hidden";
@@ -1681,7 +1605,7 @@ class ScrollLocker {
1681
1605
  }
1682
1606
  const doc = ownerDocument(referenceElement);
1683
1607
  const html = doc.documentElement;
1684
- const htmlOverflowY = getWindow(html).getComputedStyle(html).overflowY;
1608
+ const htmlOverflowY = getWindow$1(html).getComputedStyle(html).overflowY;
1685
1609
  if (htmlOverflowY === "hidden" || htmlOverflowY === "clip") {
1686
1610
  this.restore = NOOP;
1687
1611
  return;
@@ -1767,7 +1691,7 @@ function contains(parent, child) {
1767
1691
  if (parent.contains(child)) {
1768
1692
  return true;
1769
1693
  }
1770
- if (rootNode && isShadowRoot(rootNode)) {
1694
+ if (rootNode && isShadowRoot$1(rootNode)) {
1771
1695
  let next = child;
1772
1696
  while (next) {
1773
1697
  if (parent === next) {
@@ -1801,7 +1725,7 @@ function getDocument(node) {
1801
1725
  return (node == null ? void 0 : node.ownerDocument) || document;
1802
1726
  }
1803
1727
  function isTypeableElement(element) {
1804
- return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
1728
+ return isHTMLElement$1(element) && element.matches(TYPEABLE_SELECTOR);
1805
1729
  }
1806
1730
  function isTypeableCombobox(element) {
1807
1731
  if (!element) {
@@ -1874,103 +1798,35 @@ function formatErrorMessage(code, ...args) {
1874
1798
  args.forEach((arg) => url.searchParams.append("args[]", arg));
1875
1799
  return `Base UI error #${code}; visit ${url} for the full message.`;
1876
1800
  }
1877
- const sides = ["top", "right", "bottom", "left"];
1878
- const min = Math.min;
1879
- const max = Math.max;
1880
- const round = Math.round;
1881
- const floor = Math.floor;
1882
- const createCoords = (v2) => ({
1883
- x: v2,
1884
- y: v2
1885
- });
1886
- const oppositeSideMap = {
1887
- left: "right",
1888
- right: "left",
1889
- bottom: "top",
1890
- top: "bottom"
1891
- };
1892
- const oppositeAlignmentMap = {
1893
- start: "end",
1894
- end: "start"
1895
- };
1896
- function clamp(start, value, end) {
1897
- return max(start, min(value, end));
1801
+ const min$1 = Math.min;
1802
+ const max$1 = Math.max;
1803
+ const round$1 = Math.round;
1804
+ function clamp$1(start, value, end) {
1805
+ return max$1(start, min$1(value, end));
1898
1806
  }
1899
- function evaluate(value, param) {
1807
+ function evaluate$1(value, param) {
1900
1808
  return typeof value === "function" ? value(param) : value;
1901
1809
  }
1902
- function getSide(placement) {
1810
+ function getSide$1(placement) {
1903
1811
  return placement.split("-")[0];
1904
1812
  }
1905
- function getAlignment(placement) {
1813
+ function getAlignment$1(placement) {
1906
1814
  return placement.split("-")[1];
1907
1815
  }
1908
- function getOppositeAxis(axis) {
1816
+ function getOppositeAxis$1(axis) {
1909
1817
  return axis === "x" ? "y" : "x";
1910
1818
  }
1911
- function getAxisLength(axis) {
1819
+ function getAxisLength$1(axis) {
1912
1820
  return axis === "y" ? "height" : "width";
1913
1821
  }
1914
1822
  const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
1915
- function getSideAxis(placement) {
1916
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
1823
+ function getSideAxis$1(placement) {
1824
+ return yAxisSides.has(getSide$1(placement)) ? "y" : "x";
1917
1825
  }
1918
- function getAlignmentAxis(placement) {
1919
- return getOppositeAxis(getSideAxis(placement));
1826
+ function getAlignmentAxis$1(placement) {
1827
+ return getOppositeAxis$1(getSideAxis$1(placement));
1920
1828
  }
1921
- function getAlignmentSides(placement, rects, rtl) {
1922
- if (rtl === void 0) {
1923
- rtl = false;
1924
- }
1925
- const alignment = getAlignment(placement);
1926
- const alignmentAxis = getAlignmentAxis(placement);
1927
- const length = getAxisLength(alignmentAxis);
1928
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
1929
- if (rects.reference[length] > rects.floating[length]) {
1930
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
1931
- }
1932
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
1933
- }
1934
- function getExpandedPlacements(placement) {
1935
- const oppositePlacement = getOppositePlacement(placement);
1936
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
1937
- }
1938
- function getOppositeAlignmentPlacement(placement) {
1939
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
1940
- }
1941
- const lrPlacement = ["left", "right"];
1942
- const rlPlacement = ["right", "left"];
1943
- const tbPlacement = ["top", "bottom"];
1944
- const btPlacement = ["bottom", "top"];
1945
- function getSideList(side, isStart, rtl) {
1946
- switch (side) {
1947
- case "top":
1948
- case "bottom":
1949
- if (rtl)
1950
- return isStart ? rlPlacement : lrPlacement;
1951
- return isStart ? lrPlacement : rlPlacement;
1952
- case "left":
1953
- case "right":
1954
- return isStart ? tbPlacement : btPlacement;
1955
- default:
1956
- return [];
1957
- }
1958
- }
1959
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
1960
- const alignment = getAlignment(placement);
1961
- let list = getSideList(getSide(placement), direction === "start", rtl);
1962
- if (alignment) {
1963
- list = list.map((side) => side + "-" + alignment);
1964
- if (flipAlignment) {
1965
- list = list.concat(list.map(getOppositeAlignmentPlacement));
1966
- }
1967
- }
1968
- return list;
1969
- }
1970
- function getOppositePlacement(placement) {
1971
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
1972
- }
1973
- function expandPaddingObject(padding) {
1829
+ function expandPaddingObject$1(padding) {
1974
1830
  return {
1975
1831
  top: 0,
1976
1832
  right: 0,
@@ -1979,32 +1835,14 @@ function expandPaddingObject(padding) {
1979
1835
  ...padding
1980
1836
  };
1981
1837
  }
1982
- function getPaddingObject(padding) {
1983
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
1838
+ function getPaddingObject$1(padding) {
1839
+ return typeof padding !== "number" ? expandPaddingObject$1(padding) : {
1984
1840
  top: padding,
1985
1841
  right: padding,
1986
1842
  bottom: padding,
1987
1843
  left: padding
1988
1844
  };
1989
1845
  }
1990
- function rectToClientRect(rect) {
1991
- const {
1992
- x: x2,
1993
- y: y2,
1994
- width,
1995
- height
1996
- } = rect;
1997
- return {
1998
- width,
1999
- height,
2000
- top: y2,
2001
- left: x2,
2002
- right: x2 + width,
2003
- bottom: y2 + height,
2004
- x: x2,
2005
- y: y2
2006
- };
2007
- }
2008
1846
  /*!
2009
1847
  * tabbable 6.3.0
2010
1848
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
@@ -2798,7 +2636,7 @@ function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, iner
2798
2636
  return;
2799
2637
  }
2800
2638
  [].forEach.call(parent.children, (node) => {
2801
- if (getNodeName(node) === "script") {
2639
+ if (getNodeName$1(node) === "script") {
2802
2640
  return;
2803
2641
  }
2804
2642
  if (elementsToKeep.has(node)) {
@@ -3140,7 +2978,7 @@ function useFloatingPortalNode(props = {}) {
3140
2978
  if (uniqueId == null) {
3141
2979
  return;
3142
2980
  }
3143
- const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
2981
+ const resolvedContainer = (containerProp && (isNode$1(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
3144
2982
  if (resolvedContainer == null) {
3145
2983
  if (containerRef.current) {
3146
2984
  containerRef.current = null;
@@ -3275,7 +3113,7 @@ function resolveRef(maybeRef) {
3275
3113
  return "current" in maybeRef ? maybeRef.current : maybeRef;
3276
3114
  }
3277
3115
  function getEventType(event, lastInteractionType) {
3278
- const win = getWindow(event.target);
3116
+ const win = getWindow$1(event.target);
3279
3117
  if (event instanceof win.KeyboardEvent) {
3280
3118
  return "keyboard";
3281
3119
  }
@@ -3300,7 +3138,7 @@ function clearDisconnectedPreviouslyFocusedElements() {
3300
3138
  }
3301
3139
  function addPreviouslyFocusedElement(element) {
3302
3140
  clearDisconnectedPreviouslyFocusedElements();
3303
- if (element && getNodeName(element) !== "body") {
3141
+ if (element && getNodeName$1(element) !== "body") {
3304
3142
  previouslyFocusedElements.push(element);
3305
3143
  if (previouslyFocusedElements.length > LIST_LIMIT) {
3306
3144
  previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
@@ -3328,7 +3166,7 @@ function isFocusable(element) {
3328
3166
  if (typeof element.checkVisibility === "function") {
3329
3167
  return element.checkVisibility();
3330
3168
  }
3331
- return getComputedStyle$1(element).display !== "none";
3169
+ return getComputedStyle$2(element).display !== "none";
3332
3170
  }
3333
3171
  function handleTabIndex(floatingFocusElement, orderRef) {
3334
3172
  var _a;
@@ -3509,7 +3347,7 @@ function FloatingFocusManager(props) {
3509
3347
  handleTabIndex(floatingFocusElement, orderRef);
3510
3348
  }
3511
3349
  if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && activeElement(getDocument(floatingFocusElement)) === getDocument(floatingFocusElement).body) {
3512
- if (isHTMLElement(floatingFocusElement)) {
3350
+ if (isHTMLElement$1(floatingFocusElement)) {
3513
3351
  floatingFocusElement.focus();
3514
3352
  if (restoreFocus === "popup") {
3515
3353
  restoreFocusFrame.request(() => {
@@ -3521,7 +3359,7 @@ function FloatingFocusManager(props) {
3521
3359
  const prevTabbableIndex = tabbableIndexRef.current;
3522
3360
  const tabbableContent = getTabbableContent();
3523
3361
  const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
3524
- if (isHTMLElement(nodeToFocus)) {
3362
+ if (isHTMLElement$1(nodeToFocus)) {
3525
3363
  nodeToFocus.focus();
3526
3364
  }
3527
3365
  }
@@ -3551,7 +3389,7 @@ function FloatingFocusManager(props) {
3551
3389
  dataRef.current.insideReactTree = false;
3552
3390
  });
3553
3391
  }
3554
- const domReferenceElement = isHTMLElement(domReference) ? domReference : null;
3392
+ const domReferenceElement = isHTMLElement$1(domReference) ? domReference : null;
3555
3393
  const cleanups = [];
3556
3394
  if (!floating && !domReferenceElement) {
3557
3395
  return void 0;
@@ -3604,7 +3442,7 @@ function FloatingFocusManager(props) {
3604
3442
  };
3605
3443
  }, [open, disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, getInsideElements, nextFocusableElement, previousFocusableElement]);
3606
3444
  useIsoLayoutEffect(() => {
3607
- if (!open || disabled || !isHTMLElement(floatingFocusElement)) {
3445
+ if (!open || disabled || !isHTMLElement$1(floatingFocusElement)) {
3608
3446
  return;
3609
3447
  }
3610
3448
  const doc = getDocument(floatingFocusElement);
@@ -3705,7 +3543,7 @@ function FloatingFocusManager(props) {
3705
3543
  const hasExplicitReturnFocus = typeof returnFocusRef.current !== "boolean";
3706
3544
  if (
3707
3545
  // eslint-disable-next-line react-hooks/exhaustive-deps
3708
- returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus
3546
+ returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement$1(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus
3709
3547
  // since it likely entered a different element which should be
3710
3548
  // respected: https://github.com/floating-ui/floating-ui/issues/2607
3711
3549
  (!hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)
@@ -3893,6 +3731,134 @@ function useClick(context, props = {}) {
3893
3731
  reference
3894
3732
  } : EMPTY_OBJECT, [enabled, reference]);
3895
3733
  }
3734
+ const sides = ["top", "right", "bottom", "left"];
3735
+ const min = Math.min;
3736
+ const max = Math.max;
3737
+ const round = Math.round;
3738
+ const floor = Math.floor;
3739
+ const createCoords = (v2) => ({
3740
+ x: v2,
3741
+ y: v2
3742
+ });
3743
+ const oppositeSideMap = {
3744
+ left: "right",
3745
+ right: "left",
3746
+ bottom: "top",
3747
+ top: "bottom"
3748
+ };
3749
+ function clamp(start, value, end) {
3750
+ return max(start, min(value, end));
3751
+ }
3752
+ function evaluate(value, param) {
3753
+ return typeof value === "function" ? value(param) : value;
3754
+ }
3755
+ function getSide(placement) {
3756
+ return placement.split("-")[0];
3757
+ }
3758
+ function getAlignment(placement) {
3759
+ return placement.split("-")[1];
3760
+ }
3761
+ function getOppositeAxis(axis) {
3762
+ return axis === "x" ? "y" : "x";
3763
+ }
3764
+ function getAxisLength(axis) {
3765
+ return axis === "y" ? "height" : "width";
3766
+ }
3767
+ function getSideAxis(placement) {
3768
+ const firstChar = placement[0];
3769
+ return firstChar === "t" || firstChar === "b" ? "y" : "x";
3770
+ }
3771
+ function getAlignmentAxis(placement) {
3772
+ return getOppositeAxis(getSideAxis(placement));
3773
+ }
3774
+ function getAlignmentSides(placement, rects, rtl) {
3775
+ if (rtl === void 0) {
3776
+ rtl = false;
3777
+ }
3778
+ const alignment = getAlignment(placement);
3779
+ const alignmentAxis = getAlignmentAxis(placement);
3780
+ const length = getAxisLength(alignmentAxis);
3781
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
3782
+ if (rects.reference[length] > rects.floating[length]) {
3783
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
3784
+ }
3785
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
3786
+ }
3787
+ function getExpandedPlacements(placement) {
3788
+ const oppositePlacement = getOppositePlacement(placement);
3789
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
3790
+ }
3791
+ function getOppositeAlignmentPlacement(placement) {
3792
+ return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
3793
+ }
3794
+ const lrPlacement = ["left", "right"];
3795
+ const rlPlacement = ["right", "left"];
3796
+ const tbPlacement = ["top", "bottom"];
3797
+ const btPlacement = ["bottom", "top"];
3798
+ function getSideList(side, isStart, rtl) {
3799
+ switch (side) {
3800
+ case "top":
3801
+ case "bottom":
3802
+ if (rtl)
3803
+ return isStart ? rlPlacement : lrPlacement;
3804
+ return isStart ? lrPlacement : rlPlacement;
3805
+ case "left":
3806
+ case "right":
3807
+ return isStart ? tbPlacement : btPlacement;
3808
+ default:
3809
+ return [];
3810
+ }
3811
+ }
3812
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
3813
+ const alignment = getAlignment(placement);
3814
+ let list = getSideList(getSide(placement), direction === "start", rtl);
3815
+ if (alignment) {
3816
+ list = list.map((side) => side + "-" + alignment);
3817
+ if (flipAlignment) {
3818
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
3819
+ }
3820
+ }
3821
+ return list;
3822
+ }
3823
+ function getOppositePlacement(placement) {
3824
+ const side = getSide(placement);
3825
+ return oppositeSideMap[side] + placement.slice(side.length);
3826
+ }
3827
+ function expandPaddingObject(padding) {
3828
+ return {
3829
+ top: 0,
3830
+ right: 0,
3831
+ bottom: 0,
3832
+ left: 0,
3833
+ ...padding
3834
+ };
3835
+ }
3836
+ function getPaddingObject(padding) {
3837
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
3838
+ top: padding,
3839
+ right: padding,
3840
+ bottom: padding,
3841
+ left: padding
3842
+ };
3843
+ }
3844
+ function rectToClientRect(rect) {
3845
+ const {
3846
+ x: x2,
3847
+ y: y2,
3848
+ width,
3849
+ height
3850
+ } = rect;
3851
+ return {
3852
+ width,
3853
+ height,
3854
+ top: y2,
3855
+ left: x2,
3856
+ right: x2 + width,
3857
+ bottom: y2 + height,
3858
+ x: x2,
3859
+ y: y2
3860
+ };
3861
+ }
3896
3862
  function computeCoordsFromPlacement(_ref, placement, rtl) {
3897
3863
  let {
3898
3864
  reference,
@@ -3948,6 +3914,63 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
3948
3914
  }
3949
3915
  return coords;
3950
3916
  }
3917
+ async function detectOverflow(state, options) {
3918
+ var _await$platform$isEle;
3919
+ if (options === void 0) {
3920
+ options = {};
3921
+ }
3922
+ const {
3923
+ x: x2,
3924
+ y: y2,
3925
+ platform: platform2,
3926
+ rects,
3927
+ elements,
3928
+ strategy
3929
+ } = state;
3930
+ const {
3931
+ boundary = "clippingAncestors",
3932
+ rootBoundary = "viewport",
3933
+ elementContext = "floating",
3934
+ altBoundary = false,
3935
+ padding = 0
3936
+ } = evaluate(options, state);
3937
+ const paddingObject = getPaddingObject(padding);
3938
+ const altContext = elementContext === "floating" ? "reference" : "floating";
3939
+ const element = elements[altBoundary ? altContext : elementContext];
3940
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
3941
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
3942
+ boundary,
3943
+ rootBoundary,
3944
+ strategy
3945
+ }));
3946
+ const rect = elementContext === "floating" ? {
3947
+ x: x2,
3948
+ y: y2,
3949
+ width: rects.floating.width,
3950
+ height: rects.floating.height
3951
+ } : rects.reference;
3952
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
3953
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
3954
+ x: 1,
3955
+ y: 1
3956
+ } : {
3957
+ x: 1,
3958
+ y: 1
3959
+ };
3960
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
3961
+ elements,
3962
+ rect,
3963
+ offsetParent,
3964
+ strategy
3965
+ }) : rect);
3966
+ return {
3967
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
3968
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
3969
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
3970
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
3971
+ };
3972
+ }
3973
+ const MAX_RESET_COUNT = 50;
3951
3974
  const computePosition$1 = async (reference, floating, config) => {
3952
3975
  const {
3953
3976
  placement = "bottom",
@@ -3955,7 +3978,10 @@ const computePosition$1 = async (reference, floating, config) => {
3955
3978
  middleware = [],
3956
3979
  platform: platform2
3957
3980
  } = config;
3958
- const validMiddleware = middleware.filter(Boolean);
3981
+ const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
3982
+ ...platform2,
3983
+ detectOverflow
3984
+ };
3959
3985
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
3960
3986
  let rects = await platform2.getElementRects({
3961
3987
  reference,
@@ -3967,13 +3993,17 @@ const computePosition$1 = async (reference, floating, config) => {
3967
3993
  y: y2
3968
3994
  } = computeCoordsFromPlacement(rects, placement, rtl);
3969
3995
  let statefulPlacement = placement;
3970
- let middlewareData = {};
3971
3996
  let resetCount = 0;
3972
- for (let i2 = 0; i2 < validMiddleware.length; i2++) {
3997
+ const middlewareData = {};
3998
+ for (let i2 = 0; i2 < middleware.length; i2++) {
3999
+ const currentMiddleware = middleware[i2];
4000
+ if (!currentMiddleware) {
4001
+ continue;
4002
+ }
3973
4003
  const {
3974
4004
  name,
3975
4005
  fn: fn2
3976
- } = validMiddleware[i2];
4006
+ } = currentMiddleware;
3977
4007
  const {
3978
4008
  x: nextX,
3979
4009
  y: nextY,
@@ -3987,7 +4017,7 @@ const computePosition$1 = async (reference, floating, config) => {
3987
4017
  strategy,
3988
4018
  middlewareData,
3989
4019
  rects,
3990
- platform: platform2,
4020
+ platform: platformWithDetectOverflow,
3991
4021
  elements: {
3992
4022
  reference,
3993
4023
  floating
@@ -3995,14 +4025,11 @@ const computePosition$1 = async (reference, floating, config) => {
3995
4025
  });
3996
4026
  x2 = nextX != null ? nextX : x2;
3997
4027
  y2 = nextY != null ? nextY : y2;
3998
- middlewareData = {
3999
- ...middlewareData,
4000
- [name]: {
4001
- ...middlewareData[name],
4002
- ...data
4003
- }
4028
+ middlewareData[name] = {
4029
+ ...middlewareData[name],
4030
+ ...data
4004
4031
  };
4005
- if (reset && resetCount <= 50) {
4032
+ if (reset && resetCount < MAX_RESET_COUNT) {
4006
4033
  resetCount++;
4007
4034
  if (typeof reset === "object") {
4008
4035
  if (reset.placement) {
@@ -4031,62 +4058,6 @@ const computePosition$1 = async (reference, floating, config) => {
4031
4058
  middlewareData
4032
4059
  };
4033
4060
  };
4034
- async function detectOverflow(state, options) {
4035
- var _await$platform$isEle;
4036
- if (options === void 0) {
4037
- options = {};
4038
- }
4039
- const {
4040
- x: x2,
4041
- y: y2,
4042
- platform: platform2,
4043
- rects,
4044
- elements,
4045
- strategy
4046
- } = state;
4047
- const {
4048
- boundary = "clippingAncestors",
4049
- rootBoundary = "viewport",
4050
- elementContext = "floating",
4051
- altBoundary = false,
4052
- padding = 0
4053
- } = evaluate(options, state);
4054
- const paddingObject = getPaddingObject(padding);
4055
- const altContext = elementContext === "floating" ? "reference" : "floating";
4056
- const element = elements[altBoundary ? altContext : elementContext];
4057
- const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
4058
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
4059
- boundary,
4060
- rootBoundary,
4061
- strategy
4062
- }));
4063
- const rect = elementContext === "floating" ? {
4064
- x: x2,
4065
- y: y2,
4066
- width: rects.floating.width,
4067
- height: rects.floating.height
4068
- } : rects.reference;
4069
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
4070
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
4071
- x: 1,
4072
- y: 1
4073
- } : {
4074
- x: 1,
4075
- y: 1
4076
- };
4077
- const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
4078
- elements,
4079
- rect,
4080
- offsetParent,
4081
- strategy
4082
- }) : rect);
4083
- return {
4084
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
4085
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
4086
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
4087
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
4088
- };
4089
- }
4090
4061
  const flip$2 = function(options) {
4091
4062
  if (options === void 0) {
4092
4063
  options = {};
@@ -4126,7 +4097,7 @@ const flip$2 = function(options) {
4126
4097
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
4127
4098
  }
4128
4099
  const placements = [initialPlacement, ...fallbackPlacements];
4129
- const overflow = await detectOverflow(state, detectOverflowOptions);
4100
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
4130
4101
  const overflows = [];
4131
4102
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
4132
4103
  if (checkMainAxis) {
@@ -4216,7 +4187,8 @@ const hide$3 = function(options) {
4216
4187
  options,
4217
4188
  async fn(state) {
4218
4189
  const {
4219
- rects
4190
+ rects,
4191
+ platform: platform2
4220
4192
  } = state;
4221
4193
  const {
4222
4194
  strategy = "referenceHidden",
@@ -4224,7 +4196,7 @@ const hide$3 = function(options) {
4224
4196
  } = evaluate(options, state);
4225
4197
  switch (strategy) {
4226
4198
  case "referenceHidden": {
4227
- const overflow = await detectOverflow(state, {
4199
+ const overflow = await platform2.detectOverflow(state, {
4228
4200
  ...detectOverflowOptions,
4229
4201
  elementContext: "reference"
4230
4202
  });
@@ -4237,7 +4209,7 @@ const hide$3 = function(options) {
4237
4209
  };
4238
4210
  }
4239
4211
  case "escaped": {
4240
- const overflow = await detectOverflow(state, {
4212
+ const overflow = await platform2.detectOverflow(state, {
4241
4213
  ...detectOverflowOptions,
4242
4214
  altBoundary: true
4243
4215
  });
@@ -4335,7 +4307,8 @@ const shift$2 = function(options) {
4335
4307
  const {
4336
4308
  x: x2,
4337
4309
  y: y2,
4338
- placement
4310
+ placement,
4311
+ platform: platform2
4339
4312
  } = state;
4340
4313
  const {
4341
4314
  mainAxis: checkMainAxis = true,
@@ -4358,7 +4331,7 @@ const shift$2 = function(options) {
4358
4331
  x: x2,
4359
4332
  y: y2
4360
4333
  };
4361
- const overflow = await detectOverflow(state, detectOverflowOptions);
4334
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
4362
4335
  const crossAxis = getSideAxis(getSide(placement));
4363
4336
  const mainAxis = getOppositeAxis(crossAxis);
4364
4337
  let mainAxisCoord = coords[mainAxis];
@@ -4481,7 +4454,7 @@ const size$2 = function(options) {
4481
4454
  },
4482
4455
  ...detectOverflowOptions
4483
4456
  } = evaluate(options, state);
4484
- const overflow = await detectOverflow(state, detectOverflowOptions);
4457
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
4485
4458
  const side = getSide(placement);
4486
4459
  const alignment = getAlignment(placement);
4487
4460
  const isYAxis = getSideAxis(placement) === "y";
@@ -4539,6 +4512,160 @@ const size$2 = function(options) {
4539
4512
  }
4540
4513
  };
4541
4514
  };
4515
+ function hasWindow() {
4516
+ return typeof window !== "undefined";
4517
+ }
4518
+ function getNodeName(node) {
4519
+ if (isNode(node)) {
4520
+ return (node.nodeName || "").toLowerCase();
4521
+ }
4522
+ return "#document";
4523
+ }
4524
+ function getWindow(node) {
4525
+ var _node$ownerDocument;
4526
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4527
+ }
4528
+ function getDocumentElement(node) {
4529
+ var _ref;
4530
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
4531
+ }
4532
+ function isNode(value) {
4533
+ if (!hasWindow()) {
4534
+ return false;
4535
+ }
4536
+ return value instanceof Node || value instanceof getWindow(value).Node;
4537
+ }
4538
+ function isElement(value) {
4539
+ if (!hasWindow()) {
4540
+ return false;
4541
+ }
4542
+ return value instanceof Element || value instanceof getWindow(value).Element;
4543
+ }
4544
+ function isHTMLElement(value) {
4545
+ if (!hasWindow()) {
4546
+ return false;
4547
+ }
4548
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
4549
+ }
4550
+ function isShadowRoot(value) {
4551
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
4552
+ return false;
4553
+ }
4554
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
4555
+ }
4556
+ function isOverflowElement(element) {
4557
+ const {
4558
+ overflow,
4559
+ overflowX,
4560
+ overflowY,
4561
+ display
4562
+ } = getComputedStyle$1(element);
4563
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
4564
+ }
4565
+ function isTableElement(element) {
4566
+ return /^(table|td|th)$/.test(getNodeName(element));
4567
+ }
4568
+ function isTopLayer(element) {
4569
+ try {
4570
+ if (element.matches(":popover-open")) {
4571
+ return true;
4572
+ }
4573
+ } catch (_e) {
4574
+ }
4575
+ try {
4576
+ return element.matches(":modal");
4577
+ } catch (_e) {
4578
+ return false;
4579
+ }
4580
+ }
4581
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
4582
+ const containRe = /paint|layout|strict|content/;
4583
+ const isNotNone = (value) => !!value && value !== "none";
4584
+ let isWebKitValue;
4585
+ function isContainingBlock(elementOrCss) {
4586
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
4587
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
4588
+ }
4589
+ function getContainingBlock(element) {
4590
+ let currentNode = getParentNode(element);
4591
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
4592
+ if (isContainingBlock(currentNode)) {
4593
+ return currentNode;
4594
+ } else if (isTopLayer(currentNode)) {
4595
+ return null;
4596
+ }
4597
+ currentNode = getParentNode(currentNode);
4598
+ }
4599
+ return null;
4600
+ }
4601
+ function isWebKit() {
4602
+ if (isWebKitValue == null) {
4603
+ isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
4604
+ }
4605
+ return isWebKitValue;
4606
+ }
4607
+ function isLastTraversableNode(node) {
4608
+ return /^(html|body|#document)$/.test(getNodeName(node));
4609
+ }
4610
+ function getComputedStyle$1(element) {
4611
+ return getWindow(element).getComputedStyle(element);
4612
+ }
4613
+ function getNodeScroll(element) {
4614
+ if (isElement(element)) {
4615
+ return {
4616
+ scrollLeft: element.scrollLeft,
4617
+ scrollTop: element.scrollTop
4618
+ };
4619
+ }
4620
+ return {
4621
+ scrollLeft: element.scrollX,
4622
+ scrollTop: element.scrollY
4623
+ };
4624
+ }
4625
+ function getParentNode(node) {
4626
+ if (getNodeName(node) === "html") {
4627
+ return node;
4628
+ }
4629
+ const result = (
4630
+ // Step into the shadow DOM of the parent of a slotted node.
4631
+ node.assignedSlot || // DOM Element detected.
4632
+ node.parentNode || // ShadowRoot detected.
4633
+ isShadowRoot(node) && node.host || // Fallback.
4634
+ getDocumentElement(node)
4635
+ );
4636
+ return isShadowRoot(result) ? result.host : result;
4637
+ }
4638
+ function getNearestOverflowAncestor(node) {
4639
+ const parentNode = getParentNode(node);
4640
+ if (isLastTraversableNode(parentNode)) {
4641
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
4642
+ }
4643
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
4644
+ return parentNode;
4645
+ }
4646
+ return getNearestOverflowAncestor(parentNode);
4647
+ }
4648
+ function getOverflowAncestors(node, list, traverseIframes) {
4649
+ var _node$ownerDocument2;
4650
+ if (list === void 0) {
4651
+ list = [];
4652
+ }
4653
+ if (traverseIframes === void 0) {
4654
+ traverseIframes = true;
4655
+ }
4656
+ const scrollableAncestor = getNearestOverflowAncestor(node);
4657
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
4658
+ const win = getWindow(scrollableAncestor);
4659
+ if (isBody) {
4660
+ const frameElement = getFrameElement(win);
4661
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
4662
+ } else {
4663
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4664
+ }
4665
+ }
4666
+ function getFrameElement(win) {
4667
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
4668
+ }
4542
4669
  function getCssDimensions$1(element) {
4543
4670
  const css = getComputedStyle$1(element);
4544
4671
  let width = parseFloat(css.width) || 0;
@@ -4587,7 +4714,7 @@ function getScale(element) {
4587
4714
  const noOffsets = /* @__PURE__ */ createCoords(0);
4588
4715
  function getVisualOffsets(element) {
4589
4716
  const win = getWindow(element);
4590
- if (!isWebKit$1() || !win.visualViewport) {
4717
+ if (!isWebKit() || !win.visualViewport) {
4591
4718
  return noOffsets;
4592
4719
  }
4593
4720
  return {
@@ -4696,7 +4823,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
4696
4823
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4697
4824
  scroll = getNodeScroll(offsetParent);
4698
4825
  }
4699
- if (isHTMLElement(offsetParent)) {
4826
+ if (isOffsetParentAnElement) {
4700
4827
  const offsetRect = getBoundingClientRect(offsetParent);
4701
4828
  scale = getScale(offsetParent);
4702
4829
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -4744,7 +4871,7 @@ function getViewportRect(element, strategy) {
4744
4871
  if (visualViewport) {
4745
4872
  width = visualViewport.width;
4746
4873
  height = visualViewport.height;
4747
- const visualViewportBased = isWebKit$1();
4874
+ const visualViewportBased = isWebKit();
4748
4875
  if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
4749
4876
  x2 = visualViewport.offsetLeft;
4750
4877
  y2 = visualViewport.offsetTop;
@@ -4770,7 +4897,6 @@ function getViewportRect(element, strategy) {
4770
4897
  y: y2
4771
4898
  };
4772
4899
  }
4773
- const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
4774
4900
  function getInnerBoundingClientRect(element, strategy) {
4775
4901
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
4776
4902
  const top = clientRect.top + element.clientTop;
@@ -4828,7 +4954,7 @@ function getClippingElementAncestors(element, cache) {
4828
4954
  if (!currentNodeIsContaining && computedStyle.position === "fixed") {
4829
4955
  currentContainingBlockComputedStyle = null;
4830
4956
  }
4831
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
4957
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
4832
4958
  if (shouldDropCurrentNode) {
4833
4959
  result = result.filter((ancestor) => ancestor !== currentNode);
4834
4960
  } else {
@@ -4848,20 +4974,23 @@ function getClippingRect(_ref) {
4848
4974
  } = _ref;
4849
4975
  const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
4850
4976
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
4851
- const firstClippingAncestor = clippingAncestors[0];
4852
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
4853
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
4854
- accRect.top = max(rect.top, accRect.top);
4855
- accRect.right = min(rect.right, accRect.right);
4856
- accRect.bottom = min(rect.bottom, accRect.bottom);
4857
- accRect.left = max(rect.left, accRect.left);
4858
- return accRect;
4859
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
4977
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
4978
+ let top = firstRect.top;
4979
+ let right = firstRect.right;
4980
+ let bottom = firstRect.bottom;
4981
+ let left = firstRect.left;
4982
+ for (let i2 = 1; i2 < clippingAncestors.length; i2++) {
4983
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i2], strategy);
4984
+ top = max(rect.top, top);
4985
+ right = min(rect.right, right);
4986
+ bottom = min(rect.bottom, bottom);
4987
+ left = max(rect.left, left);
4988
+ }
4860
4989
  return {
4861
- width: clippingRect.right - clippingRect.left,
4862
- height: clippingRect.bottom - clippingRect.top,
4863
- x: clippingRect.left,
4864
- y: clippingRect.top
4990
+ width: right - left,
4991
+ height: bottom - top,
4992
+ x: left,
4993
+ y: top
4865
4994
  };
4866
4995
  }
4867
4996
  function getDimensions(element) {
@@ -5070,7 +5199,7 @@ function autoUpdate(reference, floating, update2, options) {
5070
5199
  animationFrame = false
5071
5200
  } = options;
5072
5201
  const referenceEl = unwrapElement(reference);
5073
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
5202
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
5074
5203
  ancestors.forEach((ancestor) => {
5075
5204
  ancestorScroll && ancestor.addEventListener("scroll", update2, {
5076
5205
  passive: true
@@ -5083,7 +5212,7 @@ function autoUpdate(reference, floating, update2, options) {
5083
5212
  if (elementResize) {
5084
5213
  resizeObserver = new ResizeObserver((_ref) => {
5085
5214
  let [firstEntry] = _ref;
5086
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
5215
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
5087
5216
  resizeObserver.unobserve(floating);
5088
5217
  cancelAnimationFrame(reobserveFrame);
5089
5218
  reobserveFrame = requestAnimationFrame(() => {
@@ -5096,7 +5225,9 @@ function autoUpdate(reference, floating, update2, options) {
5096
5225
  if (referenceEl && !animationFrame) {
5097
5226
  resizeObserver.observe(referenceEl);
5098
5227
  }
5099
- resizeObserver.observe(floating);
5228
+ if (floating) {
5229
+ resizeObserver.observe(floating);
5230
+ }
5100
5231
  }
5101
5232
  let frameId;
5102
5233
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -5516,23 +5647,23 @@ function useDismiss(context, props = {}) {
5516
5647
  if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) {
5517
5648
  return;
5518
5649
  }
5519
- let targetRootAncestor = isElement(target) ? target : null;
5520
- while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
5521
- const nextParent = getParentNode(targetRootAncestor);
5522
- if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
5650
+ let targetRootAncestor = isElement$1(target) ? target : null;
5651
+ while (targetRootAncestor && !isLastTraversableNode$1(targetRootAncestor)) {
5652
+ const nextParent = getParentNode$1(targetRootAncestor);
5653
+ if (isLastTraversableNode$1(nextParent) || !isElement$1(nextParent)) {
5523
5654
  break;
5524
5655
  }
5525
5656
  targetRootAncestor = nextParent;
5526
5657
  }
5527
- if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
5658
+ if (markers.length && isElement$1(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
5528
5659
  !contains(target, store5.select("floatingElement")) && // If the target root element contains none of the markers, then the
5529
5660
  // element was injected after the floating element rendered.
5530
5661
  Array.from(markers).every((marker) => !contains(targetRootAncestor, marker))) {
5531
5662
  return;
5532
5663
  }
5533
- if (isHTMLElement(target) && !("touches" in event)) {
5534
- const lastTraversableNode = isLastTraversableNode(target);
5535
- const style = getComputedStyle$1(target);
5664
+ if (isHTMLElement$1(target) && !("touches" in event)) {
5665
+ const lastTraversableNode = isLastTraversableNode$1(target);
5666
+ const style = getComputedStyle$2(target);
5536
5667
  const scrollRe = /auto|scroll/;
5537
5668
  const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
5538
5669
  const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
@@ -5686,7 +5817,7 @@ function useDismiss(context, props = {}) {
5686
5817
  compositionTimeout.start(
5687
5818
  // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
5688
5819
  // Only apply to WebKit for the test to remain 0ms.
5689
- isWebKit$1() ? 5 : 0,
5820
+ isWebKit$2() ? 5 : 0,
5690
5821
  () => {
5691
5822
  isComposingRef.current = false;
5692
5823
  }
@@ -5709,13 +5840,13 @@ function useDismiss(context, props = {}) {
5709
5840
  }
5710
5841
  let ancestors = [];
5711
5842
  if (ancestorScroll) {
5712
- if (isElement(domReferenceElement)) {
5843
+ if (isElement$1(domReferenceElement)) {
5713
5844
  ancestors = getOverflowAncestors(domReferenceElement);
5714
5845
  }
5715
- if (isElement(floatingElement)) {
5846
+ if (isElement$1(floatingElement)) {
5716
5847
  ancestors = ancestors.concat(getOverflowAncestors(floatingElement));
5717
5848
  }
5718
- if (!isElement(referenceElement) && referenceElement && referenceElement.contextElement) {
5849
+ if (!isElement$1(referenceElement) && referenceElement && referenceElement.contextElement) {
5719
5850
  ancestors = ancestors.concat(getOverflowAncestors(referenceElement.contextElement));
5720
5851
  }
5721
5852
  }
@@ -7333,7 +7464,7 @@ function useFloatingRootContext(options) {
7333
7464
  const nested = useFloatingParentNodeId() != null;
7334
7465
  if (process.env.NODE_ENV !== "production") {
7335
7466
  const optionDomReference = elements.reference;
7336
- if (optionDomReference && !isElement(optionDomReference)) {
7467
+ if (optionDomReference && !isElement$1(optionDomReference)) {
7337
7468
  console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
7338
7469
  }
7339
7470
  }
@@ -7354,7 +7485,7 @@ function useFloatingRootContext(options) {
7354
7485
  };
7355
7486
  if (elements.reference !== void 0) {
7356
7487
  valuesToSync.referenceElement = elements.reference;
7357
- valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;
7488
+ valuesToSync.domReferenceElement = isElement$1(elements.reference) ? elements.reference : null;
7358
7489
  }
7359
7490
  if (elements.floating !== void 0) {
7360
7491
  valuesToSync.floatingElement = elements.floating;
@@ -7396,7 +7527,7 @@ function useFloating(options = {}) {
7396
7527
  }
7397
7528
  });
7398
7529
  const setPositionReference = q$1((node) => {
7399
- const computedPositionReference = isElement(node) ? {
7530
+ const computedPositionReference = isElement$1(node) ? {
7400
7531
  getBoundingClientRect: () => node.getBoundingClientRect(),
7401
7532
  getClientRects: () => node.getClientRects(),
7402
7533
  contextElement: node
@@ -7407,17 +7538,17 @@ function useFloating(options = {}) {
7407
7538
  const [localDomReference, setLocalDomReference] = d$2(null);
7408
7539
  const [localFloatingElement, setLocalFloatingElement] = d$2(null);
7409
7540
  rootContext.useSyncedValue("referenceElement", localDomReference);
7410
- rootContext.useSyncedValue("domReferenceElement", isElement(localDomReference) ? localDomReference : null);
7541
+ rootContext.useSyncedValue("domReferenceElement", isElement$1(localDomReference) ? localDomReference : null);
7411
7542
  rootContext.useSyncedValue("floatingElement", localFloatingElement);
7412
7543
  const setReference = q$1((node) => {
7413
- if (isElement(node) || node === null) {
7544
+ if (isElement$1(node) || node === null) {
7414
7545
  domReferenceRef.current = node;
7415
7546
  setLocalDomReference(node);
7416
7547
  }
7417
- if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
7548
+ if (isElement$1(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
7418
7549
  // `null` to support `positionReference` + an unstable `reference`
7419
7550
  // callback ref.
7420
- node !== null && !isElement(node)) {
7551
+ node !== null && !isElement$1(node)) {
7421
7552
  position.refs.setReference(node);
7422
7553
  }
7423
7554
  }, [position.refs, setLocalDomReference]);
@@ -7495,7 +7626,7 @@ function useSyncedFloatingRootContext(options) {
7495
7626
  referenceElement,
7496
7627
  floatingElement
7497
7628
  };
7498
- if (isElement(referenceElement)) {
7629
+ if (isElement$1(referenceElement)) {
7499
7630
  valuesToSync.domReferenceElement = referenceElement;
7500
7631
  }
7501
7632
  store5.update(valuesToSync);
@@ -7629,7 +7760,7 @@ function useHoverFloatingInteraction(context, parameters = {}) {
7629
7760
  if (!enabled) {
7630
7761
  return void 0;
7631
7762
  }
7632
- if (open && ((_a = handleCloseOptionsRef.current) == null ? void 0 : _a.blockPointerEvents) && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {
7763
+ if (open && ((_a = handleCloseOptionsRef.current) == null ? void 0 : _a.blockPointerEvents) && isHoverOpen() && isElement$1(domReferenceElement) && floatingElement) {
7633
7764
  performedPointerEventsMutationRef.current = true;
7634
7765
  const body = getDocument(floatingElement).body;
7635
7766
  body.setAttribute(safePolygonIdentifier, "");
@@ -7830,7 +7961,7 @@ function useHoverReferenceInteraction(context, props = {}) {
7830
7961
  return void 0;
7831
7962
  }
7832
7963
  const trigger = triggerElementRef.current ?? (isActiveTrigger ? store5.select("domReferenceElement") : null);
7833
- if (!isElement(trigger)) {
7964
+ if (!isElement$1(trigger)) {
7834
7965
  return void 0;
7835
7966
  }
7836
7967
  function onMouseEnter(event) {
@@ -8255,7 +8386,7 @@ function safePolygon(options = {}) {
8255
8386
  hasLanded = true;
8256
8387
  return void 0;
8257
8388
  }
8258
- if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {
8389
+ if (isLeave && isElement$1(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {
8259
8390
  return void 0;
8260
8391
  }
8261
8392
  if (tree && getNodeChildren(tree.nodesRef.current, nodeId).some(({
@@ -8811,7 +8942,7 @@ function useButton(parameters = {}) {
8811
8942
  };
8812
8943
  }
8813
8944
  function isButtonElement(elem) {
8814
- return isHTMLElement(elem) && elem.tagName === "BUTTON";
8945
+ return isHTMLElement$1(elem) && elem.tagName === "BUTTON";
8815
8946
  }
8816
8947
  let TransitionStatusDataAttributes = /* @__PURE__ */ function(TransitionStatusDataAttributes2) {
8817
8948
  TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style";
@@ -9102,17 +9233,17 @@ const baseArrow = (options) => ({
9102
9233
  element,
9103
9234
  padding = 0,
9104
9235
  offsetParent = "real"
9105
- } = evaluate(options, state) || {};
9236
+ } = evaluate$1(options, state) || {};
9106
9237
  if (element == null) {
9107
9238
  return {};
9108
9239
  }
9109
- const paddingObject = getPaddingObject(padding);
9240
+ const paddingObject = getPaddingObject$1(padding);
9110
9241
  const coords = {
9111
9242
  x: x2,
9112
9243
  y: y2
9113
9244
  };
9114
- const axis = getAlignmentAxis(placement);
9115
- const length = getAxisLength(axis);
9245
+ const axis = getAlignmentAxis$1(placement);
9246
+ const length = getAxisLength$1(axis);
9116
9247
  const arrowDimensions = await platform2.getDimensions(element);
9117
9248
  const isYAxis = axis === "y";
9118
9249
  const minProp = isYAxis ? "top" : "left";
@@ -9132,8 +9263,8 @@ const baseArrow = (options) => ({
9132
9263
  const min2 = minPadding;
9133
9264
  const max2 = clientSize - arrowDimensions[length] - maxPadding;
9134
9265
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
9135
- const offset2 = clamp(min2, center, max2);
9136
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
9266
+ const offset2 = clamp$1(min2, center, max2);
9267
+ const shouldAddOffset = !middlewareData.arrow && getAlignment$1(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
9137
9268
  const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
9138
9269
  return {
9139
9270
  [axis]: coords[axis] + alignmentOffset,
@@ -9192,7 +9323,7 @@ const adaptiveOrigin = {
9192
9323
  strategy,
9193
9324
  placement
9194
9325
  } = state;
9195
- const win = getWindow(floating);
9326
+ const win = getWindow$1(floating);
9196
9327
  const styles = win.getComputedStyle(floating);
9197
9328
  const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
9198
9329
  if (!hasTransition) {
@@ -9221,7 +9352,7 @@ const adaptiveOrigin = {
9221
9352
  } else if (await ((_b = platform2.isElement) == null ? void 0 : _b.call(platform2, offsetParent))) {
9222
9353
  offsetDimensions = await platform2.getDimensions(offsetParent);
9223
9354
  }
9224
- const currentSide = getSide(placement);
9355
+ const currentSide = getSide$1(placement);
9225
9356
  let x2 = rawX;
9226
9357
  let y2 = rawY;
9227
9358
  if (currentSide === "left") {
@@ -9259,8 +9390,8 @@ function getOffsetData(state, sideParam, isRtl) {
9259
9390
  placement
9260
9391
  } = state;
9261
9392
  const data = {
9262
- side: getLogicalSide(sideParam, getSide(placement), isRtl),
9263
- align: getAlignment(placement) || "center",
9393
+ side: getLogicalSide(sideParam, getSide$1(placement), isRtl),
9394
+ align: getAlignment$1(placement) || "center",
9264
9395
  anchor: {
9265
9396
  width: rects.reference.width,
9266
9397
  height: rects.reference.height
@@ -9398,7 +9529,7 @@ function useAnchorPositioning(params) {
9398
9529
  width,
9399
9530
  height
9400
9531
  } = arrowRef.current.getBoundingClientRect();
9401
- const sideAxis = getSideAxis(getSide(limitData.placement));
9532
+ const sideAxis = getSideAxis$1(getSide$1(limitData.placement));
9402
9533
  const arrowSize = sideAxis === "y" ? width : height;
9403
9534
  const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
9404
9535
  return {
@@ -9450,8 +9581,8 @@ function useAnchorPositioning(params) {
9450
9581
  rects,
9451
9582
  y: y3
9452
9583
  } = state;
9453
- const currentRenderedSide = getSide(renderedPlacement2);
9454
- const currentRenderedAxis = getSideAxis(currentRenderedSide);
9584
+ const currentRenderedSide = getSide$1(renderedPlacement2);
9585
+ const currentRenderedAxis = getSideAxis$1(currentRenderedSide);
9455
9586
  const arrowEl = arrowRef.current;
9456
9587
  const arrowX = ((_a2 = middlewareData2.arrow) == null ? void 0 : _a2.x) || 0;
9457
9588
  const arrowY = ((_b2 = middlewareData2.arrow) == null ? void 0 : _b2.y) || 0;
@@ -9553,9 +9684,9 @@ function useAnchorPositioning(params) {
9553
9684
  }
9554
9685
  return void 0;
9555
9686
  }, [keepMounted, mounted, elements, update2, autoUpdateOptions]);
9556
- const renderedSide = getSide(renderedPlacement);
9687
+ const renderedSide = getSide$1(renderedPlacement);
9557
9688
  const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
9558
- const renderedAlign = getAlignment(renderedPlacement) || "center";
9689
+ const renderedAlign = getAlignment$1(renderedPlacement) || "center";
9559
9690
  const anchorHidden = Boolean((_a = middlewareData.hide) == null ? void 0 : _a.referenceHidden);
9560
9691
  useIsoLayoutEffect(() => {
9561
9692
  if (lazyFlip && mounted && isPositioned) {
@@ -9750,13 +9881,13 @@ const PopoverPositioner = /* @__PURE__ */ D(function PopoverPositioner2(componen
9750
9881
  if (process.env.NODE_ENV !== "production")
9751
9882
  PopoverPositioner.displayName = "PopoverPositioner";
9752
9883
  function getCssDimensions(element) {
9753
- const css = getComputedStyle$1(element);
9884
+ const css = getComputedStyle$2(element);
9754
9885
  let width = parseFloat(css.width) || 0;
9755
9886
  let height = parseFloat(css.height) || 0;
9756
- const hasOffset = isHTMLElement(element);
9887
+ const hasOffset = isHTMLElement$1(element);
9757
9888
  const offsetWidth = hasOffset ? element.offsetWidth : width;
9758
9889
  const offsetHeight = hasOffset ? element.offsetHeight : height;
9759
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
9890
+ const shouldFallback = round$1(width) !== offsetWidth || round$1(height) !== offsetHeight;
9760
9891
  if (shouldFallback) {
9761
9892
  width = offsetWidth;
9762
9893
  height = offsetHeight;
@@ -10022,7 +10153,7 @@ const PopoverPopup = /* @__PURE__ */ D(function PopoverPopup2(componentProps, fo
10022
10153
  initialFocus: resolvedInitialFocus,
10023
10154
  returnFocus: finalFocus,
10024
10155
  restoreFocus: "popup",
10025
- previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : void 0,
10156
+ previousFocusableElement: isHTMLElement$1(activeTriggerElement) ? activeTriggerElement : void 0,
10026
10157
  nextFocusableElement: store5.context.triggerFocusTargetRef,
10027
10158
  beforeContentFocusGuardRef: store5.context.beforeContentFocusGuardRef,
10028
10159
  children: element
@@ -10089,12 +10220,12 @@ var createTranslateFunction = ({
10089
10220
  return t2;
10090
10221
  };
10091
10222
  var TranslationContext = R$2(null);
10092
- var createTranslation = (defaultTerms) => {
10223
+ var createTranslation = (defaultTerms2) => {
10093
10224
  return {
10094
- defaultTerms,
10225
+ defaultTerms: defaultTerms2,
10095
10226
  TranslationProvider: ({ terms, children, locale }) => {
10096
10227
  const t2 = T$1(() => {
10097
- return createTranslateFunction({ locale, terms: defaultTerms, overrides: terms });
10228
+ return createTranslateFunction({ locale, terms: defaultTerms2, overrides: terms });
10098
10229
  }, [terms, locale]);
10099
10230
  return /* @__PURE__ */ u$2(TranslationContext.Provider, { value: { t: t2, locale }, children });
10100
10231
  },
@@ -10107,10 +10238,10 @@ var createTranslation = (defaultTerms) => {
10107
10238
  createTFunction: ({
10108
10239
  overrides,
10109
10240
  locale
10110
- }) => createTranslateFunction({ terms: defaultTerms, overrides, locale })
10241
+ }) => createTranslateFunction({ terms: defaultTerms2, overrides, locale })
10111
10242
  };
10112
10243
  };
10113
- const { TranslationProvider, useTranslation, createTFunction } = createTranslation({
10244
+ const defaultTerms = {
10114
10245
  DAILY: "Daily",
10115
10246
  WEEKLY: "Weekly",
10116
10247
  MONTHLY: "Monthly",
@@ -10121,8 +10252,11 @@ const { TranslationProvider, useTranslation, createTFunction } = createTranslati
10121
10252
  save: "Save",
10122
10253
  save_alert: "Save Alert",
10123
10254
  frequency: "Frequency",
10124
- create_alert: "Create Alert"
10125
- });
10255
+ create_alert: "Create Alert",
10256
+ create_alert_error: "Failed to create alert. Please try again later.",
10257
+ privacy_policy_link: "How we use your personal data"
10258
+ };
10259
+ const { TranslationProvider, useTranslation, createTFunction } = createTranslation(defaultTerms);
10126
10260
  var i = Symbol.for("preact-signals");
10127
10261
  function t() {
10128
10262
  if (!(s$1 > 1)) {
@@ -10873,6 +11007,51 @@ function array(item, message2) {
10873
11007
  };
10874
11008
  }
10875
11009
  // @__NO_SIDE_EFFECTS__
11010
+ function literal(literal_, message2) {
11011
+ return {
11012
+ kind: "schema",
11013
+ type: "literal",
11014
+ reference: literal,
11015
+ expects: /* @__PURE__ */ _stringify(literal_),
11016
+ async: false,
11017
+ literal: literal_,
11018
+ message: message2,
11019
+ get "~standard"() {
11020
+ return /* @__PURE__ */ _getStandardProps(this);
11021
+ },
11022
+ "~run"(dataset, config2) {
11023
+ if (dataset.value === this.literal) {
11024
+ dataset.typed = true;
11025
+ } else {
11026
+ _addIssue(this, "type", dataset, config2);
11027
+ }
11028
+ return dataset;
11029
+ }
11030
+ };
11031
+ }
11032
+ // @__NO_SIDE_EFFECTS__
11033
+ function number(message2) {
11034
+ return {
11035
+ kind: "schema",
11036
+ type: "number",
11037
+ reference: number,
11038
+ expects: "number",
11039
+ async: false,
11040
+ message: message2,
11041
+ get "~standard"() {
11042
+ return /* @__PURE__ */ _getStandardProps(this);
11043
+ },
11044
+ "~run"(dataset, config2) {
11045
+ if (typeof dataset.value === "number" && !isNaN(dataset.value)) {
11046
+ dataset.typed = true;
11047
+ } else {
11048
+ _addIssue(this, "type", dataset, config2);
11049
+ }
11050
+ return dataset;
11051
+ }
11052
+ };
11053
+ }
11054
+ // @__NO_SIDE_EFFECTS__
10876
11055
  function object(entries2, message2) {
10877
11056
  return {
10878
11057
  kind: "schema",
@@ -11217,6 +11396,21 @@ function pipe(...pipe2) {
11217
11396
  }
11218
11397
  };
11219
11398
  }
11399
+ const alertFiltersSchema = /* @__PURE__ */ record(
11400
+ /* @__PURE__ */ string(),
11401
+ /* @__PURE__ */ union([
11402
+ /* @__PURE__ */ string(),
11403
+ /* @__PURE__ */ array(/* @__PURE__ */ string()),
11404
+ /* @__PURE__ */ object({
11405
+ type: /* @__PURE__ */ literal("provided"),
11406
+ lat: /* @__PURE__ */ number(),
11407
+ lng: /* @__PURE__ */ number(),
11408
+ radius: /* @__PURE__ */ number(),
11409
+ unit: /* @__PURE__ */ optional(/* @__PURE__ */ picklist(["miles", "km"])),
11410
+ label: /* @__PURE__ */ optional(/* @__PURE__ */ string())
11411
+ })
11412
+ ])
11413
+ );
11220
11414
  const saveSearchEndpoint = endpoint({
11221
11415
  pathname: "/search/save",
11222
11416
  method: "POST",
@@ -11229,7 +11423,7 @@ const saveSearchEndpoint = endpoint({
11229
11423
  last_name: /* @__PURE__ */ optional(/* @__PURE__ */ string())
11230
11424
  }),
11231
11425
  alerts: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ string(), /* @__PURE__ */ picklist(FREQUENCIES)),
11232
- filters: /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())]))
11426
+ filters: alertFiltersSchema
11233
11427
  })
11234
11428
  }
11235
11429
  });
@@ -11422,13 +11616,6 @@ const InputError = ({ error: error2 }) => {
11422
11616
  ] });
11423
11617
  };
11424
11618
  const inputClass = "rounded-field-input bg-neutral-1 text-accent-11 autofill:shadow-[inset_0_0_0_1000px_var(--i-color-a-2)] autofill:focus:shadow-[inset_0_0_0_1000px_var(--i-color-a-1)] autofill:[-webkit-text-fill-color:var(--i-color-a-11)] px-3 py-2 ring ring-[1px] transition-all ease-expo-out duration-snappy ring-neutral-4 fr inline-flex w-full items-center justify-center px-2.5 text-base shadow-[0_0_0_1px] outline-none focus:shadow-[0_0_0_2px]";
11425
- const getErrorMessage = (error2) => {
11426
- if (typeof error2 === "string")
11427
- return error2;
11428
- if (typeof error2 === "object" && error2 !== null && "message" in error2 && typeof error2.message === "string")
11429
- return error2.message;
11430
- return "Failed to create alert. Please try again later.";
11431
- };
11432
11619
  const JobAlertsButton = D(
11433
11620
  ({ class: className, ...props }, ref) => /* @__PURE__ */ u$2(
11434
11621
  "button",
@@ -11449,6 +11636,21 @@ const JobAlertsButton = D(
11449
11636
  )
11450
11637
  );
11451
11638
  const PopoverHeader = () => /* @__PURE__ */ u$2("p", { class: "text-neutral-11 px-2 pb-4 pt-1 text-sm", children: store$1.config$.value.headerText });
11639
+ const PrivacyPolicyLink = ({ label }) => {
11640
+ const url = store$1.config$.value.privacyPolicyUrl;
11641
+ if (!url)
11642
+ return null;
11643
+ return /* @__PURE__ */ u$2(
11644
+ "a",
11645
+ {
11646
+ href: url,
11647
+ target: "_blank",
11648
+ rel: "noopener noreferrer",
11649
+ class: "text-neutral-11 hover:text-accent-11 px-2 text-xs underline underline-offset-2",
11650
+ children: label
11651
+ }
11652
+ );
11653
+ };
11452
11654
  function noop2() {
11453
11655
  }
11454
11656
  const JobAlerts = ({ theme, rpcClient, logger, analytics }) => {
@@ -11497,7 +11699,7 @@ const JobAlerts = ({ theme, rpcClient, logger, analytics }) => {
11497
11699
  setFormState("idle");
11498
11700
  }).catch((err) => {
11499
11701
  logger.error(err);
11500
- setError(getErrorMessage(err));
11702
+ setError(t2("create_alert_error"));
11501
11703
  setFormState("idle");
11502
11704
  });
11503
11705
  },
@@ -11551,6 +11753,7 @@ const JobAlerts = ({ theme, rpcClient, logger, analytics }) => {
11551
11753
  /* @__PURE__ */ u$2("div", { class: "text-neutral-10 absolute bottom-0 right-0 top-0 flex items-center p-1", "aria-hidden": true, children: /* @__PURE__ */ u$2(Icon, { name: "chevron-up-down" }) })
11552
11754
  ] })
11553
11755
  ] }),
11756
+ /* @__PURE__ */ u$2(PrivacyPolicyLink, { label: t2("privacy_policy_link") }),
11554
11757
  /* @__PURE__ */ u$2(
11555
11758
  "button",
11556
11759
  {
@@ -12188,6 +12391,11 @@ const tailwind = `#ija {
12188
12391
  line-height: 1.25rem;
12189
12392
  }
12190
12393
 
12394
+ #ija .text-xs {
12395
+ font-size: 0.75rem;
12396
+ line-height: 1rem;
12397
+ }
12398
+
12191
12399
  #ija .font-medium {
12192
12400
  font-weight: 500;
12193
12401
  }
@@ -12238,6 +12446,10 @@ const tailwind = `#ija {
12238
12446
  text-decoration-line: underline;
12239
12447
  }
12240
12448
 
12449
+ #ija .underline-offset-2 {
12450
+ text-underline-offset: 2px;
12451
+ }
12452
+
12241
12453
  #ija .opacity-0 {
12242
12454
  opacity: 0;
12243
12455
  }
@@ -12467,6 +12679,10 @@ const tailwind = `#ija {
12467
12679
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
12468
12680
  }
12469
12681
 
12682
+ #ija .hover\\:text-accent-11:hover {
12683
+ color: var(--i-color-a-11);
12684
+ }
12685
+
12470
12686
  #ija .focus\\:shadow-\\[0_0_0_2px\\]:focus {
12471
12687
  --tw-shadow: 0 0 0 2px;
12472
12688
  --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);
@@ -12633,5 +12849,6 @@ const jobAlertsPlugin = () => createPlugin(({ rpcClient, logger, analytics }) =>
12633
12849
  });
12634
12850
  export {
12635
12851
  createJobAlertsDomManager,
12852
+ defaultTerms,
12636
12853
  jobAlertsPlugin
12637
12854
  };