@rededor/cura 2.0.0-alpha.5 → 2.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/assets/icons/iconset-default-tmp.svg +40 -0
  3. package/dist/assets/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/cura-accordion_21.cjs.entry.js +179 -69
  5. package/dist/cjs/cura-accordion_21.cjs.entry.js.map +1 -1
  6. package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
  7. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  8. package/dist/cjs/cura-icons-view.entry.cjs.js.map +1 -1
  9. package/dist/cjs/index-BK9MSAiE.js.map +1 -1
  10. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  11. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  12. package/dist/collection/assets/icons/iconset-default-tmp.svg +40 -0
  13. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  14. package/dist/collection/assets-raw/icons/default/autism.svg +3 -0
  15. package/dist/collection/assets-raw/icons/default/biop.svg +3 -0
  16. package/dist/collection/assets-raw/icons/default/lab.svg +3 -0
  17. package/dist/collection/assets-raw/icons/default/mobileClick.svg +3 -0
  18. package/dist/collection/assets-raw/icons/default/mobileRotate1.svg +3 -0
  19. package/dist/collection/assets-raw/icons/default/mobileRotate2.svg +3 -0
  20. package/dist/collection/assets-raw/icons/default/mobileRotate3.svg +3 -0
  21. package/dist/collection/assets-raw/icons/default/star.svg +3 -0
  22. package/dist/collection/assets-raw/icons/default/stop.svg +3 -0
  23. package/dist/collection/assets-raw/icons/default/xray.svg +3 -0
  24. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
  25. package/dist/components/cura-calendar.js +1 -1
  26. package/dist/components/cura-icons-view.js +1 -1
  27. package/dist/components/cura-icons-view.js.map +1 -1
  28. package/dist/components/cura-input-date.js +2 -2
  29. package/dist/components/cura-select.js +1 -1
  30. package/dist/components/{p-Cs5scX1L.js → p-CvdWbsfO.js} +181 -71
  31. package/dist/components/p-CvdWbsfO.js.map +1 -0
  32. package/dist/components/p-D1cPOZpG.js.map +1 -1
  33. package/dist/components/{p-D6PpdPRJ.js → p-DETZu2ie.js} +3 -3
  34. package/dist/components/{p-D6PpdPRJ.js.map → p-DETZu2ie.js.map} +1 -1
  35. package/dist/cura/cura-icons-view.entry.esm.js.map +1 -1
  36. package/dist/cura/cura.esm.js +1 -1
  37. package/dist/cura/{p-6dfc7c02.entry.js → p-2ab58335.entry.js} +2 -2
  38. package/dist/cura/p-2ab58335.entry.js.map +1 -0
  39. package/dist/cura/p-76603652.entry.js +2 -0
  40. package/dist/cura/p-76603652.entry.js.map +1 -0
  41. package/dist/cura/p-PPMZr_VE.js.map +1 -1
  42. package/dist/esm/cura-accordion_21.entry.js +179 -69
  43. package/dist/esm/cura-accordion_21.entry.js.map +1 -1
  44. package/dist/esm/cura-icons-view.entry.js +1 -1
  45. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  46. package/dist/esm/index-OdKytJIH.js.map +1 -1
  47. package/package.json +2 -2
  48. package/dist/components/p-Cs5scX1L.js.map +0 -1
  49. package/dist/cura/p-2632183e.entry.js +0 -2
  50. package/dist/cura/p-2632183e.entry.js.map +0 -1
  51. package/dist/cura/p-6dfc7c02.entry.js.map +0 -1
