@haiilo/catalyst 3.0.0 → 3.0.2

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 (80) hide show
  1. package/dist/catalyst/catalyst.css +22 -22
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/p-1c6eace6.js +3 -0
  5. package/dist/catalyst/p-1c6eace6.js.map +1 -0
  6. package/dist/catalyst/p-6865acc8.entry.js +10 -0
  7. package/dist/catalyst/p-6865acc8.entry.js.map +1 -0
  8. package/dist/catalyst/scss/core/_dialog.scss +1 -1
  9. package/dist/catalyst/scss/core/_notification.scss +10 -10
  10. package/dist/catalyst/scss/core/_typography.scss +1 -1
  11. package/dist/cjs/cat-alert_24.cjs.entry.js +1365 -39
  12. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  13. package/dist/cjs/catalyst.cjs.js +2 -2
  14. package/dist/cjs/{index-e540e911.js → index-22e41d18.js} +1 -4
  15. package/dist/cjs/index-22e41d18.js.map +1 -0
  16. package/dist/cjs/loader.cjs.js +2 -2
  17. package/dist/collection/collection-manifest.json +0 -1
  18. package/dist/collection/components/cat-input/cat-input.css +10 -0
  19. package/dist/collection/components/cat-scrollable/cat-scrollable.js +18 -14
  20. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  21. package/dist/collection/components/cat-select/cat-select.js +14 -10
  22. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  23. package/dist/collection/components/cat-textarea/cat-textarea.css +5 -0
  24. package/dist/collection/scss/core/_dialog.scss +1 -1
  25. package/dist/collection/scss/core/_notification.scss +10 -10
  26. package/dist/collection/scss/core/_typography.scss +1 -1
  27. package/dist/components/cat-badge.js.map +1 -1
  28. package/dist/components/cat-button2.js.map +1 -1
  29. package/dist/components/cat-card.js.map +1 -1
  30. package/dist/components/cat-dropdown2.js +759 -2
  31. package/dist/components/cat-dropdown2.js.map +1 -1
  32. package/dist/components/cat-input.js +1 -1
  33. package/dist/components/cat-input.js.map +1 -1
  34. package/dist/components/cat-scrollable2.js +241 -14
  35. package/dist/components/cat-scrollable2.js.map +1 -1
  36. package/dist/components/cat-select-demo.js +2 -2
  37. package/dist/components/cat-select2.js +13 -194
  38. package/dist/components/cat-select2.js.map +1 -1
  39. package/dist/components/cat-textarea.js +1 -1
  40. package/dist/components/cat-textarea.js.map +1 -1
  41. package/dist/components/index.d.ts +0 -1
  42. package/dist/components/index.js +0 -1
  43. package/dist/components/index.js.map +1 -1
  44. package/dist/esm/cat-alert_24.entry.js +1359 -33
  45. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  46. package/dist/esm/catalyst.js +2 -2
  47. package/dist/esm/{index-c2a28ebb.js → index-7b85fb91.js} +1 -4
  48. package/dist/esm/index-7b85fb91.js.map +1 -0
  49. package/dist/esm/loader.js +2 -2
  50. package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +3 -0
  51. package/dist/types/components/cat-select/cat-select.d.ts +1 -0
  52. package/dist/types/components.d.ts +0 -25
  53. package/package.json +2 -2
  54. package/dist/catalyst/p-52f9fea7.entry.js +0 -2
  55. package/dist/catalyst/p-52f9fea7.entry.js.map +0 -1
  56. package/dist/catalyst/p-53a1db22.js +0 -3
  57. package/dist/catalyst/p-53a1db22.js.map +0 -1
  58. package/dist/catalyst/p-557c8009.entry.js +0 -2
  59. package/dist/catalyst/p-557c8009.entry.js.map +0 -1
  60. package/dist/catalyst/p-60a20ebe.js +0 -10
  61. package/dist/catalyst/p-60a20ebe.js.map +0 -1
  62. package/dist/cjs/cat-modal.cjs.entry.js +0 -74
  63. package/dist/cjs/cat-modal.cjs.entry.js.map +0 -1
  64. package/dist/cjs/first-tabbable-7966cf1c.js +0 -1288
  65. package/dist/cjs/first-tabbable-7966cf1c.js.map +0 -1
  66. package/dist/cjs/index-e540e911.js.map +0 -1
  67. package/dist/collection/components/cat-modal/cat-modal.css +0 -65
  68. package/dist/collection/components/cat-modal/cat-modal.js +0 -117
  69. package/dist/collection/components/cat-modal/cat-modal.js.map +0 -1
  70. package/dist/components/cat-modal.d.ts +0 -11
  71. package/dist/components/cat-modal.js +0 -111
  72. package/dist/components/cat-modal.js.map +0 -1
  73. package/dist/components/focus-trap.esm.js +0 -763
  74. package/dist/components/focus-trap.esm.js.map +0 -1
  75. package/dist/esm/cat-modal.entry.js +0 -70
  76. package/dist/esm/cat-modal.entry.js.map +0 -1
  77. package/dist/esm/first-tabbable-4a00de61.js +0 -1284
  78. package/dist/esm/first-tabbable-4a00de61.js.map +0 -1
  79. package/dist/esm/index-c2a28ebb.js.map +0 -1
  80. package/dist/types/components/cat-modal/cat-modal.d.ts +0 -20
@@ -1,6 +1,5 @@
1
- import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-c2a28ebb.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-7b85fb91.js';
2
2
  import { l as loglevel, d as catIconRegistry, b as catI18nRegistry } from './cat-icon-registry-d6b80490.js';
3
- import { c as createFocusTrap, t as tabbable, f as firstTabbable } from './first-tabbable-4a00de61.js';
4
3
 
