@linzjs/lui 17.11.0 → 17.11.3

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.
package/dist/lui.esm.js CHANGED
@@ -757,8 +757,8 @@ function LuiFormikForm(props) {
757
757
  " "))));
758
758
  }
759
759
 
760
- var css_248z$5 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiError {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: #2a292c;\n}\n.LuiError-errorIcon {\n vertical-align: middle;\n display: inline-block;\n}\n.LuiError-errorText {\n margin-left: 0.5rem;\n}";
761
- styleInject(css_248z$5);
760
+ var css_248z$8 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiError {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: #2a292c;\n}\n.LuiError-errorIcon {\n vertical-align: middle;\n display: inline-block;\n}\n.LuiError-errorText {\n margin-left: 0.5rem;\n}";
761
+ styleInject(css_248z$8);
762
762
 
763
763
  const LuiError = ({ error, className }) => (React__default.createElement("div", { className: `LuiError ${className}-error` },
764
764
  React__default.createElement(LuiIcon, { className: `LuiError-errorIcon ${className}-errorIcon`, alt: 'Error', name: "ic_error", size: "md", status: "error" }),
@@ -844,7 +844,7 @@ function useGenerateOrDefaultId(idFromProps) {
844
844
  }
845
845
  const LuiTextInput = (props) => {
846
846
  const id = useGenerateOrDefaultId(props.inputProps?.id);
847
- return (React__default.createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError', props.className) },
847
+ return (React__default.createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError', props.warning && 'hasWarning', props.className) },
848
848
  React__default.createElement("label", { className: 'LuiTextInput-label', htmlFor: id },
849
849
  props.mandatory && React__default.createElement("span", { className: "LuiTextInput-mandatory" }, "*"),
850
850
  React__default.createElement("span", { className: 'LuiTextInput-label-text ' +
@@ -855,7 +855,10 @@ const LuiTextInput = (props) => {
855
855
  props.icon),
856
856
  props.error && (React__default.createElement("span", { className: "LuiTextInput-error" },
857
857
  React__default.createElement(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }),
858
- props.error)))));
858
+ props.error)),
859
+ props.warning && (React__default.createElement("span", { className: "LuiTextInput-warning" },
860
+ React__default.createElement(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }),
861
+ props.warning)))));
859
862
  };
860
863
 
861
864
  const LuiCheckboxInput = (props) => {
@@ -24907,8 +24910,8 @@ function isChromatic() {
24907
24910
  window?.location.href.match(/chromatic=true/));
24908
24911
  }
24909
24912
 
24910
- var css_248z$4 = ":export {\n charcoal: #2a292c;\n fuscous: #6b6966;\n gray: #989189;\n silver: #beb9b4;\n lily: #eaeaea;\n hint: #f9f9f9;\n snow: #ffffff;\n white: #ffffff;\n teal: #00425d;\n sea: #007198;\n electric: #0096cc;\n spray: #73c8e1;\n polar: #e2f3f7;\n sherpa: #004b50;\n surfie: #017a76;\n persian: #00a599;\n downy: #73cdc8;\n iceberg: #dcf5f0;\n sacramento: #004e32;\n salem: #08814d;\n pigment: #0aa245;\n granny: #9bd79b;\n panache: #e9fae7;\n brand-primary: #004b50;\n brand-secondary: #017a76;\n error: #cc0000;\n error-bg: #f5cccc;\n error-focus: #5a0000;\n warning: #ea6a2e;\n warning-bg: #fbdfd2;\n warning-focus: #b33a01;\n success: #0aa245;\n success-bg: #e9fae7;\n info: #3a7cdf;\n info-bg: #d8e5f9;\n visited: #00425d;\n green-hover: #107c3a;\n green-active: #094a22;\n green-btn: #0aa245;\n txt-link: #0096cc;\n primary-hover-btn: #005678;\n selection: #c7e9f3;\n heading-color: #017a76;\n heading-color--secondary: #2a292c;\n base-type-color: #2a292c;\n input-text: #2a292c;\n input-placeholder: #6b6966;\n input-placeholder-when-disabled: #989189;\n base-icon-color: #007198;\n disabled-color: #989189;\n disabled-color-dark: #6b6966;\n linz-color-primary: #023d48;\n linz-color-primary-hover: #01818a;\n linz-color-tertiary: #e1e44a;\n linz-color-tertiary-hover: #cdcf59;\n color-test-pink: #f09;\n linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}";
24911
- styleInject(css_248z$4);
24913
+ var css_248z$7 = ":export {\n charcoal: #2a292c;\n fuscous: #6b6966;\n gray: #989189;\n silver: #beb9b4;\n lily: #eaeaea;\n hint: #f9f9f9;\n snow: #ffffff;\n white: #ffffff;\n teal: #00425d;\n sea: #007198;\n electric: #0096cc;\n spray: #73c8e1;\n polar: #e2f3f7;\n sherpa: #004b50;\n surfie: #017a76;\n persian: #00a599;\n downy: #73cdc8;\n iceberg: #dcf5f0;\n sacramento: #004e32;\n salem: #08814d;\n pigment: #0aa245;\n granny: #9bd79b;\n panache: #e9fae7;\n brand-primary: #004b50;\n brand-secondary: #017a76;\n error: #cc0000;\n error-bg: #f5cccc;\n error-focus: #5a0000;\n warning: #ea6a2e;\n warning-bg: #fbdfd2;\n warning-focus: #b33a01;\n success: #0aa245;\n success-bg: #e9fae7;\n info: #3a7cdf;\n info-bg: #d8e5f9;\n visited: #00425d;\n green-hover: #107c3a;\n green-active: #094a22;\n green-btn: #0aa245;\n txt-link: #0096cc;\n primary-hover-btn: #005678;\n selection: #c7e9f3;\n heading-color: #017a76;\n heading-color--secondary: #2a292c;\n base-type-color: #2a292c;\n input-text: #2a292c;\n input-placeholder: #6b6966;\n input-placeholder-when-disabled: #989189;\n base-icon-color: #007198;\n disabled-color: #989189;\n disabled-color-dark: #6b6966;\n linz-color-primary: #023d48;\n linz-color-primary-hover: #01818a;\n linz-color-tertiary: #e1e44a;\n linz-color-tertiary-hover: #cdcf59;\n color-test-pink: #f09;\n linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}";
24914
+ styleInject(css_248z$7);
24912
24915
 
24913
24916
  var _excluded = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
24914
24917
 
@@ -25038,22 +25041,22 @@ function LuiComboSelectActual(givenProps, ref) {
25038
25041
  ...theme,
25039
25042
  colors: {
25040
25043
  ...theme.colors,
25041
- primary: css_248z$4['sea'],
25042
- primary75: css_248z$4['electric'],
25043
- primary50: css_248z$4['spray'],
25044
- primary25: css_248z$4['polar'],
25045
- neutral90: css_248z$4['charcoal'],
25046
- neutral80: css_248z$4['charcoal'],
25047
- neutral70: css_248z$4['charcoal'],
25048
- neutral60: css_248z$4['fuscous'],
25049
- neutral50: css_248z$4['fuscous'],
25050
- neutral40: css_248z$4['gray'],
25051
- neutral30: css_248z$4['gray'],
25052
- neutral20: css_248z$4['silver'],
25053
- neutral10: css_248z$4['lily'],
25054
- neutral5: css_248z$4['hint'],
25055
- danger: css_248z$4['error'],
25056
- dangerLight: css_248z$4['error-bg'],
25044
+ primary: css_248z$7['sea'],
25045
+ primary75: css_248z$7['electric'],
25046
+ primary50: css_248z$7['spray'],
25047
+ primary25: css_248z$7['polar'],
25048
+ neutral90: css_248z$7['charcoal'],
25049
+ neutral80: css_248z$7['charcoal'],
25050
+ neutral70: css_248z$7['charcoal'],
25051
+ neutral60: css_248z$7['fuscous'],
25052
+ neutral50: css_248z$7['fuscous'],
25053
+ neutral40: css_248z$7['gray'],
25054
+ neutral30: css_248z$7['gray'],
25055
+ neutral20: css_248z$7['silver'],
25056
+ neutral10: css_248z$7['lily'],
25057
+ neutral5: css_248z$7['hint'],
25058
+ danger: css_248z$7['error'],
25059
+ dangerLight: css_248z$7['error-bg'],
25057
25060
  },
25058
25061
  }),
25059
25062
  styles: {
@@ -25068,7 +25071,7 @@ function LuiComboSelectActual(givenProps, ref) {
25068
25071
  }),
25069
25072
  dropdownIndicator: (provided) => ({
25070
25073
  ...provided,
25071
- color: css_248z$4['fuscous'],
25074
+ color: css_248z$7['fuscous'],
25072
25075
  }),
25073
25076
  indicatorSeparator: (provided) => ({
25074
25077
  ...provided,
@@ -25093,12 +25096,12 @@ function LuiComboSelectActual(givenProps, ref) {
25093
25096
  /* please keep this in sync with FormVars.scss/mixin.formPlaceholder */
25094
25097
  fontWeight: 'normal',
25095
25098
  fontStyle: 'italic',
25096
- color: css_248z$4['input-placeholder'],
25099
+ color: css_248z$7['input-placeholder'],
25097
25100
  }),
25098
25101
  option: (provided, { isSelected }) => ({
25099
25102
  ...provided,
25100
- color: css_248z$4['input-text'],
25101
- backgroundColor: isSelected ? css_248z$4['selection'] : css_248z$4['white'],
25103
+ color: css_248z$7['input-text'],
25104
+ backgroundColor: isSelected ? css_248z$7['selection'] : css_248z$7['white'],
25102
25105
  }),
25103
25106
  },
25104
25107
  };
@@ -28050,8 +28053,8 @@ const LuiModalHeader = (props) => {
28050
28053
  React__default.createElement("i", { className: "material-icons-round lui-modal-header-btn-size" }, "close")))))));
28051
28054
  };
28052
28055
 
28053
- var css_248z$3 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n";
28054
- styleInject(css_248z$3);
28056
+ var css_248z$6 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n";
28057
+ styleInject(css_248z$6);
28055
28058
 
