@teja-app/ui 0.0.2 → 0.0.4
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/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.types.d.ts +3 -0
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +36 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +196 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarDivider.d.ts +12 -0
- package/dist/components/Sidebar/SidebarDivider.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarGroup.d.ts +26 -0
- package/dist/components/Sidebar/SidebarGroup.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarItem.d.ts +23 -0
- package/dist/components/Sidebar/SidebarItem.d.ts.map +1 -0
- package/dist/components/Sidebar/index.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.cjs +7 -6
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/useSidebar.d.ts +39 -0
- package/dist/hooks/useSidebar.d.ts.map +1 -0
- package/dist/index.cjs +526 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1367 -912
- package/dist/index.js.map +1 -1
- package/dist/{useSelection-BK6u5Ezx.js → useSidebar-BWe09WbE.js} +109 -2
- package/dist/useSidebar-BWe09WbE.js.map +1 -0
- package/dist/{useSelection-DyXUWnGK.cjs → useSidebar-d1VZFhxd.cjs} +108 -1
- package/dist/useSidebar-d1VZFhxd.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/useSelection-BK6u5Ezx.js.map +0 -1
- package/dist/useSelection-DyXUWnGK.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { u, a, b, c, d } from "./
|
|
1
|
+
import { u, a, b, c, d, e } from "./useSidebar-BWe09WbE.js";
|
|
2
2
|
import { cn } from "./utils/index.js";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { forwardRef, useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect, useContext, createContext, Fragment as Fragment$1, isValidElement, cloneElement, createElement, useId as useId$1, useSyncExternalStore, useReducer, createRef } from "react";
|
|
6
6
|
import * as ReactDOM from "react-dom";
|
|
7
7
|
import { flushSync, createPortal } from "react-dom";
|
|
8
|
-
const variantStyles$
|
|
8
|
+
const variantStyles$4 = {
|
|
9
9
|
primary: [
|
|
10
10
|
// Light mode
|
|
11
11
|
"bg-primary-800 text-white border border-gold-500/40",
|
|
@@ -45,7 +45,7 @@ const variantStyles$3 = {
|
|
|
45
45
|
"dark:focus:ring-error/30"
|
|
46
46
|
].join(" ")
|
|
47
47
|
};
|
|
48
|
-
const sizeStyles$
|
|
48
|
+
const sizeStyles$b = {
|
|
49
49
|
sm: "px-3 py-1.5 text-sm h-8",
|
|
50
50
|
md: "px-4 py-2 text-base h-10",
|
|
51
51
|
lg: "px-6 py-3 text-lg h-12"
|
|
@@ -75,9 +75,9 @@ const Button = forwardRef(
|
|
|
75
75
|
"dark:focus:ring-offset-primary-900",
|
|
76
76
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
77
77
|
// Variant styles
|
|
78
|
-
variantStyles$
|
|
78
|
+
variantStyles$4[variant],
|
|
79
79
|
// Size styles
|
|
80
|
-
sizeStyles$
|
|
80
|
+
sizeStyles$b[size2],
|
|
81
81
|
// Width styles
|
|
82
82
|
fullWidth && "w-full",
|
|
83
83
|
// Custom className (allows override)
|
|
@@ -128,7 +128,7 @@ const Button = forwardRef(
|
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
Button.displayName = "Button";
|
|
131
|
-
const sizeStyles$
|
|
131
|
+
const sizeStyles$a = {
|
|
132
132
|
xs: "h-3 w-3",
|
|
133
133
|
// 12px
|
|
134
134
|
sm: "h-4 w-4",
|
|
@@ -158,7 +158,7 @@ const Spinner = forwardRef(
|
|
|
158
158
|
ref,
|
|
159
159
|
className: cn(
|
|
160
160
|
"animate-spin",
|
|
161
|
-
sizeStyles$
|
|
161
|
+
sizeStyles$a[size2],
|
|
162
162
|
colorStyles[color],
|
|
163
163
|
className
|
|
164
164
|
),
|
|
@@ -451,8 +451,8 @@ const Textarea = forwardRef(
|
|
|
451
451
|
}
|
|
452
452
|
}, [autoResize]);
|
|
453
453
|
const handleChange = useCallback(
|
|
454
|
-
(
|
|
455
|
-
onChange?.(
|
|
454
|
+
(e3) => {
|
|
455
|
+
onChange?.(e3);
|
|
456
456
|
if (autoResize) {
|
|
457
457
|
adjustHeight();
|
|
458
458
|
}
|
|
@@ -798,14 +798,14 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
798
798
|
}
|
|
799
799
|
};
|
|
800
800
|
}, []);
|
|
801
|
-
return useCallback((
|
|
802
|
-
if (
|
|
801
|
+
return useCallback((e3) => {
|
|
802
|
+
if (e3.target instanceof HTMLButtonElement || e3.target instanceof HTMLInputElement || e3.target instanceof HTMLTextAreaElement || e3.target instanceof HTMLSelectElement) {
|
|
803
803
|
stateRef.current.isFocused = true;
|
|
804
|
-
let target =
|
|
805
|
-
let onBlurHandler = (
|
|
804
|
+
let target = e3.target;
|
|
805
|
+
let onBlurHandler = (e4) => {
|
|
806
806
|
stateRef.current.isFocused = false;
|
|
807
807
|
if (target.disabled) {
|
|
808
|
-
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(
|
|
808
|
+
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e4);
|
|
809
809
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
810
810
|
}
|
|
811
811
|
if (stateRef.current.observer) {
|
|
@@ -851,38 +851,38 @@ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
|
|
|
851
851
|
Tab: true,
|
|
852
852
|
Escape: true
|
|
853
853
|
};
|
|
854
|
-
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality,
|
|
855
|
-
for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality,
|
|
854
|
+
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e3) {
|
|
855
|
+
for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality, e3);
|
|
856
856
|
}
|
|
857
|
-
function $507fabe10e71c6fb$var$isValidKey(
|
|
858
|
-
return !(
|
|
857
|
+
function $507fabe10e71c6fb$var$isValidKey(e3) {
|
|
858
|
+
return !(e3.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e3.altKey || e3.ctrlKey || e3.key === "Control" || e3.key === "Shift" || e3.key === "Meta");
|
|
859
859
|
}
|
|
860
|
-
function $507fabe10e71c6fb$var$handleKeyboardEvent(
|
|
860
|
+
function $507fabe10e71c6fb$var$handleKeyboardEvent(e3) {
|
|
861
861
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
862
|
-
if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $507fabe10e71c6fb$var$isValidKey(
|
|
862
|
+
if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $507fabe10e71c6fb$var$isValidKey(e3)) {
|
|
863
863
|
$507fabe10e71c6fb$var$currentModality = "keyboard";
|
|
864
|
-
$507fabe10e71c6fb$var$triggerChangeHandlers("keyboard",
|
|
864
|
+
$507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e3);
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
function $507fabe10e71c6fb$var$handlePointerEvent(
|
|
867
|
+
function $507fabe10e71c6fb$var$handlePointerEvent(e3) {
|
|
868
868
|
$507fabe10e71c6fb$var$currentModality = "pointer";
|
|
869
|
-
"pointerType" in
|
|
870
|
-
if (
|
|
869
|
+
"pointerType" in e3 ? e3.pointerType : "mouse";
|
|
870
|
+
if (e3.type === "mousedown" || e3.type === "pointerdown") {
|
|
871
871
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
872
|
-
$507fabe10e71c6fb$var$triggerChangeHandlers("pointer",
|
|
872
|
+
$507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e3);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
function $507fabe10e71c6fb$var$handleClickEvent(
|
|
876
|
-
if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $6a7db85432448f7f$export$60278871457622de(
|
|
875
|
+
function $507fabe10e71c6fb$var$handleClickEvent(e3) {
|
|
876
|
+
if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $6a7db85432448f7f$export$60278871457622de(e3)) {
|
|
877
877
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
878
878
|
$507fabe10e71c6fb$var$currentModality = "virtual";
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
function $507fabe10e71c6fb$var$handleFocusEvent(
|
|
882
|
-
if (
|
|
881
|
+
function $507fabe10e71c6fb$var$handleFocusEvent(e3) {
|
|
882
|
+
if (e3.target === window || e3.target === document || $8a9cb279dc87e130$export$fda7da73ab5d4c48 || !e3.isTrusted) return;
|
|
883
883
|
if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
|
|
884
884
|
$507fabe10e71c6fb$var$currentModality = "virtual";
|
|
885
|
-
$507fabe10e71c6fb$var$triggerChangeHandlers("virtual",
|
|
885
|
+
$507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e3);
|
|
886
886
|
}
|
|
887
887
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = false;
|
|
888
888
|
$507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
|
|
@@ -972,20 +972,20 @@ const $507fabe10e71c6fb$var$nonTextInputTypes = /* @__PURE__ */ new Set([
|
|
|
972
972
|
"submit",
|
|
973
973
|
"reset"
|
|
974
974
|
]);
|
|
975
|
-
function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality,
|
|
976
|
-
let document1 = $431fbd86ca7dc216$export$b204af158042fbac(
|
|
977
|
-
const IHTMLInputElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(
|
|
978
|
-
const IHTMLTextAreaElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(
|
|
979
|
-
const IHTMLElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(
|
|
980
|
-
const IKeyboardEvent = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(
|
|
975
|
+
function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e3) {
|
|
976
|
+
let document1 = $431fbd86ca7dc216$export$b204af158042fbac(e3 === null || e3 === void 0 ? void 0 : e3.target);
|
|
977
|
+
const IHTMLInputElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e3 === null || e3 === void 0 ? void 0 : e3.target).HTMLInputElement : HTMLInputElement;
|
|
978
|
+
const IHTMLTextAreaElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e3 === null || e3 === void 0 ? void 0 : e3.target).HTMLTextAreaElement : HTMLTextAreaElement;
|
|
979
|
+
const IHTMLElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e3 === null || e3 === void 0 ? void 0 : e3.target).HTMLElement : HTMLElement;
|
|
980
|
+
const IKeyboardEvent = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e3 === null || e3 === void 0 ? void 0 : e3.target).KeyboardEvent : KeyboardEvent;
|
|
981
981
|
isTextInput = isTextInput || document1.activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(document1.activeElement.type) || document1.activeElement instanceof IHTMLTextAreaElement || document1.activeElement instanceof IHTMLElement && document1.activeElement.isContentEditable;
|
|
982
|
-
return !(isTextInput && modality === "keyboard" &&
|
|
982
|
+
return !(isTextInput && modality === "keyboard" && e3 instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e3.key]);
|
|
983
983
|
}
|
|
984
984
|
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
985
985
|
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
|
|
986
986
|
useEffect(() => {
|
|
987
|
-
let handler = (modality,
|
|
988
|
-
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality,
|
|
987
|
+
let handler = (modality, e3) => {
|
|
988
|
+
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e3)) return;
|
|
989
989
|
fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
|
|
990
990
|
};
|
|
991
991
|
$507fabe10e71c6fb$var$changeHandlers.add(handler);
|
|
@@ -996,9 +996,9 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
|
996
996
|
}
|
|
997
997
|
function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
998
998
|
let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
|
|
999
|
-
const onBlur = useCallback((
|
|
1000
|
-
if (
|
|
1001
|
-
if (onBlurProp) onBlurProp(
|
|
999
|
+
const onBlur = useCallback((e3) => {
|
|
1000
|
+
if (e3.target === e3.currentTarget) {
|
|
1001
|
+
if (onBlurProp) onBlurProp(e3);
|
|
1002
1002
|
if (onFocusChange) onFocusChange(false);
|
|
1003
1003
|
return true;
|
|
1004
1004
|
}
|
|
@@ -1007,13 +1007,13 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
|
1007
1007
|
onFocusChange
|
|
1008
1008
|
]);
|
|
1009
1009
|
const onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
|
|
1010
|
-
const onFocus = useCallback((
|
|
1011
|
-
const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(
|
|
1010
|
+
const onFocus = useCallback((e3) => {
|
|
1011
|
+
const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e3.target);
|
|
1012
1012
|
const activeElement = ownerDocument ? $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) : $d4ee10de306f2510$export$cd4e5573fbe2b576();
|
|
1013
|
-
if (
|
|
1014
|
-
if (onFocusProp) onFocusProp(
|
|
1013
|
+
if (e3.target === e3.currentTarget && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(e3.nativeEvent)) {
|
|
1014
|
+
if (onFocusProp) onFocusProp(e3);
|
|
1015
1015
|
if (onFocusChange) onFocusChange(true);
|
|
1016
|
-
onSyntheticFocus(
|
|
1016
|
+
onSyntheticFocus(e3);
|
|
1017
1017
|
}
|
|
1018
1018
|
}, [
|
|
1019
1019
|
onFocusChange,
|
|
@@ -1033,12 +1033,12 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
1033
1033
|
isFocusWithin: false
|
|
1034
1034
|
});
|
|
1035
1035
|
let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
1036
|
-
let onBlur = useCallback((
|
|
1037
|
-
if (!
|
|
1038
|
-
if (state.current.isFocusWithin && !
|
|
1036
|
+
let onBlur = useCallback((e3) => {
|
|
1037
|
+
if (!e3.currentTarget.contains(e3.target)) return;
|
|
1038
|
+
if (state.current.isFocusWithin && !e3.currentTarget.contains(e3.relatedTarget)) {
|
|
1039
1039
|
state.current.isFocusWithin = false;
|
|
1040
1040
|
removeAllGlobalListeners();
|
|
1041
|
-
if (onBlurWithin) onBlurWithin(
|
|
1041
|
+
if (onBlurWithin) onBlurWithin(e3);
|
|
1042
1042
|
if (onFocusWithinChange) onFocusWithinChange(false);
|
|
1043
1043
|
}
|
|
1044
1044
|
}, [
|
|
@@ -1048,20 +1048,20 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
1048
1048
|
removeAllGlobalListeners
|
|
1049
1049
|
]);
|
|
1050
1050
|
let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
|
|
1051
|
-
let onFocus = useCallback((
|
|
1052
|
-
if (!
|
|
1053
|
-
const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(
|
|
1051
|
+
let onFocus = useCallback((e3) => {
|
|
1052
|
+
if (!e3.currentTarget.contains(e3.target)) return;
|
|
1053
|
+
const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e3.target);
|
|
1054
1054
|
const activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
|
|
1055
|
-
if (!state.current.isFocusWithin && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(
|
|
1056
|
-
if (onFocusWithin) onFocusWithin(
|
|
1055
|
+
if (!state.current.isFocusWithin && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(e3.nativeEvent)) {
|
|
1056
|
+
if (onFocusWithin) onFocusWithin(e3);
|
|
1057
1057
|
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
1058
1058
|
state.current.isFocusWithin = true;
|
|
1059
|
-
onSyntheticFocus(
|
|
1060
|
-
let currentTarget =
|
|
1061
|
-
addGlobalListener(ownerDocument, "focus", (
|
|
1062
|
-
if (state.current.isFocusWithin && !$d4ee10de306f2510$export$4282f70798064fe0(currentTarget,
|
|
1059
|
+
onSyntheticFocus(e3);
|
|
1060
|
+
let currentTarget = e3.currentTarget;
|
|
1061
|
+
addGlobalListener(ownerDocument, "focus", (e4) => {
|
|
1062
|
+
if (state.current.isFocusWithin && !$d4ee10de306f2510$export$4282f70798064fe0(currentTarget, e4.target)) {
|
|
1063
1063
|
let nativeEvent = new ownerDocument.defaultView.FocusEvent("blur", {
|
|
1064
|
-
relatedTarget:
|
|
1064
|
+
relatedTarget: e4.target
|
|
1065
1065
|
});
|
|
1066
1066
|
$8a9cb279dc87e130$export$c2b7abe5d61ec696(nativeEvent, currentTarget);
|
|
1067
1067
|
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(nativeEvent);
|
|
@@ -1100,8 +1100,8 @@ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
|
|
|
1100
1100
|
$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
|
|
1101
1101
|
}, 50);
|
|
1102
1102
|
}
|
|
1103
|
-
function $6179b936705e76d3$var$handleGlobalPointerEvent(
|
|
1104
|
-
if (
|
|
1103
|
+
function $6179b936705e76d3$var$handleGlobalPointerEvent(e3) {
|
|
1104
|
+
if (e3.pointerType === "touch") $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
|
|
1105
1105
|
}
|
|
1106
1106
|
function $6179b936705e76d3$var$setupGlobalTouchEvents() {
|
|
1107
1107
|
if (typeof document === "undefined") return;
|
|
@@ -1135,8 +1135,8 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
1135
1135
|
state.isHovered = true;
|
|
1136
1136
|
let target = event.currentTarget;
|
|
1137
1137
|
state.target = target;
|
|
1138
|
-
addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(event.target), "pointerover", (
|
|
1139
|
-
if (state.isHovered && state.target && !$d4ee10de306f2510$export$4282f70798064fe0(state.target,
|
|
1138
|
+
addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(event.target), "pointerover", (e3) => {
|
|
1139
|
+
if (state.isHovered && state.target && !$d4ee10de306f2510$export$4282f70798064fe0(state.target, e3.target)) triggerHoverEnd2(e3, e3.pointerType);
|
|
1140
1140
|
}, {
|
|
1141
1141
|
capture: true
|
|
1142
1142
|
});
|
|
@@ -1165,23 +1165,23 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
let hoverProps2 = {};
|
|
1167
1167
|
if (typeof PointerEvent !== "undefined") {
|
|
1168
|
-
hoverProps2.onPointerEnter = (
|
|
1169
|
-
if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents &&
|
|
1170
|
-
triggerHoverStart(
|
|
1168
|
+
hoverProps2.onPointerEnter = (e3) => {
|
|
1169
|
+
if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e3.pointerType === "mouse") return;
|
|
1170
|
+
triggerHoverStart(e3, e3.pointerType);
|
|
1171
1171
|
};
|
|
1172
|
-
hoverProps2.onPointerLeave = (
|
|
1173
|
-
if (!isDisabled &&
|
|
1172
|
+
hoverProps2.onPointerLeave = (e3) => {
|
|
1173
|
+
if (!isDisabled && e3.currentTarget.contains(e3.target)) triggerHoverEnd2(e3, e3.pointerType);
|
|
1174
1174
|
};
|
|
1175
1175
|
} else if (process.env.NODE_ENV === "test") {
|
|
1176
1176
|
hoverProps2.onTouchStart = () => {
|
|
1177
1177
|
state.ignoreEmulatedMouseEvents = true;
|
|
1178
1178
|
};
|
|
1179
|
-
hoverProps2.onMouseEnter = (
|
|
1180
|
-
if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(
|
|
1179
|
+
hoverProps2.onMouseEnter = (e3) => {
|
|
1180
|
+
if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e3, "mouse");
|
|
1181
1181
|
state.ignoreEmulatedMouseEvents = false;
|
|
1182
1182
|
};
|
|
1183
|
-
hoverProps2.onMouseLeave = (
|
|
1184
|
-
if (!isDisabled &&
|
|
1183
|
+
hoverProps2.onMouseLeave = (e3) => {
|
|
1184
|
+
if (!isDisabled && e3.currentTarget.contains(e3.target)) triggerHoverEnd2(e3, "mouse");
|
|
1185
1185
|
};
|
|
1186
1186
|
}
|
|
1187
1187
|
return {
|
|
@@ -1246,16 +1246,16 @@ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
1248
|
var i$5 = Object.defineProperty;
|
|
1249
|
-
var d$3 = (t2,
|
|
1250
|
-
var r$7 = (t2,
|
|
1249
|
+
var d$3 = (t2, e3, n2) => e3 in t2 ? i$5(t2, e3, { enumerable: true, configurable: true, writable: true, value: n2 }) : t2[e3] = n2;
|
|
1250
|
+
var r$7 = (t2, e3, n2) => (d$3(t2, typeof e3 != "symbol" ? e3 + "" : e3, n2), n2);
|
|
1251
1251
|
let o$8 = class o {
|
|
1252
1252
|
constructor() {
|
|
1253
1253
|
r$7(this, "current", this.detect());
|
|
1254
1254
|
r$7(this, "handoffState", "pending");
|
|
1255
1255
|
r$7(this, "currentId", 0);
|
|
1256
1256
|
}
|
|
1257
|
-
set(
|
|
1258
|
-
this.current !==
|
|
1257
|
+
set(e3) {
|
|
1258
|
+
this.current !== e3 && (this.handoffState = "pending", this.currentId = 0, this.current = e3);
|
|
1259
1259
|
}
|
|
1260
1260
|
reset() {
|
|
1261
1261
|
this.set(this.detect());
|
|
@@ -1295,72 +1295,72 @@ function e$5(n2) {
|
|
|
1295
1295
|
function d$2(n2) {
|
|
1296
1296
|
return e$5(n2) === n2;
|
|
1297
1297
|
}
|
|
1298
|
-
function t$5(
|
|
1299
|
-
typeof queueMicrotask == "function" ? queueMicrotask(
|
|
1298
|
+
function t$5(e3) {
|
|
1299
|
+
typeof queueMicrotask == "function" ? queueMicrotask(e3) : Promise.resolve().then(e3).catch((o4) => setTimeout(() => {
|
|
1300
1300
|
throw o4;
|
|
1301
1301
|
}));
|
|
1302
1302
|
}
|
|
1303
1303
|
function o$7() {
|
|
1304
|
-
let s2 = [], r2 = { addEventListener(
|
|
1305
|
-
return
|
|
1306
|
-
}, requestAnimationFrame(...
|
|
1307
|
-
let t2 = requestAnimationFrame(...
|
|
1304
|
+
let s2 = [], r2 = { addEventListener(e3, t2, n2, i2) {
|
|
1305
|
+
return e3.addEventListener(t2, n2, i2), r2.add(() => e3.removeEventListener(t2, n2, i2));
|
|
1306
|
+
}, requestAnimationFrame(...e3) {
|
|
1307
|
+
let t2 = requestAnimationFrame(...e3);
|
|
1308
1308
|
return r2.add(() => cancelAnimationFrame(t2));
|
|
1309
|
-
}, nextFrame(...
|
|
1310
|
-
return r2.requestAnimationFrame(() => r2.requestAnimationFrame(...
|
|
1311
|
-
}, setTimeout(...
|
|
1312
|
-
let t2 = setTimeout(...
|
|
1309
|
+
}, nextFrame(...e3) {
|
|
1310
|
+
return r2.requestAnimationFrame(() => r2.requestAnimationFrame(...e3));
|
|
1311
|
+
}, setTimeout(...e3) {
|
|
1312
|
+
let t2 = setTimeout(...e3);
|
|
1313
1313
|
return r2.add(() => clearTimeout(t2));
|
|
1314
|
-
}, microTask(...
|
|
1314
|
+
}, microTask(...e3) {
|
|
1315
1315
|
let t2 = { current: true };
|
|
1316
1316
|
return t$5(() => {
|
|
1317
|
-
t2.current &&
|
|
1317
|
+
t2.current && e3[0]();
|
|
1318
1318
|
}), r2.add(() => {
|
|
1319
1319
|
t2.current = false;
|
|
1320
1320
|
});
|
|
1321
|
-
}, style(
|
|
1322
|
-
let i2 =
|
|
1323
|
-
return Object.assign(
|
|
1324
|
-
Object.assign(
|
|
1321
|
+
}, style(e3, t2, n2) {
|
|
1322
|
+
let i2 = e3.style.getPropertyValue(t2);
|
|
1323
|
+
return Object.assign(e3.style, { [t2]: n2 }), this.add(() => {
|
|
1324
|
+
Object.assign(e3.style, { [t2]: i2 });
|
|
1325
1325
|
});
|
|
1326
|
-
}, group(
|
|
1326
|
+
}, group(e3) {
|
|
1327
1327
|
let t2 = o$7();
|
|
1328
|
-
return
|
|
1329
|
-
}, add(
|
|
1330
|
-
return s2.includes(
|
|
1331
|
-
let t2 = s2.indexOf(
|
|
1328
|
+
return e3(t2), this.add(() => t2.dispose());
|
|
1329
|
+
}, add(e3) {
|
|
1330
|
+
return s2.includes(e3) || s2.push(e3), () => {
|
|
1331
|
+
let t2 = s2.indexOf(e3);
|
|
1332
1332
|
if (t2 >= 0) for (let n2 of s2.splice(t2, 1)) n2();
|
|
1333
1333
|
};
|
|
1334
1334
|
}, dispose() {
|
|
1335
|
-
for (let
|
|
1335
|
+
for (let e3 of s2.splice(0)) e3();
|
|
1336
1336
|
} };
|
|
1337
1337
|
return r2;
|
|
1338
1338
|
}
|
|
1339
1339
|
function p$7() {
|
|
1340
|
-
let [
|
|
1341
|
-
return useEffect(() => () =>
|
|
1340
|
+
let [e3] = useState(o$7);
|
|
1341
|
+
return useEffect(() => () => e3.dispose(), [e3]), e3;
|
|
1342
1342
|
}
|
|
1343
|
-
let n$6 = (
|
|
1344
|
-
s$c.isServer ? useEffect(
|
|
1343
|
+
let n$6 = (e3, t2) => {
|
|
1344
|
+
s$c.isServer ? useEffect(e3, t2) : useLayoutEffect(e3, t2);
|
|
1345
1345
|
};
|
|
1346
|
-
function s$b(
|
|
1347
|
-
let r2 = useRef(
|
|
1346
|
+
function s$b(e3) {
|
|
1347
|
+
let r2 = useRef(e3);
|
|
1348
1348
|
return n$6(() => {
|
|
1349
|
-
r2.current =
|
|
1350
|
-
}, [
|
|
1349
|
+
r2.current = e3;
|
|
1350
|
+
}, [e3]), r2;
|
|
1351
1351
|
}
|
|
1352
1352
|
let o$6 = function(t2) {
|
|
1353
|
-
let
|
|
1354
|
-
return React__default.useCallback((...r2) =>
|
|
1353
|
+
let e3 = s$b(t2);
|
|
1354
|
+
return React__default.useCallback((...r2) => e3.current(...r2), [e3]);
|
|
1355
1355
|
};
|
|
1356
|
-
function E$4(
|
|
1357
|
-
let t2 =
|
|
1358
|
-
return { top:
|
|
1356
|
+
function E$4(e3) {
|
|
1357
|
+
let t2 = e3.width / 2, n2 = e3.height / 2;
|
|
1358
|
+
return { top: e3.clientY - n2, right: e3.clientX + t2, bottom: e3.clientY + n2, left: e3.clientX - t2 };
|
|
1359
1359
|
}
|
|
1360
|
-
function P$4(
|
|
1361
|
-
return !(!
|
|
1360
|
+
function P$4(e3, t2) {
|
|
1361
|
+
return !(!e3 || !t2 || e3.right < t2.left || e3.left > t2.right || e3.bottom < t2.top || e3.top > t2.bottom);
|
|
1362
1362
|
}
|
|
1363
|
-
function w$7({ disabled:
|
|
1363
|
+
function w$7({ disabled: e3 = false } = {}) {
|
|
1364
1364
|
let t2 = useRef(null), [n2, l2] = useState(false), r2 = p$7(), o4 = o$6(() => {
|
|
1365
1365
|
t2.current = null, l2(false), r2.dispose();
|
|
1366
1366
|
}), f2 = o$6((s2) => {
|
|
@@ -1377,10 +1377,10 @@ function w$7({ disabled: e2 = false } = {}) {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
});
|
|
1380
|
-
return { pressed: n2, pressProps:
|
|
1380
|
+
return { pressed: n2, pressProps: e3 ? {} : { onPointerDown: f2, onPointerUp: o4, onClick: o4 } };
|
|
1381
1381
|
}
|
|
1382
|
-
function n$5(
|
|
1383
|
-
return useMemo(() =>
|
|
1382
|
+
function n$5(e3) {
|
|
1383
|
+
return useMemo(() => e3, Object.values(e3));
|
|
1384
1384
|
}
|
|
1385
1385
|
let e$4 = createContext(void 0);
|
|
1386
1386
|
function a$e() {
|
|
@@ -1394,38 +1394,38 @@ function t$4(...r2) {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
function u$e(r2, n2, ...a4) {
|
|
1396
1396
|
if (r2 in n2) {
|
|
1397
|
-
let
|
|
1398
|
-
return typeof
|
|
1397
|
+
let e3 = n2[r2];
|
|
1398
|
+
return typeof e3 == "function" ? e3(...a4) : e3;
|
|
1399
1399
|
}
|
|
1400
|
-
let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((
|
|
1400
|
+
let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e3) => `"${e3}"`).join(", ")}.`);
|
|
1401
1401
|
throw Error.captureStackTrace && Error.captureStackTrace(t2, u$e), t2;
|
|
1402
1402
|
}
|
|
1403
|
-
var A$2 = ((a4) => (a4[a4.None = 0] = "None", a4[a4.RenderStrategy = 1] = "RenderStrategy", a4[a4.Static = 2] = "Static", a4))(A$2 || {}), C$8 = ((
|
|
1403
|
+
var A$2 = ((a4) => (a4[a4.None = 0] = "None", a4[a4.RenderStrategy = 1] = "RenderStrategy", a4[a4.Static = 2] = "Static", a4))(A$2 || {}), C$8 = ((e3) => (e3[e3.Unmount = 0] = "Unmount", e3[e3.Hidden = 1] = "Hidden", e3))(C$8 || {});
|
|
1404
1404
|
function K() {
|
|
1405
1405
|
let n2 = $$2();
|
|
1406
1406
|
return useCallback((r2) => U$1({ mergeRefs: n2, ...r2 }), [n2]);
|
|
1407
1407
|
}
|
|
1408
|
-
function U$1({ ourProps: n2, theirProps: r2, slot:
|
|
1408
|
+
function U$1({ ourProps: n2, theirProps: r2, slot: e3, defaultTag: a4, features: s2, visible: t2 = true, name: l2, mergeRefs: i2 }) {
|
|
1409
1409
|
i2 = i2 != null ? i2 : I$6;
|
|
1410
1410
|
let o4 = P$3(r2, n2);
|
|
1411
|
-
if (t2) return F$3(o4,
|
|
1411
|
+
if (t2) return F$3(o4, e3, a4, l2, i2);
|
|
1412
1412
|
let y3 = s2 != null ? s2 : 0;
|
|
1413
1413
|
if (y3 & 2) {
|
|
1414
1414
|
let { static: f2 = false, ...u3 } = o4;
|
|
1415
|
-
if (f2) return F$3(u3,
|
|
1415
|
+
if (f2) return F$3(u3, e3, a4, l2, i2);
|
|
1416
1416
|
}
|
|
1417
1417
|
if (y3 & 1) {
|
|
1418
1418
|
let { unmount: f2 = true, ...u3 } = o4;
|
|
1419
1419
|
return u$e(f2 ? 0 : 1, { [0]() {
|
|
1420
1420
|
return null;
|
|
1421
1421
|
}, [1]() {
|
|
1422
|
-
return F$3({ ...u3, hidden: true, style: { display: "none" } },
|
|
1422
|
+
return F$3({ ...u3, hidden: true, style: { display: "none" } }, e3, a4, l2, i2);
|
|
1423
1423
|
} });
|
|
1424
1424
|
}
|
|
1425
|
-
return F$3(o4,
|
|
1425
|
+
return F$3(o4, e3, a4, l2, i2);
|
|
1426
1426
|
}
|
|
1427
|
-
function F$3(n2, r2 = {},
|
|
1428
|
-
let { as: t2 =
|
|
1427
|
+
function F$3(n2, r2 = {}, e3, a4, s2) {
|
|
1428
|
+
let { as: t2 = e3, children: l2, refName: i2 = "ref", ...o4 } = h$7(n2, ["unmount", "static"]), y3 = n2.ref !== void 0 ? { [i2]: n2.ref } : {}, f2 = typeof l2 == "function" ? l2(r2) : l2;
|
|
1429
1429
|
"className" in o4 && o4.className && typeof o4.className == "function" && (o4.className = o4.className(r2)), o4["aria-labelledby"] && o4["aria-labelledby"] === o4.id && (o4["aria-labelledby"] = void 0);
|
|
1430
1430
|
let u3 = {};
|
|
1431
1431
|
if (r2) {
|
|
@@ -1449,29 +1449,29 @@ function F$3(n2, r2 = {}, e2, a4, s2) {
|
|
|
1449
1449
|
return createElement(t2, Object.assign({}, h$7(o4, ["ref"]), !b$5(t2) && y3, !b$5(t2) && u3), f2);
|
|
1450
1450
|
}
|
|
1451
1451
|
function $$2() {
|
|
1452
|
-
let n2 = useRef([]), r2 = useCallback((
|
|
1453
|
-
for (let a4 of n2.current) a4 != null && (typeof a4 == "function" ? a4(
|
|
1452
|
+
let n2 = useRef([]), r2 = useCallback((e3) => {
|
|
1453
|
+
for (let a4 of n2.current) a4 != null && (typeof a4 == "function" ? a4(e3) : a4.current = e3);
|
|
1454
1454
|
}, []);
|
|
1455
|
-
return (...
|
|
1456
|
-
if (!
|
|
1455
|
+
return (...e3) => {
|
|
1456
|
+
if (!e3.every((a4) => a4 == null)) return n2.current = e3, r2;
|
|
1457
1457
|
};
|
|
1458
1458
|
}
|
|
1459
1459
|
function I$6(...n2) {
|
|
1460
1460
|
return n2.every((r2) => r2 == null) ? void 0 : (r2) => {
|
|
1461
|
-
for (let
|
|
1461
|
+
for (let e3 of n2) e3 != null && (typeof e3 == "function" ? e3(r2) : e3.current = r2);
|
|
1462
1462
|
};
|
|
1463
1463
|
}
|
|
1464
1464
|
function P$3(...n2) {
|
|
1465
1465
|
if (n2.length === 0) return {};
|
|
1466
1466
|
if (n2.length === 1) return n2[0];
|
|
1467
|
-
let r2 = {},
|
|
1468
|
-
for (let s2 of n2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (
|
|
1469
|
-
if (r2.disabled || r2["aria-disabled"]) for (let s2 in
|
|
1467
|
+
let r2 = {}, e3 = {};
|
|
1468
|
+
for (let s2 of n2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (e3[t2] != null || (e3[t2] = []), e3[t2].push(s2[t2])) : r2[t2] = s2[t2];
|
|
1469
|
+
if (r2.disabled || r2["aria-disabled"]) for (let s2 in e3) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(s2) && (e3[s2] = [(t2) => {
|
|
1470
1470
|
var l2;
|
|
1471
1471
|
return (l2 = t2 == null ? void 0 : t2.preventDefault) == null ? void 0 : l2.call(t2);
|
|
1472
1472
|
}]);
|
|
1473
|
-
for (let s2 in
|
|
1474
|
-
let i2 =
|
|
1473
|
+
for (let s2 in e3) Object.assign(r2, { [s2](t2, ...l2) {
|
|
1474
|
+
let i2 = e3[s2];
|
|
1475
1475
|
for (let o4 of i2) {
|
|
1476
1476
|
if ((t2 instanceof Event || (t2 == null ? void 0 : t2.nativeEvent) instanceof Event) && t2.defaultPrevented) return;
|
|
1477
1477
|
o4(t2, ...l2);
|
|
@@ -1482,10 +1482,10 @@ function P$3(...n2) {
|
|
|
1482
1482
|
function V$3(...n2) {
|
|
1483
1483
|
if (n2.length === 0) return {};
|
|
1484
1484
|
if (n2.length === 1) return n2[0];
|
|
1485
|
-
let r2 = {},
|
|
1486
|
-
for (let s2 of n2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (
|
|
1487
|
-
for (let s2 in
|
|
1488
|
-
let l2 =
|
|
1485
|
+
let r2 = {}, e3 = {};
|
|
1486
|
+
for (let s2 of n2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (e3[t2] != null || (e3[t2] = []), e3[t2].push(s2[t2])) : r2[t2] = s2[t2];
|
|
1487
|
+
for (let s2 in e3) Object.assign(r2, { [s2](...t2) {
|
|
1488
|
+
let l2 = e3[s2];
|
|
1489
1489
|
for (let i2 of l2) i2 == null || i2(...t2);
|
|
1490
1490
|
} });
|
|
1491
1491
|
return r2;
|
|
@@ -1496,13 +1496,13 @@ function Y(n2) {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
function m$4(n2) {
|
|
1498
1498
|
let r2 = Object.assign({}, n2);
|
|
1499
|
-
for (let
|
|
1499
|
+
for (let e3 in r2) r2[e3] === void 0 && delete r2[e3];
|
|
1500
1500
|
return r2;
|
|
1501
1501
|
}
|
|
1502
1502
|
function h$7(n2, r2 = []) {
|
|
1503
|
-
let
|
|
1504
|
-
for (let a4 of r2) a4 in
|
|
1505
|
-
return
|
|
1503
|
+
let e3 = Object.assign({}, n2);
|
|
1504
|
+
for (let a4 of r2) a4 in e3 && delete e3[a4];
|
|
1505
|
+
return e3;
|
|
1506
1506
|
}
|
|
1507
1507
|
function H$3(n2) {
|
|
1508
1508
|
return React__default.version.split(".")[0] >= "19" ? n2.props.ref : n2.ref;
|
|
@@ -1514,33 +1514,33 @@ function D$5(n2) {
|
|
|
1514
1514
|
return b$5(n2.type);
|
|
1515
1515
|
}
|
|
1516
1516
|
function b$4(l2, r2, c3) {
|
|
1517
|
-
let [i2, s2] = useState(c3),
|
|
1518
|
-
return
|
|
1517
|
+
let [i2, s2] = useState(c3), e3 = l2 !== void 0, t2 = useRef(e3), u3 = useRef(false), d3 = useRef(false);
|
|
1518
|
+
return e3 && !t2.current && !u3.current ? (u3.current = true, t2.current = e3, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !e3 && t2.current && !d3.current && (d3.current = true, t2.current = e3, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [e3 ? l2 : i2, o$6((n2) => (e3 || flushSync(() => s2(n2)), r2 == null ? void 0 : r2(n2)))];
|
|
1519
1519
|
}
|
|
1520
|
-
function l$5(
|
|
1521
|
-
let [t2] = useState(
|
|
1520
|
+
function l$5(e3) {
|
|
1521
|
+
let [t2] = useState(e3);
|
|
1522
1522
|
return t2;
|
|
1523
1523
|
}
|
|
1524
1524
|
function p$6(t2 = {}, i2 = null, n2 = []) {
|
|
1525
|
-
for (let [
|
|
1525
|
+
for (let [e3, o4] of Object.entries(t2)) s$a(n2, r$5(i2, e3), o4);
|
|
1526
1526
|
return n2;
|
|
1527
1527
|
}
|
|
1528
1528
|
function r$5(t2, i2) {
|
|
1529
1529
|
return t2 ? t2 + "[" + i2 + "]" : i2;
|
|
1530
1530
|
}
|
|
1531
1531
|
function s$a(t2, i2, n2) {
|
|
1532
|
-
if (Array.isArray(n2)) for (let [
|
|
1532
|
+
if (Array.isArray(n2)) for (let [e3, o4] of n2.entries()) s$a(t2, r$5(i2, e3.toString()), o4);
|
|
1533
1533
|
else n2 instanceof Date ? t2.push([i2, n2.toISOString()]) : typeof n2 == "boolean" ? t2.push([i2, n2 ? "1" : "0"]) : typeof n2 == "string" ? t2.push([i2, n2]) : typeof n2 == "number" ? t2.push([i2, `${n2}`]) : n2 == null ? t2.push([i2, ""]) : c$b(n2) && !isValidElement(n2) && p$6(n2, i2, t2);
|
|
1534
1534
|
}
|
|
1535
1535
|
function g$3(t2) {
|
|
1536
|
-
var n2,
|
|
1536
|
+
var n2, e3;
|
|
1537
1537
|
let i2 = (n2 = t2 == null ? void 0 : t2.form) != null ? n2 : t2.closest("form");
|
|
1538
1538
|
if (i2) {
|
|
1539
1539
|
for (let o4 of i2.elements) if (o4 !== t2 && (o4.tagName === "INPUT" && o4.type === "submit" || o4.tagName === "BUTTON" && o4.type === "submit" || o4.nodeName === "INPUT" && o4.type === "image")) {
|
|
1540
1540
|
o4.click();
|
|
1541
1541
|
return;
|
|
1542
1542
|
}
|
|
1543
|
-
(
|
|
1543
|
+
(e3 = i2.requestSubmit) == null || e3.call(i2);
|
|
1544
1544
|
}
|
|
1545
1545
|
}
|
|
1546
1546
|
function c$b(t2) {
|
|
@@ -1549,37 +1549,37 @@ function c$b(t2) {
|
|
|
1549
1549
|
return i2 === null || Object.getPrototypeOf(i2) === null;
|
|
1550
1550
|
}
|
|
1551
1551
|
let a$d = "span";
|
|
1552
|
-
var s$9 = ((
|
|
1552
|
+
var s$9 = ((e3) => (e3[e3.None = 1] = "None", e3[e3.Focusable = 2] = "Focusable", e3[e3.Hidden = 4] = "Hidden", e3))(s$9 || {});
|
|
1553
1553
|
function l$4(t2, r2) {
|
|
1554
1554
|
var n2;
|
|
1555
|
-
let { features: d3 = 1, ...
|
|
1556
|
-
return K()({ ourProps: o4, theirProps:
|
|
1555
|
+
let { features: d3 = 1, ...e3 } = t2, o4 = { ref: r2, "aria-hidden": (d3 & 2) === 2 ? true : (n2 = e3["aria-hidden"]) != null ? n2 : void 0, hidden: (d3 & 4) === 4 ? true : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(d3 & 4) === 4 && (d3 & 2) !== 2 && { display: "none" } } };
|
|
1556
|
+
return K()({ ourProps: o4, theirProps: e3, slot: {}, defaultTag: a$d, name: "Hidden" });
|
|
1557
1557
|
}
|
|
1558
1558
|
let f$d = Y(l$4);
|
|
1559
1559
|
let f$c = createContext(null);
|
|
1560
1560
|
function W$2(t2) {
|
|
1561
|
-
let [
|
|
1562
|
-
return React__default.createElement(f$c.Provider, { value: { target:
|
|
1561
|
+
let [e3, r2] = useState(null);
|
|
1562
|
+
return React__default.createElement(f$c.Provider, { value: { target: e3 } }, t2.children, React__default.createElement(f$d, { features: s$9.Hidden, ref: r2 }));
|
|
1563
1563
|
}
|
|
1564
1564
|
function c$a({ children: t2 }) {
|
|
1565
|
-
let
|
|
1566
|
-
if (!
|
|
1567
|
-
let { target: r2 } =
|
|
1565
|
+
let e3 = useContext(f$c);
|
|
1566
|
+
if (!e3) return React__default.createElement(React__default.Fragment, null, t2);
|
|
1567
|
+
let { target: r2 } = e3;
|
|
1568
1568
|
return r2 ? createPortal(React__default.createElement(React__default.Fragment, null, t2), r2) : null;
|
|
1569
1569
|
}
|
|
1570
|
-
function j$6({ data: t2, form:
|
|
1570
|
+
function j$6({ data: t2, form: e3, disabled: r2, onReset: n2, overrides: F2 }) {
|
|
1571
1571
|
let [i2, a4] = useState(null), p2 = p$7();
|
|
1572
1572
|
return useEffect(() => {
|
|
1573
1573
|
if (n2 && i2) return p2.addEventListener(i2, "reset", n2);
|
|
1574
|
-
}, [i2,
|
|
1574
|
+
}, [i2, e3, n2]), React__default.createElement(c$a, null, React__default.createElement(C$7, { setForm: a4, formId: e3 }), p$6(t2).map(([s2, v2]) => React__default.createElement(f$d, { features: s$9.Hidden, ...m$4({ key: s2, as: "input", type: "hidden", hidden: true, readOnly: true, form: e3, disabled: r2, name: s2, value: v2, ...F2 }) })));
|
|
1575
1575
|
}
|
|
1576
|
-
function C$7({ setForm: t2, formId:
|
|
1576
|
+
function C$7({ setForm: t2, formId: e3 }) {
|
|
1577
1577
|
return useEffect(() => {
|
|
1578
|
-
if (
|
|
1579
|
-
let r2 = document.getElementById(
|
|
1578
|
+
if (e3) {
|
|
1579
|
+
let r2 = document.getElementById(e3);
|
|
1580
1580
|
r2 && t2(r2);
|
|
1581
1581
|
}
|
|
1582
|
-
}, [t2,
|
|
1582
|
+
}, [t2, e3]), e3 ? null : React__default.createElement(f$d, { features: s$9.Hidden, as: "input", type: "hidden", hidden: true, readOnly: true, ref: (r2) => {
|
|
1583
1583
|
if (!r2) return;
|
|
1584
1584
|
let n2 = r2.closest("form");
|
|
1585
1585
|
n2 && t2(n2);
|
|
@@ -1592,51 +1592,51 @@ function u$d() {
|
|
|
1592
1592
|
function f$b({ id: t2, children: r2 }) {
|
|
1593
1593
|
return React__default.createElement(e$3.Provider, { value: t2 }, r2);
|
|
1594
1594
|
}
|
|
1595
|
-
function o$5(
|
|
1596
|
-
return typeof
|
|
1595
|
+
function o$5(e3) {
|
|
1596
|
+
return typeof e3 != "object" || e3 === null ? false : "nodeType" in e3;
|
|
1597
1597
|
}
|
|
1598
|
-
function t$3(
|
|
1599
|
-
return o$5(
|
|
1598
|
+
function t$3(e3) {
|
|
1599
|
+
return o$5(e3) && "tagName" in e3;
|
|
1600
1600
|
}
|
|
1601
|
-
function n$4(
|
|
1602
|
-
return t$3(
|
|
1601
|
+
function n$4(e3) {
|
|
1602
|
+
return t$3(e3) && "accessKey" in e3;
|
|
1603
1603
|
}
|
|
1604
|
-
function i$4(
|
|
1605
|
-
return t$3(
|
|
1604
|
+
function i$4(e3) {
|
|
1605
|
+
return t$3(e3) && "tabIndex" in e3;
|
|
1606
1606
|
}
|
|
1607
|
-
function r$4(
|
|
1608
|
-
return t$3(
|
|
1607
|
+
function r$4(e3) {
|
|
1608
|
+
return t$3(e3) && "style" in e3;
|
|
1609
1609
|
}
|
|
1610
|
-
function u$c(
|
|
1611
|
-
return n$4(
|
|
1610
|
+
function u$c(e3) {
|
|
1611
|
+
return n$4(e3) && e3.nodeName === "IFRAME";
|
|
1612
1612
|
}
|
|
1613
|
-
function l$3(
|
|
1614
|
-
return n$4(
|
|
1613
|
+
function l$3(e3) {
|
|
1614
|
+
return n$4(e3) && e3.nodeName === "INPUT";
|
|
1615
1615
|
}
|
|
1616
|
-
function m$3(
|
|
1617
|
-
return n$4(
|
|
1616
|
+
function m$3(e3) {
|
|
1617
|
+
return n$4(e3) && e3.nodeName === "LABEL";
|
|
1618
1618
|
}
|
|
1619
|
-
function a$c(
|
|
1620
|
-
return n$4(
|
|
1619
|
+
function a$c(e3) {
|
|
1620
|
+
return n$4(e3) && e3.nodeName === "FIELDSET";
|
|
1621
1621
|
}
|
|
1622
|
-
function E$3(
|
|
1623
|
-
return n$4(
|
|
1622
|
+
function E$3(e3) {
|
|
1623
|
+
return n$4(e3) && e3.nodeName === "LEGEND";
|
|
1624
1624
|
}
|
|
1625
|
-
function L$2(
|
|
1626
|
-
return t$3(
|
|
1625
|
+
function L$2(e3) {
|
|
1626
|
+
return t$3(e3) ? e3.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]') : false;
|
|
1627
1627
|
}
|
|
1628
1628
|
function s$8(l2) {
|
|
1629
|
-
let
|
|
1630
|
-
for (;
|
|
1631
|
-
let i2 = (
|
|
1629
|
+
let e3 = l2.parentElement, t2 = null;
|
|
1630
|
+
for (; e3 && !a$c(e3); ) E$3(e3) && (t2 = e3), e3 = e3.parentElement;
|
|
1631
|
+
let i2 = (e3 == null ? void 0 : e3.getAttribute("disabled")) === "";
|
|
1632
1632
|
return i2 && r$3(t2) ? false : i2;
|
|
1633
1633
|
}
|
|
1634
1634
|
function r$3(l2) {
|
|
1635
1635
|
if (!l2) return false;
|
|
1636
|
-
let
|
|
1637
|
-
for (;
|
|
1638
|
-
if (E$3(
|
|
1639
|
-
|
|
1636
|
+
let e3 = l2.previousElementSibling;
|
|
1637
|
+
for (; e3 !== null; ) {
|
|
1638
|
+
if (E$3(e3)) return false;
|
|
1639
|
+
e3 = e3.previousElementSibling;
|
|
1640
1640
|
}
|
|
1641
1641
|
return true;
|
|
1642
1642
|
}
|
|
@@ -1649,38 +1649,38 @@ function y$5(...t2) {
|
|
|
1649
1649
|
useEffect(() => {
|
|
1650
1650
|
n2.current = t2;
|
|
1651
1651
|
}, [t2]);
|
|
1652
|
-
let c3 = o$6((
|
|
1653
|
-
for (let o4 of n2.current) o4 != null && (typeof o4 == "function" ? o4(
|
|
1652
|
+
let c3 = o$6((e3) => {
|
|
1653
|
+
for (let o4 of n2.current) o4 != null && (typeof o4 == "function" ? o4(e3) : o4.current = e3);
|
|
1654
1654
|
});
|
|
1655
|
-
return t2.every((
|
|
1655
|
+
return t2.every((e3) => e3 == null || (e3 == null ? void 0 : e3[u$b])) ? void 0 : c3;
|
|
1656
1656
|
}
|
|
1657
1657
|
let a$b = createContext(null);
|
|
1658
1658
|
a$b.displayName = "DescriptionContext";
|
|
1659
1659
|
function f$a() {
|
|
1660
1660
|
let r2 = useContext(a$b);
|
|
1661
1661
|
if (r2 === null) {
|
|
1662
|
-
let
|
|
1663
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
1662
|
+
let e3 = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
1663
|
+
throw Error.captureStackTrace && Error.captureStackTrace(e3, f$a), e3;
|
|
1664
1664
|
}
|
|
1665
1665
|
return r2;
|
|
1666
1666
|
}
|
|
1667
1667
|
function w$6() {
|
|
1668
|
-
var r2,
|
|
1669
|
-
return (
|
|
1668
|
+
var r2, e3;
|
|
1669
|
+
return (e3 = (r2 = useContext(a$b)) == null ? void 0 : r2.value) != null ? e3 : void 0;
|
|
1670
1670
|
}
|
|
1671
1671
|
function H$2() {
|
|
1672
|
-
let [r2,
|
|
1672
|
+
let [r2, e3] = useState([]);
|
|
1673
1673
|
return [r2.length > 0 ? r2.join(" ") : void 0, useMemo(() => function(t2) {
|
|
1674
|
-
let i2 = o$6((n2) => (
|
|
1674
|
+
let i2 = o$6((n2) => (e3((o4) => [...o4, n2]), () => e3((o4) => {
|
|
1675
1675
|
let s2 = o4.slice(), p2 = s2.indexOf(n2);
|
|
1676
1676
|
return p2 !== -1 && s2.splice(p2, 1), s2;
|
|
1677
1677
|
}))), l2 = useMemo(() => ({ register: i2, slot: t2.slot, name: t2.name, props: t2.props, value: t2.value }), [i2, t2.slot, t2.name, t2.props, t2.value]);
|
|
1678
1678
|
return React__default.createElement(a$b.Provider, { value: l2 }, t2.children);
|
|
1679
|
-
}, [
|
|
1679
|
+
}, [e3])];
|
|
1680
1680
|
}
|
|
1681
1681
|
let I$5 = "p";
|
|
1682
|
-
function C$6(r2,
|
|
1683
|
-
let c3 = useId$1(), t2 = a$e(), { id: i2 = `headlessui-description-${c3}`, ...l2 } = r2, n2 = f$a(), o4 = y$5(
|
|
1682
|
+
function C$6(r2, e3) {
|
|
1683
|
+
let c3 = useId$1(), t2 = a$e(), { id: i2 = `headlessui-description-${c3}`, ...l2 } = r2, n2 = f$a(), o4 = y$5(e3);
|
|
1684
1684
|
n$6(() => n2.register(i2), [i2, n2.register]);
|
|
1685
1685
|
let s2 = n$5({ ...n2.slot, disabled: t2 || false }), p2 = { ref: o4, ...n2.props, id: i2 };
|
|
1686
1686
|
return K()({ ourProps: p2, theirProps: l2, slot: s2, defaultTag: I$5, name: n2.name || "Description" });
|
|
@@ -1698,28 +1698,28 @@ function C$5() {
|
|
|
1698
1698
|
return n2;
|
|
1699
1699
|
}
|
|
1700
1700
|
function N$1(n2) {
|
|
1701
|
-
var a4,
|
|
1702
|
-
let l2 = (
|
|
1701
|
+
var a4, e3, o4;
|
|
1702
|
+
let l2 = (e3 = (a4 = useContext(L$1)) == null ? void 0 : a4.value) != null ? e3 : void 0;
|
|
1703
1703
|
return ((o4 = n2 == null ? void 0 : n2.length) != null ? o4 : 0) > 0 ? [l2, ...n2].filter(Boolean).join(" ") : l2;
|
|
1704
1704
|
}
|
|
1705
1705
|
function V$2({ inherit: n2 = false } = {}) {
|
|
1706
|
-
let l2 = N$1(), [a4,
|
|
1706
|
+
let l2 = N$1(), [a4, e3] = useState([]), o4 = n2 ? [l2, ...a4].filter(Boolean) : a4;
|
|
1707
1707
|
return [o4.length > 0 ? o4.join(" ") : void 0, useMemo(() => function(t2) {
|
|
1708
|
-
let p2 = o$6((i2) => (
|
|
1708
|
+
let p2 = o$6((i2) => (e3((u3) => [...u3, i2]), () => e3((u3) => {
|
|
1709
1709
|
let d3 = u3.slice(), f2 = d3.indexOf(i2);
|
|
1710
1710
|
return f2 !== -1 && d3.splice(f2, 1), d3;
|
|
1711
1711
|
}))), b3 = useMemo(() => ({ register: p2, slot: t2.slot, name: t2.name, props: t2.props, value: t2.value }), [p2, t2.slot, t2.name, t2.props, t2.value]);
|
|
1712
1712
|
return React__default.createElement(L$1.Provider, { value: b3 }, t2.children);
|
|
1713
|
-
}, [
|
|
1713
|
+
}, [e3])];
|
|
1714
1714
|
}
|
|
1715
1715
|
let G$2 = "label";
|
|
1716
1716
|
function U(n2, l2) {
|
|
1717
1717
|
var y3;
|
|
1718
|
-
let a4 = useId$1(),
|
|
1719
|
-
n$6(() =>
|
|
1718
|
+
let a4 = useId$1(), e3 = C$5(), o4 = u$d(), T3 = a$e(), { id: t2 = `headlessui-label-${a4}`, htmlFor: p2 = o4 != null ? o4 : (y3 = e3.props) == null ? void 0 : y3.htmlFor, passive: b3 = false, ...i2 } = n2, u3 = y$5(l2);
|
|
1719
|
+
n$6(() => e3.register(t2), [t2, e3.register]);
|
|
1720
1720
|
let d3 = o$6((s2) => {
|
|
1721
1721
|
let g2 = s2.currentTarget;
|
|
1722
|
-
if (!(s2.target !== s2.currentTarget && L$2(s2.target)) && (m$3(g2) && s2.preventDefault(),
|
|
1722
|
+
if (!(s2.target !== s2.currentTarget && L$2(s2.target)) && (m$3(g2) && s2.preventDefault(), e3.props && "onClick" in e3.props && typeof e3.props.onClick == "function" && e3.props.onClick(s2), m$3(g2))) {
|
|
1723
1723
|
let r2 = document.getElementById(g2.htmlFor);
|
|
1724
1724
|
if (r2) {
|
|
1725
1725
|
let E2 = r2.getAttribute("disabled");
|
|
@@ -1729,8 +1729,8 @@ function U(n2, l2) {
|
|
|
1729
1729
|
(l$3(r2) && (r2.type === "file" || r2.type === "radio" || r2.type === "checkbox") || r2.role === "radio" || r2.role === "checkbox" || r2.role === "switch") && r2.click(), r2.focus({ preventScroll: true });
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
|
-
}), f2 = n$5({ ...
|
|
1733
|
-
return b3 && ("onClick" in c3 && (delete c3.htmlFor, delete c3.onClick), "onClick" in i2 && delete i2.onClick), K()({ ourProps: c3, theirProps: i2, slot: f2, defaultTag: p2 ? G$2 : "div", name:
|
|
1732
|
+
}), f2 = n$5({ ...e3.slot, disabled: T3 || false }), c3 = { ref: u3, ...e3.props, id: t2, htmlFor: p2, onClick: d3 };
|
|
1733
|
+
return b3 && ("onClick" in c3 && (delete c3.htmlFor, delete c3.onClick), "onClick" in i2 && delete i2.onClick), K()({ ourProps: c3, theirProps: i2, slot: f2, defaultTag: p2 ? G$2 : "div", name: e3.name || "Label" });
|
|
1734
1734
|
}
|
|
1735
1735
|
let j$5 = Y(U), Z = Object.assign(j$5, {});
|
|
1736
1736
|
let e$2 = createContext(() => {
|
|
@@ -2650,24 +2650,24 @@ function useVirtualizer(options) {
|
|
|
2650
2650
|
...options
|
|
2651
2651
|
});
|
|
2652
2652
|
}
|
|
2653
|
-
function l$2(
|
|
2654
|
-
return
|
|
2653
|
+
function l$2(e3, r2) {
|
|
2654
|
+
return e3 !== null && r2 !== null && typeof e3 == "object" && typeof r2 == "object" && "id" in e3 && "id" in r2 ? e3.id === r2.id : e3 === r2;
|
|
2655
2655
|
}
|
|
2656
|
-
function u$a(
|
|
2656
|
+
function u$a(e3 = l$2) {
|
|
2657
2657
|
return useCallback((r2, t2) => {
|
|
2658
|
-
if (typeof
|
|
2659
|
-
let o4 =
|
|
2658
|
+
if (typeof e3 == "string") {
|
|
2659
|
+
let o4 = e3;
|
|
2660
2660
|
return (r2 == null ? void 0 : r2[o4]) === (t2 == null ? void 0 : t2[o4]);
|
|
2661
2661
|
}
|
|
2662
|
-
return
|
|
2663
|
-
}, [
|
|
2662
|
+
return e3(r2, t2);
|
|
2663
|
+
}, [e3]);
|
|
2664
2664
|
}
|
|
2665
2665
|
function h$6(i2) {
|
|
2666
2666
|
if (i2 === null) return { width: 0, height: 0 };
|
|
2667
|
-
let { width: t2, height:
|
|
2668
|
-
return { width: t2, height:
|
|
2667
|
+
let { width: t2, height: e3 } = i2.getBoundingClientRect();
|
|
2668
|
+
return { width: t2, height: e3 };
|
|
2669
2669
|
}
|
|
2670
|
-
function w$5(i2, t2,
|
|
2670
|
+
function w$5(i2, t2, e3 = false) {
|
|
2671
2671
|
let [r2, f2] = useState(() => h$6(t2));
|
|
2672
2672
|
return n$6(() => {
|
|
2673
2673
|
if (!t2 || !i2) return;
|
|
@@ -2680,14 +2680,14 @@ function w$5(i2, t2, e2 = false) {
|
|
|
2680
2680
|
}), () => {
|
|
2681
2681
|
n2.dispose();
|
|
2682
2682
|
};
|
|
2683
|
-
}, [t2, i2]),
|
|
2683
|
+
}, [t2, i2]), e3 ? { width: `${r2.width}px`, height: `${r2.height}px` } : r2;
|
|
2684
2684
|
}
|
|
2685
2685
|
var g$2 = ((f2) => (f2[f2.Left = 0] = "Left", f2[f2.Right = 2] = "Right", f2))(g$2 || {});
|
|
2686
2686
|
function s$7(t2) {
|
|
2687
|
-
let r2 = useRef(null), u3 = o$6((
|
|
2688
|
-
r2.current =
|
|
2689
|
-
}), i2 = o$6((
|
|
2690
|
-
r2.current !== "mouse" && (s$8(
|
|
2687
|
+
let r2 = useRef(null), u3 = o$6((e3) => {
|
|
2688
|
+
r2.current = e3.pointerType, !s$8(e3.currentTarget) && e3.pointerType === "mouse" && e3.button === g$2.Left && (e3.preventDefault(), t2(e3));
|
|
2689
|
+
}), i2 = o$6((e3) => {
|
|
2690
|
+
r2.current !== "mouse" && (s$8(e3.currentTarget) || t2(e3));
|
|
2691
2691
|
});
|
|
2692
2692
|
return { onPointerDown: u3, onClick: i2 };
|
|
2693
2693
|
}
|
|
@@ -2697,27 +2697,27 @@ let a$a = class a2 extends Map {
|
|
|
2697
2697
|
this.factory = t2;
|
|
2698
2698
|
}
|
|
2699
2699
|
get(t2) {
|
|
2700
|
-
let
|
|
2701
|
-
return
|
|
2700
|
+
let e3 = super.get(t2);
|
|
2701
|
+
return e3 === void 0 && (e3 = this.factory(t2), this.set(t2, e3)), e3;
|
|
2702
2702
|
}
|
|
2703
2703
|
};
|
|
2704
2704
|
var h$5 = Object.defineProperty;
|
|
2705
|
-
var v$3 = (t2,
|
|
2706
|
-
var S$6 = (t2,
|
|
2707
|
-
if (!
|
|
2705
|
+
var v$3 = (t2, e3, r2) => e3 in t2 ? h$5(t2, e3, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e3] = r2;
|
|
2706
|
+
var S$6 = (t2, e3, r2) => (v$3(t2, e3 + "", r2), r2), b$3 = (t2, e3, r2) => {
|
|
2707
|
+
if (!e3.has(t2)) throw TypeError("Cannot " + r2);
|
|
2708
2708
|
};
|
|
2709
|
-
var i$3 = (t2,
|
|
2710
|
-
if (
|
|
2711
|
-
|
|
2712
|
-
}, u$9 = (t2,
|
|
2709
|
+
var i$3 = (t2, e3, r2) => (b$3(t2, e3, "read from private field"), r2 ? r2.call(t2) : e3.get(t2)), c$9 = (t2, e3, r2) => {
|
|
2710
|
+
if (e3.has(t2)) throw TypeError("Cannot add the same private member more than once");
|
|
2711
|
+
e3 instanceof WeakSet ? e3.add(t2) : e3.set(t2, r2);
|
|
2712
|
+
}, u$9 = (t2, e3, r2, s2) => (b$3(t2, e3, "write to private field"), e3.set(t2, r2), r2);
|
|
2713
2713
|
var n$3, a$9, o$3;
|
|
2714
2714
|
let T$3 = class T {
|
|
2715
|
-
constructor(
|
|
2715
|
+
constructor(e3) {
|
|
2716
2716
|
c$9(this, n$3, {});
|
|
2717
2717
|
c$9(this, a$9, new a$a(() => /* @__PURE__ */ new Set()));
|
|
2718
2718
|
c$9(this, o$3, /* @__PURE__ */ new Set());
|
|
2719
2719
|
S$6(this, "disposables", o$7());
|
|
2720
|
-
u$9(this, n$3,
|
|
2720
|
+
u$9(this, n$3, e3), s$c.isServer && this.disposables.microTask(() => {
|
|
2721
2721
|
this.dispose();
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
@@ -2727,70 +2727,70 @@ let T$3 = class T {
|
|
|
2727
2727
|
get state() {
|
|
2728
2728
|
return i$3(this, n$3);
|
|
2729
2729
|
}
|
|
2730
|
-
subscribe(
|
|
2730
|
+
subscribe(e3, r2) {
|
|
2731
2731
|
if (s$c.isServer) return () => {
|
|
2732
2732
|
};
|
|
2733
|
-
let s2 = { selector:
|
|
2733
|
+
let s2 = { selector: e3, callback: r2, current: e3(i$3(this, n$3)) };
|
|
2734
2734
|
return i$3(this, o$3).add(s2), this.disposables.add(() => {
|
|
2735
2735
|
i$3(this, o$3).delete(s2);
|
|
2736
2736
|
});
|
|
2737
2737
|
}
|
|
2738
|
-
on(
|
|
2738
|
+
on(e3, r2) {
|
|
2739
2739
|
return s$c.isServer ? () => {
|
|
2740
|
-
} : (i$3(this, a$9).get(
|
|
2741
|
-
i$3(this, a$9).get(
|
|
2740
|
+
} : (i$3(this, a$9).get(e3).add(r2), this.disposables.add(() => {
|
|
2741
|
+
i$3(this, a$9).get(e3).delete(r2);
|
|
2742
2742
|
}));
|
|
2743
2743
|
}
|
|
2744
|
-
send(
|
|
2745
|
-
let r2 = this.reduce(i$3(this, n$3),
|
|
2744
|
+
send(e3) {
|
|
2745
|
+
let r2 = this.reduce(i$3(this, n$3), e3);
|
|
2746
2746
|
if (r2 !== i$3(this, n$3)) {
|
|
2747
2747
|
u$9(this, n$3, r2);
|
|
2748
2748
|
for (let s2 of i$3(this, o$3)) {
|
|
2749
2749
|
let l2 = s2.selector(i$3(this, n$3));
|
|
2750
2750
|
j$4(s2.current, l2) || (s2.current = l2, s2.callback(l2));
|
|
2751
2751
|
}
|
|
2752
|
-
for (let s2 of i$3(this, a$9).get(
|
|
2752
|
+
for (let s2 of i$3(this, a$9).get(e3.type)) s2(i$3(this, n$3), e3);
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
2755
2755
|
};
|
|
2756
2756
|
n$3 = /* @__PURE__ */ new WeakMap(), a$9 = /* @__PURE__ */ new WeakMap(), o$3 = /* @__PURE__ */ new WeakMap();
|
|
2757
|
-
function j$4(t2,
|
|
2758
|
-
return Object.is(t2,
|
|
2757
|
+
function j$4(t2, e3) {
|
|
2758
|
+
return Object.is(t2, e3) ? true : typeof t2 != "object" || t2 === null || typeof e3 != "object" || e3 === null ? false : Array.isArray(t2) && Array.isArray(e3) ? t2.length !== e3.length ? false : f$9(t2[Symbol.iterator](), e3[Symbol.iterator]()) : t2 instanceof Map && e3 instanceof Map || t2 instanceof Set && e3 instanceof Set ? t2.size !== e3.size ? false : f$9(t2.entries(), e3.entries()) : p$5(t2) && p$5(e3) ? f$9(Object.entries(t2)[Symbol.iterator](), Object.entries(e3)[Symbol.iterator]()) : false;
|
|
2759
2759
|
}
|
|
2760
|
-
function f$9(t2,
|
|
2760
|
+
function f$9(t2, e3) {
|
|
2761
2761
|
do {
|
|
2762
|
-
let r2 = t2.next(), s2 =
|
|
2762
|
+
let r2 = t2.next(), s2 = e3.next();
|
|
2763
2763
|
if (r2.done && s2.done) return true;
|
|
2764
2764
|
if (r2.done || s2.done || !Object.is(r2.value, s2.value)) return false;
|
|
2765
2765
|
} while (true);
|
|
2766
2766
|
}
|
|
2767
2767
|
function p$5(t2) {
|
|
2768
2768
|
if (Object.prototype.toString.call(t2) !== "[object Object]") return false;
|
|
2769
|
-
let
|
|
2770
|
-
return
|
|
2769
|
+
let e3 = Object.getPrototypeOf(t2);
|
|
2770
|
+
return e3 === null || Object.getPrototypeOf(e3) === null;
|
|
2771
2771
|
}
|
|
2772
2772
|
function k$4(t2) {
|
|
2773
|
-
let [
|
|
2773
|
+
let [e3, r2] = t2(), s2 = o$7();
|
|
2774
2774
|
return (...l2) => {
|
|
2775
|
-
|
|
2775
|
+
e3(...l2), s2.dispose(), s2.microTask(r2);
|
|
2776
2776
|
};
|
|
2777
2777
|
}
|
|
2778
2778
|
var a$8 = Object.defineProperty;
|
|
2779
|
-
var r$2 = (
|
|
2780
|
-
var p$4 = (
|
|
2779
|
+
var r$2 = (e3, c3, t2) => c3 in e3 ? a$8(e3, c3, { enumerable: true, configurable: true, writable: true, value: t2 }) : e3[c3] = t2;
|
|
2780
|
+
var p$4 = (e3, c3, t2) => (r$2(e3, typeof c3 != "symbol" ? c3 + "" : c3, t2), t2);
|
|
2781
2781
|
var k$3 = ((t2) => (t2[t2.Push = 0] = "Push", t2[t2.Pop = 1] = "Pop", t2))(k$3 || {});
|
|
2782
|
-
let y$4 = { [0](
|
|
2783
|
-
let t2 = c3.id, s2 =
|
|
2782
|
+
let y$4 = { [0](e3, c3) {
|
|
2783
|
+
let t2 = c3.id, s2 = e3.stack, i2 = e3.stack.indexOf(t2);
|
|
2784
2784
|
if (i2 !== -1) {
|
|
2785
|
-
let n2 =
|
|
2786
|
-
return n2.splice(i2, 1), n2.push(t2), s2 = n2, { ...
|
|
2787
|
-
}
|
|
2788
|
-
return { ...
|
|
2789
|
-
}, [1](
|
|
2790
|
-
let t2 = c3.id, s2 =
|
|
2791
|
-
if (s2 === -1) return
|
|
2792
|
-
let i2 =
|
|
2793
|
-
return i2.splice(s2, 1), { ...
|
|
2785
|
+
let n2 = e3.stack.slice();
|
|
2786
|
+
return n2.splice(i2, 1), n2.push(t2), s2 = n2, { ...e3, stack: s2 };
|
|
2787
|
+
}
|
|
2788
|
+
return { ...e3, stack: [...e3.stack, t2] };
|
|
2789
|
+
}, [1](e3, c3) {
|
|
2790
|
+
let t2 = c3.id, s2 = e3.stack.indexOf(t2);
|
|
2791
|
+
if (s2 === -1) return e3;
|
|
2792
|
+
let i2 = e3.stack.slice();
|
|
2793
|
+
return i2.splice(s2, 1), { ...e3, stack: i2 };
|
|
2794
2794
|
} };
|
|
2795
2795
|
let o$2 = class o2 extends T$3 {
|
|
2796
2796
|
constructor() {
|
|
@@ -2949,38 +2949,38 @@ function requireWithSelector() {
|
|
|
2949
2949
|
return withSelector.exports;
|
|
2950
2950
|
}
|
|
2951
2951
|
var withSelectorExports = requireWithSelector();
|
|
2952
|
-
function S$5(
|
|
2953
|
-
return withSelectorExports.useSyncExternalStoreWithSelector(o$6((i2) =>
|
|
2952
|
+
function S$5(e3, n2, r2 = j$4) {
|
|
2953
|
+
return withSelectorExports.useSyncExternalStoreWithSelector(o$6((i2) => e3.subscribe(s$6, i2)), o$6(() => e3.state), o$6(() => e3.state), o$6(n2), r2);
|
|
2954
2954
|
}
|
|
2955
|
-
function s$6(
|
|
2956
|
-
return
|
|
2955
|
+
function s$6(e3) {
|
|
2956
|
+
return e3;
|
|
2957
2957
|
}
|
|
2958
2958
|
function I$4(o4, s2) {
|
|
2959
|
-
let t2 = useId$1(), r2 = x$4.get(s2), [i2, c3] = S$5(r2, useCallback((
|
|
2959
|
+
let t2 = useId$1(), r2 = x$4.get(s2), [i2, c3] = S$5(r2, useCallback((e3) => [r2.selectors.isTop(e3, t2), r2.selectors.inStack(e3, t2)], [r2, t2]));
|
|
2960
2960
|
return n$6(() => {
|
|
2961
2961
|
if (o4) return r2.actions.push(t2), () => r2.actions.pop(t2);
|
|
2962
2962
|
}, [r2, o4, t2]), o4 ? c3 ? i2 : true : false;
|
|
2963
2963
|
}
|
|
2964
2964
|
let f$8 = /* @__PURE__ */ new Map(), u$8 = /* @__PURE__ */ new Map();
|
|
2965
2965
|
function h$4(t2) {
|
|
2966
|
-
var
|
|
2967
|
-
let r2 = (
|
|
2966
|
+
var e3;
|
|
2967
|
+
let r2 = (e3 = u$8.get(t2)) != null ? e3 : 0;
|
|
2968
2968
|
return u$8.set(t2, r2 + 1), r2 !== 0 ? () => m$2(t2) : (f$8.set(t2, { "aria-hidden": t2.getAttribute("aria-hidden"), inert: t2.inert }), t2.setAttribute("aria-hidden", "true"), t2.inert = true, () => m$2(t2));
|
|
2969
2969
|
}
|
|
2970
2970
|
function m$2(t2) {
|
|
2971
2971
|
var i2;
|
|
2972
2972
|
let r2 = (i2 = u$8.get(t2)) != null ? i2 : 1;
|
|
2973
2973
|
if (r2 === 1 ? u$8.delete(t2) : u$8.set(t2, r2 - 1), r2 !== 1) return;
|
|
2974
|
-
let
|
|
2975
|
-
|
|
2974
|
+
let e3 = f$8.get(t2);
|
|
2975
|
+
e3 && (e3["aria-hidden"] === null ? t2.removeAttribute("aria-hidden") : t2.setAttribute("aria-hidden", e3["aria-hidden"]), t2.inert = e3.inert, f$8.delete(t2));
|
|
2976
2976
|
}
|
|
2977
|
-
function y$3(t2, { allowed: r2, disallowed:
|
|
2977
|
+
function y$3(t2, { allowed: r2, disallowed: e3 } = {}) {
|
|
2978
2978
|
let i2 = I$4(t2, "inert-others");
|
|
2979
2979
|
n$6(() => {
|
|
2980
2980
|
var d3, c3;
|
|
2981
2981
|
if (!i2) return;
|
|
2982
2982
|
let a4 = o$7();
|
|
2983
|
-
for (let n2 of (d3 =
|
|
2983
|
+
for (let n2 of (d3 = e3 == null ? void 0 : e3()) != null ? d3 : []) n2 && a4.add(h$4(n2));
|
|
2984
2984
|
let s2 = (c3 = r2 == null ? void 0 : r2()) != null ? c3 : [];
|
|
2985
2985
|
for (let n2 of s2) {
|
|
2986
2986
|
if (!n2) continue;
|
|
@@ -2993,44 +2993,44 @@ function y$3(t2, { allowed: r2, disallowed: e2 } = {}) {
|
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
2995
|
return a4.dispose;
|
|
2996
|
-
}, [i2, r2,
|
|
2996
|
+
}, [i2, r2, e3]);
|
|
2997
2997
|
}
|
|
2998
2998
|
function p$3(s2, n2, o4) {
|
|
2999
2999
|
let i2 = s$b((t2) => {
|
|
3000
|
-
let
|
|
3001
|
-
|
|
3000
|
+
let e3 = t2.getBoundingClientRect();
|
|
3001
|
+
e3.x === 0 && e3.y === 0 && e3.width === 0 && e3.height === 0 && o4();
|
|
3002
3002
|
});
|
|
3003
3003
|
useEffect(() => {
|
|
3004
3004
|
if (!s2) return;
|
|
3005
3005
|
let t2 = n2 === null ? null : n$4(n2) ? n2 : n2.current;
|
|
3006
3006
|
if (!t2) return;
|
|
3007
|
-
let
|
|
3007
|
+
let e3 = o$7();
|
|
3008
3008
|
if (typeof ResizeObserver != "undefined") {
|
|
3009
3009
|
let r2 = new ResizeObserver(() => i2.current(t2));
|
|
3010
|
-
r2.observe(t2),
|
|
3010
|
+
r2.observe(t2), e3.add(() => r2.disconnect());
|
|
3011
3011
|
}
|
|
3012
3012
|
if (typeof IntersectionObserver != "undefined") {
|
|
3013
3013
|
let r2 = new IntersectionObserver(() => i2.current(t2));
|
|
3014
|
-
r2.observe(t2),
|
|
3014
|
+
r2.observe(t2), e3.add(() => r2.disconnect());
|
|
3015
3015
|
}
|
|
3016
|
-
return () =>
|
|
3016
|
+
return () => e3.dispose();
|
|
3017
3017
|
}, [n2, i2, s2]);
|
|
3018
3018
|
}
|
|
3019
|
-
let E$2 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "details>summary", "textarea:not([disabled])"].map((
|
|
3019
|
+
let E$2 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "details>summary", "textarea:not([disabled])"].map((e3) => `${e3}:not([tabindex='-1'])`).join(","), S$4 = ["[data-autofocus]"].map((e3) => `${e3}:not([tabindex='-1'])`).join(",");
|
|
3020
3020
|
var T$2 = ((o4) => (o4[o4.First = 1] = "First", o4[o4.Previous = 2] = "Previous", o4[o4.Next = 4] = "Next", o4[o4.Last = 8] = "Last", o4[o4.WrapAround = 16] = "WrapAround", o4[o4.NoScroll = 32] = "NoScroll", o4[o4.AutoFocus = 64] = "AutoFocus", o4))(T$2 || {}), A$1 = ((n2) => (n2[n2.Error = 0] = "Error", n2[n2.Overflow = 1] = "Overflow", n2[n2.Success = 2] = "Success", n2[n2.Underflow = 3] = "Underflow", n2))(A$1 || {}), O$2 = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(O$2 || {});
|
|
3021
|
-
function x$3(
|
|
3022
|
-
return
|
|
3021
|
+
function x$3(e3 = document.body) {
|
|
3022
|
+
return e3 == null ? [] : Array.from(e3.querySelectorAll(E$2)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
3023
3023
|
}
|
|
3024
|
-
function h$3(
|
|
3025
|
-
return
|
|
3024
|
+
function h$3(e3 = document.body) {
|
|
3025
|
+
return e3 == null ? [] : Array.from(e3.querySelectorAll(S$4)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
3026
3026
|
}
|
|
3027
3027
|
var I$3 = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(I$3 || {});
|
|
3028
|
-
function H$1(
|
|
3028
|
+
function H$1(e3, r2 = 0) {
|
|
3029
3029
|
var t2;
|
|
3030
|
-
return
|
|
3031
|
-
return
|
|
3030
|
+
return e3 === ((t2 = l$7(e3)) == null ? void 0 : t2.body) ? false : u$e(r2, { [0]() {
|
|
3031
|
+
return e3.matches(E$2);
|
|
3032
3032
|
}, [1]() {
|
|
3033
|
-
let l2 =
|
|
3033
|
+
let l2 = e3;
|
|
3034
3034
|
for (; l2 !== null; ) {
|
|
3035
3035
|
if (l2.matches(E$2)) return true;
|
|
3036
3036
|
l2 = l2.parentElement;
|
|
@@ -3039,32 +3039,32 @@ function H$1(e2, r2 = 0) {
|
|
|
3039
3039
|
} });
|
|
3040
3040
|
}
|
|
3041
3041
|
var g$1 = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(g$1 || {});
|
|
3042
|
-
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (
|
|
3043
|
-
|
|
3044
|
-
}, true), document.addEventListener("click", (
|
|
3045
|
-
|
|
3042
|
+
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e3) => {
|
|
3043
|
+
e3.metaKey || e3.altKey || e3.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
3044
|
+
}, true), document.addEventListener("click", (e3) => {
|
|
3045
|
+
e3.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e3.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
3046
3046
|
}, true));
|
|
3047
|
-
function w$4(
|
|
3048
|
-
|
|
3047
|
+
function w$4(e3) {
|
|
3048
|
+
e3 == null || e3.focus({ preventScroll: true });
|
|
3049
3049
|
}
|
|
3050
3050
|
let _$3 = ["textarea", "input"].join(",");
|
|
3051
|
-
function P$2(
|
|
3051
|
+
function P$2(e3) {
|
|
3052
3052
|
var r2, t2;
|
|
3053
|
-
return (t2 = (r2 =
|
|
3053
|
+
return (t2 = (r2 = e3 == null ? void 0 : e3.matches) == null ? void 0 : r2.call(e3, _$3)) != null ? t2 : false;
|
|
3054
3054
|
}
|
|
3055
|
-
function G$1(
|
|
3056
|
-
return
|
|
3055
|
+
function G$1(e3, r2 = (t2) => t2) {
|
|
3056
|
+
return e3.slice().sort((t2, l2) => {
|
|
3057
3057
|
let n2 = r2(t2), a4 = r2(l2);
|
|
3058
3058
|
if (n2 === null || a4 === null) return 0;
|
|
3059
3059
|
let u3 = n2.compareDocumentPosition(a4);
|
|
3060
3060
|
return u3 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : u3 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3061
3061
|
});
|
|
3062
3062
|
}
|
|
3063
|
-
function R(
|
|
3064
|
-
return v$2(x$3(t2), r2, { relativeTo:
|
|
3063
|
+
function R(e3, r2, t2 = e3 === null ? document.body : r$6(e3)) {
|
|
3064
|
+
return v$2(x$3(t2), r2, { relativeTo: e3 });
|
|
3065
3065
|
}
|
|
3066
|
-
function v$2(
|
|
3067
|
-
let a4 = Array.isArray(
|
|
3066
|
+
function v$2(e3, r2, { sorted: t2 = true, relativeTo: l2 = null, skipElements: n2 = [] } = {}) {
|
|
3067
|
+
let a4 = Array.isArray(e3) ? e3.length > 0 ? r$6(e3[0]) : document : r$6(e3), u3 = Array.isArray(e3) ? t2 ? G$1(e3) : e3 : r2 & 64 ? h$3(e3) : x$3(e3);
|
|
3068
3068
|
n2.length > 0 && u3.length > 1 && (u3 = u3.filter((i2) => !n2.some((d3) => d3 != null && "current" in d3 ? (d3 == null ? void 0 : d3.current) === i2 : d3 === i2))), l2 = l2 != null ? l2 : a4 == null ? void 0 : a4.activeElement;
|
|
3069
3069
|
let o4 = (() => {
|
|
3070
3070
|
if (r2 & 5) return 1;
|
|
@@ -3098,60 +3098,60 @@ function i$2() {
|
|
|
3098
3098
|
function n$2() {
|
|
3099
3099
|
return t$2() || i$2();
|
|
3100
3100
|
}
|
|
3101
|
-
function i$1(t2,
|
|
3101
|
+
function i$1(t2, e3, o4, n2) {
|
|
3102
3102
|
let u3 = s$b(o4);
|
|
3103
3103
|
useEffect(() => {
|
|
3104
3104
|
if (!t2) return;
|
|
3105
3105
|
function r2(m2) {
|
|
3106
3106
|
u3.current(m2);
|
|
3107
3107
|
}
|
|
3108
|
-
return document.addEventListener(
|
|
3109
|
-
}, [t2,
|
|
3108
|
+
return document.addEventListener(e3, r2, n2), () => document.removeEventListener(e3, r2, n2);
|
|
3109
|
+
}, [t2, e3, n2]);
|
|
3110
3110
|
}
|
|
3111
|
-
function s$5(t2,
|
|
3111
|
+
function s$5(t2, e3, o4, n2) {
|
|
3112
3112
|
let i2 = s$b(o4);
|
|
3113
3113
|
useEffect(() => {
|
|
3114
3114
|
if (!t2) return;
|
|
3115
3115
|
function r2(d3) {
|
|
3116
3116
|
i2.current(d3);
|
|
3117
3117
|
}
|
|
3118
|
-
return window.addEventListener(
|
|
3119
|
-
}, [t2,
|
|
3118
|
+
return window.addEventListener(e3, r2, n2), () => window.removeEventListener(e3, r2, n2);
|
|
3119
|
+
}, [t2, e3, n2]);
|
|
3120
3120
|
}
|
|
3121
3121
|
const C$3 = 30;
|
|
3122
3122
|
function k$2(o4, f2, h3) {
|
|
3123
|
-
let m2 = s$b(h3), s2 = useCallback(function(
|
|
3124
|
-
if (
|
|
3125
|
-
let r2 = c3(
|
|
3123
|
+
let m2 = s$b(h3), s2 = useCallback(function(e3, c3) {
|
|
3124
|
+
if (e3.defaultPrevented) return;
|
|
3125
|
+
let r2 = c3(e3);
|
|
3126
3126
|
if (r2 === null || !r2.getRootNode().contains(r2) || !r2.isConnected) return;
|
|
3127
3127
|
let M2 = (function u3(n2) {
|
|
3128
3128
|
return typeof n2 == "function" ? u3(n2()) : Array.isArray(n2) || n2 instanceof Set ? n2 : [n2];
|
|
3129
3129
|
})(f2);
|
|
3130
|
-
for (let u3 of M2) if (u3 !== null && (u3.contains(r2) ||
|
|
3131
|
-
return !H$1(r2, I$3.Loose) && r2.tabIndex !== -1 &&
|
|
3130
|
+
for (let u3 of M2) if (u3 !== null && (u3.contains(r2) || e3.composed && e3.composedPath().includes(u3))) return;
|
|
3131
|
+
return !H$1(r2, I$3.Loose) && r2.tabIndex !== -1 && e3.preventDefault(), m2.current(e3, r2);
|
|
3132
3132
|
}, [m2, f2]), i2 = useRef(null);
|
|
3133
3133
|
i$1(o4, "pointerdown", (t2) => {
|
|
3134
|
-
var
|
|
3135
|
-
n$2() || (i2.current = ((c3 = (
|
|
3134
|
+
var e3, c3;
|
|
3135
|
+
n$2() || (i2.current = ((c3 = (e3 = t2.composedPath) == null ? void 0 : e3.call(t2)) == null ? void 0 : c3[0]) || t2.target);
|
|
3136
3136
|
}, true), i$1(o4, "pointerup", (t2) => {
|
|
3137
3137
|
if (n$2() || !i2.current) return;
|
|
3138
|
-
let
|
|
3139
|
-
return i2.current = null, s2(t2, () =>
|
|
3138
|
+
let e3 = i2.current;
|
|
3139
|
+
return i2.current = null, s2(t2, () => e3);
|
|
3140
3140
|
}, true);
|
|
3141
3141
|
let l2 = useRef({ x: 0, y: 0 });
|
|
3142
3142
|
i$1(o4, "touchstart", (t2) => {
|
|
3143
3143
|
l2.current.x = t2.touches[0].clientX, l2.current.y = t2.touches[0].clientY;
|
|
3144
3144
|
}, true), i$1(o4, "touchend", (t2) => {
|
|
3145
|
-
let
|
|
3146
|
-
if (!(Math.abs(
|
|
3145
|
+
let e3 = { x: t2.changedTouches[0].clientX, y: t2.changedTouches[0].clientY };
|
|
3146
|
+
if (!(Math.abs(e3.x - l2.current.x) >= C$3 || Math.abs(e3.y - l2.current.y) >= C$3)) return s2(t2, () => i$4(t2.target) ? t2.target : null);
|
|
3147
3147
|
}, true), s$5(o4, "blur", (t2) => s2(t2, () => u$c(window.document.activeElement) ? window.document.activeElement : null), true);
|
|
3148
3148
|
}
|
|
3149
|
-
function u$7(...
|
|
3150
|
-
return useMemo(() => l$7(...
|
|
3149
|
+
function u$7(...e3) {
|
|
3150
|
+
return useMemo(() => l$7(...e3), [...e3]);
|
|
3151
3151
|
}
|
|
3152
|
-
var H = ((
|
|
3152
|
+
var H = ((e3) => (e3[e3.Ignore = 0] = "Ignore", e3[e3.Select = 1] = "Select", e3[e3.Close = 2] = "Close", e3))(H || {});
|
|
3153
3153
|
const S$3 = { Ignore: { kind: 0 }, Select: (r2) => ({ kind: 1, target: r2 }), Close: { kind: 2 } }, M$2 = 200, f$7 = 5;
|
|
3154
|
-
function L(r2, { trigger: n2, action: T3, close:
|
|
3154
|
+
function L(r2, { trigger: n2, action: T3, close: e3, select: p2 }) {
|
|
3155
3155
|
let l2 = useRef(null), i2 = useRef(null), u3 = useRef(null);
|
|
3156
3156
|
i$1(r2 && n2 !== null, "pointerdown", (t2) => {
|
|
3157
3157
|
o$5(t2 == null ? void 0 : t2.target) && n2 != null && n2.contains(t2.target) && (i2.current = t2.x, u3.current = t2.y, l2.current = t2.timeStamp);
|
|
@@ -3164,37 +3164,37 @@ function L(r2, { trigger: n2, action: T3, close: e2, select: p2 }) {
|
|
|
3164
3164
|
case 0:
|
|
3165
3165
|
return;
|
|
3166
3166
|
case 1: {
|
|
3167
|
-
t2.timeStamp - c3 > M$2 && (p2(a4.target),
|
|
3167
|
+
t2.timeStamp - c3 > M$2 && (p2(a4.target), e3());
|
|
3168
3168
|
break;
|
|
3169
3169
|
}
|
|
3170
3170
|
case 2: {
|
|
3171
|
-
|
|
3171
|
+
e3();
|
|
3172
3172
|
break;
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
3175
|
}, { capture: true });
|
|
3176
3176
|
}
|
|
3177
|
-
function E$1(n2,
|
|
3177
|
+
function E$1(n2, e3, a4, t2) {
|
|
3178
3178
|
let i2 = s$b(a4);
|
|
3179
3179
|
useEffect(() => {
|
|
3180
3180
|
n2 = n2 != null ? n2 : window;
|
|
3181
3181
|
function r2(o4) {
|
|
3182
3182
|
i2.current(o4);
|
|
3183
3183
|
}
|
|
3184
|
-
return n2.addEventListener(
|
|
3185
|
-
}, [n2,
|
|
3184
|
+
return n2.addEventListener(e3, r2, t2), () => n2.removeEventListener(e3, r2, t2);
|
|
3185
|
+
}, [n2, e3, t2]);
|
|
3186
3186
|
}
|
|
3187
|
-
function v$1(
|
|
3187
|
+
function v$1(e3) {
|
|
3188
3188
|
let l2 = useRef({ value: "", selectionStart: null, selectionEnd: null });
|
|
3189
|
-
return E$1(
|
|
3189
|
+
return E$1(e3, "blur", (n2) => {
|
|
3190
3190
|
let t2 = n2.target;
|
|
3191
3191
|
l$3(t2) && (l2.current = { value: t2.value, selectionStart: t2.selectionStart, selectionEnd: t2.selectionEnd });
|
|
3192
3192
|
}), o$6(() => {
|
|
3193
|
-
if (!d$2(
|
|
3194
|
-
if (
|
|
3193
|
+
if (!d$2(e3) && l$3(e3) && e3.isConnected) {
|
|
3194
|
+
if (e3.focus({ preventScroll: true }), e3.value !== l2.current.value) e3.setSelectionRange(e3.value.length, e3.value.length);
|
|
3195
3195
|
else {
|
|
3196
3196
|
let { selectionStart: n2, selectionEnd: t2 } = l2.current;
|
|
3197
|
-
n2 !== null && t2 !== null &&
|
|
3197
|
+
n2 !== null && t2 !== null && e3.setSelectionRange(n2, t2);
|
|
3198
3198
|
}
|
|
3199
3199
|
l2.current = { value: "", selectionStart: null, selectionEnd: null };
|
|
3200
3200
|
}
|
|
@@ -3215,21 +3215,21 @@ function a$7(o4, r2) {
|
|
|
3215
3215
|
let t2 = o4(), n2 = /* @__PURE__ */ new Set();
|
|
3216
3216
|
return { getSnapshot() {
|
|
3217
3217
|
return t2;
|
|
3218
|
-
}, subscribe(
|
|
3219
|
-
return n2.add(
|
|
3220
|
-
}, dispatch(
|
|
3221
|
-
let i2 = r2[
|
|
3218
|
+
}, subscribe(e3) {
|
|
3219
|
+
return n2.add(e3), () => n2.delete(e3);
|
|
3220
|
+
}, dispatch(e3, ...s2) {
|
|
3221
|
+
let i2 = r2[e3].call(t2, ...s2);
|
|
3222
3222
|
i2 && (t2 = i2, n2.forEach((c3) => c3()));
|
|
3223
3223
|
} };
|
|
3224
3224
|
}
|
|
3225
3225
|
function d$1() {
|
|
3226
3226
|
let r2;
|
|
3227
|
-
return { before({ doc:
|
|
3227
|
+
return { before({ doc: e3 }) {
|
|
3228
3228
|
var l2;
|
|
3229
|
-
let o4 =
|
|
3229
|
+
let o4 = e3.documentElement, t2 = (l2 = e3.defaultView) != null ? l2 : window;
|
|
3230
3230
|
r2 = Math.max(0, t2.innerWidth - o4.clientWidth);
|
|
3231
|
-
}, after({ doc:
|
|
3232
|
-
let t2 =
|
|
3231
|
+
}, after({ doc: e3, d: o4 }) {
|
|
3232
|
+
let t2 = e3.documentElement, l2 = Math.max(0, t2.clientWidth - t2.offsetWidth), n2 = Math.max(0, r2 - l2);
|
|
3233
3233
|
o4.style(t2, "paddingRight", `${n2}px`);
|
|
3234
3234
|
} };
|
|
3235
3235
|
}
|
|
@@ -3248,99 +3248,99 @@ function w$3() {
|
|
|
3248
3248
|
let s2 = (c3 = window.scrollY) != null ? c3 : window.pageYOffset, l2 = null;
|
|
3249
3249
|
r2.addEventListener(o4, "click", (t2) => {
|
|
3250
3250
|
if (i$4(t2.target)) try {
|
|
3251
|
-
let
|
|
3252
|
-
if (!
|
|
3253
|
-
let { hash: n2 } = new URL(
|
|
3251
|
+
let e3 = t2.target.closest("a");
|
|
3252
|
+
if (!e3) return;
|
|
3253
|
+
let { hash: n2 } = new URL(e3.href), f2 = o4.querySelector(n2);
|
|
3254
3254
|
i$4(f2) && !a4(f2) && (l2 = f2);
|
|
3255
3255
|
} catch {
|
|
3256
3256
|
}
|
|
3257
3257
|
}, true), r2.group((t2) => {
|
|
3258
|
-
r2.addEventListener(o4, "touchstart", (
|
|
3259
|
-
if (t2.dispose(), i$4(
|
|
3260
|
-
let n2 =
|
|
3258
|
+
r2.addEventListener(o4, "touchstart", (e3) => {
|
|
3259
|
+
if (t2.dispose(), i$4(e3.target) && r$4(e3.target)) if (a4(e3.target)) {
|
|
3260
|
+
let n2 = e3.target;
|
|
3261
3261
|
for (; n2.parentElement && a4(n2.parentElement); ) n2 = n2.parentElement;
|
|
3262
3262
|
t2.style(n2, "overscrollBehavior", "contain");
|
|
3263
|
-
} else t2.style(
|
|
3263
|
+
} else t2.style(e3.target, "touchAction", "none");
|
|
3264
3264
|
});
|
|
3265
3265
|
}), r2.addEventListener(o4, "touchmove", (t2) => {
|
|
3266
3266
|
if (i$4(t2.target)) {
|
|
3267
3267
|
if (l$3(t2.target)) return;
|
|
3268
3268
|
if (a4(t2.target)) {
|
|
3269
|
-
let
|
|
3270
|
-
for (;
|
|
3271
|
-
|
|
3269
|
+
let e3 = t2.target;
|
|
3270
|
+
for (; e3.parentElement && e3.dataset.headlessuiPortal !== "" && !(e3.scrollHeight > e3.clientHeight || e3.scrollWidth > e3.clientWidth); ) e3 = e3.parentElement;
|
|
3271
|
+
e3.dataset.headlessuiPortal === "" && t2.preventDefault();
|
|
3272
3272
|
} else t2.preventDefault();
|
|
3273
3273
|
}
|
|
3274
3274
|
}, { passive: false }), r2.add(() => {
|
|
3275
|
-
var
|
|
3276
|
-
let t2 = (
|
|
3275
|
+
var e3;
|
|
3276
|
+
let t2 = (e3 = window.scrollY) != null ? e3 : window.pageYOffset;
|
|
3277
3277
|
s2 !== t2 && window.scrollTo(0, s2), l2 && l2.isConnected && (l2.scrollIntoView({ block: "nearest" }), l2 = null);
|
|
3278
3278
|
});
|
|
3279
3279
|
});
|
|
3280
3280
|
} } : {};
|
|
3281
3281
|
}
|
|
3282
3282
|
function r$1() {
|
|
3283
|
-
return { before({ doc:
|
|
3284
|
-
o4.style(
|
|
3283
|
+
return { before({ doc: e3, d: o4 }) {
|
|
3284
|
+
o4.style(e3.documentElement, "overflow", "hidden");
|
|
3285
3285
|
} };
|
|
3286
3286
|
}
|
|
3287
|
-
function r(
|
|
3287
|
+
function r(e3) {
|
|
3288
3288
|
let o4 = {};
|
|
3289
|
-
for (let t2 of
|
|
3289
|
+
for (let t2 of e3) Object.assign(o4, t2(o4));
|
|
3290
3290
|
return o4;
|
|
3291
3291
|
}
|
|
3292
|
-
let c$8 = a$7(() => /* @__PURE__ */ new Map(), { PUSH(
|
|
3292
|
+
let c$8 = a$7(() => /* @__PURE__ */ new Map(), { PUSH(e3, o4) {
|
|
3293
3293
|
var n2;
|
|
3294
|
-
let t2 = (n2 = this.get(
|
|
3295
|
-
return t2.count++, t2.meta.add(o4), t2.computedMeta = r(t2.meta), this.set(
|
|
3296
|
-
}, POP(
|
|
3297
|
-
let t2 = this.get(
|
|
3294
|
+
let t2 = (n2 = this.get(e3)) != null ? n2 : { doc: e3, count: 0, d: o$7(), meta: /* @__PURE__ */ new Set(), computedMeta: {} };
|
|
3295
|
+
return t2.count++, t2.meta.add(o4), t2.computedMeta = r(t2.meta), this.set(e3, t2), this;
|
|
3296
|
+
}, POP(e3, o4) {
|
|
3297
|
+
let t2 = this.get(e3);
|
|
3298
3298
|
return t2 && (t2.count--, t2.meta.delete(o4), t2.computedMeta = r(t2.meta)), this;
|
|
3299
|
-
}, SCROLL_PREVENT(
|
|
3300
|
-
let o4 = { doc:
|
|
3301
|
-
return
|
|
3299
|
+
}, SCROLL_PREVENT(e3) {
|
|
3300
|
+
let o4 = { doc: e3.doc, d: e3.d, meta() {
|
|
3301
|
+
return e3.computedMeta;
|
|
3302
3302
|
} }, t2 = [w$3(), d$1(), r$1()];
|
|
3303
3303
|
t2.forEach(({ before: n2 }) => n2 == null ? void 0 : n2(o4)), t2.forEach(({ after: n2 }) => n2 == null ? void 0 : n2(o4));
|
|
3304
|
-
}, SCROLL_ALLOW({ d:
|
|
3305
|
-
|
|
3306
|
-
}, TEARDOWN({ doc:
|
|
3307
|
-
this.delete(
|
|
3304
|
+
}, SCROLL_ALLOW({ d: e3 }) {
|
|
3305
|
+
e3.dispose();
|
|
3306
|
+
}, TEARDOWN({ doc: e3 }) {
|
|
3307
|
+
this.delete(e3);
|
|
3308
3308
|
} });
|
|
3309
3309
|
c$8.subscribe(() => {
|
|
3310
|
-
let
|
|
3311
|
-
for (let [t2] of
|
|
3312
|
-
for (let t2 of
|
|
3310
|
+
let e3 = c$8.getSnapshot(), o4 = /* @__PURE__ */ new Map();
|
|
3311
|
+
for (let [t2] of e3) o4.set(t2, t2.documentElement.style.overflow);
|
|
3312
|
+
for (let t2 of e3.values()) {
|
|
3313
3313
|
let n2 = o4.get(t2.doc) === "hidden", a4 = t2.count !== 0;
|
|
3314
3314
|
(a4 && !n2 || !a4 && n2) && c$8.dispatch(t2.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", t2), t2.count === 0 && c$8.dispatch("TEARDOWN", t2);
|
|
3315
3315
|
}
|
|
3316
3316
|
});
|
|
3317
|
-
function a$6(r2,
|
|
3318
|
-
let f2 = o$1(c$8), o4 =
|
|
3317
|
+
function a$6(r2, e3, n2 = () => ({ containers: [] })) {
|
|
3318
|
+
let f2 = o$1(c$8), o4 = e3 ? f2.get(e3) : void 0, i2 = o4 ? o4.count > 0 : false;
|
|
3319
3319
|
return n$6(() => {
|
|
3320
|
-
if (!(!
|
|
3321
|
-
}, [r2,
|
|
3320
|
+
if (!(!e3 || !r2)) return c$8.dispatch("PUSH", e3, n2), () => c$8.dispatch("POP", e3, n2);
|
|
3321
|
+
}, [r2, e3]), i2;
|
|
3322
3322
|
}
|
|
3323
|
-
function f$6(
|
|
3324
|
-
let r2 = I$4(
|
|
3323
|
+
function f$6(e3, c3, n2 = () => [document.body]) {
|
|
3324
|
+
let r2 = I$4(e3, "scroll-lock");
|
|
3325
3325
|
a$6(r2, c3, (t2) => {
|
|
3326
3326
|
var o4;
|
|
3327
3327
|
return { containers: [...(o4 = t2.containers) != null ? o4 : [], n2] };
|
|
3328
3328
|
});
|
|
3329
3329
|
}
|
|
3330
|
-
function t$1(
|
|
3331
|
-
return [
|
|
3330
|
+
function t$1(e3) {
|
|
3331
|
+
return [e3.screenX, e3.screenY];
|
|
3332
3332
|
}
|
|
3333
3333
|
function u$6() {
|
|
3334
|
-
let
|
|
3334
|
+
let e3 = useRef([-1, -1]);
|
|
3335
3335
|
return { wasMoved(r2) {
|
|
3336
3336
|
let n2 = t$1(r2);
|
|
3337
|
-
return
|
|
3337
|
+
return e3.current[0] === n2[0] && e3.current[1] === n2[1] ? false : (e3.current = n2, true);
|
|
3338
3338
|
}, update(r2) {
|
|
3339
|
-
|
|
3339
|
+
e3.current = t$1(r2);
|
|
3340
3340
|
} };
|
|
3341
3341
|
}
|
|
3342
3342
|
function c$7(u3 = 0) {
|
|
3343
|
-
let [r2, a4] = useState(u3), g2 = useCallback((
|
|
3343
|
+
let [r2, a4] = useState(u3), g2 = useCallback((e3) => a4(e3), []), s2 = useCallback((e3) => a4((l2) => l2 | e3), []), m2 = useCallback((e3) => (r2 & e3) === e3, [r2]), n2 = useCallback((e3) => a4((l2) => l2 & ~e3), []), F2 = useCallback((e3) => a4((l2) => l2 ^ e3), []);
|
|
3344
3344
|
return { flags: r2, setFlag: g2, addFlag: s2, hasFlag: m2, removeFlag: n2, toggleFlag: F2 };
|
|
3345
3345
|
}
|
|
3346
3346
|
var T$1, S$2;
|
|
@@ -3349,16 +3349,16 @@ typeof process != "undefined" && typeof globalThis != "undefined" && typeof Elem
|
|
|
3349
3349
|
`)), [];
|
|
3350
3350
|
});
|
|
3351
3351
|
var A = ((i2) => (i2[i2.None = 0] = "None", i2[i2.Closed = 1] = "Closed", i2[i2.Enter = 2] = "Enter", i2[i2.Leave = 4] = "Leave", i2))(A || {});
|
|
3352
|
-
function x$2(
|
|
3352
|
+
function x$2(e3) {
|
|
3353
3353
|
let r2 = {};
|
|
3354
|
-
for (let t2 in
|
|
3354
|
+
for (let t2 in e3) e3[t2] === true && (r2[`data-${t2}`] = "");
|
|
3355
3355
|
return r2;
|
|
3356
3356
|
}
|
|
3357
|
-
function N(
|
|
3358
|
-
let [i2, a4] = useState(t2), { hasFlag: s2, addFlag: o4, removeFlag: l2 } = c$7(
|
|
3357
|
+
function N(e3, r2, t2, n2) {
|
|
3358
|
+
let [i2, a4] = useState(t2), { hasFlag: s2, addFlag: o4, removeFlag: l2 } = c$7(e3 && i2 ? 3 : 0), u3 = useRef(false), f2 = useRef(false), E2 = p$7();
|
|
3359
3359
|
return n$6(() => {
|
|
3360
3360
|
var d3;
|
|
3361
|
-
if (
|
|
3361
|
+
if (e3) {
|
|
3362
3362
|
if (t2 && a4(true), !r2) {
|
|
3363
3363
|
t2 && o4(3);
|
|
3364
3364
|
return;
|
|
@@ -3372,60 +3372,60 @@ function N(e2, r2, t2, n2) {
|
|
|
3372
3372
|
f2.current && D$4(r2) || (u3.current = false, l2(7), t2 || a4(false), (p2 = n2 == null ? void 0 : n2.end) == null || p2.call(n2, t2));
|
|
3373
3373
|
} });
|
|
3374
3374
|
}
|
|
3375
|
-
}, [
|
|
3375
|
+
}, [e3, t2, r2, E2]), e3 ? [i2, { closed: s2(1), enter: s2(2), leave: s2(4), transition: s2(2) || s2(4) }] : [t2, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
3376
3376
|
}
|
|
3377
|
-
function C$2(
|
|
3377
|
+
function C$2(e3, { prepare: r2, run: t2, done: n2, inFlight: i2 }) {
|
|
3378
3378
|
let a4 = o$7();
|
|
3379
|
-
return j$3(
|
|
3379
|
+
return j$3(e3, { prepare: r2, inFlight: i2 }), a4.nextFrame(() => {
|
|
3380
3380
|
t2(), a4.requestAnimationFrame(() => {
|
|
3381
|
-
a4.add(M$1(
|
|
3381
|
+
a4.add(M$1(e3, n2));
|
|
3382
3382
|
});
|
|
3383
3383
|
}), a4.dispose;
|
|
3384
3384
|
}
|
|
3385
|
-
function M$1(
|
|
3385
|
+
function M$1(e3, r2) {
|
|
3386
3386
|
var a4, s2;
|
|
3387
3387
|
let t2 = o$7();
|
|
3388
|
-
if (!
|
|
3388
|
+
if (!e3) return t2.dispose;
|
|
3389
3389
|
let n2 = false;
|
|
3390
3390
|
t2.add(() => {
|
|
3391
3391
|
n2 = true;
|
|
3392
3392
|
});
|
|
3393
|
-
let i2 = (s2 = (a4 =
|
|
3393
|
+
let i2 = (s2 = (a4 = e3.getAnimations) == null ? void 0 : a4.call(e3).filter((o4) => o4 instanceof CSSTransition)) != null ? s2 : [];
|
|
3394
3394
|
return i2.length === 0 ? (r2(), t2.dispose) : (Promise.allSettled(i2.map((o4) => o4.finished)).then(() => {
|
|
3395
3395
|
n2 || r2();
|
|
3396
3396
|
}), t2.dispose);
|
|
3397
3397
|
}
|
|
3398
|
-
function j$3(
|
|
3398
|
+
function j$3(e3, { inFlight: r2, prepare: t2 }) {
|
|
3399
3399
|
if (r2 != null && r2.current) {
|
|
3400
3400
|
t2();
|
|
3401
3401
|
return;
|
|
3402
3402
|
}
|
|
3403
|
-
let n2 =
|
|
3404
|
-
|
|
3403
|
+
let n2 = e3.style.transition;
|
|
3404
|
+
e3.style.transition = "none", t2(), e3.offsetHeight, e3.style.transition = n2;
|
|
3405
3405
|
}
|
|
3406
|
-
function D$4(
|
|
3406
|
+
function D$4(e3) {
|
|
3407
3407
|
var t2, n2;
|
|
3408
|
-
return ((n2 = (t2 =
|
|
3408
|
+
return ((n2 = (t2 = e3.getAnimations) == null ? void 0 : t2.call(e3)) != null ? n2 : []).some((i2) => i2 instanceof CSSTransition && i2.playState !== "finished");
|
|
3409
3409
|
}
|
|
3410
|
-
function F$2(c3, { container:
|
|
3410
|
+
function F$2(c3, { container: e3, accept: t2, walk: r2 }) {
|
|
3411
3411
|
let o4 = useRef(t2), l2 = useRef(r2);
|
|
3412
3412
|
useEffect(() => {
|
|
3413
3413
|
o4.current = t2, l2.current = r2;
|
|
3414
3414
|
}, [t2, r2]), n$6(() => {
|
|
3415
|
-
if (!
|
|
3416
|
-
let n2 = l$7(
|
|
3415
|
+
if (!e3 || !c3) return;
|
|
3416
|
+
let n2 = l$7(e3);
|
|
3417
3417
|
if (!n2) return;
|
|
3418
|
-
let f2 = o4.current, p2 = l2.current, i2 = Object.assign((m2) => f2(m2), { acceptNode: f2 }), u3 = n2.createTreeWalker(
|
|
3418
|
+
let f2 = o4.current, p2 = l2.current, i2 = Object.assign((m2) => f2(m2), { acceptNode: f2 }), u3 = n2.createTreeWalker(e3, NodeFilter.SHOW_ELEMENT, i2, false);
|
|
3419
3419
|
for (; u3.nextNode(); ) p2(u3.currentNode);
|
|
3420
|
-
}, [
|
|
3420
|
+
}, [e3, c3, o4, l2]);
|
|
3421
3421
|
}
|
|
3422
3422
|
function m$1(u3, t2) {
|
|
3423
|
-
let
|
|
3423
|
+
let e3 = useRef([]), r2 = o$6(u3);
|
|
3424
3424
|
useEffect(() => {
|
|
3425
|
-
let o4 = [...
|
|
3426
|
-
for (let [a4, l2] of t2.entries()) if (
|
|
3425
|
+
let o4 = [...e3.current];
|
|
3426
|
+
for (let [a4, l2] of t2.entries()) if (e3.current[a4] !== l2) {
|
|
3427
3427
|
let n2 = r2(t2, o4);
|
|
3428
|
-
return
|
|
3428
|
+
return e3.current = t2, n2;
|
|
3429
3429
|
}
|
|
3430
3430
|
}, [r2, ...t2]);
|
|
3431
3431
|
}
|
|
@@ -5495,11 +5495,11 @@ function useInnerOffset(context, props) {
|
|
|
5495
5495
|
const initialOverflowRef = React.useRef(null);
|
|
5496
5496
|
React.useEffect(() => {
|
|
5497
5497
|
if (!enabled) return;
|
|
5498
|
-
function onWheel(
|
|
5499
|
-
if (
|
|
5498
|
+
function onWheel(e3) {
|
|
5499
|
+
if (e3.ctrlKey || !el || overflowRef.current == null) {
|
|
5500
5500
|
return;
|
|
5501
5501
|
}
|
|
5502
|
-
const dY =
|
|
5502
|
+
const dY = e3.deltaY;
|
|
5503
5503
|
const isAtTop = overflowRef.current.top >= -0.5;
|
|
5504
5504
|
const isAtBottom = overflowRef.current.bottom >= -0.5;
|
|
5505
5505
|
const remainingScroll = el.scrollHeight - el.clientHeight;
|
|
@@ -5509,7 +5509,7 @@ function useInnerOffset(context, props) {
|
|
|
5509
5509
|
return;
|
|
5510
5510
|
}
|
|
5511
5511
|
if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
|
|
5512
|
-
|
|
5512
|
+
e3.preventDefault();
|
|
5513
5513
|
ReactDOM.flushSync(() => {
|
|
5514
5514
|
onChange((d3) => d3 + Math[method](dY, remainingScroll * sign));
|
|
5515
5515
|
});
|
|
@@ -5571,8 +5571,8 @@ let y$2 = createContext({ styles: void 0, setReference: () => {
|
|
|
5571
5571
|
y$2.displayName = "FloatingContext";
|
|
5572
5572
|
let $$1 = createContext(null);
|
|
5573
5573
|
$$1.displayName = "PlacementContext";
|
|
5574
|
-
function ye(
|
|
5575
|
-
return useMemo(() =>
|
|
5574
|
+
function ye(e3) {
|
|
5575
|
+
return useMemo(() => e3 ? typeof e3 == "string" ? { to: e3 } : e3 : null, [e3]);
|
|
5576
5576
|
}
|
|
5577
5577
|
function Fe$3() {
|
|
5578
5578
|
return useContext(y$2).setReference;
|
|
@@ -5581,12 +5581,12 @@ function be() {
|
|
|
5581
5581
|
return useContext(y$2).getReferenceProps;
|
|
5582
5582
|
}
|
|
5583
5583
|
function Te$1() {
|
|
5584
|
-
let { getFloatingProps:
|
|
5585
|
-
return useCallback((...n2) => Object.assign({},
|
|
5584
|
+
let { getFloatingProps: e3, slot: t2 } = useContext(y$2);
|
|
5585
|
+
return useCallback((...n2) => Object.assign({}, e3(...n2), { "data-anchor": t2.anchor }), [e3, t2]);
|
|
5586
5586
|
}
|
|
5587
|
-
function Re$1(
|
|
5588
|
-
|
|
5589
|
-
let t2 = useContext($$1), n2 = useMemo(() =>
|
|
5587
|
+
function Re$1(e3 = null) {
|
|
5588
|
+
e3 === false && (e3 = null), typeof e3 == "string" && (e3 = { to: e3 });
|
|
5589
|
+
let t2 = useContext($$1), n2 = useMemo(() => e3, [JSON.stringify(e3, (l2, o4) => {
|
|
5590
5590
|
var u3;
|
|
5591
5591
|
return (u3 = o4 == null ? void 0 : o4.outerHTML) != null ? u3 : o4;
|
|
5592
5592
|
})]);
|
|
@@ -5594,10 +5594,10 @@ function Re$1(e2 = null) {
|
|
|
5594
5594
|
t2 == null || t2(n2 != null ? n2 : null);
|
|
5595
5595
|
}, [t2, n2]);
|
|
5596
5596
|
let r2 = useContext(y$2);
|
|
5597
|
-
return useMemo(() => [r2.setFloating,
|
|
5597
|
+
return useMemo(() => [r2.setFloating, e3 ? r2.styles : {}], [r2.setFloating, e3, r2.styles]);
|
|
5598
5598
|
}
|
|
5599
5599
|
let D$3 = 4;
|
|
5600
|
-
function Ae$2({ children:
|
|
5600
|
+
function Ae$2({ children: e3, enabled: t2 = true }) {
|
|
5601
5601
|
let [n2, r2] = useState(null), [l2, o4] = useState(0), u3 = useRef(null), [f2, s2] = useState(null);
|
|
5602
5602
|
ce(f2);
|
|
5603
5603
|
let i2 = t2 && n2 !== null && f2 !== null, { to: F2 = "bottom", gap: E2 = 0, offset: A2 = 0, padding: c3 = 0, inner: h3 } = ge$1(n2, f2), [a4, p2 = "center"] = F2.split(" ");
|
|
@@ -5629,28 +5629,28 @@ function Ae$2({ children: e2, enabled: t2 = true }) {
|
|
|
5629
5629
|
let G2 = useMemo(() => ({ anchor: [w2, V2].filter(Boolean).join(" ") }), [w2, V2]), K2 = useInnerOffset(g2, { overflowRef: u3, onChange: o4 }), { getReferenceProps: Q2, getFloatingProps: X2 } = useInteractions([K2]), Y2 = o$6((P2) => {
|
|
5630
5630
|
s2(P2), b3.setFloating(P2);
|
|
5631
5631
|
});
|
|
5632
|
-
return React.createElement($$1.Provider, { value: r2 }, React.createElement(y$2.Provider, { value: { setFloating: Y2, setReference: b3.setReference, styles: S2, getReferenceProps: Q2, getFloatingProps: X2, slot: G2 } },
|
|
5632
|
+
return React.createElement($$1.Provider, { value: r2 }, React.createElement(y$2.Provider, { value: { setFloating: Y2, setReference: b3.setReference, styles: S2, getReferenceProps: Q2, getFloatingProps: X2, slot: G2 } }, e3));
|
|
5633
5633
|
}
|
|
5634
|
-
function ce(
|
|
5634
|
+
function ce(e3) {
|
|
5635
5635
|
n$6(() => {
|
|
5636
|
-
if (!
|
|
5636
|
+
if (!e3) return;
|
|
5637
5637
|
let t2 = new MutationObserver(() => {
|
|
5638
|
-
let n2 = window.getComputedStyle(
|
|
5638
|
+
let n2 = window.getComputedStyle(e3).maxHeight, r2 = parseFloat(n2);
|
|
5639
5639
|
if (isNaN(r2)) return;
|
|
5640
5640
|
let l2 = parseInt(n2);
|
|
5641
|
-
isNaN(l2) || r2 !== l2 && (
|
|
5641
|
+
isNaN(l2) || r2 !== l2 && (e3.style.maxHeight = `${Math.ceil(r2)}px`);
|
|
5642
5642
|
});
|
|
5643
|
-
return t2.observe(
|
|
5643
|
+
return t2.observe(e3, { attributes: true, attributeFilter: ["style"] }), () => {
|
|
5644
5644
|
t2.disconnect();
|
|
5645
5645
|
};
|
|
5646
|
-
}, [
|
|
5646
|
+
}, [e3]);
|
|
5647
5647
|
}
|
|
5648
|
-
function ge$1(
|
|
5648
|
+
function ge$1(e3, t2) {
|
|
5649
5649
|
var o4, u3, f2;
|
|
5650
|
-
let n2 = O$1((o4 =
|
|
5651
|
-
return { ...
|
|
5650
|
+
let n2 = O$1((o4 = e3 == null ? void 0 : e3.gap) != null ? o4 : "var(--anchor-gap, 0)", t2), r2 = O$1((u3 = e3 == null ? void 0 : e3.offset) != null ? u3 : "var(--anchor-offset, 0)", t2), l2 = O$1((f2 = e3 == null ? void 0 : e3.padding) != null ? f2 : "var(--anchor-padding, 0)", t2);
|
|
5651
|
+
return { ...e3, gap: n2, offset: r2, padding: l2 };
|
|
5652
5652
|
}
|
|
5653
|
-
function O$1(
|
|
5653
|
+
function O$1(e3, t2, n2 = void 0) {
|
|
5654
5654
|
let r2 = p$7(), l2 = o$6((s2, i2) => {
|
|
5655
5655
|
if (s2 == null) return [n2, null];
|
|
5656
5656
|
if (typeof s2 == "number") return [s2, null];
|
|
@@ -5680,14 +5680,14 @@ function O$1(e2, t2, n2 = void 0) {
|
|
|
5680
5680
|
}];
|
|
5681
5681
|
}
|
|
5682
5682
|
return [n2, null];
|
|
5683
|
-
}), o4 = useMemo(() => l2(
|
|
5683
|
+
}), o4 = useMemo(() => l2(e3, t2)[0], [e3, t2]), [u3 = o4, f2] = useState();
|
|
5684
5684
|
return n$6(() => {
|
|
5685
|
-
let [s2, i2] = l2(
|
|
5685
|
+
let [s2, i2] = l2(e3, t2);
|
|
5686
5686
|
if (f2(s2), !!i2) return i2(f2);
|
|
5687
|
-
}, [
|
|
5687
|
+
}, [e3, t2]), u3;
|
|
5688
5688
|
}
|
|
5689
|
-
function q(
|
|
5690
|
-
let t2 = /var\((.*)\)/.exec(
|
|
5689
|
+
function q(e3) {
|
|
5690
|
+
let t2 = /var\((.*)\)/.exec(e3);
|
|
5691
5691
|
if (t2) {
|
|
5692
5692
|
let n2 = t2[1].indexOf(",");
|
|
5693
5693
|
if (n2 === -1) return [t2[1]];
|
|
@@ -5696,24 +5696,24 @@ function q(e2) {
|
|
|
5696
5696
|
}
|
|
5697
5697
|
return [];
|
|
5698
5698
|
}
|
|
5699
|
-
function J$1(
|
|
5699
|
+
function J$1(e3, t2) {
|
|
5700
5700
|
let n2 = document.createElement("div");
|
|
5701
|
-
t2.appendChild(n2), n2.style.setProperty("margin-top", "0px", "important"), n2.style.setProperty("margin-top",
|
|
5701
|
+
t2.appendChild(n2), n2.style.setProperty("margin-top", "0px", "important"), n2.style.setProperty("margin-top", e3, "important");
|
|
5702
5702
|
let r2 = parseFloat(window.getComputedStyle(n2).marginTop) || 0;
|
|
5703
5703
|
return t2.removeChild(n2), r2;
|
|
5704
5704
|
}
|
|
5705
|
-
function f$5({ children: t2, freeze:
|
|
5706
|
-
let n2 = u$5(
|
|
5705
|
+
function f$5({ children: t2, freeze: e3 }, o4) {
|
|
5706
|
+
let n2 = u$5(e3, t2);
|
|
5707
5707
|
return isValidElement(n2) ? cloneElement(n2, { ref: o4 }) : React__default.createElement(React__default.Fragment, null, n2);
|
|
5708
5708
|
}
|
|
5709
5709
|
const s$4 = React__default.forwardRef(f$5);
|
|
5710
|
-
function u$5(t2,
|
|
5711
|
-
let [o4, n2] = useState(
|
|
5712
|
-
return !t2 && o4 !==
|
|
5710
|
+
function u$5(t2, e3) {
|
|
5711
|
+
let [o4, n2] = useState(e3);
|
|
5712
|
+
return !t2 && o4 !== e3 && n2(e3), t2 ? o4 : e3;
|
|
5713
5713
|
}
|
|
5714
5714
|
let n$1 = createContext(null);
|
|
5715
5715
|
n$1.displayName = "OpenClosedContext";
|
|
5716
|
-
var i = ((
|
|
5716
|
+
var i = ((e3) => (e3[e3.Open = 1] = "Open", e3[e3.Closed = 2] = "Closed", e3[e3.Closing = 4] = "Closing", e3[e3.Opening = 8] = "Opening", e3))(i || {});
|
|
5717
5717
|
function u$4() {
|
|
5718
5718
|
return useContext(n$1);
|
|
5719
5719
|
}
|
|
@@ -5724,19 +5724,19 @@ function s$3({ children: o4 }) {
|
|
|
5724
5724
|
return React__default.createElement(n$1.Provider, { value: null }, o4);
|
|
5725
5725
|
}
|
|
5726
5726
|
function t(n2) {
|
|
5727
|
-
function
|
|
5728
|
-
document.readyState !== "loading" && (n2(), document.removeEventListener("DOMContentLoaded",
|
|
5727
|
+
function e3() {
|
|
5728
|
+
document.readyState !== "loading" && (n2(), document.removeEventListener("DOMContentLoaded", e3));
|
|
5729
5729
|
}
|
|
5730
|
-
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("DOMContentLoaded",
|
|
5730
|
+
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("DOMContentLoaded", e3), e3());
|
|
5731
5731
|
}
|
|
5732
5732
|
let n = [];
|
|
5733
5733
|
t(() => {
|
|
5734
|
-
function
|
|
5734
|
+
function e3(t2) {
|
|
5735
5735
|
if (!i$4(t2.target) || t2.target === document.body || n[0] === t2.target) return;
|
|
5736
5736
|
let r2 = t2.target;
|
|
5737
5737
|
r2 = r2.closest(E$2), n.unshift(r2 != null ? r2 : t2.target), n = n.filter((o4) => o4 != null && o4.isConnected), n.splice(10);
|
|
5738
5738
|
}
|
|
5739
|
-
window.addEventListener("click",
|
|
5739
|
+
window.addEventListener("click", e3, { capture: true }), window.addEventListener("mousedown", e3, { capture: true }), window.addEventListener("focus", e3, { capture: true }), document.body.addEventListener("click", e3, { capture: true }), document.body.addEventListener("mousedown", e3, { capture: true }), document.body.addEventListener("focus", e3, { capture: true });
|
|
5740
5740
|
});
|
|
5741
5741
|
function u$3(l2) {
|
|
5742
5742
|
throw new Error("Unexpected object: " + l2);
|
|
@@ -5748,24 +5748,24 @@ function f$4(l2, n2) {
|
|
|
5748
5748
|
let r2 = n2.resolveActiveIndex(), s2 = r2 != null ? r2 : -1;
|
|
5749
5749
|
switch (l2.focus) {
|
|
5750
5750
|
case 0: {
|
|
5751
|
-
for (let
|
|
5751
|
+
for (let e3 = 0; e3 < t2.length; ++e3) if (!n2.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
5752
5752
|
return r2;
|
|
5753
5753
|
}
|
|
5754
5754
|
case 1: {
|
|
5755
5755
|
s2 === -1 && (s2 = t2.length);
|
|
5756
|
-
for (let
|
|
5756
|
+
for (let e3 = s2 - 1; e3 >= 0; --e3) if (!n2.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
5757
5757
|
return r2;
|
|
5758
5758
|
}
|
|
5759
5759
|
case 2: {
|
|
5760
|
-
for (let
|
|
5760
|
+
for (let e3 = s2 + 1; e3 < t2.length; ++e3) if (!n2.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
5761
5761
|
return r2;
|
|
5762
5762
|
}
|
|
5763
5763
|
case 3: {
|
|
5764
|
-
for (let
|
|
5764
|
+
for (let e3 = t2.length - 1; e3 >= 0; --e3) if (!n2.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
5765
5765
|
return r2;
|
|
5766
5766
|
}
|
|
5767
5767
|
case 4: {
|
|
5768
|
-
for (let
|
|
5768
|
+
for (let e3 = 0; e3 < t2.length; ++e3) if (n2.resolveId(t2[e3], e3, t2) === l2.id) return e3;
|
|
5769
5769
|
return r2;
|
|
5770
5770
|
}
|
|
5771
5771
|
case 5:
|
|
@@ -5775,34 +5775,34 @@ function f$4(l2, n2) {
|
|
|
5775
5775
|
}
|
|
5776
5776
|
}
|
|
5777
5777
|
function c$4(t2) {
|
|
5778
|
-
let r2 = o$6(t2),
|
|
5779
|
-
useEffect(() => (
|
|
5780
|
-
|
|
5781
|
-
|
|
5778
|
+
let r2 = o$6(t2), e3 = useRef(false);
|
|
5779
|
+
useEffect(() => (e3.current = false, () => {
|
|
5780
|
+
e3.current = true, t$5(() => {
|
|
5781
|
+
e3.current && r2();
|
|
5782
5782
|
});
|
|
5783
5783
|
}), [r2]);
|
|
5784
5784
|
}
|
|
5785
|
-
let
|
|
5785
|
+
let e2 = createContext(false);
|
|
5786
5786
|
function a$5() {
|
|
5787
|
-
return useContext(
|
|
5787
|
+
return useContext(e2);
|
|
5788
5788
|
}
|
|
5789
5789
|
function l$1(o4) {
|
|
5790
|
-
return React__default.createElement(
|
|
5790
|
+
return React__default.createElement(e2.Provider, { value: o4.force }, o4.children);
|
|
5791
5791
|
}
|
|
5792
|
-
function W$1(
|
|
5792
|
+
function W$1(e3) {
|
|
5793
5793
|
let o4 = a$5(), l2 = useContext(c$3), [r2, p2] = useState(() => {
|
|
5794
5794
|
var s2;
|
|
5795
5795
|
if (!o4 && l2 !== null) return (s2 = l2.current) != null ? s2 : null;
|
|
5796
5796
|
if (s$c.isServer) return null;
|
|
5797
|
-
let t2 =
|
|
5797
|
+
let t2 = e3 == null ? void 0 : e3.getElementById("headlessui-portal-root");
|
|
5798
5798
|
if (t2) return t2;
|
|
5799
|
-
if (
|
|
5800
|
-
let n2 =
|
|
5801
|
-
return n2.setAttribute("id", "headlessui-portal-root"),
|
|
5799
|
+
if (e3 === null) return null;
|
|
5800
|
+
let n2 = e3.createElement("div");
|
|
5801
|
+
return n2.setAttribute("id", "headlessui-portal-root"), e3.body.appendChild(n2);
|
|
5802
5802
|
});
|
|
5803
5803
|
return useEffect(() => {
|
|
5804
|
-
r2 !== null && (
|
|
5805
|
-
}, [r2,
|
|
5804
|
+
r2 !== null && (e3 != null && e3.body.contains(r2) || e3 == null || e3.body.appendChild(r2));
|
|
5805
|
+
}, [r2, e3]), useEffect(() => {
|
|
5806
5806
|
o4 || l2 !== null && p2(l2.current);
|
|
5807
5807
|
}, [l2, p2, o4]), r2;
|
|
5808
5808
|
}
|
|
@@ -5817,59 +5817,59 @@ let _$2 = Fragment$1, j$2 = Y(function(o4, l2) {
|
|
|
5817
5817
|
g2.dispose(), y3 && a4 && g2.add(y3.register(a4));
|
|
5818
5818
|
} }, v2({ ourProps: { ref: n2 }, theirProps: p2, slot: {}, defaultTag: _$2, name: "Portal" })), u3) : null;
|
|
5819
5819
|
});
|
|
5820
|
-
function S$1(
|
|
5821
|
-
let l2 = y$5(o4), { enabled: r2 = true, ownerDocument: p2, ...t2 } =
|
|
5820
|
+
function S$1(e3, o4) {
|
|
5821
|
+
let l2 = y$5(o4), { enabled: r2 = true, ownerDocument: p2, ...t2 } = e3, n2 = K();
|
|
5822
5822
|
return r2 ? React__default.createElement(j$2, { ...t2, ownerDocument: p2, ref: l2 }) : n2({ ourProps: { ref: l2 }, theirProps: t2, slot: {}, defaultTag: _$2, name: "Portal" });
|
|
5823
5823
|
}
|
|
5824
5824
|
let I$2 = Fragment$1, c$3 = createContext(null);
|
|
5825
|
-
function D$2(
|
|
5826
|
-
let { target: l2, ...r2 } =
|
|
5825
|
+
function D$2(e3, o4) {
|
|
5826
|
+
let { target: l2, ...r2 } = e3, t2 = { ref: y$5(o4) }, n2 = K();
|
|
5827
5827
|
return React__default.createElement(c$3.Provider, { value: l2 }, n2({ ourProps: t2, theirProps: r2, defaultTag: I$2, name: "Popover.Group" }));
|
|
5828
5828
|
}
|
|
5829
5829
|
let m = createContext(null);
|
|
5830
5830
|
function ee$1() {
|
|
5831
|
-
let
|
|
5831
|
+
let e3 = useContext(m), o4 = useRef([]), l2 = o$6((t2) => (o4.current.push(t2), e3 && e3.register(t2), () => r2(t2))), r2 = o$6((t2) => {
|
|
5832
5832
|
let n2 = o4.current.indexOf(t2);
|
|
5833
|
-
n2 !== -1 && o4.current.splice(n2, 1),
|
|
5833
|
+
n2 !== -1 && o4.current.splice(n2, 1), e3 && e3.unregister(t2);
|
|
5834
5834
|
}), p2 = useMemo(() => ({ register: l2, unregister: r2, portals: o4 }), [l2, r2, o4]);
|
|
5835
5835
|
return [o4, useMemo(() => function({ children: n2 }) {
|
|
5836
5836
|
return React__default.createElement(m.Provider, { value: p2 }, n2);
|
|
5837
5837
|
}, [p2])];
|
|
5838
5838
|
}
|
|
5839
5839
|
let J = Y(S$1), X$1 = Y(D$2), te$2 = Object.assign(J, { Group: X$1 });
|
|
5840
|
-
const c$2 = { Idle: { kind: "Idle" }, Tracked: (
|
|
5841
|
-
function a$4(
|
|
5842
|
-
let t2 =
|
|
5840
|
+
const c$2 = { Idle: { kind: "Idle" }, Tracked: (e3) => ({ kind: "Tracked", position: e3 }), Moved: { kind: "Moved" } };
|
|
5841
|
+
function a$4(e3) {
|
|
5842
|
+
let t2 = e3.getBoundingClientRect();
|
|
5843
5843
|
return `${t2.x},${t2.y}`;
|
|
5844
5844
|
}
|
|
5845
|
-
function p$2(
|
|
5845
|
+
function p$2(e3, t2, i2) {
|
|
5846
5846
|
let n2 = o$7();
|
|
5847
5847
|
if (t2.kind === "Tracked") {
|
|
5848
5848
|
let o4 = function() {
|
|
5849
|
-
d3 !== a$4(
|
|
5849
|
+
d3 !== a$4(e3) && (n2.dispose(), i2());
|
|
5850
5850
|
};
|
|
5851
5851
|
let { position: d3 } = t2, s2 = new ResizeObserver(o4);
|
|
5852
|
-
s2.observe(
|
|
5852
|
+
s2.observe(e3), n2.add(() => s2.disconnect()), n2.addEventListener(window, "scroll", o4, { passive: true }), n2.addEventListener(window, "resize", o4);
|
|
5853
5853
|
}
|
|
5854
5854
|
return () => n2.dispose();
|
|
5855
5855
|
}
|
|
5856
5856
|
var I$1 = Object.defineProperty;
|
|
5857
|
-
var h$2 = (t2, i2,
|
|
5858
|
-
var f$3 = (t2, i2,
|
|
5859
|
-
var P$1 = ((
|
|
5860
|
-
function v(t2, i2 = (
|
|
5861
|
-
let
|
|
5857
|
+
var h$2 = (t2, i2, e3) => i2 in t2 ? I$1(t2, i2, { enumerable: true, configurable: true, writable: true, value: e3 }) : t2[i2] = e3;
|
|
5858
|
+
var f$3 = (t2, i2, e3) => (h$2(t2, typeof i2 != "symbol" ? i2 + "" : i2, e3), e3);
|
|
5859
|
+
var P$1 = ((e3) => (e3[e3.Open = 0] = "Open", e3[e3.Closed = 1] = "Closed", e3))(P$1 || {}), k$1 = ((e3) => (e3[e3.Single = 0] = "Single", e3[e3.Multi = 1] = "Multi", e3))(k$1 || {}), _$1 = ((n2) => (n2[n2.Pointer = 0] = "Pointer", n2[n2.Focus = 1] = "Focus", n2[n2.Other = 2] = "Other", n2))(_$1 || {}), D$1 = ((l2) => (l2[l2.OpenCombobox = 0] = "OpenCombobox", l2[l2.CloseCombobox = 1] = "CloseCombobox", l2[l2.GoToOption = 2] = "GoToOption", l2[l2.SetTyping = 3] = "SetTyping", l2[l2.RegisterOption = 4] = "RegisterOption", l2[l2.UnregisterOption = 5] = "UnregisterOption", l2[l2.DefaultToFirstOption = 6] = "DefaultToFirstOption", l2[l2.SetActivationTrigger = 7] = "SetActivationTrigger", l2[l2.UpdateVirtualConfiguration = 8] = "UpdateVirtualConfiguration", l2[l2.SetInputElement = 9] = "SetInputElement", l2[l2.SetButtonElement = 10] = "SetButtonElement", l2[l2.SetOptionsElement = 11] = "SetOptionsElement", l2[l2.MarkInputAsMoved = 12] = "MarkInputAsMoved", l2))(D$1 || {});
|
|
5860
|
+
function v(t2, i2 = (e3) => e3) {
|
|
5861
|
+
let e3 = t2.activeOptionIndex !== null ? t2.options[t2.activeOptionIndex] : null, n2 = i2(t2.options.slice()), o4 = n2.length > 0 && n2[0].dataRef.current.order !== null ? n2.sort((u3, a4) => u3.dataRef.current.order - a4.dataRef.current.order) : G$1(n2, (u3) => u3.dataRef.current.domRef.current), r2 = e3 ? o4.indexOf(e3) : null;
|
|
5862
5862
|
return r2 === -1 && (r2 = null), { options: o4, activeOptionIndex: r2 };
|
|
5863
5863
|
}
|
|
5864
5864
|
let j$1 = { [1](t2) {
|
|
5865
|
-
var
|
|
5866
|
-
if ((
|
|
5865
|
+
var e3;
|
|
5866
|
+
if ((e3 = t2.dataRef.current) != null && e3.disabled || t2.comboboxState === 1) return t2;
|
|
5867
5867
|
let i2 = t2.inputElement ? c$2.Tracked(a$4(t2.inputElement)) : t2.inputPositionState;
|
|
5868
5868
|
return { ...t2, activeOptionIndex: null, comboboxState: 1, isTyping: false, activationTrigger: 2, inputPositionState: i2, __demoMode: false };
|
|
5869
5869
|
}, [0](t2) {
|
|
5870
|
-
var i2,
|
|
5870
|
+
var i2, e3;
|
|
5871
5871
|
if ((i2 = t2.dataRef.current) != null && i2.disabled || t2.comboboxState === 0) return t2;
|
|
5872
|
-
if ((
|
|
5872
|
+
if ((e3 = t2.dataRef.current) != null && e3.value) {
|
|
5873
5873
|
let n2 = t2.dataRef.current.calculateIndex(t2.dataRef.current.value);
|
|
5874
5874
|
if (n2 !== -1) return { ...t2, activeOptionIndex: n2, comboboxState: 0, __demoMode: false, inputPositionState: c$2.Idle };
|
|
5875
5875
|
}
|
|
@@ -5888,105 +5888,105 @@ let j$1 = { [1](t2) {
|
|
|
5888
5888
|
} }), b3 = (a4 = i2.trigger) != null ? a4 : 2;
|
|
5889
5889
|
return t2.activeOptionIndex === m2 && t2.activationTrigger === b3 ? t2 : { ...t2, activeOptionIndex: m2, activationTrigger: b3, isTyping: false, __demoMode: false };
|
|
5890
5890
|
}
|
|
5891
|
-
let
|
|
5892
|
-
if (
|
|
5893
|
-
let p2 =
|
|
5894
|
-
p2 !== -1 && (
|
|
5891
|
+
let e3 = v(t2);
|
|
5892
|
+
if (e3.activeOptionIndex === null) {
|
|
5893
|
+
let p2 = e3.options.findIndex((c3) => !c3.dataRef.current.disabled);
|
|
5894
|
+
p2 !== -1 && (e3.activeOptionIndex = p2);
|
|
5895
5895
|
}
|
|
5896
|
-
let n2 = i2.focus === c$5.Specific ? i2.idx : f$4(i2, { resolveItems: () =>
|
|
5897
|
-
return t2.activeOptionIndex === n2 && t2.activationTrigger === o4 ? t2 : { ...t2, ...
|
|
5896
|
+
let n2 = i2.focus === c$5.Specific ? i2.idx : f$4(i2, { resolveItems: () => e3.options, resolveActiveIndex: () => e3.activeOptionIndex, resolveId: (p2) => p2.id, resolveDisabled: (p2) => p2.dataRef.current.disabled }), o4 = (s2 = i2.trigger) != null ? s2 : 2;
|
|
5897
|
+
return t2.activeOptionIndex === n2 && t2.activationTrigger === o4 ? t2 : { ...t2, ...e3, isTyping: false, activeOptionIndex: n2, activationTrigger: o4, __demoMode: false };
|
|
5898
5898
|
}, [4]: (t2, i2) => {
|
|
5899
5899
|
var r2, u3, a4, s2;
|
|
5900
5900
|
if ((r2 = t2.dataRef.current) != null && r2.virtual) return { ...t2, options: [...t2.options, i2.payload] };
|
|
5901
|
-
let
|
|
5902
|
-
t2.activeOptionIndex === null && (a4 = (u3 = t2.dataRef.current).isSelected) != null && a4.call(u3, i2.payload.dataRef.current.value) && (n2.activeOptionIndex = n2.options.indexOf(
|
|
5901
|
+
let e3 = i2.payload, n2 = v(t2, (p2) => (p2.push(e3), p2));
|
|
5902
|
+
t2.activeOptionIndex === null && (a4 = (u3 = t2.dataRef.current).isSelected) != null && a4.call(u3, i2.payload.dataRef.current.value) && (n2.activeOptionIndex = n2.options.indexOf(e3));
|
|
5903
5903
|
let o4 = { ...t2, ...n2, activationTrigger: 2 };
|
|
5904
5904
|
return (s2 = t2.dataRef.current) != null && s2.__demoMode && t2.dataRef.current.value === void 0 && (o4.activeOptionIndex = 0), o4;
|
|
5905
5905
|
}, [5]: (t2, i2) => {
|
|
5906
5906
|
var n2;
|
|
5907
5907
|
if ((n2 = t2.dataRef.current) != null && n2.virtual) return { ...t2, options: t2.options.filter((o4) => o4.id !== i2.id) };
|
|
5908
|
-
let
|
|
5908
|
+
let e3 = v(t2, (o4) => {
|
|
5909
5909
|
let r2 = o4.findIndex((u3) => u3.id === i2.id);
|
|
5910
5910
|
return r2 !== -1 && o4.splice(r2, 1), o4;
|
|
5911
5911
|
});
|
|
5912
|
-
return { ...t2, ...
|
|
5912
|
+
return { ...t2, ...e3, activationTrigger: 2 };
|
|
5913
5913
|
}, [6]: (t2, i2) => t2.defaultToFirstOption === i2.value ? t2 : { ...t2, defaultToFirstOption: i2.value }, [7]: (t2, i2) => t2.activationTrigger === i2.trigger ? t2 : { ...t2, activationTrigger: i2.trigger }, [8]: (t2, i2) => {
|
|
5914
5914
|
var n2, o4;
|
|
5915
5915
|
if (t2.virtual === null) return { ...t2, virtual: { options: i2.options, disabled: (n2 = i2.disabled) != null ? n2 : () => false } };
|
|
5916
5916
|
if (t2.virtual.options === i2.options && t2.virtual.disabled === i2.disabled) return t2;
|
|
5917
|
-
let
|
|
5917
|
+
let e3 = t2.activeOptionIndex;
|
|
5918
5918
|
if (t2.activeOptionIndex !== null) {
|
|
5919
5919
|
let r2 = i2.options.indexOf(t2.virtual.options[t2.activeOptionIndex]);
|
|
5920
|
-
r2 !== -1 ?
|
|
5920
|
+
r2 !== -1 ? e3 = r2 : e3 = null;
|
|
5921
5921
|
}
|
|
5922
|
-
return { ...t2, activeOptionIndex:
|
|
5922
|
+
return { ...t2, activeOptionIndex: e3, virtual: { options: i2.options, disabled: (o4 = i2.disabled) != null ? o4 : () => false } };
|
|
5923
5923
|
}, [9]: (t2, i2) => t2.inputElement === i2.element ? t2 : { ...t2, inputElement: i2.element }, [10]: (t2, i2) => t2.buttonElement === i2.element ? t2 : { ...t2, buttonElement: i2.element }, [11]: (t2, i2) => t2.optionsElement === i2.element ? t2 : { ...t2, optionsElement: i2.element }, [12](t2) {
|
|
5924
5924
|
return t2.inputPositionState.kind !== "Tracked" ? t2 : { ...t2, inputPositionState: c$2.Moved };
|
|
5925
5925
|
} };
|
|
5926
5926
|
let y$1 = class y extends T$3 {
|
|
5927
|
-
constructor(
|
|
5928
|
-
super(
|
|
5929
|
-
f$3(this, "actions", { onChange: (
|
|
5927
|
+
constructor(e3) {
|
|
5928
|
+
super(e3);
|
|
5929
|
+
f$3(this, "actions", { onChange: (e4) => {
|
|
5930
5930
|
let { onChange: n2, compare: o4, mode: r2, value: u3 } = this.state.dataRef.current;
|
|
5931
|
-
return u$e(r2, { [0]: () => n2 == null ? void 0 : n2(
|
|
5932
|
-
let a4 = u3.slice(), s2 = a4.findIndex((p2) => o4(p2,
|
|
5933
|
-
return s2 === -1 ? a4.push(
|
|
5931
|
+
return u$e(r2, { [0]: () => n2 == null ? void 0 : n2(e4), [1]: () => {
|
|
5932
|
+
let a4 = u3.slice(), s2 = a4.findIndex((p2) => o4(p2, e4));
|
|
5933
|
+
return s2 === -1 ? a4.push(e4) : a4.splice(s2, 1), n2 == null ? void 0 : n2(a4);
|
|
5934
5934
|
} });
|
|
5935
|
-
}, registerOption: (
|
|
5936
|
-
this.state.activeOptionIndex === this.state.dataRef.current.calculateIndex(n2.current.value) && this.send({ type: 6, value: true }), this.send({ type: 5, id:
|
|
5937
|
-
}), goToOption: (
|
|
5938
|
-
this.send({ type: 3, isTyping:
|
|
5935
|
+
}, registerOption: (e4, n2) => (this.send({ type: 4, payload: { id: e4, dataRef: n2 } }), () => {
|
|
5936
|
+
this.state.activeOptionIndex === this.state.dataRef.current.calculateIndex(n2.current.value) && this.send({ type: 6, value: true }), this.send({ type: 5, id: e4 });
|
|
5937
|
+
}), goToOption: (e4, n2) => (this.send({ type: 6, value: false }), this.send({ type: 2, ...e4, trigger: n2 })), setIsTyping: (e4) => {
|
|
5938
|
+
this.send({ type: 3, isTyping: e4 });
|
|
5939
5939
|
}, closeCombobox: () => {
|
|
5940
|
-
var
|
|
5941
|
-
this.send({ type: 1 }), this.send({ type: 6, value: false }), (n2 = (
|
|
5940
|
+
var e4, n2;
|
|
5941
|
+
this.send({ type: 1 }), this.send({ type: 6, value: false }), (n2 = (e4 = this.state.dataRef.current).onClose) == null || n2.call(e4);
|
|
5942
5942
|
}, openCombobox: () => {
|
|
5943
5943
|
this.send({ type: 0 }), this.send({ type: 6, value: true });
|
|
5944
|
-
}, setActivationTrigger: (
|
|
5945
|
-
this.send({ type: 7, trigger:
|
|
5944
|
+
}, setActivationTrigger: (e4) => {
|
|
5945
|
+
this.send({ type: 7, trigger: e4 });
|
|
5946
5946
|
}, selectActiveOption: () => {
|
|
5947
|
-
let
|
|
5948
|
-
if (
|
|
5949
|
-
if (this.actions.setIsTyping(false), this.state.virtual) this.actions.onChange(this.state.virtual.options[
|
|
5947
|
+
let e4 = this.selectors.activeOptionIndex(this.state);
|
|
5948
|
+
if (e4 !== null) {
|
|
5949
|
+
if (this.actions.setIsTyping(false), this.state.virtual) this.actions.onChange(this.state.virtual.options[e4]);
|
|
5950
5950
|
else {
|
|
5951
|
-
let { dataRef: n2 } = this.state.options[
|
|
5951
|
+
let { dataRef: n2 } = this.state.options[e4];
|
|
5952
5952
|
this.actions.onChange(n2.current.value);
|
|
5953
5953
|
}
|
|
5954
|
-
this.actions.goToOption({ focus: c$5.Specific, idx:
|
|
5955
|
-
}
|
|
5956
|
-
}, setInputElement: (
|
|
5957
|
-
this.send({ type: 9, element:
|
|
5958
|
-
}, setButtonElement: (
|
|
5959
|
-
this.send({ type: 10, element:
|
|
5960
|
-
}, setOptionsElement: (
|
|
5961
|
-
this.send({ type: 11, element:
|
|
5954
|
+
this.actions.goToOption({ focus: c$5.Specific, idx: e4 });
|
|
5955
|
+
}
|
|
5956
|
+
}, setInputElement: (e4) => {
|
|
5957
|
+
this.send({ type: 9, element: e4 });
|
|
5958
|
+
}, setButtonElement: (e4) => {
|
|
5959
|
+
this.send({ type: 10, element: e4 });
|
|
5960
|
+
}, setOptionsElement: (e4) => {
|
|
5961
|
+
this.send({ type: 11, element: e4 });
|
|
5962
5962
|
} });
|
|
5963
|
-
f$3(this, "selectors", { activeDescendantId: (
|
|
5963
|
+
f$3(this, "selectors", { activeDescendantId: (e4) => {
|
|
5964
5964
|
var o4, r2;
|
|
5965
|
-
let n2 = this.selectors.activeOptionIndex(
|
|
5966
|
-
if (n2 !== null) return
|
|
5967
|
-
}, activeOptionIndex: (
|
|
5968
|
-
if (
|
|
5969
|
-
if (
|
|
5970
|
-
let { options: o4, disabled: r2 } =
|
|
5965
|
+
let n2 = this.selectors.activeOptionIndex(e4);
|
|
5966
|
+
if (n2 !== null) return e4.virtual ? (r2 = e4.options.find((u3) => !u3.dataRef.current.disabled && e4.dataRef.current.compare(u3.dataRef.current.value, e4.virtual.options[n2]))) == null ? void 0 : r2.id : (o4 = e4.options[n2]) == null ? void 0 : o4.id;
|
|
5967
|
+
}, activeOptionIndex: (e4) => {
|
|
5968
|
+
if (e4.defaultToFirstOption && e4.activeOptionIndex === null && (e4.virtual ? e4.virtual.options.length > 0 : e4.options.length > 0)) {
|
|
5969
|
+
if (e4.virtual) {
|
|
5970
|
+
let { options: o4, disabled: r2 } = e4.virtual, u3 = o4.findIndex((a4) => {
|
|
5971
5971
|
var s2;
|
|
5972
5972
|
return !((s2 = r2 == null ? void 0 : r2(a4)) != null && s2);
|
|
5973
5973
|
});
|
|
5974
5974
|
if (u3 !== -1) return u3;
|
|
5975
5975
|
}
|
|
5976
|
-
let n2 =
|
|
5976
|
+
let n2 = e4.options.findIndex((o4) => !o4.dataRef.current.disabled);
|
|
5977
5977
|
if (n2 !== -1) return n2;
|
|
5978
5978
|
}
|
|
5979
|
-
return
|
|
5980
|
-
}, activeOption: (
|
|
5979
|
+
return e4.activeOptionIndex;
|
|
5980
|
+
}, activeOption: (e4) => {
|
|
5981
5981
|
var o4, r2;
|
|
5982
|
-
let n2 = this.selectors.activeOptionIndex(
|
|
5983
|
-
return n2 === null ? null :
|
|
5984
|
-
}, isActive: (
|
|
5982
|
+
let n2 = this.selectors.activeOptionIndex(e4);
|
|
5983
|
+
return n2 === null ? null : e4.virtual ? e4.virtual.options[n2 != null ? n2 : 0] : (r2 = (o4 = e4.options[n2]) == null ? void 0 : o4.dataRef.current.value) != null ? r2 : null;
|
|
5984
|
+
}, isActive: (e4, n2, o4) => {
|
|
5985
5985
|
var u3;
|
|
5986
|
-
let r2 = this.selectors.activeOptionIndex(
|
|
5987
|
-
return r2 === null ? false :
|
|
5988
|
-
}, shouldScrollIntoView: (
|
|
5989
|
-
return
|
|
5986
|
+
let r2 = this.selectors.activeOptionIndex(e4);
|
|
5987
|
+
return r2 === null ? false : e4.virtual ? r2 === e4.dataRef.current.calculateIndex(n2) : ((u3 = e4.options[r2]) == null ? void 0 : u3.id) === o4;
|
|
5988
|
+
}, shouldScrollIntoView: (e4, n2, o4) => !(e4.virtual || e4.__demoMode || e4.comboboxState !== 0 || e4.activationTrigger === 0 || !this.selectors.isActive(e4, n2, o4)), didInputMove(e4) {
|
|
5989
|
+
return e4.inputPositionState.kind === "Moved";
|
|
5990
5990
|
} });
|
|
5991
5991
|
{
|
|
5992
5992
|
let n2 = this.state.id, o4 = x$4.get(null);
|
|
@@ -6002,25 +6002,25 @@ let y$1 = class y extends T$3 {
|
|
|
6002
6002
|
});
|
|
6003
6003
|
});
|
|
6004
6004
|
}
|
|
6005
|
-
static new({ id:
|
|
6005
|
+
static new({ id: e3, virtual: n2 = null, __demoMode: o4 = false }) {
|
|
6006
6006
|
var r2;
|
|
6007
|
-
return new y({ id:
|
|
6007
|
+
return new y({ id: e3, dataRef: { current: {} }, comboboxState: o4 ? 0 : 1, isTyping: false, options: [], virtual: n2 ? { options: n2.options, disabled: (r2 = n2.disabled) != null ? r2 : () => false } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: o4, inputPositionState: c$2.Idle });
|
|
6008
6008
|
}
|
|
6009
|
-
reduce(
|
|
6010
|
-
return u$e(n2.type, j$1,
|
|
6009
|
+
reduce(e3, n2) {
|
|
6010
|
+
return u$e(n2.type, j$1, e3, n2);
|
|
6011
6011
|
}
|
|
6012
6012
|
};
|
|
6013
6013
|
const u$2 = createContext(null);
|
|
6014
6014
|
function p$1(n2) {
|
|
6015
6015
|
let o4 = useContext(u$2);
|
|
6016
6016
|
if (o4 === null) {
|
|
6017
|
-
let
|
|
6018
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
6017
|
+
let e3 = new Error(`<${n2} /> is missing a parent <Combobox /> component.`);
|
|
6018
|
+
throw Error.captureStackTrace && Error.captureStackTrace(e3, b$2), e3;
|
|
6019
6019
|
}
|
|
6020
6020
|
return o4;
|
|
6021
6021
|
}
|
|
6022
|
-
function b$2({ id: n2, virtual: o4 = null, __demoMode:
|
|
6023
|
-
let t2 = useMemo(() => y$1.new({ id: n2, virtual: o4, __demoMode:
|
|
6022
|
+
function b$2({ id: n2, virtual: o4 = null, __demoMode: e3 = false }) {
|
|
6023
|
+
let t2 = useMemo(() => y$1.new({ id: n2, virtual: o4, __demoMode: e3 }), []);
|
|
6024
6024
|
return c$4(() => t2.dispose()), t2;
|
|
6025
6025
|
}
|
|
6026
6026
|
let de$1 = createContext(null);
|
|
@@ -6028,14 +6028,14 @@ de$1.displayName = "ComboboxDataContext";
|
|
|
6028
6028
|
function te$1(T3) {
|
|
6029
6029
|
let O2 = useContext(de$1);
|
|
6030
6030
|
if (O2 === null) {
|
|
6031
|
-
let
|
|
6032
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
6031
|
+
let e3 = new Error(`<${T3} /> is missing a parent <Combobox /> component.`);
|
|
6032
|
+
throw Error.captureStackTrace && Error.captureStackTrace(e3, te$1), e3;
|
|
6033
6033
|
}
|
|
6034
6034
|
return O2;
|
|
6035
6035
|
}
|
|
6036
6036
|
let Le$3 = createContext(null);
|
|
6037
6037
|
function Eo(T3) {
|
|
6038
|
-
let O2 = p$1("VirtualProvider"),
|
|
6038
|
+
let O2 = p$1("VirtualProvider"), e3 = te$1("VirtualProvider"), { options: o4 } = e3.virtual, E2 = S$5(O2, (a4) => a4.optionsElement), [R2, y3] = useMemo(() => {
|
|
6039
6039
|
let a4 = E2;
|
|
6040
6040
|
if (!a4) return [0, 0];
|
|
6041
6041
|
let u3 = window.getComputedStyle(a4);
|
|
@@ -6058,14 +6058,14 @@ function Eo(T3) {
|
|
|
6058
6058
|
}
|
|
6059
6059
|
let ho = Fragment$1;
|
|
6060
6060
|
function Ao(T3, O2) {
|
|
6061
|
-
let
|
|
6061
|
+
let e3 = useId$1(), o4 = a$e(), { value: E2, defaultValue: R2, onChange: y3, form: b3, name: h3, by: p2, invalid: f2 = false, disabled: n2 = o4 || false, onClose: m2, __demoMode: a4 = false, multiple: u3 = false, immediate: A2 = false, virtual: d3 = null, nullable: X2, ...G2 } = T3, C2 = l$5(R2), [x2 = u3 ? [] : void 0, v2] = b$4(E2, y3, C2), c3 = b$2({ id: e3, virtual: d3, __demoMode: a4 }), z2 = useRef({ static: false, hold: false }), D2 = u$a(p2), K$1 = o$6((i2) => d3 ? p2 === null ? d3.options.indexOf(i2) : d3.options.findIndex((M2) => D2(M2, i2)) : c3.state.options.findIndex((M2) => D2(M2.dataRef.current.value, i2))), W2 = useCallback((i2) => u$e(l2.mode, { [k$1.Multi]: () => x2.some((M2) => D2(M2, i2)), [k$1.Single]: () => D2(x2, i2) }), [x2]), S2 = S$5(c3, (i2) => i2.virtual), j2 = o$6(() => m2 == null ? void 0 : m2()), l2 = useMemo(() => ({ __demoMode: a4, immediate: A2, optionsPropsRef: z2, value: x2, defaultValue: C2, disabled: n2, invalid: f2, mode: u3 ? k$1.Multi : k$1.Single, virtual: d3 ? S2 : null, onChange: v2, isSelected: W2, calculateIndex: K$1, compare: D2, onClose: j2 }), [a4, A2, z2, x2, C2, n2, f2, u3, d3, S2, v2, W2, K$1, D2, j2]);
|
|
6062
6062
|
n$6(() => {
|
|
6063
6063
|
var i2;
|
|
6064
6064
|
d3 && c3.send({ type: D$1.UpdateVirtualConfiguration, options: d3.options, disabled: (i2 = d3.disabled) != null ? i2 : null });
|
|
6065
6065
|
}, [d3, d3 == null ? void 0 : d3.options, d3 == null ? void 0 : d3.disabled]), n$6(() => {
|
|
6066
6066
|
c3.state.dataRef.current = l2;
|
|
6067
6067
|
}, [l2]);
|
|
6068
|
-
let [k2, Y2, s2, U2] = S$5(c3, (i2) => [i2.comboboxState, i2.buttonElement, i2.inputElement, i2.optionsElement]), $2 = x$4.get(null), ne2 = S$5($2, useCallback((i2) => $2.selectors.isTop(i2,
|
|
6068
|
+
let [k2, Y2, s2, U2] = S$5(c3, (i2) => [i2.comboboxState, i2.buttonElement, i2.inputElement, i2.optionsElement]), $2 = x$4.get(null), ne2 = S$5($2, useCallback((i2) => $2.selectors.isTop(i2, e3), [$2, e3]));
|
|
6069
6069
|
k$2(ne2, [Y2, s2, U2], () => c3.actions.closeCombobox());
|
|
6070
6070
|
let be2 = S$5(c3, c3.selectors.activeOptionIndex), ee2 = S$5(c3, c3.selectors.activeOption), q2 = n$5({ open: k2 === P$1.Open, disabled: n2, invalid: f2, activeIndex: be2, activeOption: ee2, value: x2 }), [t2, V2] = V$2(), P2 = O2 === null ? {} : { ref: O2 }, N2 = useCallback(() => {
|
|
6071
6071
|
if (C2 !== void 0) return v2 == null ? void 0 : v2(C2);
|
|
@@ -6075,23 +6075,23 @@ function Ao(T3, O2) {
|
|
|
6075
6075
|
let Io = "input";
|
|
6076
6076
|
function Ro(T3, O2) {
|
|
6077
6077
|
var ee2, q2;
|
|
6078
|
-
let
|
|
6079
|
-
|
|
6078
|
+
let e3 = p$1("Combobox.Input"), o4 = te$1("Combobox.Input"), E2 = useId$1(), R2 = u$d(), { id: y3 = R2 || `headlessui-combobox-input-${E2}`, onChange: b3, displayValue: h3, disabled: p2 = o4.disabled || false, autoFocus: f2 = false, type: n$12 = "text", ...m2 } = T3, a4 = useRef(null), u3 = y$5(a4, O2, Fe$3(), e3.actions.setInputElement), [A2, d3] = S$5(e3, (t2) => [t2.comboboxState, t2.isTyping]), X2 = p$7(), G2 = o$6(() => {
|
|
6079
|
+
e3.actions.onChange(null), e3.state.optionsElement && (e3.state.optionsElement.scrollTop = 0), e3.actions.goToOption({ focus: c$5.Nothing });
|
|
6080
6080
|
}), C2 = useMemo(() => {
|
|
6081
6081
|
var t2;
|
|
6082
6082
|
return typeof h3 == "function" && o4.value !== void 0 ? (t2 = h3(o4.value)) != null ? t2 : "" : typeof o4.value == "string" ? o4.value : "";
|
|
6083
6083
|
}, [o4.value, h3]);
|
|
6084
6084
|
m$1(([t2, V2], [P2, N2]) => {
|
|
6085
|
-
if (
|
|
6085
|
+
if (e3.state.isTyping) return;
|
|
6086
6086
|
let g2 = a4.current;
|
|
6087
6087
|
g2 && ((N2 === P$1.Open && V2 === P$1.Closed || t2 !== P2) && (g2.value = t2), requestAnimationFrame(() => {
|
|
6088
|
-
if (
|
|
6088
|
+
if (e3.state.isTyping || !g2 || d$2(g2)) return;
|
|
6089
6089
|
let { selectionStart: i2, selectionEnd: M2 } = g2;
|
|
6090
6090
|
Math.abs((M2 != null ? M2 : 0) - (i2 != null ? i2 : 0)) === 0 && i2 === 0 && g2.setSelectionRange(g2.value.length, g2.value.length);
|
|
6091
6091
|
}));
|
|
6092
6092
|
}, [C2, A2, d3]), m$1(([t2], [V2]) => {
|
|
6093
6093
|
if (t2 === P$1.Open && V2 === P$1.Closed) {
|
|
6094
|
-
if (
|
|
6094
|
+
if (e3.state.isTyping) return;
|
|
6095
6095
|
let P2 = a4.current;
|
|
6096
6096
|
if (!P2) return;
|
|
6097
6097
|
let N2 = P2.value, { selectionStart: g2, selectionEnd: i2, selectionDirection: M2 } = P2;
|
|
@@ -6105,90 +6105,90 @@ function Ro(T3, O2) {
|
|
|
6105
6105
|
x2.current = false;
|
|
6106
6106
|
});
|
|
6107
6107
|
}), z2 = o$6((t2) => {
|
|
6108
|
-
switch (
|
|
6108
|
+
switch (e3.actions.setIsTyping(true), t2.key) {
|
|
6109
6109
|
case o$4.Enter:
|
|
6110
|
-
if (
|
|
6111
|
-
if (t2.preventDefault(), t2.stopPropagation(),
|
|
6112
|
-
|
|
6110
|
+
if (e3.state.comboboxState !== P$1.Open || x2.current) return;
|
|
6111
|
+
if (t2.preventDefault(), t2.stopPropagation(), e3.selectors.activeOptionIndex(e3.state) === null) {
|
|
6112
|
+
e3.actions.closeCombobox();
|
|
6113
6113
|
return;
|
|
6114
6114
|
}
|
|
6115
|
-
|
|
6115
|
+
e3.actions.selectActiveOption(), o4.mode === k$1.Single && e3.actions.closeCombobox();
|
|
6116
6116
|
break;
|
|
6117
6117
|
case o$4.ArrowDown:
|
|
6118
|
-
return t2.preventDefault(), t2.stopPropagation(), u$e(
|
|
6118
|
+
return t2.preventDefault(), t2.stopPropagation(), u$e(e3.state.comboboxState, { [P$1.Open]: () => e3.actions.goToOption({ focus: c$5.Next }), [P$1.Closed]: () => e3.actions.openCombobox() });
|
|
6119
6119
|
case o$4.ArrowUp:
|
|
6120
|
-
return t2.preventDefault(), t2.stopPropagation(), u$e(
|
|
6121
|
-
flushSync(() =>
|
|
6120
|
+
return t2.preventDefault(), t2.stopPropagation(), u$e(e3.state.comboboxState, { [P$1.Open]: () => e3.actions.goToOption({ focus: c$5.Previous }), [P$1.Closed]: () => {
|
|
6121
|
+
flushSync(() => e3.actions.openCombobox()), o4.value || e3.actions.goToOption({ focus: c$5.Last });
|
|
6122
6122
|
} });
|
|
6123
6123
|
case o$4.Home:
|
|
6124
|
-
if (
|
|
6125
|
-
return t2.preventDefault(), t2.stopPropagation(),
|
|
6124
|
+
if (e3.state.comboboxState === P$1.Closed || t2.shiftKey) break;
|
|
6125
|
+
return t2.preventDefault(), t2.stopPropagation(), e3.actions.goToOption({ focus: c$5.First });
|
|
6126
6126
|
case o$4.PageUp:
|
|
6127
|
-
return t2.preventDefault(), t2.stopPropagation(),
|
|
6127
|
+
return t2.preventDefault(), t2.stopPropagation(), e3.actions.goToOption({ focus: c$5.First });
|
|
6128
6128
|
case o$4.End:
|
|
6129
|
-
if (
|
|
6130
|
-
return t2.preventDefault(), t2.stopPropagation(),
|
|
6129
|
+
if (e3.state.comboboxState === P$1.Closed || t2.shiftKey) break;
|
|
6130
|
+
return t2.preventDefault(), t2.stopPropagation(), e3.actions.goToOption({ focus: c$5.Last });
|
|
6131
6131
|
case o$4.PageDown:
|
|
6132
|
-
return t2.preventDefault(), t2.stopPropagation(),
|
|
6132
|
+
return t2.preventDefault(), t2.stopPropagation(), e3.actions.goToOption({ focus: c$5.Last });
|
|
6133
6133
|
case o$4.Escape:
|
|
6134
|
-
return
|
|
6134
|
+
return e3.state.comboboxState !== P$1.Open ? void 0 : (t2.preventDefault(), e3.state.optionsElement && !o4.optionsPropsRef.current.static && t2.stopPropagation(), o4.mode === k$1.Single && o4.value === null && G2(), e3.actions.closeCombobox());
|
|
6135
6135
|
case o$4.Tab:
|
|
6136
|
-
if (
|
|
6137
|
-
o4.mode === k$1.Single &&
|
|
6136
|
+
if (e3.actions.setIsTyping(false), e3.state.comboboxState !== P$1.Open) return;
|
|
6137
|
+
o4.mode === k$1.Single && e3.state.activationTrigger !== _$1.Focus && e3.actions.selectActiveOption(), e3.actions.closeCombobox();
|
|
6138
6138
|
break;
|
|
6139
6139
|
}
|
|
6140
6140
|
}), D2 = o$6((t2) => {
|
|
6141
|
-
b3 == null || b3(t2), o4.mode === k$1.Single && t2.target.value === "" && G2(),
|
|
6141
|
+
b3 == null || b3(t2), o4.mode === k$1.Single && t2.target.value === "" && G2(), e3.actions.openCombobox();
|
|
6142
6142
|
}), K$1 = o$6((t2) => {
|
|
6143
6143
|
var P2, N2, g2;
|
|
6144
6144
|
let V2 = (P2 = t2.relatedTarget) != null ? P2 : n.find((i2) => i2 !== t2.currentTarget);
|
|
6145
|
-
if (!((N2 =
|
|
6145
|
+
if (!((N2 = e3.state.optionsElement) != null && N2.contains(V2)) && !((g2 = e3.state.buttonElement) != null && g2.contains(V2)) && e3.state.comboboxState === P$1.Open) return t2.preventDefault(), o4.mode === k$1.Single && o4.value === null && G2(), e3.actions.closeCombobox();
|
|
6146
6146
|
}), W2 = o$6((t2) => {
|
|
6147
6147
|
var P2, N2, g2;
|
|
6148
6148
|
let V2 = (P2 = t2.relatedTarget) != null ? P2 : n.find((i2) => i2 !== t2.currentTarget);
|
|
6149
|
-
(N2 =
|
|
6150
|
-
flushSync(() =>
|
|
6149
|
+
(N2 = e3.state.buttonElement) != null && N2.contains(V2) || (g2 = e3.state.optionsElement) != null && g2.contains(V2) || o4.disabled || o4.immediate && e3.state.comboboxState !== P$1.Open && X2.microTask(() => {
|
|
6150
|
+
flushSync(() => e3.actions.openCombobox()), e3.actions.setActivationTrigger(_$1.Focus);
|
|
6151
6151
|
});
|
|
6152
|
-
}), S2 = N$1(), j2 = w$6(), { isFocused: l2, focusProps: k2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: f2 }), { isHovered: Y2, hoverProps: s2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: p2 }), U2 = S$5(
|
|
6152
|
+
}), S2 = N$1(), j2 = w$6(), { isFocused: l2, focusProps: k2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: f2 }), { isHovered: Y2, hoverProps: s2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: p2 }), U2 = S$5(e3, (t2) => t2.optionsElement), $2 = n$5({ open: A2 === P$1.Open, disabled: p2, invalid: o4.invalid, hover: Y2, focus: l2, autofocus: f2 }), ne2 = V$3({ ref: u3, id: y3, role: "combobox", type: n$12, "aria-controls": U2 == null ? void 0 : U2.id, "aria-expanded": A2 === P$1.Open, "aria-activedescendant": S$5(e3, e3.selectors.activeDescendantId), "aria-labelledby": S2, "aria-describedby": j2, "aria-autocomplete": "list", defaultValue: (q2 = (ee2 = T3.defaultValue) != null ? ee2 : o4.defaultValue !== void 0 ? h3 == null ? void 0 : h3(o4.defaultValue) : null) != null ? q2 : o4.defaultValue, disabled: p2 || void 0, autoFocus: f2, onCompositionStart: v2, onCompositionEnd: c3, onKeyDown: z2, onChange: D2, onFocus: W2, onBlur: K$1 }, k2, s2);
|
|
6153
6153
|
return K()({ ourProps: ne2, theirProps: m2, slot: $2, defaultTag: Io, name: "Combobox.Input" });
|
|
6154
6154
|
}
|
|
6155
6155
|
let _o = "button";
|
|
6156
6156
|
function Fo(T3, O2) {
|
|
6157
|
-
let
|
|
6157
|
+
let e3 = p$1("Combobox.Button"), o4 = te$1("Combobox.Button"), [E2, R2] = useState(null), y3 = y$5(O2, R2, e3.actions.setButtonElement), b3 = useId$1(), { id: h3 = `headlessui-combobox-button-${b3}`, disabled: p2 = o4.disabled || false, autoFocus: f2 = false, ...n2 } = T3, [m2, a4, u3] = S$5(e3, (l2) => [l2.comboboxState, l2.inputElement, l2.optionsElement]), A2 = v$1(a4), d3 = m2 === P$1.Open;
|
|
6158
6158
|
L(d3, { trigger: E2, action: useCallback((l2) => {
|
|
6159
6159
|
if (E2 != null && E2.contains(l2.target)) return S$3.Ignore;
|
|
6160
6160
|
if (a4 != null && a4.contains(l2.target)) return S$3.Ignore;
|
|
6161
6161
|
let k2 = l2.target.closest('[role="option"]:not([data-disabled])');
|
|
6162
6162
|
return n$4(k2) ? S$3.Select(k2) : u3 != null && u3.contains(l2.target) ? S$3.Ignore : S$3.Close;
|
|
6163
|
-
}, [E2, a4, u3]), close:
|
|
6163
|
+
}, [E2, a4, u3]), close: e3.actions.closeCombobox, select: e3.actions.selectActiveOption });
|
|
6164
6164
|
let X2 = o$6((l2) => {
|
|
6165
6165
|
switch (l2.key) {
|
|
6166
6166
|
case o$4.Space:
|
|
6167
6167
|
case o$4.Enter:
|
|
6168
|
-
l2.preventDefault(), l2.stopPropagation(),
|
|
6168
|
+
l2.preventDefault(), l2.stopPropagation(), e3.state.comboboxState === P$1.Closed && flushSync(() => e3.actions.openCombobox()), A2();
|
|
6169
6169
|
return;
|
|
6170
6170
|
case o$4.ArrowDown:
|
|
6171
|
-
l2.preventDefault(), l2.stopPropagation(),
|
|
6171
|
+
l2.preventDefault(), l2.stopPropagation(), e3.state.comboboxState === P$1.Closed && (flushSync(() => e3.actions.openCombobox()), e3.state.dataRef.current.value || e3.actions.goToOption({ focus: c$5.First })), A2();
|
|
6172
6172
|
return;
|
|
6173
6173
|
case o$4.ArrowUp:
|
|
6174
|
-
l2.preventDefault(), l2.stopPropagation(),
|
|
6174
|
+
l2.preventDefault(), l2.stopPropagation(), e3.state.comboboxState === P$1.Closed && (flushSync(() => e3.actions.openCombobox()), e3.state.dataRef.current.value || e3.actions.goToOption({ focus: c$5.Last })), A2();
|
|
6175
6175
|
return;
|
|
6176
6176
|
case o$4.Escape:
|
|
6177
|
-
if (
|
|
6178
|
-
l2.preventDefault(),
|
|
6177
|
+
if (e3.state.comboboxState !== P$1.Open) return;
|
|
6178
|
+
l2.preventDefault(), e3.state.optionsElement && !o4.optionsPropsRef.current.static && l2.stopPropagation(), flushSync(() => e3.actions.closeCombobox()), A2();
|
|
6179
6179
|
return;
|
|
6180
6180
|
default:
|
|
6181
6181
|
return;
|
|
6182
6182
|
}
|
|
6183
6183
|
}), G2 = s$7(() => {
|
|
6184
|
-
|
|
6184
|
+
e3.state.comboboxState === P$1.Open ? e3.actions.closeCombobox() : e3.actions.openCombobox(), A2();
|
|
6185
6185
|
}), C2 = N$1([h3]), { isFocusVisible: x2, focusProps: v2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: f2 }), { isHovered: c3, hoverProps: z2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: p2 }), { pressed: D2, pressProps: K$1 } = w$7({ disabled: p2 }), W2 = n$5({ open: m2 === P$1.Open, active: D2 || m2 === P$1.Open, disabled: p2, invalid: o4.invalid, value: o4.value, hover: c3, focus: x2 }), S2 = V$3({ ref: y3, id: h3, type: e$1(T3, E2), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": u3 == null ? void 0 : u3.id, "aria-expanded": m2 === P$1.Open, "aria-labelledby": C2, disabled: p2 || void 0, autoFocus: f2, onKeyDown: X2 }, G2, v2, z2, K$1);
|
|
6186
6186
|
return K()({ ourProps: S2, theirProps: n2, slot: W2, defaultTag: _o, name: "Combobox.Button" });
|
|
6187
6187
|
}
|
|
6188
6188
|
let Do = "div", So = A$2.RenderStrategy | A$2.Static;
|
|
6189
6189
|
function Mo$1(T3, O2) {
|
|
6190
6190
|
var M2, Ce2, ve2;
|
|
6191
|
-
let
|
|
6191
|
+
let e3 = useId$1(), { id: o4 = `headlessui-combobox-options-${e3}`, hold: E2 = false, anchor: R2, portal: y3 = false, modal: b3 = true, transition: h3 = false, ...p2 } = T3, f2 = p$1("Combobox.Options"), n2 = te$1("Combobox.Options"), m2 = ye(R2);
|
|
6192
6192
|
m2 && (y3 = true);
|
|
6193
6193
|
let [a4, u3] = Re$1(m2), [A2, d3] = useState(null), X2 = Te$1(), G2 = y$5(O2, m2 ? a4 : null, f2.actions.setOptionsElement, d3), [C2, x2, v2, c3, z2] = S$5(f2, (_2) => [_2.comboboxState, _2.inputElement, _2.buttonElement, _2.optionsElement, _2.activationTrigger]), D2 = u$7(x2 || v2), K$1 = u$7(c3), W2 = u$4(), [S2, j2] = N(h3, A2, W2 !== null ? (W2 & i.Open) === i.Open : C2 === P$1.Open);
|
|
6194
6194
|
p$3(S2, x2, f2.actions.closeCombobox);
|
|
@@ -6223,7 +6223,7 @@ function Mo$1(T3, O2) {
|
|
|
6223
6223
|
let Lo = "div";
|
|
6224
6224
|
function Vo(T3, O2) {
|
|
6225
6225
|
var l2, k2, Y2;
|
|
6226
|
-
let
|
|
6226
|
+
let e3 = te$1("Combobox.Option"), o4 = p$1("Combobox.Option"), E2 = useId$1(), { id: R2 = `headlessui-combobox-option-${E2}`, value: y3, disabled: b3 = (Y2 = (k2 = (l2 = e3.virtual) == null ? void 0 : l2.disabled) == null ? void 0 : k2.call(l2, y3)) != null ? Y2 : false, order: h3 = null, ...p2 } = T3, [f2] = S$5(o4, (s2) => [s2.inputElement]), n2 = v$1(f2), m2 = S$5(o4, useCallback((s2) => o4.selectors.isActive(s2, y3, R2), [y3, R2])), a4 = e3.isSelected(y3), u3 = useRef(null), A2 = s$b({ disabled: b3, value: y3, domRef: u3, order: h3 }), d3 = useContext(Le$3), X2 = y$5(O2, u3, d3 ? d3.measureElement : null), G2 = o$6(() => {
|
|
6227
6227
|
o4.actions.setIsTyping(false), o4.actions.onChange(y3);
|
|
6228
6228
|
});
|
|
6229
6229
|
n$6(() => o4.actions.registerOption(R2, A2), [A2, R2]);
|
|
@@ -6235,45 +6235,45 @@ function Vo(T3, O2) {
|
|
|
6235
6235
|
});
|
|
6236
6236
|
}, [C2, u3]);
|
|
6237
6237
|
let x2 = o$6((s2) => {
|
|
6238
|
-
s2.preventDefault(), s2.button === g$2.Left && (b3 || (G2(), n$2() || requestAnimationFrame(() => n2()),
|
|
6238
|
+
s2.preventDefault(), s2.button === g$2.Left && (b3 || (G2(), n$2() || requestAnimationFrame(() => n2()), e3.mode === k$1.Single && o4.actions.closeCombobox()));
|
|
6239
6239
|
}), v2 = o$6(() => {
|
|
6240
6240
|
if (b3) return o4.actions.goToOption({ focus: c$5.Nothing });
|
|
6241
|
-
let s2 =
|
|
6241
|
+
let s2 = e3.calculateIndex(y3);
|
|
6242
6242
|
o4.actions.goToOption({ focus: c$5.Specific, idx: s2 });
|
|
6243
6243
|
}), c3 = u$6(), z2 = o$6((s2) => c3.update(s2)), D2 = o$6((s2) => {
|
|
6244
6244
|
if (!c3.wasMoved(s2) || b3 || m2 && o4.state.activationTrigger === _$1.Pointer) return;
|
|
6245
|
-
let U2 =
|
|
6245
|
+
let U2 = e3.calculateIndex(y3);
|
|
6246
6246
|
o4.actions.goToOption({ focus: c$5.Specific, idx: U2 }, _$1.Pointer);
|
|
6247
6247
|
}), K$1 = o$6((s2) => {
|
|
6248
|
-
c3.wasMoved(s2) && (b3 || m2 && (
|
|
6248
|
+
c3.wasMoved(s2) && (b3 || m2 && (e3.optionsPropsRef.current.hold || o4.state.activationTrigger === _$1.Pointer && o4.actions.goToOption({ focus: c$5.Nothing })));
|
|
6249
6249
|
}), W2 = n$5({ active: m2, focus: m2, selected: a4, disabled: b3 }), S2 = { id: R2, ref: X2, role: "option", tabIndex: b3 === true ? void 0 : -1, "aria-disabled": b3 === true ? true : void 0, "aria-selected": a4, disabled: void 0, onMouseDown: x2, onFocus: v2, onPointerEnter: z2, onMouseEnter: z2, onPointerMove: D2, onMouseMove: D2, onPointerLeave: K$1, onMouseLeave: K$1 };
|
|
6250
6250
|
return K()({ ourProps: S2, theirProps: p2, slot: W2, defaultTag: Lo, name: "Combobox.Option" });
|
|
6251
6251
|
}
|
|
6252
6252
|
let wo = Y(Ao), Bo = Y(Fo), ko = Y(Ro), No = Z, Uo = Y(Mo$1), Ho = Y(Vo), Ht = Object.assign(wo, { Input: ko, Button: Bo, Label: No, Options: Uo, Option: Ho });
|
|
6253
6253
|
function a$3(o4, r2 = typeof document != "undefined" ? document.defaultView : null, t2) {
|
|
6254
6254
|
let n2 = I$4(o4, "escape");
|
|
6255
|
-
E$1(r2, "keydown", (
|
|
6256
|
-
n2 && (
|
|
6255
|
+
E$1(r2, "keydown", (e3) => {
|
|
6256
|
+
n2 && (e3.defaultPrevented || e3.key === o$4.Escape && t2(e3));
|
|
6257
6257
|
});
|
|
6258
6258
|
}
|
|
6259
6259
|
function f$2() {
|
|
6260
6260
|
var t2;
|
|
6261
|
-
let [
|
|
6261
|
+
let [e3] = useState(() => typeof window != "undefined" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [o4, c3] = useState((t2 = e3 == null ? void 0 : e3.matches) != null ? t2 : false);
|
|
6262
6262
|
return n$6(() => {
|
|
6263
|
-
if (!
|
|
6263
|
+
if (!e3) return;
|
|
6264
6264
|
function n2(r2) {
|
|
6265
6265
|
c3(r2.matches);
|
|
6266
6266
|
}
|
|
6267
|
-
return
|
|
6268
|
-
}, [
|
|
6267
|
+
return e3.addEventListener("change", n2), () => e3.removeEventListener("change", n2);
|
|
6268
|
+
}, [e3]), o4;
|
|
6269
6269
|
}
|
|
6270
6270
|
function S({ defaultContainers: l2 = [], portals: n2, mainTreeNode: o4 } = {}) {
|
|
6271
6271
|
let c3 = o$6(() => {
|
|
6272
6272
|
var r2, u3;
|
|
6273
6273
|
let i2 = l$7(o4), t2 = [];
|
|
6274
|
-
for (let
|
|
6275
|
-
if (n2 != null && n2.current) for (let
|
|
6276
|
-
for (let
|
|
6274
|
+
for (let e3 of l2) e3 !== null && (t$3(e3) ? t2.push(e3) : "current" in e3 && t$3(e3.current) && t2.push(e3.current));
|
|
6275
|
+
if (n2 != null && n2.current) for (let e3 of n2.current) t2.push(e3);
|
|
6276
|
+
for (let e3 of (r2 = i2 == null ? void 0 : i2.querySelectorAll("html > *, body > *")) != null ? r2 : []) e3 !== document.body && e3 !== document.head && t$3(e3) && e3.id !== "headlessui-portal-root" && (o4 && (e3.contains(o4) || e3.contains((u3 = o4 == null ? void 0 : o4.getRootNode()) == null ? void 0 : u3.host)) || t2.some((E2) => e3.contains(E2)) || t2.push(e3));
|
|
6277
6277
|
return t2;
|
|
6278
6278
|
});
|
|
6279
6279
|
return { resolveContainers: c3, contains: o$6((i2) => c3().some((t2) => t2.contains(i2))) };
|
|
@@ -6284,8 +6284,8 @@ function j({ children: l2, node: n2 }) {
|
|
|
6284
6284
|
return React__default.createElement(d2.Provider, { value: i2 }, l2, i2 === null && React__default.createElement(f$d, { features: s$9.Hidden, ref: (t2) => {
|
|
6285
6285
|
var r2, u3;
|
|
6286
6286
|
if (t2) {
|
|
6287
|
-
for (let
|
|
6288
|
-
c3(
|
|
6287
|
+
for (let e3 of (u3 = (r2 = l$7(t2)) == null ? void 0 : r2.querySelectorAll("html > *, body > *")) != null ? u3 : []) if (e3 !== document.body && e3 !== document.head && t$3(e3) && e3 != null && e3.contains(t2)) {
|
|
6288
|
+
c3(e3);
|
|
6289
6289
|
break;
|
|
6290
6290
|
}
|
|
6291
6291
|
}
|
|
@@ -6301,43 +6301,43 @@ function s$2() {
|
|
|
6301
6301
|
}, () => false, () => !r2) : false;
|
|
6302
6302
|
}
|
|
6303
6303
|
function l() {
|
|
6304
|
-
let r2 = s$2(), [
|
|
6305
|
-
return
|
|
6306
|
-
|
|
6307
|
-
}, [
|
|
6304
|
+
let r2 = s$2(), [e3, n2] = React.useState(s$c.isHandoffComplete);
|
|
6305
|
+
return e3 && s$c.isHandoffComplete === false && n2(false), React.useEffect(() => {
|
|
6306
|
+
e3 !== true && n2(true);
|
|
6307
|
+
}, [e3]), React.useEffect(() => s$c.handoff(), []), r2 ? false : e3;
|
|
6308
6308
|
}
|
|
6309
6309
|
function f$1() {
|
|
6310
|
-
let
|
|
6311
|
-
return n$6(() => (
|
|
6312
|
-
|
|
6313
|
-
}), []),
|
|
6310
|
+
let e3 = useRef(false);
|
|
6311
|
+
return n$6(() => (e3.current = true, () => {
|
|
6312
|
+
e3.current = false;
|
|
6313
|
+
}), []), e3;
|
|
6314
6314
|
}
|
|
6315
6315
|
var a$2 = ((r2) => (r2[r2.Forwards = 0] = "Forwards", r2[r2.Backwards = 1] = "Backwards", r2))(a$2 || {});
|
|
6316
6316
|
function u$1() {
|
|
6317
|
-
let
|
|
6317
|
+
let e3 = useRef(0);
|
|
6318
6318
|
return s$5(true, "keydown", (r2) => {
|
|
6319
|
-
r2.key === "Tab" && (
|
|
6320
|
-
}, true),
|
|
6319
|
+
r2.key === "Tab" && (e3.current = r2.shiftKey ? 1 : 0);
|
|
6320
|
+
}, true), e3;
|
|
6321
6321
|
}
|
|
6322
6322
|
function x(o4) {
|
|
6323
6323
|
if (!o4) return /* @__PURE__ */ new Set();
|
|
6324
6324
|
if (typeof o4 == "function") return new Set(o4());
|
|
6325
6325
|
let t2 = /* @__PURE__ */ new Set();
|
|
6326
|
-
for (let
|
|
6326
|
+
for (let e3 of o4.current) t$3(e3.current) && t2.add(e3.current);
|
|
6327
6327
|
return t2;
|
|
6328
6328
|
}
|
|
6329
6329
|
let $ = "div";
|
|
6330
6330
|
var G = ((n2) => (n2[n2.None = 0] = "None", n2[n2.InitialFocus = 1] = "InitialFocus", n2[n2.TabLock = 2] = "TabLock", n2[n2.FocusLock = 4] = "FocusLock", n2[n2.RestoreFocus = 8] = "RestoreFocus", n2[n2.AutoFocus = 16] = "AutoFocus", n2))(G || {});
|
|
6331
6331
|
function w$2(o4, t2) {
|
|
6332
|
-
let
|
|
6332
|
+
let e3 = useRef(null), r2 = y$5(e3, t2), { initialFocus: u3, initialFocusFallback: a4, containers: n2, features: s2 = 15, ...f2 } = o4;
|
|
6333
6333
|
l() || (s2 = 0);
|
|
6334
|
-
let l$12 = u$7(
|
|
6334
|
+
let l$12 = u$7(e3.current);
|
|
6335
6335
|
re(s2, { ownerDocument: l$12 });
|
|
6336
|
-
let T3 = ne(s2, { ownerDocument: l$12, container:
|
|
6337
|
-
oe$1(s2, { ownerDocument: l$12, container:
|
|
6336
|
+
let T3 = ne(s2, { ownerDocument: l$12, container: e3, initialFocus: u3, initialFocusFallback: a4 });
|
|
6337
|
+
oe$1(s2, { ownerDocument: l$12, container: e3, containers: n2, previousActiveElement: T3 });
|
|
6338
6338
|
let g2 = u$1(), A2 = o$6((c3) => {
|
|
6339
|
-
if (!n$4(
|
|
6340
|
-
let E2 =
|
|
6339
|
+
if (!n$4(e3.current)) return;
|
|
6340
|
+
let E2 = e3.current;
|
|
6341
6341
|
((V2) => V2())(() => {
|
|
6342
6342
|
u$e(g2.current, { [a$2.Forwards]: () => {
|
|
6343
6343
|
v$2(E2, T$2.First, { skipElements: [c3.relatedTarget, a4] });
|
|
@@ -6352,33 +6352,33 @@ function w$2(o4, t2) {
|
|
|
6352
6352
|
}, onBlur(c3) {
|
|
6353
6353
|
if (!(s2 & 4)) return;
|
|
6354
6354
|
let E2 = x(n2);
|
|
6355
|
-
n$4(
|
|
6355
|
+
n$4(e3.current) && E2.add(e3.current);
|
|
6356
6356
|
let L2 = c3.relatedTarget;
|
|
6357
|
-
i$4(L2) && L2.dataset.headlessuiFocusGuard !== "true" && (I(E2, L2) || (b3.current ? v$2(
|
|
6357
|
+
i$4(L2) && L2.dataset.headlessuiFocusGuard !== "true" && (I(E2, L2) || (b3.current ? v$2(e3.current, u$e(g2.current, { [a$2.Forwards]: () => T$2.Next, [a$2.Backwards]: () => T$2.Previous }) | T$2.WrapAround, { relativeTo: c3.target }) : i$4(c3.target) && w$4(c3.target)));
|
|
6358
6358
|
} }, B = K();
|
|
6359
6359
|
return React__default.createElement(React__default.Fragment, null, v2 && React__default.createElement(f$d, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: A2, features: s$9.Focusable }), B({ ourProps: k2, theirProps: f2, defaultTag: $, name: "FocusTrap" }), v2 && React__default.createElement(f$d, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: A2, features: s$9.Focusable }));
|
|
6360
6360
|
}
|
|
6361
6361
|
let ee = Y(w$2), ge = Object.assign(ee, { features: G });
|
|
6362
6362
|
function te(o4 = true) {
|
|
6363
6363
|
let t2 = useRef(n.slice());
|
|
6364
|
-
return m$1(([
|
|
6365
|
-
r2 === true &&
|
|
6364
|
+
return m$1(([e3], [r2]) => {
|
|
6365
|
+
r2 === true && e3 === false && t$5(() => {
|
|
6366
6366
|
t2.current.splice(0);
|
|
6367
|
-
}), r2 === false &&
|
|
6367
|
+
}), r2 === false && e3 === true && (t2.current = n.slice());
|
|
6368
6368
|
}, [o4, n, t2]), o$6(() => {
|
|
6369
|
-
var
|
|
6370
|
-
return (
|
|
6369
|
+
var e3;
|
|
6370
|
+
return (e3 = t2.current.find((r2) => r2 != null && r2.isConnected)) != null ? e3 : null;
|
|
6371
6371
|
});
|
|
6372
6372
|
}
|
|
6373
6373
|
function re(o4, { ownerDocument: t2 }) {
|
|
6374
|
-
let
|
|
6374
|
+
let e3 = !!(o4 & 8), r2 = te(e3);
|
|
6375
6375
|
m$1(() => {
|
|
6376
|
-
|
|
6377
|
-
}, [
|
|
6378
|
-
|
|
6376
|
+
e3 || d$2(t2 == null ? void 0 : t2.body) && w$4(r2());
|
|
6377
|
+
}, [e3]), c$4(() => {
|
|
6378
|
+
e3 && w$4(r2());
|
|
6379
6379
|
});
|
|
6380
6380
|
}
|
|
6381
|
-
function ne(o4, { ownerDocument: t2, container:
|
|
6381
|
+
function ne(o4, { ownerDocument: t2, container: e3, initialFocus: r2, initialFocusFallback: u3 }) {
|
|
6382
6382
|
let a4 = useRef(null), n2 = I$4(!!(o4 & 1), "focus-trap#initial-focus"), s2 = f$1();
|
|
6383
6383
|
return m$1(() => {
|
|
6384
6384
|
if (o4 === 0) return;
|
|
@@ -6386,7 +6386,7 @@ function ne(o4, { ownerDocument: t2, container: e2, initialFocus: r2, initialFoc
|
|
|
6386
6386
|
u3 != null && u3.current && w$4(u3.current);
|
|
6387
6387
|
return;
|
|
6388
6388
|
}
|
|
6389
|
-
let f2 =
|
|
6389
|
+
let f2 = e3.current;
|
|
6390
6390
|
f2 && t$5(() => {
|
|
6391
6391
|
if (!s2.current) return;
|
|
6392
6392
|
let l2 = t2 == null ? void 0 : t2.activeElement;
|
|
@@ -6411,12 +6411,12 @@ function ne(o4, { ownerDocument: t2, container: e2, initialFocus: r2, initialFoc
|
|
|
6411
6411
|
});
|
|
6412
6412
|
}, [u3, n2, o4]), a4;
|
|
6413
6413
|
}
|
|
6414
|
-
function oe$1(o4, { ownerDocument: t2, container:
|
|
6414
|
+
function oe$1(o4, { ownerDocument: t2, container: e3, containers: r2, previousActiveElement: u3 }) {
|
|
6415
6415
|
let a4 = f$1(), n2 = !!(o4 & 4);
|
|
6416
6416
|
E$1(t2 == null ? void 0 : t2.defaultView, "focus", (s2) => {
|
|
6417
6417
|
if (!n2 || !a4.current) return;
|
|
6418
6418
|
let f2 = x(r2);
|
|
6419
|
-
n$4(
|
|
6419
|
+
n$4(e3.current) && f2.add(e3.current);
|
|
6420
6420
|
let l2 = u3.current;
|
|
6421
6421
|
if (!l2) return;
|
|
6422
6422
|
let T3 = s2.target;
|
|
@@ -6424,33 +6424,33 @@ function oe$1(o4, { ownerDocument: t2, container: e2, containers: r2, previousAc
|
|
|
6424
6424
|
}, true);
|
|
6425
6425
|
}
|
|
6426
6426
|
function I(o4, t2) {
|
|
6427
|
-
for (let
|
|
6427
|
+
for (let e3 of o4) if (e3.contains(t2)) return true;
|
|
6428
6428
|
return false;
|
|
6429
6429
|
}
|
|
6430
|
-
function ue(
|
|
6430
|
+
function ue(e3) {
|
|
6431
6431
|
var t2;
|
|
6432
|
-
return !!(
|
|
6432
|
+
return !!(e3.enter || e3.enterFrom || e3.enterTo || e3.leave || e3.leaveFrom || e3.leaveTo) || !b$5((t2 = e3.as) != null ? t2 : de) || React__default.Children.count(e3.children) === 1;
|
|
6433
6433
|
}
|
|
6434
6434
|
let V$1 = createContext(null);
|
|
6435
6435
|
V$1.displayName = "TransitionContext";
|
|
6436
6436
|
var De$1 = ((n2) => (n2.Visible = "visible", n2.Hidden = "hidden", n2))(De$1 || {});
|
|
6437
6437
|
function He$2() {
|
|
6438
|
-
let
|
|
6439
|
-
if (
|
|
6440
|
-
return
|
|
6438
|
+
let e3 = useContext(V$1);
|
|
6439
|
+
if (e3 === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
6440
|
+
return e3;
|
|
6441
6441
|
}
|
|
6442
6442
|
function Ae$1() {
|
|
6443
|
-
let
|
|
6444
|
-
if (
|
|
6445
|
-
return
|
|
6443
|
+
let e3 = useContext(w$1);
|
|
6444
|
+
if (e3 === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
6445
|
+
return e3;
|
|
6446
6446
|
}
|
|
6447
6447
|
let w$1 = createContext(null);
|
|
6448
6448
|
w$1.displayName = "NestingContext";
|
|
6449
|
-
function M(
|
|
6450
|
-
return "children" in
|
|
6449
|
+
function M(e3) {
|
|
6450
|
+
return "children" in e3 ? M(e3.children) : e3.current.filter(({ el: t2 }) => t2.current !== null).filter(({ state: t2 }) => t2 === "visible").length > 0;
|
|
6451
6451
|
}
|
|
6452
|
-
function Te(
|
|
6453
|
-
let n2 = s$b(
|
|
6452
|
+
function Te(e3, t2) {
|
|
6453
|
+
let n2 = s$b(e3), l2 = useRef([]), S2 = f$1(), R2 = p$7(), d3 = o$6((o4, i2 = C$8.Hidden) => {
|
|
6454
6454
|
let a4 = l2.current.findIndex(({ el: s2 }) => s2 === o4);
|
|
6455
6455
|
a4 !== -1 && (u$e(i2, { [C$8.Unmount]() {
|
|
6456
6456
|
l2.current.splice(a4, 1);
|
|
@@ -6478,9 +6478,9 @@ function Te(e2, t2) {
|
|
|
6478
6478
|
return useMemo(() => ({ children: l2, register: y3, unregister: d3, onStart: g2, onStop: v2, wait: p2, chains: h3 }), [y3, d3, l2, g2, v2, h3, p2]);
|
|
6479
6479
|
}
|
|
6480
6480
|
let de = Fragment$1, fe = A$2.RenderStrategy;
|
|
6481
|
-
function Fe$2(
|
|
6481
|
+
function Fe$2(e3, t2) {
|
|
6482
6482
|
var ee2, te2;
|
|
6483
|
-
let { transition: n2 = true, beforeEnter: l$12, afterEnter: S2, beforeLeave: R2, afterLeave: d3, enter: y3, enterFrom: C2, enterTo: p2, entered: h3, leave: g2, leaveFrom: v2, leaveTo: o4, ...i$12 } =
|
|
6483
|
+
let { transition: n2 = true, beforeEnter: l$12, afterEnter: S2, beforeLeave: R2, afterLeave: d3, enter: y3, enterFrom: C2, enterTo: p2, entered: h3, leave: g2, leaveFrom: v2, leaveTo: o4, ...i$12 } = e3, [a4, s2] = useState(null), r2 = useRef(null), f2 = ue(e3), U2 = y$5(...f2 ? [r2, t2, s2] : t2 === null ? [] : [t2]), H2 = (ee2 = i$12.unmount) == null || ee2 ? C$8.Unmount : C$8.Hidden, { show: u3, appear: z2, initial: K$1 } = He$2(), [m2, j2] = useState(u3 ? "visible" : "hidden"), Q2 = Ae$1(), { register: A2, unregister: F2 } = Q2;
|
|
6484
6484
|
n$6(() => A2(r2), [A2, r2]), n$6(() => {
|
|
6485
6485
|
if (H2 === C$8.Hidden && r2.current) {
|
|
6486
6486
|
if (u3 && m2 !== "visible") {
|
|
@@ -6516,8 +6516,8 @@ function Fe$2(e2, t2) {
|
|
|
6516
6516
|
let he2 = K();
|
|
6517
6517
|
return React__default.createElement(w$1.Provider, { value: I2 }, React__default.createElement(c$6, { value: N$12 }, he2({ ourProps: Ce2, theirProps: i$12, defaultTag: de, features: fe, visible: m2 === "visible", name: "Transition.Child" })));
|
|
6518
6518
|
}
|
|
6519
|
-
function Ie$1(
|
|
6520
|
-
let { show: n2, appear: l$12 = false, unmount: S2 = true, ...R2 } =
|
|
6519
|
+
function Ie$1(e3, t2) {
|
|
6520
|
+
let { show: n2, appear: l$12 = false, unmount: S2 = true, ...R2 } = e3, d3 = useRef(null), y3 = ue(e3), C2 = y$5(...y3 ? [d3, t2] : t2 === null ? [] : [t2]);
|
|
6521
6521
|
l();
|
|
6522
6522
|
let p2 = u$4();
|
|
6523
6523
|
if (n2 === void 0 && p2 !== null && (n2 = (p2 & i.Open) === i.Open), n2 === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
@@ -6533,33 +6533,33 @@ function Ie$1(e2, t2) {
|
|
|
6533
6533
|
}, [n2, v2]);
|
|
6534
6534
|
let r2 = { unmount: S2 }, f2 = o$6(() => {
|
|
6535
6535
|
var u3;
|
|
6536
|
-
o4 && i$12(false), (u3 =
|
|
6536
|
+
o4 && i$12(false), (u3 = e3.beforeEnter) == null || u3.call(e3);
|
|
6537
6537
|
}), U2 = o$6(() => {
|
|
6538
6538
|
var u3;
|
|
6539
|
-
o4 && i$12(false), (u3 =
|
|
6539
|
+
o4 && i$12(false), (u3 = e3.beforeLeave) == null || u3.call(e3);
|
|
6540
6540
|
}), H2 = K();
|
|
6541
6541
|
return React__default.createElement(w$1.Provider, { value: v2 }, React__default.createElement(V$1.Provider, { value: s2 }, H2({ ourProps: { ...r2, as: Fragment$1, children: React__default.createElement(me, { ref: C2, ...r2, ...R2, beforeEnter: f2, beforeLeave: U2 }) }, theirProps: {}, defaultTag: Fragment$1, features: fe, visible: h3 === "visible", name: "Transition" })));
|
|
6542
6542
|
}
|
|
6543
|
-
function Le$2(
|
|
6543
|
+
function Le$2(e3, t2) {
|
|
6544
6544
|
let n2 = useContext(V$1) !== null, l2 = u$4() !== null;
|
|
6545
|
-
return React__default.createElement(React__default.Fragment, null, !n2 && l2 ? React__default.createElement(X, { ref: t2, ...
|
|
6545
|
+
return React__default.createElement(React__default.Fragment, null, !n2 && l2 ? React__default.createElement(X, { ref: t2, ...e3 }) : React__default.createElement(me, { ref: t2, ...e3 }));
|
|
6546
6546
|
}
|
|
6547
6547
|
let X = Y(Ie$1), me = Y(Fe$2), Oe$2 = Y(Le$2), Ke$2 = Object.assign(X, { Child: Oe$2, Root: X });
|
|
6548
6548
|
var we$1 = ((o4) => (o4[o4.Open = 0] = "Open", o4[o4.Closed = 1] = "Closed", o4))(we$1 || {}), Be$1 = ((t2) => (t2[t2.SetTitleId = 0] = "SetTitleId", t2))(Be$1 || {});
|
|
6549
|
-
let Ue$1 = { [0](
|
|
6550
|
-
return
|
|
6549
|
+
let Ue$1 = { [0](e3, t2) {
|
|
6550
|
+
return e3.titleId === t2.id ? e3 : { ...e3, titleId: t2.id };
|
|
6551
6551
|
} }, w = createContext(null);
|
|
6552
6552
|
w.displayName = "DialogContext";
|
|
6553
|
-
function O(
|
|
6553
|
+
function O(e3) {
|
|
6554
6554
|
let t2 = useContext(w);
|
|
6555
6555
|
if (t2 === null) {
|
|
6556
|
-
let o4 = new Error(`<${
|
|
6556
|
+
let o4 = new Error(`<${e3} /> is missing a parent <Dialog /> component.`);
|
|
6557
6557
|
throw Error.captureStackTrace && Error.captureStackTrace(o4, O), o4;
|
|
6558
6558
|
}
|
|
6559
6559
|
return t2;
|
|
6560
6560
|
}
|
|
6561
|
-
function He$1(
|
|
6562
|
-
return u$e(t2.type, Ue$1,
|
|
6561
|
+
function He$1(e3, t2) {
|
|
6562
|
+
return u$e(t2.type, Ue$1, e3, t2);
|
|
6563
6563
|
}
|
|
6564
6564
|
let z$1 = Y(function(t2, o4) {
|
|
6565
6565
|
let a4 = useId$1(), { id: n2 = `headlessui-dialog-${a4}`, open: i$12, onClose: p2, initialFocus: d3, role: s2 = "dialog", autoFocus: f2 = true, __demoMode: u3 = false, unmount: y3 = false, ...S$12 } = t2, R2 = useRef(false);
|
|
@@ -6594,30 +6594,30 @@ let z$1 = Y(function(t2, o4) {
|
|
|
6594
6594
|
let ie = K();
|
|
6595
6595
|
return React__default.createElement(s$3, null, React__default.createElement(l$1, { force: true }, React__default.createElement(te$2, null, React__default.createElement(w.Provider, { value: re2 }, React__default.createElement(X$1, { target: T3 }, React__default.createElement(l$1, { force: false }, React__default.createElement(ne2, { slot: N2 }, React__default.createElement(ee2, null, React__default.createElement(ge, { initialFocus: d3, initialFocusFallback: T3, containers: M2, features: E2 }, React__default.createElement(C$4, { value: m2 }, ie({ ourProps: le, theirProps: S$12, slot: N2, defaultTag: Ne$1, features: We$1, visible: c3 === 0, name: "Dialog" })))))))))));
|
|
6596
6596
|
}), Ne$1 = "div", We$1 = A$2.RenderStrategy | A$2.Static;
|
|
6597
|
-
function $e(
|
|
6598
|
-
let { transition: o4 = false, open: a4, ...n2 } =
|
|
6597
|
+
function $e(e3, t2) {
|
|
6598
|
+
let { transition: o4 = false, open: a4, ...n2 } = e3, i2 = u$4(), p2 = e3.hasOwnProperty("open") || i2 !== null, d3 = e3.hasOwnProperty("onClose");
|
|
6599
6599
|
if (!p2 && !d3) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
6600
6600
|
if (!p2) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
6601
6601
|
if (!d3) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
6602
|
-
if (!i2 && typeof
|
|
6603
|
-
if (typeof
|
|
6602
|
+
if (!i2 && typeof e3.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e3.open}`);
|
|
6603
|
+
if (typeof e3.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e3.onClose}`);
|
|
6604
6604
|
return (a4 !== void 0 || o4) && !n2.static ? React__default.createElement(j, null, React__default.createElement(Ke$2, { show: a4, transition: o4, unmount: n2.unmount }, React__default.createElement(z$1, { ref: t2, ...n2 }))) : React__default.createElement(j, null, React__default.createElement(z$1, { ref: t2, open: a4, ...n2 }));
|
|
6605
6605
|
}
|
|
6606
6606
|
let je$1 = "div";
|
|
6607
|
-
function Ye(
|
|
6608
|
-
let o4 = useId$1(), { id: a4 = `headlessui-dialog-panel-${o4}`, transition: n2 = false, ...i2 } =
|
|
6607
|
+
function Ye(e3, t2) {
|
|
6608
|
+
let o4 = useId$1(), { id: a4 = `headlessui-dialog-panel-${o4}`, transition: n2 = false, ...i2 } = e3, [{ dialogState: p2, unmount: d3 }, s2] = O("Dialog.Panel"), f2 = y$5(t2, s2.panelRef), u3 = n$5({ open: p2 === 0 }), y3 = o$6((I2) => {
|
|
6609
6609
|
I2.stopPropagation();
|
|
6610
6610
|
}), S2 = { ref: f2, id: a4, onClick: y3 }, R2 = n2 ? Oe$2 : Fragment$1, g2 = n2 ? { unmount: d3 } : {}, T3 = K();
|
|
6611
6611
|
return React__default.createElement(R2, { ...g2 }, T3({ ourProps: S2, theirProps: i2, slot: u3, defaultTag: je$1, name: "Dialog.Panel" }));
|
|
6612
6612
|
}
|
|
6613
6613
|
let Je = "div";
|
|
6614
|
-
function Ke$1(
|
|
6615
|
-
let { transition: o4 = false, ...a4 } =
|
|
6614
|
+
function Ke$1(e3, t2) {
|
|
6615
|
+
let { transition: o4 = false, ...a4 } = e3, [{ dialogState: n2, unmount: i2 }] = O("Dialog.Backdrop"), p2 = n$5({ open: n2 === 0 }), d3 = { ref: t2, "aria-hidden": true }, s2 = o4 ? Oe$2 : Fragment$1, f2 = o4 ? { unmount: i2 } : {}, u3 = K();
|
|
6616
6616
|
return React__default.createElement(s2, { ...f2 }, u3({ ourProps: d3, theirProps: a4, slot: p2, defaultTag: Je, name: "Dialog.Backdrop" }));
|
|
6617
6617
|
}
|
|
6618
6618
|
let Xe = "h2";
|
|
6619
|
-
function Ve(
|
|
6620
|
-
let o4 = useId$1(), { id: a4 = `headlessui-dialog-title-${o4}`, ...n2 } =
|
|
6619
|
+
function Ve(e3, t2) {
|
|
6620
|
+
let o4 = useId$1(), { id: a4 = `headlessui-dialog-title-${o4}`, ...n2 } = e3, [{ dialogState: i2, setTitleId: p2 }] = O("Dialog.Title"), d3 = y$5(t2);
|
|
6621
6621
|
useEffect(() => (p2(a4), () => p2(null)), [a4, p2]);
|
|
6622
6622
|
let s2 = n$5({ open: i2 === 0 }), f2 = { ref: d3, id: a4 };
|
|
6623
6623
|
return K()({ ourProps: f2, theirProps: n2, slot: s2, defaultTag: Xe, name: "Dialog.Title" });
|
|
@@ -6632,19 +6632,19 @@ function c$1(d3, l2) {
|
|
|
6632
6632
|
}
|
|
6633
6633
|
let W = Y(c$1);
|
|
6634
6634
|
let a$1 = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
|
|
6635
|
-
function o3(
|
|
6635
|
+
function o3(e3) {
|
|
6636
6636
|
var l2, n2;
|
|
6637
|
-
let i2 = (l2 =
|
|
6637
|
+
let i2 = (l2 = e3.innerText) != null ? l2 : "", t2 = e3.cloneNode(true);
|
|
6638
6638
|
if (!n$4(t2)) return i2;
|
|
6639
6639
|
let u3 = false;
|
|
6640
6640
|
for (let f2 of t2.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) f2.remove(), u3 = true;
|
|
6641
6641
|
let r2 = u3 ? (n2 = t2.innerText) != null ? n2 : "" : i2;
|
|
6642
6642
|
return a$1.test(r2) && (r2 = r2.replace(a$1, "")), r2;
|
|
6643
6643
|
}
|
|
6644
|
-
function F$1(
|
|
6645
|
-
let i2 =
|
|
6644
|
+
function F$1(e3) {
|
|
6645
|
+
let i2 = e3.getAttribute("aria-label");
|
|
6646
6646
|
if (typeof i2 == "string") return i2.trim();
|
|
6647
|
-
let t2 =
|
|
6647
|
+
let t2 = e3.getAttribute("aria-labelledby");
|
|
6648
6648
|
if (t2) {
|
|
6649
6649
|
let u3 = t2.split(" ").map((r2) => {
|
|
6650
6650
|
let l2 = document.getElementById(r2);
|
|
@@ -6656,93 +6656,93 @@ function F$1(e2) {
|
|
|
6656
6656
|
}).filter(Boolean);
|
|
6657
6657
|
if (u3.length > 0) return u3.join(", ");
|
|
6658
6658
|
}
|
|
6659
|
-
return o3(
|
|
6659
|
+
return o3(e3).trim();
|
|
6660
6660
|
}
|
|
6661
6661
|
function s$1(c3) {
|
|
6662
6662
|
let t2 = useRef(""), r2 = useRef("");
|
|
6663
6663
|
return o$6(() => {
|
|
6664
|
-
let
|
|
6665
|
-
if (!
|
|
6666
|
-
let u3 =
|
|
6664
|
+
let e3 = c3.current;
|
|
6665
|
+
if (!e3) return "";
|
|
6666
|
+
let u3 = e3.innerText;
|
|
6667
6667
|
if (t2.current === u3) return r2.current;
|
|
6668
|
-
let n2 = F$1(
|
|
6668
|
+
let n2 = F$1(e3).trim().toLowerCase();
|
|
6669
6669
|
return t2.current = u3, r2.current = n2, n2;
|
|
6670
6670
|
});
|
|
6671
6671
|
}
|
|
6672
6672
|
var T2 = Object.defineProperty;
|
|
6673
|
-
var y2 = (
|
|
6674
|
-
var b$1 = (
|
|
6673
|
+
var y2 = (e3, o4, t2) => o4 in e3 ? T2(e3, o4, { enumerable: true, configurable: true, writable: true, value: t2 }) : e3[o4] = t2;
|
|
6674
|
+
var b$1 = (e3, o4, t2) => (y2(e3, typeof o4 != "symbol" ? o4 + "" : o4, t2), t2);
|
|
6675
6675
|
var F = ((t2) => (t2[t2.Open = 0] = "Open", t2[t2.Closed = 1] = "Closed", t2))(F || {}), P = ((t2) => (t2[t2.Single = 0] = "Single", t2[t2.Multi = 1] = "Multi", t2))(P || {}), C$1 = ((t2) => (t2[t2.Pointer = 0] = "Pointer", t2[t2.Other = 1] = "Other", t2))(C$1 || {}), k = ((r2) => (r2[r2.OpenListbox = 0] = "OpenListbox", r2[r2.CloseListbox = 1] = "CloseListbox", r2[r2.GoToOption = 2] = "GoToOption", r2[r2.Search = 3] = "Search", r2[r2.ClearSearch = 4] = "ClearSearch", r2[r2.SelectOption = 5] = "SelectOption", r2[r2.RegisterOptions = 6] = "RegisterOptions", r2[r2.UnregisterOptions = 7] = "UnregisterOptions", r2[r2.SetButtonElement = 8] = "SetButtonElement", r2[r2.SetOptionsElement = 9] = "SetOptionsElement", r2[r2.SortOptions = 10] = "SortOptions", r2[r2.MarkButtonAsMoved = 11] = "MarkButtonAsMoved", r2))(k || {});
|
|
6676
|
-
function g(
|
|
6677
|
-
let t2 =
|
|
6676
|
+
function g(e3, o4 = (t2) => t2) {
|
|
6677
|
+
let t2 = e3.activeOptionIndex !== null ? e3.options[e3.activeOptionIndex] : null, n2 = G$1(o4(e3.options.slice()), (s2) => s2.dataRef.current.domRef.current), i2 = t2 ? n2.indexOf(t2) : null;
|
|
6678
6678
|
return i2 === -1 && (i2 = null), { options: n2, activeOptionIndex: i2 };
|
|
6679
6679
|
}
|
|
6680
|
-
let D = { [1](
|
|
6681
|
-
if (
|
|
6682
|
-
let o4 =
|
|
6683
|
-
return { ...
|
|
6684
|
-
}, [0](
|
|
6685
|
-
if (
|
|
6686
|
-
let t2 =
|
|
6687
|
-
return i2 !== -1 && (t2 = i2), { ...
|
|
6688
|
-
}, [2](
|
|
6680
|
+
let D = { [1](e3) {
|
|
6681
|
+
if (e3.dataRef.current.disabled || e3.listboxState === 1) return e3;
|
|
6682
|
+
let o4 = e3.buttonElement ? c$2.Tracked(a$4(e3.buttonElement)) : e3.buttonPositionState;
|
|
6683
|
+
return { ...e3, activeOptionIndex: null, pendingFocus: { focus: c$5.Nothing }, listboxState: 1, __demoMode: false, buttonPositionState: o4 };
|
|
6684
|
+
}, [0](e3, o4) {
|
|
6685
|
+
if (e3.dataRef.current.disabled || e3.listboxState === 0) return e3;
|
|
6686
|
+
let t2 = e3.activeOptionIndex, { isSelected: n2 } = e3.dataRef.current, i2 = e3.options.findIndex((s2) => n2(s2.dataRef.current.value));
|
|
6687
|
+
return i2 !== -1 && (t2 = i2), { ...e3, frozenValue: false, pendingFocus: o4.focus, listboxState: 0, activeOptionIndex: t2, __demoMode: false, buttonPositionState: c$2.Idle };
|
|
6688
|
+
}, [2](e3, o4) {
|
|
6689
6689
|
var s2, l2, c3, p2, f2;
|
|
6690
|
-
if (
|
|
6691
|
-
let t2 = { ...
|
|
6690
|
+
if (e3.dataRef.current.disabled || e3.listboxState === 1) return e3;
|
|
6691
|
+
let t2 = { ...e3, searchQuery: "", activationTrigger: (s2 = o4.trigger) != null ? s2 : 1, __demoMode: false };
|
|
6692
6692
|
if (o4.focus === c$5.Nothing) return { ...t2, activeOptionIndex: null };
|
|
6693
|
-
if (o4.focus === c$5.Specific) return { ...t2, activeOptionIndex:
|
|
6693
|
+
if (o4.focus === c$5.Specific) return { ...t2, activeOptionIndex: e3.options.findIndex((d3) => d3.id === o4.id) };
|
|
6694
6694
|
if (o4.focus === c$5.Previous) {
|
|
6695
|
-
let d3 =
|
|
6695
|
+
let d3 = e3.activeOptionIndex;
|
|
6696
6696
|
if (d3 !== null) {
|
|
6697
|
-
let O2 =
|
|
6697
|
+
let O2 = e3.options[d3].dataRef.current.domRef, r2 = f$4(o4, { resolveItems: () => e3.options, resolveActiveIndex: () => e3.activeOptionIndex, resolveId: (u3) => u3.id, resolveDisabled: (u3) => u3.dataRef.current.disabled });
|
|
6698
6698
|
if (r2 !== null) {
|
|
6699
|
-
let u3 =
|
|
6699
|
+
let u3 = e3.options[r2].dataRef.current.domRef;
|
|
6700
6700
|
if (((l2 = O2.current) == null ? void 0 : l2.previousElementSibling) === u3.current || ((c3 = u3.current) == null ? void 0 : c3.previousElementSibling) === null) return { ...t2, activeOptionIndex: r2 };
|
|
6701
6701
|
}
|
|
6702
6702
|
}
|
|
6703
6703
|
} else if (o4.focus === c$5.Next) {
|
|
6704
|
-
let d3 =
|
|
6704
|
+
let d3 = e3.activeOptionIndex;
|
|
6705
6705
|
if (d3 !== null) {
|
|
6706
|
-
let O2 =
|
|
6706
|
+
let O2 = e3.options[d3].dataRef.current.domRef, r2 = f$4(o4, { resolveItems: () => e3.options, resolveActiveIndex: () => e3.activeOptionIndex, resolveId: (u3) => u3.id, resolveDisabled: (u3) => u3.dataRef.current.disabled });
|
|
6707
6707
|
if (r2 !== null) {
|
|
6708
|
-
let u3 =
|
|
6708
|
+
let u3 = e3.options[r2].dataRef.current.domRef;
|
|
6709
6709
|
if (((p2 = O2.current) == null ? void 0 : p2.nextElementSibling) === u3.current || ((f2 = u3.current) == null ? void 0 : f2.nextElementSibling) === null) return { ...t2, activeOptionIndex: r2 };
|
|
6710
6710
|
}
|
|
6711
6711
|
}
|
|
6712
6712
|
}
|
|
6713
|
-
let n2 = g(
|
|
6713
|
+
let n2 = g(e3), i2 = f$4(o4, { resolveItems: () => n2.options, resolveActiveIndex: () => n2.activeOptionIndex, resolveId: (d3) => d3.id, resolveDisabled: (d3) => d3.dataRef.current.disabled });
|
|
6714
6714
|
return { ...t2, ...n2, activeOptionIndex: i2 };
|
|
6715
|
-
}, [3]: (
|
|
6716
|
-
if (
|
|
6717
|
-
let n2 =
|
|
6715
|
+
}, [3]: (e3, o4) => {
|
|
6716
|
+
if (e3.dataRef.current.disabled || e3.listboxState === 1) return e3;
|
|
6717
|
+
let n2 = e3.searchQuery !== "" ? 0 : 1, i2 = e3.searchQuery + o4.value.toLowerCase(), l2 = (e3.activeOptionIndex !== null ? e3.options.slice(e3.activeOptionIndex + n2).concat(e3.options.slice(0, e3.activeOptionIndex + n2)) : e3.options).find((p2) => {
|
|
6718
6718
|
var f2;
|
|
6719
6719
|
return !p2.dataRef.current.disabled && ((f2 = p2.dataRef.current.textValue) == null ? void 0 : f2.startsWith(i2));
|
|
6720
|
-
}), c3 = l2 ?
|
|
6721
|
-
return c3 === -1 || c3 ===
|
|
6722
|
-
}, [4](
|
|
6723
|
-
return
|
|
6724
|
-
}, [5](
|
|
6725
|
-
return
|
|
6726
|
-
}, [6]: (
|
|
6727
|
-
let t2 =
|
|
6728
|
-
if (
|
|
6729
|
-
let { isSelected: i2 } =
|
|
6720
|
+
}), c3 = l2 ? e3.options.indexOf(l2) : -1;
|
|
6721
|
+
return c3 === -1 || c3 === e3.activeOptionIndex ? { ...e3, searchQuery: i2 } : { ...e3, searchQuery: i2, activeOptionIndex: c3, activationTrigger: 1 };
|
|
6722
|
+
}, [4](e3) {
|
|
6723
|
+
return e3.dataRef.current.disabled || e3.listboxState === 1 || e3.searchQuery === "" ? e3 : { ...e3, searchQuery: "" };
|
|
6724
|
+
}, [5](e3) {
|
|
6725
|
+
return e3.dataRef.current.mode === 0 ? { ...e3, frozenValue: true } : { ...e3 };
|
|
6726
|
+
}, [6]: (e3, o4) => {
|
|
6727
|
+
let t2 = e3.options.concat(o4.options), n2 = e3.activeOptionIndex;
|
|
6728
|
+
if (e3.pendingFocus.focus !== c$5.Nothing && (n2 = f$4(e3.pendingFocus, { resolveItems: () => t2, resolveActiveIndex: () => e3.activeOptionIndex, resolveId: (i2) => i2.id, resolveDisabled: (i2) => i2.dataRef.current.disabled })), e3.activeOptionIndex === null) {
|
|
6729
|
+
let { isSelected: i2 } = e3.dataRef.current;
|
|
6730
6730
|
if (i2) {
|
|
6731
6731
|
let s2 = t2.findIndex((l2) => i2 == null ? void 0 : i2(l2.dataRef.current.value));
|
|
6732
6732
|
s2 !== -1 && (n2 = s2);
|
|
6733
6733
|
}
|
|
6734
6734
|
}
|
|
6735
|
-
return { ...
|
|
6736
|
-
}, [7]: (
|
|
6737
|
-
let t2 =
|
|
6735
|
+
return { ...e3, options: t2, activeOptionIndex: n2, pendingFocus: { focus: c$5.Nothing }, pendingShouldSort: true };
|
|
6736
|
+
}, [7]: (e3, o4) => {
|
|
6737
|
+
let t2 = e3.options, n2 = [], i2 = new Set(o4.options);
|
|
6738
6738
|
for (let [s2, l2] of t2.entries()) if (i2.has(l2.id) && (n2.push(s2), i2.delete(l2.id), i2.size === 0)) break;
|
|
6739
6739
|
if (n2.length > 0) {
|
|
6740
6740
|
t2 = t2.slice();
|
|
6741
6741
|
for (let s2 of n2.reverse()) t2.splice(s2, 1);
|
|
6742
6742
|
}
|
|
6743
|
-
return { ...
|
|
6744
|
-
}, [8]: (
|
|
6745
|
-
return
|
|
6743
|
+
return { ...e3, options: t2, activationTrigger: 1 };
|
|
6744
|
+
}, [8]: (e3, o4) => e3.buttonElement === o4.element ? e3 : { ...e3, buttonElement: o4.element }, [9]: (e3, o4) => e3.optionsElement === o4.element ? e3 : { ...e3, optionsElement: o4.element }, [10]: (e3) => e3.pendingShouldSort ? { ...e3, ...g(e3), pendingShouldSort: false } : e3, [11](e3) {
|
|
6745
|
+
return e3.buttonPositionState.kind !== "Tracked" ? e3 : { ...e3, buttonPositionState: c$2.Moved };
|
|
6746
6746
|
} };
|
|
6747
6747
|
let h$1 = class h extends T$3 {
|
|
6748
6748
|
constructor(t2) {
|
|
@@ -6835,15 +6835,15 @@ let h$1 = class h extends T$3 {
|
|
|
6835
6835
|
};
|
|
6836
6836
|
const c2 = createContext(null);
|
|
6837
6837
|
function p(o4) {
|
|
6838
|
-
let
|
|
6839
|
-
if (
|
|
6838
|
+
let e3 = useContext(c2);
|
|
6839
|
+
if (e3 === null) {
|
|
6840
6840
|
let t2 = new Error(`<${o4} /> is missing a parent <Listbox /> component.`);
|
|
6841
6841
|
throw Error.captureStackTrace && Error.captureStackTrace(t2, u2), t2;
|
|
6842
6842
|
}
|
|
6843
|
-
return
|
|
6843
|
+
return e3;
|
|
6844
6844
|
}
|
|
6845
|
-
function u2({ id: o4, __demoMode:
|
|
6846
|
-
let t2 = useMemo(() => h$1.new({ id: o4, __demoMode:
|
|
6845
|
+
function u2({ id: o4, __demoMode: e3 = false }) {
|
|
6846
|
+
let t2 = useMemo(() => h$1.new({ id: o4, __demoMode: e3 }), []);
|
|
6847
6847
|
return c$4(() => t2.dispose()), t2;
|
|
6848
6848
|
}
|
|
6849
6849
|
let oe = createContext(null);
|
|
@@ -6910,58 +6910,58 @@ let Oe$1 = createContext(false), ht = "div", At = A$2.RenderStrategy | A$2.Stati
|
|
|
6910
6910
|
function _t(b3, E2) {
|
|
6911
6911
|
let m2 = useId$1(), { id: u3 = `headlessui-listbox-options-${m2}`, anchor: s2, portal: a4 = false, modal: _2 = true, transition: i$12 = false, ...y3 } = b3, o4 = ye(s2), [x2, O2] = useState(null);
|
|
6912
6912
|
o4 && (a4 = true);
|
|
6913
|
-
let l2 = Q$1("Listbox.Options"), t2 = p("Listbox.Options"), [p$12, S2, h3, I2] = S$5(t2, (
|
|
6913
|
+
let l2 = Q$1("Listbox.Options"), t2 = p("Listbox.Options"), [p$12, S2, h3, I2] = S$5(t2, (e3) => [e3.listboxState, e3.buttonElement, e3.optionsElement, e3.__demoMode]), R$1 = u$7(S2), c3 = u$7(h3), L2 = u$4(), [f2, k2] = N(i$12, x2, L2 !== null ? (L2 & i.Open) === i.Open : p$12 === F.Open);
|
|
6914
6914
|
p$3(f2, S2, t2.actions.closeListbox);
|
|
6915
6915
|
let N$12 = I2 ? false : _2 && p$12 === F.Open;
|
|
6916
6916
|
f$6(N$12, c3);
|
|
6917
6917
|
let C2 = I2 ? false : _2 && p$12 === F.Open;
|
|
6918
6918
|
y$3(C2, { allowed: useCallback(() => [S2, h3], [S2, h3]) });
|
|
6919
|
-
let n2 = S$5(t2, t2.selectors.didButtonMove) ? false : f2, F$12 = S$5(t2, t2.selectors.hasFrozenValue) && !b3.static, U2 = u$5(F$12, l2.value), H2 = useCallback((
|
|
6919
|
+
let n2 = S$5(t2, t2.selectors.didButtonMove) ? false : f2, F$12 = S$5(t2, t2.selectors.hasFrozenValue) && !b3.static, U2 = u$5(F$12, l2.value), H2 = useCallback((e3) => l2.compare(U2, e3), [l2.compare, U2]), A2 = S$5(t2, (e3) => {
|
|
6920
6920
|
var de2;
|
|
6921
6921
|
if (o4 == null || !((de2 = o4 == null ? void 0 : o4.to) != null && de2.includes("selection"))) return null;
|
|
6922
|
-
let w2 =
|
|
6922
|
+
let w2 = e3.options.findIndex((ve2) => H2(ve2.dataRef.current.value));
|
|
6923
6923
|
return w2 === -1 && (w2 = 0), w2;
|
|
6924
6924
|
}), $2 = (() => {
|
|
6925
6925
|
if (o4 == null) return;
|
|
6926
6926
|
if (A2 === null) return { ...o4, inner: void 0 };
|
|
6927
|
-
let
|
|
6928
|
-
return { ...o4, inner: { listRef: { current:
|
|
6927
|
+
let e3 = Array.from(l2.listRef.current.values());
|
|
6928
|
+
return { ...o4, inner: { listRef: { current: e3 }, index: A2 } };
|
|
6929
6929
|
})(), [r2, M2] = Re$1($2), ne2 = Te$1(), re2 = y$5(E2, o4 ? r2 : null, t2.actions.setOptionsElement, O2), q2 = p$7();
|
|
6930
6930
|
useEffect(() => {
|
|
6931
|
-
let
|
|
6932
|
-
|
|
6931
|
+
let e3 = h3;
|
|
6932
|
+
e3 && p$12 === F.Open && (d$2(e3) || e3 == null || e3.focus({ preventScroll: true }));
|
|
6933
6933
|
}, [p$12, h3]);
|
|
6934
|
-
let le = o$6((
|
|
6934
|
+
let le = o$6((e3) => {
|
|
6935
6935
|
var w2;
|
|
6936
|
-
switch (q2.dispose(),
|
|
6936
|
+
switch (q2.dispose(), e3.key) {
|
|
6937
6937
|
case o$4.Space:
|
|
6938
|
-
if (t2.state.searchQuery !== "") return
|
|
6938
|
+
if (t2.state.searchQuery !== "") return e3.preventDefault(), e3.stopPropagation(), t2.actions.search(e3.key);
|
|
6939
6939
|
case o$4.Enter:
|
|
6940
|
-
|
|
6940
|
+
e3.preventDefault(), e3.stopPropagation(), t2.actions.selectActiveOption();
|
|
6941
6941
|
break;
|
|
6942
6942
|
case u$e(l2.orientation, { vertical: o$4.ArrowDown, horizontal: o$4.ArrowRight }):
|
|
6943
|
-
return
|
|
6943
|
+
return e3.preventDefault(), e3.stopPropagation(), t2.actions.goToOption({ focus: c$5.Next });
|
|
6944
6944
|
case u$e(l2.orientation, { vertical: o$4.ArrowUp, horizontal: o$4.ArrowLeft }):
|
|
6945
|
-
return
|
|
6945
|
+
return e3.preventDefault(), e3.stopPropagation(), t2.actions.goToOption({ focus: c$5.Previous });
|
|
6946
6946
|
case o$4.Home:
|
|
6947
6947
|
case o$4.PageUp:
|
|
6948
|
-
return
|
|
6948
|
+
return e3.preventDefault(), e3.stopPropagation(), t2.actions.goToOption({ focus: c$5.First });
|
|
6949
6949
|
case o$4.End:
|
|
6950
6950
|
case o$4.PageDown:
|
|
6951
|
-
return
|
|
6951
|
+
return e3.preventDefault(), e3.stopPropagation(), t2.actions.goToOption({ focus: c$5.Last });
|
|
6952
6952
|
case o$4.Escape:
|
|
6953
|
-
|
|
6953
|
+
e3.preventDefault(), e3.stopPropagation(), flushSync(() => t2.actions.closeListbox()), (w2 = t2.state.buttonElement) == null || w2.focus({ preventScroll: true });
|
|
6954
6954
|
return;
|
|
6955
6955
|
case o$4.Tab:
|
|
6956
|
-
|
|
6956
|
+
e3.preventDefault(), e3.stopPropagation(), flushSync(() => t2.actions.closeListbox()), R(t2.state.buttonElement, e3.shiftKey ? T$2.Previous : T$2.Next);
|
|
6957
6957
|
break;
|
|
6958
6958
|
default:
|
|
6959
|
-
|
|
6959
|
+
e3.key.length === 1 && (t2.actions.search(e3.key), q2.setTimeout(() => t2.actions.clearSearch(), 350));
|
|
6960
6960
|
break;
|
|
6961
6961
|
}
|
|
6962
|
-
}), P$12 = S$5(t2, (
|
|
6962
|
+
}), P$12 = S$5(t2, (e3) => {
|
|
6963
6963
|
var w2;
|
|
6964
|
-
return (w2 =
|
|
6964
|
+
return (w2 = e3.buttonElement) == null ? void 0 : w2.id;
|
|
6965
6965
|
}), W2 = n$5({ open: p$12 === F.Open }), Le2 = V$3(o4 ? ne2() : {}, { id: u3, ref: re2, "aria-activedescendant": S$5(t2, t2.selectors.activeDescendantId), "aria-multiselectable": l2.mode === P.Multi ? true : void 0, "aria-labelledby": P$12, "aria-orientation": l2.orientation, onKeyDown: le, role: "listbox", tabIndex: p$12 === F.Open ? 0 : void 0, style: { ...y3.style, ...M2, "--button-width": w$5(f2, S2, true).width }, ...x$2(k2) }), Pe = K(), ge2 = useMemo(() => l2.mode === P.Multi ? l2 : { ...l2, isSelected: H2 }, [l2, H2]);
|
|
6966
6966
|
return React__default.createElement(te$2, { enabled: a4 ? b3.static || f2 : false, ownerDocument: R$1 }, React__default.createElement(oe.Provider, { value: ge2 }, Pe({ ourProps: Le2, theirProps: y3, slot: W2, defaultTag: ht, features: At, visible: n2, name: "Listbox.Options" })));
|
|
6967
6967
|
}
|
|
@@ -7016,12 +7016,12 @@ function Le$1(n2, t2) {
|
|
|
7016
7016
|
P2(true), r2 == null || r2(!d3), F2.nextFrame(() => {
|
|
7017
7017
|
P2(false);
|
|
7018
7018
|
});
|
|
7019
|
-
}), k2 = o$6((
|
|
7020
|
-
if (s$8(
|
|
7021
|
-
|
|
7022
|
-
}), M2 = o$6((
|
|
7023
|
-
|
|
7024
|
-
}), U2 = o$6((
|
|
7019
|
+
}), k2 = o$6((e3) => {
|
|
7020
|
+
if (s$8(e3.currentTarget)) return e3.preventDefault();
|
|
7021
|
+
e3.preventDefault(), D2();
|
|
7022
|
+
}), M2 = o$6((e3) => {
|
|
7023
|
+
e3.key === o$4.Space ? (e3.preventDefault(), D2()) : e3.key === o$4.Enter && g$3(e3.currentTarget);
|
|
7024
|
+
}), U2 = o$6((e3) => e3.preventDefault()), I2 = N$1(), B = w$6(), { isFocusVisible: K$1, focusProps: O2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: S2 }), { isHovered: W2, hoverProps: N2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: o4 }), { pressed: J2, pressProps: V2 } = w$7({ disabled: o4 }), X2 = n$5({ checked: d3, disabled: o4, hover: W2, focus: K$1, active: J2, autofocus: S2, changing: H2 }), j2 = V$3({ id: b3, ref: A2, role: "switch", type: e$1(n2, L2), tabIndex: n2.tabIndex === -1 ? 0 : (g2 = n2.tabIndex) != null ? g2 : 0, "aria-checked": d3, "aria-labelledby": I2, "aria-describedby": B, disabled: o4 || void 0, autoFocus: S2, onClick: k2, onKeyUp: M2, onKeyPress: U2 }, O2, N2, V2), $2 = useCallback(() => {
|
|
7025
7025
|
if (l2 !== void 0) return r2 == null ? void 0 : r2(l2);
|
|
7026
7026
|
}, [r2, l2]), q2 = K();
|
|
7027
7027
|
return React__default.createElement(React__default.Fragment, null, p2 != null && React__default.createElement(j$6, { disabled: o4, data: { [p2]: c3 || "on" }, overrides: { type: "checkbox", checked: d3 }, form: u3, onReset: $2 }), q2({ ourProps: j2, theirProps: C2, slot: X2, defaultTag: Ce$1, name: "Switch" }));
|
|
@@ -7031,106 +7031,106 @@ function b2({ onFocus: n2 }) {
|
|
|
7031
7031
|
let [r2, o4] = useState(true), u3 = f$1();
|
|
7032
7032
|
return r2 ? React__default.createElement(f$d, { as: "button", type: "button", features: s$9.Focusable, onFocus: (a4) => {
|
|
7033
7033
|
a4.preventDefault();
|
|
7034
|
-
let
|
|
7034
|
+
let e3, i2 = 50;
|
|
7035
7035
|
function t2() {
|
|
7036
7036
|
if (i2-- <= 0) {
|
|
7037
|
-
|
|
7037
|
+
e3 && cancelAnimationFrame(e3);
|
|
7038
7038
|
return;
|
|
7039
7039
|
}
|
|
7040
7040
|
if (n2()) {
|
|
7041
|
-
if (cancelAnimationFrame(
|
|
7041
|
+
if (cancelAnimationFrame(e3), !u3.current) return;
|
|
7042
7042
|
o4(false);
|
|
7043
7043
|
return;
|
|
7044
7044
|
}
|
|
7045
|
-
|
|
7045
|
+
e3 = requestAnimationFrame(t2);
|
|
7046
7046
|
}
|
|
7047
|
-
|
|
7047
|
+
e3 = requestAnimationFrame(t2);
|
|
7048
7048
|
} }) : null;
|
|
7049
7049
|
}
|
|
7050
7050
|
const s = React.createContext(null);
|
|
7051
7051
|
function a3() {
|
|
7052
|
-
return { groups: /* @__PURE__ */ new Map(), get(o4,
|
|
7052
|
+
return { groups: /* @__PURE__ */ new Map(), get(o4, e3) {
|
|
7053
7053
|
var i2;
|
|
7054
7054
|
let t2 = this.groups.get(o4);
|
|
7055
7055
|
t2 || (t2 = /* @__PURE__ */ new Map(), this.groups.set(o4, t2));
|
|
7056
|
-
let n2 = (i2 = t2.get(
|
|
7057
|
-
t2.set(
|
|
7058
|
-
let r2 = Array.from(t2.keys()).indexOf(
|
|
7056
|
+
let n2 = (i2 = t2.get(e3)) != null ? i2 : 0;
|
|
7057
|
+
t2.set(e3, n2 + 1);
|
|
7058
|
+
let r2 = Array.from(t2.keys()).indexOf(e3);
|
|
7059
7059
|
function u3() {
|
|
7060
|
-
let c3 = t2.get(
|
|
7061
|
-
c3 > 1 ? t2.set(
|
|
7060
|
+
let c3 = t2.get(e3);
|
|
7061
|
+
c3 > 1 ? t2.set(e3, c3 - 1) : t2.delete(e3);
|
|
7062
7062
|
}
|
|
7063
7063
|
return [r2, u3];
|
|
7064
7064
|
} };
|
|
7065
7065
|
}
|
|
7066
7066
|
function f({ children: o4 }) {
|
|
7067
|
-
let
|
|
7068
|
-
return React.createElement(s.Provider, { value:
|
|
7067
|
+
let e3 = React.useRef(a3());
|
|
7068
|
+
return React.createElement(s.Provider, { value: e3 }, o4);
|
|
7069
7069
|
}
|
|
7070
7070
|
function C(o4) {
|
|
7071
|
-
let
|
|
7072
|
-
if (!
|
|
7073
|
-
let t2 = React.useId(), [n2, r2] =
|
|
7071
|
+
let e3 = React.useContext(s);
|
|
7072
|
+
if (!e3) throw new Error("You must wrap your component in a <StableCollection>");
|
|
7073
|
+
let t2 = React.useId(), [n2, r2] = e3.current.get(o4, t2);
|
|
7074
7074
|
return React.useEffect(() => r2, []), n2;
|
|
7075
7075
|
}
|
|
7076
7076
|
var Le = ((t2) => (t2[t2.Forwards = 0] = "Forwards", t2[t2.Backwards = 1] = "Backwards", t2))(Le || {}), _e = ((l2) => (l2[l2.Less = -1] = "Less", l2[l2.Equal = 0] = "Equal", l2[l2.Greater = 1] = "Greater", l2))(_e || {}), Se = ((n2) => (n2[n2.SetSelectedIndex = 0] = "SetSelectedIndex", n2[n2.RegisterTab = 1] = "RegisterTab", n2[n2.UnregisterTab = 2] = "UnregisterTab", n2[n2.RegisterPanel = 3] = "RegisterPanel", n2[n2.UnregisterPanel = 4] = "UnregisterPanel", n2))(Se || {});
|
|
7077
|
-
let De = { [0](
|
|
7077
|
+
let De = { [0](e3, r2) {
|
|
7078
7078
|
var d3;
|
|
7079
|
-
let t2 = G$1(
|
|
7079
|
+
let t2 = G$1(e3.tabs, (u3) => u3.current), l2 = G$1(e3.panels, (u3) => u3.current), a4 = t2.filter((u3) => {
|
|
7080
7080
|
var T3;
|
|
7081
7081
|
return !((T3 = u3.current) != null && T3.hasAttribute("disabled"));
|
|
7082
|
-
}), n2 = { ...
|
|
7082
|
+
}), n2 = { ...e3, tabs: t2, panels: l2 };
|
|
7083
7083
|
if (r2.index < 0 || r2.index > t2.length - 1) {
|
|
7084
|
-
let u3 = u$e(Math.sign(r2.index -
|
|
7084
|
+
let u3 = u$e(Math.sign(r2.index - e3.selectedIndex), { [-1]: () => 1, [0]: () => u$e(Math.sign(r2.index), { [-1]: () => 0, [0]: () => 0, [1]: () => 1 }), [1]: () => 0 });
|
|
7085
7085
|
if (a4.length === 0) return n2;
|
|
7086
7086
|
let T3 = u$e(u3, { [0]: () => t2.indexOf(a4[0]), [1]: () => t2.indexOf(a4[a4.length - 1]) });
|
|
7087
|
-
return { ...n2, selectedIndex: T3 === -1 ?
|
|
7087
|
+
return { ...n2, selectedIndex: T3 === -1 ? e3.selectedIndex : T3 };
|
|
7088
7088
|
}
|
|
7089
7089
|
let s2 = t2.slice(0, r2.index), f2 = [...t2.slice(r2.index), ...s2].find((u3) => a4.includes(u3));
|
|
7090
7090
|
if (!f2) return n2;
|
|
7091
|
-
let b3 = (d3 = t2.indexOf(f2)) != null ? d3 :
|
|
7092
|
-
return b3 === -1 && (b3 =
|
|
7093
|
-
}, [1](
|
|
7094
|
-
if (
|
|
7095
|
-
let t2 =
|
|
7096
|
-
return
|
|
7097
|
-
}, [2](
|
|
7098
|
-
return { ...
|
|
7099
|
-
}, [3](
|
|
7100
|
-
return
|
|
7101
|
-
}, [4](
|
|
7102
|
-
return { ...
|
|
7091
|
+
let b3 = (d3 = t2.indexOf(f2)) != null ? d3 : e3.selectedIndex;
|
|
7092
|
+
return b3 === -1 && (b3 = e3.selectedIndex), { ...n2, selectedIndex: b3 };
|
|
7093
|
+
}, [1](e3, r2) {
|
|
7094
|
+
if (e3.tabs.includes(r2.tab)) return e3;
|
|
7095
|
+
let t2 = e3.tabs[e3.selectedIndex], l2 = G$1([...e3.tabs, r2.tab], (n2) => n2.current), a4 = e3.selectedIndex;
|
|
7096
|
+
return e3.info.current.isControlled || (a4 = l2.indexOf(t2), a4 === -1 && (a4 = e3.selectedIndex)), { ...e3, tabs: l2, selectedIndex: a4 };
|
|
7097
|
+
}, [2](e3, r2) {
|
|
7098
|
+
return { ...e3, tabs: e3.tabs.filter((t2) => t2 !== r2.tab) };
|
|
7099
|
+
}, [3](e3, r2) {
|
|
7100
|
+
return e3.panels.includes(r2.panel) ? e3 : { ...e3, panels: G$1([...e3.panels, r2.panel], (t2) => t2.current) };
|
|
7101
|
+
}, [4](e3, r2) {
|
|
7102
|
+
return { ...e3, panels: e3.panels.filter((t2) => t2 !== r2.panel) };
|
|
7103
7103
|
} }, z = createContext(null);
|
|
7104
7104
|
z.displayName = "TabsDataContext";
|
|
7105
|
-
function h2(
|
|
7105
|
+
function h2(e3) {
|
|
7106
7106
|
let r2 = useContext(z);
|
|
7107
7107
|
if (r2 === null) {
|
|
7108
|
-
let t2 = new Error(`<${
|
|
7108
|
+
let t2 = new Error(`<${e3} /> is missing a parent <Tab.Group /> component.`);
|
|
7109
7109
|
throw Error.captureStackTrace && Error.captureStackTrace(t2, h2), t2;
|
|
7110
7110
|
}
|
|
7111
7111
|
return r2;
|
|
7112
7112
|
}
|
|
7113
7113
|
let V = createContext(null);
|
|
7114
7114
|
V.displayName = "TabsActionsContext";
|
|
7115
|
-
function Q(
|
|
7115
|
+
function Q(e3) {
|
|
7116
7116
|
let r2 = useContext(V);
|
|
7117
7117
|
if (r2 === null) {
|
|
7118
|
-
let t2 = new Error(`<${
|
|
7118
|
+
let t2 = new Error(`<${e3} /> is missing a parent <Tab.Group /> component.`);
|
|
7119
7119
|
throw Error.captureStackTrace && Error.captureStackTrace(t2, Q), t2;
|
|
7120
7120
|
}
|
|
7121
7121
|
return r2;
|
|
7122
7122
|
}
|
|
7123
|
-
function Fe(
|
|
7124
|
-
return u$e(r2.type, De,
|
|
7123
|
+
function Fe(e3, r2) {
|
|
7124
|
+
return u$e(r2.type, De, e3, r2);
|
|
7125
7125
|
}
|
|
7126
7126
|
let Ie = "div";
|
|
7127
|
-
function he(
|
|
7128
|
-
let { defaultIndex: t2 = 0, vertical: l2 = false, manual: a4 = false, onChange: n2, selectedIndex: s2 = null, ...g2 } =
|
|
7127
|
+
function he(e3, r2) {
|
|
7128
|
+
let { defaultIndex: t2 = 0, vertical: l2 = false, manual: a4 = false, onChange: n2, selectedIndex: s2 = null, ...g2 } = e3;
|
|
7129
7129
|
const f$12 = l2 ? "vertical" : "horizontal", b$12 = a4 ? "manual" : "auto";
|
|
7130
7130
|
let d3 = s2 !== null, u3 = s$b({ isControlled: d3 }), T3 = y$5(r2), [p2, c3] = useReducer(Fe, { info: u3, selectedIndex: s2 != null ? s2 : t2, tabs: [], panels: [] }), v2 = n$5({ selectedIndex: p2.selectedIndex }), m2 = s$b(n2 || (() => {
|
|
7131
7131
|
})), C2 = s$b(p2.tabs), D2 = useMemo(() => ({ orientation: f$12, activation: b$12, ...p2 }), [f$12, b$12, p2]), P2 = o$6((i2) => (c3({ type: 1, tab: i2 }), () => c3({ type: 2, tab: i2 }))), R2 = o$6((i2) => (c3({ type: 3, panel: i2 }), () => c3({ type: 4, panel: i2 }))), A2 = o$6((i2) => {
|
|
7132
7132
|
L2.current !== i2 && m2.current(i2), d3 || c3({ type: 0, index: i2 });
|
|
7133
|
-
}), L2 = s$b(d3 ?
|
|
7133
|
+
}), L2 = s$b(d3 ? e3.selectedIndex : p2.selectedIndex), _2 = useMemo(() => ({ registerTab: P2, registerPanel: R2, change: A2 }), []);
|
|
7134
7134
|
n$6(() => {
|
|
7135
7135
|
c3({ type: 0, index: s2 != null ? s2 : t2 });
|
|
7136
7136
|
}, [s2]), n$6(() => {
|
|
@@ -7146,14 +7146,14 @@ function he(e2, r2) {
|
|
|
7146
7146
|
} }), X2({ ourProps: J2, theirProps: g2, slot: v2, defaultTag: Ie, name: "Tabs" }))));
|
|
7147
7147
|
}
|
|
7148
7148
|
let ve = "div";
|
|
7149
|
-
function Ce(
|
|
7150
|
-
let { orientation: t2, selectedIndex: l2 } = h2("Tab.List"), a4 = y$5(r2), n2 = n$5({ selectedIndex: l2 }), s2 =
|
|
7149
|
+
function Ce(e3, r2) {
|
|
7150
|
+
let { orientation: t2, selectedIndex: l2 } = h2("Tab.List"), a4 = y$5(r2), n2 = n$5({ selectedIndex: l2 }), s2 = e3, g2 = { ref: a4, role: "tablist", "aria-orientation": t2 };
|
|
7151
7151
|
return K()({ ourProps: g2, theirProps: s2, slot: n2, defaultTag: ve, name: "Tabs.List" });
|
|
7152
7152
|
}
|
|
7153
7153
|
let Me = "button";
|
|
7154
|
-
function Ge(
|
|
7154
|
+
function Ge(e3, r2) {
|
|
7155
7155
|
var Y2, Z2;
|
|
7156
|
-
let t2 = useId$1(), { id: l2 = `headlessui-tabs-tab-${t2}`, disabled: a4 = false, autoFocus: n2 = false, ...s2 } =
|
|
7156
|
+
let t2 = useId$1(), { id: l2 = `headlessui-tabs-tab-${t2}`, disabled: a4 = false, autoFocus: n2 = false, ...s2 } = e3, { orientation: g2, activation: f2, selectedIndex: b3, tabs: d3, panels: u3 } = h2("Tab"), T3 = Q("Tab"), p2 = h2("Tab"), [c3, v2] = useState(null), m2 = useRef(null), C$12 = y$5(m2, r2, v2);
|
|
7157
7157
|
n$6(() => T3.registerTab(m2), [T3, m2]);
|
|
7158
7158
|
let D2 = C("tabs"), P2 = d3.indexOf(m2);
|
|
7159
7159
|
P2 === -1 && (P2 = D2);
|
|
@@ -7190,18 +7190,18 @@ function Ge(e2, r2) {
|
|
|
7190
7190
|
}));
|
|
7191
7191
|
}), X2 = o$6((o4) => {
|
|
7192
7192
|
o4.preventDefault();
|
|
7193
|
-
}), { isFocusVisible: i2, focusProps: M2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: n2 }), { isHovered: S2, hoverProps: $2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: a4 }), { pressed: pe, pressProps: ue2 } = w$7({ disabled: a4 }), Te2 = n$5({ selected: R2, hover: S2, active: pe, focus: i2, autofocus: n2, disabled: a4 }), de2 = V$3({ ref: C$12, onKeyDown: L2, onMouseDown: X2, onClick: J2, id: l2, role: "tab", type: e$1(
|
|
7193
|
+
}), { isFocusVisible: i2, focusProps: M2 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: n2 }), { isHovered: S2, hoverProps: $2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: a4 }), { pressed: pe, pressProps: ue2 } = w$7({ disabled: a4 }), Te2 = n$5({ selected: R2, hover: S2, active: pe, focus: i2, autofocus: n2, disabled: a4 }), de2 = V$3({ ref: C$12, onKeyDown: L2, onMouseDown: X2, onClick: J2, id: l2, role: "tab", type: e$1(e3, c3), "aria-controls": (Z2 = (Y2 = u3[P2]) == null ? void 0 : Y2.current) == null ? void 0 : Z2.id, "aria-selected": R2, tabIndex: R2 ? 0 : -1, disabled: a4 || void 0, autoFocus: n2 }, M2, $2, ue2);
|
|
7194
7194
|
return K()({ ourProps: de2, theirProps: s2, slot: Te2, defaultTag: Me, name: "Tabs.Tab" });
|
|
7195
7195
|
}
|
|
7196
7196
|
let Ue = "div";
|
|
7197
|
-
function He(
|
|
7198
|
-
let { selectedIndex: t2 } = h2("Tab.Panels"), l2 = y$5(r2), a4 = n$5({ selectedIndex: t2 }), n2 =
|
|
7197
|
+
function He(e3, r2) {
|
|
7198
|
+
let { selectedIndex: t2 } = h2("Tab.Panels"), l2 = y$5(r2), a4 = n$5({ selectedIndex: t2 }), n2 = e3, s2 = { ref: l2 };
|
|
7199
7199
|
return K()({ ourProps: s2, theirProps: n2, slot: a4, defaultTag: Ue, name: "Tabs.Panels" });
|
|
7200
7200
|
}
|
|
7201
7201
|
let we = "div", Oe = A$2.RenderStrategy | A$2.Static;
|
|
7202
|
-
function Ne(
|
|
7202
|
+
function Ne(e3, r2) {
|
|
7203
7203
|
var R2, A2, L2, _2;
|
|
7204
|
-
let t2 = useId$1(), { id: l2 = `headlessui-tabs-panel-${t2}`, tabIndex: a4 = 0, ...n2 } =
|
|
7204
|
+
let t2 = useId$1(), { id: l2 = `headlessui-tabs-panel-${t2}`, tabIndex: a4 = 0, ...n2 } = e3, { selectedIndex: s2, tabs: g2, panels: f2 } = h2("Tab.Panel"), b3 = Q("Tab.Panel"), d3 = useRef(null), u3 = y$5(d3, r2);
|
|
7205
7205
|
n$6(() => b3.registerPanel(d3), [b3, d3]);
|
|
7206
7206
|
let T3 = C("panels"), p2 = f2.indexOf(d3);
|
|
7207
7207
|
p2 === -1 && (p2 = T3);
|
|
@@ -7222,7 +7222,8 @@ function Select({
|
|
|
7222
7222
|
fullWidth = false,
|
|
7223
7223
|
className,
|
|
7224
7224
|
isLoading = false,
|
|
7225
|
-
loadingText = "Loading..."
|
|
7225
|
+
loadingText = "Loading...",
|
|
7226
|
+
placement = "bottom"
|
|
7226
7227
|
}) {
|
|
7227
7228
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
7228
7229
|
const hasError = !!error2;
|
|
@@ -7296,43 +7297,52 @@ function Select({
|
|
|
7296
7297
|
leave: "transition ease-in duration-100",
|
|
7297
7298
|
leaveFrom: "opacity-100",
|
|
7298
7299
|
leaveTo: "opacity-0",
|
|
7299
|
-
children: /* @__PURE__ */ jsx(
|
|
7300
|
-
|
|
7300
|
+
children: /* @__PURE__ */ jsx(
|
|
7301
|
+
Bt,
|
|
7301
7302
|
{
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
"relative cursor-pointer select-none py-2.5 pl-10 pr-4",
|
|
7306
|
-
// Light mode
|
|
7307
|
-
active ? "bg-gold-50 text-primary-900" : "text-primary-900",
|
|
7308
|
-
// Dark mode
|
|
7309
|
-
active ? "dark:bg-primary-700 dark:text-primary-100" : "dark:text-primary-200",
|
|
7310
|
-
option.disabled && "cursor-not-allowed opacity-50",
|
|
7311
|
-
selected && "font-medium"
|
|
7303
|
+
className: cn(
|
|
7304
|
+
"absolute z-dropdown max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700",
|
|
7305
|
+
placement === "top" ? "bottom-full mb-1" : "top-full mt-1"
|
|
7312
7306
|
),
|
|
7313
|
-
children: (
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
"
|
|
7322
|
-
|
|
7323
|
-
|
|
7307
|
+
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
7308
|
+
It,
|
|
7309
|
+
{
|
|
7310
|
+
disabled: option.disabled,
|
|
7311
|
+
value: option.value,
|
|
7312
|
+
className: ({ active, selected }) => cn(
|
|
7313
|
+
"relative cursor-pointer select-none py-2.5 pl-10 pr-4",
|
|
7314
|
+
// Light mode
|
|
7315
|
+
active ? "bg-gold-50 text-primary-900" : "text-primary-900",
|
|
7316
|
+
// Dark mode
|
|
7317
|
+
active ? "dark:bg-primary-700 dark:text-primary-100" : "dark:text-primary-200",
|
|
7318
|
+
option.disabled && "cursor-not-allowed opacity-50",
|
|
7319
|
+
selected && "font-medium"
|
|
7320
|
+
),
|
|
7321
|
+
children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7322
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate", children: option.label }),
|
|
7323
|
+
selected && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-gold-600 dark:text-gold-400", children: /* @__PURE__ */ jsx(
|
|
7324
|
+
"svg",
|
|
7324
7325
|
{
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7326
|
+
className: "h-5 w-5",
|
|
7327
|
+
fill: "currentColor",
|
|
7328
|
+
viewBox: "0 0 20 20",
|
|
7329
|
+
"aria-hidden": "true",
|
|
7330
|
+
children: /* @__PURE__ */ jsx(
|
|
7331
|
+
"path",
|
|
7332
|
+
{
|
|
7333
|
+
clipRule: "evenodd",
|
|
7334
|
+
d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
|
|
7335
|
+
fillRule: "evenodd"
|
|
7336
|
+
}
|
|
7337
|
+
)
|
|
7328
7338
|
}
|
|
7329
|
-
)
|
|
7330
|
-
}
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
)
|
|
7339
|
+
) })
|
|
7340
|
+
] })
|
|
7341
|
+
},
|
|
7342
|
+
option.value
|
|
7343
|
+
))
|
|
7344
|
+
}
|
|
7345
|
+
)
|
|
7336
7346
|
}
|
|
7337
7347
|
)
|
|
7338
7348
|
] }) }),
|
|
@@ -7369,7 +7379,7 @@ const CloseIcon$2 = () => /* @__PURE__ */ jsx(
|
|
|
7369
7379
|
)
|
|
7370
7380
|
}
|
|
7371
7381
|
);
|
|
7372
|
-
const sizeStyles$
|
|
7382
|
+
const sizeStyles$9 = {
|
|
7373
7383
|
sm: "max-w-[400px]",
|
|
7374
7384
|
md: "max-w-[560px]",
|
|
7375
7385
|
lg: "max-w-[720px]"
|
|
@@ -7422,7 +7432,7 @@ function Modal({
|
|
|
7422
7432
|
"bg-white border border-primary-200",
|
|
7423
7433
|
// Dark mode
|
|
7424
7434
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7425
|
-
sizeStyles$
|
|
7435
|
+
sizeStyles$9[size2],
|
|
7426
7436
|
className
|
|
7427
7437
|
),
|
|
7428
7438
|
children: [
|
|
@@ -7500,7 +7510,7 @@ const CloseIcon$1 = () => /* @__PURE__ */ jsx(
|
|
|
7500
7510
|
)
|
|
7501
7511
|
}
|
|
7502
7512
|
);
|
|
7503
|
-
const sizeStyles$
|
|
7513
|
+
const sizeStyles$8 = {
|
|
7504
7514
|
sm: "max-w-[400px]",
|
|
7505
7515
|
md: "max-w-[560px]",
|
|
7506
7516
|
lg: "max-w-[720px]"
|
|
@@ -7549,7 +7559,7 @@ function Drawer({
|
|
|
7549
7559
|
"bg-white border-l border-primary-200",
|
|
7550
7560
|
// Dark mode
|
|
7551
7561
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7552
|
-
sizeStyles$
|
|
7562
|
+
sizeStyles$8[size2],
|
|
7553
7563
|
className
|
|
7554
7564
|
),
|
|
7555
7565
|
children: [
|
|
@@ -7665,7 +7675,7 @@ const paddingStyles = {
|
|
|
7665
7675
|
md: "p-6",
|
|
7666
7676
|
lg: "p-8"
|
|
7667
7677
|
};
|
|
7668
|
-
const variantStyles$
|
|
7678
|
+
const variantStyles$3 = {
|
|
7669
7679
|
default: [
|
|
7670
7680
|
"shadow-sm border border-primary-200",
|
|
7671
7681
|
"dark:border-primary-700"
|
|
@@ -7706,7 +7716,7 @@ const Card = forwardRef(
|
|
|
7706
7716
|
// Padding
|
|
7707
7717
|
paddingStyles[padding],
|
|
7708
7718
|
// Variant
|
|
7709
|
-
variantStyles$
|
|
7719
|
+
variantStyles$3[variant],
|
|
7710
7720
|
// Hover effect
|
|
7711
7721
|
hoverable && [
|
|
7712
7722
|
"cursor-pointer",
|
|
@@ -7722,7 +7732,7 @@ const Card = forwardRef(
|
|
|
7722
7732
|
}
|
|
7723
7733
|
);
|
|
7724
7734
|
Card.displayName = "Card";
|
|
7725
|
-
const sizeStyles$
|
|
7735
|
+
const sizeStyles$7 = {
|
|
7726
7736
|
sm: "h-4 w-4",
|
|
7727
7737
|
md: "h-5 w-5",
|
|
7728
7738
|
lg: "h-6 w-6"
|
|
@@ -7767,8 +7777,8 @@ const Checkbox = forwardRef(
|
|
|
7767
7777
|
},
|
|
7768
7778
|
[forwardedRef]
|
|
7769
7779
|
);
|
|
7770
|
-
const handleChange = (
|
|
7771
|
-
onChange?.(
|
|
7780
|
+
const handleChange = (e3) => {
|
|
7781
|
+
onChange?.(e3.target.checked);
|
|
7772
7782
|
};
|
|
7773
7783
|
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
7774
7784
|
/* @__PURE__ */ jsxs(
|
|
@@ -7792,7 +7802,7 @@ const Checkbox = forwardRef(
|
|
|
7792
7802
|
"aria-describedby": errorId,
|
|
7793
7803
|
onChange: handleChange,
|
|
7794
7804
|
className: cn(
|
|
7795
|
-
sizeStyles$
|
|
7805
|
+
sizeStyles$7[size2],
|
|
7796
7806
|
"rounded border transition-colors",
|
|
7797
7807
|
"focus:ring-2 focus:ring-offset-0",
|
|
7798
7808
|
"disabled:cursor-not-allowed",
|
|
@@ -7846,7 +7856,7 @@ const Checkbox = forwardRef(
|
|
|
7846
7856
|
}
|
|
7847
7857
|
);
|
|
7848
7858
|
Checkbox.displayName = "Checkbox";
|
|
7849
|
-
const sizeStyles$
|
|
7859
|
+
const sizeStyles$6 = {
|
|
7850
7860
|
sm: "h-4 w-4",
|
|
7851
7861
|
md: "h-5 w-5",
|
|
7852
7862
|
lg: "h-6 w-6"
|
|
@@ -7885,7 +7895,7 @@ const Radio = forwardRef(
|
|
|
7885
7895
|
id: radioId,
|
|
7886
7896
|
disabled,
|
|
7887
7897
|
className: cn(
|
|
7888
|
-
sizeStyles$
|
|
7898
|
+
sizeStyles$6[size2],
|
|
7889
7899
|
"border transition-colors",
|
|
7890
7900
|
"focus:ring-2 focus:ring-offset-0",
|
|
7891
7901
|
"disabled:cursor-not-allowed",
|
|
@@ -7941,8 +7951,8 @@ function RadioGroup({
|
|
|
7941
7951
|
const hasError = !!error2;
|
|
7942
7952
|
const groupId = `${name}-group`;
|
|
7943
7953
|
const isDisabled = disabled || isLoading;
|
|
7944
|
-
const handleChange = (
|
|
7945
|
-
onChange?.(
|
|
7954
|
+
const handleChange = (e3) => {
|
|
7955
|
+
onChange?.(e3.target.value);
|
|
7946
7956
|
};
|
|
7947
7957
|
return /* @__PURE__ */ jsxs("fieldset", { className, role: "radiogroup", "aria-labelledby": label ? groupId : void 0, children: [
|
|
7948
7958
|
label && /* @__PURE__ */ jsxs(
|
|
@@ -7992,7 +8002,7 @@ function RadioGroup({
|
|
|
7992
8002
|
] });
|
|
7993
8003
|
}
|
|
7994
8004
|
RadioGroup.displayName = "RadioGroup";
|
|
7995
|
-
const sizeStyles$
|
|
8005
|
+
const sizeStyles$5 = {
|
|
7996
8006
|
sm: {
|
|
7997
8007
|
switch: "h-5 w-9",
|
|
7998
8008
|
dot: "h-3 w-3",
|
|
@@ -8019,7 +8029,7 @@ function Toggle({
|
|
|
8019
8029
|
className,
|
|
8020
8030
|
isLoading = false
|
|
8021
8031
|
}) {
|
|
8022
|
-
const currentSize = sizeStyles$
|
|
8032
|
+
const currentSize = sizeStyles$5[size2];
|
|
8023
8033
|
const isDisabled = disabled || isLoading;
|
|
8024
8034
|
return /* @__PURE__ */ jsx(W, { className, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8025
8035
|
(label || description) && /* @__PURE__ */ jsxs("div", { className: "flex-1 mr-4", children: [
|
|
@@ -8174,8 +8184,8 @@ function Combobox({
|
|
|
8174
8184
|
"aria-label": !label ? placeholder : void 0,
|
|
8175
8185
|
"aria-labelledby": label ? labelId : void 0,
|
|
8176
8186
|
displayValue: () => selectedOption?.label || "",
|
|
8177
|
-
onChange: (
|
|
8178
|
-
const newQuery =
|
|
8187
|
+
onChange: (e3) => {
|
|
8188
|
+
const newQuery = e3.target.value;
|
|
8179
8189
|
setQuery(newQuery);
|
|
8180
8190
|
onSearch?.(newQuery);
|
|
8181
8191
|
},
|
|
@@ -8256,7 +8266,7 @@ function Combobox({
|
|
|
8256
8266
|
] });
|
|
8257
8267
|
}
|
|
8258
8268
|
Combobox.displayName = "Combobox";
|
|
8259
|
-
const variantStyles$
|
|
8269
|
+
const variantStyles$2 = {
|
|
8260
8270
|
default: cn(
|
|
8261
8271
|
"bg-primary-100 text-primary-700 border-primary-200",
|
|
8262
8272
|
"dark:bg-primary-800 dark:text-primary-200 dark:border-primary-700"
|
|
@@ -8282,7 +8292,7 @@ const variantStyles$1 = {
|
|
|
8282
8292
|
"dark:bg-gold-900/50 dark:text-gold-300 dark:border-gold-700"
|
|
8283
8293
|
)
|
|
8284
8294
|
};
|
|
8285
|
-
const sizeStyles$
|
|
8295
|
+
const sizeStyles$4 = {
|
|
8286
8296
|
sm: "px-2 py-0.5 text-xs",
|
|
8287
8297
|
md: "px-2.5 py-1 text-sm",
|
|
8288
8298
|
lg: "px-3 py-1.5 text-base"
|
|
@@ -8295,8 +8305,8 @@ const Badge = forwardRef(
|
|
|
8295
8305
|
ref,
|
|
8296
8306
|
className: cn(
|
|
8297
8307
|
"inline-flex items-center justify-center font-medium rounded-full border",
|
|
8298
|
-
variantStyles$
|
|
8299
|
-
sizeStyles$
|
|
8308
|
+
variantStyles$2[variant],
|
|
8309
|
+
sizeStyles$4[size2],
|
|
8300
8310
|
className
|
|
8301
8311
|
),
|
|
8302
8312
|
...props,
|
|
@@ -8454,7 +8464,7 @@ const TableCell = forwardRef(
|
|
|
8454
8464
|
}
|
|
8455
8465
|
);
|
|
8456
8466
|
TableCell.displayName = "TableCell";
|
|
8457
|
-
const sizeStyles$
|
|
8467
|
+
const sizeStyles$3 = {
|
|
8458
8468
|
sm: "px-3 py-1.5 text-sm",
|
|
8459
8469
|
md: "px-4 py-2 text-sm",
|
|
8460
8470
|
lg: "px-5 py-2.5 text-base"
|
|
@@ -8503,7 +8513,7 @@ function Tabs({
|
|
|
8503
8513
|
className: ({ selected }) => cn(
|
|
8504
8514
|
"relative outline-none transition-colors duration-normal",
|
|
8505
8515
|
"focus-visible:ring-2 focus-visible:ring-gold-500/50",
|
|
8506
|
-
sizeStyles$
|
|
8516
|
+
sizeStyles$3[size2],
|
|
8507
8517
|
fullWidth && "flex-1",
|
|
8508
8518
|
// Default variant styles
|
|
8509
8519
|
variant === "default" && [
|
|
@@ -8687,7 +8697,7 @@ const Breadcrumbs = forwardRef(
|
|
|
8687
8697
|
}
|
|
8688
8698
|
);
|
|
8689
8699
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
8690
|
-
const variantStyles = {
|
|
8700
|
+
const variantStyles$1 = {
|
|
8691
8701
|
text: "rounded",
|
|
8692
8702
|
circular: "rounded-full",
|
|
8693
8703
|
rectangular: "rounded-md"
|
|
@@ -8723,7 +8733,7 @@ const Skeleton = forwardRef(
|
|
|
8723
8733
|
{
|
|
8724
8734
|
className: cn(
|
|
8725
8735
|
"bg-primary-200 dark:bg-primary-700",
|
|
8726
|
-
variantStyles[variant],
|
|
8736
|
+
variantStyles$1[variant],
|
|
8727
8737
|
animate && "animate-pulse"
|
|
8728
8738
|
),
|
|
8729
8739
|
style: {
|
|
@@ -8745,7 +8755,7 @@ const Skeleton = forwardRef(
|
|
|
8745
8755
|
ref,
|
|
8746
8756
|
className: cn(
|
|
8747
8757
|
"bg-primary-200 dark:bg-primary-700",
|
|
8748
|
-
variantStyles[variant],
|
|
8758
|
+
variantStyles$1[variant],
|
|
8749
8759
|
animate && "animate-pulse",
|
|
8750
8760
|
className
|
|
8751
8761
|
),
|
|
@@ -8823,7 +8833,7 @@ const defaultIcons = {
|
|
|
8823
8833
|
}
|
|
8824
8834
|
)
|
|
8825
8835
|
};
|
|
8826
|
-
const sizeStyles$
|
|
8836
|
+
const sizeStyles$2 = {
|
|
8827
8837
|
sm: {
|
|
8828
8838
|
container: "py-6 px-4",
|
|
8829
8839
|
icon: "w-10 h-10",
|
|
@@ -8859,7 +8869,7 @@ const EmptyState = forwardRef(
|
|
|
8859
8869
|
className,
|
|
8860
8870
|
...props
|
|
8861
8871
|
}, ref) => {
|
|
8862
|
-
const styles = sizeStyles$
|
|
8872
|
+
const styles = sizeStyles$2[size2];
|
|
8863
8873
|
return /* @__PURE__ */ jsxs(
|
|
8864
8874
|
"div",
|
|
8865
8875
|
{
|
|
@@ -8903,7 +8913,7 @@ const EmptyState = forwardRef(
|
|
|
8903
8913
|
EmptyState.displayName = "EmptyState";
|
|
8904
8914
|
const ChevronLeftIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) });
|
|
8905
8915
|
const ChevronRightIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) });
|
|
8906
|
-
const sizeStyles = {
|
|
8916
|
+
const sizeStyles$1 = {
|
|
8907
8917
|
sm: { button: "h-8 min-w-8 px-2 text-sm", text: "text-sm" },
|
|
8908
8918
|
md: { button: "h-10 min-w-10 px-3 text-sm", text: "text-sm" }
|
|
8909
8919
|
};
|
|
@@ -8953,7 +8963,7 @@ function Pagination({
|
|
|
8953
8963
|
className
|
|
8954
8964
|
}) {
|
|
8955
8965
|
const pageSizeId = useId$1();
|
|
8956
|
-
const currentSize = sizeStyles[size2];
|
|
8966
|
+
const currentSize = sizeStyles$1[size2];
|
|
8957
8967
|
const canGoPrevious = currentPage > 1;
|
|
8958
8968
|
const canGoNext = currentPage < totalPages;
|
|
8959
8969
|
const pageNumbers = useMemo(
|
|
@@ -9067,7 +9077,7 @@ function Pagination({
|
|
|
9067
9077
|
{
|
|
9068
9078
|
id: pageSizeId,
|
|
9069
9079
|
value: pageSize,
|
|
9070
|
-
onChange: (
|
|
9080
|
+
onChange: (e3) => onPageSizeChange(Number(e3.target.value)),
|
|
9071
9081
|
disabled,
|
|
9072
9082
|
className: cn(
|
|
9073
9083
|
"rounded-md border bg-white px-2 py-1",
|
|
@@ -9243,9 +9253,9 @@ function MultiSelect({
|
|
|
9243
9253
|
);
|
|
9244
9254
|
const allSelected = selectableOptions.length > 0 && selectableOptions.every((opt) => value.includes(opt.value));
|
|
9245
9255
|
const someSelected = selectableOptions.some((opt) => value.includes(opt.value));
|
|
9246
|
-
const handleSelectAll = (
|
|
9247
|
-
|
|
9248
|
-
|
|
9256
|
+
const handleSelectAll = (e3) => {
|
|
9257
|
+
e3.preventDefault();
|
|
9258
|
+
e3.stopPropagation();
|
|
9249
9259
|
if (allSelected) {
|
|
9250
9260
|
const selectableValues = selectableOptions.map((opt) => opt.value);
|
|
9251
9261
|
onChange(value.filter((v2) => !selectableValues.includes(v2)));
|
|
@@ -9255,18 +9265,18 @@ function MultiSelect({
|
|
|
9255
9265
|
onChange(Array.from(newValues));
|
|
9256
9266
|
}
|
|
9257
9267
|
};
|
|
9258
|
-
const handleRemove = (optionValue,
|
|
9259
|
-
|
|
9260
|
-
|
|
9268
|
+
const handleRemove = (optionValue, e3) => {
|
|
9269
|
+
e3.preventDefault();
|
|
9270
|
+
e3.stopPropagation();
|
|
9261
9271
|
onChange(value.filter((v2) => v2 !== optionValue));
|
|
9262
9272
|
};
|
|
9263
|
-
const handleClearAll = (
|
|
9264
|
-
|
|
9265
|
-
|
|
9273
|
+
const handleClearAll = (e3) => {
|
|
9274
|
+
e3.preventDefault();
|
|
9275
|
+
e3.stopPropagation();
|
|
9266
9276
|
onChange([]);
|
|
9267
9277
|
};
|
|
9268
|
-
const handleSearchChange = (
|
|
9269
|
-
const newQuery =
|
|
9278
|
+
const handleSearchChange = (e3) => {
|
|
9279
|
+
const newQuery = e3.target.value;
|
|
9270
9280
|
setQuery(newQuery);
|
|
9271
9281
|
onSearch?.(newQuery);
|
|
9272
9282
|
};
|
|
@@ -9322,7 +9332,7 @@ function MultiSelect({
|
|
|
9322
9332
|
"button",
|
|
9323
9333
|
{
|
|
9324
9334
|
type: "button",
|
|
9325
|
-
onClick: (
|
|
9335
|
+
onClick: (e3) => handleRemove(option.value, e3),
|
|
9326
9336
|
className: "rounded hover:bg-primary-200 dark:hover:bg-primary-600",
|
|
9327
9337
|
"aria-label": `Remove ${option.label}`,
|
|
9328
9338
|
disabled: isDisabled,
|
|
@@ -9399,7 +9409,7 @@ function MultiSelect({
|
|
|
9399
9409
|
"focus:border-gold-500 focus:outline-none focus:ring-1 focus:ring-gold-500",
|
|
9400
9410
|
"dark:border-primary-600"
|
|
9401
9411
|
),
|
|
9402
|
-
onClick: (
|
|
9412
|
+
onClick: (e3) => e3.stopPropagation()
|
|
9403
9413
|
}
|
|
9404
9414
|
)
|
|
9405
9415
|
] }),
|
|
@@ -9480,6 +9490,446 @@ function MultiSelect({
|
|
|
9480
9490
|
] });
|
|
9481
9491
|
}
|
|
9482
9492
|
MultiSelect.displayName = "MultiSelect";
|
|
9493
|
+
function shouldShowItem(item) {
|
|
9494
|
+
if (item.visible === void 0) return true;
|
|
9495
|
+
if (typeof item.visible === "boolean") return item.visible;
|
|
9496
|
+
if (typeof item.visible === "function") return item.visible();
|
|
9497
|
+
return true;
|
|
9498
|
+
}
|
|
9499
|
+
function isItemActive(currentPath, href, matcher = "exact") {
|
|
9500
|
+
if (!currentPath) return false;
|
|
9501
|
+
if (typeof matcher === "function") {
|
|
9502
|
+
return matcher(currentPath, href);
|
|
9503
|
+
}
|
|
9504
|
+
switch (matcher) {
|
|
9505
|
+
case "exact":
|
|
9506
|
+
return currentPath === href;
|
|
9507
|
+
case "startsWith":
|
|
9508
|
+
return currentPath === href || currentPath.startsWith(`${href}/`);
|
|
9509
|
+
default:
|
|
9510
|
+
return false;
|
|
9511
|
+
}
|
|
9512
|
+
}
|
|
9513
|
+
const sizeStyles = {
|
|
9514
|
+
sm: "px-2 py-1.5 text-xs gap-2",
|
|
9515
|
+
md: "px-3 py-2.5 text-sm gap-3",
|
|
9516
|
+
lg: "px-4 py-3 text-base gap-3"
|
|
9517
|
+
};
|
|
9518
|
+
const iconSizeStyles = {
|
|
9519
|
+
sm: "h-4 w-4",
|
|
9520
|
+
md: "h-5 w-5",
|
|
9521
|
+
lg: "h-6 w-6"
|
|
9522
|
+
};
|
|
9523
|
+
const DefaultLink = ({
|
|
9524
|
+
to,
|
|
9525
|
+
children,
|
|
9526
|
+
className,
|
|
9527
|
+
onClick,
|
|
9528
|
+
title,
|
|
9529
|
+
"aria-current": ariaCurrent,
|
|
9530
|
+
"aria-label": ariaLabel
|
|
9531
|
+
}) => /* @__PURE__ */ jsx(
|
|
9532
|
+
"a",
|
|
9533
|
+
{
|
|
9534
|
+
href: to,
|
|
9535
|
+
className,
|
|
9536
|
+
onClick,
|
|
9537
|
+
title,
|
|
9538
|
+
"aria-current": ariaCurrent,
|
|
9539
|
+
"aria-label": ariaLabel,
|
|
9540
|
+
children
|
|
9541
|
+
}
|
|
9542
|
+
);
|
|
9543
|
+
function SidebarItem({
|
|
9544
|
+
item,
|
|
9545
|
+
currentPath,
|
|
9546
|
+
size: size2 = "md",
|
|
9547
|
+
collapsed = false,
|
|
9548
|
+
onNavigate,
|
|
9549
|
+
LinkComponent,
|
|
9550
|
+
className,
|
|
9551
|
+
...props
|
|
9552
|
+
}) {
|
|
9553
|
+
if (!shouldShowItem(item)) {
|
|
9554
|
+
return null;
|
|
9555
|
+
}
|
|
9556
|
+
const isActive = isItemActive(currentPath, item.href, item.activeMatch);
|
|
9557
|
+
const LinkElement = LinkComponent || DefaultLink;
|
|
9558
|
+
const handleClick = () => {
|
|
9559
|
+
if (item.disabled) return;
|
|
9560
|
+
item.onClick?.();
|
|
9561
|
+
onNavigate?.(item.href);
|
|
9562
|
+
};
|
|
9563
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9564
|
+
item.icon && /* @__PURE__ */ jsx(
|
|
9565
|
+
"span",
|
|
9566
|
+
{
|
|
9567
|
+
className: cn(
|
|
9568
|
+
"flex-shrink-0",
|
|
9569
|
+
iconSizeStyles[size2],
|
|
9570
|
+
"[&>svg]:h-full [&>svg]:w-full"
|
|
9571
|
+
),
|
|
9572
|
+
"aria-hidden": "true",
|
|
9573
|
+
children: item.icon
|
|
9574
|
+
}
|
|
9575
|
+
),
|
|
9576
|
+
!collapsed && /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: item.label }),
|
|
9577
|
+
!collapsed && item.badge !== void 0 && /* @__PURE__ */ jsx(
|
|
9578
|
+
"span",
|
|
9579
|
+
{
|
|
9580
|
+
className: cn(
|
|
9581
|
+
"flex-shrink-0 rounded-full px-2 py-0.5 text-xs font-medium",
|
|
9582
|
+
isActive ? "bg-primary-200 text-primary-800 dark:bg-primary-700 dark:text-primary-200" : "bg-primary-100 text-primary-600 dark:bg-primary-800 dark:text-primary-300"
|
|
9583
|
+
),
|
|
9584
|
+
children: item.badge
|
|
9585
|
+
}
|
|
9586
|
+
)
|
|
9587
|
+
] });
|
|
9588
|
+
if (item.onClick && !item.href) {
|
|
9589
|
+
return /* @__PURE__ */ jsx(
|
|
9590
|
+
"button",
|
|
9591
|
+
{
|
|
9592
|
+
type: "button",
|
|
9593
|
+
onClick: handleClick,
|
|
9594
|
+
disabled: item.disabled,
|
|
9595
|
+
"aria-label": item["aria-label"] || item.label,
|
|
9596
|
+
title: collapsed ? item.label : void 0,
|
|
9597
|
+
className: cn(
|
|
9598
|
+
// Base styles
|
|
9599
|
+
"flex w-full items-center rounded-lg font-medium",
|
|
9600
|
+
"transition-colors duration-150",
|
|
9601
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9602
|
+
"dark:focus:ring-offset-primary-900",
|
|
9603
|
+
// Size styles
|
|
9604
|
+
sizeStyles[size2],
|
|
9605
|
+
// State styles
|
|
9606
|
+
item.disabled && "opacity-50 cursor-not-allowed",
|
|
9607
|
+
!item.disabled && !isActive && [
|
|
9608
|
+
"text-primary-600 hover:bg-primary-50 hover:text-primary-900",
|
|
9609
|
+
"dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-100"
|
|
9610
|
+
],
|
|
9611
|
+
isActive && [
|
|
9612
|
+
"bg-primary-100 text-primary-900",
|
|
9613
|
+
"dark:bg-primary-800 dark:text-primary-100"
|
|
9614
|
+
],
|
|
9615
|
+
// Collapsed mode
|
|
9616
|
+
collapsed && "justify-center",
|
|
9617
|
+
className
|
|
9618
|
+
),
|
|
9619
|
+
...props,
|
|
9620
|
+
children: content
|
|
9621
|
+
}
|
|
9622
|
+
);
|
|
9623
|
+
}
|
|
9624
|
+
return /* @__PURE__ */ jsx(
|
|
9625
|
+
LinkElement,
|
|
9626
|
+
{
|
|
9627
|
+
to: item.href,
|
|
9628
|
+
onClick: handleClick,
|
|
9629
|
+
className: cn(
|
|
9630
|
+
// Base styles
|
|
9631
|
+
"flex items-center rounded-lg font-medium",
|
|
9632
|
+
"transition-colors duration-150",
|
|
9633
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9634
|
+
"dark:focus:ring-offset-primary-900",
|
|
9635
|
+
// Size styles
|
|
9636
|
+
sizeStyles[size2],
|
|
9637
|
+
// State styles
|
|
9638
|
+
item.disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
9639
|
+
!item.disabled && !isActive && [
|
|
9640
|
+
"text-primary-600 hover:bg-primary-50 hover:text-primary-900",
|
|
9641
|
+
"dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-100"
|
|
9642
|
+
],
|
|
9643
|
+
isActive && [
|
|
9644
|
+
"bg-primary-100 text-primary-900",
|
|
9645
|
+
"dark:bg-primary-800 dark:text-primary-100"
|
|
9646
|
+
],
|
|
9647
|
+
// Collapsed mode
|
|
9648
|
+
collapsed && "justify-center",
|
|
9649
|
+
className
|
|
9650
|
+
),
|
|
9651
|
+
"aria-current": isActive ? "page" : void 0,
|
|
9652
|
+
"aria-label": item["aria-label"] || (collapsed ? item.label : void 0),
|
|
9653
|
+
title: collapsed ? item.label : void 0,
|
|
9654
|
+
children: content
|
|
9655
|
+
}
|
|
9656
|
+
);
|
|
9657
|
+
}
|
|
9658
|
+
function shouldShowGroup(group) {
|
|
9659
|
+
if (group.visible === void 0) return true;
|
|
9660
|
+
if (typeof group.visible === "boolean") return group.visible;
|
|
9661
|
+
if (typeof group.visible === "function") return group.visible();
|
|
9662
|
+
return true;
|
|
9663
|
+
}
|
|
9664
|
+
const SidebarGroup = forwardRef(
|
|
9665
|
+
({
|
|
9666
|
+
group,
|
|
9667
|
+
currentPath,
|
|
9668
|
+
size: size2 = "md",
|
|
9669
|
+
collapsed = false,
|
|
9670
|
+
LinkComponent,
|
|
9671
|
+
onNavigate,
|
|
9672
|
+
className,
|
|
9673
|
+
...props
|
|
9674
|
+
}, ref) => {
|
|
9675
|
+
if (!shouldShowGroup(group)) {
|
|
9676
|
+
return null;
|
|
9677
|
+
}
|
|
9678
|
+
const visibleItems = group.items.filter(shouldShowItem);
|
|
9679
|
+
if (visibleItems.length === 0) {
|
|
9680
|
+
return null;
|
|
9681
|
+
}
|
|
9682
|
+
return /* @__PURE__ */ jsxs("div", { ref, role: "group", className: cn("space-y-1", className), ...props, children: [
|
|
9683
|
+
group.label && !collapsed && /* @__PURE__ */ jsx(
|
|
9684
|
+
"h3",
|
|
9685
|
+
{
|
|
9686
|
+
className: cn(
|
|
9687
|
+
"px-3 py-2 text-xs font-semibold uppercase tracking-wider",
|
|
9688
|
+
"text-primary-500 dark:text-primary-400"
|
|
9689
|
+
),
|
|
9690
|
+
children: group.label
|
|
9691
|
+
}
|
|
9692
|
+
),
|
|
9693
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": group.label || `Navigation group ${group.key}`, children: /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: visibleItems.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
9694
|
+
SidebarItem,
|
|
9695
|
+
{
|
|
9696
|
+
item,
|
|
9697
|
+
currentPath,
|
|
9698
|
+
size: size2,
|
|
9699
|
+
collapsed,
|
|
9700
|
+
LinkComponent,
|
|
9701
|
+
onNavigate
|
|
9702
|
+
}
|
|
9703
|
+
) }, item.key)) }) })
|
|
9704
|
+
] });
|
|
9705
|
+
}
|
|
9706
|
+
);
|
|
9707
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
9708
|
+
const SidebarDivider = forwardRef(
|
|
9709
|
+
({ label, className, ...props }, ref) => {
|
|
9710
|
+
if (label) {
|
|
9711
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative my-4", className), children: [
|
|
9712
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
9713
|
+
"hr",
|
|
9714
|
+
{
|
|
9715
|
+
ref,
|
|
9716
|
+
className: "w-full border-t border-primary-200 dark:border-primary-700",
|
|
9717
|
+
...props
|
|
9718
|
+
}
|
|
9719
|
+
) }),
|
|
9720
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex justify-center", children: /* @__PURE__ */ jsx("span", { className: "bg-white px-2 text-xs text-primary-500 dark:bg-primary-900 dark:text-primary-400", children: label }) })
|
|
9721
|
+
] });
|
|
9722
|
+
}
|
|
9723
|
+
return /* @__PURE__ */ jsx(
|
|
9724
|
+
"hr",
|
|
9725
|
+
{
|
|
9726
|
+
ref,
|
|
9727
|
+
className: cn(
|
|
9728
|
+
"my-4 border-t border-primary-200 dark:border-primary-700",
|
|
9729
|
+
className
|
|
9730
|
+
),
|
|
9731
|
+
...props
|
|
9732
|
+
}
|
|
9733
|
+
);
|
|
9734
|
+
}
|
|
9735
|
+
);
|
|
9736
|
+
SidebarDivider.displayName = "SidebarDivider";
|
|
9737
|
+
const variantStyles = {
|
|
9738
|
+
default: [
|
|
9739
|
+
"bg-white border-r border-gold-500/40",
|
|
9740
|
+
"dark:bg-primary-900 dark:border-gold-500/20"
|
|
9741
|
+
].join(" "),
|
|
9742
|
+
minimal: [
|
|
9743
|
+
"bg-white border-r border-primary-200",
|
|
9744
|
+
"dark:bg-primary-900 dark:border-primary-700"
|
|
9745
|
+
].join(" ")
|
|
9746
|
+
};
|
|
9747
|
+
const Sidebar = forwardRef(
|
|
9748
|
+
({
|
|
9749
|
+
navigation,
|
|
9750
|
+
currentPath,
|
|
9751
|
+
isOpen = false,
|
|
9752
|
+
onClose,
|
|
9753
|
+
collapsed = false,
|
|
9754
|
+
onCollapsedChange,
|
|
9755
|
+
variant = "default",
|
|
9756
|
+
size: size2 = "md",
|
|
9757
|
+
header,
|
|
9758
|
+
footer,
|
|
9759
|
+
LinkComponent,
|
|
9760
|
+
onNavigate,
|
|
9761
|
+
showMobileOverlay = true,
|
|
9762
|
+
width = "16rem",
|
|
9763
|
+
collapsedWidth = "4rem",
|
|
9764
|
+
className,
|
|
9765
|
+
"aria-label": ariaLabel = "Main navigation",
|
|
9766
|
+
...props
|
|
9767
|
+
}, ref) => {
|
|
9768
|
+
useEffect(() => {
|
|
9769
|
+
const handleEscape = (event) => {
|
|
9770
|
+
if (event.key === "Escape" && isOpen) {
|
|
9771
|
+
onClose?.();
|
|
9772
|
+
}
|
|
9773
|
+
};
|
|
9774
|
+
document.addEventListener("keydown", handleEscape);
|
|
9775
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
9776
|
+
}, [isOpen, onClose]);
|
|
9777
|
+
useEffect(() => {
|
|
9778
|
+
if (isOpen) {
|
|
9779
|
+
document.body.style.overflow = "hidden";
|
|
9780
|
+
} else {
|
|
9781
|
+
document.body.style.overflow = "";
|
|
9782
|
+
}
|
|
9783
|
+
return () => {
|
|
9784
|
+
document.body.style.overflow = "";
|
|
9785
|
+
};
|
|
9786
|
+
}, [isOpen]);
|
|
9787
|
+
const handleNavigate = useCallback(
|
|
9788
|
+
(href) => {
|
|
9789
|
+
onNavigate?.(href);
|
|
9790
|
+
onClose?.();
|
|
9791
|
+
},
|
|
9792
|
+
[onNavigate, onClose]
|
|
9793
|
+
);
|
|
9794
|
+
const handleOverlayClick = useCallback(() => {
|
|
9795
|
+
onClose?.();
|
|
9796
|
+
}, [onClose]);
|
|
9797
|
+
const handleCollapseToggle = useCallback(() => {
|
|
9798
|
+
onCollapsedChange?.(!collapsed);
|
|
9799
|
+
}, [collapsed, onCollapsedChange]);
|
|
9800
|
+
const hasVisibleGroups = (groups) => groups?.some(shouldShowGroup) ?? false;
|
|
9801
|
+
const hasFeatured = hasVisibleGroups(navigation.featured);
|
|
9802
|
+
const hasPrimary = hasVisibleGroups(navigation.primary);
|
|
9803
|
+
const hasSecondary = hasVisibleGroups(navigation.secondary);
|
|
9804
|
+
const hasBottom = hasVisibleGroups(navigation.bottom);
|
|
9805
|
+
const sidebarWidth = collapsed ? collapsedWidth : width;
|
|
9806
|
+
const sidebarContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9807
|
+
header && /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0", collapsed && "px-2"), children: header }),
|
|
9808
|
+
hasFeatured && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-3", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: navigation.featured?.map((group) => /* @__PURE__ */ jsx(
|
|
9809
|
+
SidebarGroup,
|
|
9810
|
+
{
|
|
9811
|
+
group,
|
|
9812
|
+
currentPath,
|
|
9813
|
+
size: size2,
|
|
9814
|
+
collapsed,
|
|
9815
|
+
LinkComponent,
|
|
9816
|
+
onNavigate: handleNavigate
|
|
9817
|
+
},
|
|
9818
|
+
group.key
|
|
9819
|
+
)) }) }),
|
|
9820
|
+
hasPrimary && /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-3 py-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: navigation.primary?.map((group) => /* @__PURE__ */ jsx(
|
|
9821
|
+
SidebarGroup,
|
|
9822
|
+
{
|
|
9823
|
+
group,
|
|
9824
|
+
currentPath,
|
|
9825
|
+
size: size2,
|
|
9826
|
+
collapsed,
|
|
9827
|
+
LinkComponent,
|
|
9828
|
+
onNavigate: handleNavigate
|
|
9829
|
+
},
|
|
9830
|
+
group.key
|
|
9831
|
+
)) }) }),
|
|
9832
|
+
hasPrimary && hasSecondary && /* @__PURE__ */ jsx("div", { className: "px-3", children: /* @__PURE__ */ jsx(SidebarDivider, {}) }),
|
|
9833
|
+
hasSecondary && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-2", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: navigation.secondary?.map((group) => /* @__PURE__ */ jsx(
|
|
9834
|
+
SidebarGroup,
|
|
9835
|
+
{
|
|
9836
|
+
group,
|
|
9837
|
+
currentPath,
|
|
9838
|
+
size: size2,
|
|
9839
|
+
collapsed,
|
|
9840
|
+
LinkComponent,
|
|
9841
|
+
onNavigate: handleNavigate
|
|
9842
|
+
},
|
|
9843
|
+
group.key
|
|
9844
|
+
)) }) }),
|
|
9845
|
+
!hasPrimary && /* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
9846
|
+
(hasPrimary || hasSecondary) && hasBottom && /* @__PURE__ */ jsx("div", { className: "px-3", children: /* @__PURE__ */ jsx(SidebarDivider, {}) }),
|
|
9847
|
+
hasBottom && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: navigation.bottom?.map((group) => /* @__PURE__ */ jsx(
|
|
9848
|
+
SidebarGroup,
|
|
9849
|
+
{
|
|
9850
|
+
group,
|
|
9851
|
+
currentPath,
|
|
9852
|
+
size: size2,
|
|
9853
|
+
collapsed,
|
|
9854
|
+
LinkComponent,
|
|
9855
|
+
onNavigate: handleNavigate
|
|
9856
|
+
},
|
|
9857
|
+
group.key
|
|
9858
|
+
)) }) }),
|
|
9859
|
+
footer && /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0", collapsed && "px-2"), children: footer }),
|
|
9860
|
+
onCollapsedChange && /* @__PURE__ */ jsx("div", { className: "hidden lg:block flex-shrink-0 border-t border-primary-200 dark:border-primary-700 p-2", children: /* @__PURE__ */ jsx(
|
|
9861
|
+
"button",
|
|
9862
|
+
{
|
|
9863
|
+
type: "button",
|
|
9864
|
+
onClick: handleCollapseToggle,
|
|
9865
|
+
className: cn(
|
|
9866
|
+
"flex w-full items-center justify-center rounded-lg p-2",
|
|
9867
|
+
"text-primary-500 hover:bg-primary-50 hover:text-primary-700",
|
|
9868
|
+
"dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-200",
|
|
9869
|
+
"transition-colors duration-150",
|
|
9870
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500/20"
|
|
9871
|
+
),
|
|
9872
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9873
|
+
children: /* @__PURE__ */ jsx(
|
|
9874
|
+
"svg",
|
|
9875
|
+
{
|
|
9876
|
+
className: cn(
|
|
9877
|
+
"h-5 w-5 transition-transform duration-200",
|
|
9878
|
+
collapsed && "rotate-180"
|
|
9879
|
+
),
|
|
9880
|
+
fill: "none",
|
|
9881
|
+
viewBox: "0 0 24 24",
|
|
9882
|
+
stroke: "currentColor",
|
|
9883
|
+
"aria-hidden": "true",
|
|
9884
|
+
children: /* @__PURE__ */ jsx(
|
|
9885
|
+
"path",
|
|
9886
|
+
{
|
|
9887
|
+
strokeLinecap: "round",
|
|
9888
|
+
strokeLinejoin: "round",
|
|
9889
|
+
strokeWidth: 2,
|
|
9890
|
+
d: "M11 19l-7-7 7-7m8 14l-7-7 7-7"
|
|
9891
|
+
}
|
|
9892
|
+
)
|
|
9893
|
+
}
|
|
9894
|
+
)
|
|
9895
|
+
}
|
|
9896
|
+
) })
|
|
9897
|
+
] });
|
|
9898
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9899
|
+
showMobileOverlay && isOpen && /* @__PURE__ */ jsx(
|
|
9900
|
+
"div",
|
|
9901
|
+
{
|
|
9902
|
+
className: "fixed inset-0 z-40 bg-black/20 lg:hidden",
|
|
9903
|
+
onClick: handleOverlayClick,
|
|
9904
|
+
"aria-hidden": "true"
|
|
9905
|
+
}
|
|
9906
|
+
),
|
|
9907
|
+
/* @__PURE__ */ jsx(
|
|
9908
|
+
"aside",
|
|
9909
|
+
{
|
|
9910
|
+
ref,
|
|
9911
|
+
className: cn(
|
|
9912
|
+
// Base styles
|
|
9913
|
+
"fixed top-0 left-0 z-50 flex h-full flex-col",
|
|
9914
|
+
"transform transition-all duration-300 ease-in-out",
|
|
9915
|
+
// Desktop styles
|
|
9916
|
+
"lg:static lg:z-auto lg:translate-x-0",
|
|
9917
|
+
// Mobile styles
|
|
9918
|
+
isOpen ? "translate-x-0" : "-translate-x-full",
|
|
9919
|
+
// Variant styles
|
|
9920
|
+
variantStyles[variant],
|
|
9921
|
+
className
|
|
9922
|
+
),
|
|
9923
|
+
style: { width: sidebarWidth },
|
|
9924
|
+
"aria-label": ariaLabel,
|
|
9925
|
+
...props,
|
|
9926
|
+
children: sidebarContent
|
|
9927
|
+
}
|
|
9928
|
+
)
|
|
9929
|
+
] });
|
|
9930
|
+
}
|
|
9931
|
+
);
|
|
9932
|
+
Sidebar.displayName = "Sidebar";
|
|
9483
9933
|
export {
|
|
9484
9934
|
Badge,
|
|
9485
9935
|
Breadcrumbs,
|
|
@@ -9498,6 +9948,10 @@ export {
|
|
|
9498
9948
|
Radio,
|
|
9499
9949
|
RadioGroup,
|
|
9500
9950
|
Select,
|
|
9951
|
+
Sidebar,
|
|
9952
|
+
SidebarDivider,
|
|
9953
|
+
SidebarGroup,
|
|
9954
|
+
SidebarItem,
|
|
9501
9955
|
Skeleton,
|
|
9502
9956
|
Spinner,
|
|
9503
9957
|
TabContentPanels,
|
|
@@ -9515,6 +9969,7 @@ export {
|
|
|
9515
9969
|
a as useDebouncedCallback,
|
|
9516
9970
|
b as useDebouncedCallbackWithControl,
|
|
9517
9971
|
c as useSelection,
|
|
9518
|
-
d as
|
|
9972
|
+
d as useSidebar,
|
|
9973
|
+
e as useTable
|
|
9519
9974
|
};
|
|
9520
9975
|
//# sourceMappingURL=index.js.map
|