5
4
  function setAttributeDefault(host, attr, value) {
6
5
  if (!host.hostElement.hasAttribute(attr) && value != null) {
@@ -1103,7 +1102,7 @@ function getWindow(node) {
1103
1102
  return node;
1104
1103
  }
1105
1104
 
1106
- function getComputedStyle(element) {
1105
+ function getComputedStyle$1(element) {
1107
1106
  return getWindow(element).getComputedStyle(element);
1108
1107
  }
1109
1108
 
@@ -1146,7 +1145,7 @@ function isOverflowElement(element) {
1146
1145
  overflowX,
1147
1146
  overflowY,
1148
1147
  display
1149
- } = getComputedStyle(element);
1148
+ } = getComputedStyle$1(element);
1150
1149
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
1151
1150
  }
1152
1151
  function isTableElement(element) {
@@ -1155,7 +1154,7 @@ function isTableElement(element) {
1155
1154
  function isContainingBlock(element) {
1156
1155
  // TODO: Try and use feature detection here instead
1157
1156
  const isFirefox = /firefox/i.test(getUAString());
1158
- const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
1157
+ const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
1159
1158
  // create a containing block.
1160
1159
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1161
1160
 
@@ -1300,7 +1299,7 @@ function getParentNode(node) {
1300
1299
  }
1301
1300
 
1302
1301
  function getTrueOffsetParent(element) {
1303
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1302
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1304
1303
  return null;
1305
1304
  }
1306
1305
 
@@ -1332,11 +1331,11 @@ function getOffsetParent(element) {
1332
1331
  const window = getWindow(element);
1333
1332
  let offsetParent = getTrueOffsetParent(element);
1334
1333
 
1335
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
1334
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
1336
1335
  offsetParent = getTrueOffsetParent(offsetParent);
1337
1336
  }
1338
1337
 
1339
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1338
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1340
1339
  return window;
1341
1340
  }
1342
1341
 
@@ -1443,7 +1442,7 @@ function getDocumentRect(element) {
1443
1442
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1444
1443
  const y = -scroll.scrollTop;
1445
1444
 
1446
- if (getComputedStyle(body || html).direction === 'rtl') {
1445
+ if (getComputedStyle$1(body || html).direction === 'rtl') {
1447
1446
  x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1448
1447
  }
1449
1448
 
@@ -1514,7 +1513,7 @@ function getNearestParentCapableOfEscapingClipping(element, clippingAncestors) {
1514
1513
 
1515
1514
  while (currentNode && !isLastTraversableNode(currentNode) && // @ts-expect-error
1516
1515
  !clippingAncestors.includes(currentNode)) {
1517
- if (isElement(currentNode) && ['absolute', 'fixed'].includes(getComputedStyle(currentNode).position)) {
1516
+ if (isElement(currentNode) && ['absolute', 'fixed'].includes(getComputedStyle$1(currentNode).position)) {
1518
1517
  break;
1519
1518
  }
1520
1519
 
@@ -1629,7 +1628,7 @@ const platform = {
1629
1628
  };
1630
1629
  },
1631
1630
  getClientRects: element => Array.from(element.getClientRects()),
1632
- isRTL: element => getComputedStyle(element).direction === 'rtl'
1631
+ isRTL: element => getComputedStyle$1(element).direction === 'rtl'
1633
1632
  };
1634
1633
 
1635
1634
  /**
@@ -1721,6 +1720,1287 @@ const computePosition = (reference, floating, options) => computePosition$1(refe
1721
1720
  */
1722
1721
  const timeTransitionS = 125;
1723
1722
 
1723
+ /*!
1724
+ * tabbable 6.0.0
1725
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
1726
+ */
1727
+ var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
1728
+ var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
1729
+ var NoElement = typeof Element === 'undefined';
1730
+ var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1731
+ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
1732
+ return element.getRootNode();
1733
+ } : function (element) {
1734
+ return element.ownerDocument;
1735
+ };
1736
+ /**
1737
+ * @param {Element} el container to check in
1738
+ * @param {boolean} includeContainer add container to check
1739
+ * @param {(node: Element) => boolean} filter filter candidates
1740
+ * @returns {Element[]}
1741
+ */
1742
+
1743
+ var getCandidates = function getCandidates(el, includeContainer, filter) {
1744
+ var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
1745
+
1746
+ if (includeContainer && matches.call(el, candidateSelector)) {
1747
+ candidates.unshift(el);
1748
+ }
1749
+
1750
+ candidates = candidates.filter(filter);
1751
+ return candidates;
1752
+ };
1753
+ /**
1754
+ * @callback GetShadowRoot
1755
+ * @param {Element} element to check for shadow root
1756
+ * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
1757
+ */
1758
+
1759
+ /**
1760
+ * @callback ShadowRootFilter
1761
+ * @param {Element} shadowHostNode the element which contains shadow content
1762
+ * @returns {boolean} true if a shadow root could potentially contain valid candidates.
1763
+ */
1764
+
1765
+ /**
1766
+ * @typedef {Object} CandidatesScope
1767
+ * @property {Element} scope contains inner candidates
1768
+ * @property {Element[]} candidates
1769
+ */
1770
+
1771
+ /**
1772
+ * @typedef {Object} IterativeOptions
1773
+ * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
1774
+ * if a function, implies shadow support is enabled and either returns the shadow root of an element
1775
+ * or a boolean stating if it has an undisclosed shadow root
1776
+ * @property {(node: Element) => boolean} filter filter candidates
1777
+ * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list
1778
+ * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
1779
+ */
1780
+
1781
+ /**
1782
+ * @param {Element[]} elements list of element containers to match candidates from
1783
+ * @param {boolean} includeContainer add container list to check
1784
+ * @param {IterativeOptions} options
1785
+ * @returns {Array.<Element|CandidatesScope>}
1786
+ */
1787
+
1788
+
1789
+ var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
1790
+ var candidates = [];
1791
+ var elementsToCheck = Array.from(elements);
1792
+
1793
+ while (elementsToCheck.length) {
1794
+ var element = elementsToCheck.shift();
1795
+
1796
+ if (element.tagName === 'SLOT') {
1797
+ // add shadow dom slot scope (slot itself cannot be focusable)
1798
+ var assigned = element.assignedElements();
1799
+ var content = assigned.length ? assigned : element.children;
1800
+ var nestedCandidates = getCandidatesIteratively(content, true, options);
1801
+
1802
+ if (options.flatten) {
1803
+ candidates.push.apply(candidates, nestedCandidates);
1804
+ } else {
1805
+ candidates.push({
1806
+ scope: element,
1807
+ candidates: nestedCandidates
1808
+ });
1809
+ }
1810
+ } else {
1811
+ // check candidate element
1812
+ var validCandidate = matches.call(element, candidateSelector);
1813
+
1814
+ if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
1815
+ candidates.push(element);
1816
+ } // iterate over shadow content if possible
1817
+
1818
+
1819
+ var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
1820
+ typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
1821
+ var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);
1822
+
1823
+ if (shadowRoot && validShadowRoot) {
1824
+ // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
1825
+ // shadow exists, so look at light dom children as fallback BUT create a scope for any
1826
+ // child candidates found because they're likely slotted elements (elements that are
1827
+ // children of the web component element (which has the shadow), in the light dom, but
1828
+ // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
1829
+ // _after_ we return from this recursive call
1830
+ var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
1831
+
1832
+ if (options.flatten) {
1833
+ candidates.push.apply(candidates, _nestedCandidates);
1834
+ } else {
1835
+ candidates.push({
1836
+ scope: element,
1837
+ candidates: _nestedCandidates
1838
+ });
1839
+ }
1840
+ } else {
1841
+ // there's not shadow so just dig into the element's (light dom) children
1842
+ // __without__ giving the element special scope treatment
1843
+ elementsToCheck.unshift.apply(elementsToCheck, element.children);
1844
+ }
1845
+ }
1846
+ }
1847
+
1848
+ return candidates;
1849
+ };
1850
+
1851
+ var getTabindex = function getTabindex(node, isScope) {
1852
+ if (node.tabIndex < 0) {
1853
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
1854
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
1855
+ // yet they are still part of the regular tab order; in FF, they get a default
1856
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
1857
+ // order, consider their tab index to be 0.
1858
+ // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
1859
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
1860
+ //
1861
+ // isScope is positive for custom element with shadow root or slot that by default
1862
+ // have tabIndex -1, but need to be sorted by document order in order for their
1863
+ // content to be inserted in the correct position
1864
+ if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
1865
+ return 0;
1866
+ }
1867
+ }
1868
+
1869
+ return node.tabIndex;
1870
+ };
1871
+
1872
+ var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
1873
+ return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
1874
+ };
1875
+
1876
+ var isInput = function isInput(node) {
1877
+ return node.tagName === 'INPUT';
1878
+ };
1879
+
1880
+ var isHiddenInput = function isHiddenInput(node) {
1881
+ return isInput(node) && node.type === 'hidden';
1882
+ };
1883
+
1884
+ var isDetailsWithSummary = function isDetailsWithSummary(node) {
1885
+ var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
1886
+ return child.tagName === 'SUMMARY';
1887
+ });
1888
+ return r;
1889
+ };
1890
+
1891
+ var getCheckedRadio = function getCheckedRadio(nodes, form) {
1892
+ for (var i = 0; i < nodes.length; i++) {
1893
+ if (nodes[i].checked && nodes[i].form === form) {
1894
+ return nodes[i];
1895
+ }
1896
+ }
1897
+ };
1898
+
1899
+ var isTabbableRadio = function isTabbableRadio(node) {
1900
+ if (!node.name) {
1901
+ return true;
1902
+ }
1903
+
1904
+ var radioScope = node.form || getRootNode(node);
1905
+
1906
+ var queryRadios = function queryRadios(name) {
1907
+ return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
1908
+ };
1909
+
1910
+ var radioSet;
1911
+
1912
+ if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
1913
+ radioSet = queryRadios(window.CSS.escape(node.name));
1914
+ } else {
1915
+ try {
1916
+ radioSet = queryRadios(node.name);
1917
+ } catch (err) {
1918
+ // eslint-disable-next-line no-console
1919
+ console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
1920
+ return false;
1921
+ }
1922
+ }
1923
+
1924
+ var checked = getCheckedRadio(radioSet, node.form);
1925
+ return !checked || checked === node;
1926
+ };
1927
+
1928
+ var isRadio = function isRadio(node) {
1929
+ return isInput(node) && node.type === 'radio';
1930
+ };
1931
+
1932
+ var isNonTabbableRadio = function isNonTabbableRadio(node) {
1933
+ return isRadio(node) && !isTabbableRadio(node);
1934
+ }; // determines if a node is ultimately attached to the window's document
1935
+
1936
+
1937
+ var isNodeAttached = function isNodeAttached(node) {
1938
+ var _nodeRootHost;
1939
+
1940
+ // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
1941
+ // (but NOT _the_ document; see second 'If' comment below for more).
1942
+ // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
1943
+ // is attached, and the one we need to check if it's in the document or not (because the
1944
+ // shadow, and all nodes it contains, is never considered in the document since shadows
1945
+ // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
1946
+ // is hidden, or is not in the document itself but is detached, it will affect the shadow's
1947
+ // visibility, including all the nodes it contains). The host could be any normal node,
1948
+ // or a custom element (i.e. web component). Either way, that's the one that is considered
1949
+ // part of the document, not the shadow root, nor any of its children (i.e. the node being
1950
+ // tested).
1951
+ // To further complicate things, we have to look all the way up until we find a shadow HOST
1952
+ // that is attached (or find none) because the node might be in nested shadows...
1953
+ // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
1954
+ // document (per the docs) and while it's a Document-type object, that document does not
1955
+ // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
1956
+ // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
1957
+ // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
1958
+ // node is actually detached.
1959
+ var nodeRootHost = getRootNode(node).host;
1960
+ var attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && _nodeRootHost.ownerDocument.contains(nodeRootHost) || node.ownerDocument.contains(node));
1961
+
1962
+ while (!attached && nodeRootHost) {
1963
+ var _nodeRootHost2;
1964
+
1965
+ // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
1966
+ // which means we need to get the host's host and check if that parent host is contained
1967
+ // in (i.e. attached to) the document
1968
+ nodeRootHost = getRootNode(nodeRootHost).host;
1969
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && _nodeRootHost2.ownerDocument.contains(nodeRootHost));
1970
+ }
1971
+
1972
+ return attached;
1973
+ };
1974
+
1975
+ var isZeroArea = function isZeroArea(node) {
1976
+ var _node$getBoundingClie = node.getBoundingClientRect(),
1977
+ width = _node$getBoundingClie.width,
1978
+ height = _node$getBoundingClie.height;
1979
+
1980
+ return width === 0 && height === 0;
1981
+ };
1982
+
1983
+ var isHidden = function isHidden(node, _ref) {
1984
+ var displayCheck = _ref.displayCheck,
1985
+ getShadowRoot = _ref.getShadowRoot;
1986
+
1987
+ // NOTE: visibility will be `undefined` if node is detached from the document
1988
+ // (see notes about this further down), which means we will consider it visible
1989
+ // (this is legacy behavior from a very long way back)
1990
+ // NOTE: we check this regardless of `displayCheck="none"` because this is a
1991
+ // _visibility_ check, not a _display_ check
1992
+ if (getComputedStyle(node).visibility === 'hidden') {
1993
+ return true;
1994
+ }
1995
+
1996
+ var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
1997
+ var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
1998
+
1999
+ if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
2000
+ return true;
2001
+ }
2002
+
2003
+ if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
2004
+ if (typeof getShadowRoot === 'function') {
2005
+ // figure out if we should consider the node to be in an undisclosed shadow and use the
2006
+ // 'non-zero-area' fallback
2007
+ var originalNode = node;
2008
+
2009
+ while (node) {
2010
+ var parentElement = node.parentElement;
2011
+ var rootNode = getRootNode(node);
2012
+
2013
+ if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
2014
+ ) {
2015
+ // node has an undisclosed shadow which means we can only treat it as a black box, so we
2016
+ // fall back to a non-zero-area test
2017
+ return isZeroArea(node);
2018
+ } else if (node.assignedSlot) {
2019
+ // iterate up slot
2020
+ node = node.assignedSlot;
2021
+ } else if (!parentElement && rootNode !== node.ownerDocument) {
2022
+ // cross shadow boundary
2023
+ node = rootNode.host;
2024
+ } else {
2025
+ // iterate up normal dom
2026
+ node = parentElement;
2027
+ }
2028
+ }
2029
+
2030
+ node = originalNode;
2031
+ } // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
2032
+ // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
2033
+ // it might be a falsy value, which means shadow DOM support is disabled
2034
+ // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
2035
+ // now we can just test to see if it would normally be visible or not, provided it's
2036
+ // attached to the main document.
2037
+ // NOTE: We must consider case where node is inside a shadow DOM and given directly to
2038
+ // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
2039
+
2040
+
2041
+ if (isNodeAttached(node)) {
2042
+ // this works wherever the node is: if there's at least one client rect, it's
2043
+ // somehow displayed; it also covers the CSS 'display: contents' case where the
2044
+ // node itself is hidden in place of its contents; and there's no need to search
2045
+ // up the hierarchy either
2046
+ return !node.getClientRects().length;
2047
+ } // Else, the node isn't attached to the document, which means the `getClientRects()`
2048
+ // API will __always__ return zero rects (this can happen, for example, if React
2049
+ // is used to render nodes onto a detached tree, as confirmed in this thread:
2050
+ // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
2051
+ //
2052
+ // It also means that even window.getComputedStyle(node).display will return `undefined`
2053
+ // because styles are only computed for nodes that are in the document.
2054
+ //
2055
+ // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
2056
+ // somehow. Though it was never stated officially, anyone who has ever used tabbable
2057
+ // APIs on nodes in detached containers has actually implicitly used tabbable in what
2058
+ // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
2059
+ // considering __everything__ to be visible because of the innability to determine styles.
2060
+ //
2061
+ // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
2062
+ // nodes as visible with the 'none' fallback.__
2063
+
2064
+
2065
+ if (displayCheck !== 'legacy-full') {
2066
+ return true; // hidden
2067
+ } // else, fallback to 'none' mode and consider the node visible
2068
+
2069
+ } else if (displayCheck === 'non-zero-area') {
2070
+ // NOTE: Even though this tests that the node's client rect is non-zero to determine
2071
+ // whether it's displayed, and that a detached node will __always__ have a zero-area
2072
+ // client rect, we don't special-case for whether the node is attached or not. In
2073
+ // this mode, we do want to consider nodes that have a zero area to be hidden at all
2074
+ // times, and that includes attached or not.
2075
+ return isZeroArea(node);
2076
+ } // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
2077
+ // it's visible
2078
+
2079
+
2080
+ return false;
2081
+ }; // form fields (nested) inside a disabled fieldset are not focusable/tabbable
2082
+ // unless they are in the _first_ <legend> element of the top-most disabled
2083
+ // fieldset
2084
+
2085
+
2086
+ var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
2087
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
2088
+ var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>
2089
+
2090
+ while (parentNode) {
2091
+ if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
2092
+ // look for the first <legend> among the children of the disabled <fieldset>
2093
+ for (var i = 0; i < parentNode.children.length; i++) {
2094
+ var child = parentNode.children.item(i); // when the first <legend> (in document order) is found
2095
+
2096
+ if (child.tagName === 'LEGEND') {
2097
+ // if its parent <fieldset> is not nested in another disabled <fieldset>,
2098
+ // return whether `node` is a descendant of its first <legend>
2099
+ return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
2100
+ }
2101
+ } // the disabled <fieldset> containing `node` has no <legend>
2102
+
2103
+
2104
+ return true;
2105
+ }
2106
+
2107
+ parentNode = parentNode.parentElement;
2108
+ }
2109
+ } // else, node's tabbable/focusable state should not be affected by a fieldset's
2110
+ // enabled/disabled state
2111
+
2112
+
2113
+ return false;
2114
+ };
2115
+
2116
+ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
2117
+ if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
2118
+ isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
2119
+ return false;
2120
+ }
2121
+
2122
+ return true;
2123
+ };
2124
+
2125
+ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
2126
+ if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
2127
+ return false;
2128
+ }
2129
+
2130
+ return true;
2131
+ };
2132
+
2133
+ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
2134
+ var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
2135
+
2136
+ if (isNaN(tabIndex) || tabIndex >= 0) {
2137
+ return true;
2138
+ } // If a custom element has an explicit negative tabindex,
2139
+ // browsers will not allow tab targeting said element's children.
2140
+
2141
+
2142
+ return false;
2143
+ };
2144
+ /**
2145
+ * @param {Array.<Element|CandidatesScope>} candidates
2146
+ * @returns Element[]
2147
+ */
2148
+
2149
+
2150
+ var sortByOrder = function sortByOrder(candidates) {
2151
+ var regularTabbables = [];
2152
+ var orderedTabbables = [];
2153
+ candidates.forEach(function (item, i) {
2154
+ var isScope = !!item.scope;
2155
+ var element = isScope ? item.scope : item;
2156
+ var candidateTabindex = getTabindex(element, isScope);
2157
+ var elements = isScope ? sortByOrder(item.candidates) : element;
2158
+
2159
+ if (candidateTabindex === 0) {
2160
+ isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
2161
+ } else {
2162
+ orderedTabbables.push({
2163
+ documentOrder: i,
2164
+ tabIndex: candidateTabindex,
2165
+ item: item,
2166
+ isScope: isScope,
2167
+ content: elements
2168
+ });
2169
+ }
2170
+ });
2171
+ return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
2172
+ sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
2173
+ return acc;
2174
+ }, []).concat(regularTabbables);
2175
+ };
2176
+
2177
+ var tabbable = function tabbable(el, options) {
2178
+ options = options || {};
2179
+ var candidates;
2180
+
2181
+ if (options.getShadowRoot) {
2182
+ candidates = getCandidatesIteratively([el], options.includeContainer, {
2183
+ filter: isNodeMatchingSelectorTabbable.bind(null, options),
2184
+ flatten: false,
2185
+ getShadowRoot: options.getShadowRoot,
2186
+ shadowRootFilter: isValidShadowRootTabbable
2187
+ });
2188
+ } else {
2189
+ candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
2190
+ }
2191
+
2192
+ return sortByOrder(candidates);
2193
+ };
2194
+
2195
+ var focusable = function focusable(el, options) {
2196
+ options = options || {};
2197
+ var candidates;
2198
+
2199
+ if (options.getShadowRoot) {
2200
+ candidates = getCandidatesIteratively([el], options.includeContainer, {
2201
+ filter: isNodeMatchingSelectorFocusable.bind(null, options),
2202
+ flatten: true,
2203
+ getShadowRoot: options.getShadowRoot
2204
+ });
2205
+ } else {
2206
+ candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
2207
+ }
2208
+
2209
+ return candidates;
2210
+ };
2211
+
2212
+ var isTabbable = function isTabbable(node, options) {
2213
+ options = options || {};
2214
+
2215
+ if (!node) {
2216
+ throw new Error('No node provided');
2217
+ }
2218
+
2219
+ if (matches.call(node, candidateSelector) === false) {
2220
+ return false;
2221
+ }
2222
+
2223
+ return isNodeMatchingSelectorTabbable(options, node);
2224
+ };
2225
+
2226
+ var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
2227
+
2228
+ var isFocusable = function isFocusable(node, options) {
2229
+ options = options || {};
2230
+
2231
+ if (!node) {
2232
+ throw new Error('No node provided');
2233
+ }
2234
+
2235
+ if (matches.call(node, focusableCandidateSelector) === false) {
2236
+ return false;
2237
+ }
2238
+
2239
+ return isNodeMatchingSelectorFocusable(options, node);
2240
+ };
2241
+
2242
+ /*!
2243
+ * focus-trap 7.0.0
2244
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
2245
+ */
2246
+
2247
+ function ownKeys(object, enumerableOnly) {
2248
+ var keys = Object.keys(object);
2249
+
2250
+ if (Object.getOwnPropertySymbols) {
2251
+ var symbols = Object.getOwnPropertySymbols(object);
2252
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
2253
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2254
+ })), keys.push.apply(keys, symbols);
2255
+ }
2256
+
2257
+ return keys;
2258
+ }
2259
+
2260
+ function _objectSpread2(target) {
2261
+ for (var i = 1; i < arguments.length; i++) {
2262
+ var source = null != arguments[i] ? arguments[i] : {};
2263
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
2264
+ _defineProperty(target, key, source[key]);
2265
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
2266
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2267
+ });
2268
+ }
2269
+
2270
+ return target;
2271
+ }
2272
+
2273
+ function _defineProperty(obj, key, value) {
2274
+ if (key in obj) {
2275
+ Object.defineProperty(obj, key, {
2276
+ value: value,
2277
+ enumerable: true,
2278
+ configurable: true,
2279
+ writable: true
2280
+ });
2281
+ } else {
2282
+ obj[key] = value;
2283
+ }
2284
+
2285
+ return obj;
2286
+ }
2287
+
2288
+ var activeFocusTraps = function () {
2289
+ var trapQueue = [];
2290
+ return {
2291
+ activateTrap: function activateTrap(trap) {
2292
+ if (trapQueue.length > 0) {
2293
+ var activeTrap = trapQueue[trapQueue.length - 1];
2294
+
2295
+ if (activeTrap !== trap) {
2296
+ activeTrap.pause();
2297
+ }
2298
+ }
2299
+
2300
+ var trapIndex = trapQueue.indexOf(trap);
2301
+
2302
+ if (trapIndex === -1) {
2303
+ trapQueue.push(trap);
2304
+ } else {
2305
+ // move this existing trap to the front of the queue
2306
+ trapQueue.splice(trapIndex, 1);
2307
+ trapQueue.push(trap);
2308
+ }
2309
+ },
2310
+ deactivateTrap: function deactivateTrap(trap) {
2311
+ var trapIndex = trapQueue.indexOf(trap);
2312
+
2313
+ if (trapIndex !== -1) {
2314
+ trapQueue.splice(trapIndex, 1);
2315
+ }
2316
+
2317
+ if (trapQueue.length > 0) {
2318
+ trapQueue[trapQueue.length - 1].unpause();
2319
+ }
2320
+ }
2321
+ };
2322
+ }();
2323
+
2324
+ var isSelectableInput = function isSelectableInput(node) {
2325
+ return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
2326
+ };
2327
+
2328
+ var isEscapeEvent = function isEscapeEvent(e) {
2329
+ return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
2330
+ };
2331
+
2332
+ var isTabEvent = function isTabEvent(e) {
2333
+ return e.key === 'Tab' || e.keyCode === 9;
2334
+ };
2335
+
2336
+ var delay$1 = function delay(fn) {
2337
+ return setTimeout(fn, 0);
2338
+ }; // Array.find/findIndex() are not supported on IE; this replicates enough
2339
+ // of Array.findIndex() for our needs
2340
+
2341
+
2342
+ var findIndex = function findIndex(arr, fn) {
2343
+ var idx = -1;
2344
+ arr.every(function (value, i) {
2345
+ if (fn(value)) {
2346
+ idx = i;
2347
+ return false; // break
2348
+ }
2349
+
2350
+ return true; // next
2351
+ });
2352
+ return idx;
2353
+ };
2354
+ /**
2355
+ * Get an option's value when it could be a plain value, or a handler that provides
2356
+ * the value.
2357
+ * @param {*} value Option's value to check.
2358
+ * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
2359
+ * @returns {*} The `value`, or the handler's returned value.
2360
+ */
2361
+
2362
+
2363
+ var valueOrHandler = function valueOrHandler(value) {
2364
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2365
+ params[_key - 1] = arguments[_key];
2366
+ }
2367
+
2368
+ return typeof value === 'function' ? value.apply(void 0, params) : value;
2369
+ };
2370
+
2371
+ var getActualTarget = function getActualTarget(event) {
2372
+ // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
2373
+ // shadow host. However, event.target.composedPath() will be an array of
2374
+ // nodes "clicked" from inner-most (the actual element inside the shadow) to
2375
+ // outer-most (the host HTML document). If we have access to composedPath(),
2376
+ // then use its first element; otherwise, fall back to event.target (and
2377
+ // this only works for an _open_ shadow DOM; otherwise,
2378
+ // composedPath()[0] === event.target always).
2379
+ return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
2380
+ };
2381
+
2382
+ var createFocusTrap = function createFocusTrap(elements, userOptions) {
2383
+ // SSR: a live trap shouldn't be created in this type of environment so this
2384
+ // should be safe code to execute if the `document` option isn't specified
2385
+ var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
2386
+
2387
+ var config = _objectSpread2({
2388
+ returnFocusOnDeactivate: true,
2389
+ escapeDeactivates: true,
2390
+ delayInitialFocus: true
2391
+ }, userOptions);
2392
+
2393
+ var state = {
2394
+ // containers given to createFocusTrap()
2395
+ // @type {Array<HTMLElement>}
2396
+ containers: [],
2397
+ // list of objects identifying tabbable nodes in `containers` in the trap
2398
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
2399
+ // is active, but the trap should never get to a state where there isn't at least one group
2400
+ // with at least one tabbable node in it (that would lead to an error condition that would
2401
+ // result in an error being thrown)
2402
+ // @type {Array<{
2403
+ // container: HTMLElement,
2404
+ // tabbableNodes: Array<HTMLElement>, // empty if none
2405
+ // focusableNodes: Array<HTMLElement>, // empty if none
2406
+ // firstTabbableNode: HTMLElement|null,
2407
+ // lastTabbableNode: HTMLElement|null,
2408
+ // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
2409
+ // }>}
2410
+ containerGroups: [],
2411
+ // same order/length as `containers` list
2412
+ // references to objects in `containerGroups`, but only those that actually have
2413
+ // tabbable nodes in them
2414
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
2415
+ // the same length
2416
+ tabbableGroups: [],
2417
+ nodeFocusedBeforeActivation: null,
2418
+ mostRecentlyFocusedNode: null,
2419
+ active: false,
2420
+ paused: false,
2421
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
2422
+ // has been delayed during activation
2423
+ delayInitialFocusTimer: undefined
2424
+ };
2425
+ var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
2426
+
2427
+ /**
2428
+ * Gets a configuration option value.
2429
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
2430
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
2431
+ * @param {string} optionName Name of the option whose value is sought.
2432
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
2433
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
2434
+ */
2435
+
2436
+ var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
2437
+ return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
2438
+ };
2439
+ /**
2440
+ * Finds the index of the container that contains the element.
2441
+ * @param {HTMLElement} element
2442
+ * @returns {number} Index of the container in either `state.containers` or
2443
+ * `state.containerGroups` (the order/length of these lists are the same); -1
2444
+ * if the element isn't found.
2445
+ */
2446
+
2447
+
2448
+ var findContainerIndex = function findContainerIndex(element) {
2449
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
2450
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
2451
+ // and we still need to find the element in there
2452
+ return state.containerGroups.findIndex(function (_ref) {
2453
+ var container = _ref.container,
2454
+ tabbableNodes = _ref.tabbableNodes;
2455
+ return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
2456
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
2457
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
2458
+ // look inside web components even if open)
2459
+ tabbableNodes.find(function (node) {
2460
+ return node === element;
2461
+ });
2462
+ });
2463
+ };
2464
+ /**
2465
+ * Gets the node for the given option, which is expected to be an option that
2466
+ * can be either a DOM node, a string that is a selector to get a node, `false`
2467
+ * (if a node is explicitly NOT given), or a function that returns any of these
2468
+ * values.
2469
+ * @param {string} optionName
2470
+ * @returns {undefined | false | HTMLElement | SVGElement} Returns
2471
+ * `undefined` if the option is not specified; `false` if the option
2472
+ * resolved to `false` (node explicitly not given); otherwise, the resolved
2473
+ * DOM node.
2474
+ * @throws {Error} If the option is set, not `false`, and is not, or does not
2475
+ * resolve to a node.
2476
+ */
2477
+
2478
+
2479
+ var getNodeForOption = function getNodeForOption(optionName) {
2480
+ var optionValue = config[optionName];
2481
+
2482
+ if (typeof optionValue === 'function') {
2483
+ for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2484
+ params[_key2 - 1] = arguments[_key2];
2485
+ }
2486
+
2487
+ optionValue = optionValue.apply(void 0, params);
2488
+ }
2489
+
2490
+ if (optionValue === true) {
2491
+ optionValue = undefined; // use default value
2492
+ }
2493
+
2494
+ if (!optionValue) {
2495
+ if (optionValue === undefined || optionValue === false) {
2496
+ return optionValue;
2497
+ } // else, empty string (invalid), null (invalid), 0 (invalid)
2498
+
2499
+
2500
+ throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
2501
+ }
2502
+
2503
+ var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
2504
+
2505
+ if (typeof optionValue === 'string') {
2506
+ node = doc.querySelector(optionValue); // resolve to node, or null if fails
2507
+
2508
+ if (!node) {
2509
+ throw new Error("`".concat(optionName, "` as selector refers to no known node"));
2510
+ }
2511
+ }
2512
+
2513
+ return node;
2514
+ };
2515
+
2516
+ var getInitialFocusNode = function getInitialFocusNode() {
2517
+ var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
2518
+
2519
+ if (node === false) {
2520
+ return false;
2521
+ }
2522
+
2523
+ if (node === undefined) {
2524
+ // option not specified: use fallback options
2525
+ if (findContainerIndex(doc.activeElement) >= 0) {
2526
+ node = doc.activeElement;
2527
+ } else {
2528
+ var firstTabbableGroup = state.tabbableGroups[0];
2529
+ var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
2530
+
2531
+ node = firstTabbableNode || getNodeForOption('fallbackFocus');
2532
+ }
2533
+ }
2534
+
2535
+ if (!node) {
2536
+ throw new Error('Your focus-trap needs to have at least one focusable element');
2537
+ }
2538
+
2539
+ return node;
2540
+ };
2541
+
2542
+ var updateTabbableNodes = function updateTabbableNodes() {
2543
+ state.containerGroups = state.containers.map(function (container) {
2544
+ var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
2545
+ // are a superset of tabbable nodes
2546
+
2547
+ var focusableNodes = focusable(container, config.tabbableOptions);
2548
+ return {
2549
+ container: container,
2550
+ tabbableNodes: tabbableNodes,
2551
+ focusableNodes: focusableNodes,
2552
+ firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
2553
+ lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
2554
+
2555
+ /**
2556
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
2557
+ * in this container, if any.
2558
+ * @param {HTMLElement} node
2559
+ * @param {boolean} [forward] True if going in forward tab order; false if going
2560
+ * in reverse.
2561
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
2562
+ */
2563
+ nextTabbableNode: function nextTabbableNode(node) {
2564
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2565
+ // NOTE: If tabindex is positive (in order to manipulate the tab order separate
2566
+ // from the DOM order), this __will not work__ because the list of focusableNodes,
2567
+ // while it contains tabbable nodes, does not sort its nodes in any order other
2568
+ // than DOM order, because it can't: Where would you place focusable (but not
2569
+ // tabbable) nodes in that order? They have no order, because they aren't tabbale...
2570
+ // Support for positive tabindex is already broken and hard to manage (possibly
2571
+ // not supportable, TBD), so this isn't going to make things worse than they
2572
+ // already are, and at least makes things better for the majority of cases where
2573
+ // tabindex is either 0/unset or negative.
2574
+ // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
2575
+ var nodeIdx = focusableNodes.findIndex(function (n) {
2576
+ return n === node;
2577
+ });
2578
+
2579
+ if (nodeIdx < 0) {
2580
+ return undefined;
2581
+ }
2582
+
2583
+ if (forward) {
2584
+ return focusableNodes.slice(nodeIdx + 1).find(function (n) {
2585
+ return isTabbable(n, config.tabbableOptions);
2586
+ });
2587
+ }
2588
+
2589
+ return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
2590
+ return isTabbable(n, config.tabbableOptions);
2591
+ });
2592
+ }
2593
+ };
2594
+ });
2595
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
2596
+ return group.tabbableNodes.length > 0;
2597
+ }); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
2598
+
2599
+ if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
2600
+ ) {
2601
+ throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
2602
+ }
2603
+ };
2604
+
2605
+ var tryFocus = function tryFocus(node) {
2606
+ if (node === false) {
2607
+ return;
2608
+ }
2609
+
2610
+ if (node === doc.activeElement) {
2611
+ return;
2612
+ }
2613
+
2614
+ if (!node || !node.focus) {
2615
+ tryFocus(getInitialFocusNode());
2616
+ return;
2617
+ }
2618
+
2619
+ node.focus({
2620
+ preventScroll: !!config.preventScroll
2621
+ });
2622
+ state.mostRecentlyFocusedNode = node;
2623
+
2624
+ if (isSelectableInput(node)) {
2625
+ node.select();
2626
+ }
2627
+ };
2628
+
2629
+ var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
2630
+ var node = getNodeForOption('setReturnFocus', previousActiveElement);
2631
+ return node ? node : node === false ? false : previousActiveElement;
2632
+ }; // This needs to be done on mousedown and touchstart instead of click
2633
+ // so that it precedes the focus event.
2634
+
2635
+
2636
+ var checkPointerDown = function checkPointerDown(e) {
2637
+ var target = getActualTarget(e);
2638
+
2639
+ if (findContainerIndex(target) >= 0) {
2640
+ // allow the click since it ocurred inside the trap
2641
+ return;
2642
+ }
2643
+
2644
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
2645
+ // immediately deactivate the trap
2646
+ trap.deactivate({
2647
+ // if, on deactivation, we should return focus to the node originally-focused
2648
+ // when the trap was activated (or the configured `setReturnFocus` node),
2649
+ // then assume it's also OK to return focus to the outside node that was
2650
+ // just clicked, causing deactivation, as long as that node is focusable;
2651
+ // if it isn't focusable, then return focus to the original node focused
2652
+ // on activation (or the configured `setReturnFocus` node)
2653
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
2654
+ // which will result in the outside click setting focus to the node
2655
+ // that was clicked, whether it's focusable or not; by setting
2656
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
2657
+ // on activation (or the configured `setReturnFocus` node)
2658
+ returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
2659
+ });
2660
+ return;
2661
+ } // This is needed for mobile devices.
2662
+ // (If we'll only let `click` events through,
2663
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
2664
+
2665
+
2666
+ if (valueOrHandler(config.allowOutsideClick, e)) {
2667
+ // allow the click outside the trap to take place
2668
+ return;
2669
+ } // otherwise, prevent the click
2670
+
2671
+
2672
+ e.preventDefault();
2673
+ }; // In case focus escapes the trap for some strange reason, pull it back in.
2674
+
2675
+
2676
+ var checkFocusIn = function checkFocusIn(e) {
2677
+ var target = getActualTarget(e);
2678
+ var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
2679
+
2680
+ if (targetContained || target instanceof Document) {
2681
+ if (targetContained) {
2682
+ state.mostRecentlyFocusedNode = target;
2683
+ }
2684
+ } else {
2685
+ // escaped! pull it back in to where it just left
2686
+ e.stopImmediatePropagation();
2687
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
2688
+ }
2689
+ }; // Hijack Tab events on the first and last focusable nodes of the trap,
2690
+ // in order to prevent focus from escaping. If it escapes for even a
2691
+ // moment it can end up scrolling the page and causing confusion so we
2692
+ // kind of need to capture the action at the keydown phase.
2693
+
2694
+
2695
+ var checkTab = function checkTab(e) {
2696
+ var target = getActualTarget(e);
2697
+ updateTabbableNodes();
2698
+ var destinationNode = null;
2699
+
2700
+ if (state.tabbableGroups.length > 0) {
2701
+ // make sure the target is actually contained in a group
2702
+ // NOTE: the target may also be the container itself if it's focusable
2703
+ // with tabIndex='-1' and was given initial focus
2704
+ var containerIndex = findContainerIndex(target);
2705
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
2706
+
2707
+ if (containerIndex < 0) {
2708
+ // target not found in any group: quite possible focus has escaped the trap,
2709
+ // so bring it back in to...
2710
+ if (e.shiftKey) {
2711
+ // ...the last node in the last group
2712
+ destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
2713
+ } else {
2714
+ // ...the first node in the first group
2715
+ destinationNode = state.tabbableGroups[0].firstTabbableNode;
2716
+ }
2717
+ } else if (e.shiftKey) {
2718
+ // REVERSE
2719
+ // is the target the first tabbable node in a group?
2720
+ var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
2721
+ var firstTabbableNode = _ref2.firstTabbableNode;
2722
+ return target === firstTabbableNode;
2723
+ });
2724
+
2725
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
2726
+ // an exception case where the target is either the container itself, or
2727
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
2728
+ // and user clicked on it or node was programmatically given focus)
2729
+ // and is not followed by any other tabbable node, in which
2730
+ // case, we should handle shift+tab as if focus were on the container's
2731
+ // first tabbable node, and go to the last tabbable node of the LAST group
2732
+ startOfGroupIndex = containerIndex;
2733
+ }
2734
+
2735
+ if (startOfGroupIndex >= 0) {
2736
+ // YES: then shift+tab should go to the last tabbable node in the
2737
+ // previous group (and wrap around to the last tabbable node of
2738
+ // the LAST group if it's the first tabbable node of the FIRST group)
2739
+ var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
2740
+ var destinationGroup = state.tabbableGroups[destinationGroupIndex];
2741
+ destinationNode = destinationGroup.lastTabbableNode;
2742
+ }
2743
+ } else {
2744
+ // FORWARD
2745
+ // is the target the last tabbable node in a group?
2746
+ var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
2747
+ var lastTabbableNode = _ref3.lastTabbableNode;
2748
+ return target === lastTabbableNode;
2749
+ });
2750
+
2751
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
2752
+ // an exception case where the target is the container itself, or
2753
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
2754
+ // and user clicked on it or node was programmatically given focus)
2755
+ // and is not followed by any other tabbable node, in which
2756
+ // case, we should handle tab as if focus were on the container's
2757
+ // last tabbable node, and go to the first tabbable node of the FIRST group
2758
+ lastOfGroupIndex = containerIndex;
2759
+ }
2760
+
2761
+ if (lastOfGroupIndex >= 0) {
2762
+ // YES: then tab should go to the first tabbable node in the next
2763
+ // group (and wrap around to the first tabbable node of the FIRST
2764
+ // group if it's the last tabbable node of the LAST group)
2765
+ var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
2766
+
2767
+ var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
2768
+ destinationNode = _destinationGroup.firstTabbableNode;
2769
+ }
2770
+ }
2771
+ } else {
2772
+ // NOTE: the fallbackFocus option does not support returning false to opt-out
2773
+ destinationNode = getNodeForOption('fallbackFocus');
2774
+ }
2775
+
2776
+ if (destinationNode) {
2777
+ e.preventDefault();
2778
+ tryFocus(destinationNode);
2779
+ } // else, let the browser take care of [shift+]tab and move the focus
2780
+
2781
+ };
2782
+
2783
+ var checkKey = function checkKey(e) {
2784
+ if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates, e) !== false) {
2785
+ e.preventDefault();
2786
+ trap.deactivate();
2787
+ return;
2788
+ }
2789
+
2790
+ if (isTabEvent(e)) {
2791
+ checkTab(e);
2792
+ return;
2793
+ }
2794
+ };
2795
+
2796
+ var checkClick = function checkClick(e) {
2797
+ var target = getActualTarget(e);
2798
+
2799
+ if (findContainerIndex(target) >= 0) {
2800
+ return;
2801
+ }
2802
+
2803
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
2804
+ return;
2805
+ }
2806
+
2807
+ if (valueOrHandler(config.allowOutsideClick, e)) {
2808
+ return;
2809
+ }
2810
+
2811
+ e.preventDefault();
2812
+ e.stopImmediatePropagation();
2813
+ }; //
2814
+ // EVENT LISTENERS
2815
+ //
2816
+
2817
+
2818
+ var addListeners = function addListeners() {
2819
+ if (!state.active) {
2820
+ return;
2821
+ } // There can be only one listening focus trap at a time
2822
+
2823
+
2824
+ activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
2825
+ // that caused the focus trap activation.
2826
+
2827
+ state.delayInitialFocusTimer = config.delayInitialFocus ? delay$1(function () {
2828
+ tryFocus(getInitialFocusNode());
2829
+ }) : tryFocus(getInitialFocusNode());
2830
+ doc.addEventListener('focusin', checkFocusIn, true);
2831
+ doc.addEventListener('mousedown', checkPointerDown, {
2832
+ capture: true,
2833
+ passive: false
2834
+ });
2835
+ doc.addEventListener('touchstart', checkPointerDown, {
2836
+ capture: true,
2837
+ passive: false
2838
+ });
2839
+ doc.addEventListener('click', checkClick, {
2840
+ capture: true,
2841
+ passive: false
2842
+ });
2843
+ doc.addEventListener('keydown', checkKey, {
2844
+ capture: true,
2845
+ passive: false
2846
+ });
2847
+ return trap;
2848
+ };
2849
+
2850
+ var removeListeners = function removeListeners() {
2851
+ if (!state.active) {
2852
+ return;
2853
+ }
2854
+
2855
+ doc.removeEventListener('focusin', checkFocusIn, true);
2856
+ doc.removeEventListener('mousedown', checkPointerDown, true);
2857
+ doc.removeEventListener('touchstart', checkPointerDown, true);
2858
+ doc.removeEventListener('click', checkClick, true);
2859
+ doc.removeEventListener('keydown', checkKey, true);
2860
+ return trap;
2861
+ }; //
2862
+ // TRAP DEFINITION
2863
+ //
2864
+
2865
+
2866
+ trap = {
2867
+ get active() {
2868
+ return state.active;
2869
+ },
2870
+
2871
+ get paused() {
2872
+ return state.paused;
2873
+ },
2874
+
2875
+ activate: function activate(activateOptions) {
2876
+ if (state.active) {
2877
+ return this;
2878
+ }
2879
+
2880
+ var onActivate = getOption(activateOptions, 'onActivate');
2881
+ var onPostActivate = getOption(activateOptions, 'onPostActivate');
2882
+ var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
2883
+
2884
+ if (!checkCanFocusTrap) {
2885
+ updateTabbableNodes();
2886
+ }
2887
+
2888
+ state.active = true;
2889
+ state.paused = false;
2890
+ state.nodeFocusedBeforeActivation = doc.activeElement;
2891
+
2892
+ if (onActivate) {
2893
+ onActivate();
2894
+ }
2895
+
2896
+ var finishActivation = function finishActivation() {
2897
+ if (checkCanFocusTrap) {
2898
+ updateTabbableNodes();
2899
+ }
2900
+
2901
+ addListeners();
2902
+
2903
+ if (onPostActivate) {
2904
+ onPostActivate();
2905
+ }
2906
+ };
2907
+
2908
+ if (checkCanFocusTrap) {
2909
+ checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
2910
+ return this;
2911
+ }
2912
+
2913
+ finishActivation();
2914
+ return this;
2915
+ },
2916
+ deactivate: function deactivate(deactivateOptions) {
2917
+ if (!state.active) {
2918
+ return this;
2919
+ }
2920
+
2921
+ var options = _objectSpread2({
2922
+ onDeactivate: config.onDeactivate,
2923
+ onPostDeactivate: config.onPostDeactivate,
2924
+ checkCanReturnFocus: config.checkCanReturnFocus
2925
+ }, deactivateOptions);
2926
+
2927
+ clearTimeout(state.delayInitialFocusTimer); // noop if undefined
2928
+
2929
+ state.delayInitialFocusTimer = undefined;
2930
+ removeListeners();
2931
+ state.active = false;
2932
+ state.paused = false;
2933
+ activeFocusTraps.deactivateTrap(trap);
2934
+ var onDeactivate = getOption(options, 'onDeactivate');
2935
+ var onPostDeactivate = getOption(options, 'onPostDeactivate');
2936
+ var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
2937
+ var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
2938
+
2939
+ if (onDeactivate) {
2940
+ onDeactivate();
2941
+ }
2942
+
2943
+ var finishDeactivation = function finishDeactivation() {
2944
+ delay$1(function () {
2945
+ if (returnFocus) {
2946
+ tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
2947
+ }
2948
+
2949
+ if (onPostDeactivate) {
2950
+ onPostDeactivate();
2951
+ }
2952
+ });
2953
+ };
2954
+
2955
+ if (returnFocus && checkCanReturnFocus) {
2956
+ checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
2957
+ return this;
2958
+ }
2959
+
2960
+ finishDeactivation();
2961
+ return this;
2962
+ },
2963
+ pause: function pause() {
2964
+ if (state.paused || !state.active) {
2965
+ return this;
2966
+ }
2967
+
2968
+ state.paused = true;
2969
+ removeListeners();
2970
+ return this;
2971
+ },
2972
+ unpause: function unpause() {
2973
+ if (!state.paused || !state.active) {
2974
+ return this;
2975
+ }
2976
+
2977
+ state.paused = false;
2978
+ updateTabbableNodes();
2979
+ addListeners();
2980
+ return this;
2981
+ },
2982
+ updateContainerElements: function updateContainerElements(containerElements) {
2983
+ var elementsAsArray = [].concat(containerElements).filter(Boolean);
2984
+ state.containers = elementsAsArray.map(function (element) {
2985
+ return typeof element === 'string' ? doc.querySelector(element) : element;
2986
+ });
2987
+
2988
+ if (state.active) {
2989
+ updateTabbableNodes();
2990
+ }
2991
+
2992
+ return this;
2993
+ }
2994
+ }; // initialize container elements
2995
+
2996
+ trap.updateContainerElements(elements);
2997
+ return trap;
2998
+ };
2999
+
3000
+ const firstTabbable = (container) => {
3001
+ return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
3002
+ };
3003
+
1724
3004
  const catDropdownCss = ":host{display:contents}:host([hidden]){display:none}::slotted(nav){padding-top:0.5rem;padding-bottom:0.5rem;min-width:8rem;max-width:16rem}.content{position:absolute;background:white;display:none;-webkit-overflow-scrolling:touch;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 0 0 1px rgb(var(--cat-border-color, 235, 236, 240)), 0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);border-radius:var(--cat-border-radius-m, 0.25rem);z-index:100;opacity:0;transition:transform 0.13s cubic-bezier(0.3, 0, 0.8, 0.15), opacity 0.13s cubic-bezier(0.3, 0, 0.8, 0.15)}.content[data-placement^=top]{transform:translateY(1rem)}.content[data-placement^=left]{transform:translateX(1rem)}.content[data-placement^=right]{transform:translateX(-1rem)}.content[data-placement^=bottom]{transform:translateY(-1rem)}.content.show{opacity:1;transform:translateX(0);transform:translateY(0);transition:transform 0.5s cubic-bezier(0.05, 0.7, 0.1, 1), opacity 0.5s cubic-bezier(0.05, 0.7, 0.1, 1)}.content.overflow-auto{overflow:auto}";