28056
28059
  /**
28057
28060
  * @internal
@@ -32543,11 +32546,11 @@ tippy.setDefaultProps({
32543
32546
  render: render
32544
32547
  });
32545
32548
 
32546
- var css_248z$2 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
32547
- styleInject(css_248z$2);
32549
+ var css_248z$5 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
32550
+ styleInject(css_248z$5);
32548
32551
 
32549
- var css_248z$1 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
32550
- styleInject(css_248z$1);
32552
+ var css_248z$4 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
32553
+ styleInject(css_248z$4);
32551
32554
 
32552
32555
  let id = 0;
32553
32556
  const getKey = () => id++;
@@ -32651,8 +32654,8 @@ const LuiSidePanelProvider = ({ children }) => {
32651
32654
  React__default.createElement(LuiSidePanelContainer, { ...props })));
32652
32655
  };
32653
32656
 
32654
- var css_248z = ".lui-switch-checkbox {\n height: 0;\n width: 0;\n visibility: hidden;\n}\n\n.lui-switch-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n width: 40px;\n height: 20px;\n background: grey;\n border-radius: 40px;\n position: relative;\n transition: background-color 0.2s;\n}\n\n.lui-switch-label .lui-switch-button {\n content: \"\";\n position: absolute;\n top: 2px;\n left: 2px;\n width: 18px;\n height: 16px;\n border-radius: 18px;\n transition: 0.2s;\n background: #fff;\n box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);\n}\n\n.lui-switch-checkbox:checked + .lui-switch-label .lui-switch-button {\n left: calc(100% - 2px);\n transform: translateX(-100%);\n}\n\n.lui-switch-label:active .lui-switch-button {\n width: 20px;\n}";
32655
- styleInject(css_248z);
32657
+ var css_248z$3 = ".lui-switch-checkbox {\n height: 0;\n width: 0;\n visibility: hidden;\n}\n\n.lui-switch-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n width: 40px;\n height: 20px;\n background: grey;\n border-radius: 40px;\n position: relative;\n transition: background-color 0.2s;\n}\n\n.lui-switch-label .lui-switch-button {\n content: \"\";\n position: absolute;\n top: 2px;\n left: 2px;\n width: 18px;\n height: 16px;\n border-radius: 18px;\n transition: 0.2s;\n background: #fff;\n box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);\n}\n\n.lui-switch-checkbox:checked + .lui-switch-label .lui-switch-button {\n left: calc(100% - 2px);\n transform: translateX(-100%);\n}\n\n.lui-switch-label:active .lui-switch-button {\n width: 20px;\n}";
32658
+ styleInject(css_248z$3);
32656
32659
 
32657
32660
  const LuiSwitchButton = (props) => {
32658
32661
  const generatedId = useGenerateOrDefaultId();
@@ -40364,5 +40367,3428 @@ const LuiAccordicardStatic = (props) => {
40364
40367
  React__default.createElement(LuiIcon, { className: clsx('LuiAccordicardStatic-chevron', isOpen ? 'LuiAccordicardStatic-chevron--isOpen' : null), name: 'ic_expand_more', alt: "expand", title: "Expand and collapse panel", size: "md" }))));
40365
40368
  };
40366
40369
 
40367
- export { FIRM_KEY, FIRM_NAME_KEY, GLOBAL_CLIENT_REFERENCE_KEY, LOLActiveFirmMessage, LOLAuthorisedLink, LOLCommonDrawerMenu, LOLCommonDrawerMenuAfterLinks, LOLDrawerMenu, LOLFirmSwitcherMenu, LOLGlobalClientRefContext, LOLGlobalClientRefContextProvider, LOLLogoutLink, LOLSearchBox, LOLUserContext, LOLUserContextProvider, LOLUserLastLogin, LuiAccordicard, LuiAccordicardStatic, LuiAlertModal, LuiAlertModalButtons, LuiBadge, LuiBanner, LuiBannerContent, LuiBearingFormikInput, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuItem, LuiComboSelect, LuiControlledMenu, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuOption, LuiDrawerMenuOptions, LuiDrawerMenuSection, LuiDropdownMenu, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFooter, LuiFormSectionHeader, LuiFormikCheckbox, LuiFormikForm, LuiFormikFormLabel, LuiFormikFormSubmitButton, LuiFormikRadioButton, LuiFormikRadioGroup, LuiFormikSelect, LuiFormikTextInput, LuiHeader, LuiHeaderMenuItem, LuiIcon, LuiLoadingSpinner, LuiLoadingSpinnerChristmas, LuiLoadingSpinnerEaster, LuiMenu, LuiMenuCloseButton, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiRadioInput, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, LuiShadow, LuiSidePanel, LuiSidePanelProvider, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, getDefaultSearchMenuOptions, isChromatic, useClickedOutsideElement, useLOLGlobalClientRefContext, useLOLUserContext, useShowLUIMessage };
40370
+ var css_248z$2 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiListBox {\n padding: 0;\n list-style: none;\n}\n.LuiListBox .LuiListBoxItem {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n user-select: none;\n color: #2a292c;\n line-height: 24px;\n outline: none;\n padding: 0.5rem 0.75rem;\n border: 2px solid transparent;\n}\n.LuiListBox .LuiListBoxItem:focus-visible {\n border-color: #007198;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-selected {\n background: #e2f3f7;\n}\n.LuiListBox .LuiListBoxItem:hover, .LuiListBox .LuiListBoxItem.LuiListBoxItem-selected:hover {\n background: #d6eef4;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-disabled {\n background: #eaeaea;\n}\n.LuiListBox .LuiListBox-emptyIndicator, .LuiListBox .LuiListBox-loadingIndicator {\n padding: 0.5rem 0.75rem;\n}";
40371
+ styleInject(css_248z$2);
40372
+
40373
+ function $c1d7fb2ec91bae71$var$Item(props) {
40374
+ return null;
40375
+ }
40376
+ $c1d7fb2ec91bae71$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
40377
+ let { childItems: childItems , title: title , children: children } = props;
40378
+ let rendered = props.title || props.children;
40379
+ let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
40380
+ // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
40381
+ if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
40382
+ yield {
40383
+ type: 'item',
40384
+ props: props,
40385
+ rendered: rendered,
40386
+ textValue: textValue,
40387
+ 'aria-label': props['aria-label'],
40388
+ hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
40389
+ *childNodes () {
40390
+ if (childItems) for (let child1 of childItems)yield {
40391
+ type: 'item',
40392
+ value: child1
40393
+ };
40394
+ else if (title) {
40395
+ let items = [];
40396
+ React__default.Children.forEach(children, (child)=>{
40397
+ items.push({
40398
+ type: 'item',
40399
+ element: child
40400
+ });
40401
+ });
40402
+ yield* items;
40403
+ }
40404
+ }
40405
+ };
40406
+ };
40407
+ function $c1d7fb2ec91bae71$var$hasChildItems(props) {
40408
+ if (props.hasChildItems != null) return props.hasChildItems;
40409
+ if (props.childItems) return true;
40410
+ if (props.title && React__default.Children.count(props.children) > 0) return true;
40411
+ return false;
40412
+ }
40413
+ // We don't want getCollectionNode to show up in the type definition
40414
+ let $c1d7fb2ec91bae71$export$6d08773d2e66f8f2 = $c1d7fb2ec91bae71$var$Item;
40415
+
40416
+
40417
+
40418
+ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
40419
+ build(props, context) {
40420
+ this.context = context;
40421
+ return $eb2240fc39a57fa5$var$iterable(()=>this.iterateCollection(props)
40422
+ );
40423
+ }
40424
+ *iterateCollection(props) {
40425
+ let { children: children , items: items } = props;
40426
+ if (typeof children === 'function') {
40427
+ if (!items) throw new Error('props.children was a function but props.items is missing');
40428
+ for (let item of props.items)yield* this.getFullNode({
40429
+ value: item
40430
+ }, {
40431
+ renderer: children
40432
+ });
40433
+ } else {
40434
+ let items = [];
40435
+ React__default.Children.forEach(children, (child)=>{
40436
+ items.push(child);
40437
+ });
40438
+ let index = 0;
40439
+ for (let item of items){
40440
+ let nodes = this.getFullNode({
40441
+ element: item,
40442
+ index: index
40443
+ }, {
40444
+ });
40445
+ for (let node of nodes){
40446
+ index++;
40447
+ yield node;
40448
+ }
40449
+ }
40450
+ }
40451
+ }
40452
+ getKey(item, partialNode, state, parentKey) {
40453
+ if (item.key != null) return item.key;
40454
+ if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
40455
+ let v = partialNode.value;
40456
+ if (v != null) {
40457
+ var _key;
40458
+ let key = (_key = v.key) !== null && _key !== void 0 ? _key : v.id;
40459
+ if (key == null) throw new Error('No key found for item');
40460
+ return key;
40461
+ }
40462
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
40463
+ }
40464
+ getChildState(state, partialNode) {
40465
+ return {
40466
+ renderer: partialNode.renderer || state.renderer
40467
+ };
40468
+ }
40469
+ *getFullNode(partialNode, state, parentKey, parentNode) {
40470
+ // If there's a value instead of an element on the node, and a parent renderer function is available,
40471
+ // use it to render an element for the value.
40472
+ let element = partialNode.element;
40473
+ if (!element && partialNode.value && state && state.renderer) {
40474
+ let cached = this.cache.get(partialNode.value);
40475
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
40476
+ cached.index = partialNode.index;
40477
+ cached.parentKey = parentNode ? parentNode.key : null;
40478
+ yield cached;
40479
+ return;
40480
+ }
40481
+ element = state.renderer(partialNode.value);
40482
+ }
40483
+ // If there's an element with a getCollectionNode function on its type, then it's a supported component.
40484
+ // Call this function to get a partial node, and recursively build a full node from there.
40485
+ if (React__default.isValidElement(element)) {
40486
+ let type = element.type;
40487
+ if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
40488
+ let name = typeof element.type === 'function' ? element.type.name : element.type;
40489
+ throw new Error(`Unknown element <${name}> in collection.`);
40490
+ }
40491
+ let childNodes = type.getCollectionNode(element.props, this.context);
40492
+ let index = partialNode.index;
40493
+ let result = childNodes.next();
40494
+ while(!result.done && result.value){
40495
+ let childNode = result.value;
40496
+ partialNode.index = index;
40497
+ let nodeKey = childNode.key;
40498
+ if (!nodeKey) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
40499
+ let nodes = this.getFullNode({
40500
+ ...childNode,
40501
+ key: nodeKey,
40502
+ index: index,
40503
+ wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
40504
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
40505
+ let children = [
40506
+ ...nodes
40507
+ ];
40508
+ for (let node of children){
40509
+ // Cache the node based on its value
40510
+ node.value = childNode.value || partialNode.value;
40511
+ if (node.value) this.cache.set(node.value, node);
40512
+ // The partial node may have specified a type for the child in order to specify a constraint.
40513
+ // Verify that the full node that was built recursively matches this type.
40514
+ if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
40515
+ index++;
40516
+ yield node;
40517
+ }
40518
+ result = childNodes.next(children);
40519
+ }
40520
+ return;
40521
+ }
40522
+ // Ignore invalid elements
40523
+ if (partialNode.key == null) return;
40524
+ // Create full node
40525
+ let builder = this;
40526
+ let node = {
40527
+ type: partialNode.type,
40528
+ props: partialNode.props,
40529
+ key: partialNode.key,
40530
+ parentKey: parentNode ? parentNode.key : null,
40531
+ value: partialNode.value,
40532
+ level: parentNode ? parentNode.level + 1 : 0,
40533
+ index: partialNode.index,
40534
+ rendered: partialNode.rendered,
40535
+ textValue: partialNode.textValue,
40536
+ 'aria-label': partialNode['aria-label'],
40537
+ wrapper: partialNode.wrapper,
40538
+ shouldInvalidate: partialNode.shouldInvalidate,
40539
+ hasChildNodes: partialNode.hasChildNodes,
40540
+ childNodes: $eb2240fc39a57fa5$var$iterable(function*() {
40541
+ if (!partialNode.hasChildNodes) return;
40542
+ let index = 0;
40543
+ for (let child of partialNode.childNodes()){
40544
+ // Ensure child keys are globally unique by prepending the parent node's key
40545
+ if (child.key != null) // TODO: Remove this line entirely and enforce that users always provide unique keys.
40546
+ // Currently this line will have issues when a parent has a key `a` and a child with key `bc`
40547
+ // but another parent has key `ab` and its child has a key `c`. The combined keys would result in both
40548
+ // children having a key of `abc`.
40549
+ child.key = `${node.key}${child.key}`;
40550
+ child.index = index;
40551
+ let nodes = builder.getFullNode(child, builder.getChildState(state, child), node.key, node);
40552
+ for (let node1 of nodes){
40553
+ index++;
40554
+ yield node1;
40555
+ }
40556
+ }
40557
+ })
40558
+ };
40559
+ yield node;
40560
+ }
40561
+ constructor(){
40562
+ this.cache = new WeakMap();
40563
+ }
40564
+ }
40565
+ // Wraps an iterator function as an iterable object, and caches the results.
40566
+ function $eb2240fc39a57fa5$var$iterable(iterator) {
40567
+ let cache = [];
40568
+ let iterable = null;
40569
+ return {
40570
+ *[Symbol.iterator] () {
40571
+ for (let item of cache)yield item;
40572
+ if (!iterable) iterable = iterator();
40573
+ for (let item1 of iterable){
40574
+ cache.push(item1);
40575
+ yield item1;
40576
+ }
40577
+ }
40578
+ };
40579
+ }
40580
+ function $eb2240fc39a57fa5$var$compose(outer, inner) {
40581
+ if (outer && inner) return (element)=>outer(inner(element))
40582
+ ;
40583
+ if (outer) return outer;
40584
+ if (inner) return inner;
40585
+ }
40586
+ function $eb2240fc39a57fa5$var$capitalize(str) {
40587
+ return str[0].toUpperCase() + str.slice(1);
40588
+ }
40589
+
40590
+
40591
+
40592
+ function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context, invalidators = []) {
40593
+ let builder = useMemo(()=>new $eb2240fc39a57fa5$export$bf788dd355e3a401()
40594
+ , []);
40595
+ let prev = useRef(null);
40596
+ return useMemo(()=>{
40597
+ let nodes = builder.build(props, context);
40598
+ prev.current = factory(nodes, prev.current);
40599
+ return prev.current;
40600
+ // Don't invalidate when any prop changes, just the two we care about.
40601
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40602
+ }, [
40603
+ builder,
40604
+ props.children,
40605
+ props.items,
40606
+ context,
40607
+ ...invalidators
40608
+ ]);
40609
+ }
40610
+
40611
+
40612
+ const $453cc9f0df89c0a5$var$cache = new WeakMap();
40613
+ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
40614
+ let count = $453cc9f0df89c0a5$var$cache.get(collection);
40615
+ if (count != null) return count;
40616
+ count = 0;
40617
+ for (let item of collection)if (item.type === 'section') count += $453cc9f0df89c0a5$export$77d5aafae4e095b2(item.childNodes);
40618
+ else count++;
40619
+ $453cc9f0df89c0a5$var$cache.set(collection, count);
40620
+ return count;
40621
+ }
40622
+
40623
+ function mapToAriaListBoxProps({ selectionMode, selectionBehavior, items = [], value, onChange, ariaProps, getKey = (item) => {
40624
+ if (!item.hasOwnProperty('key')) {
40625
+ throw Error('Could not find `key` property on item, please provide a custom `getKey` function');
40626
+ }
40627
+ return item.key;
40628
+ }, }) {
40629
+ return {
40630
+ ...ariaProps,
40631
+ items: items?.map((item) => {
40632
+ if (item.hasOwnProperty('key')) {
40633
+ return item;
40634
+ }
40635
+ return { ...item, key: getKey(item) };
40636
+ }),
40637
+ selectionMode,
40638
+ selectionBehavior,
40639
+ selectedKeys: (Array.isArray(value) ? value : [value]).filter(Boolean),
40640
+ children: (item) => React__default.createElement($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, null, String(item.key)),
40641
+ ...(onChange
40642
+ ? {
40643
+ onSelectionChange: (keys) => {
40644
+ const selectedItems = keys === 'all'
40645
+ ? items
40646
+ : items.filter((item) => keys.has(getKey(item)));
40647
+ const selectedKeys = keys === 'all'
40648
+ ? items.map((item) => getKey(item))
40649
+ : Array.from(keys);
40650
+ onChange(selectedKeys, selectedItems);
40651
+ },
40652
+ }
40653
+ : {}),
40654
+ };
40655
+ }
40656
+
40657
+ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value1, defaultValue, onChange) {
40658
+ let [stateValue, setStateValue] = useState(value1 || defaultValue);
40659
+ let ref = useRef(value1 !== undefined);
40660
+ let wasControlled = ref.current;
40661
+ let isControlled = value1 !== undefined;
40662
+ // Internal state reference for useCallback
40663
+ let stateRef = useRef(stateValue);
40664
+ if (wasControlled !== isControlled) console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
40665
+ ref.current = isControlled;
40666
+ let setValue = useCallback((value2, ...args)=>{
40667
+ let onChangeCaller = (value, ...onChangeArgs)=>{
40668
+ if (onChange) {
40669
+ if (!Object.is(stateRef.current, value)) onChange(value, ...onChangeArgs);
40670
+ }
40671
+ if (!isControlled) stateRef.current = value;
40672
+ };
40673
+ if (typeof value2 === 'function') {
40674
+ console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
40675
+ // this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
40676
+ // when someone using useControlledState calls setControlledState(myFunc)
40677
+ // this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
40678
+ // if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
40679
+ // otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
40680
+ let updateFunction = (oldValue, ...functionArgs)=>{
40681
+ let interceptedValue = value2(isControlled ? stateRef.current : oldValue, ...functionArgs);
40682
+ onChangeCaller(interceptedValue, ...args);
40683
+ if (!isControlled) return interceptedValue;
40684
+ return oldValue;
40685
+ };
40686
+ setStateValue(updateFunction);
40687
+ } else {
40688
+ if (!isControlled) setStateValue(value2);
40689
+ onChangeCaller(value2, ...args);
40690
+ }
40691
+ }, [
40692
+ isControlled,
40693
+ onChange
40694
+ ]);
40695
+ // If a controlled component's value prop changes, we need to update stateRef
40696
+ if (isControlled) stateRef.current = value1;
40697
+ else value1 = stateValue;
40698
+ return [
40699
+ value1,
40700
+ setValue
40701
+ ];
40702
+ }
40703
+
40704
+ // Default context value to use in case there is no SSRProvider. This is fine for
40705
+ // client-only apps. In order to support multiple copies of React Aria potentially
40706
+ // being on the page at once, the prefix is set to a random number. SSRProvider
40707
+ // will reset this to zero for consistency between server and client, so in the
40708
+ // SSR case multiple copies of React Aria is not supported.
40709
+ const $704cf1d3b684cc5c$var$defaultContext = {
40710
+ prefix: String(Math.round(Math.random() * 10000000000)),
40711
+ current: 0
40712
+ };
40713
+ const $704cf1d3b684cc5c$var$SSRContext = /*#__PURE__*/ React__default.createContext($704cf1d3b684cc5c$var$defaultContext);
40714
+ let $704cf1d3b684cc5c$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
40715
+ function $704cf1d3b684cc5c$export$619500959fc48b26(defaultId) {
40716
+ let ctx = useContext($704cf1d3b684cc5c$var$SSRContext);
40717
+ // If we are rendering in a non-DOM environment, and there's no SSRProvider,
40718
+ // provide a warning to hint to the developer to add one.
40719
+ if (ctx === $704cf1d3b684cc5c$var$defaultContext && !$704cf1d3b684cc5c$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
40720
+ return useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
40721
+ , [
40722
+ defaultId
40723
+ ]);
40724
+ }
40725
+ function $704cf1d3b684cc5c$export$535bd6ca7f90a273() {
40726
+ let cur = useContext($704cf1d3b684cc5c$var$SSRContext);
40727
+ let isInSSRContext = cur !== $704cf1d3b684cc5c$var$defaultContext;
40728
+ let [isSSR, setIsSSR] = useState(isInSSRContext);
40729
+ // If on the client, and the component was initially server rendered,
40730
+ // then schedule a layout effect to update the component after hydration.
40731
+ if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
40732
+ // because the condition never changes after mounting.
40733
+ // eslint-disable-next-line react-hooks/rules-of-hooks
40734
+ useLayoutEffect(()=>{
40735
+ setIsSSR(false);
40736
+ }, []);
40737
+ return isSSR;
40738
+ }
40739
+
40740
+ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof window !== 'undefined' ? React__default.useLayoutEffect : ()=>{
40741
+ };
40742
+
40743
+
40744
+
40745
+
40746
+ let $bdb11010cef70236$var$idsUpdaterMap = new Map();
40747
+ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
40748
+ let [value, setValue] = useState(defaultId);
40749
+ let nextId = useRef(null);
40750
+ let res = $704cf1d3b684cc5c$export$619500959fc48b26(value);
40751
+ let updateValue = useCallback((val)=>{
40752
+ nextId.current = val;
40753
+ }, []);
40754
+ $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
40755
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
40756
+ let r = res;
40757
+ return ()=>{
40758
+ $bdb11010cef70236$var$idsUpdaterMap.delete(r);
40759
+ };
40760
+ }, [
40761
+ res
40762
+ ]);
40763
+ // This cannot cause an infinite loop because the ref is updated first.
40764
+ // eslint-disable-next-line
40765
+ useEffect(()=>{
40766
+ let newId = nextId.current;
40767
+ if (newId) {
40768
+ nextId.current = null;
40769
+ setValue(newId);
40770
+ }
40771
+ });
40772
+ return res;
40773
+ }
40774
+ function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
40775
+ if (idA === idB) return idA;
40776
+ let setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
40777
+ if (setIdA) {
40778
+ setIdA(idB);
40779
+ return idB;
40780
+ }
40781
+ let setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
40782
+ if (setIdB) {
40783
+ setIdB(idA);
40784
+ return idA;
40785
+ }
40786
+ return idB;
40787
+ }
40788
+ function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
40789
+ let id = $bdb11010cef70236$export$f680877a34711e37();
40790
+ let [resolvedId, setResolvedId] = $1dbecbe27a04f9af$export$14d238f342723f25(id);
40791
+ let updateId = useCallback(()=>{
40792
+ setResolvedId(function*() {
40793
+ yield id;
40794
+ yield document.getElementById(id) ? id : null;
40795
+ });
40796
+ }, [
40797
+ id,
40798
+ setResolvedId
40799
+ ]);
40800
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updateId, [
40801
+ id,
40802
+ updateId,
40803
+ ...depArray
40804
+ ]);
40805
+ return resolvedId;
40806
+ }
40807
+
40808
+
40809
+ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
40810
+ return (...args)=>{
40811
+ for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
40812
+ };
40813
+ }
40814
+
40815
+
40816
+
40817
+
40818
+
40819
+ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
40820
+ // Start with a base clone of the first argument. This is a lot faster than starting
40821
+ // with an empty object and adding properties as we go.
40822
+ let result = {
40823
+ ...args[0]
40824
+ };
40825
+ for(let i = 1; i < args.length; i++){
40826
+ let props = args[i];
40827
+ for(let key in props){
40828
+ let a = result[key];
40829
+ let b = props[key];
40830
+ // Chain events
40831
+ if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
40832
+ key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(a, b);
40833
+ else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = clsx(a, b);
40834
+ else if (key === 'id' && a && b) result.id = $bdb11010cef70236$export$cd8c9cb68f842629(a, b);
40835
+ else result[key] = b !== undefined ? b : a;
40836
+ }
40837
+ }
40838
+ return result;
40839
+ }
40840
+
40841
+
40842
+ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
40843
+ 'id'
40844
+ ]);
40845
+ const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
40846
+ 'aria-label',
40847
+ 'aria-labelledby',
40848
+ 'aria-describedby',
40849
+ 'aria-details'
40850
+ ]);
40851
+ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
40852
+ function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {
40853
+ }) {
40854
+ let { labelable: labelable , propNames: propNames } = opts;
40855
+ let filteredProps = {
40856
+ };
40857
+ for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
40858
+ return filteredProps;
40859
+ }
40860
+
40861
+
40862
+ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
40863
+ if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
40864
+ preventScroll: true
40865
+ });
40866
+ else {
40867
+ let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
40868
+ element.focus();
40869
+ $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
40870
+ }
40871
+ }
40872
+ let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
40873
+ function $7215afc6de606d6b$var$supportsPreventScroll() {
40874
+ if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
40875
+ $7215afc6de606d6b$var$supportsPreventScrollCached = false;
40876
+ try {
40877
+ var focusElem = document.createElement('div');
40878
+ focusElem.focus({
40879
+ get preventScroll () {
40880
+ $7215afc6de606d6b$var$supportsPreventScrollCached = true;
40881
+ return true;
40882
+ }
40883
+ });
40884
+ } catch (e) {
40885
+ // Ignore
40886
+ }
40887
+ }
40888
+ return $7215afc6de606d6b$var$supportsPreventScrollCached;
40889
+ }
40890
+ function $7215afc6de606d6b$var$getScrollableElements(element) {
40891
+ var parent = element.parentNode;
40892
+ var scrollableElements = [];
40893
+ var rootScrollingElement = document.scrollingElement || document.documentElement;
40894
+ while(parent instanceof HTMLElement && parent !== rootScrollingElement){
40895
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
40896
+ element: parent,
40897
+ scrollTop: parent.scrollTop,
40898
+ scrollLeft: parent.scrollLeft
40899
+ });
40900
+ parent = parent.parentNode;
40901
+ }
40902
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
40903
+ element: rootScrollingElement,
40904
+ scrollTop: rootScrollingElement.scrollTop,
40905
+ scrollLeft: rootScrollingElement.scrollLeft
40906
+ });
40907
+ return scrollableElements;
40908
+ }
40909
+ function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
40910
+ for (let { element: element , scrollTop: scrollTop , scrollLeft: scrollLeft } of scrollableElements){
40911
+ element.scrollTop = scrollTop;
40912
+ element.scrollLeft = scrollLeft;
40913
+ }
40914
+ }
40915
+
40916
+
40917
+ /*
40918
+ * Copyright 2020 Adobe. All rights reserved.
40919
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
40920
+ * you may not use this file except in compliance with the License. You may obtain a copy
40921
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
40922
+ *
40923
+ * Unless required by applicable law or agreed to in writing, software distributed under
40924
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40925
+ * OF ANY KIND, either express or implied. See the License for the specific language
40926
+ * governing permissions and limitations under the License.
40927
+ */ // We store a global list of elements that are currently transitioning,
40928
+ // mapped to a set of CSS properties that are transitioning for that element.
40929
+ // This is necessary rather than a simple count of transitions because of browser
40930
+ // bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
40931
+ // than one or the other. So we need to track what's actually transitioning so that
40932
+ // we can ignore these duplicate events.
40933
+ let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
40934
+ // A list of callbacks to call once there are no transitioning elements.
40935
+ let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
40936
+ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
40937
+ if (typeof window === 'undefined') return;
40938
+ let onTransitionStart = (e)=>{
40939
+ // Add the transitioning property to the list for this element.
40940
+ let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
40941
+ if (!transitions) {
40942
+ transitions = new Set();
40943
+ $bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
40944
+ // The transitioncancel event must be registered on the element itself, rather than as a global
40945
+ // event. This enables us to handle when the node is deleted from the document while it is transitioning.
40946
+ // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
40947
+ e.target.addEventListener('transitioncancel', onTransitionEnd);
40948
+ }
40949
+ transitions.add(e.propertyName);
40950
+ };
40951
+ let onTransitionEnd = (e)=>{
40952
+ // Remove property from list of transitioning properties.
40953
+ let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
40954
+ if (!properties) return;
40955
+ properties.delete(e.propertyName);
40956
+ // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
40957
+ if (properties.size === 0) {
40958
+ e.target.removeEventListener('transitioncancel', onTransitionEnd);
40959
+ $bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
40960
+ }
40961
+ // If no transitioning elements, call all of the queued callbacks.
40962
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
40963
+ for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
40964
+ $bbed8b41f857bcc0$var$transitionCallbacks.clear();
40965
+ }
40966
+ };
40967
+ document.body.addEventListener('transitionrun', onTransitionStart);
40968
+ document.body.addEventListener('transitionend', onTransitionEnd);
40969
+ }
40970
+ if (typeof document !== 'undefined') {
40971
+ if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
40972
+ else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
40973
+ }
40974
+ function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
40975
+ // Wait one frame to see if an animation starts, e.g. a transition on mount.
40976
+ requestAnimationFrame(()=>{
40977
+ // If no transitions are running, call the function immediately.
40978
+ // Otherwise, add it to a list of callbacks to run at the end of the animation.
40979
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
40980
+ else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
40981
+ });
40982
+ }
40983
+
40984
+
40985
+
40986
+ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
40987
+ let globalListeners = useRef(new Map());
40988
+ let addGlobalListener = useCallback((eventTarget, type, listener, options)=>{
40989
+ // Make sure we remove the listener after it is called with the `once` option.
40990
+ let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
40991
+ globalListeners.current.delete(listener);
40992
+ listener(...args);
40993
+ } : listener;
40994
+ globalListeners.current.set(listener, {
40995
+ type: type,
40996
+ eventTarget: eventTarget,
40997
+ fn: fn,
40998
+ options: options
40999
+ });
41000
+ eventTarget.addEventListener(type, listener, options);
41001
+ }, []);
41002
+ let removeGlobalListener = useCallback((eventTarget, type, listener, options)=>{
41003
+ var ref;
41004
+ let fn = ((ref = globalListeners.current.get(listener)) === null || ref === void 0 ? void 0 : ref.fn) || listener;
41005
+ eventTarget.removeEventListener(type, fn, options);
41006
+ globalListeners.current.delete(listener);
41007
+ }, []);
41008
+ let removeAllGlobalListeners = useCallback(()=>{
41009
+ globalListeners.current.forEach((value, key)=>{
41010
+ removeGlobalListener(value.eventTarget, value.type, key, value.options);
41011
+ });
41012
+ }, [
41013
+ removeGlobalListener
41014
+ ]);
41015
+ // eslint-disable-next-line arrow-body-style
41016
+ useEffect(()=>{
41017
+ return removeAllGlobalListeners;
41018
+ }, [
41019
+ removeAllGlobalListeners
41020
+ ]);
41021
+ return {
41022
+ addGlobalListener: addGlobalListener,
41023
+ removeGlobalListener: removeGlobalListener,
41024
+ removeAllGlobalListeners: removeAllGlobalListeners
41025
+ };
41026
+ }
41027
+
41028
+
41029
+
41030
+ function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
41031
+ let { id: id , 'aria-label': label , 'aria-labelledby': labelledBy } = props;
41032
+ // If there is both an aria-label and aria-labelledby,
41033
+ // combine them by pointing to the element itself.
41034
+ id = $bdb11010cef70236$export$f680877a34711e37(id);
41035
+ if (labelledBy && label) {
41036
+ let ids = new Set([
41037
+ ...labelledBy.trim().split(/\s+/),
41038
+ id
41039
+ ]);
41040
+ labelledBy = [
41041
+ ...ids
41042
+ ].join(' ');
41043
+ } else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
41044
+ // If no labels are provided, use the default
41045
+ if (!label && !labelledBy && defaultLabel) label = defaultLabel;
41046
+ return {
41047
+ id: id,
41048
+ 'aria-label': label,
41049
+ 'aria-labelledby': labelledBy
41050
+ };
41051
+ }
41052
+
41053
+
41054
+
41055
+ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
41056
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41057
+ if (context && context.ref && ref) {
41058
+ context.ref.current = ref.current;
41059
+ return ()=>{
41060
+ context.ref.current = null;
41061
+ };
41062
+ }
41063
+ }, [
41064
+ context,
41065
+ ref
41066
+ ]);
41067
+ }
41068
+
41069
+
41070
+
41071
+
41072
+ let $ef06256079686ba0$var$descriptionId = 0;
41073
+ const $ef06256079686ba0$var$descriptionNodes = new Map();
41074
+ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
41075
+ let [id1, setId] = useState(null);
41076
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41077
+ if (!description) return;
41078
+ let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
41079
+ if (!desc) {
41080
+ let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
41081
+ setId(id);
41082
+ let node = document.createElement('div');
41083
+ node.id = id;
41084
+ node.style.display = 'none';
41085
+ node.textContent = description;
41086
+ document.body.appendChild(node);
41087
+ desc = {
41088
+ refCount: 0,
41089
+ element: node
41090
+ };
41091
+ $ef06256079686ba0$var$descriptionNodes.set(description, desc);
41092
+ } else setId(desc.element.id);
41093
+ desc.refCount++;
41094
+ return ()=>{
41095
+ if (--desc.refCount === 0) {
41096
+ desc.element.remove();
41097
+ $ef06256079686ba0$var$descriptionNodes.delete(description);
41098
+ }
41099
+ };
41100
+ }, [
41101
+ description
41102
+ ]);
41103
+ return {
41104
+ 'aria-describedby': description ? id1 : undefined
41105
+ };
41106
+ }
41107
+
41108
+
41109
+ /*
41110
+ * Copyright 2020 Adobe. All rights reserved.
41111
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
41112
+ * you may not use this file except in compliance with the License. You may obtain a copy
41113
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
41114
+ *
41115
+ * Unless required by applicable law or agreed to in writing, software distributed under
41116
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
41117
+ * OF ANY KIND, either express or implied. See the License for the specific language
41118
+ * governing permissions and limitations under the License.
41119
+ */ function $c87311424ea30a05$var$testUserAgent(re) {
41120
+ var ref;
41121
+ if (typeof window === 'undefined' || window.navigator == null) return false;
41122
+ return ((ref = window.navigator['userAgentData']) === null || ref === void 0 ? void 0 : ref.brands.some((brand)=>re.test(brand.brand)
41123
+ )) || re.test(window.navigator.userAgent);
41124
+ }
41125
+ function $c87311424ea30a05$var$testPlatform(re) {
41126
+ var ref;
41127
+ return typeof window !== 'undefined' && window.navigator != null ? re.test(((ref = window.navigator['userAgentData']) === null || ref === void 0 ? void 0 : ref.platform) || window.navigator.platform) : false;
41128
+ }
41129
+ function $c87311424ea30a05$export$9ac100e40613ea10() {
41130
+ return $c87311424ea30a05$var$testPlatform(/^Mac/i);
41131
+ }
41132
+ function $c87311424ea30a05$export$186c6964ca17d99() {
41133
+ return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
41134
+ }
41135
+ function $c87311424ea30a05$export$7bef049ce92e4224() {
41136
+ return $c87311424ea30a05$var$testPlatform(/^iPad/i) || $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
41137
+ }
41138
+ function $c87311424ea30a05$export$fedb369cb70207f1() {
41139
+ return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
41140
+ }
41141
+ function $c87311424ea30a05$export$e1865c3bedcd822b() {
41142
+ return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
41143
+ }
41144
+ function $c87311424ea30a05$export$78551043582a6a98() {
41145
+ return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
41146
+ }
41147
+ function $c87311424ea30a05$export$6446a186d09e379e() {
41148
+ return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
41149
+ }
41150
+
41151
+
41152
+
41153
+ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler1, options) {
41154
+ let handlerRef = useRef(handler1);
41155
+ handlerRef.current = handler1;
41156
+ let isDisabled = handler1 == null;
41157
+ useEffect(()=>{
41158
+ if (isDisabled) return;
41159
+ let element = ref.current;
41160
+ let handler = (e)=>handlerRef.current.call(this, e)
41161
+ ;
41162
+ element.addEventListener(event, handler, options);
41163
+ return ()=>{
41164
+ element.removeEventListener(event, handler, options);
41165
+ };
41166
+ }, [
41167
+ ref,
41168
+ event,
41169
+ options,
41170
+ isDisabled
41171
+ ]);
41172
+ }
41173
+
41174
+
41175
+
41176
+
41177
+ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
41178
+ let [value, setValue] = useState(defaultValue);
41179
+ let valueRef = useRef(value);
41180
+ let effect = useRef(null);
41181
+ valueRef.current = value;
41182
+ // Store the function in a ref so we can always access the current version
41183
+ // which has the proper `value` in scope.
41184
+ let nextRef = useRef(null);
41185
+ nextRef.current = ()=>{
41186
+ // Run the generator to the next yield.
41187
+ let newValue = effect.current.next();
41188
+ // If the generator is done, reset the effect.
41189
+ if (newValue.done) {
41190
+ effect.current = null;
41191
+ return;
41192
+ }
41193
+ // If the value is the same as the current value,
41194
+ // then continue to the next yield. Otherwise,
41195
+ // set the value in state and wait for the next layout effect.
41196
+ if (value === newValue.value) nextRef.current();
41197
+ else setValue(newValue.value);
41198
+ };
41199
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41200
+ // If there is an effect currently running, continue to the next yield.
41201
+ if (effect.current) nextRef.current();
41202
+ });
41203
+ let queue = useCallback((fn)=>{
41204
+ effect.current = fn(valueRef.current);
41205
+ nextRef.current();
41206
+ }, [
41207
+ effect,
41208
+ nextRef
41209
+ ]);
41210
+ return [
41211
+ value,
41212
+ queue
41213
+ ];
41214
+ }
41215
+
41216
+
41217
+ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
41218
+ let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
41219
+ let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
41220
+ let width = element.offsetWidth;
41221
+ let height = element.offsetHeight;
41222
+ let x = scrollView.scrollLeft;
41223
+ let y = scrollView.scrollTop;
41224
+ let maxX = x + scrollView.offsetWidth;
41225
+ let maxY = y + scrollView.offsetHeight;
41226
+ if (offsetX <= x) x = offsetX;
41227
+ else if (offsetX + width > maxX) x += offsetX + width - maxX;
41228
+ if (offsetY <= y) y = offsetY;
41229
+ else if (offsetY + height > maxY) y += offsetY + height - maxY;
41230
+ scrollView.scrollLeft = x;
41231
+ scrollView.scrollTop = y;
41232
+ }
41233
+ /**
41234
+ * Computes the offset left or top from child to ancestor by accumulating
41235
+ * offsetLeft or offsetTop through intervening offsetParents.
41236
+ */ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
41237
+ const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
41238
+ let sum = 0;
41239
+ while(child.offsetParent){
41240
+ sum += child[prop];
41241
+ if (child.offsetParent === ancestor) break;
41242
+ else if (child.offsetParent.contains(ancestor)) {
41243
+ // If the ancestor is not `position:relative`, then we stop at
41244
+ // _its_ offset parent, and we subtract off _its_ offset, so that
41245
+ // we end up with the proper offset from child to ancestor.
41246
+ sum -= ancestor[prop];
41247
+ break;
41248
+ }
41249
+ child = child.offsetParent;
41250
+ }
41251
+ return sum;
41252
+ }
41253
+
41254
+ // Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
41255
+ // rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
41256
+ let $14c0b72509d70225$var$state = 'default';
41257
+ let $14c0b72509d70225$var$savedUserSelect = '';
41258
+ let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
41259
+ function $14c0b72509d70225$export$16a4697467175487(target) {
41260
+ if ($c87311424ea30a05$export$fedb369cb70207f1()) {
41261
+ if ($14c0b72509d70225$var$state === 'default') {
41262
+ $14c0b72509d70225$var$savedUserSelect = document.documentElement.style.webkitUserSelect;
41263
+ document.documentElement.style.webkitUserSelect = 'none';
41264
+ }
41265
+ $14c0b72509d70225$var$state = 'disabled';
41266
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) {
41267
+ // If not iOS, store the target's original user-select and change to user-select: none
41268
+ // Ignore state since it doesn't apply for non iOS
41269
+ $14c0b72509d70225$var$modifiedElementMap.set(target, target.style.userSelect);
41270
+ target.style.userSelect = 'none';
41271
+ }
41272
+ }
41273
+ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
41274
+ if ($c87311424ea30a05$export$fedb369cb70207f1()) {
41275
+ // If the state is already default, there's nothing to do.
41276
+ // If it is restoring, then there's no need to queue a second restore.
41277
+ if ($14c0b72509d70225$var$state !== 'disabled') return;
41278
+ $14c0b72509d70225$var$state = 'restoring';
41279
+ // There appears to be a delay on iOS where selection still might occur
41280
+ // after pointer up, so wait a bit before removing user-select.
41281
+ setTimeout(()=>{
41282
+ // Wait for any CSS transitions to complete so we don't recompute style
41283
+ // for the whole page in the middle of the animation and cause jank.
41284
+ $bbed8b41f857bcc0$export$24490316f764c430(()=>{
41285
+ // Avoid race conditions
41286
+ if ($14c0b72509d70225$var$state === 'restoring') {
41287
+ if (document.documentElement.style.webkitUserSelect === 'none') document.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
41288
+ $14c0b72509d70225$var$savedUserSelect = '';
41289
+ $14c0b72509d70225$var$state = 'default';
41290
+ }
41291
+ });
41292
+ }, 300);
41293
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
41294
+ // Ignore state since it doesn't apply for non iOS
41295
+ {
41296
+ if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
41297
+ let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
41298
+ if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;
41299
+ if (target.getAttribute('style') === '') target.removeAttribute('style');
41300
+ $14c0b72509d70225$var$modifiedElementMap.delete(target);
41301
+ }
41302
+ }
41303
+ }
41304
+
41305
+
41306
+
41307
+
41308
+
41309
+ function $8a9cb279dc87e130$export$60278871457622de(event) {
41310
+ // JAWS/NVDA with Firefox.
41311
+ if (event.mozInputSource === 0 && event.isTrusted) return true;
41312
+ return event.detail === 0 && !event.pointerType;
41313
+ }
41314
+ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
41315
+ isDefaultPrevented() {
41316
+ return this.nativeEvent.defaultPrevented;
41317
+ }
41318
+ preventDefault() {
41319
+ this.defaultPrevented = true;
41320
+ this.nativeEvent.preventDefault();
41321
+ }
41322
+ stopPropagation() {
41323
+ this.nativeEvent.stopPropagation();
41324
+ this.isPropagationStopped = ()=>true
41325
+ ;
41326
+ }
41327
+ isPropagationStopped() {
41328
+ return false;
41329
+ }
41330
+ persist() {
41331
+ }
41332
+ constructor(type, nativeEvent){
41333
+ this.nativeEvent = nativeEvent;
41334
+ this.target = nativeEvent.target;
41335
+ this.currentTarget = nativeEvent.currentTarget;
41336
+ this.relatedTarget = nativeEvent.relatedTarget;
41337
+ this.bubbles = nativeEvent.bubbles;
41338
+ this.cancelable = nativeEvent.cancelable;
41339
+ this.defaultPrevented = nativeEvent.defaultPrevented;
41340
+ this.eventPhase = nativeEvent.eventPhase;
41341
+ this.isTrusted = nativeEvent.isTrusted;
41342
+ this.timeStamp = nativeEvent.timeStamp;
41343
+ this.type = type;
41344
+ }
41345
+ }
41346
+ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
41347
+ let stateRef = useRef({
41348
+ isFocused: false,
41349
+ onBlur: onBlur,
41350
+ observer: null
41351
+ });
41352
+ stateRef.current.onBlur = onBlur;
41353
+ // Clean up MutationObserver on unmount. See below.
41354
+ // eslint-disable-next-line arrow-body-style
41355
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41356
+ const state = stateRef.current;
41357
+ return ()=>{
41358
+ if (state.observer) {
41359
+ state.observer.disconnect();
41360
+ state.observer = null;
41361
+ }
41362
+ };
41363
+ }, []);
41364
+ // This function is called during a React onFocus event.
41365
+ return useCallback((e1)=>{
41366
+ // React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
41367
+ // Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
41368
+ // MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
41369
+ // For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
41370
+ if (e1.target instanceof HTMLButtonElement || e1.target instanceof HTMLInputElement || e1.target instanceof HTMLTextAreaElement || e1.target instanceof HTMLSelectElement) {
41371
+ stateRef.current.isFocused = true;
41372
+ let target = e1.target;
41373
+ let onBlurHandler = (e)=>{
41374
+ var // For backward compatibility, dispatch a (fake) React synthetic event.
41375
+ _current, ref;
41376
+ stateRef.current.isFocused = false;
41377
+ if (target.disabled) (ref = (_current = stateRef.current).onBlur) === null || ref === void 0 ? void 0 : ref.call(_current, new $8a9cb279dc87e130$export$905e7fc544a71f36('blur', e));
41378
+ // We no longer need the MutationObserver once the target is blurred.
41379
+ if (stateRef.current.observer) {
41380
+ stateRef.current.observer.disconnect();
41381
+ stateRef.current.observer = null;
41382
+ }
41383
+ };
41384
+ target.addEventListener('focusout', onBlurHandler, {
41385
+ once: true
41386
+ });
41387
+ stateRef.current.observer = new MutationObserver(()=>{
41388
+ if (stateRef.current.isFocused && target.disabled) {
41389
+ stateRef.current.observer.disconnect();
41390
+ target.dispatchEvent(new FocusEvent('blur'));
41391
+ target.dispatchEvent(new FocusEvent('focusout', {
41392
+ bubbles: true
41393
+ }));
41394
+ }
41395
+ });
41396
+ stateRef.current.observer.observe(target, {
41397
+ attributes: true,
41398
+ attributeFilter: [
41399
+ 'disabled'
41400
+ ]
41401
+ });
41402
+ }
41403
+ }, []);
41404
+ }
41405
+
41406
+
41407
+
41408
+ const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = React__default.createContext(null);
41409
+ $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
41410
+
41411
+
41412
+
41413
+ function $f6c31cce2adf654f$var$usePressResponderContext(props) {
41414
+ // Consume context from <PressResponder> and merge with props.
41415
+ let context = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
41416
+ if (context) {
41417
+ let { register: register , ...contextProps } = context;
41418
+ props = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props);
41419
+ register();
41420
+ }
41421
+ $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, props.ref);
41422
+ return props;
41423
+ }
41424
+ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
41425
+ let { onPress: onPress1 , onPressChange: onPressChange1 , onPressStart: onPressStart1 , onPressEnd: onPressEnd1 , onPressUp: onPressUp1 , isDisabled: isDisabled1 , isPressed: isPressedProp , preventFocusOnPress: preventFocusOnPress , shouldCancelOnPointerExit: shouldCancelOnPointerExit , allowTextSelectionOnPress: allowTextSelectionOnPress , // eslint-disable-next-line @typescript-eslint/no-unused-vars
41426
+ ref: _ , ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
41427
+ let propsRef = useRef(null);
41428
+ propsRef.current = {
41429
+ onPress: onPress1,
41430
+ onPressChange: onPressChange1,
41431
+ onPressStart: onPressStart1,
41432
+ onPressEnd: onPressEnd1,
41433
+ onPressUp: onPressUp1,
41434
+ isDisabled: isDisabled1,
41435
+ shouldCancelOnPointerExit: shouldCancelOnPointerExit
41436
+ };
41437
+ let [isPressed, setPressed] = useState(false);
41438
+ let ref = useRef({
41439
+ isPressed: false,
41440
+ ignoreEmulatedMouseEvents: false,
41441
+ ignoreClickAfterPress: false,
41442
+ didFirePressStart: false,
41443
+ activePointerId: null,
41444
+ target: null,
41445
+ isOverTarget: false,
41446
+ pointerType: null
41447
+ });
41448
+ let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
41449
+ let pressProps1 = useMemo(()=>{
41450
+ let state = ref.current;
41451
+ let triggerPressStart = (originalEvent, pointerType)=>{
41452
+ let { onPressStart: onPressStart , onPressChange: onPressChange , isDisabled: isDisabled } = propsRef.current;
41453
+ if (isDisabled || state.didFirePressStart) return;
41454
+ if (onPressStart) onPressStart({
41455
+ type: 'pressstart',
41456
+ pointerType: pointerType,
41457
+ target: originalEvent.currentTarget,
41458
+ shiftKey: originalEvent.shiftKey,
41459
+ metaKey: originalEvent.metaKey,
41460
+ ctrlKey: originalEvent.ctrlKey,
41461
+ altKey: originalEvent.altKey
41462
+ });
41463
+ if (onPressChange) onPressChange(true);
41464
+ state.didFirePressStart = true;
41465
+ setPressed(true);
41466
+ };
41467
+ let triggerPressEnd = (originalEvent, pointerType, wasPressed = true)=>{
41468
+ let { onPressEnd: onPressEnd , onPressChange: onPressChange , onPress: onPress , isDisabled: isDisabled } = propsRef.current;
41469
+ if (!state.didFirePressStart) return;
41470
+ state.ignoreClickAfterPress = true;
41471
+ state.didFirePressStart = false;
41472
+ if (onPressEnd) onPressEnd({
41473
+ type: 'pressend',
41474
+ pointerType: pointerType,
41475
+ target: originalEvent.currentTarget,
41476
+ shiftKey: originalEvent.shiftKey,
41477
+ metaKey: originalEvent.metaKey,
41478
+ ctrlKey: originalEvent.ctrlKey,
41479
+ altKey: originalEvent.altKey
41480
+ });
41481
+ if (onPressChange) onPressChange(false);
41482
+ setPressed(false);
41483
+ if (onPress && wasPressed && !isDisabled) onPress({
41484
+ type: 'press',
41485
+ pointerType: pointerType,
41486
+ target: originalEvent.currentTarget,
41487
+ shiftKey: originalEvent.shiftKey,
41488
+ metaKey: originalEvent.metaKey,
41489
+ ctrlKey: originalEvent.ctrlKey,
41490
+ altKey: originalEvent.altKey
41491
+ });
41492
+ };
41493
+ let triggerPressUp = (originalEvent, pointerType)=>{
41494
+ let { onPressUp: onPressUp , isDisabled: isDisabled } = propsRef.current;
41495
+ if (isDisabled) return;
41496
+ if (onPressUp) onPressUp({
41497
+ type: 'pressup',
41498
+ pointerType: pointerType,
41499
+ target: originalEvent.currentTarget,
41500
+ shiftKey: originalEvent.shiftKey,
41501
+ metaKey: originalEvent.metaKey,
41502
+ ctrlKey: originalEvent.ctrlKey,
41503
+ altKey: originalEvent.altKey
41504
+ });
41505
+ };
41506
+ let cancel = (e)=>{
41507
+ if (state.isPressed) {
41508
+ if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41509
+ state.isPressed = false;
41510
+ state.isOverTarget = false;
41511
+ state.activePointerId = null;
41512
+ state.pointerType = null;
41513
+ removeAllGlobalListeners();
41514
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41515
+ }
41516
+ };
41517
+ let pressProps = {
41518
+ onKeyDown (e) {
41519
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent) && e.currentTarget.contains(e.target)) {
41520
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
41521
+ e.stopPropagation();
41522
+ // If the event is repeating, it may have started on a different element
41523
+ // after which focus moved to the current element. Ignore these events and
41524
+ // only handle the first key down event.
41525
+ if (!state.isPressed && !e.repeat) {
41526
+ state.target = e.currentTarget;
41527
+ state.isPressed = true;
41528
+ triggerPressStart(e, 'keyboard');
41529
+ // Focus may move before the key up event, so register the event on the document
41530
+ // instead of the same element where the key down event occurred.
41531
+ addGlobalListener(document, 'keyup', onKeyUp, false);
41532
+ }
41533
+ }
41534
+ },
41535
+ onKeyUp (e) {
41536
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
41537
+ },
41538
+ onClick (e) {
41539
+ if (e && !e.currentTarget.contains(e.target)) return;
41540
+ if (e && e.button === 0) {
41541
+ e.stopPropagation();
41542
+ if (isDisabled1) e.preventDefault();
41543
+ // If triggered from a screen reader or by using element.click(),
41544
+ // trigger as if it were a keyboard click.
41545
+ if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === 'virtual' || $8a9cb279dc87e130$export$60278871457622de(e.nativeEvent))) {
41546
+ // Ensure the element receives focus (VoiceOver on iOS does not do this)
41547
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41548
+ triggerPressStart(e, 'virtual');
41549
+ triggerPressUp(e, 'virtual');
41550
+ triggerPressEnd(e, 'virtual');
41551
+ }
41552
+ state.ignoreEmulatedMouseEvents = false;
41553
+ state.ignoreClickAfterPress = false;
41554
+ }
41555
+ }
41556
+ };
41557
+ let onKeyUp = (e)=>{
41558
+ if (state.isPressed && $f6c31cce2adf654f$var$isValidKeyboardEvent(e)) {
41559
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
41560
+ e.stopPropagation();
41561
+ state.isPressed = false;
41562
+ let target = e.target;
41563
+ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', state.target.contains(target));
41564
+ removeAllGlobalListeners();
41565
+ // If the target is a link, trigger the click method to open the URL,
41566
+ // but defer triggering pressEnd until onClick event handler.
41567
+ if (state.target instanceof HTMLElement && (state.target.contains(target) && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link')) state.target.click();
41568
+ }
41569
+ };
41570
+ if (typeof PointerEvent !== 'undefined') {
41571
+ pressProps.onPointerDown = (e)=>{
41572
+ // Only handle left clicks, and ignore events that bubbled through portals.
41573
+ if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
41574
+ // iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
41575
+ // Ignore and let the onClick handler take care of it instead.
41576
+ // https://bugs.webkit.org/show_bug.cgi?id=222627
41577
+ // https://bugs.webkit.org/show_bug.cgi?id=223202
41578
+ if ($f6c31cce2adf654f$var$isVirtualPointerEvent(e.nativeEvent)) {
41579
+ state.pointerType = 'virtual';
41580
+ return;
41581
+ }
41582
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent
41583
+ // default on pointer down and handle focusing the pressable element ourselves.
41584
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41585
+ state.pointerType = e.pointerType;
41586
+ e.stopPropagation();
41587
+ if (!state.isPressed) {
41588
+ state.isPressed = true;
41589
+ state.isOverTarget = true;
41590
+ state.activePointerId = e.pointerId;
41591
+ state.target = e.currentTarget;
41592
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41593
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
41594
+ triggerPressStart(e, state.pointerType);
41595
+ addGlobalListener(document, 'pointermove', onPointerMove, false);
41596
+ addGlobalListener(document, 'pointerup', onPointerUp, false);
41597
+ addGlobalListener(document, 'pointercancel', onPointerCancel, false);
41598
+ }
41599
+ };
41600
+ pressProps.onMouseDown = (e)=>{
41601
+ if (!e.currentTarget.contains(e.target)) return;
41602
+ if (e.button === 0) {
41603
+ // Chrome and Firefox on touch Windows devices require mouse down events
41604
+ // to be canceled in addition to pointer events, or an extra asynchronous
41605
+ // focus event will be fired.
41606
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41607
+ e.stopPropagation();
41608
+ }
41609
+ };
41610
+ pressProps.onPointerUp = (e)=>{
41611
+ // iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
41612
+ if (!e.currentTarget.contains(e.target) || state.pointerType === 'virtual') return;
41613
+ // Only handle left clicks
41614
+ // Safari on iOS sometimes fires pointerup events, even
41615
+ // when the touch isn't over the target, so double check.
41616
+ if (e.button === 0 && $f6c31cce2adf654f$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType);
41617
+ };
41618
+ // Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly.
41619
+ // Use pointer move events instead to implement our own hit testing.
41620
+ // See https://bugs.webkit.org/show_bug.cgi?id=199803
41621
+ let onPointerMove = (e)=>{
41622
+ if (e.pointerId !== state.activePointerId) return;
41623
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) {
41624
+ if (!state.isOverTarget) {
41625
+ state.isOverTarget = true;
41626
+ triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41627
+ }
41628
+ } else if (state.isOverTarget) {
41629
+ state.isOverTarget = false;
41630
+ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41631
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41632
+ }
41633
+ };
41634
+ let onPointerUp = (e)=>{
41635
+ if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0) {
41636
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41637
+ else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41638
+ state.isPressed = false;
41639
+ state.isOverTarget = false;
41640
+ state.activePointerId = null;
41641
+ state.pointerType = null;
41642
+ removeAllGlobalListeners();
41643
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41644
+ }
41645
+ };
41646
+ let onPointerCancel = (e)=>{
41647
+ cancel(e);
41648
+ };
41649
+ pressProps.onDragStart = (e)=>{
41650
+ if (!e.currentTarget.contains(e.target)) return;
41651
+ // Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
41652
+ cancel(e);
41653
+ };
41654
+ } else {
41655
+ pressProps.onMouseDown = (e)=>{
41656
+ // Only handle left clicks
41657
+ if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
41658
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent
41659
+ // default on mouse down and handle focusing the pressable element ourselves.
41660
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41661
+ e.stopPropagation();
41662
+ if (state.ignoreEmulatedMouseEvents) return;
41663
+ state.isPressed = true;
41664
+ state.isOverTarget = true;
41665
+ state.target = e.currentTarget;
41666
+ state.pointerType = $8a9cb279dc87e130$export$60278871457622de(e.nativeEvent) ? 'virtual' : 'mouse';
41667
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41668
+ triggerPressStart(e, state.pointerType);
41669
+ addGlobalListener(document, 'mouseup', onMouseUp, false);
41670
+ };
41671
+ pressProps.onMouseEnter = (e)=>{
41672
+ if (!e.currentTarget.contains(e.target)) return;
41673
+ e.stopPropagation();
41674
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
41675
+ state.isOverTarget = true;
41676
+ triggerPressStart(e, state.pointerType);
41677
+ }
41678
+ };
41679
+ pressProps.onMouseLeave = (e)=>{
41680
+ if (!e.currentTarget.contains(e.target)) return;
41681
+ e.stopPropagation();
41682
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
41683
+ state.isOverTarget = false;
41684
+ triggerPressEnd(e, state.pointerType, false);
41685
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41686
+ }
41687
+ };
41688
+ pressProps.onMouseUp = (e)=>{
41689
+ if (!e.currentTarget.contains(e.target)) return;
41690
+ if (!state.ignoreEmulatedMouseEvents && e.button === 0) triggerPressUp(e, state.pointerType);
41691
+ };
41692
+ let onMouseUp = (e)=>{
41693
+ // Only handle left clicks
41694
+ if (e.button !== 0) return;
41695
+ state.isPressed = false;
41696
+ removeAllGlobalListeners();
41697
+ if (state.ignoreEmulatedMouseEvents) {
41698
+ state.ignoreEmulatedMouseEvents = false;
41699
+ return;
41700
+ }
41701
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41702
+ else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41703
+ state.isOverTarget = false;
41704
+ };
41705
+ pressProps.onTouchStart = (e)=>{
41706
+ if (!e.currentTarget.contains(e.target)) return;
41707
+ e.stopPropagation();
41708
+ let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
41709
+ if (!touch) return;
41710
+ state.activePointerId = touch.identifier;
41711
+ state.ignoreEmulatedMouseEvents = true;
41712
+ state.isOverTarget = true;
41713
+ state.isPressed = true;
41714
+ state.target = e.currentTarget;
41715
+ state.pointerType = 'touch';
41716
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent default
41717
+ // on the emulated mouse event and handle focusing the pressable element ourselves.
41718
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41719
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
41720
+ triggerPressStart(e, state.pointerType);
41721
+ addGlobalListener(window, 'scroll', onScroll, true);
41722
+ };
41723
+ pressProps.onTouchMove = (e)=>{
41724
+ if (!e.currentTarget.contains(e.target)) return;
41725
+ e.stopPropagation();
41726
+ if (!state.isPressed) return;
41727
+ let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
41728
+ if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
41729
+ if (!state.isOverTarget) {
41730
+ state.isOverTarget = true;
41731
+ triggerPressStart(e, state.pointerType);
41732
+ }
41733
+ } else if (state.isOverTarget) {
41734
+ state.isOverTarget = false;
41735
+ triggerPressEnd(e, state.pointerType, false);
41736
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41737
+ }
41738
+ };
41739
+ pressProps.onTouchEnd = (e)=>{
41740
+ if (!e.currentTarget.contains(e.target)) return;
41741
+ e.stopPropagation();
41742
+ if (!state.isPressed) return;
41743
+ let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
41744
+ if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
41745
+ triggerPressUp(e, state.pointerType);
41746
+ triggerPressEnd(e, state.pointerType);
41747
+ } else if (state.isOverTarget) triggerPressEnd(e, state.pointerType, false);
41748
+ state.isPressed = false;
41749
+ state.activePointerId = null;
41750
+ state.isOverTarget = false;
41751
+ state.ignoreEmulatedMouseEvents = true;
41752
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41753
+ removeAllGlobalListeners();
41754
+ };
41755
+ pressProps.onTouchCancel = (e)=>{
41756
+ if (!e.currentTarget.contains(e.target)) return;
41757
+ e.stopPropagation();
41758
+ if (state.isPressed) cancel(e);
41759
+ };
41760
+ let onScroll = (e)=>{
41761
+ if (state.isPressed && e.target.contains(state.target)) cancel({
41762
+ currentTarget: state.target,
41763
+ shiftKey: false,
41764
+ ctrlKey: false,
41765
+ metaKey: false,
41766
+ altKey: false
41767
+ });
41768
+ };
41769
+ pressProps.onDragStart = (e)=>{
41770
+ if (!e.currentTarget.contains(e.target)) return;
41771
+ cancel(e);
41772
+ };
41773
+ }
41774
+ return pressProps;
41775
+ }, [
41776
+ addGlobalListener,
41777
+ isDisabled1,
41778
+ preventFocusOnPress,
41779
+ removeAllGlobalListeners,
41780
+ allowTextSelectionOnPress
41781
+ ]);
41782
+ // Remove user-select: none in case component unmounts immediately after pressStart
41783
+ // eslint-disable-next-line arrow-body-style
41784
+ useEffect(()=>{
41785
+ return ()=>{
41786
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(ref.current.target);
41787
+ };
41788
+ }, [
41789
+ allowTextSelectionOnPress
41790
+ ]);
41791
+ return {
41792
+ isPressed: isPressedProp || isPressed,
41793
+ pressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, pressProps1)
41794
+ };
41795
+ }
41796
+ function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
41797
+ return target.tagName === 'A' && target.hasAttribute('href');
41798
+ }
41799
+ function $f6c31cce2adf654f$var$isValidKeyboardEvent(event) {
41800
+ const { key: key , code: code , target: target } = event;
41801
+ const element = target;
41802
+ const { tagName: tagName , isContentEditable: isContentEditable } = element;
41803
+ const role = element.getAttribute('role');
41804
+ // Accessibility for keyboards. Space and Enter only.
41805
+ // "Spacebar" is for IE 11
41806
+ return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && tagName !== 'INPUT' && tagName !== 'TEXTAREA' && isContentEditable !== true && (!$f6c31cce2adf654f$var$isHTMLAnchorLink(element) || role === 'button' && key !== 'Enter') && // An element with role='link' should only trigger with Enter key
41807
+ !(role === 'link' && key !== 'Enter');
41808
+ }
41809
+ function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
41810
+ const { targetTouches: targetTouches } = event;
41811
+ if (targetTouches.length > 0) return targetTouches[0];
41812
+ return null;
41813
+ }
41814
+ function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
41815
+ const changedTouches = event.changedTouches;
41816
+ for(let i = 0; i < changedTouches.length; i++){
41817
+ const touch = changedTouches[i];
41818
+ if (touch.identifier === pointerId) return touch;
41819
+ }
41820
+ return null;
41821
+ }
41822
+ function $f6c31cce2adf654f$var$createEvent(target, e) {
41823
+ return {
41824
+ currentTarget: target,
41825
+ shiftKey: e.shiftKey,
41826
+ ctrlKey: e.ctrlKey,
41827
+ metaKey: e.metaKey,
41828
+ altKey: e.altKey
41829
+ };
41830
+ }
41831
+ function $f6c31cce2adf654f$var$getPointClientRect(point) {
41832
+ let offsetX = point.width / 2 || point.radiusX || 0;
41833
+ let offsetY = point.height / 2 || point.radiusY || 0;
41834
+ return {
41835
+ top: point.clientY - offsetY,
41836
+ right: point.clientX + offsetX,
41837
+ bottom: point.clientY + offsetY,
41838
+ left: point.clientX - offsetX
41839
+ };
41840
+ }
41841
+ function $f6c31cce2adf654f$var$areRectanglesOverlapping(a, b) {
41842
+ // check if they cannot overlap on x axis
41843
+ if (a.left > b.right || b.left > a.right) return false;
41844
+ // check if they cannot overlap on y axis
41845
+ if (a.top > b.bottom || b.top > a.bottom) return false;
41846
+ return true;
41847
+ }
41848
+ function $f6c31cce2adf654f$var$isOverTarget(point, target) {
41849
+ let rect = target.getBoundingClientRect();
41850
+ let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
41851
+ return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
41852
+ }
41853
+ function $f6c31cce2adf654f$var$shouldPreventDefault(target) {
41854
+ // We cannot prevent default if the target is a draggable element.
41855
+ return !(target instanceof HTMLElement) || !target.draggable;
41856
+ }
41857
+ function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target) {
41858
+ return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && target.type === 'submit');
41859
+ }
41860
+ function $f6c31cce2adf654f$var$isVirtualPointerEvent(event) {
41861
+ // If the pointer size is zero, then we assume it's from a screen reader.
41862
+ // Android TalkBack double tap will sometimes return a event with width and height of 1
41863
+ // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
41864
+ // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
41865
+ // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
41866
+ // Talkback double tap from Windows Firefox touch screen press
41867
+ return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
41868
+ }
41869
+
41870
+
41871
+
41872
+
41873
+ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
41874
+ let { isDisabled: isDisabled , onFocus: onFocusProp , onBlur: onBlurProp , onFocusChange: onFocusChange } = props;
41875
+ const onBlur = useCallback((e)=>{
41876
+ if (e.target === e.currentTarget) {
41877
+ if (onBlurProp) onBlurProp(e);
41878
+ if (onFocusChange) onFocusChange(false);
41879
+ return true;
41880
+ }
41881
+ }, [
41882
+ onBlurProp,
41883
+ onFocusChange
41884
+ ]);
41885
+ const onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
41886
+ const onFocus = useCallback((e)=>{
41887
+ if (e.target === e.currentTarget) {
41888
+ if (onFocusProp) onFocusProp(e);
41889
+ if (onFocusChange) onFocusChange(true);
41890
+ onSyntheticFocus(e);
41891
+ }
41892
+ }, [
41893
+ onFocusChange,
41894
+ onFocusProp,
41895
+ onSyntheticFocus
41896
+ ]);
41897
+ return {
41898
+ focusProps: {
41899
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
41900
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : null
41901
+ }
41902
+ };
41903
+ }
41904
+
41905
+
41906
+
41907
+
41908
+
41909
+ let $507fabe10e71c6fb$var$currentModality = null;
41910
+ let $507fabe10e71c6fb$var$changeHandlers = new Set();
41911
+ let $507fabe10e71c6fb$var$hasSetupGlobalListeners = false;
41912
+ let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41913
+ let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
41914
+ // Only Tab or Esc keys will make focus visible on text input elements
41915
+ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
41916
+ Tab: true,
41917
+ Escape: true
41918
+ };
41919
+ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
41920
+ for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
41921
+ }
41922
+ /**
41923
+ * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
41924
+ */ function $507fabe10e71c6fb$var$isValidKey(e) {
41925
+ // Control and Shift keys trigger when navigating back to the tab with keyboard.
41926
+ return !(e.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
41927
+ }
41928
+ function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
41929
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41930
+ if ($507fabe10e71c6fb$var$isValidKey(e)) {
41931
+ $507fabe10e71c6fb$var$currentModality = 'keyboard';
41932
+ $507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
41933
+ }
41934
+ }
41935
+ function $507fabe10e71c6fb$var$handlePointerEvent(e) {
41936
+ $507fabe10e71c6fb$var$currentModality = 'pointer';
41937
+ if (e.type === 'mousedown' || e.type === 'pointerdown') {
41938
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41939
+ $507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
41940
+ }
41941
+ }
41942
+ function $507fabe10e71c6fb$var$handleClickEvent(e) {
41943
+ if ($8a9cb279dc87e130$export$60278871457622de(e)) {
41944
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41945
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
41946
+ }
41947
+ }
41948
+ function $507fabe10e71c6fb$var$handleFocusEvent(e) {
41949
+ // Firefox fires two extra focus events when the user first clicks into an iframe:
41950
+ // first on the window, then on the document. We ignore these events so they don't
41951
+ // cause keyboard focus rings to appear.
41952
+ if (e.target === window || e.target === document) return;
41953
+ // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
41954
+ // This occurs, for example, when navigating a form with the next/previous buttons on iOS.
41955
+ if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
41956
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
41957
+ $507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
41958
+ }
41959
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41960
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
41961
+ }
41962
+ function $507fabe10e71c6fb$var$handleWindowBlur() {
41963
+ // When the window is blurred, reset state. This is necessary when tabbing out of the window,
41964
+ // for example, since a subsequent focus event won't be fired.
41965
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41966
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
41967
+ }
41968
+ /**
41969
+ * Setup global event listeners to control when keyboard focus style should be visible.
41970
+ */ function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
41971
+ if (typeof window === 'undefined' || $507fabe10e71c6fb$var$hasSetupGlobalListeners) return;
41972
+ // Programmatic focus() calls shouldn't affect the current input modality.
41973
+ // However, we need to detect other cases when a focus event occurs without
41974
+ // a preceding user event (e.g. screen reader focus). Overriding the focus
41975
+ // method on HTMLElement.prototype is a bit hacky, but works.
41976
+ let focus = HTMLElement.prototype.focus;
41977
+ HTMLElement.prototype.focus = function() {
41978
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41979
+ focus.apply(this, arguments);
41980
+ };
41981
+ document.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
41982
+ document.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
41983
+ document.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
41984
+ // Register focus events on the window so they are sure to happen
41985
+ // before React's event listeners (registered on the document).
41986
+ window.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
41987
+ window.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
41988
+ if (typeof PointerEvent !== 'undefined') {
41989
+ document.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
41990
+ document.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
41991
+ document.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
41992
+ } else {
41993
+ document.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
41994
+ document.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
41995
+ document.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
41996
+ }
41997
+ $507fabe10e71c6fb$var$hasSetupGlobalListeners = true;
41998
+ }
41999
+ if (typeof document !== 'undefined') {
42000
+ if (document.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents();
42001
+ else document.addEventListener('DOMContentLoaded', $507fabe10e71c6fb$var$setupGlobalFocusEvents);
42002
+ }
42003
+ function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
42004
+ return $507fabe10e71c6fb$var$currentModality !== 'pointer';
42005
+ }
42006
+ function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
42007
+ return $507fabe10e71c6fb$var$currentModality;
42008
+ }
42009
+ /**
42010
+ * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
42011
+ * focus visible style can be properly set.
42012
+ */ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
42013
+ return !(isTextInput && modality === 'keyboard' && e instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
42014
+ }
42015
+ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
42016
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents();
42017
+ useEffect(()=>{
42018
+ let handler = (modality, e)=>{
42019
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(opts === null || opts === void 0 ? void 0 : opts.isTextInput, modality, e)) return;
42020
+ fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
42021
+ };
42022
+ $507fabe10e71c6fb$var$changeHandlers.add(handler);
42023
+ return ()=>{
42024
+ $507fabe10e71c6fb$var$changeHandlers.delete(handler);
42025
+ };
42026
+ }, deps);
42027
+ }
42028
+
42029
+
42030
+
42031
+
42032
+ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
42033
+ let { isDisabled: isDisabled , onBlurWithin: onBlurWithin , onFocusWithin: onFocusWithin , onFocusWithinChange: onFocusWithinChange } = props;
42034
+ let state = useRef({
42035
+ isFocusWithin: false
42036
+ });
42037
+ let onBlur = useCallback((e)=>{
42038
+ // We don't want to trigger onBlurWithin and then immediately onFocusWithin again
42039
+ // when moving focus inside the element. Only trigger if the currentTarget doesn't
42040
+ // include the relatedTarget (where focus is moving).
42041
+ if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
42042
+ state.current.isFocusWithin = false;
42043
+ if (onBlurWithin) onBlurWithin(e);
42044
+ if (onFocusWithinChange) onFocusWithinChange(false);
42045
+ }
42046
+ }, [
42047
+ onBlurWithin,
42048
+ onFocusWithinChange,
42049
+ state
42050
+ ]);
42051
+ let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
42052
+ let onFocus = useCallback((e)=>{
42053
+ if (!state.current.isFocusWithin) {
42054
+ if (onFocusWithin) onFocusWithin(e);
42055
+ if (onFocusWithinChange) onFocusWithinChange(true);
42056
+ state.current.isFocusWithin = true;
42057
+ onSyntheticFocus(e);
42058
+ }
42059
+ }, [
42060
+ onFocusWithin,
42061
+ onFocusWithinChange,
42062
+ onSyntheticFocus
42063
+ ]);
42064
+ if (isDisabled) return {
42065
+ focusWithinProps: {
42066
+ onFocus: null,
42067
+ onBlur: null
42068
+ }
42069
+ };
42070
+ return {
42071
+ focusWithinProps: {
42072
+ onFocus: onFocus,
42073
+ onBlur: onBlur
42074
+ }
42075
+ };
42076
+ }
42077
+
42078
+
42079
+
42080
+ // iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
42081
+ // We want to ignore these emulated events so they do not trigger hover behavior.
42082
+ // See https://bugs.webkit.org/show_bug.cgi?id=214609.
42083
+ let $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
42084
+ let $6179b936705e76d3$var$hoverCount = 0;
42085
+ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
42086
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
42087
+ // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter
42088
+ // with pointerType="mouse" immediately after onPointerUp and before onFocus. On other
42089
+ // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in
42090
+ // the distant future because a user previously touched the element.
42091
+ setTimeout(()=>{
42092
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
42093
+ }, 50);
42094
+ }
42095
+ function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
42096
+ if (e.pointerType === 'touch') $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
42097
+ }
42098
+ function $6179b936705e76d3$var$setupGlobalTouchEvents() {
42099
+ if (typeof document === 'undefined') return;
42100
+ if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
42101
+ else document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
42102
+ $6179b936705e76d3$var$hoverCount++;
42103
+ return ()=>{
42104
+ $6179b936705e76d3$var$hoverCount--;
42105
+ if ($6179b936705e76d3$var$hoverCount > 0) return;
42106
+ if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
42107
+ else document.removeEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
42108
+ };
42109
+ }
42110
+ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
42111
+ let { onHoverStart: onHoverStart , onHoverChange: onHoverChange , onHoverEnd: onHoverEnd , isDisabled: isDisabled } = props;
42112
+ let [isHovered, setHovered] = useState(false);
42113
+ let state = useRef({
42114
+ isHovered: false,
42115
+ ignoreEmulatedMouseEvents: false,
42116
+ pointerType: '',
42117
+ target: null
42118
+ }).current;
42119
+ useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []);
42120
+ let { hoverProps: hoverProps1 , triggerHoverEnd: triggerHoverEnd1 } = useMemo(()=>{
42121
+ let triggerHoverStart = (event, pointerType)=>{
42122
+ state.pointerType = pointerType;
42123
+ if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;
42124
+ state.isHovered = true;
42125
+ let target = event.currentTarget;
42126
+ state.target = target;
42127
+ if (onHoverStart) onHoverStart({
42128
+ type: 'hoverstart',
42129
+ target: target,
42130
+ pointerType: pointerType
42131
+ });
42132
+ if (onHoverChange) onHoverChange(true);
42133
+ setHovered(true);
42134
+ };
42135
+ let triggerHoverEnd = (event, pointerType)=>{
42136
+ state.pointerType = '';
42137
+ state.target = null;
42138
+ if (pointerType === 'touch' || !state.isHovered) return;
42139
+ state.isHovered = false;
42140
+ let target = event.currentTarget;
42141
+ if (onHoverEnd) onHoverEnd({
42142
+ type: 'hoverend',
42143
+ target: target,
42144
+ pointerType: pointerType
42145
+ });
42146
+ if (onHoverChange) onHoverChange(false);
42147
+ setHovered(false);
42148
+ };
42149
+ let hoverProps = {
42150
+ };
42151
+ if (typeof PointerEvent !== 'undefined') {
42152
+ hoverProps.onPointerEnter = (e)=>{
42153
+ if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;
42154
+ triggerHoverStart(e, e.pointerType);
42155
+ };
42156
+ hoverProps.onPointerLeave = (e)=>{
42157
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, e.pointerType);
42158
+ };
42159
+ } else {
42160
+ hoverProps.onTouchStart = ()=>{
42161
+ state.ignoreEmulatedMouseEvents = true;
42162
+ };
42163
+ hoverProps.onMouseEnter = (e)=>{
42164
+ if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');
42165
+ state.ignoreEmulatedMouseEvents = false;
42166
+ };
42167
+ hoverProps.onMouseLeave = (e)=>{
42168
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');
42169
+ };
42170
+ }
42171
+ return {
42172
+ hoverProps: hoverProps,
42173
+ triggerHoverEnd: triggerHoverEnd
42174
+ };
42175
+ }, [
42176
+ onHoverStart,
42177
+ onHoverChange,
42178
+ onHoverEnd,
42179
+ isDisabled,
42180
+ state
42181
+ ]);
42182
+ useEffect(()=>{
42183
+ // Call the triggerHoverEnd as soon as isDisabled changes to true
42184
+ // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
42185
+ if (isDisabled) triggerHoverEnd1({
42186
+ currentTarget: state.target
42187
+ }, state.pointerType);
42188
+ }, [
42189
+ isDisabled
42190
+ ]);
42191
+ return {
42192
+ hoverProps: hoverProps1,
42193
+ isHovered: isHovered
42194
+ };
42195
+ }
42196
+
42197
+
42198
+
42199
+
42200
+
42201
+ const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
42202
+ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
42203
+ let { isDisabled: isDisabled , onLongPressStart: onLongPressStart , onLongPressEnd: onLongPressEnd , onLongPress: onLongPress , threshold: threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD , accessibilityDescription: accessibilityDescription } = props;
42204
+ const timeRef = useRef(null);
42205
+ let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
42206
+ let { pressProps: pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
42207
+ isDisabled: isDisabled,
42208
+ onPressStart (e1) {
42209
+ if (e1.pointerType === 'mouse' || e1.pointerType === 'touch') {
42210
+ if (onLongPressStart) onLongPressStart({
42211
+ ...e1,
42212
+ type: 'longpressstart'
42213
+ });
42214
+ timeRef.current = setTimeout(()=>{
42215
+ // Prevent other usePress handlers from also handling this event.
42216
+ e1.target.dispatchEvent(new PointerEvent('pointercancel', {
42217
+ bubbles: true
42218
+ }));
42219
+ if (onLongPress) onLongPress({
42220
+ ...e1,
42221
+ type: 'longpress'
42222
+ });
42223
+ timeRef.current = null;
42224
+ }, threshold);
42225
+ // Prevent context menu, which may be opened on long press on touch devices
42226
+ if (e1.pointerType === 'touch') {
42227
+ let onContextMenu = (e)=>{
42228
+ e.preventDefault();
42229
+ };
42230
+ addGlobalListener(e1.target, 'contextmenu', onContextMenu, {
42231
+ once: true
42232
+ });
42233
+ addGlobalListener(window, 'pointerup', ()=>{
42234
+ // If no contextmenu event is fired quickly after pointerup, remove the handler
42235
+ // so future context menu events outside a long press are not prevented.
42236
+ setTimeout(()=>{
42237
+ removeGlobalListener(e1.target, 'contextmenu', onContextMenu);
42238
+ }, 30);
42239
+ }, {
42240
+ once: true
42241
+ });
42242
+ }
42243
+ }
42244
+ },
42245
+ onPressEnd (e) {
42246
+ if (timeRef.current) clearTimeout(timeRef.current);
42247
+ if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) onLongPressEnd({
42248
+ ...e,
42249
+ type: 'longpressend'
42250
+ });
42251
+ }
42252
+ });
42253
+ let descriptionProps = $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : null);
42254
+ return {
42255
+ longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, descriptionProps)
42256
+ };
42257
+ }
42258
+
42259
+ function $d191a55c9702f145$export$8467354a121f1b9f(props) {
42260
+ let { id: id , label: label , 'aria-labelledby': ariaLabelledby , 'aria-label': ariaLabel , labelElementType: labelElementType = 'label' } = props;
42261
+ id = $bdb11010cef70236$export$f680877a34711e37(id);
42262
+ let labelId = $bdb11010cef70236$export$f680877a34711e37();
42263
+ let labelProps = {
42264
+ };
42265
+ if (label) {
42266
+ ariaLabelledby = ariaLabelledby ? `${ariaLabelledby} ${labelId}` : labelId;
42267
+ labelProps = {
42268
+ id: labelId,
42269
+ htmlFor: labelElementType === 'label' ? id : undefined
42270
+ };
42271
+ } else if (!ariaLabelledby && !ariaLabel) console.warn('If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility');
42272
+ let fieldProps = $313b98861ee5dd6c$export$d6875122194c7b44({
42273
+ id: id,
42274
+ 'aria-label': ariaLabel,
42275
+ 'aria-labelledby': ariaLabelledby
42276
+ });
42277
+ return {
42278
+ labelProps: labelProps,
42279
+ fieldProps: fieldProps
42280
+ };
42281
+ }
42282
+
42283
+ function $6a99195332edec8b$export$80f3e147d781571c(element) {
42284
+ // If the user is interacting with a virtual cursor, e.g. screen reader, then
42285
+ // wait until after any animated transitions that are currently occurring on
42286
+ // the page before shifting focus. This avoids issues with VoiceOver on iOS
42287
+ // causing the page to scroll when moving focus if the element is transitioning
42288
+ // from off the screen.
42289
+ if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === 'virtual') {
42290
+ let lastFocusedElement = document.activeElement;
42291
+ $bbed8b41f857bcc0$export$24490316f764c430(()=>{
42292
+ // If focus did not move and the element is still in the document, focus it.
42293
+ if (document.activeElement === lastFocusedElement && document.contains(element)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
42294
+ });
42295
+ } else $7215afc6de606d6b$export$de79e2c695e052f3(element);
42296
+ }
42297
+
42298
+
42299
+ /*
42300
+ * Copyright 2021 Adobe. All rights reserved.
42301
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
42302
+ * you may not use this file except in compliance with the License. You may obtain a copy
42303
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
42304
+ *
42305
+ * Unless required by applicable law or agreed to in writing, software distributed under
42306
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42307
+ * OF ANY KIND, either express or implied. See the License for the specific language
42308
+ * governing permissions and limitations under the License.
42309
+ */ function $645f2e67b85a24c9$var$isStyleVisible(element) {
42310
+ if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) return false;
42311
+ let { display: display , visibility: visibility } = element.style;
42312
+ let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
42313
+ if (isVisible) {
42314
+ const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
42315
+ let { display: computedDisplay , visibility: computedVisibility } = getComputedStyle(element);
42316
+ isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
42317
+ }
42318
+ return isVisible;
42319
+ }
42320
+ function $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) {
42321
+ return !element.hasAttribute('hidden') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
42322
+ }
42323
+ function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
42324
+ return element.nodeName !== '#comment' && $645f2e67b85a24c9$var$isStyleVisible(element) && $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) && (!element.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element.parentElement, element));
42325
+ }
42326
+ const $9bf71ea28793e738$var$focusableElements = [
42327
+ 'input:not([disabled]):not([type=hidden])',
42328
+ 'select:not([disabled])',
42329
+ 'textarea:not([disabled])',
42330
+ 'button:not([disabled])',
42331
+ 'a[href]',
42332
+ 'area[href]',
42333
+ 'summary',
42334
+ 'iframe',
42335
+ 'object',
42336
+ 'embed',
42337
+ 'audio[controls]',
42338
+ 'video[controls]',
42339
+ '[contenteditable]'
42340
+ ];
42341
+ const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
42342
+ $9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
42343
+ const $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
42344
+ function $9bf71ea28793e738$var$isElementInScope(element, scope) {
42345
+ return scope.some((node)=>node.contains(element)
42346
+ );
42347
+ }
42348
+ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
42349
+ let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
42350
+ let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
42351
+ acceptNode (node) {
42352
+ var ref;
42353
+ // Skip nodes inside the starting node.
42354
+ if (opts === null || opts === void 0 ? void 0 : (ref = opts.from) === null || ref === void 0 ? void 0 : ref.contains(node)) return NodeFilter.FILTER_REJECT;
42355
+ if (node.matches(selector) && $645f2e67b85a24c9$export$e989c0fffaa6b27a(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
42356
+ return NodeFilter.FILTER_SKIP;
42357
+ }
42358
+ });
42359
+ if (opts === null || opts === void 0 ? void 0 : opts.from) walker.currentNode = opts.from;
42360
+ return walker;
42361
+ }
42362
+
42363
+
42364
+
42365
+
42366
+
42367
+
42368
+
42369
+
42370
+ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {
42371
+ }) {
42372
+ let { autoFocus: autoFocus = false , isTextInput: isTextInput , within: within } = props;
42373
+ let state = useRef({
42374
+ isFocused: false,
42375
+ isFocusVisible: autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27()
42376
+ });
42377
+ let [isFocused1, setFocused] = useState(false);
42378
+ let [isFocusVisibleState, setFocusVisible] = useState(()=>state.current.isFocused && state.current.isFocusVisible
42379
+ );
42380
+ let updateState = useCallback(()=>setFocusVisible(state.current.isFocused && state.current.isFocusVisible)
42381
+ , []);
42382
+ let onFocusChange = useCallback((isFocused)=>{
42383
+ state.current.isFocused = isFocused;
42384
+ setFocused(isFocused);
42385
+ updateState();
42386
+ }, [
42387
+ updateState
42388
+ ]);
42389
+ $507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible)=>{
42390
+ state.current.isFocusVisible = isFocusVisible;
42391
+ updateState();
42392
+ }, [], {
42393
+ isTextInput: isTextInput
42394
+ });
42395
+ let { focusProps: focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
42396
+ isDisabled: within,
42397
+ onFocusChange: onFocusChange
42398
+ });
42399
+ let { focusWithinProps: focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
42400
+ isDisabled: !within,
42401
+ onFocusWithinChange: onFocusChange
42402
+ });
42403
+ return {
42404
+ isFocused: isFocused1,
42405
+ isFocusVisible: state.current.isFocused && isFocusVisibleState,
42406
+ focusProps: within ? focusWithinProps : focusProps
42407
+ };
42408
+ }
42409
+
42410
+ /*
42411
+ * Copyright 2020 Adobe. All rights reserved.
42412
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
42413
+ * you may not use this file except in compliance with the License. You may obtain a copy
42414
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
42415
+ *
42416
+ * Unless required by applicable law or agreed to in writing, software distributed under
42417
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42418
+ * OF ANY KIND, either express or implied. See the License for the specific language
42419
+ * governing permissions and limitations under the License.
42420
+ */ // https://en.wikipedia.org/wiki/Right-to-left
42421
+ const $148a7a147e38ea7f$var$RTL_SCRIPTS = new Set([
42422
+ 'Arab',
42423
+ 'Syrc',
42424
+ 'Samr',
42425
+ 'Mand',
42426
+ 'Thaa',
42427
+ 'Mend',
42428
+ 'Nkoo',
42429
+ 'Adlm',
42430
+ 'Rohg',
42431
+ 'Hebr'
42432
+ ]);
42433
+ const $148a7a147e38ea7f$var$RTL_LANGS = new Set([
42434
+ 'ae',
42435
+ 'ar',
42436
+ 'arc',
42437
+ 'bcc',
42438
+ 'bqi',
42439
+ 'ckb',
42440
+ 'dv',
42441
+ 'fa',
42442
+ 'glk',
42443
+ 'he',
42444
+ 'ku',
42445
+ 'mzn',
42446
+ 'nqo',
42447
+ 'pnb',
42448
+ 'ps',
42449
+ 'sd',
42450
+ 'ug',
42451
+ 'ur',
42452
+ 'yi'
42453
+ ]);
42454
+ function $148a7a147e38ea7f$export$702d680b21cbd764(locale) {
42455
+ // If the Intl.Locale API is available, use it to get the script for the locale.
42456
+ // This is more accurate than guessing by language, since languages can be written in multiple scripts.
42457
+ // @ts-ignore
42458
+ if (Intl.Locale) {
42459
+ // @ts-ignore
42460
+ let script = new Intl.Locale(locale).maximize().script;
42461
+ return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(script);
42462
+ }
42463
+ // If not, just guess by the language (first part of the locale)
42464
+ let lang = locale.split('-')[0];
42465
+ return $148a7a147e38ea7f$var$RTL_LANGS.has(lang);
42466
+ }
42467
+
42468
+
42469
+
42470
+
42471
+
42472
+ function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
42473
+ // @ts-ignore
42474
+ let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
42475
+ try {
42476
+ // @ts-ignore
42477
+ Intl.DateTimeFormat.supportedLocalesOf([
42478
+ locale
42479
+ ]);
42480
+ } catch (_err) {
42481
+ locale = 'en-US';
42482
+ }
42483
+ return {
42484
+ locale: locale,
42485
+ direction: $148a7a147e38ea7f$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr'
42486
+ };
42487
+ }
42488
+ let $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
42489
+ let $1e5a04cdaf7d1af8$var$listeners = new Set();
42490
+ function $1e5a04cdaf7d1af8$var$updateLocale() {
42491
+ $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
42492
+ for (let listener of $1e5a04cdaf7d1af8$var$listeners)listener($1e5a04cdaf7d1af8$var$currentLocale);
42493
+ }
42494
+ function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
42495
+ let isSSR = $704cf1d3b684cc5c$export$535bd6ca7f90a273();
42496
+ let [defaultLocale, setDefaultLocale] = useState($1e5a04cdaf7d1af8$var$currentLocale);
42497
+ useEffect(()=>{
42498
+ if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.addEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
42499
+ $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale);
42500
+ return ()=>{
42501
+ $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale);
42502
+ if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.removeEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
42503
+ };
42504
+ }, []);
42505
+ // We cannot determine the browser's language on the server, so default to
42506
+ // en-US. This will be updated after hydration on the client to the correct value.
42507
+ if (isSSR) return {
42508
+ locale: 'en-US',
42509
+ direction: 'ltr'
42510
+ };
42511
+ return defaultLocale;
42512
+ }
42513
+
42514
+
42515
+
42516
+ const $18f2051aff69b9bf$var$I18nContext = /*#__PURE__*/ React__default.createContext(null);
42517
+ function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
42518
+ let defaultLocale = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
42519
+ let context = useContext($18f2051aff69b9bf$var$I18nContext);
42520
+ return context || defaultLocale;
42521
+ }
42522
+
42523
+
42524
+
42525
+ let $325a3faab7a68acd$var$cache = new Map();
42526
+ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
42527
+ let { locale: locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
42528
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1
42529
+ ).join() : '');
42530
+ if ($325a3faab7a68acd$var$cache.has(cacheKey)) return $325a3faab7a68acd$var$cache.get(cacheKey);
42531
+ let formatter = new Intl.Collator(locale, options);
42532
+ $325a3faab7a68acd$var$cache.set(cacheKey, formatter);
42533
+ return formatter;
42534
+ }
42535
+
42536
+ function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
42537
+ // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.
42538
+ // On Windows and Ubuntu, Alt + Space has a system wide meaning.
42539
+ return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
42540
+ }
42541
+ function $feb5ffebff200149$export$16792effe837dba3(e) {
42542
+ if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
42543
+ return e.ctrlKey;
42544
+ }
42545
+
42546
+
42547
+
42548
+
42549
+ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
42550
+ let { keyboardDelegate: keyboardDelegate , selectionManager: selectionManager , onTypeSelect: onTypeSelect } = options;
42551
+ let state = useRef({
42552
+ search: '',
42553
+ timeout: null
42554
+ }).current;
42555
+ let onKeyDown = (e)=>{
42556
+ let character = $fb3050f43d946246$var$getStringForKey(e.key);
42557
+ if (!character || e.ctrlKey || e.metaKey) return;
42558
+ // Do not propagate the Spacebar event if it's meant to be part of the search.
42559
+ // When we time out, the search term becomes empty, hence the check on length.
42560
+ // Trimming is to account for the case of pressing the Spacebar more than once,
42561
+ // which should cycle through the selection/deselection of the focused item.
42562
+ if (character === ' ' && state.search.trim().length > 0) {
42563
+ e.preventDefault();
42564
+ if (!('continuePropagation' in e)) e.stopPropagation();
42565
+ }
42566
+ state.search += character;
42567
+ // Use the delegate to find a key to focus.
42568
+ // Prioritize items after the currently focused item, falling back to searching the whole list.
42569
+ let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
42570
+ // If no key found, search from the top.
42571
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
42572
+ if (key != null) {
42573
+ selectionManager.setFocusedKey(key);
42574
+ if (onTypeSelect) onTypeSelect(key);
42575
+ }
42576
+ clearTimeout(state.timeout);
42577
+ state.timeout = setTimeout(()=>{
42578
+ state.search = '';
42579
+ }, 500);
42580
+ };
42581
+ return {
42582
+ typeSelectProps: {
42583
+ // Using a capturing listener to catch the keydown event before
42584
+ // other hooks in order to handle the Spacebar event.
42585
+ onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
42586
+ }
42587
+ };
42588
+ }
42589
+ function $fb3050f43d946246$var$getStringForKey(key) {
42590
+ // If the key is of length 1, it is an ASCII value.
42591
+ // Otherwise, if there are no ASCII characters in the key name,
42592
+ // it is a Unicode character.
42593
+ // See https://www.w3.org/TR/uievents-key/
42594
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
42595
+ return '';
42596
+ }
42597
+
42598
+
42599
+ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
42600
+ let { selectionManager: manager , keyboardDelegate: delegate , ref: ref , autoFocus: autoFocus = false , shouldFocusWrap: shouldFocusWrap = false , disallowEmptySelection: disallowEmptySelection = false , disallowSelectAll: disallowSelectAll = false , selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace' , disallowTypeAhead: disallowTypeAhead = false , shouldUseVirtualFocus: shouldUseVirtualFocus , allowsTabNavigation: allowsTabNavigation = false , isVirtualized: isVirtualized , scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
42601
+ scrollRef = ref } = options;
42602
+ let { direction: direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
42603
+ let onKeyDown = (e)=>{
42604
+ // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
42605
+ if (e.altKey && e.key === 'Tab') e.preventDefault();
42606
+ // Keyboard events bubble through portals. Don't handle keyboard events
42607
+ // for elements outside the collection (e.g. menus).
42608
+ if (!ref.current.contains(e.target)) return;
42609
+ const navigateToKey = (key, childFocus)=>{
42610
+ if (key != null) {
42611
+ manager.setFocusedKey(key, childFocus);
42612
+ if (e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(key);
42613
+ else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
42614
+ }
42615
+ };
42616
+ switch(e.key){
42617
+ case 'ArrowDown':
42618
+ if (delegate.getKeyBelow) {
42619
+ var ref4, ref1;
42620
+ e.preventDefault();
42621
+ let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (ref4 = delegate.getFirstKey) === null || ref4 === void 0 ? void 0 : ref4.call(delegate);
42622
+ if (nextKey == null && shouldFocusWrap) nextKey = (ref1 = delegate.getFirstKey) === null || ref1 === void 0 ? void 0 : ref1.call(delegate, manager.focusedKey);
42623
+ navigateToKey(nextKey);
42624
+ }
42625
+ break;
42626
+ case 'ArrowUp':
42627
+ if (delegate.getKeyAbove) {
42628
+ var ref2, ref3;
42629
+ e.preventDefault();
42630
+ let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (ref2 = delegate.getLastKey) === null || ref2 === void 0 ? void 0 : ref2.call(delegate);
42631
+ if (nextKey == null && shouldFocusWrap) nextKey = (ref3 = delegate.getLastKey) === null || ref3 === void 0 ? void 0 : ref3.call(delegate, manager.focusedKey);
42632
+ navigateToKey(nextKey);
42633
+ }
42634
+ break;
42635
+ case 'ArrowLeft':
42636
+ if (delegate.getKeyLeftOf) {
42637
+ e.preventDefault();
42638
+ let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
42639
+ navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
42640
+ }
42641
+ break;
42642
+ case 'ArrowRight':
42643
+ if (delegate.getKeyRightOf) {
42644
+ e.preventDefault();
42645
+ let nextKey = delegate.getKeyRightOf(manager.focusedKey);
42646
+ navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
42647
+ }
42648
+ break;
42649
+ case 'Home':
42650
+ if (delegate.getFirstKey) {
42651
+ e.preventDefault();
42652
+ let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
42653
+ manager.setFocusedKey(firstKey);
42654
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(firstKey);
42655
+ else if (selectOnFocus) manager.replaceSelection(firstKey);
42656
+ }
42657
+ break;
42658
+ case 'End':
42659
+ if (delegate.getLastKey) {
42660
+ e.preventDefault();
42661
+ let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
42662
+ manager.setFocusedKey(lastKey);
42663
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(lastKey);
42664
+ else if (selectOnFocus) manager.replaceSelection(lastKey);
42665
+ }
42666
+ break;
42667
+ case 'PageDown':
42668
+ if (delegate.getKeyPageBelow) {
42669
+ e.preventDefault();
42670
+ let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
42671
+ navigateToKey(nextKey);
42672
+ }
42673
+ break;
42674
+ case 'PageUp':
42675
+ if (delegate.getKeyPageAbove) {
42676
+ e.preventDefault();
42677
+ let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
42678
+ navigateToKey(nextKey);
42679
+ }
42680
+ break;
42681
+ case 'a':
42682
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {
42683
+ e.preventDefault();
42684
+ manager.selectAll();
42685
+ }
42686
+ break;
42687
+ case 'Escape':
42688
+ e.preventDefault();
42689
+ if (!disallowEmptySelection) manager.clearSelection();
42690
+ break;
42691
+ case 'Tab':
42692
+ if (!allowsTabNavigation) {
42693
+ // There may be elements that are "tabbable" inside a collection (e.g. in a grid cell).
42694
+ // However, collections should be treated as a single tab stop, with arrow key navigation internally.
42695
+ // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.
42696
+ // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element
42697
+ // in the collection, so that the browser default behavior will apply starting from that element
42698
+ // rather than the currently focused one.
42699
+ if (e.shiftKey) ref.current.focus();
42700
+ else {
42701
+ let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
42702
+ tabbable: true
42703
+ });
42704
+ let next;
42705
+ let last;
42706
+ do {
42707
+ last = walker.lastChild();
42708
+ if (last) next = last;
42709
+ }while (last)
42710
+ if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
42711
+ }
42712
+ break;
42713
+ }
42714
+ }
42715
+ };
42716
+ // Store the scroll position so we can restore it later.
42717
+ let scrollPos = useRef({
42718
+ top: 0,
42719
+ left: 0
42720
+ });
42721
+ $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, 'scroll', isVirtualized ? null : ()=>{
42722
+ scrollPos.current = {
42723
+ top: scrollRef.current.scrollTop,
42724
+ left: scrollRef.current.scrollLeft
42725
+ };
42726
+ });
42727
+ let onFocus = (e)=>{
42728
+ if (manager.isFocused) {
42729
+ // If a focus event bubbled through a portal, reset focus state.
42730
+ if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
42731
+ return;
42732
+ }
42733
+ // Focus events can bubble through portals. Ignore these events.
42734
+ if (!e.currentTarget.contains(e.target)) return;
42735
+ manager.setFocused(true);
42736
+ if (manager.focusedKey == null) {
42737
+ let navigateToFirstKey = (key)=>{
42738
+ if (key != null) {
42739
+ manager.setFocusedKey(key);
42740
+ if (selectOnFocus) manager.replaceSelection(key);
42741
+ }
42742
+ };
42743
+ // If the user hasn't yet interacted with the collection, there will be no focusedKey set.
42744
+ // Attempt to detect whether the user is tabbing forward or backward into the collection
42745
+ // and either focus the first or last item accordingly.
42746
+ let relatedTarget = e.relatedTarget;
42747
+ var _lastSelectedKey, _firstSelectedKey;
42748
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_lastSelectedKey = manager.lastSelectedKey) !== null && _lastSelectedKey !== void 0 ? _lastSelectedKey : delegate.getLastKey());
42749
+ else navigateToFirstKey((_firstSelectedKey = manager.firstSelectedKey) !== null && _firstSelectedKey !== void 0 ? _firstSelectedKey : delegate.getFirstKey());
42750
+ } else if (!isVirtualized) {
42751
+ // Restore the scroll position to what it was before.
42752
+ scrollRef.current.scrollTop = scrollPos.current.top;
42753
+ scrollRef.current.scrollLeft = scrollPos.current.left;
42754
+ // Refocus and scroll the focused item into view if it exists within the scrollable region.
42755
+ let element = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
42756
+ if (element) {
42757
+ // This prevents a flash of focus on the first/last element in the collection
42758
+ $7215afc6de606d6b$export$de79e2c695e052f3(element);
42759
+ $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
42760
+ }
42761
+ }
42762
+ };
42763
+ let onBlur = (e)=>{
42764
+ // Don't set blurred and then focused again if moving focus within the collection.
42765
+ if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
42766
+ };
42767
+ const autoFocusRef = useRef(autoFocus);
42768
+ useEffect(()=>{
42769
+ if (autoFocusRef.current) {
42770
+ let focusedKey = null;
42771
+ // Check focus strategy to determine which item to focus
42772
+ if (autoFocus === 'first') focusedKey = delegate.getFirstKey();
42773
+ if (autoFocus === 'last') focusedKey = delegate.getLastKey();
42774
+ // If there are any selected keys, make the first one the new focus target
42775
+ let selectedKeys = manager.selectedKeys;
42776
+ if (selectedKeys.size) focusedKey = selectedKeys.values().next().value;
42777
+ manager.setFocused(true);
42778
+ manager.setFocusedKey(focusedKey);
42779
+ // If no default focus key is selected, focus the collection itself.
42780
+ if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
42781
+ }
42782
+ autoFocusRef.current = false;
42783
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42784
+ }, []);
42785
+ // If not virtualized, scroll the focused element into view when the focusedKey changes.
42786
+ // When virtualized, Virtualizer handles this internally.
42787
+ useEffect(()=>{
42788
+ if (!isVirtualized && manager.focusedKey && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
42789
+ let element = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
42790
+ if (element) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
42791
+ }
42792
+ }, [
42793
+ isVirtualized,
42794
+ scrollRef,
42795
+ manager.focusedKey
42796
+ ]);
42797
+ let handlers = {
42798
+ onKeyDown: onKeyDown,
42799
+ onFocus: onFocus,
42800
+ onBlur: onBlur,
42801
+ onMouseDown (e) {
42802
+ // Ignore events that bubbled through portals.
42803
+ if (e.currentTarget.contains(e.target)) // Prevent focus going to the collection when clicking on the scrollbar.
42804
+ e.preventDefault();
42805
+ }
42806
+ };
42807
+ let { typeSelectProps: typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
42808
+ keyboardDelegate: delegate,
42809
+ selectionManager: manager
42810
+ });
42811
+ if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
42812
+ // If nothing is focused within the collection, make the collection itself tabbable.
42813
+ // This will be marshalled to either the first or last item depending on where focus came from.
42814
+ // If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try
42815
+ // to move real DOM focus to the element anyway.
42816
+ let tabIndex;
42817
+ if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
42818
+ return {
42819
+ collectionProps: {
42820
+ ...handlers,
42821
+ tabIndex: tabIndex
42822
+ }
42823
+ };
42824
+ }
42825
+
42826
+
42827
+
42828
+
42829
+
42830
+
42831
+
42832
+ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
42833
+ let { selectionManager: manager , key: key , ref: ref , shouldSelectOnPressUp: shouldSelectOnPressUp , isVirtualized: isVirtualized , shouldUseVirtualFocus: shouldUseVirtualFocus , focus: focus , isDisabled: isDisabled , onAction: onAction , allowsDifferentPressOrigin: allowsDifferentPressOrigin } = options;
42834
+ let onSelect = (e)=>{
42835
+ if (e.pointerType === 'keyboard' && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
42836
+ else {
42837
+ if (manager.selectionMode === 'none') return;
42838
+ if (manager.selectionMode === 'single') {
42839
+ if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
42840
+ else manager.replaceSelection(key);
42841
+ } else if (e && e.shiftKey) manager.extendSelection(key);
42842
+ else if (manager.selectionBehavior === 'toggle' || e && ($feb5ffebff200149$export$16792effe837dba3(e) || e.pointerType === 'touch' || e.pointerType === 'virtual')) // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys
42843
+ manager.toggleSelection(key);
42844
+ else manager.replaceSelection(key);
42845
+ }
42846
+ };
42847
+ // Focus the associated DOM node when this item becomes the focusedKey
42848
+ useEffect(()=>{
42849
+ let isFocused = key === manager.focusedKey;
42850
+ if (isFocused && manager.isFocused && !shouldUseVirtualFocus && document.activeElement !== ref.current) {
42851
+ if (focus) focus();
42852
+ else $6a99195332edec8b$export$80f3e147d781571c(ref.current);
42853
+ }
42854
+ }, [
42855
+ ref,
42856
+ key,
42857
+ manager.focusedKey,
42858
+ manager.childFocusStrategy,
42859
+ manager.isFocused,
42860
+ shouldUseVirtualFocus
42861
+ ]);
42862
+ // Set tabIndex to 0 if the element is focused, or -1 otherwise so that only the last focused
42863
+ // item is tabbable. If using virtual focus, don't set a tabIndex at all so that VoiceOver
42864
+ // on iOS 14 doesn't try to move real DOM focus to the item anyway.
42865
+ let itemProps = {
42866
+ };
42867
+ if (!shouldUseVirtualFocus) itemProps = {
42868
+ tabIndex: key === manager.focusedKey ? 0 : -1,
42869
+ onFocus (e) {
42870
+ if (e.target === ref.current) manager.setFocusedKey(key);
42871
+ }
42872
+ };
42873
+ // With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
42874
+ // Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
42875
+ // With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
42876
+ // With touch, onAction occurs on single tap, and long press enters selection mode.
42877
+ isDisabled = isDisabled || manager.isDisabled(key);
42878
+ let allowsSelection = !isDisabled && manager.canSelectItem(key);
42879
+ let allowsActions = onAction && !isDisabled;
42880
+ let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : manager.isEmpty);
42881
+ let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
42882
+ let hasAction = hasPrimaryAction || hasSecondaryAction;
42883
+ let modality = useRef(null);
42884
+ let longPressEnabled = hasAction && allowsSelection;
42885
+ let longPressEnabledOnPressStart = useRef(false);
42886
+ let hadPrimaryActionOnPressStart = useRef(false);
42887
+ // By default, selection occurs on pointer down. This can be strange if selecting an
42888
+ // item causes the UI to disappear immediately (e.g. menus).
42889
+ // If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.
42890
+ // onPress requires a pointer down event on the same element as pointer up. For menus,
42891
+ // we want to be able to have the pointer down on the trigger that opens the menu and
42892
+ // the pointer up on the menu item rather than requiring a separate press.
42893
+ // For keyboard events, selection still occurs on key down.
42894
+ let itemPressProps = {
42895
+ };
42896
+ if (shouldSelectOnPressUp) {
42897
+ itemPressProps.onPressStart = (e)=>{
42898
+ modality.current = e.pointerType;
42899
+ longPressEnabledOnPressStart.current = longPressEnabled;
42900
+ if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
42901
+ };
42902
+ // If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
42903
+ // Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
42904
+ if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
42905
+ if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
42906
+ if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
42907
+ onAction();
42908
+ } else if (e.pointerType !== 'keyboard') onSelect(e);
42909
+ };
42910
+ else {
42911
+ itemPressProps.onPressUp = (e)=>{
42912
+ if (e.pointerType !== 'keyboard') onSelect(e);
42913
+ };
42914
+ itemPressProps.onPress = hasPrimaryAction ? ()=>onAction()
42915
+ : null;
42916
+ }
42917
+ } else {
42918
+ itemPressProps.onPressStart = (e)=>{
42919
+ modality.current = e.pointerType;
42920
+ longPressEnabledOnPressStart.current = longPressEnabled;
42921
+ hadPrimaryActionOnPressStart.current = hasPrimaryAction;
42922
+ // Select on mouse down unless there is a primary action which will occur on mouse up.
42923
+ // For keyboard, select on key down. If there is an action, the Space key selects on key down,
42924
+ // and the Enter key performs onAction on key up.
42925
+ if (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!onAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
42926
+ };
42927
+ itemPressProps.onPress = (e)=>{
42928
+ // Selection occurs on touch up. Primary actions always occur on pointer up.
42929
+ // Both primary and secondary actions occur on Enter key up. The only exception
42930
+ // is secondary actions, which occur on double click with a mouse.
42931
+ if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
42932
+ if (hasAction) onAction();
42933
+ else onSelect(e);
42934
+ }
42935
+ };
42936
+ }
42937
+ if (!isVirtualized) itemProps['data-key'] = key;
42938
+ itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
42939
+ let { pressProps: pressProps , isPressed: isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
42940
+ // Double clicking with a mouse with selectionBehavior = 'replace' performs an action.
42941
+ let onDoubleClick = hasSecondaryAction ? (e)=>{
42942
+ if (modality.current === 'mouse') {
42943
+ e.stopPropagation();
42944
+ e.preventDefault();
42945
+ onAction();
42946
+ }
42947
+ } : undefined;
42948
+ // Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior
42949
+ // to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to
42950
+ // selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.
42951
+ let { longPressProps: longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
42952
+ isDisabled: !longPressEnabled,
42953
+ onLongPress (e) {
42954
+ if (e.pointerType === 'touch') {
42955
+ onSelect(e);
42956
+ manager.setSelectionBehavior('toggle');
42957
+ }
42958
+ }
42959
+ });
42960
+ // Prevent native drag and drop on long press if we also select on long press.
42961
+ // Once the user is in selection mode, they can long press again to drag.
42962
+ let onDragStart = (e)=>{
42963
+ if (modality.current === 'touch' && longPressEnabledOnPressStart.current) e.preventDefault();
42964
+ };
42965
+ return {
42966
+ itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {
42967
+ }, longPressEnabled ? longPressProps : {
42968
+ }, {
42969
+ onDoubleClick: onDoubleClick,
42970
+ onDragStart: onDragStart
42971
+ }),
42972
+ isPressed: isPressed,
42973
+ isSelected: manager.isSelected(key),
42974
+ isDisabled: isDisabled,
42975
+ allowsSelection: allowsSelection,
42976
+ hasAction: hasAction
42977
+ };
42978
+ }
42979
+ function $880e95eb8b93ba9a$var$isActionKey() {
42980
+ let event = window.event;
42981
+ return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
42982
+ }
42983
+ function $880e95eb8b93ba9a$var$isSelectionKey() {
42984
+ let event = window.event;
42985
+ return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
42986
+ }
42987
+
42988
+
42989
+
42990
+ class $2a25aae57d74318e$export$a05409b8bb224a5a {
42991
+ getKeyBelow(key) {
42992
+ key = this.collection.getKeyAfter(key);
42993
+ while(key != null){
42994
+ let item = this.collection.getItem(key);
42995
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
42996
+ key = this.collection.getKeyAfter(key);
42997
+ }
42998
+ }
42999
+ getKeyAbove(key) {
43000
+ key = this.collection.getKeyBefore(key);
43001
+ while(key != null){
43002
+ let item = this.collection.getItem(key);
43003
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43004
+ key = this.collection.getKeyBefore(key);
43005
+ }
43006
+ }
43007
+ getFirstKey() {
43008
+ let key = this.collection.getFirstKey();
43009
+ while(key != null){
43010
+ let item = this.collection.getItem(key);
43011
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43012
+ key = this.collection.getKeyAfter(key);
43013
+ }
43014
+ }
43015
+ getLastKey() {
43016
+ let key = this.collection.getLastKey();
43017
+ while(key != null){
43018
+ let item = this.collection.getItem(key);
43019
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43020
+ key = this.collection.getKeyBefore(key);
43021
+ }
43022
+ }
43023
+ getItem(key) {
43024
+ return this.ref.current.querySelector(`[data-key="${key}"]`);
43025
+ }
43026
+ getKeyPageAbove(key) {
43027
+ let menu = this.ref.current;
43028
+ let item = this.getItem(key);
43029
+ if (!item) return null;
43030
+ let pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);
43031
+ while(item && item.offsetTop > pageY){
43032
+ key = this.getKeyAbove(key);
43033
+ item = this.getItem(key);
43034
+ }
43035
+ return key;
43036
+ }
43037
+ getKeyPageBelow(key) {
43038
+ let menu = this.ref.current;
43039
+ let item = this.getItem(key);
43040
+ if (!item) return null;
43041
+ let pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);
43042
+ while(item && item.offsetTop < pageY){
43043
+ key = this.getKeyBelow(key);
43044
+ item = this.getItem(key);
43045
+ }
43046
+ return key;
43047
+ }
43048
+ getKeyForSearch(search, fromKey) {
43049
+ if (!this.collator) return null;
43050
+ let collection = this.collection;
43051
+ let key = fromKey || this.getFirstKey();
43052
+ while(key != null){
43053
+ let item = collection.getItem(key);
43054
+ let substring = item.textValue.slice(0, search.length);
43055
+ if (item.textValue && this.collator.compare(substring, search) === 0) return key;
43056
+ key = this.getKeyBelow(key);
43057
+ }
43058
+ return null;
43059
+ }
43060
+ constructor(collection, disabledKeys, ref, collator){
43061
+ this.collection = collection;
43062
+ this.disabledKeys = disabledKeys;
43063
+ this.ref = ref;
43064
+ this.collator = collator;
43065
+ }
43066
+ }
43067
+
43068
+
43069
+
43070
+
43071
+ function $982254629710d113$export$b95089534ab7c1fd(props) {
43072
+ let { selectionManager: selectionManager , collection: collection , disabledKeys: disabledKeys , ref: ref , keyboardDelegate: keyboardDelegate , autoFocus: autoFocus , shouldFocusWrap: shouldFocusWrap , isVirtualized: isVirtualized , disallowEmptySelection: disallowEmptySelection , selectOnFocus: selectOnFocus = selectionManager.selectionBehavior === 'replace' , disallowTypeAhead: disallowTypeAhead , shouldUseVirtualFocus: shouldUseVirtualFocus , allowsTabNavigation: allowsTabNavigation } = props;
43073
+ // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
43074
+ // When virtualized, the layout object will be passed in as a prop and override this.
43075
+ let collator = $325a3faab7a68acd$export$a16aca283550c30d({
43076
+ usage: 'search',
43077
+ sensitivity: 'base'
43078
+ });
43079
+ let delegate = useMemo(()=>keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a(collection, disabledKeys, ref, collator)
43080
+ , [
43081
+ keyboardDelegate,
43082
+ collection,
43083
+ disabledKeys,
43084
+ ref,
43085
+ collator
43086
+ ]);
43087
+ let { collectionProps: collectionProps } = $ae20dd8cbca75726$export$d6daf82dcd84e87c({
43088
+ ref: ref,
43089
+ selectionManager: selectionManager,
43090
+ keyboardDelegate: delegate,
43091
+ autoFocus: autoFocus,
43092
+ shouldFocusWrap: shouldFocusWrap,
43093
+ disallowEmptySelection: disallowEmptySelection,
43094
+ selectOnFocus: selectOnFocus,
43095
+ disallowTypeAhead: disallowTypeAhead,
43096
+ shouldUseVirtualFocus: shouldUseVirtualFocus,
43097
+ allowsTabNavigation: allowsTabNavigation,
43098
+ isVirtualized: isVirtualized,
43099
+ scrollRef: ref
43100
+ });
43101
+ return {
43102
+ listProps: collectionProps
43103
+ };
43104
+ }
43105
+
43106
+ const $b1f0cad8af73213b$export$3585ede4d035bf14 = new WeakMap();
43107
+ function $b1f0cad8af73213b$var$normalizeKey(key) {
43108
+ if (typeof key === 'string') return key.replace(/\s*/g, '');
43109
+ return '' + key;
43110
+ }
43111
+ function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
43112
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
43113
+ if (!data) throw new Error('Unknown list');
43114
+ return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
43115
+ }
43116
+
43117
+
43118
+
43119
+
43120
+
43121
+
43122
+ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
43123
+ let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
43124
+ labelable: true
43125
+ });
43126
+ let { listProps: listProps } = $982254629710d113$export$b95089534ab7c1fd({
43127
+ ...props,
43128
+ ref: ref,
43129
+ selectionManager: state.selectionManager,
43130
+ collection: state.collection,
43131
+ disabledKeys: state.disabledKeys
43132
+ });
43133
+ let { focusWithinProps: focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
43134
+ onFocusWithin: props.onFocus,
43135
+ onBlurWithin: props.onBlur,
43136
+ onFocusWithinChange: props.onFocusChange
43137
+ });
43138
+ // Share list id and some props with child options.
43139
+ let id = $bdb11010cef70236$export$f680877a34711e37(props.id);
43140
+ $b1f0cad8af73213b$export$3585ede4d035bf14.set(state, {
43141
+ id: id,
43142
+ shouldUseVirtualFocus: props.shouldUseVirtualFocus,
43143
+ shouldSelectOnPressUp: props.shouldSelectOnPressUp,
43144
+ shouldFocusOnHover: props.shouldFocusOnHover,
43145
+ isVirtualized: props.isVirtualized
43146
+ });
43147
+ let { labelProps: labelProps , fieldProps: fieldProps } = $d191a55c9702f145$export$8467354a121f1b9f({
43148
+ ...props,
43149
+ id: id,
43150
+ // listbox is not an HTML input element so it
43151
+ // shouldn't be labeled by a <label> element.
43152
+ labelElementType: 'span'
43153
+ });
43154
+ return {
43155
+ labelProps: labelProps,
43156
+ listBoxProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
43157
+ 'aria-multiselectable': 'true'
43158
+ } : {
43159
+ }, {
43160
+ role: 'listbox',
43161
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(fieldProps, listProps)
43162
+ })
43163
+ };
43164
+ }
43165
+
43166
+
43167
+
43168
+
43169
+
43170
+
43171
+
43172
+ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
43173
+ let { key: key } = props;
43174
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
43175
+ var _isDisabled;
43176
+ let isDisabled = (_isDisabled = props.isDisabled) !== null && _isDisabled !== void 0 ? _isDisabled : state.disabledKeys.has(key);
43177
+ var _isSelected;
43178
+ let isSelected = (_isSelected = props.isSelected) !== null && _isSelected !== void 0 ? _isSelected : state.selectionManager.isSelected(key);
43179
+ let isFocused = state.selectionManager.focusedKey === key;
43180
+ var _shouldSelectOnPressUp;
43181
+ let shouldSelectOnPressUp = (_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _shouldSelectOnPressUp !== void 0 ? _shouldSelectOnPressUp : data.shouldSelectOnPressUp;
43182
+ var _shouldFocusOnHover;
43183
+ let shouldFocusOnHover = (_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _shouldFocusOnHover !== void 0 ? _shouldFocusOnHover : data.shouldFocusOnHover;
43184
+ var _shouldUseVirtualFocus;
43185
+ let shouldUseVirtualFocus = (_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _shouldUseVirtualFocus !== void 0 ? _shouldUseVirtualFocus : data.shouldUseVirtualFocus;
43186
+ var _isVirtualized;
43187
+ let isVirtualized = (_isVirtualized = props.isVirtualized) !== null && _isVirtualized !== void 0 ? _isVirtualized : data.isVirtualized;
43188
+ let labelId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
43189
+ let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
43190
+ let optionProps = {
43191
+ role: 'option',
43192
+ 'aria-disabled': isDisabled,
43193
+ 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined
43194
+ };
43195
+ // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text".
43196
+ // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.
43197
+ // https://bugs.webkit.org/show_bug.cgi?id=209279
43198
+ if (!($c87311424ea30a05$export$9ac100e40613ea10() && $c87311424ea30a05$export$78551043582a6a98())) {
43199
+ optionProps['aria-label'] = props['aria-label'];
43200
+ optionProps['aria-labelledby'] = labelId;
43201
+ optionProps['aria-describedby'] = descriptionId;
43202
+ }
43203
+ if (isVirtualized) {
43204
+ optionProps['aria-posinset'] = state.collection.getItem(key).index + 1;
43205
+ optionProps['aria-setsize'] = $453cc9f0df89c0a5$export$77d5aafae4e095b2(state.collection);
43206
+ }
43207
+ let { itemProps: itemProps , isPressed: isPressed } = $880e95eb8b93ba9a$export$ecf600387e221c37({
43208
+ selectionManager: state.selectionManager,
43209
+ key: key,
43210
+ ref: ref,
43211
+ shouldSelectOnPressUp: shouldSelectOnPressUp,
43212
+ allowsDifferentPressOrigin: shouldSelectOnPressUp,
43213
+ isVirtualized: isVirtualized,
43214
+ shouldUseVirtualFocus: shouldUseVirtualFocus,
43215
+ isDisabled: isDisabled
43216
+ });
43217
+ let { hoverProps: hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
43218
+ isDisabled: isDisabled || !shouldFocusOnHover,
43219
+ onHoverStart () {
43220
+ if (!$507fabe10e71c6fb$export$b9b3dfddab17db27()) {
43221
+ state.selectionManager.setFocused(true);
43222
+ state.selectionManager.setFocusedKey(key);
43223
+ }
43224
+ }
43225
+ });
43226
+ return {
43227
+ optionProps: {
43228
+ ...optionProps,
43229
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, hoverProps),
43230
+ id: $b1f0cad8af73213b$export$9145995848b05025(state, key)
43231
+ },
43232
+ labelProps: {
43233
+ id: labelId
43234
+ },
43235
+ descriptionProps: {
43236
+ id: descriptionId
43237
+ },
43238
+ isFocused: isFocused,
43239
+ isSelected: isSelected,
43240
+ isDisabled: isDisabled,
43241
+ isPressed: isPressed
43242
+ };
43243
+ }
43244
+
43245
+ function LuiListBoxItem({ node, state, renderer, }) {
43246
+ const ref = useRef(null);
43247
+ const { optionProps, isSelected, isDisabled } = $293f70390ea03370$export$497855f14858aa34({ key: node.key }, state, ref);
43248
+ const { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
43249
+ return (React__default.createElement("li", { ref: ref, ...$3ef42575df84b30b$export$9d1611c77c2fe928(optionProps, focusProps), className: clsx('LuiListBoxItem', isSelected && 'LuiListBoxItem-selected', isDisabled && 'LuiListBoxItem-disabled') }, renderer
43250
+ ? renderer({ item: node.value, isDisabled, isSelected, isFocusVisible })
43251
+ : node.rendered));
43252
+ }
43253
+
43254
+ function DefaultItemRenderer({ item, }) {
43255
+ if (!item.hasOwnProperty('label')) {
43256
+ throw Error('Could not find `label` property on item, please provide a custom `itemRenderer`');
43257
+ }
43258
+ return React__default.createElement(React__default.Fragment, null, item.label);
43259
+ }
43260
+
43261
+ class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
43262
+ constructor(keys, anchorKey, currentKey){
43263
+ super(keys);
43264
+ if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
43265
+ this.anchorKey = anchorKey || keys.anchorKey;
43266
+ this.currentKey = currentKey || keys.currentKey;
43267
+ } else {
43268
+ this.anchorKey = anchorKey;
43269
+ this.currentKey = currentKey;
43270
+ }
43271
+ }
43272
+ }
43273
+
43274
+
43275
+
43276
+ function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
43277
+ if (setA.size !== setB.size) return false;
43278
+ for (let item of setA){
43279
+ if (!setB.has(item)) return false;
43280
+ }
43281
+ return true;
43282
+ }
43283
+ function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
43284
+ let { selectionMode: selectionMode = 'none' , disallowEmptySelection: disallowEmptySelection , allowDuplicateSelectionEvents: allowDuplicateSelectionEvents , selectionBehavior: selectionBehaviorProp = 'toggle' , disabledBehavior: disabledBehavior = 'all' } = props;
43285
+ // We want synchronous updates to `isFocused` and `focusedKey` after their setters are called.
43286
+ // But we also need to trigger a react re-render. So, we have both a ref (sync) and state (async).
43287
+ let isFocusedRef = useRef(false);
43288
+ let [, setFocused] = useState(false);
43289
+ let focusedKeyRef = useRef(null);
43290
+ let childFocusStrategyRef = useRef(null);
43291
+ let [, setFocusedKey] = useState(null);
43292
+ let selectedKeysProp = useMemo(()=>$7af3f5b51489e0b5$var$convertSelection(props.selectedKeys)
43293
+ , [
43294
+ props.selectedKeys
43295
+ ]);
43296
+ let defaultSelectedKeys = useMemo(()=>$7af3f5b51489e0b5$var$convertSelection(props.defaultSelectedKeys, new $e40ea825a81a3709$export$52baac22726c72bf())
43297
+ , [
43298
+ props.defaultSelectedKeys
43299
+ ]);
43300
+ let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
43301
+ let disabledKeysProp = useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
43302
+ , [
43303
+ props.disabledKeys
43304
+ ]);
43305
+ let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
43306
+ // If the selectionBehavior prop is set to replace, but the current state is toggle (e.g. due to long press
43307
+ // to enter selection mode on touch), and the selection becomes empty, reset the selection behavior.
43308
+ if (selectionBehaviorProp === 'replace' && selectionBehavior === 'toggle' && typeof selectedKeys === 'object' && selectedKeys.size === 0) setSelectionBehavior('replace');
43309
+ // If the selectionBehavior prop changes, update the state as well.
43310
+ let lastSelectionBehavior = useRef(selectionBehaviorProp);
43311
+ useEffect(()=>{
43312
+ if (selectionBehaviorProp !== lastSelectionBehavior.current) {
43313
+ setSelectionBehavior(selectionBehaviorProp);
43314
+ lastSelectionBehavior.current = selectionBehaviorProp;
43315
+ }
43316
+ }, [
43317
+ selectionBehaviorProp
43318
+ ]);
43319
+ return {
43320
+ selectionMode: selectionMode,
43321
+ disallowEmptySelection: disallowEmptySelection,
43322
+ selectionBehavior: selectionBehavior,
43323
+ setSelectionBehavior: setSelectionBehavior,
43324
+ get isFocused () {
43325
+ return isFocusedRef.current;
43326
+ },
43327
+ setFocused (f) {
43328
+ isFocusedRef.current = f;
43329
+ setFocused(f);
43330
+ },
43331
+ get focusedKey () {
43332
+ return focusedKeyRef.current;
43333
+ },
43334
+ get childFocusStrategy () {
43335
+ return childFocusStrategyRef.current;
43336
+ },
43337
+ setFocusedKey (k, childFocusStrategy = 'first') {
43338
+ focusedKeyRef.current = k;
43339
+ childFocusStrategyRef.current = childFocusStrategy;
43340
+ setFocusedKey(k);
43341
+ },
43342
+ selectedKeys: selectedKeys,
43343
+ setSelectedKeys (keys) {
43344
+ if (allowDuplicateSelectionEvents || !$7af3f5b51489e0b5$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
43345
+ },
43346
+ disabledKeys: disabledKeysProp,
43347
+ disabledBehavior: disabledBehavior
43348
+ };
43349
+ }
43350
+ function $7af3f5b51489e0b5$var$convertSelection(selection, defaultValue) {
43351
+ if (!selection) return defaultValue;
43352
+ return selection === 'all' ? 'all' : new $e40ea825a81a3709$export$52baac22726c72bf(selection);
43353
+ }
43354
+
43355
+
43356
+
43357
+ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
43358
+ /**
43359
+ * The type of selection that is allowed in the collection.
43360
+ */ get selectionMode() {
43361
+ return this.state.selectionMode;
43362
+ }
43363
+ /**
43364
+ * Whether the collection allows empty selection.
43365
+ */ get disallowEmptySelection() {
43366
+ return this.state.disallowEmptySelection;
43367
+ }
43368
+ /**
43369
+ * The selection behavior for the collection.
43370
+ */ get selectionBehavior() {
43371
+ return this.state.selectionBehavior;
43372
+ }
43373
+ /**
43374
+ * Sets the selection behavior for the collection.
43375
+ */ setSelectionBehavior(selectionBehavior) {
43376
+ this.state.setSelectionBehavior(selectionBehavior);
43377
+ }
43378
+ /**
43379
+ * Whether the collection is currently focused.
43380
+ */ get isFocused() {
43381
+ return this.state.isFocused;
43382
+ }
43383
+ /**
43384
+ * Sets whether the collection is focused.
43385
+ */ setFocused(isFocused) {
43386
+ this.state.setFocused(isFocused);
43387
+ }
43388
+ /**
43389
+ * The current focused key in the collection.
43390
+ */ get focusedKey() {
43391
+ return this.state.focusedKey;
43392
+ }
43393
+ /** Whether the first or last child of the focused key should receive focus. */ get childFocusStrategy() {
43394
+ return this.state.childFocusStrategy;
43395
+ }
43396
+ /**
43397
+ * Sets the focused key.
43398
+ */ setFocusedKey(key, childFocusStrategy) {
43399
+ this.state.setFocusedKey(key, childFocusStrategy);
43400
+ }
43401
+ /**
43402
+ * The currently selected keys in the collection.
43403
+ */ get selectedKeys() {
43404
+ return this.state.selectedKeys === 'all' ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
43405
+ }
43406
+ /**
43407
+ * The raw selection value for the collection.
43408
+ * Either 'all' for select all, or a set of keys.
43409
+ */ get rawSelection() {
43410
+ return this.state.selectedKeys;
43411
+ }
43412
+ /**
43413
+ * Returns whether a key is selected.
43414
+ */ isSelected(key) {
43415
+ if (this.state.selectionMode === 'none') return false;
43416
+ key = this.getKey(key);
43417
+ return this.state.selectedKeys === 'all' ? this.canSelectItem(key) : this.state.selectedKeys.has(key);
43418
+ }
43419
+ /**
43420
+ * Whether the selection is empty.
43421
+ */ get isEmpty() {
43422
+ return this.state.selectedKeys !== 'all' && this.state.selectedKeys.size === 0;
43423
+ }
43424
+ /**
43425
+ * Whether all items in the collection are selected.
43426
+ */ get isSelectAll() {
43427
+ if (this.isEmpty) return false;
43428
+ if (this.state.selectedKeys === 'all') return true;
43429
+ if (this._isSelectAll != null) return this._isSelectAll;
43430
+ let allKeys = this.getSelectAllKeys();
43431
+ let selectedKeys = this.state.selectedKeys;
43432
+ this._isSelectAll = allKeys.every((k)=>selectedKeys.has(k)
43433
+ );
43434
+ return this._isSelectAll;
43435
+ }
43436
+ get firstSelectedKey() {
43437
+ let first = null;
43438
+ for (let key of this.state.selectedKeys){
43439
+ let item = this.collection.getItem(key);
43440
+ if (!first || (item === null || item === void 0 ? void 0 : item.index) < first.index) first = item;
43441
+ }
43442
+ return first === null || first === void 0 ? void 0 : first.key;
43443
+ }
43444
+ get lastSelectedKey() {
43445
+ let last = null;
43446
+ for (let key of this.state.selectedKeys){
43447
+ let item = this.collection.getItem(key);
43448
+ if (!last || (item === null || item === void 0 ? void 0 : item.index) > last.index) last = item;
43449
+ }
43450
+ return last === null || last === void 0 ? void 0 : last.key;
43451
+ }
43452
+ get disabledKeys() {
43453
+ return this.state.disabledKeys;
43454
+ }
43455
+ get disabledBehavior() {
43456
+ return this.state.disabledBehavior;
43457
+ }
43458
+ /**
43459
+ * Extends the selection to the given key.
43460
+ */ extendSelection(toKey) {
43461
+ if (this.selectionMode === 'none') return;
43462
+ if (this.selectionMode === 'single') {
43463
+ this.replaceSelection(toKey);
43464
+ return;
43465
+ }
43466
+ toKey = this.getKey(toKey);
43467
+ let selection;
43468
+ // Only select the one key if coming from a select all.
43469
+ if (this.state.selectedKeys === 'all') selection = new $e40ea825a81a3709$export$52baac22726c72bf([
43470
+ toKey
43471
+ ], toKey, toKey);
43472
+ else {
43473
+ let selectedKeys = this.state.selectedKeys;
43474
+ let anchorKey = selectedKeys.anchorKey || toKey;
43475
+ selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, toKey);
43476
+ for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey || toKey))selection.delete(key);
43477
+ for (let key1 of this.getKeyRange(toKey, anchorKey))if (this.canSelectItem(key1)) selection.add(key1);
43478
+ }
43479
+ this.state.setSelectedKeys(selection);
43480
+ }
43481
+ getKeyRange(from, to) {
43482
+ let fromItem = this.collection.getItem(from);
43483
+ let toItem = this.collection.getItem(to);
43484
+ if (fromItem && toItem) {
43485
+ if (fromItem.index <= toItem.index) return this.getKeyRangeInternal(from, to);
43486
+ return this.getKeyRangeInternal(to, from);
43487
+ }
43488
+ return [];
43489
+ }
43490
+ getKeyRangeInternal(from, to) {
43491
+ let keys = [];
43492
+ let key = from;
43493
+ while(key){
43494
+ let item = this.collection.getItem(key);
43495
+ if (item && item.type === 'item' || item.type === 'cell' && this.allowsCellSelection) keys.push(key);
43496
+ if (key === to) return keys;
43497
+ key = this.collection.getKeyAfter(key);
43498
+ }
43499
+ return [];
43500
+ }
43501
+ getKey(key) {
43502
+ let item = this.collection.getItem(key);
43503
+ if (!item) // ¯\_(ツ)_/¯
43504
+ return key;
43505
+ // If cell selection is allowed, just return the key.
43506
+ if (item.type === 'cell' && this.allowsCellSelection) return key;
43507
+ // Find a parent item to select
43508
+ while(item.type !== 'item' && item.parentKey != null)item = this.collection.getItem(item.parentKey);
43509
+ if (!item || item.type !== 'item') return null;
43510
+ return item.key;
43511
+ }
43512
+ /**
43513
+ * Toggles whether the given key is selected.
43514
+ */ toggleSelection(key) {
43515
+ if (this.selectionMode === 'none') return;
43516
+ if (this.selectionMode === 'single' && !this.isSelected(key)) {
43517
+ this.replaceSelection(key);
43518
+ return;
43519
+ }
43520
+ key = this.getKey(key);
43521
+ if (key == null) return;
43522
+ let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === 'all' ? this.getSelectAllKeys() : this.state.selectedKeys);
43523
+ if (keys.has(key)) keys.delete(key);
43524
+ else if (this.canSelectItem(key)) {
43525
+ keys.add(key);
43526
+ keys.anchorKey = key;
43527
+ keys.currentKey = key;
43528
+ }
43529
+ if (this.disallowEmptySelection && keys.size === 0) return;
43530
+ this.state.setSelectedKeys(keys);
43531
+ }
43532
+ /**
43533
+ * Replaces the selection with only the given key.
43534
+ */ replaceSelection(key) {
43535
+ if (this.selectionMode === 'none') return;
43536
+ key = this.getKey(key);
43537
+ if (key == null) return;
43538
+ let selection = this.canSelectItem(key) ? new $e40ea825a81a3709$export$52baac22726c72bf([
43539
+ key
43540
+ ], key, key) : new $e40ea825a81a3709$export$52baac22726c72bf();
43541
+ this.state.setSelectedKeys(selection);
43542
+ }
43543
+ /**
43544
+ * Replaces the selection with the given keys.
43545
+ */ setSelectedKeys(keys) {
43546
+ if (this.selectionMode === 'none') return;
43547
+ let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
43548
+ for (let key of keys){
43549
+ key = this.getKey(key);
43550
+ if (key != null) {
43551
+ selection.add(key);
43552
+ if (this.selectionMode === 'single') break;
43553
+ }
43554
+ }
43555
+ this.state.setSelectedKeys(selection);
43556
+ }
43557
+ getSelectAllKeys() {
43558
+ let keys = [];
43559
+ let addKeys = (key)=>{
43560
+ while(key){
43561
+ if (this.canSelectItem(key)) {
43562
+ let item = this.collection.getItem(key);
43563
+ if (item.type === 'item') keys.push(key);
43564
+ // Add child keys. If cell selection is allowed, then include item children too.
43565
+ if (item.hasChildNodes && (this.allowsCellSelection || item.type !== 'item')) addKeys([
43566
+ ...item.childNodes
43567
+ ][0].key);
43568
+ }
43569
+ key = this.collection.getKeyAfter(key);
43570
+ }
43571
+ };
43572
+ addKeys(this.collection.getFirstKey());
43573
+ return keys;
43574
+ }
43575
+ /**
43576
+ * Selects all items in the collection.
43577
+ */ selectAll() {
43578
+ if (this.selectionMode === 'multiple') this.state.setSelectedKeys('all');
43579
+ }
43580
+ /**
43581
+ * Removes all keys from the selection.
43582
+ */ clearSelection() {
43583
+ if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $e40ea825a81a3709$export$52baac22726c72bf());
43584
+ }
43585
+ /**
43586
+ * Toggles between select all and an empty selection.
43587
+ */ toggleSelectAll() {
43588
+ if (this.isSelectAll) this.clearSelection();
43589
+ else this.selectAll();
43590
+ }
43591
+ select(key, e) {
43592
+ if (this.selectionMode === 'none') return;
43593
+ if (this.selectionMode === 'single') {
43594
+ if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
43595
+ else this.replaceSelection(key);
43596
+ } else if (this.selectionBehavior === 'toggle' || e && (e.pointerType === 'touch' || e.pointerType === 'virtual')) // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys
43597
+ this.toggleSelection(key);
43598
+ else this.replaceSelection(key);
43599
+ }
43600
+ /**
43601
+ * Returns whether the current selection is equal to the given selection.
43602
+ */ isSelectionEqual(selection) {
43603
+ if (selection === this.state.selectedKeys) return true;
43604
+ // Check if the set of keys match.
43605
+ let selectedKeys = this.selectedKeys;
43606
+ if (selection.size !== selectedKeys.size) return false;
43607
+ for (let key of selection){
43608
+ if (!selectedKeys.has(key)) return false;
43609
+ }
43610
+ for (let key2 of selectedKeys){
43611
+ if (!selection.has(key2)) return false;
43612
+ }
43613
+ return true;
43614
+ }
43615
+ canSelectItem(key) {
43616
+ if (this.state.selectionMode === 'none' || this.state.disabledKeys.has(key)) return false;
43617
+ let item = this.collection.getItem(key);
43618
+ if (!item || item.type === 'cell' && !this.allowsCellSelection) return false;
43619
+ return true;
43620
+ }
43621
+ isDisabled(key) {
43622
+ return this.state.disabledKeys.has(key) && this.state.disabledBehavior === 'all';
43623
+ }
43624
+ constructor(collection, state, options){
43625
+ this.collection = collection;
43626
+ this.state = state;
43627
+ var ref;
43628
+ this.allowsCellSelection = (ref = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && ref !== void 0 ? ref : false;
43629
+ this._isSelectAll = null;
43630
+ }
43631
+ }
43632
+
43633
+ var tmp = Symbol.iterator;
43634
+ class $a02d57049d202695$export$d085fb9e920b5ca7 {
43635
+ *[tmp]() {
43636
+ yield* this.iterable;
43637
+ }
43638
+ get size() {
43639
+ return this.keyMap.size;
43640
+ }
43641
+ getKeys() {
43642
+ return this.keyMap.keys();
43643
+ }
43644
+ getKeyBefore(key) {
43645
+ let node = this.keyMap.get(key);
43646
+ return node ? node.prevKey : null;
43647
+ }
43648
+ getKeyAfter(key) {
43649
+ let node = this.keyMap.get(key);
43650
+ return node ? node.nextKey : null;
43651
+ }
43652
+ getFirstKey() {
43653
+ return this.firstKey;
43654
+ }
43655
+ getLastKey() {
43656
+ return this.lastKey;
43657
+ }
43658
+ getItem(key) {
43659
+ return this.keyMap.get(key);
43660
+ }
43661
+ at(idx) {
43662
+ const keys = [
43663
+ ...this.getKeys()
43664
+ ];
43665
+ return this.getItem(keys[idx]);
43666
+ }
43667
+ constructor(nodes){
43668
+ this.keyMap = new Map();
43669
+ this.iterable = nodes;
43670
+ let visit = (node)=>{
43671
+ this.keyMap.set(node.key, node);
43672
+ if (node.childNodes && node.type === 'section') for (let child of node.childNodes)visit(child);
43673
+ };
43674
+ for (let node2 of nodes)visit(node2);
43675
+ let last;
43676
+ let index = 0;
43677
+ for (let [key, node1] of this.keyMap){
43678
+ if (last) {
43679
+ last.nextKey = key;
43680
+ node1.prevKey = last.key;
43681
+ } else {
43682
+ this.firstKey = key;
43683
+ node1.prevKey = undefined;
43684
+ }
43685
+ if (node1.type === 'item') node1.index = index++;
43686
+ last = node1;
43687
+ // Set nextKey as undefined since this might be the last node
43688
+ // If it isn't the last node, last.nextKey will properly set at start of new loop
43689
+ last.nextKey = undefined;
43690
+ }
43691
+ this.lastKey = last === null || last === void 0 ? void 0 : last.key;
43692
+ }
43693
+ }
43694
+
43695
+
43696
+
43697
+
43698
+ function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
43699
+ let { filter: filter } = props;
43700
+ let selectionState = $7af3f5b51489e0b5$export$253fe78d46329472(props);
43701
+ let disabledKeys = useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
43702
+ , [
43703
+ props.disabledKeys
43704
+ ]);
43705
+ let factory = (nodes)=>filter ? new $a02d57049d202695$export$d085fb9e920b5ca7(filter(nodes)) : new $a02d57049d202695$export$d085fb9e920b5ca7(nodes)
43706
+ ;
43707
+ let context = useMemo(()=>({
43708
+ suppressTextValueWarning: props.suppressTextValueWarning
43709
+ })
43710
+ , [
43711
+ props.suppressTextValueWarning
43712
+ ]);
43713
+ let collection = $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context, [
43714
+ filter
43715
+ ]);
43716
+ // Reset focused key if that item is deleted from the collection.
43717
+ useEffect(()=>{
43718
+ if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
43719
+ }, [
43720
+ collection,
43721
+ selectionState.focusedKey
43722
+ ]);
43723
+ return {
43724
+ collection: collection,
43725
+ disabledKeys: disabledKeys,
43726
+ selectionManager: new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(collection, selectionState)
43727
+ };
43728
+ }
43729
+
43730
+ function LuiListBox({ ariaLabel, ariaLabelledBy, itemRenderer = DefaultItemRenderer, loadingIndicator = DefaultLoadingIndicator, emptyIndicator = DefaultEmptyIndicator, selectionMode = 'single', selectionBehavior = 'toggle', disabled = false, items, value, onChange = () => {
43731
+ /* noop */
43732
+ }, getKey, ariaProps, className, ...ulProps }) {
43733
+ const listProps = useMemo(() => mapToAriaListBoxProps({
43734
+ selectionMode,
43735
+ selectionBehavior,
43736
+ items,
43737
+ value,
43738
+ onChange,
43739
+ getKey,
43740
+ ariaProps,
43741
+ disabled,
43742
+ }), [
43743
+ selectionMode,
43744
+ selectionBehavior,
43745
+ items,
43746
+ value,
43747
+ onChange,
43748
+ getKey,
43749
+ ariaProps,
43750
+ ]);
43751
+ const ariaListBoxProps = useMemo(() => ({
43752
+ 'aria-label': ariaLabel,
43753
+ 'aria-labelledby': ariaLabelledBy,
43754
+ ...listProps,
43755
+ }), [listProps, ariaLabel, ariaLabelledBy]);
43756
+ const ref = useRef(null);
43757
+ const state = $e72dd72e1c76a225$export$2f645645f7bca764(listProps);
43758
+ const { listBoxProps } = $c132121280ec012d$export$50eacbbf140a3141(ariaListBoxProps, state, ref);
43759
+ return (React__default.createElement("ul", { ...ulProps, ...listBoxProps, ref: ref, className: clsx('LuiListBox', className) },
43760
+ !items && loadingIndicator(),
43761
+ items?.length === 0 && emptyIndicator(),
43762
+ [...state.collection].map((node) => (React__default.createElement(LuiListBoxItem, { key: node.key, node: node, state: state, renderer: itemRenderer })))));
43763
+ }
43764
+ function DefaultLoadingIndicator() {
43765
+ return (React__default.createElement(React__default.Fragment, null,
43766
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43767
+ React__default.createElement(Skeleton, null)),
43768
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43769
+ React__default.createElement(Skeleton, null)),
43770
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43771
+ React__default.createElement(Skeleton, null))));
43772
+ }
43773
+ function DefaultEmptyIndicator() {
43774
+ return React__default.createElement("li", { className: "LuiListBox-emptyIndicator" }, "Nothing to Display");
43775
+ }
43776
+
43777
+ var css_248z$1 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.RadioItemRenderer {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0 0 0 2rem;\n}\n.RadioItemRenderer::before {\n content: \"\";\n height: 1.5rem;\n min-width: 1.5rem;\n width: 1.5rem;\n border: 2px solid #007198;\n border-radius: 50%;\n background-color: transparent;\n position: absolute;\n left: 0;\n top: 0;\n margin-right: 0.75rem;\n}\n.RadioItemRenderer:after {\n content: \"\";\n position: absolute;\n left: 5px;\n top: 5px;\n background-color: #007198;\n height: 14px;\n min-width: 14px;\n width: 14px;\n border-radius: 50%;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n}\n.RadioItemRenderer-isSelected:after {\n opacity: 1;\n}";
43778
+ styleInject(css_248z$1);
43779
+
43780
+ function RadioItemRenderer({ item, isSelected, }) {
43781
+ return (React__default.createElement("div", { className: `RadioItemRenderer ${isSelected ? 'RadioItemRenderer-isSelected' : ''}` }, item.label));
43782
+ }
43783
+
43784
+ var css_248z = ".CheckboxRenderer {\n display: flex;\n align-items: center;\n}";
43785
+ styleInject(css_248z);
43786
+
43787
+ function CheckboxItemRenderer({ item, isSelected, }) {
43788
+ return (React__default.createElement("div", { className: `CheckboxRenderer ${isSelected ? 'LuiCheckboxInput--isChecked' : ''}`, style: {} },
43789
+ React__default.createElement(LuiIcon, { size: "md", name: isSelected ? 'ic_check' : 'ic_zoom_out', alt: isSelected ? 'Checked' : 'Indeterminate Check', className: `LuiCheckboxInput-labelCheck ${isSelected ? 'LuiCheckboxInput--isChecked' : ''}` }),
43790
+ item.label));
43791
+ }
43792
+
43793
+ export { CheckboxItemRenderer, FIRM_KEY, FIRM_NAME_KEY, GLOBAL_CLIENT_REFERENCE_KEY, LOLActiveFirmMessage, LOLAuthorisedLink, LOLCommonDrawerMenu, LOLCommonDrawerMenuAfterLinks, LOLDrawerMenu, LOLFirmSwitcherMenu, LOLGlobalClientRefContext, LOLGlobalClientRefContextProvider, LOLLogoutLink, LOLSearchBox, LOLUserContext, LOLUserContextProvider, LOLUserLastLogin, LuiAccordicard, LuiAccordicardStatic, LuiAlertModal, LuiAlertModalButtons, LuiBadge, LuiBanner, LuiBannerContent, LuiBearingFormikInput, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuItem, LuiComboSelect, LuiControlledMenu, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuOption, LuiDrawerMenuOptions, LuiDrawerMenuSection, LuiDropdownMenu, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFooter, LuiFormSectionHeader, LuiFormikCheckbox, LuiFormikForm, LuiFormikFormLabel, LuiFormikFormSubmitButton, LuiFormikRadioButton, LuiFormikRadioGroup, LuiFormikSelect, LuiFormikTextInput, LuiHeader, LuiHeaderMenuItem, LuiIcon, LuiListBox, LuiLoadingSpinner, LuiLoadingSpinnerChristmas, LuiLoadingSpinnerEaster, LuiMenu, LuiMenuCloseButton, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiRadioInput, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, LuiShadow, LuiSidePanel, LuiSidePanelProvider, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, RadioItemRenderer, getDefaultSearchMenuOptions, isChromatic, useClickedOutsideElement, useLOLGlobalClientRefContext, useLOLUserContext, useShowLUIMessage };
40368
43794
  //# sourceMappingURL=lui.esm.js.map