@@ -5565,8 +5565,9 @@ function getOppositeAxis(axis) {
5565
5565
  function getAxisLength(axis) {
5566
5566
  return axis === 'y' ? 'height' : 'width';
5567
5567
  }
5568
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
5568
5569
  function getSideAxis(placement) {
5569
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
5570
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
5570
5571
  }
5571
5572
  function getAlignmentAxis(placement) {
5572
5573
  return getOppositeAxis(getSideAxis(placement));
@@ -5591,19 +5592,19 @@ function getExpandedPlacements(placement) {
5591
5592
  function getOppositeAlignmentPlacement(placement) {
5592
5593
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
5593
5594
  }
5595
+ const lrPlacement = ['left', 'right'];
5596
+ const rlPlacement = ['right', 'left'];
5597
+ const tbPlacement = ['top', 'bottom'];
5598
+ const btPlacement = ['bottom', 'top'];
5594
5599
  function getSideList(side, isStart, rtl) {
5595
- const lr = ['left', 'right'];
5596
- const rl = ['right', 'left'];
5597
- const tb = ['top', 'bottom'];
5598
- const bt = ['bottom', 'top'];
5599
5600
  switch (side) {
5600
5601
  case 'top':
5601
5602
  case 'bottom':
5602
- if (rtl) return isStart ? rl : lr;
5603
- return isStart ? lr : rl;
5603
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
5604
+ return isStart ? lrPlacement : rlPlacement;
5604
5605
  case 'left':
5605
5606
  case 'right':
5606
- return isStart ? tb : bt;
5607
+ return isStart ? tbPlacement : btPlacement;
5607
5608
  default:
5608
5609
  return [];
5609
5610
  }
@@ -5941,16 +5942,22 @@ const flip$1 = function (options) {
5941
5942
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
5942
5943
  const nextPlacement = placements[nextIndex];
5943
5944
  if (nextPlacement) {
5944
- // Try next placement and re-run the lifecycle.
5945
- return {
5946
- data: {
5947
- index: nextIndex,
5948
- overflows: overflowsData
5949
- },
5950
- reset: {
5951
- placement: nextPlacement
5952
- }
5953
- };
5945
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
5946
+ if (!ignoreCrossAxisOverflow ||
5947
+ // We leave the current main axis only if every placement on that axis
5948
+ // overflows the main axis.
5949
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
5950
+ // Try next placement and re-run the lifecycle.
5951
+ return {
5952
+ data: {
5953
+ index: nextIndex,
5954
+ overflows: overflowsData
5955
+ },
5956
+ reset: {
5957
+ placement: nextPlacement
5958
+ }
5959
+ };
5960
+ }
5954
5961
  }
5955
5962
 
5956
5963
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -5996,6 +6003,8 @@ const flip$1 = function (options) {
5996
6003
  };
5997
6004
  };
5998
6005
 
6006
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
6007
+
5999
6008
  // For type backwards-compatibility, the `OffsetOptions` type was also
6000
6009
  // Derivable.
6001
6010
 
@@ -6009,7 +6018,7 @@ async function convertValueToCoords(state, options) {
6009
6018
  const side = getSide(placement);
6010
6019
  const alignment = getAlignment(placement);
6011
6020
  const isVertical = getSideAxis(placement) === 'y';
6012
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
6021
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
6013
6022
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
6014
6023
  const rawValue = evaluate(options, state);
6015
6024
 
@@ -6023,10 +6032,9 @@ async function convertValueToCoords(state, options) {
6023
6032
  crossAxis: 0,
6024
6033
  alignmentAxis: null
6025
6034
  } : {
6026
- mainAxis: 0,
6027
- crossAxis: 0,
6028
- alignmentAxis: null,
6029
- ...rawValue
6035
+ mainAxis: rawValue.mainAxis || 0,
6036
+ crossAxis: rawValue.crossAxis || 0,
6037
+ alignmentAxis: rawValue.alignmentAxis
6030
6038
  };
6031
6039
  if (alignment && typeof alignmentAxis === 'number') {
6032
6040
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
@@ -6148,7 +6156,11 @@ const shift$1 = function (options) {
6148
6156
  ...limitedCoords,
6149
6157
  data: {
6150
6158
  x: limitedCoords.x - x,
6151
- y: limitedCoords.y - y
6159
+ y: limitedCoords.y - y,
6160
+ enabled: {
6161
+ [mainAxis]: checkMainAxis,
6162
+ [crossAxis]: checkCrossAxis
6163
+ }
6152
6164
  }
6153
6165
  };
6154
6166
  }
@@ -6169,6 +6181,7 @@ const size$1 = function (options) {
6169
6181
  name: 'size',
6170
6182
  options,
6171
6183
  async fn(state) {
6184
+ var _state$middlewareData, _state$middlewareData2;
6172
6185
  const {
6173
6186
  placement,
6174
6187
  rects,
@@ -6203,10 +6216,11 @@ const size$1 = function (options) {
6203
6216
  const noShift = !state.middlewareData.shift;
6204
6217
  let availableHeight = overflowAvailableHeight;
6205
6218
  let availableWidth = overflowAvailableWidth;
6206
- if (isYAxis) {
6207
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
6208
- } else {
6209
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
6219
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
6220
+ availableWidth = maximumClippingWidth;
6221
+ }
6222
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
6223
+ availableHeight = maximumClippingHeight;
6210
6224
  }
6211
6225
  if (noShift && !alignment) {
6212
6226
  const xMin = max(overflow.left, 0);
@@ -6237,6 +6251,9 @@ const size$1 = function (options) {
6237
6251
  };
6238
6252
  };
6239
6253
 
6254
+ function hasWindow() {
6255
+ return typeof window !== 'undefined';
6256
+ }
6240
6257
  function getNodeName(node) {
6241
6258
  if (isNode(node)) {
6242
6259
  return (node.nodeName || '').toLowerCase();
@@ -6255,48 +6272,63 @@ function getDocumentElement(node) {
6255
6272
  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
6256
6273
  }
6257
6274
  function isNode(value) {
6275
+ if (!hasWindow()) {
6276
+ return false;
6277
+ }
6258
6278
  return value instanceof Node || value instanceof getWindow(value).Node;
6259
6279
  }
6260
6280
  function isElement(value) {
6281
+ if (!hasWindow()) {
6282
+ return false;
6283
+ }
6261
6284
  return value instanceof Element || value instanceof getWindow(value).Element;
6262
6285
  }
6263
6286
  function isHTMLElement(value) {
6287
+ if (!hasWindow()) {
6288
+ return false;
6289
+ }
6264
6290
  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
6265
6291
  }
6266
6292
  function isShadowRoot(value) {
6267
- // Browsers without `ShadowRoot` support.
6268
- if (typeof ShadowRoot === 'undefined') {
6293
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
6269
6294
  return false;
6270
6295
  }
6271
6296
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
6272
6297
  }
6298
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
6273
6299
  function isOverflowElement(element) {
6274
6300
  const {
6275
6301
  overflow,
6276
6302
  overflowX,
6277
6303
  overflowY,
6278
6304
  display
6279
- } = getComputedStyle(element);
6280
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
6305
+ } = getComputedStyle$1(element);
6306
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
6281
6307
  }
6308
+ const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
6282
6309
  function isTableElement(element) {
6283
- return ['table', 'td', 'th'].includes(getNodeName(element));
6310
+ return tableElements.has(getNodeName(element));
6284
6311
  }
6312
+ const topLayerSelectors = [':popover-open', ':modal'];
6285
6313
  function isTopLayer(element) {
6286
- return [':popover-open', ':modal'].some(selector => {
6314
+ return topLayerSelectors.some(selector => {
6287
6315
  try {
6288
6316
  return element.matches(selector);
6289
- } catch (e) {
6317
+ } catch (_e) {
6290
6318
  return false;
6291
6319
  }
6292
6320
  });
6293
6321
  }
6322
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
6323
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
6324
+ const containValues = ['paint', 'layout', 'strict', 'content'];
6294
6325
  function isContainingBlock(elementOrCss) {
6295
6326
  const webkit = isWebKit();
6296
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
6327
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
6297
6328
 
6298
6329
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
6299
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
6330
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
6331
+ 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));
6300
6332
  }
6301
6333
  function getContainingBlock(element) {
6302
6334
  let currentNode = getParentNode(element);
@@ -6314,10 +6346,11 @@ function isWebKit() {
6314
6346
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
6315
6347
  return CSS.supports('-webkit-backdrop-filter', 'none');
6316
6348
  }
6349
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
6317
6350
  function isLastTraversableNode(node) {
6318
- return ['html', 'body', '#document'].includes(getNodeName(node));
6351
+ return lastTraversableNodeNames.has(getNodeName(node));
6319
6352
  }
6320
- function getComputedStyle(element) {
6353
+ function getComputedStyle$1(element) {
6321
6354
  return getWindow(element).getComputedStyle(element);
6322
6355
  }
6323
6356
  function getNodeScroll(element) {
@@ -6369,13 +6402,17 @@ function getOverflowAncestors(node, list, traverseIframes) {
6369
6402
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
6370
6403
  const win = getWindow(scrollableAncestor);
6371
6404
  if (isBody) {
6372
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
6405
+ const frameElement = getFrameElement(win);
6406
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
6373
6407
  }
6374
6408
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
6375
6409
  }
6410
+ function getFrameElement(win) {
6411
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
6412
+ }
6376
6413
 
6377
6414
  function getCssDimensions(element) {
6378
- const css = getComputedStyle(element);
6415
+ const css = getComputedStyle$1(element);
6379
6416
  // In testing environments, the `width` and `height` properties are empty
6380
6417
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
6381
6418
  let width = parseFloat(css.width) || 0;
@@ -6476,11 +6513,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6476
6513
  const win = getWindow(domElement);
6477
6514
  const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
6478
6515
  let currentWin = win;
6479
- let currentIFrame = currentWin.frameElement;
6516
+ let currentIFrame = getFrameElement(currentWin);
6480
6517
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
6481
6518
  const iframeScale = getScale(currentIFrame);
6482
6519
  const iframeRect = currentIFrame.getBoundingClientRect();
6483
- const css = getComputedStyle(currentIFrame);
6520
+ const css = getComputedStyle$1(currentIFrame);
6484
6521
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
6485
6522
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
6486
6523
  x *= iframeScale.x;
@@ -6490,7 +6527,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6490
6527
  x += left;
6491
6528
  y += top;
6492
6529
  currentWin = getWindow(currentIFrame);
6493
- currentIFrame = currentWin.frameElement;
6530
+ currentIFrame = getFrameElement(currentWin);
6494
6531
  }
6495
6532
  }
6496
6533
  return rectToClientRect({
@@ -6501,6 +6538,26 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
6501
6538
  });
6502
6539
  }
6503
6540
 
6541
+ // If <html> has a CSS width greater than the viewport, then this will be
6542
+ // incorrect for RTL.
6543
+ function getWindowScrollBarX(element, rect) {
6544
+ const leftScroll = getNodeScroll(element).scrollLeft;
6545
+ if (!rect) {
6546
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
6547
+ }
6548
+ return rect.left + leftScroll;
6549
+ }
6550
+
6551
+ function getHTMLOffset(documentElement, scroll) {
6552
+ const htmlRect = documentElement.getBoundingClientRect();
6553
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
6554
+ const y = htmlRect.top + scroll.scrollTop;
6555
+ return {
6556
+ x,
6557
+ y
6558
+ };
6559
+ }
6560
+
6504
6561
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
6505
6562
  let {
6506
6563
  elements,
@@ -6532,11 +6589,12 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
6532
6589
  offsets.y = offsetRect.y + offsetParent.clientTop;
6533
6590
  }
6534
6591
  }
6592
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
6535
6593
  return {
6536
6594
  width: rect.width * scale.x,
6537
6595
  height: rect.height * scale.y,
6538
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
6539
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
6596
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
6597
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
6540
6598
  };
6541
6599
  }
6542
6600
 
@@ -6544,12 +6602,6 @@ function getClientRects(element) {
6544
6602
  return Array.from(element.getClientRects());
6545
6603
  }
6546
6604
 
6547
- function getWindowScrollBarX(element) {
6548
- // If <html> has a CSS width greater than the viewport, then this will be
6549
- // incorrect for RTL.
6550
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
6551
- }
6552
-
6553
6605
  // Gets the entire size of the scrollable document area, even extending outside
6554
6606
  // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
6555
6607
  function getDocumentRect(element) {
@@ -6560,7 +6612,7 @@ function getDocumentRect(element) {
6560
6612
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
6561
6613
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
6562
6614
  const y = -scroll.scrollTop;
6563
- if (getComputedStyle(body).direction === 'rtl') {
6615
+ if (getComputedStyle$1(body).direction === 'rtl') {
6564
6616
  x += max(html.clientWidth, body.clientWidth) - width;
6565
6617
  }
6566
6618
  return {
@@ -6571,6 +6623,10 @@ function getDocumentRect(element) {
6571
6623
  };
6572
6624
  }
6573
6625
 
6626
+ // Safety check: ensure the scrollbar space is reasonable in case this
6627
+ // calculation is affected by unusual styles.
6628
+ // Most scrollbars leave 15-18px of space.
6629
+ const SCROLLBAR_MAX = 25;
6574
6630
  function getViewportRect(element, strategy) {
6575
6631
  const win = getWindow(element);
6576
6632
  const html = getDocumentElement(element);
@@ -6588,6 +6644,24 @@ function getViewportRect(element, strategy) {
6588
6644
  y = visualViewport.offsetTop;
6589
6645
  }
6590
6646
  }
6647
+ const windowScrollbarX = getWindowScrollBarX(html);
6648
+ // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
6649
+ // visual width of the <html> but this is not considered in the size
6650
+ // of `html.clientWidth`.
6651
+ if (windowScrollbarX <= 0) {
6652
+ const doc = html.ownerDocument;
6653
+ const body = doc.body;
6654
+ const bodyStyles = getComputedStyle(body);
6655
+ const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
6656
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
6657
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
6658
+ width -= clippingStableScrollbarWidth;
6659
+ }
6660
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
6661
+ // If the <body> scrollbar is on the left, the width needs to be extended
6662
+ // by the scrollbar amount so there isn't extra space on the right.
6663
+ width += windowScrollbarX;
6664
+ }
6591
6665
  return {
6592
6666
  width,
6593
6667
  height,
@@ -6596,6 +6670,7 @@ function getViewportRect(element, strategy) {
6596
6670
  };
6597
6671
  }
6598
6672
 
6673
+ const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
6599
6674
  // Returns the inner client rect, subtracting scrollbars if present.
6600
6675
  function getInnerBoundingClientRect(element, strategy) {
6601
6676
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -6624,9 +6699,10 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
6624
6699
  } else {
6625
6700
  const visualOffsets = getVisualOffsets(element);
6626
6701
  rect = {
6627
- ...clippingAncestor,
6628
6702
  x: clippingAncestor.x - visualOffsets.x,
6629
- y: clippingAncestor.y - visualOffsets.y
6703
+ y: clippingAncestor.y - visualOffsets.y,
6704
+ width: clippingAncestor.width,
6705
+ height: clippingAncestor.height
6630
6706
  };
6631
6707
  }
6632
6708
  return rectToClientRect(rect);
@@ -6636,7 +6712,7 @@ function hasFixedPositionAncestor(element, stopNode) {
6636
6712
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
6637
6713
  return false;
6638
6714
  }
6639
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
6715
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
6640
6716
  }
6641
6717
 
6642
6718
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -6649,17 +6725,17 @@ function getClippingElementAncestors(element, cache) {
6649
6725
  }
6650
6726
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
6651
6727
  let currentContainingBlockComputedStyle = null;
6652
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
6728
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
6653
6729
  let currentNode = elementIsFixed ? getParentNode(element) : element;
6654
6730
 
6655
6731
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
6656
6732
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
6657
- const computedStyle = getComputedStyle(currentNode);
6733
+ const computedStyle = getComputedStyle$1(currentNode);
6658
6734
  const currentNodeIsContaining = isContainingBlock(currentNode);
6659
6735
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
6660
6736
  currentContainingBlockComputedStyle = null;
6661
6737
  }
6662
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
6738
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
6663
6739
  if (shouldDropCurrentNode) {
6664
6740
  // Drop non-containing blocks.
6665
6741
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -6722,6 +6798,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6722
6798
  scrollTop: 0
6723
6799
  };
6724
6800
  const offsets = createCoords(0);
6801
+
6802
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
6803
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
6804
+ function setLeftRTLScrollbarOffset() {
6805
+ offsets.x = getWindowScrollBarX(documentElement);
6806
+ }
6725
6807
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
6726
6808
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
6727
6809
  scroll = getNodeScroll(offsetParent);
@@ -6731,11 +6813,15 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6731
6813
  offsets.x = offsetRect.x + offsetParent.clientLeft;
6732
6814
  offsets.y = offsetRect.y + offsetParent.clientTop;
6733
6815
  } else if (documentElement) {
6734
- offsets.x = getWindowScrollBarX(documentElement);
6816
+ setLeftRTLScrollbarOffset();
6735
6817
  }
6736
6818
  }
6737
- const x = rect.left + scroll.scrollLeft - offsets.x;
6738
- const y = rect.top + scroll.scrollTop - offsets.y;
6819
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
6820
+ setLeftRTLScrollbarOffset();
6821
+ }
6822
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
6823
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
6824
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
6739
6825
  return {
6740
6826
  x,
6741
6827
  y,
@@ -6745,17 +6831,26 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
6745
6831
  }
6746
6832
 
6747
6833
  function isStaticPositioned(element) {
6748
- return getComputedStyle(element).position === 'static';
6834
+ return getComputedStyle$1(element).position === 'static';
6749
6835
  }
6750
6836
 
6751
6837
  function getTrueOffsetParent(element, polyfill) {
6752
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
6838
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
6753
6839
  return null;
6754
6840
  }
6755
6841
  if (polyfill) {
6756
6842
  return polyfill(element);
6757
6843
  }
6758
- return element.offsetParent;
6844
+ let rawOffsetParent = element.offsetParent;
6845
+
6846
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
6847
+ // while Chrome and Safari return the <body> element. The <body> element must
6848
+ // be used to perform the correct calculations even if the <html> element is
6849
+ // non-static.
6850
+ if (getDocumentElement(element) === rawOffsetParent) {
6851
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
6852
+ }
6853
+ return rawOffsetParent;
6759
6854
  }
6760
6855
 
6761
6856
  // Gets the closest ancestor positioned element. Handles some edge cases,
@@ -6801,7 +6896,7 @@ const getElementRects = async function (data) {
6801
6896
  };
6802
6897
 
6803
6898
  function isRTL(element) {
6804
- return getComputedStyle(element).direction === 'rtl';
6899
+ return getComputedStyle$1(element).direction === 'rtl';
6805
6900
  }
6806
6901
 
6807
6902
  const platform = {
@@ -6817,6 +6912,10 @@ const platform = {
6817
6912
  isRTL
6818
6913
  };
6819
6914
 
6915
+ function rectsAreEqual(a, b) {
6916
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
6917
+ }
6918
+
6820
6919
  // https://samthor.au/2021/observing-dom/
6821
6920
  function observeMove(element, onMove) {
6822
6921
  let io = null;
@@ -6836,12 +6935,13 @@ function observeMove(element, onMove) {
6836
6935
  threshold = 1;
6837
6936
  }
6838
6937
  cleanup();
6938
+ const elementRectForRootMargin = element.getBoundingClientRect();
6839
6939
  const {
6840
6940
  left,
6841
6941
  top,
6842
6942
  width,
6843
6943
  height
6844
- } = element.getBoundingClientRect();
6944
+ } = elementRectForRootMargin;
6845
6945
  if (!skip) {
6846
6946
  onMove();
6847
6947
  }
@@ -6874,6 +6974,16 @@ function observeMove(element, onMove) {
6874
6974
  refresh(false, ratio);
6875
6975
  }
6876
6976
  }
6977
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
6978
+ // It's possible that even though the ratio is reported as 1, the
6979
+ // element is not actually fully within the IntersectionObserver's root
6980
+ // area anymore. This can happen under performance constraints. This may
6981
+ // be a bug in the browser's IntersectionObserver implementation. To
6982
+ // work around this, we compare the element's bounding rect now with
6983
+ // what it was at the time we created the IntersectionObserver. If they
6984
+ // are not equal then the element moved, so we refresh.
6985
+ refresh();
6986
+ }
6877
6987
  isFirstUpdate = false;
6878
6988
  }
6879
6989
 
@@ -6885,7 +6995,7 @@ function observeMove(element, onMove) {
6885
6995
  // Handle <iframe>s
6886
6996
  root: root.ownerDocument
6887
6997
  });
6888
- } catch (e) {
6998
+ } catch (_e) {
6889
6999
  io = new IntersectionObserver(handleObserve, options);
6890
7000
  }
6891
7001
  io.observe(element);
@@ -6951,7 +7061,7 @@ function autoUpdate(reference, floating, update, options) {
6951
7061
  }
6952
7062
  function frameLoop() {
6953
7063
  const nextRefRect = getBoundingClientRect(reference);
6954
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
7064
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
6955
7065
  update();
6956
7066
  }
6957
7067
  prevRefRect = nextRefRect;