1725
3005
 
1726
3006
  let nextUniqueId$7 = 0;
@@ -1941,7 +3221,7 @@ const CatIcon = class {
1941
3221
  };
1942
3222
  CatIcon.style = catIconCss;
1943
3223
 
1944
- const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .input-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
3224
+ const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}:host(.cat-error) .input-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
1945
3225
 
1946
3226
  let nextUniqueId$6 = 0;
1947
3227
  const CatInput = class {
@@ -3776,6 +5056,44 @@ function filter(predicate, thisArg) {
3776
5056
  });
3777
5057
  }
3778
5058
 
5059
+ function audit(durationSelector) {
5060
+ return operate((source, subscriber) => {
5061
+ let hasValue = false;
5062
+ let lastValue = null;
5063
+ let durationSubscriber = null;
5064
+ let isComplete = false;
5065
+ const endDuration = () => {
5066
+ durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
5067
+ durationSubscriber = null;
5068
+ if (hasValue) {
5069
+ hasValue = false;
5070
+ const value = lastValue;
5071
+ lastValue = null;
5072
+ subscriber.next(value);
5073
+ }
5074
+ isComplete && subscriber.complete();
5075
+ };
5076
+ const cleanupDuration = () => {
5077
+ durationSubscriber = null;
5078
+ isComplete && subscriber.complete();
5079
+ };
5080
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
5081
+ hasValue = true;
5082
+ lastValue = value;
5083
+ if (!durationSubscriber) {
5084
+ innerFrom(durationSelector(value)).subscribe((durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration)));
5085
+ }
5086
+ }, () => {
5087
+ isComplete = true;
5088
+ (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
5089
+ }));
5090
+ });
5091
+ }
5092
+
5093
+ function auditTime(duration, scheduler = asyncScheduler) {
5094
+ return audit(() => timer(duration, scheduler));
5095
+ }
5096
+
3779
5097
  function catchError(selector) {
3780
5098
  return operate((source, subscriber) => {
3781
5099
  let innerSub = null;
@@ -4039,6 +5357,8 @@ const CatScrollable = class {
4039
5357
  this.scrolledBottom = createEvent(this, "scrolledBottom", 7);
4040
5358
  this.init = new Subject();
4041
5359
  this.destroyed = new Subject();
5360
+ this.resizedEntries = new Subject();
5361
+ this.resizedObserver = new ResizeObserver(entries => this.resizedEntries.next(entries));
4042
5362
  /** Flags to disable/enable scroll shadowX. */
4043
5363
  this.noShadowX = false;
4044
5364
  /** Flags to disable/enable scroll shadowY. */
@@ -4061,13 +5381,17 @@ const CatScrollable = class {
4061
5381
  componentDidRender() {
4062
5382
  if (this.scrollElement) {
4063
5383
  this.scrolled = fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.destroyed));
5384
+ this.resizedObserver.observe(this.scrollElement);
4064
5385
  }
4065
- this.attachEmitter('left', this.scrolledLeft, this.scrolledBuffer);
4066
- this.attachEmitter('right', this.scrolledRight, this.scrolledBuffer);
4067
- this.attachEmitter('bottom', this.scrolledBottom, this.scrolledBuffer);
4068
- this.attachEmitter('top', this.scrolledTop, this.scrolledBuffer);
4069
- merge(this.init, this.scrolled)
4070
- .pipe(map(() => ({
5386
+ if (this.scrollWrapperElement) {
5387
+ this.resizedObserver.observe(this.scrollWrapperElement);
5388
+ }
5389
+ this.attachEmitter('left', this.scrolledLeft);
5390
+ this.attachEmitter('right', this.scrolledRight);
5391
+ this.attachEmitter('bottom', this.scrolledBottom);
5392
+ this.attachEmitter('top', this.scrolledTop);
5393
+ merge(this.init, this.scrolled, this.resizedEntries)
5394
+ .pipe(auditTime(CatScrollable.THROTTLE), map(() => ({
4071
5395
  top: this.getScrollOffset('top') > 0,
4072
5396
  left: this.getScrollOffset('left') > 0,
4073
5397
  right: this.getScrollOffset('right') > 0,
@@ -4089,6 +5413,7 @@ const CatScrollable = class {
4089
5413
  this.init.complete();
4090
5414
  this.destroyed.next();
4091
5415
  this.destroyed.complete();
5416
+ this.resizedObserver.disconnect();
4092
5417
  }
4093
5418
  render() {
4094
5419
  return [
@@ -4101,13 +5426,9 @@ const CatScrollable = class {
4101
5426
  } }, h("slot", null))
4102
5427
  ];
4103
5428
  }
4104
- attachEmitter(from, emitter, buffer) {
4105
- merge(this.init, this.scrolled)
4106
- .pipe(map(() => this.getScrollOffset(from)))
4107
- .pipe(map(offset => offset <= buffer))
4108
- .pipe(distinctUntilChanged())
4109
- .pipe(filter(isLower => isLower))
4110
- .pipe(takeUntil(this.destroyed))
5429
+ attachEmitter(from, emitter) {
5430
+ merge(this.init, this.scrolled, this.resizedEntries)
5431
+ .pipe(auditTime(CatScrollable.THROTTLE), map(() => this.getScrollOffset(from)), map(offset => offset <= this.scrolledBuffer), distinctUntilChanged(), filter(isLower => isLower), takeUntil(this.destroyed))
4111
5432
  .subscribe(() => emitter.emit());
4112
5433
  }
4113
5434
  getScrollOffset(from) {
@@ -4137,6 +5458,7 @@ const CatScrollable = class {
4137
5458
  }
4138
5459
  }
4139
5460
  };
5461
+ CatScrollable.THROTTLE = 50;
4140
5462
  CatScrollable.style = catScrollableCss;
4141
5463
 
4142
5464
  var GHOST_ELEMENT_ID = '__autosizeInputGhost';
@@ -4487,11 +5809,14 @@ const CatSelect = class {
4487
5809
  });
4488
5810
  }
4489
5811
  render() {
4490
- return (h(Host, null, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))), h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (h("span", { class: {
4491
- pill: true,
4492
- 'select-no-open': true,
4493
- 'select-option-active': this.state.activeSelectionIndex === i
4494
- }, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: '' })) : null, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "16-cross", iconOnly: true, a11yLabel: catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1 }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, initials: '' })) : null, h("input", { class: "select-input", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, onInput: () => this.onInput(), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && h("cat-spinner", null), (this.state.selection.length || this.state.term.length) &&
5812
+ return (h(Host, null, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))), h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => {
5813
+ var _a;
5814
+ return (h("span", { class: {
5815
+ pill: true,
5816
+ 'select-no-open': true,
5817
+ 'select-option-active': this.state.activeSelectionIndex === i
5818
+ }, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: (_a = item.render.avatar.initials) !== null && _a !== void 0 ? _a : '' })) : null, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "16-cross", iconOnly: true, a11yLabel: catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1 }))));
5819
+ }))) : this.state.selection.length && this.state.selection[0].render.avatar ? (h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, initials: '' })) : null, h("input", { class: "select-input", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, onInput: () => this.onInput(), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && h("cat-spinner", null), (this.state.selection.length || this.state.term.length) &&
4495
5820
  !this.disabled &&
4496
5821
  !this.state.isResolving &&
4497
5822
  this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "cross-circle-outlined", variant: "text", size: "s", a11yLabel: catI18nRegistry.t('input.clear'), onClick: () => this.clear() })) : null, !this.state.isResolving && (h("cat-button", { iconOnly: true, icon: "chevron-down-outlined", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? catI18nRegistry.t('select.close') : catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving }))), this.hintSection, h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
