gitxp 0.0.1
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/.output/nitro.json +17 -0
- package/.output/public/assets/index-BGHvBNtP.js +11 -0
- package/.output/public/assets/routes-DuE8S6pX.js +60 -0
- package/.output/public/assets/styles-D5xbQNYu.css +1 -0
- package/.output/server/_chunks/ssr-renderer.mjs +26 -0
- package/.output/server/_libs/@floating-ui/core+[...].mjs +671 -0
- package/.output/server/_libs/@floating-ui/dom+[...].mjs +649 -0
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +856 -0
- package/.output/server/_libs/@radix-ui/react-arrow+[...].mjs +258 -0
- package/.output/server/_libs/@radix-ui/react-dialog+[...].mjs +1862 -0
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +320 -0
- package/.output/server/_libs/@radix-ui/react-tooltip+[...].mjs +534 -0
- package/.output/server/_libs/@tanstack/db+[...].mjs +14680 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +14563 -0
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +126 -0
- package/.output/server/_libs/@tanstack/router-core+[...].mjs +3636 -0
- package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
- package/.output/server/_libs/cmdk.mjs +504 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +1361 -0
- package/.output/server/_libs/h3-v2.mjs +285 -0
- package/.output/server/_libs/lucide-react.mjs +158 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +44 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +108 -0
- package/.output/server/_libs/tailwind-merge.mjs +3380 -0
- package/.output/server/_libs/tanstack__history.mjs +384 -0
- package/.output/server/_libs/tanstack__query-core.mjs +2225 -0
- package/.output/server/_libs/tanstack__react-db.mjs +242 -0
- package/.output/server/_libs/tanstack__react-query.mjs +140 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_runtime.mjs +35 -0
- package/.output/server/_ssr/empty-plugin-adapters-D9UWiqvJ.mjs +5 -0
- package/.output/server/_ssr/events-BNrmOvgU.mjs +13 -0
- package/.output/server/_ssr/notifications-DUoENv6E.mjs +514 -0
- package/.output/server/_ssr/router-DsUHD4bT.mjs +179 -0
- package/.output/server/_ssr/routes-DIFfr242.mjs +982 -0
- package/.output/server/_ssr/ssr.mjs +1854 -0
- package/.output/server/_ssr/start-5Z2QO8AU.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-CrD0YpZr.mjs +20 -0
- package/.output/server/index.mjs +310 -0
- package/.output/server/node_modules/tslib/modules/index.js +70 -0
- package/.output/server/node_modules/tslib/modules/package.json +3 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +9 -0
- package/LICENSE +21 -0
- package/README.md +325 -0
- package/bin/gitxp.js +85 -0
- package/package.json +92 -0
|
@@ -0,0 +1,1862 @@
|
|
|
1
|
+
import { i as __toESM } from "../../_runtime.mjs";
|
|
2
|
+
import { l as require_react_dom, u as require_react } from "../@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { a as createSlot, c as useComposedRefs, l as require_jsx_runtime, n as Primitive, r as dispatchDiscreteCustomEvent } from "./react-arrow+[...].mjs";
|
|
4
|
+
import { t as createContextScope } from "../radix-ui__react-context.mjs";
|
|
5
|
+
import { t as composeEventHandlers } from "../radix-ui__primitive.mjs";
|
|
6
|
+
import { __assign, __rest, __spreadArray } from "tslib";
|
|
7
|
+
//#region node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
8
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
9
|
+
var useLayoutEffect2 = globalThis?.document ? import_react.useLayoutEffect : () => {};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
12
|
+
var __defProp$9 = Object.defineProperty;
|
|
13
|
+
var __name$9 = (target, value) => __defProp$9(target, "name", {
|
|
14
|
+
value,
|
|
15
|
+
configurable: true
|
|
16
|
+
});
|
|
17
|
+
var useReactEffectEvent = import_react[" useEffectEvent ".trim().toString()];
|
|
18
|
+
var useReactInsertionEffect = import_react[" useInsertionEffect ".trim().toString()];
|
|
19
|
+
function useEffectEvent(callback) {
|
|
20
|
+
if (typeof useReactEffectEvent === "function") return useReactEffectEvent(callback);
|
|
21
|
+
const ref = import_react.useRef(() => {
|
|
22
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
23
|
+
});
|
|
24
|
+
if (typeof useReactInsertionEffect === "function") useReactInsertionEffect(() => {
|
|
25
|
+
ref.current = callback;
|
|
26
|
+
});
|
|
27
|
+
else useLayoutEffect2(() => {
|
|
28
|
+
ref.current = callback;
|
|
29
|
+
});
|
|
30
|
+
return import_react.useMemo(() => ((...args) => ref.current?.(...args)), []);
|
|
31
|
+
}
|
|
32
|
+
__name$9(useEffectEvent, "useEffectEvent");
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
35
|
+
var __defProp$8 = Object.defineProperty;
|
|
36
|
+
var __name$8 = (target, value) => __defProp$8(target, "name", {
|
|
37
|
+
value,
|
|
38
|
+
configurable: true
|
|
39
|
+
});
|
|
40
|
+
var useInsertionEffect = import_react[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
41
|
+
function useControllableState({ prop, defaultProp, onChange = /* @__PURE__ */ __name$8(() => {}, "onChange"), caller }) {
|
|
42
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
43
|
+
defaultProp,
|
|
44
|
+
onChange
|
|
45
|
+
});
|
|
46
|
+
const isControlled = prop !== void 0;
|
|
47
|
+
return [isControlled ? prop : uncontrolledProp, import_react.useCallback((nextValue) => {
|
|
48
|
+
if (isControlled) {
|
|
49
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
50
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
51
|
+
} else setUncontrolledProp(nextValue);
|
|
52
|
+
}, [
|
|
53
|
+
isControlled,
|
|
54
|
+
prop,
|
|
55
|
+
setUncontrolledProp,
|
|
56
|
+
onChangeRef
|
|
57
|
+
])];
|
|
58
|
+
}
|
|
59
|
+
__name$8(useControllableState, "useControllableState");
|
|
60
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
61
|
+
const [value, setValue] = import_react.useState(defaultProp);
|
|
62
|
+
const prevValueRef = import_react.useRef(value);
|
|
63
|
+
const onChangeRef = import_react.useRef(onChange);
|
|
64
|
+
useInsertionEffect(() => {
|
|
65
|
+
onChangeRef.current = onChange;
|
|
66
|
+
}, [onChange]);
|
|
67
|
+
import_react.useEffect(() => {
|
|
68
|
+
if (prevValueRef.current !== value) {
|
|
69
|
+
onChangeRef.current?.(value);
|
|
70
|
+
prevValueRef.current = value;
|
|
71
|
+
}
|
|
72
|
+
}, [value, prevValueRef]);
|
|
73
|
+
return [
|
|
74
|
+
value,
|
|
75
|
+
setValue,
|
|
76
|
+
onChangeRef
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
__name$8(useUncontrolledState, "useUncontrolledState");
|
|
80
|
+
function isFunction(value) {
|
|
81
|
+
return typeof value === "function";
|
|
82
|
+
}
|
|
83
|
+
__name$8(isFunction, "isFunction");
|
|
84
|
+
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
85
|
+
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
86
|
+
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
|
87
|
+
const isControlled = controlledState !== void 0;
|
|
88
|
+
const onChange = useEffectEvent(onChangeProp);
|
|
89
|
+
const args = [{
|
|
90
|
+
...initialArg,
|
|
91
|
+
state: defaultProp
|
|
92
|
+
}];
|
|
93
|
+
if (init) args.push(init);
|
|
94
|
+
const [internalState, dispatch] = import_react.useReducer((state2, action) => {
|
|
95
|
+
if (action.type === SYNC_STATE) return {
|
|
96
|
+
...state2,
|
|
97
|
+
state: action.state
|
|
98
|
+
};
|
|
99
|
+
const next = reducer(state2, action);
|
|
100
|
+
if (isControlled && !Object.is(next.state, state2.state)) onChange(next.state);
|
|
101
|
+
return next;
|
|
102
|
+
}, ...args);
|
|
103
|
+
const uncontrolledState = internalState.state;
|
|
104
|
+
const prevValueRef = import_react.useRef(uncontrolledState);
|
|
105
|
+
import_react.useEffect(() => {
|
|
106
|
+
if (prevValueRef.current !== uncontrolledState) {
|
|
107
|
+
prevValueRef.current = uncontrolledState;
|
|
108
|
+
if (!isControlled) onChange(uncontrolledState);
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
uncontrolledState,
|
|
112
|
+
prevValueRef,
|
|
113
|
+
isControlled
|
|
114
|
+
]);
|
|
115
|
+
const state = import_react.useMemo(() => {
|
|
116
|
+
if (controlledState !== void 0) return {
|
|
117
|
+
...internalState,
|
|
118
|
+
state: controlledState
|
|
119
|
+
};
|
|
120
|
+
return internalState;
|
|
121
|
+
}, [internalState, controlledState]);
|
|
122
|
+
import_react.useEffect(() => {
|
|
123
|
+
if (isControlled && !Object.is(controlledState, internalState.state)) dispatch({
|
|
124
|
+
type: SYNC_STATE,
|
|
125
|
+
state: controlledState
|
|
126
|
+
});
|
|
127
|
+
}, [
|
|
128
|
+
controlledState,
|
|
129
|
+
internalState.state,
|
|
130
|
+
isControlled
|
|
131
|
+
]);
|
|
132
|
+
return [state, dispatch];
|
|
133
|
+
}
|
|
134
|
+
__name$8(useControllableStateReducer, "useControllableStateReducer");
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
137
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
138
|
+
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
|
139
|
+
var __defProp$7 = Object.defineProperty;
|
|
140
|
+
var __name$7 = (target, value) => __defProp$7(target, "name", {
|
|
141
|
+
value,
|
|
142
|
+
configurable: true
|
|
143
|
+
});
|
|
144
|
+
function useStateMachine(initialState, machine) {
|
|
145
|
+
return import_react.useReducer((state, event) => {
|
|
146
|
+
return machine[state][event] ?? state;
|
|
147
|
+
}, initialState);
|
|
148
|
+
}
|
|
149
|
+
__name$7(useStateMachine, "useStateMachine");
|
|
150
|
+
var Presence = /* @__PURE__ */ __name$7((props) => {
|
|
151
|
+
const { present, children } = props;
|
|
152
|
+
const presence = usePresence(present);
|
|
153
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : import_react.Children.only(children);
|
|
154
|
+
const ref = useStableComposedRefs(presence.ref, getElementRef(child));
|
|
155
|
+
return typeof children === "function" || presence.isPresent ? import_react.cloneElement(child, { ref }) : null;
|
|
156
|
+
}, "Presence");
|
|
157
|
+
function usePresence(present) {
|
|
158
|
+
const [node, setNode] = import_react.useState();
|
|
159
|
+
const stylesRef = import_react.useRef(null);
|
|
160
|
+
const prevPresentRef = import_react.useRef(present);
|
|
161
|
+
const prevAnimationNameRef = import_react.useRef("none");
|
|
162
|
+
const mountAnimationNameRef = import_react.useRef(void 0);
|
|
163
|
+
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
164
|
+
mounted: {
|
|
165
|
+
UNMOUNT: "unmounted",
|
|
166
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
167
|
+
},
|
|
168
|
+
unmountSuspended: {
|
|
169
|
+
MOUNT: "mounted",
|
|
170
|
+
ANIMATION_END: "unmounted"
|
|
171
|
+
},
|
|
172
|
+
unmounted: { MOUNT: "mounted" }
|
|
173
|
+
});
|
|
174
|
+
import_react.useEffect(() => {
|
|
175
|
+
if (state === "mounted") {
|
|
176
|
+
prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);
|
|
177
|
+
mountAnimationNameRef.current = void 0;
|
|
178
|
+
} else prevAnimationNameRef.current = "none";
|
|
179
|
+
}, [state]);
|
|
180
|
+
useLayoutEffect2(() => {
|
|
181
|
+
const styles = stylesRef.current;
|
|
182
|
+
const wasPresent = prevPresentRef.current;
|
|
183
|
+
if (wasPresent !== present) {
|
|
184
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
185
|
+
const currentAnimationName = getAnimationName(styles);
|
|
186
|
+
if (present) {
|
|
187
|
+
mountAnimationNameRef.current = currentAnimationName;
|
|
188
|
+
send("MOUNT");
|
|
189
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") send("UNMOUNT");
|
|
190
|
+
else if (wasPresent && prevAnimationName !== currentAnimationName) send("ANIMATION_OUT");
|
|
191
|
+
else send("UNMOUNT");
|
|
192
|
+
prevPresentRef.current = present;
|
|
193
|
+
}
|
|
194
|
+
}, [present, send]);
|
|
195
|
+
useLayoutEffect2(() => {
|
|
196
|
+
if (node) {
|
|
197
|
+
let timeoutId;
|
|
198
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
199
|
+
const handleAnimationEnd = /* @__PURE__ */ __name$7((event) => {
|
|
200
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
201
|
+
if (event.target === node && isCurrentAnimation) {
|
|
202
|
+
send("ANIMATION_END");
|
|
203
|
+
if (!prevPresentRef.current) {
|
|
204
|
+
const currentFillMode = node.style.animationFillMode;
|
|
205
|
+
node.style.animationFillMode = "forwards";
|
|
206
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
207
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}, "handleAnimationEnd");
|
|
212
|
+
const handleAnimationStart = /* @__PURE__ */ __name$7((event) => {
|
|
213
|
+
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
214
|
+
}, "handleAnimationStart");
|
|
215
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
216
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
217
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
218
|
+
return () => {
|
|
219
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
220
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
221
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
222
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
223
|
+
};
|
|
224
|
+
} else send("ANIMATION_END");
|
|
225
|
+
}, [node, send]);
|
|
226
|
+
return {
|
|
227
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
228
|
+
ref: import_react.useCallback((node2) => {
|
|
229
|
+
if (node2) {
|
|
230
|
+
const styles = getComputedStyle(node2);
|
|
231
|
+
stylesRef.current = styles;
|
|
232
|
+
mountAnimationNameRef.current = getAnimationName(styles);
|
|
233
|
+
} else stylesRef.current = null;
|
|
234
|
+
setNode(node2);
|
|
235
|
+
}, [])
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
__name$7(usePresence, "usePresence");
|
|
239
|
+
function setRef(ref, value) {
|
|
240
|
+
if (typeof ref === "function") return ref(value);
|
|
241
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
242
|
+
}
|
|
243
|
+
__name$7(setRef, "setRef");
|
|
244
|
+
function useStableComposedRefs(...refs) {
|
|
245
|
+
const refsRef = import_react.useRef(refs);
|
|
246
|
+
refsRef.current = refs;
|
|
247
|
+
return import_react.useCallback((node) => {
|
|
248
|
+
const currentRefs = refsRef.current;
|
|
249
|
+
let hasCleanup = false;
|
|
250
|
+
const cleanups = currentRefs.map((ref) => {
|
|
251
|
+
const cleanup = setRef(ref, node);
|
|
252
|
+
if (!hasCleanup && typeof cleanup === "function") hasCleanup = true;
|
|
253
|
+
return cleanup;
|
|
254
|
+
});
|
|
255
|
+
if (hasCleanup) return () => {
|
|
256
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
257
|
+
const cleanup = cleanups[i];
|
|
258
|
+
if (typeof cleanup === "function") cleanup();
|
|
259
|
+
else setRef(currentRefs[i], null);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}, []);
|
|
263
|
+
}
|
|
264
|
+
__name$7(useStableComposedRefs, "useStableComposedRefs");
|
|
265
|
+
function getAnimationName(styles) {
|
|
266
|
+
return styles?.animationName || "none";
|
|
267
|
+
}
|
|
268
|
+
__name$7(getAnimationName, "getAnimationName");
|
|
269
|
+
function getElementRef(element) {
|
|
270
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
271
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
272
|
+
if (mayWarn) return element.ref;
|
|
273
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
274
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
275
|
+
if (mayWarn) return element.props.ref;
|
|
276
|
+
return element.props.ref || element.ref;
|
|
277
|
+
}
|
|
278
|
+
__name$7(getElementRef, "getElementRef");
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region node_modules/@radix-ui/react-id/dist/index.mjs
|
|
281
|
+
var __defProp$6 = Object.defineProperty;
|
|
282
|
+
var __name$6 = (target, value) => __defProp$6(target, "name", {
|
|
283
|
+
value,
|
|
284
|
+
configurable: true
|
|
285
|
+
});
|
|
286
|
+
var useReactId = import_react[" useId ".trim().toString()] || (() => void 0);
|
|
287
|
+
var count$1 = 0;
|
|
288
|
+
function useId(deterministicId) {
|
|
289
|
+
const [id, setId] = import_react.useState(useReactId());
|
|
290
|
+
useLayoutEffect2(() => {
|
|
291
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$1++));
|
|
292
|
+
}, [deterministicId]);
|
|
293
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
294
|
+
}
|
|
295
|
+
__name$6(useId, "useId");
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
298
|
+
var __defProp$5 = Object.defineProperty;
|
|
299
|
+
var __name$5 = (target, value) => __defProp$5(target, "name", {
|
|
300
|
+
value,
|
|
301
|
+
configurable: true
|
|
302
|
+
});
|
|
303
|
+
function useCallbackRef$1(callback) {
|
|
304
|
+
const callbackRef = import_react.useRef(callback);
|
|
305
|
+
import_react.useEffect(() => {
|
|
306
|
+
callbackRef.current = callback;
|
|
307
|
+
});
|
|
308
|
+
return import_react.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
|
|
309
|
+
}
|
|
310
|
+
__name$5(useCallbackRef$1, "useCallbackRef");
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
313
|
+
var __defProp$4 = Object.defineProperty;
|
|
314
|
+
var __name$4 = (target, value) => __defProp$4(target, "name", {
|
|
315
|
+
value,
|
|
316
|
+
configurable: true
|
|
317
|
+
});
|
|
318
|
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
319
|
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
320
|
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
321
|
+
var originalBodyPointerEvents;
|
|
322
|
+
var DismissableLayerContext = import_react.createContext({
|
|
323
|
+
layers: /* @__PURE__ */ new Set(),
|
|
324
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
325
|
+
branches: /* @__PURE__ */ new Set(),
|
|
326
|
+
dismissableSurfaces: /* @__PURE__ */ new Set()
|
|
327
|
+
});
|
|
328
|
+
var DismissableLayer = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name$4(function DismissableLayer2(props, forwardedRef) {
|
|
329
|
+
const { disableOutsidePointerEvents = false, deferPointerDownOutside = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
330
|
+
const context = import_react.useContext(DismissableLayerContext);
|
|
331
|
+
const [node, setNode] = import_react.useState(null);
|
|
332
|
+
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
333
|
+
const [, force] = import_react.useState({});
|
|
334
|
+
const composedRefs = useComposedRefs(forwardedRef, setNode);
|
|
335
|
+
const layers = Array.from(context.layers);
|
|
336
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
337
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;
|
|
338
|
+
const index = node ? layers.indexOf(node) : -1;
|
|
339
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
340
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
341
|
+
const isDeferredPointerDownOutsideRef = import_react.useRef(false);
|
|
342
|
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
343
|
+
onPointerDownOutside?.(event);
|
|
344
|
+
onInteractOutside?.(event);
|
|
345
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
346
|
+
}, {
|
|
347
|
+
ownerDocument,
|
|
348
|
+
deferPointerDownOutside,
|
|
349
|
+
isDeferredPointerDownOutsideRef,
|
|
350
|
+
dismissableSurfaces: context.dismissableSurfaces,
|
|
351
|
+
shouldHandlePointerDownOutside: import_react.useCallback((target) => {
|
|
352
|
+
if (!(target instanceof Node)) return false;
|
|
353
|
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
354
|
+
return isPointerEventsEnabled && !isPointerDownOnBranch;
|
|
355
|
+
}, [context.branches, isPointerEventsEnabled])
|
|
356
|
+
});
|
|
357
|
+
const focusOutside = useFocusOutside((event) => {
|
|
358
|
+
if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) return;
|
|
359
|
+
const target = event.target;
|
|
360
|
+
if ([...context.branches].some((branch) => branch.contains(target))) return;
|
|
361
|
+
onFocusOutside?.(event);
|
|
362
|
+
onInteractOutside?.(event);
|
|
363
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
364
|
+
}, ownerDocument);
|
|
365
|
+
const isHighestLayer = node ? index === layers.length - 1 : false;
|
|
366
|
+
const handleKeyDown = useCallbackRef$1((event) => {
|
|
367
|
+
if (event.key !== "Escape") return;
|
|
368
|
+
onEscapeKeyDown?.(event);
|
|
369
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
370
|
+
event.preventDefault();
|
|
371
|
+
onDismiss();
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
import_react.useEffect(() => {
|
|
375
|
+
if (!isHighestLayer) return;
|
|
376
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
377
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
378
|
+
}, [
|
|
379
|
+
ownerDocument,
|
|
380
|
+
isHighestLayer,
|
|
381
|
+
handleKeyDown
|
|
382
|
+
]);
|
|
383
|
+
import_react.useEffect(() => {
|
|
384
|
+
if (!node) return;
|
|
385
|
+
if (disableOutsidePointerEvents) {
|
|
386
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
387
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
388
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
389
|
+
}
|
|
390
|
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
391
|
+
}
|
|
392
|
+
context.layers.add(node);
|
|
393
|
+
dispatchUpdate();
|
|
394
|
+
return () => {
|
|
395
|
+
if (disableOutsidePointerEvents) {
|
|
396
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
397
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
}, [
|
|
401
|
+
node,
|
|
402
|
+
ownerDocument,
|
|
403
|
+
disableOutsidePointerEvents,
|
|
404
|
+
context
|
|
405
|
+
]);
|
|
406
|
+
import_react.useEffect(() => {
|
|
407
|
+
return () => {
|
|
408
|
+
if (!node) return;
|
|
409
|
+
context.layers.delete(node);
|
|
410
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
411
|
+
dispatchUpdate();
|
|
412
|
+
};
|
|
413
|
+
}, [node, context]);
|
|
414
|
+
import_react.useEffect(() => {
|
|
415
|
+
const handleUpdate = /* @__PURE__ */ __name$4(() => force({}), "handleUpdate");
|
|
416
|
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
417
|
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
418
|
+
}, []);
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
420
|
+
...layerProps,
|
|
421
|
+
ref: composedRefs,
|
|
422
|
+
style: {
|
|
423
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
424
|
+
...props.style
|
|
425
|
+
},
|
|
426
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
427
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
428
|
+
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
429
|
+
});
|
|
430
|
+
}, "DismissableLayer"));
|
|
431
|
+
function useDismissableLayerSurface() {
|
|
432
|
+
const context = import_react.useContext(DismissableLayerContext);
|
|
433
|
+
const [node, setNode] = import_react.useState(null);
|
|
434
|
+
import_react.useEffect(() => {
|
|
435
|
+
if (!node) return;
|
|
436
|
+
context.dismissableSurfaces.add(node);
|
|
437
|
+
return () => {
|
|
438
|
+
context.dismissableSurfaces.delete(node);
|
|
439
|
+
};
|
|
440
|
+
}, [node, context.dismissableSurfaces]);
|
|
441
|
+
return setNode;
|
|
442
|
+
}
|
|
443
|
+
__name$4(useDismissableLayerSurface, "useDismissableLayerSurface");
|
|
444
|
+
var IS_TRUE = /* @__PURE__ */ __name$4(() => true, "IS_TRUE");
|
|
445
|
+
function usePointerDownOutside(onPointerDownOutside, args) {
|
|
446
|
+
const { ownerDocument = globalThis?.document, deferPointerDownOutside = false, isDeferredPointerDownOutsideRef, dismissableSurfaces, shouldHandlePointerDownOutside = IS_TRUE } = args;
|
|
447
|
+
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
448
|
+
const isPointerInsideReactTreeRef = import_react.useRef(false);
|
|
449
|
+
const isPointerDownOutsideRef = import_react.useRef(false);
|
|
450
|
+
const interceptedOutsideInteractionEventsRef = import_react.useRef(/* @__PURE__ */ new Map());
|
|
451
|
+
const handleClickRef = import_react.useRef(() => {});
|
|
452
|
+
import_react.useEffect(() => {
|
|
453
|
+
function resetOutsideInteraction() {
|
|
454
|
+
isPointerDownOutsideRef.current = false;
|
|
455
|
+
isDeferredPointerDownOutsideRef.current = false;
|
|
456
|
+
interceptedOutsideInteractionEventsRef.current.clear();
|
|
457
|
+
}
|
|
458
|
+
__name$4(resetOutsideInteraction, "resetOutsideInteraction");
|
|
459
|
+
function isOutsideInteractionIntercepted() {
|
|
460
|
+
return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
|
|
461
|
+
}
|
|
462
|
+
__name$4(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
|
|
463
|
+
function handleInteractionCapture(event) {
|
|
464
|
+
if (!isPointerDownOutsideRef.current) return;
|
|
465
|
+
const target = event.target;
|
|
466
|
+
if (!(target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target)))) interceptedOutsideInteractionEventsRef.current.set(event.type, true);
|
|
467
|
+
if (event.type === "click") window.setTimeout(() => {
|
|
468
|
+
if (isPointerDownOutsideRef.current) handleClickRef.current();
|
|
469
|
+
}, 0);
|
|
470
|
+
}
|
|
471
|
+
__name$4(handleInteractionCapture, "handleInteractionCapture");
|
|
472
|
+
function handleInteractionBubble(event) {
|
|
473
|
+
if (isPointerDownOutsideRef.current) interceptedOutsideInteractionEventsRef.current.set(event.type, false);
|
|
474
|
+
}
|
|
475
|
+
__name$4(handleInteractionBubble, "handleInteractionBubble");
|
|
476
|
+
const handlePointerDown = /* @__PURE__ */ __name$4((event) => {
|
|
477
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
478
|
+
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
479
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
480
|
+
const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();
|
|
481
|
+
resetOutsideInteraction();
|
|
482
|
+
if (!wasOutsideInteractionIntercepted) handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true });
|
|
483
|
+
};
|
|
484
|
+
__name$4(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent");
|
|
485
|
+
if (!shouldHandlePointerDownOutside(event.target)) {
|
|
486
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
487
|
+
resetOutsideInteraction();
|
|
488
|
+
isPointerInsideReactTreeRef.current = false;
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const eventDetail = { originalEvent: event };
|
|
492
|
+
isPointerDownOutsideRef.current = true;
|
|
493
|
+
isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;
|
|
494
|
+
interceptedOutsideInteractionEventsRef.current.clear();
|
|
495
|
+
if (!deferPointerDownOutside || event.button !== 0) handleAndDispatchPointerDownOutsideEvent2();
|
|
496
|
+
else {
|
|
497
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
498
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
499
|
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
500
|
+
}
|
|
501
|
+
} else {
|
|
502
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
503
|
+
resetOutsideInteraction();
|
|
504
|
+
}
|
|
505
|
+
isPointerInsideReactTreeRef.current = false;
|
|
506
|
+
}, "handlePointerDown");
|
|
507
|
+
const outsideInteractionEvents = [
|
|
508
|
+
"pointerup",
|
|
509
|
+
"mousedown",
|
|
510
|
+
"mouseup",
|
|
511
|
+
"touchstart",
|
|
512
|
+
"touchend",
|
|
513
|
+
"click"
|
|
514
|
+
];
|
|
515
|
+
for (const eventName of outsideInteractionEvents) {
|
|
516
|
+
ownerDocument.addEventListener(eventName, handleInteractionCapture, true);
|
|
517
|
+
ownerDocument.addEventListener(eventName, handleInteractionBubble);
|
|
518
|
+
}
|
|
519
|
+
const timerId = window.setTimeout(() => {
|
|
520
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
521
|
+
}, 0);
|
|
522
|
+
return () => {
|
|
523
|
+
window.clearTimeout(timerId);
|
|
524
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
525
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
526
|
+
for (const eventName of outsideInteractionEvents) {
|
|
527
|
+
ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);
|
|
528
|
+
ownerDocument.removeEventListener(eventName, handleInteractionBubble);
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
}, [
|
|
532
|
+
ownerDocument,
|
|
533
|
+
handlePointerDownOutside,
|
|
534
|
+
deferPointerDownOutside,
|
|
535
|
+
isDeferredPointerDownOutsideRef,
|
|
536
|
+
dismissableSurfaces,
|
|
537
|
+
shouldHandlePointerDownOutside
|
|
538
|
+
]);
|
|
539
|
+
return { onPointerDownCapture: /* @__PURE__ */ __name$4(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture") };
|
|
540
|
+
}
|
|
541
|
+
__name$4(usePointerDownOutside, "usePointerDownOutside");
|
|
542
|
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
543
|
+
const handleFocusOutside = useCallbackRef$1(onFocusOutside);
|
|
544
|
+
const isFocusInsideReactTreeRef = import_react.useRef(false);
|
|
545
|
+
import_react.useEffect(() => {
|
|
546
|
+
const handleFocus = /* @__PURE__ */ __name$4((event) => {
|
|
547
|
+
if (event.target && !isFocusInsideReactTreeRef.current) handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, { discrete: false });
|
|
548
|
+
}, "handleFocus");
|
|
549
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
550
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
551
|
+
}, [ownerDocument, handleFocusOutside]);
|
|
552
|
+
return {
|
|
553
|
+
onFocusCapture: /* @__PURE__ */ __name$4(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
|
|
554
|
+
onBlurCapture: /* @__PURE__ */ __name$4(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
__name$4(useFocusOutside, "useFocusOutside");
|
|
558
|
+
function dispatchUpdate() {
|
|
559
|
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
560
|
+
document.dispatchEvent(event);
|
|
561
|
+
}
|
|
562
|
+
__name$4(dispatchUpdate, "dispatchUpdate");
|
|
563
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
564
|
+
const target = detail.originalEvent.target;
|
|
565
|
+
const event = new CustomEvent(name, {
|
|
566
|
+
bubbles: false,
|
|
567
|
+
cancelable: true,
|
|
568
|
+
detail
|
|
569
|
+
});
|
|
570
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
571
|
+
if (discrete) dispatchDiscreteCustomEvent(target, event);
|
|
572
|
+
else target.dispatchEvent(event);
|
|
573
|
+
}
|
|
574
|
+
__name$4(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
577
|
+
var __defProp$3 = Object.defineProperty;
|
|
578
|
+
var __name$3 = (target, value) => __defProp$3(target, "name", {
|
|
579
|
+
value,
|
|
580
|
+
configurable: true
|
|
581
|
+
});
|
|
582
|
+
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
583
|
+
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
584
|
+
var EVENT_OPTIONS = {
|
|
585
|
+
bubbles: false,
|
|
586
|
+
cancelable: true
|
|
587
|
+
};
|
|
588
|
+
var FocusScope = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name$3(function FocusScope2(props, forwardedRef) {
|
|
589
|
+
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
590
|
+
const [container, setContainer] = import_react.useState(null);
|
|
591
|
+
const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
|
|
592
|
+
const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
|
|
593
|
+
const lastFocusedElementRef = import_react.useRef(null);
|
|
594
|
+
const composedRefs = useComposedRefs(forwardedRef, setContainer);
|
|
595
|
+
const focusScope = import_react.useRef({
|
|
596
|
+
paused: false,
|
|
597
|
+
pause() {
|
|
598
|
+
this.paused = true;
|
|
599
|
+
},
|
|
600
|
+
resume() {
|
|
601
|
+
this.paused = false;
|
|
602
|
+
}
|
|
603
|
+
}).current;
|
|
604
|
+
import_react.useEffect(() => {
|
|
605
|
+
if (trapped) {
|
|
606
|
+
let handleFocusIn2 = function(event) {
|
|
607
|
+
if (focusScope.paused || !container) return;
|
|
608
|
+
const target = event.target;
|
|
609
|
+
if (container.contains(target)) lastFocusedElementRef.current = target;
|
|
610
|
+
else focus(lastFocusedElementRef.current, { select: true });
|
|
611
|
+
}, handleFocusOut2 = function(event) {
|
|
612
|
+
if (focusScope.paused || !container) return;
|
|
613
|
+
const relatedTarget = event.relatedTarget;
|
|
614
|
+
if (relatedTarget === null) return;
|
|
615
|
+
if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.current, { select: true });
|
|
616
|
+
}, handleMutations2 = function(mutations) {
|
|
617
|
+
if (document.activeElement !== document.body) return;
|
|
618
|
+
for (const mutation of mutations) if (mutation.removedNodes.length > 0) focus(container);
|
|
619
|
+
};
|
|
620
|
+
__name$3(handleFocusIn2, "handleFocusIn");
|
|
621
|
+
__name$3(handleFocusOut2, "handleFocusOut");
|
|
622
|
+
__name$3(handleMutations2, "handleMutations");
|
|
623
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
624
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
625
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
626
|
+
if (container) mutationObserver.observe(container, {
|
|
627
|
+
childList: true,
|
|
628
|
+
subtree: true
|
|
629
|
+
});
|
|
630
|
+
return () => {
|
|
631
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
632
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
633
|
+
mutationObserver.disconnect();
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
}, [
|
|
637
|
+
trapped,
|
|
638
|
+
container,
|
|
639
|
+
focusScope.paused
|
|
640
|
+
]);
|
|
641
|
+
import_react.useEffect(() => {
|
|
642
|
+
if (container) {
|
|
643
|
+
focusScopesStack.add(focusScope);
|
|
644
|
+
const previouslyFocusedElement = document.activeElement;
|
|
645
|
+
if (!container.contains(previouslyFocusedElement)) {
|
|
646
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
647
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
648
|
+
container.dispatchEvent(mountEvent);
|
|
649
|
+
if (!mountEvent.defaultPrevented) {
|
|
650
|
+
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
651
|
+
if (document.activeElement === previouslyFocusedElement) focus(container);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return () => {
|
|
655
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
656
|
+
setTimeout(() => {
|
|
657
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
658
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
659
|
+
container.dispatchEvent(unmountEvent);
|
|
660
|
+
if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
661
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
662
|
+
focusScopesStack.remove(focusScope);
|
|
663
|
+
}, 0);
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
}, [
|
|
667
|
+
container,
|
|
668
|
+
onMountAutoFocus,
|
|
669
|
+
onUnmountAutoFocus,
|
|
670
|
+
focusScope
|
|
671
|
+
]);
|
|
672
|
+
const handleKeyDown = import_react.useCallback((event) => {
|
|
673
|
+
if (!loop && !trapped) return;
|
|
674
|
+
if (focusScope.paused) return;
|
|
675
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
676
|
+
const focusedElement = document.activeElement;
|
|
677
|
+
if (isTabKey && focusedElement) {
|
|
678
|
+
const container2 = event.currentTarget;
|
|
679
|
+
const [first, last] = getTabbableEdges(container2);
|
|
680
|
+
if (!(first && last)) {
|
|
681
|
+
if (focusedElement === container2) event.preventDefault();
|
|
682
|
+
} else if (!event.shiftKey && focusedElement === last) {
|
|
683
|
+
event.preventDefault();
|
|
684
|
+
if (loop) focus(first, { select: true });
|
|
685
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
686
|
+
event.preventDefault();
|
|
687
|
+
if (loop) focus(last, { select: true });
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}, [
|
|
691
|
+
loop,
|
|
692
|
+
trapped,
|
|
693
|
+
focusScope.paused
|
|
694
|
+
]);
|
|
695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
696
|
+
tabIndex: -1,
|
|
697
|
+
...scopeProps,
|
|
698
|
+
ref: composedRefs,
|
|
699
|
+
onKeyDown: handleKeyDown
|
|
700
|
+
});
|
|
701
|
+
}, "FocusScope"));
|
|
702
|
+
function focusFirst(candidates, { select = false } = {}) {
|
|
703
|
+
const previouslyFocusedElement = document.activeElement;
|
|
704
|
+
for (const candidate of candidates) {
|
|
705
|
+
focus(candidate, { select });
|
|
706
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
__name$3(focusFirst, "focusFirst");
|
|
710
|
+
function getTabbableEdges(container) {
|
|
711
|
+
const candidates = getTabbableCandidates(container);
|
|
712
|
+
return [findVisible(candidates, container), findVisible(candidates.reverse(), container)];
|
|
713
|
+
}
|
|
714
|
+
__name$3(getTabbableEdges, "getTabbableEdges");
|
|
715
|
+
function getTabbableCandidates(container) {
|
|
716
|
+
const nodes = [];
|
|
717
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ __name$3((node) => {
|
|
718
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
719
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
720
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
721
|
+
}, "acceptNode") });
|
|
722
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
723
|
+
return nodes;
|
|
724
|
+
}
|
|
725
|
+
__name$3(getTabbableCandidates, "getTabbableCandidates");
|
|
726
|
+
function findVisible(elements, container) {
|
|
727
|
+
const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
|
|
728
|
+
for (const element of elements) if (!(canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container }))) return element;
|
|
729
|
+
}
|
|
730
|
+
__name$3(findVisible, "findVisible");
|
|
731
|
+
function isHidden(node, { upTo }) {
|
|
732
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
733
|
+
while (node) {
|
|
734
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
735
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
736
|
+
node = node.parentElement;
|
|
737
|
+
}
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
__name$3(isHidden, "isHidden");
|
|
741
|
+
function isSelectableInput(element) {
|
|
742
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
743
|
+
}
|
|
744
|
+
__name$3(isSelectableInput, "isSelectableInput");
|
|
745
|
+
function focus(element, { select = false } = {}) {
|
|
746
|
+
if (element && element.focus) {
|
|
747
|
+
const previouslyFocusedElement = document.activeElement;
|
|
748
|
+
element.focus({ preventScroll: true });
|
|
749
|
+
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
__name$3(focus, "focus");
|
|
753
|
+
var focusScopesStack = createFocusScopesStack();
|
|
754
|
+
function createFocusScopesStack() {
|
|
755
|
+
let stack = [];
|
|
756
|
+
return {
|
|
757
|
+
add(focusScope) {
|
|
758
|
+
const activeFocusScope = stack[0];
|
|
759
|
+
if (focusScope !== activeFocusScope) activeFocusScope?.pause();
|
|
760
|
+
stack = arrayRemove(stack, focusScope);
|
|
761
|
+
stack.unshift(focusScope);
|
|
762
|
+
},
|
|
763
|
+
remove(focusScope) {
|
|
764
|
+
stack = arrayRemove(stack, focusScope);
|
|
765
|
+
stack[0]?.resume();
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
__name$3(createFocusScopesStack, "createFocusScopesStack");
|
|
770
|
+
function arrayRemove(array, item) {
|
|
771
|
+
const updatedArray = [...array];
|
|
772
|
+
const index = updatedArray.indexOf(item);
|
|
773
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
774
|
+
return updatedArray;
|
|
775
|
+
}
|
|
776
|
+
__name$3(arrayRemove, "arrayRemove");
|
|
777
|
+
function removeLinks(items) {
|
|
778
|
+
return items.filter((item) => item.tagName !== "A");
|
|
779
|
+
}
|
|
780
|
+
__name$3(removeLinks, "removeLinks");
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
783
|
+
var __defProp$2 = Object.defineProperty;
|
|
784
|
+
var __name$2 = (target, value) => __defProp$2(target, "name", {
|
|
785
|
+
value,
|
|
786
|
+
configurable: true
|
|
787
|
+
});
|
|
788
|
+
var Portal = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name$2(function Portal2(props, forwardedRef) {
|
|
789
|
+
const { container: containerProp, ...portalProps } = props;
|
|
790
|
+
const [mounted, setMounted] = import_react.useState(false);
|
|
791
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
792
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
793
|
+
return container ? import_react_dom.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
794
|
+
...portalProps,
|
|
795
|
+
ref: forwardedRef
|
|
796
|
+
}), container) : null;
|
|
797
|
+
}, "Portal"));
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
800
|
+
var __defProp$1 = Object.defineProperty;
|
|
801
|
+
var __name$1 = (target, value) => __defProp$1(target, "name", {
|
|
802
|
+
value,
|
|
803
|
+
configurable: true
|
|
804
|
+
});
|
|
805
|
+
var count = 0;
|
|
806
|
+
var guards = null;
|
|
807
|
+
function FocusGuards(props) {
|
|
808
|
+
useFocusGuards();
|
|
809
|
+
return props.children;
|
|
810
|
+
}
|
|
811
|
+
__name$1(FocusGuards, "FocusGuards");
|
|
812
|
+
function useFocusGuards() {
|
|
813
|
+
import_react.useEffect(() => {
|
|
814
|
+
if (!guards) guards = {
|
|
815
|
+
start: createFocusGuard(),
|
|
816
|
+
end: createFocusGuard()
|
|
817
|
+
};
|
|
818
|
+
const { start, end } = guards;
|
|
819
|
+
if (document.body.firstElementChild !== start) document.body.insertAdjacentElement("afterbegin", start);
|
|
820
|
+
if (document.body.lastElementChild !== end) document.body.insertAdjacentElement("beforeend", end);
|
|
821
|
+
count++;
|
|
822
|
+
return () => {
|
|
823
|
+
if (count === 1) {
|
|
824
|
+
guards?.start.remove();
|
|
825
|
+
guards?.end.remove();
|
|
826
|
+
guards = null;
|
|
827
|
+
}
|
|
828
|
+
count = Math.max(0, count - 1);
|
|
829
|
+
};
|
|
830
|
+
}, []);
|
|
831
|
+
}
|
|
832
|
+
__name$1(useFocusGuards, "useFocusGuards");
|
|
833
|
+
function createFocusGuard() {
|
|
834
|
+
const element = document.createElement("span");
|
|
835
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
836
|
+
element.tabIndex = 0;
|
|
837
|
+
element.style.outline = "none";
|
|
838
|
+
element.style.opacity = "0";
|
|
839
|
+
element.style.position = "fixed";
|
|
840
|
+
element.style.pointerEvents = "none";
|
|
841
|
+
return element;
|
|
842
|
+
}
|
|
843
|
+
__name$1(createFocusGuard, "createFocusGuard");
|
|
844
|
+
//#endregion
|
|
845
|
+
//#region node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
846
|
+
var zeroRightClassName = "right-scroll-bar-position";
|
|
847
|
+
var fullWidthClassName = "width-before-scroll-bar";
|
|
848
|
+
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
849
|
+
/**
|
|
850
|
+
* Name of a CSS variable containing the amount of "hidden" scrollbar
|
|
851
|
+
* ! might be undefined ! use will fallback!
|
|
852
|
+
*/
|
|
853
|
+
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
856
|
+
/**
|
|
857
|
+
* Assigns a value for a given ref, no matter of the ref format
|
|
858
|
+
* @param {RefObject} ref - a callback function or ref object
|
|
859
|
+
* @param value - a new value
|
|
860
|
+
*
|
|
861
|
+
* @see https://github.com/theKashey/use-callback-ref#assignref
|
|
862
|
+
* @example
|
|
863
|
+
* const refObject = useRef();
|
|
864
|
+
* const refFn = (ref) => {....}
|
|
865
|
+
*
|
|
866
|
+
* assignRef(refObject, "refValue");
|
|
867
|
+
* assignRef(refFn, "refValue");
|
|
868
|
+
*/
|
|
869
|
+
function assignRef(ref, value) {
|
|
870
|
+
if (typeof ref === "function") ref(value);
|
|
871
|
+
else if (ref) ref.current = value;
|
|
872
|
+
return ref;
|
|
873
|
+
}
|
|
874
|
+
//#endregion
|
|
875
|
+
//#region node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
876
|
+
/**
|
|
877
|
+
* creates a MutableRef with ref change callback
|
|
878
|
+
* @param initialValue - initial ref value
|
|
879
|
+
* @param {Function} callback - a callback to run when value changes
|
|
880
|
+
*
|
|
881
|
+
* @example
|
|
882
|
+
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
|
|
883
|
+
* ref.current = 1;
|
|
884
|
+
* // prints 0 -> 1
|
|
885
|
+
*
|
|
886
|
+
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
|
887
|
+
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
|
|
888
|
+
* @returns {MutableRefObject}
|
|
889
|
+
*/
|
|
890
|
+
function useCallbackRef(initialValue, callback) {
|
|
891
|
+
var ref = (0, import_react.useState)(function() {
|
|
892
|
+
return {
|
|
893
|
+
value: initialValue,
|
|
894
|
+
callback,
|
|
895
|
+
facade: {
|
|
896
|
+
get current() {
|
|
897
|
+
return ref.value;
|
|
898
|
+
},
|
|
899
|
+
set current(value) {
|
|
900
|
+
var last = ref.value;
|
|
901
|
+
if (last !== value) {
|
|
902
|
+
ref.value = value;
|
|
903
|
+
ref.callback(value, last);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
})[0];
|
|
909
|
+
ref.callback = callback;
|
|
910
|
+
return ref.facade;
|
|
911
|
+
}
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
914
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
|
915
|
+
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
916
|
+
/**
|
|
917
|
+
* Merges two or more refs together providing a single interface to set their value
|
|
918
|
+
* @param {RefObject|Ref} refs
|
|
919
|
+
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
920
|
+
*
|
|
921
|
+
* @see {@link mergeRefs} a version without buit-in memoization
|
|
922
|
+
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
|
|
923
|
+
* @example
|
|
924
|
+
* const Component = React.forwardRef((props, ref) => {
|
|
925
|
+
* const ownRef = useRef();
|
|
926
|
+
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
|
|
927
|
+
* return <div ref={domRef}>...</div>
|
|
928
|
+
* }
|
|
929
|
+
*/
|
|
930
|
+
function useMergeRefs(refs, defaultValue) {
|
|
931
|
+
var callbackRef = useCallbackRef(defaultValue || null, function(newValue) {
|
|
932
|
+
return refs.forEach(function(ref) {
|
|
933
|
+
return assignRef(ref, newValue);
|
|
934
|
+
});
|
|
935
|
+
});
|
|
936
|
+
useIsomorphicLayoutEffect(function() {
|
|
937
|
+
var oldValue = currentValues.get(callbackRef);
|
|
938
|
+
if (oldValue) {
|
|
939
|
+
var prevRefs_1 = new Set(oldValue);
|
|
940
|
+
var nextRefs_1 = new Set(refs);
|
|
941
|
+
var current_1 = callbackRef.current;
|
|
942
|
+
prevRefs_1.forEach(function(ref) {
|
|
943
|
+
if (!nextRefs_1.has(ref)) assignRef(ref, null);
|
|
944
|
+
});
|
|
945
|
+
nextRefs_1.forEach(function(ref) {
|
|
946
|
+
if (!prevRefs_1.has(ref)) assignRef(ref, current_1);
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
currentValues.set(callbackRef, refs);
|
|
950
|
+
}, [refs]);
|
|
951
|
+
return callbackRef;
|
|
952
|
+
}
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region node_modules/use-sidecar/dist/es2015/medium.js
|
|
955
|
+
function ItoI(a) {
|
|
956
|
+
return a;
|
|
957
|
+
}
|
|
958
|
+
function innerCreateMedium(defaults, middleware) {
|
|
959
|
+
if (middleware === void 0) middleware = ItoI;
|
|
960
|
+
var buffer = [];
|
|
961
|
+
var assigned = false;
|
|
962
|
+
return {
|
|
963
|
+
read: function() {
|
|
964
|
+
if (assigned) throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
965
|
+
if (buffer.length) return buffer[buffer.length - 1];
|
|
966
|
+
return defaults;
|
|
967
|
+
},
|
|
968
|
+
useMedium: function(data) {
|
|
969
|
+
var item = middleware(data, assigned);
|
|
970
|
+
buffer.push(item);
|
|
971
|
+
return function() {
|
|
972
|
+
buffer = buffer.filter(function(x) {
|
|
973
|
+
return x !== item;
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
},
|
|
977
|
+
assignSyncMedium: function(cb) {
|
|
978
|
+
assigned = true;
|
|
979
|
+
while (buffer.length) {
|
|
980
|
+
var cbs = buffer;
|
|
981
|
+
buffer = [];
|
|
982
|
+
cbs.forEach(cb);
|
|
983
|
+
}
|
|
984
|
+
buffer = {
|
|
985
|
+
push: function(x) {
|
|
986
|
+
return cb(x);
|
|
987
|
+
},
|
|
988
|
+
filter: function() {
|
|
989
|
+
return buffer;
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
},
|
|
993
|
+
assignMedium: function(cb) {
|
|
994
|
+
assigned = true;
|
|
995
|
+
var pendingQueue = [];
|
|
996
|
+
if (buffer.length) {
|
|
997
|
+
var cbs = buffer;
|
|
998
|
+
buffer = [];
|
|
999
|
+
cbs.forEach(cb);
|
|
1000
|
+
pendingQueue = buffer;
|
|
1001
|
+
}
|
|
1002
|
+
var executeQueue = function() {
|
|
1003
|
+
var cbs = pendingQueue;
|
|
1004
|
+
pendingQueue = [];
|
|
1005
|
+
cbs.forEach(cb);
|
|
1006
|
+
};
|
|
1007
|
+
var cycle = function() {
|
|
1008
|
+
return Promise.resolve().then(executeQueue);
|
|
1009
|
+
};
|
|
1010
|
+
cycle();
|
|
1011
|
+
buffer = {
|
|
1012
|
+
push: function(x) {
|
|
1013
|
+
pendingQueue.push(x);
|
|
1014
|
+
cycle();
|
|
1015
|
+
},
|
|
1016
|
+
filter: function(filter) {
|
|
1017
|
+
pendingQueue = pendingQueue.filter(filter);
|
|
1018
|
+
return buffer;
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
function createSidecarMedium(options) {
|
|
1025
|
+
if (options === void 0) options = {};
|
|
1026
|
+
var medium = innerCreateMedium(null);
|
|
1027
|
+
medium.options = __assign({
|
|
1028
|
+
async: true,
|
|
1029
|
+
ssr: false
|
|
1030
|
+
}, options);
|
|
1031
|
+
return medium;
|
|
1032
|
+
}
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region node_modules/use-sidecar/dist/es2015/exports.js
|
|
1035
|
+
var SideCar = function(_a) {
|
|
1036
|
+
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
1037
|
+
if (!sideCar) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
1038
|
+
var Target = sideCar.read();
|
|
1039
|
+
if (!Target) throw new Error("Sidecar medium not found");
|
|
1040
|
+
return import_react.createElement(Target, __assign({}, rest));
|
|
1041
|
+
};
|
|
1042
|
+
SideCar.isSideCarExport = true;
|
|
1043
|
+
function exportSidecar(medium, exported) {
|
|
1044
|
+
medium.useMedium(exported);
|
|
1045
|
+
return SideCar;
|
|
1046
|
+
}
|
|
1047
|
+
//#endregion
|
|
1048
|
+
//#region node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
1049
|
+
var effectCar = createSidecarMedium();
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
1052
|
+
var nothing = function() {};
|
|
1053
|
+
/**
|
|
1054
|
+
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
1055
|
+
*/
|
|
1056
|
+
var RemoveScroll = import_react.forwardRef(function(props, parentRef) {
|
|
1057
|
+
var ref = import_react.useRef(null);
|
|
1058
|
+
var _a = import_react.useState({
|
|
1059
|
+
onScrollCapture: nothing,
|
|
1060
|
+
onWheelCapture: nothing,
|
|
1061
|
+
onTouchMoveCapture: nothing
|
|
1062
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
1063
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, [
|
|
1064
|
+
"forwardProps",
|
|
1065
|
+
"children",
|
|
1066
|
+
"className",
|
|
1067
|
+
"removeScrollBar",
|
|
1068
|
+
"enabled",
|
|
1069
|
+
"shards",
|
|
1070
|
+
"sideCar",
|
|
1071
|
+
"noRelative",
|
|
1072
|
+
"noIsolation",
|
|
1073
|
+
"inert",
|
|
1074
|
+
"allowPinchZoom",
|
|
1075
|
+
"as",
|
|
1076
|
+
"gapMode"
|
|
1077
|
+
]);
|
|
1078
|
+
var SideCar = sideCar;
|
|
1079
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1080
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
1081
|
+
return import_react.createElement(import_react.Fragment, null, enabled && import_react.createElement(SideCar, {
|
|
1082
|
+
sideCar: effectCar,
|
|
1083
|
+
removeScrollBar,
|
|
1084
|
+
shards,
|
|
1085
|
+
noRelative,
|
|
1086
|
+
noIsolation,
|
|
1087
|
+
inert,
|
|
1088
|
+
setCallbacks,
|
|
1089
|
+
allowPinchZoom: !!allowPinchZoom,
|
|
1090
|
+
lockRef: ref,
|
|
1091
|
+
gapMode
|
|
1092
|
+
}), forwardProps ? import_react.cloneElement(import_react.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : import_react.createElement(Container, __assign({}, containerProps, {
|
|
1093
|
+
className,
|
|
1094
|
+
ref: containerRef
|
|
1095
|
+
}), children));
|
|
1096
|
+
});
|
|
1097
|
+
RemoveScroll.defaultProps = {
|
|
1098
|
+
enabled: true,
|
|
1099
|
+
removeScrollBar: true,
|
|
1100
|
+
inert: false
|
|
1101
|
+
};
|
|
1102
|
+
RemoveScroll.classNames = {
|
|
1103
|
+
fullWidth: fullWidthClassName,
|
|
1104
|
+
zeroRight: zeroRightClassName
|
|
1105
|
+
};
|
|
1106
|
+
var getNonce = function() {
|
|
1107
|
+
if (typeof __webpack_nonce__ !== "undefined") return __webpack_nonce__;
|
|
1108
|
+
};
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
1111
|
+
function makeStyleTag() {
|
|
1112
|
+
if (!document) return null;
|
|
1113
|
+
var tag = document.createElement("style");
|
|
1114
|
+
tag.type = "text/css";
|
|
1115
|
+
var nonce = getNonce();
|
|
1116
|
+
if (nonce) tag.setAttribute("nonce", nonce);
|
|
1117
|
+
return tag;
|
|
1118
|
+
}
|
|
1119
|
+
function injectStyles(tag, css) {
|
|
1120
|
+
if (tag.styleSheet) tag.styleSheet.cssText = css;
|
|
1121
|
+
else tag.appendChild(document.createTextNode(css));
|
|
1122
|
+
}
|
|
1123
|
+
function insertStyleTag(tag) {
|
|
1124
|
+
(document.head || document.getElementsByTagName("head")[0]).appendChild(tag);
|
|
1125
|
+
}
|
|
1126
|
+
var stylesheetSingleton = function() {
|
|
1127
|
+
var counter = 0;
|
|
1128
|
+
var stylesheet = null;
|
|
1129
|
+
return {
|
|
1130
|
+
add: function(style) {
|
|
1131
|
+
if (counter == 0) {
|
|
1132
|
+
if (stylesheet = makeStyleTag()) {
|
|
1133
|
+
injectStyles(stylesheet, style);
|
|
1134
|
+
insertStyleTag(stylesheet);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
counter++;
|
|
1138
|
+
},
|
|
1139
|
+
remove: function() {
|
|
1140
|
+
counter--;
|
|
1141
|
+
if (!counter && stylesheet) {
|
|
1142
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
1143
|
+
stylesheet = null;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1148
|
+
//#endregion
|
|
1149
|
+
//#region node_modules/react-style-singleton/dist/es2015/hook.js
|
|
1150
|
+
/**
|
|
1151
|
+
* creates a hook to control style singleton
|
|
1152
|
+
* @see {@link styleSingleton} for a safer component version
|
|
1153
|
+
* @example
|
|
1154
|
+
* ```tsx
|
|
1155
|
+
* const useStyle = styleHookSingleton();
|
|
1156
|
+
* ///
|
|
1157
|
+
* useStyle('body { overflow: hidden}');
|
|
1158
|
+
*/
|
|
1159
|
+
var styleHookSingleton = function() {
|
|
1160
|
+
var sheet = stylesheetSingleton();
|
|
1161
|
+
return function(styles, isDynamic) {
|
|
1162
|
+
import_react.useEffect(function() {
|
|
1163
|
+
sheet.add(styles);
|
|
1164
|
+
return function() {
|
|
1165
|
+
sheet.remove();
|
|
1166
|
+
};
|
|
1167
|
+
}, [styles && isDynamic]);
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region node_modules/react-style-singleton/dist/es2015/component.js
|
|
1172
|
+
/**
|
|
1173
|
+
* create a Component to add styles on demand
|
|
1174
|
+
* - styles are added when first instance is mounted
|
|
1175
|
+
* - styles are removed when the last instance is unmounted
|
|
1176
|
+
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
1177
|
+
*/
|
|
1178
|
+
var styleSingleton = function() {
|
|
1179
|
+
var useStyle = styleHookSingleton();
|
|
1180
|
+
var Sheet = function(_a) {
|
|
1181
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
1182
|
+
useStyle(styles, dynamic);
|
|
1183
|
+
return null;
|
|
1184
|
+
};
|
|
1185
|
+
return Sheet;
|
|
1186
|
+
};
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region node_modules/react-remove-scroll-bar/dist/es2015/utils.js
|
|
1189
|
+
var zeroGap = {
|
|
1190
|
+
left: 0,
|
|
1191
|
+
top: 0,
|
|
1192
|
+
right: 0,
|
|
1193
|
+
gap: 0
|
|
1194
|
+
};
|
|
1195
|
+
var parse = function(x) {
|
|
1196
|
+
return parseInt(x || "", 10) || 0;
|
|
1197
|
+
};
|
|
1198
|
+
var getOffset = function(gapMode) {
|
|
1199
|
+
var cs = window.getComputedStyle(document.body);
|
|
1200
|
+
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
1201
|
+
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
1202
|
+
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
1203
|
+
return [
|
|
1204
|
+
parse(left),
|
|
1205
|
+
parse(top),
|
|
1206
|
+
parse(right)
|
|
1207
|
+
];
|
|
1208
|
+
};
|
|
1209
|
+
var getGapWidth = function(gapMode) {
|
|
1210
|
+
if (gapMode === void 0) gapMode = "margin";
|
|
1211
|
+
if (typeof window === "undefined") return zeroGap;
|
|
1212
|
+
var offsets = getOffset(gapMode);
|
|
1213
|
+
var documentWidth = document.documentElement.clientWidth;
|
|
1214
|
+
var windowWidth = window.innerWidth;
|
|
1215
|
+
return {
|
|
1216
|
+
left: offsets[0],
|
|
1217
|
+
top: offsets[1],
|
|
1218
|
+
right: offsets[2],
|
|
1219
|
+
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
1224
|
+
var Style = styleSingleton();
|
|
1225
|
+
var lockAttribute = "data-scroll-locked";
|
|
1226
|
+
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
1227
|
+
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
1228
|
+
if (gapMode === void 0) gapMode = "margin";
|
|
1229
|
+
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
1230
|
+
allowRelative && "position: relative ".concat(important, ";"),
|
|
1231
|
+
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
1232
|
+
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
1233
|
+
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
1234
|
+
};
|
|
1235
|
+
var getCurrentUseCounter = function() {
|
|
1236
|
+
var counter = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
|
|
1237
|
+
return isFinite(counter) ? counter : 0;
|
|
1238
|
+
};
|
|
1239
|
+
var useLockAttribute = function() {
|
|
1240
|
+
import_react.useEffect(function() {
|
|
1241
|
+
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
1242
|
+
return function() {
|
|
1243
|
+
var newCounter = getCurrentUseCounter() - 1;
|
|
1244
|
+
if (newCounter <= 0) document.body.removeAttribute(lockAttribute);
|
|
1245
|
+
else document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
1246
|
+
};
|
|
1247
|
+
}, []);
|
|
1248
|
+
};
|
|
1249
|
+
/**
|
|
1250
|
+
* Removes page scrollbar and blocks page scroll when mounted
|
|
1251
|
+
*/
|
|
1252
|
+
var RemoveScrollBar = function(_a) {
|
|
1253
|
+
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
1254
|
+
useLockAttribute();
|
|
1255
|
+
var gap = import_react.useMemo(function() {
|
|
1256
|
+
return getGapWidth(gapMode);
|
|
1257
|
+
}, [gapMode]);
|
|
1258
|
+
return import_react.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
1259
|
+
};
|
|
1260
|
+
//#endregion
|
|
1261
|
+
//#region node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
1262
|
+
var passiveSupported = false;
|
|
1263
|
+
if (typeof window !== "undefined") try {
|
|
1264
|
+
var options = Object.defineProperty({}, "passive", { get: function() {
|
|
1265
|
+
passiveSupported = true;
|
|
1266
|
+
return true;
|
|
1267
|
+
} });
|
|
1268
|
+
window.addEventListener("test", options, options);
|
|
1269
|
+
window.removeEventListener("test", options, options);
|
|
1270
|
+
} catch (err) {
|
|
1271
|
+
passiveSupported = false;
|
|
1272
|
+
}
|
|
1273
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
1274
|
+
//#endregion
|
|
1275
|
+
//#region node_modules/react-remove-scroll/dist/es2015/handleScroll.js
|
|
1276
|
+
var alwaysContainsScroll = function(node) {
|
|
1277
|
+
return node.tagName === "TEXTAREA";
|
|
1278
|
+
};
|
|
1279
|
+
var elementCanBeScrolled = function(node, overflow) {
|
|
1280
|
+
if (!(node instanceof Element)) return false;
|
|
1281
|
+
var styles = window.getComputedStyle(node);
|
|
1282
|
+
return styles[overflow] !== "hidden" && !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible");
|
|
1283
|
+
};
|
|
1284
|
+
var elementCouldBeVScrolled = function(node) {
|
|
1285
|
+
return elementCanBeScrolled(node, "overflowY");
|
|
1286
|
+
};
|
|
1287
|
+
var elementCouldBeHScrolled = function(node) {
|
|
1288
|
+
return elementCanBeScrolled(node, "overflowX");
|
|
1289
|
+
};
|
|
1290
|
+
var locationCouldBeScrolled = function(axis, node) {
|
|
1291
|
+
var ownerDocument = node.ownerDocument;
|
|
1292
|
+
var current = node;
|
|
1293
|
+
do {
|
|
1294
|
+
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) current = current.host;
|
|
1295
|
+
if (elementCouldBeScrolled(axis, current)) {
|
|
1296
|
+
var _a = getScrollVariables(axis, current);
|
|
1297
|
+
if (_a[1] > _a[2]) return true;
|
|
1298
|
+
}
|
|
1299
|
+
current = current.parentNode;
|
|
1300
|
+
} while (current && current !== ownerDocument.body);
|
|
1301
|
+
return false;
|
|
1302
|
+
};
|
|
1303
|
+
var getVScrollVariables = function(_a) {
|
|
1304
|
+
return [
|
|
1305
|
+
_a.scrollTop,
|
|
1306
|
+
_a.scrollHeight,
|
|
1307
|
+
_a.clientHeight
|
|
1308
|
+
];
|
|
1309
|
+
};
|
|
1310
|
+
var getHScrollVariables = function(_a) {
|
|
1311
|
+
return [
|
|
1312
|
+
_a.scrollLeft,
|
|
1313
|
+
_a.scrollWidth,
|
|
1314
|
+
_a.clientWidth
|
|
1315
|
+
];
|
|
1316
|
+
};
|
|
1317
|
+
var elementCouldBeScrolled = function(axis, node) {
|
|
1318
|
+
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
1319
|
+
};
|
|
1320
|
+
var getScrollVariables = function(axis, node) {
|
|
1321
|
+
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
1322
|
+
};
|
|
1323
|
+
var getDirectionFactor = function(axis, direction) {
|
|
1324
|
+
/**
|
|
1325
|
+
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
1326
|
+
* and then increasingly negative as you scroll towards the end of the content.
|
|
1327
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
1328
|
+
*/
|
|
1329
|
+
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
1330
|
+
};
|
|
1331
|
+
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
1332
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
1333
|
+
var delta = directionFactor * sourceDelta;
|
|
1334
|
+
var target = event.target;
|
|
1335
|
+
var targetInLock = endTarget.contains(target);
|
|
1336
|
+
var shouldCancelScroll = false;
|
|
1337
|
+
var isDeltaPositive = delta > 0;
|
|
1338
|
+
var availableScroll = 0;
|
|
1339
|
+
var availableScrollTop = 0;
|
|
1340
|
+
do {
|
|
1341
|
+
if (!target) break;
|
|
1342
|
+
var _a = getScrollVariables(axis, target), position = _a[0];
|
|
1343
|
+
var elementScroll = _a[1] - _a[2] - directionFactor * position;
|
|
1344
|
+
if (position || elementScroll) {
|
|
1345
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
1346
|
+
availableScroll += elementScroll;
|
|
1347
|
+
availableScrollTop += position;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
var parent_1 = target.parentNode;
|
|
1351
|
+
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
1352
|
+
} while (!targetInLock && target !== document.body || targetInLock && (endTarget.contains(target) || endTarget === target));
|
|
1353
|
+
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) shouldCancelScroll = true;
|
|
1354
|
+
else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) shouldCancelScroll = true;
|
|
1355
|
+
return shouldCancelScroll;
|
|
1356
|
+
};
|
|
1357
|
+
//#endregion
|
|
1358
|
+
//#region node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
1359
|
+
var getTouchXY = function(event) {
|
|
1360
|
+
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
1361
|
+
};
|
|
1362
|
+
var getDeltaXY = function(event) {
|
|
1363
|
+
return [event.deltaX, event.deltaY];
|
|
1364
|
+
};
|
|
1365
|
+
var extractRef = function(ref) {
|
|
1366
|
+
return ref && "current" in ref ? ref.current : ref;
|
|
1367
|
+
};
|
|
1368
|
+
var deltaCompare = function(x, y) {
|
|
1369
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
1370
|
+
};
|
|
1371
|
+
var generateStyle = function(id) {
|
|
1372
|
+
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
1373
|
+
};
|
|
1374
|
+
var idCounter = 0;
|
|
1375
|
+
var lockStack = [];
|
|
1376
|
+
function RemoveScrollSideCar(props) {
|
|
1377
|
+
var shouldPreventQueue = import_react.useRef([]);
|
|
1378
|
+
var touchStartRef = import_react.useRef([0, 0]);
|
|
1379
|
+
var activeAxis = import_react.useRef();
|
|
1380
|
+
var id = import_react.useState(idCounter++)[0];
|
|
1381
|
+
var Style = import_react.useState(styleSingleton)[0];
|
|
1382
|
+
var lastProps = import_react.useRef(props);
|
|
1383
|
+
import_react.useEffect(function() {
|
|
1384
|
+
lastProps.current = props;
|
|
1385
|
+
}, [props]);
|
|
1386
|
+
import_react.useEffect(function() {
|
|
1387
|
+
if (props.inert) {
|
|
1388
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
1389
|
+
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
1390
|
+
allow_1.forEach(function(el) {
|
|
1391
|
+
return el.classList.add("allow-interactivity-".concat(id));
|
|
1392
|
+
});
|
|
1393
|
+
return function() {
|
|
1394
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
1395
|
+
allow_1.forEach(function(el) {
|
|
1396
|
+
return el.classList.remove("allow-interactivity-".concat(id));
|
|
1397
|
+
});
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
}, [
|
|
1401
|
+
props.inert,
|
|
1402
|
+
props.lockRef.current,
|
|
1403
|
+
props.shards
|
|
1404
|
+
]);
|
|
1405
|
+
var shouldCancelEvent = import_react.useCallback(function(event, parent) {
|
|
1406
|
+
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) return !lastProps.current.allowPinchZoom;
|
|
1407
|
+
var touch = getTouchXY(event);
|
|
1408
|
+
var touchStart = touchStartRef.current;
|
|
1409
|
+
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1410
|
+
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1411
|
+
var currentAxis;
|
|
1412
|
+
var target = event.target;
|
|
1413
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
1414
|
+
if ("touches" in event && moveDirection === "h" && target.type === "range") return false;
|
|
1415
|
+
var selection = window.getSelection();
|
|
1416
|
+
var anchorNode = selection && selection.anchorNode;
|
|
1417
|
+
if (anchorNode ? anchorNode === target || anchorNode.contains(target) : false) return false;
|
|
1418
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1419
|
+
if (!canBeScrolledInMainDirection) return true;
|
|
1420
|
+
if (canBeScrolledInMainDirection) currentAxis = moveDirection;
|
|
1421
|
+
else {
|
|
1422
|
+
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
1423
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1424
|
+
}
|
|
1425
|
+
if (!canBeScrolledInMainDirection) return false;
|
|
1426
|
+
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) activeAxis.current = currentAxis;
|
|
1427
|
+
if (!currentAxis) return true;
|
|
1428
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1429
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
1430
|
+
}, []);
|
|
1431
|
+
var shouldPrevent = import_react.useCallback(function(_event) {
|
|
1432
|
+
var event = _event;
|
|
1433
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) return;
|
|
1434
|
+
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1435
|
+
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
1436
|
+
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
1437
|
+
})[0];
|
|
1438
|
+
if (sourceEvent && sourceEvent.should) {
|
|
1439
|
+
if (event.cancelable) event.preventDefault();
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
if (!sourceEvent) {
|
|
1443
|
+
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
1444
|
+
return node.contains(event.target);
|
|
1445
|
+
});
|
|
1446
|
+
if (shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation) {
|
|
1447
|
+
if (event.cancelable) event.preventDefault();
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}, []);
|
|
1451
|
+
var shouldCancel = import_react.useCallback(function(name, delta, target, should) {
|
|
1452
|
+
var event = {
|
|
1453
|
+
name,
|
|
1454
|
+
delta,
|
|
1455
|
+
target,
|
|
1456
|
+
should,
|
|
1457
|
+
shadowParent: getOutermostShadowParent(target)
|
|
1458
|
+
};
|
|
1459
|
+
shouldPreventQueue.current.push(event);
|
|
1460
|
+
setTimeout(function() {
|
|
1461
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
1462
|
+
return e !== event;
|
|
1463
|
+
});
|
|
1464
|
+
}, 1);
|
|
1465
|
+
}, []);
|
|
1466
|
+
var scrollTouchStart = import_react.useCallback(function(event) {
|
|
1467
|
+
touchStartRef.current = getTouchXY(event);
|
|
1468
|
+
activeAxis.current = void 0;
|
|
1469
|
+
}, []);
|
|
1470
|
+
var scrollWheel = import_react.useCallback(function(event) {
|
|
1471
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1472
|
+
}, []);
|
|
1473
|
+
var scrollTouchMove = import_react.useCallback(function(event) {
|
|
1474
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1475
|
+
}, []);
|
|
1476
|
+
import_react.useEffect(function() {
|
|
1477
|
+
lockStack.push(Style);
|
|
1478
|
+
props.setCallbacks({
|
|
1479
|
+
onScrollCapture: scrollWheel,
|
|
1480
|
+
onWheelCapture: scrollWheel,
|
|
1481
|
+
onTouchMoveCapture: scrollTouchMove
|
|
1482
|
+
});
|
|
1483
|
+
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
1484
|
+
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1485
|
+
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1486
|
+
return function() {
|
|
1487
|
+
lockStack = lockStack.filter(function(inst) {
|
|
1488
|
+
return inst !== Style;
|
|
1489
|
+
});
|
|
1490
|
+
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
1491
|
+
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1492
|
+
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1493
|
+
};
|
|
1494
|
+
}, []);
|
|
1495
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1496
|
+
return import_react.createElement(import_react.Fragment, null, inert ? import_react.createElement(Style, { styles: generateStyle(id) }) : null, removeScrollBar ? import_react.createElement(RemoveScrollBar, {
|
|
1497
|
+
noRelative: props.noRelative,
|
|
1498
|
+
gapMode: props.gapMode
|
|
1499
|
+
}) : null);
|
|
1500
|
+
}
|
|
1501
|
+
function getOutermostShadowParent(node) {
|
|
1502
|
+
var shadowParent = null;
|
|
1503
|
+
while (node !== null) {
|
|
1504
|
+
if (node instanceof ShadowRoot) {
|
|
1505
|
+
shadowParent = node.host;
|
|
1506
|
+
node = node.host;
|
|
1507
|
+
}
|
|
1508
|
+
node = node.parentNode;
|
|
1509
|
+
}
|
|
1510
|
+
return shadowParent;
|
|
1511
|
+
}
|
|
1512
|
+
//#endregion
|
|
1513
|
+
//#region node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
1514
|
+
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1515
|
+
//#endregion
|
|
1516
|
+
//#region node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
1517
|
+
var ReactRemoveScroll = import_react.forwardRef(function(props, ref) {
|
|
1518
|
+
return import_react.createElement(RemoveScroll, __assign({}, props, {
|
|
1519
|
+
ref,
|
|
1520
|
+
sideCar: sidecar_default
|
|
1521
|
+
}));
|
|
1522
|
+
});
|
|
1523
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region node_modules/aria-hidden/dist/es2015/index.js
|
|
1526
|
+
var getDefaultParent = function(originalTarget) {
|
|
1527
|
+
if (typeof document === "undefined") return null;
|
|
1528
|
+
return (Array.isArray(originalTarget) ? originalTarget[0] : originalTarget).ownerDocument.body;
|
|
1529
|
+
};
|
|
1530
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
1531
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1532
|
+
var markerMap = {};
|
|
1533
|
+
var lockCount = 0;
|
|
1534
|
+
var unwrapHost = function(node) {
|
|
1535
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
1536
|
+
};
|
|
1537
|
+
var correctTargets = function(parent, targets) {
|
|
1538
|
+
return targets.map(function(target) {
|
|
1539
|
+
if (parent.contains(target)) return target;
|
|
1540
|
+
var correctedTarget = unwrapHost(target);
|
|
1541
|
+
if (correctedTarget && parent.contains(correctedTarget)) return correctedTarget;
|
|
1542
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
1543
|
+
return null;
|
|
1544
|
+
}).filter(function(x) {
|
|
1545
|
+
return Boolean(x);
|
|
1546
|
+
});
|
|
1547
|
+
};
|
|
1548
|
+
/**
|
|
1549
|
+
* Marks everything except given node(or nodes) as aria-hidden
|
|
1550
|
+
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
1551
|
+
* @param [parentNode] - top element, defaults to document.body
|
|
1552
|
+
* @param {String} [markerName] - a special attribute to mark every node
|
|
1553
|
+
* @param {String} [controlAttribute] - html Attribute to control
|
|
1554
|
+
* @return {Undo} undo command
|
|
1555
|
+
*/
|
|
1556
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
1557
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1558
|
+
if (!markerMap[markerName]) markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
1559
|
+
var markerCounter = markerMap[markerName];
|
|
1560
|
+
var hiddenNodes = [];
|
|
1561
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
1562
|
+
var elementsToStop = new Set(targets);
|
|
1563
|
+
var keep = function(el) {
|
|
1564
|
+
if (!el || elementsToKeep.has(el)) return;
|
|
1565
|
+
elementsToKeep.add(el);
|
|
1566
|
+
keep(el.parentNode);
|
|
1567
|
+
};
|
|
1568
|
+
targets.forEach(keep);
|
|
1569
|
+
var deep = function(parent) {
|
|
1570
|
+
if (!parent || elementsToStop.has(parent)) return;
|
|
1571
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
1572
|
+
if (elementsToKeep.has(node)) deep(node);
|
|
1573
|
+
else try {
|
|
1574
|
+
var attr = node.getAttribute(controlAttribute);
|
|
1575
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
1576
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
1577
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
1578
|
+
counterMap.set(node, counterValue);
|
|
1579
|
+
markerCounter.set(node, markerValue);
|
|
1580
|
+
hiddenNodes.push(node);
|
|
1581
|
+
if (counterValue === 1 && alreadyHidden) uncontrolledNodes.set(node, true);
|
|
1582
|
+
if (markerValue === 1) node.setAttribute(markerName, "true");
|
|
1583
|
+
if (!alreadyHidden) node.setAttribute(controlAttribute, "true");
|
|
1584
|
+
} catch (e) {
|
|
1585
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
1586
|
+
}
|
|
1587
|
+
});
|
|
1588
|
+
};
|
|
1589
|
+
deep(parentNode);
|
|
1590
|
+
elementsToKeep.clear();
|
|
1591
|
+
lockCount++;
|
|
1592
|
+
return function() {
|
|
1593
|
+
hiddenNodes.forEach(function(node) {
|
|
1594
|
+
var counterValue = counterMap.get(node) - 1;
|
|
1595
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
1596
|
+
counterMap.set(node, counterValue);
|
|
1597
|
+
markerCounter.set(node, markerValue);
|
|
1598
|
+
if (!counterValue) {
|
|
1599
|
+
if (!uncontrolledNodes.has(node)) node.removeAttribute(controlAttribute);
|
|
1600
|
+
uncontrolledNodes.delete(node);
|
|
1601
|
+
}
|
|
1602
|
+
if (!markerValue) node.removeAttribute(markerName);
|
|
1603
|
+
});
|
|
1604
|
+
lockCount--;
|
|
1605
|
+
if (!lockCount) {
|
|
1606
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1607
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1608
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1609
|
+
markerMap = {};
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
};
|
|
1613
|
+
/**
|
|
1614
|
+
* Marks everything except given node(or nodes) as aria-hidden
|
|
1615
|
+
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
1616
|
+
* @param [parentNode] - top element, defaults to document.body
|
|
1617
|
+
* @param {String} [markerName] - a special attribute to mark every node
|
|
1618
|
+
* @return {Undo} undo command
|
|
1619
|
+
*/
|
|
1620
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
1621
|
+
if (markerName === void 0) markerName = "data-aria-hidden";
|
|
1622
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1623
|
+
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
1624
|
+
if (!activeParentNode) return function() {
|
|
1625
|
+
return null;
|
|
1626
|
+
};
|
|
1627
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
1628
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
1629
|
+
};
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
1632
|
+
var __defProp = Object.defineProperty;
|
|
1633
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
1634
|
+
value,
|
|
1635
|
+
configurable: true
|
|
1636
|
+
});
|
|
1637
|
+
var DIALOG_NAME = "Dialog";
|
|
1638
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
1639
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
1640
|
+
var Dialog = /* @__PURE__ */ __name((props) => {
|
|
1641
|
+
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
1642
|
+
const triggerRef = import_react.useRef(null);
|
|
1643
|
+
const contentRef = import_react.useRef(null);
|
|
1644
|
+
const [open, setOpen] = useControllableState({
|
|
1645
|
+
prop: openProp,
|
|
1646
|
+
defaultProp: defaultOpen ?? false,
|
|
1647
|
+
onChange: onOpenChange,
|
|
1648
|
+
caller: DIALOG_NAME
|
|
1649
|
+
});
|
|
1650
|
+
const [titleCount, setTitleCount] = import_react.useState(0);
|
|
1651
|
+
const [descriptionCount, setDescriptionCount] = import_react.useState(0);
|
|
1652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogProvider, {
|
|
1653
|
+
scope: __scopeDialog,
|
|
1654
|
+
triggerRef,
|
|
1655
|
+
contentRef,
|
|
1656
|
+
contentId: useId(),
|
|
1657
|
+
titleId: useId(),
|
|
1658
|
+
descriptionId: useId(),
|
|
1659
|
+
titlePresent: titleCount > 0,
|
|
1660
|
+
descriptionPresent: descriptionCount > 0,
|
|
1661
|
+
setTitleCount,
|
|
1662
|
+
setDescriptionCount,
|
|
1663
|
+
open,
|
|
1664
|
+
onOpenChange: setOpen,
|
|
1665
|
+
onOpenToggle: import_react.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
1666
|
+
modal,
|
|
1667
|
+
children
|
|
1668
|
+
});
|
|
1669
|
+
}, "Dialog");
|
|
1670
|
+
var PORTAL_NAME = "DialogPortal";
|
|
1671
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
1672
|
+
var DialogPortal = /* @__PURE__ */ __name((props) => {
|
|
1673
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
1674
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, {
|
|
1676
|
+
scope: __scopeDialog,
|
|
1677
|
+
forceMount,
|
|
1678
|
+
children: import_react.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
1679
|
+
present: forceMount || context.open,
|
|
1680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
1681
|
+
asChild: true,
|
|
1682
|
+
container,
|
|
1683
|
+
children: child
|
|
1684
|
+
})
|
|
1685
|
+
}))
|
|
1686
|
+
});
|
|
1687
|
+
}, "DialogPortal");
|
|
1688
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
1689
|
+
var DialogOverlay = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogOverlay2(props, forwardedRef) {
|
|
1690
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
1691
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
1692
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
1693
|
+
return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
1694
|
+
present: forceMount || context.open,
|
|
1695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, {
|
|
1696
|
+
...overlayProps,
|
|
1697
|
+
ref: forwardedRef
|
|
1698
|
+
})
|
|
1699
|
+
}) : null;
|
|
1700
|
+
}, "DialogOverlay"));
|
|
1701
|
+
var Slot = createSlot("DialogOverlay.RemoveScroll");
|
|
1702
|
+
var DialogOverlayImpl = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogOverlayImpl2(props, forwardedRef) {
|
|
1703
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
1704
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
1705
|
+
const registerDismissableSurface = useDismissableLayerSurface();
|
|
1706
|
+
const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);
|
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReactRemoveScroll, {
|
|
1708
|
+
as: Slot,
|
|
1709
|
+
allowPinchZoom: true,
|
|
1710
|
+
shards: [context.contentRef],
|
|
1711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
1712
|
+
"data-state": getState(context.open),
|
|
1713
|
+
...overlayProps,
|
|
1714
|
+
ref: composedRefs,
|
|
1715
|
+
style: {
|
|
1716
|
+
pointerEvents: "auto",
|
|
1717
|
+
...overlayProps.style
|
|
1718
|
+
}
|
|
1719
|
+
})
|
|
1720
|
+
});
|
|
1721
|
+
}, "DialogOverlayImpl"));
|
|
1722
|
+
var CONTENT_NAME = "DialogContent";
|
|
1723
|
+
var DialogContent = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogContent2(props, forwardedRef) {
|
|
1724
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
1725
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
1726
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
1728
|
+
present: forceMount || context.open,
|
|
1729
|
+
children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, {
|
|
1730
|
+
...contentProps,
|
|
1731
|
+
ref: forwardedRef
|
|
1732
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, {
|
|
1733
|
+
...contentProps,
|
|
1734
|
+
ref: forwardedRef
|
|
1735
|
+
})
|
|
1736
|
+
});
|
|
1737
|
+
}, "DialogContent"));
|
|
1738
|
+
var DialogContentModal = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogContentModal2(props, forwardedRef) {
|
|
1739
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1740
|
+
const contentRef = import_react.useRef(null);
|
|
1741
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
1742
|
+
import_react.useEffect(() => {
|
|
1743
|
+
const content = contentRef.current;
|
|
1744
|
+
if (content) return hideOthers(content);
|
|
1745
|
+
}, []);
|
|
1746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
|
|
1747
|
+
...props,
|
|
1748
|
+
ref: composedRefs,
|
|
1749
|
+
trapFocus: context.open,
|
|
1750
|
+
disableOutsidePointerEvents: context.open,
|
|
1751
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1752
|
+
event.preventDefault();
|
|
1753
|
+
context.triggerRef.current?.focus();
|
|
1754
|
+
}),
|
|
1755
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
1756
|
+
const originalEvent = event.detail.originalEvent;
|
|
1757
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1758
|
+
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
1759
|
+
}),
|
|
1760
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
1761
|
+
});
|
|
1762
|
+
}, "DialogContentModal"));
|
|
1763
|
+
var DialogContentNonModal = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogContentNonModal2(props, forwardedRef) {
|
|
1764
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
1765
|
+
const hasInteractedOutsideRef = import_react.useRef(false);
|
|
1766
|
+
const hasPointerDownOutsideRef = import_react.useRef(false);
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
|
|
1768
|
+
...props,
|
|
1769
|
+
ref: forwardedRef,
|
|
1770
|
+
trapFocus: false,
|
|
1771
|
+
disableOutsidePointerEvents: false,
|
|
1772
|
+
onCloseAutoFocus: (event) => {
|
|
1773
|
+
props.onCloseAutoFocus?.(event);
|
|
1774
|
+
if (!event.defaultPrevented) {
|
|
1775
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
1776
|
+
event.preventDefault();
|
|
1777
|
+
}
|
|
1778
|
+
hasInteractedOutsideRef.current = false;
|
|
1779
|
+
hasPointerDownOutsideRef.current = false;
|
|
1780
|
+
},
|
|
1781
|
+
onInteractOutside: (event) => {
|
|
1782
|
+
props.onInteractOutside?.(event);
|
|
1783
|
+
if (!event.defaultPrevented) {
|
|
1784
|
+
hasInteractedOutsideRef.current = true;
|
|
1785
|
+
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
1786
|
+
}
|
|
1787
|
+
const target = event.target;
|
|
1788
|
+
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
1789
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
}, "DialogContentNonModal"));
|
|
1793
|
+
var DialogContentImpl = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogContentImpl2(props, forwardedRef) {
|
|
1794
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
1795
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
1796
|
+
useFocusGuards();
|
|
1797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
|
|
1798
|
+
asChild: true,
|
|
1799
|
+
loop: true,
|
|
1800
|
+
trapped: trapFocus,
|
|
1801
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
1802
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
1803
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
|
|
1804
|
+
role: "dialog",
|
|
1805
|
+
id: context.contentId,
|
|
1806
|
+
"aria-describedby": context.descriptionPresent ? context.descriptionId : void 0,
|
|
1807
|
+
"aria-labelledby": context.titlePresent ? context.titleId : void 0,
|
|
1808
|
+
"data-state": getState(context.open),
|
|
1809
|
+
...contentProps,
|
|
1810
|
+
ref: forwardedRef,
|
|
1811
|
+
deferPointerDownOutside: true,
|
|
1812
|
+
onDismiss: () => context.onOpenChange(false)
|
|
1813
|
+
})
|
|
1814
|
+
}) });
|
|
1815
|
+
}, "DialogContentImpl"));
|
|
1816
|
+
var TITLE_NAME = "DialogTitle";
|
|
1817
|
+
var DialogTitle = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogTitle2(props, forwardedRef) {
|
|
1818
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
1819
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
1820
|
+
const { setTitleCount } = context;
|
|
1821
|
+
useLayoutEffect2(() => {
|
|
1822
|
+
setTitleCount((count) => count + 1);
|
|
1823
|
+
return () => setTitleCount((count) => count - 1);
|
|
1824
|
+
}, [setTitleCount]);
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.h2, {
|
|
1826
|
+
id: context.titleId,
|
|
1827
|
+
...titleProps,
|
|
1828
|
+
ref: forwardedRef
|
|
1829
|
+
});
|
|
1830
|
+
}, "DialogTitle"));
|
|
1831
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
1832
|
+
var DialogDescription = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogDescription2(props, forwardedRef) {
|
|
1833
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
1834
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
1835
|
+
const { setDescriptionCount } = context;
|
|
1836
|
+
useLayoutEffect2(() => {
|
|
1837
|
+
setDescriptionCount((count) => count + 1);
|
|
1838
|
+
return () => setDescriptionCount((count) => count - 1);
|
|
1839
|
+
}, [setDescriptionCount]);
|
|
1840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.p, {
|
|
1841
|
+
id: context.descriptionId,
|
|
1842
|
+
...descriptionProps,
|
|
1843
|
+
ref: forwardedRef
|
|
1844
|
+
});
|
|
1845
|
+
}, "DialogDescription"));
|
|
1846
|
+
var CLOSE_NAME = "DialogClose";
|
|
1847
|
+
var DialogClose = /* @__PURE__ */ import_react.forwardRef(/* @__PURE__ */ __name(function DialogClose2(props, forwardedRef) {
|
|
1848
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
1849
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
1850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
1851
|
+
type: "button",
|
|
1852
|
+
...closeProps,
|
|
1853
|
+
ref: forwardedRef,
|
|
1854
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
1855
|
+
});
|
|
1856
|
+
}, "DialogClose"));
|
|
1857
|
+
function getState(open) {
|
|
1858
|
+
return open ? "open" : "closed";
|
|
1859
|
+
}
|
|
1860
|
+
__name(getState, "getState");
|
|
1861
|
+
//#endregion
|
|
1862
|
+
export { DialogOverlay as a, Portal as c, useId as d, Presence as f, DialogDescription as i, DismissableLayer as l, useLayoutEffect2 as m, DialogClose as n, DialogPortal as o, useControllableState as p, DialogContent as r, DialogTitle as s, Dialog as t, useCallbackRef$1 as u };
|