@@ -4501,6 +5826,7 @@ const CatSelect = class {
4501
5826
  }
4502
5827
  get optionsList() {
4503
5828
  return this.state.options.map((item, i) => {
5829
+ var _a, _b;
4504
5830
  const isTagOption = this.tags && item.item.id === `select-${this.id}-option-tag`;
4505
5831
  const isOptionSelected = this.isSelected(item.item.id) || (this.tags && this.isTagSelected(item.render.label));
4506
5832
  const getLabel = () => {
@@ -4512,11 +5838,11 @@ const CatSelect = class {
4512
5838
  return (h("li", { role: "option", class: "select-option", id: `select-${this.id}-option-${i}`, "aria-selected": isOptionSelected ? 'true' : 'false' }, this.multiple ? (h("cat-checkbox", { class: { 'select-option-active': this.state.activeOptionIndex === i }, checked: isOptionSelected, tabIndex: -1, labelLeft: true, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onCatChange: e => {
4513
5839
  !isTagOption ? this.toggle(item) : this.toggleTag(item);
4514
5840
  e.stopPropagation();
4515
- } }, h("span", { slot: "label", class: "select-option-inner" }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: '' })) : null, h("span", { class: "select-option-text" }, h("span", { class: "select-option-label" }, getLabel()), h("span", { class: "select-option-description" }, item.render.description))))) : (h("div", { class: {
5841
+ } }, h("span", { slot: "label", class: "select-option-inner" }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: (_a = item.render.avatar.initials) !== null && _a !== void 0 ? _a : '' })) : null, h("span", { class: "select-option-text" }, h("span", { class: "select-option-label" }, getLabel()), h("span", { class: "select-option-description" }, item.render.description))))) : (h("div", { class: {
4516
5842
  'select-option-inner': true,
4517
5843
  'select-option-single': true,
4518
5844
  'select-option-active': this.state.activeOptionIndex === i
4519
- }, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onClick: () => (isTagOption ? this.createTag(item.render.label) : this.select(item)), tabIndex: -1 }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: '' })) : null, h("span", { class: "select-option-text" }, h("span", { class: "select-option-label" }, getLabel()), h("span", { class: "select-option-description" }, item.render.description))))));
5845
+ }, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onClick: () => (isTagOption ? this.createTag(item.render.label) : this.select(item)), tabIndex: -1 }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: (_b = item.render.avatar.initials) !== null && _b !== void 0 ? _b : '' })) : null, h("span", { class: "select-option-text" }, h("span", { class: "select-option-label" }, getLabel()), h("span", { class: "select-option-description" }, item.render.description))))));
4520
5846
  });
4521
5847
  }
4522
5848
  get hintSection() {
@@ -6360,7 +7686,7 @@ CatTabs.style = catTabsCss;
6360
7686
 
6361
7687
  var e,t,n="function"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o));},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1));}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test");}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t};}function r(e){var t=n.get(e);t&&t.destroy();}function i(e){var t=n.get(e);t&&t.update();}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c();},a=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n];}),n.delete(e);}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c();}function u(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t;}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop;}),n&&(document.documentElement.scrollTop=n);}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(u("scroll"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(u("hidden"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o("autosize:resized");try{e.dispatchEvent(i);}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;
6362
7688
 
6363
- const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;resize:vertical}textarea:disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
7689
+ const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;resize:vertical;}textarea:disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea:-webkit-autofill,textarea:-webkit-autofill:hover,textarea:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}";
6364
7690
 
6365
7691
  let nextUniqueId$2 = 0;
6366
7692
  const CatTextarea = class {