@puckeditor/plugin-auth 0.9.0-canary.3e73f35a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,4867 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function __require() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
34
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+
36
+ // ../tsup-config/react-import.js
37
+ var import_react;
38
+ var init_react_import = __esm({
39
+ "../tsup-config/react-import.js"() {
40
+ "use strict";
41
+ import_react = __toESM(require("react"));
42
+ }
43
+ });
44
+
45
+ // ../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js
46
+ var require_classnames = __commonJS({
47
+ "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(exports2, module2) {
48
+ "use strict";
49
+ init_react_import();
50
+ (function() {
51
+ "use strict";
52
+ var hasOwn = {}.hasOwnProperty;
53
+ function classNames() {
54
+ var classes = "";
55
+ for (var i = 0; i < arguments.length; i++) {
56
+ var arg = arguments[i];
57
+ if (arg) {
58
+ classes = appendClass(classes, parseValue(arg));
59
+ }
60
+ }
61
+ return classes;
62
+ }
63
+ function parseValue(arg) {
64
+ if (typeof arg === "string" || typeof arg === "number") {
65
+ return arg;
66
+ }
67
+ if (typeof arg !== "object") {
68
+ return "";
69
+ }
70
+ if (Array.isArray(arg)) {
71
+ return classNames.apply(null, arg);
72
+ }
73
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
74
+ return arg.toString();
75
+ }
76
+ var classes = "";
77
+ for (var key in arg) {
78
+ if (hasOwn.call(arg, key) && arg[key]) {
79
+ classes = appendClass(classes, key);
80
+ }
81
+ }
82
+ return classes;
83
+ }
84
+ function appendClass(value, newClass) {
85
+ if (!newClass) {
86
+ return value;
87
+ }
88
+ if (value) {
89
+ return value + " " + newClass;
90
+ }
91
+ return value + newClass;
92
+ }
93
+ if (typeof module2 !== "undefined" && module2.exports) {
94
+ classNames.default = classNames;
95
+ module2.exports = classNames;
96
+ } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
97
+ define("classnames", [], function() {
98
+ return classNames;
99
+ });
100
+ } else {
101
+ window.classNames = classNames;
102
+ }
103
+ })();
104
+ }
105
+ });
106
+
107
+ // index.ts
108
+ var index_exports = {};
109
+ __export(index_exports, {
110
+ createAuthPlugin: () => createAuthPlugin
111
+ });
112
+ module.exports = __toCommonJS(index_exports);
113
+ init_react_import();
114
+
115
+ // src/index.tsx
116
+ init_react_import();
117
+
118
+ // ../platform-client/lib/header-actions.ts
119
+ init_react_import();
120
+ var import_react2 = require("react");
121
+ var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
122
+ var markHeaderActions = (Component) => Object.assign(Component, { [HEADER_ACTIONS]: true });
123
+
124
+ // src/components/SessionMenu/index.tsx
125
+ init_react_import();
126
+
127
+ // ../platform-client/components/Menu/index.tsx
128
+ init_react_import();
129
+ var import_react5 = require("react");
130
+
131
+ // css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
132
+ init_react_import();
133
+ var styles_module_default = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
134
+
135
+ // ../platform-client/lib/get-class-name-factory.ts
136
+ init_react_import();
137
+ var import_classnames = __toESM(require_classnames());
138
+ var getClassNameFactory = (rootClass, styles, { baseClass = "" } = {}) => (options = {}) => {
139
+ let descendant = false;
140
+ let modifiers = false;
141
+ if (typeof options === "string") {
142
+ descendant = options;
143
+ } else if (typeof options === "object") {
144
+ modifiers = options;
145
+ }
146
+ if (descendant) {
147
+ const style = styles[`${rootClass}-${descendant}`];
148
+ if (style) {
149
+ return baseClass + styles[`${rootClass}-${descendant}`] || "";
150
+ }
151
+ return "";
152
+ } else if (modifiers) {
153
+ const prefixedModifiers = {};
154
+ for (let modifier in modifiers) {
155
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
156
+ }
157
+ const c = styles[rootClass];
158
+ return baseClass + (0, import_classnames.default)({
159
+ [c]: !!c,
160
+ // only apply the class if it exists
161
+ ...prefixedModifiers
162
+ });
163
+ } else {
164
+ return baseClass + styles[rootClass] || "";
165
+ }
166
+ };
167
+ var get_class_name_factory_default = getClassNameFactory;
168
+
169
+ // ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
170
+ init_react_import();
171
+ var React29 = __toESM(require("react"), 1);
172
+
173
+ // ../../node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs
174
+ init_react_import();
175
+ var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
176
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
177
+ return function handleEvent(event) {
178
+ originalEventHandler?.(event);
179
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
180
+ return ourEventHandler?.(event);
181
+ }
182
+ };
183
+ }
184
+
185
+ // ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
186
+ init_react_import();
187
+ var React2 = __toESM(require("react"), 1);
188
+ function setRef(ref, value) {
189
+ if (typeof ref === "function") {
190
+ return ref(value);
191
+ } else if (ref !== null && ref !== void 0) {
192
+ ref.current = value;
193
+ }
194
+ }
195
+ function composeRefs(...refs) {
196
+ return (node) => {
197
+ let hasCleanup = false;
198
+ const cleanups = refs.map((ref) => {
199
+ const cleanup = setRef(ref, node);
200
+ if (!hasCleanup && typeof cleanup == "function") {
201
+ hasCleanup = true;
202
+ }
203
+ return cleanup;
204
+ });
205
+ if (hasCleanup) {
206
+ return () => {
207
+ for (let i = 0; i < cleanups.length; i++) {
208
+ const cleanup = cleanups[i];
209
+ if (typeof cleanup == "function") {
210
+ cleanup();
211
+ } else {
212
+ setRef(refs[i], null);
213
+ }
214
+ }
215
+ };
216
+ }
217
+ };
218
+ }
219
+ function useComposedRefs(...refs) {
220
+ return React2.useCallback(composeRefs(...refs), refs);
221
+ }
222
+
223
+ // ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-context/dist/index.mjs
224
+ init_react_import();
225
+ var React3 = __toESM(require("react"), 1);
226
+ var import_jsx_runtime = require("react/jsx-runtime");
227
+ function createContextScope(scopeName, createContextScopeDeps = []) {
228
+ let defaultContexts = [];
229
+ function createContext3(rootComponentName, defaultContext) {
230
+ const BaseContext = React3.createContext(defaultContext);
231
+ const index2 = defaultContexts.length;
232
+ defaultContexts = [...defaultContexts, defaultContext];
233
+ const Provider = (props) => {
234
+ const { scope, children, ...context } = props;
235
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
236
+ const value = React3.useMemo(() => context, Object.values(context));
237
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
238
+ };
239
+ Provider.displayName = rootComponentName + "Provider";
240
+ function useContext22(consumerName, scope) {
241
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
242
+ const context = React3.useContext(Context);
243
+ if (context) return context;
244
+ if (defaultContext !== void 0) return defaultContext;
245
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
246
+ }
247
+ return [Provider, useContext22];
248
+ }
249
+ const createScope = () => {
250
+ const scopeContexts = defaultContexts.map((defaultContext) => {
251
+ return React3.createContext(defaultContext);
252
+ });
253
+ return function useScope(scope) {
254
+ const contexts = scope?.[scopeName] || scopeContexts;
255
+ return React3.useMemo(
256
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
257
+ [scope, contexts]
258
+ );
259
+ };
260
+ };
261
+ createScope.scopeName = scopeName;
262
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
263
+ }
264
+ function composeContextScopes(...scopes) {
265
+ const baseScope = scopes[0];
266
+ if (scopes.length === 1) return baseScope;
267
+ const createScope = () => {
268
+ const scopeHooks = scopes.map((createScope2) => ({
269
+ useScope: createScope2(),
270
+ scopeName: createScope2.scopeName
271
+ }));
272
+ return function useComposedScopes(overrideScopes) {
273
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
274
+ const scopeProps = useScope(overrideScopes);
275
+ const currentScope = scopeProps[`__scope${scopeName}`];
276
+ return { ...nextScopes2, ...currentScope };
277
+ }, {});
278
+ return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
279
+ };
280
+ };
281
+ createScope.scopeName = baseScope.scopeName;
282
+ return createScope;
283
+ }
284
+
285
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.0_@types+react@19.2.0__@_0427988989ef438cb994d86fd87ebad1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
286
+ init_react_import();
287
+ var React8 = __toESM(require("react"), 1);
288
+
289
+ // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.0_@types+react@19.2.0__@types+rea_ea2bc0681dd1d05b829e42d1b452627b/node_modules/@radix-ui/react-primitive/dist/index.mjs
290
+ init_react_import();
291
+ var React5 = __toESM(require("react"), 1);
292
+ var ReactDOM = __toESM(require("react-dom"), 1);
293
+
294
+ // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-slot/dist/index.mjs
295
+ init_react_import();
296
+ var React4 = __toESM(require("react"), 1);
297
+ var import_jsx_runtime2 = require("react/jsx-runtime");
298
+ // @__NO_SIDE_EFFECTS__
299
+ function createSlot(ownerName) {
300
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
301
+ const Slot2 = React4.forwardRef((props, forwardedRef) => {
302
+ const { children, ...slotProps } = props;
303
+ const childrenArray = React4.Children.toArray(children);
304
+ const slottable = childrenArray.find(isSlottable);
305
+ if (slottable) {
306
+ const newElement = slottable.props.children;
307
+ const newChildren = childrenArray.map((child) => {
308
+ if (child === slottable) {
309
+ if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
310
+ return React4.isValidElement(newElement) ? newElement.props.children : null;
311
+ } else {
312
+ return child;
313
+ }
314
+ });
315
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
316
+ }
317
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
318
+ });
319
+ Slot2.displayName = `${ownerName}.Slot`;
320
+ return Slot2;
321
+ }
322
+ // @__NO_SIDE_EFFECTS__
323
+ function createSlotClone(ownerName) {
324
+ const SlotClone = React4.forwardRef((props, forwardedRef) => {
325
+ const { children, ...slotProps } = props;
326
+ if (React4.isValidElement(children)) {
327
+ const childrenRef = getElementRef(children);
328
+ const props2 = mergeProps(slotProps, children.props);
329
+ if (children.type !== React4.Fragment) {
330
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
331
+ }
332
+ return React4.cloneElement(children, props2);
333
+ }
334
+ return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
335
+ });
336
+ SlotClone.displayName = `${ownerName}.SlotClone`;
337
+ return SlotClone;
338
+ }
339
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
340
+ function isSlottable(child) {
341
+ return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
342
+ }
343
+ function mergeProps(slotProps, childProps) {
344
+ const overrideProps = { ...childProps };
345
+ for (const propName in childProps) {
346
+ const slotPropValue = slotProps[propName];
347
+ const childPropValue = childProps[propName];
348
+ const isHandler = /^on[A-Z]/.test(propName);
349
+ if (isHandler) {
350
+ if (slotPropValue && childPropValue) {
351
+ overrideProps[propName] = (...args) => {
352
+ const result = childPropValue(...args);
353
+ slotPropValue(...args);
354
+ return result;
355
+ };
356
+ } else if (slotPropValue) {
357
+ overrideProps[propName] = slotPropValue;
358
+ }
359
+ } else if (propName === "style") {
360
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
361
+ } else if (propName === "className") {
362
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
363
+ }
364
+ }
365
+ return { ...slotProps, ...overrideProps };
366
+ }
367
+ function getElementRef(element) {
368
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
369
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
370
+ if (mayWarn) {
371
+ return element.ref;
372
+ }
373
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
374
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
375
+ if (mayWarn) {
376
+ return element.props.ref;
377
+ }
378
+ return element.props.ref || element.ref;
379
+ }
380
+
381
+ // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.0_@types+react@19.2.0__@types+rea_ea2bc0681dd1d05b829e42d1b452627b/node_modules/@radix-ui/react-primitive/dist/index.mjs
382
+ var import_jsx_runtime3 = require("react/jsx-runtime");
383
+ var NODES = [
384
+ "a",
385
+ "button",
386
+ "div",
387
+ "form",
388
+ "h2",
389
+ "h3",
390
+ "img",
391
+ "input",
392
+ "label",
393
+ "li",
394
+ "nav",
395
+ "ol",
396
+ "p",
397
+ "select",
398
+ "span",
399
+ "svg",
400
+ "ul"
401
+ ];
402
+ var Primitive = NODES.reduce((primitive, node) => {
403
+ const Slot2 = createSlot(`Primitive.${node}`);
404
+ const Node2 = React5.forwardRef((props, forwardedRef) => {
405
+ const { asChild, ...primitiveProps } = props;
406
+ const Comp = asChild ? Slot2 : node;
407
+ if (typeof window !== "undefined") {
408
+ window[Symbol.for("radix-ui")] = true;
409
+ }
410
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
411
+ });
412
+ Node2.displayName = `Primitive.${node}`;
413
+ return { ...primitive, [node]: Node2 };
414
+ }, {});
415
+ function dispatchDiscreteCustomEvent(target, event) {
416
+ if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
417
+ }
418
+
419
+ // ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
420
+ init_react_import();
421
+ var React6 = __toESM(require("react"), 1);
422
+ function useCallbackRef(callback) {
423
+ const callbackRef = React6.useRef(callback);
424
+ React6.useEffect(() => {
425
+ callbackRef.current = callback;
426
+ });
427
+ return React6.useMemo(() => (...args) => callbackRef.current?.(...args), []);
428
+ }
429
+
430
+ // ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
431
+ init_react_import();
432
+ var React7 = __toESM(require("react"), 1);
433
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
434
+ const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
435
+ React7.useEffect(() => {
436
+ const handleKeyDown = (event) => {
437
+ if (event.key === "Escape") {
438
+ onEscapeKeyDown(event);
439
+ }
440
+ };
441
+ ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
442
+ return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
443
+ }, [onEscapeKeyDown, ownerDocument]);
444
+ }
445
+
446
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.0_@types+react@19.2.0__@_0427988989ef438cb994d86fd87ebad1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
447
+ var import_jsx_runtime4 = require("react/jsx-runtime");
448
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
449
+ var CONTEXT_UPDATE = "dismissableLayer.update";
450
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
451
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
452
+ var originalBodyPointerEvents;
453
+ var DismissableLayerContext = React8.createContext({
454
+ layers: /* @__PURE__ */ new Set(),
455
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
456
+ branches: /* @__PURE__ */ new Set()
457
+ });
458
+ var DismissableLayer = React8.forwardRef(
459
+ (props, forwardedRef) => {
460
+ const {
461
+ disableOutsidePointerEvents = false,
462
+ onEscapeKeyDown,
463
+ onPointerDownOutside,
464
+ onFocusOutside,
465
+ onInteractOutside,
466
+ onDismiss,
467
+ ...layerProps
468
+ } = props;
469
+ const context = React8.useContext(DismissableLayerContext);
470
+ const [node, setNode] = React8.useState(null);
471
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
472
+ const [, force] = React8.useState({});
473
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
474
+ const layers = Array.from(context.layers);
475
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
476
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
477
+ const index2 = node ? layers.indexOf(node) : -1;
478
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
479
+ const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
480
+ const pointerDownOutside = usePointerDownOutside((event) => {
481
+ const target = event.target;
482
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
483
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
484
+ onPointerDownOutside?.(event);
485
+ onInteractOutside?.(event);
486
+ if (!event.defaultPrevented) onDismiss?.();
487
+ }, ownerDocument);
488
+ const focusOutside = useFocusOutside((event) => {
489
+ const target = event.target;
490
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
491
+ if (isFocusInBranch) return;
492
+ onFocusOutside?.(event);
493
+ onInteractOutside?.(event);
494
+ if (!event.defaultPrevented) onDismiss?.();
495
+ }, ownerDocument);
496
+ useEscapeKeydown((event) => {
497
+ const isHighestLayer = index2 === context.layers.size - 1;
498
+ if (!isHighestLayer) return;
499
+ onEscapeKeyDown?.(event);
500
+ if (!event.defaultPrevented && onDismiss) {
501
+ event.preventDefault();
502
+ onDismiss();
503
+ }
504
+ }, ownerDocument);
505
+ React8.useEffect(() => {
506
+ if (!node) return;
507
+ if (disableOutsidePointerEvents) {
508
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
509
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
510
+ ownerDocument.body.style.pointerEvents = "none";
511
+ }
512
+ context.layersWithOutsidePointerEventsDisabled.add(node);
513
+ }
514
+ context.layers.add(node);
515
+ dispatchUpdate();
516
+ return () => {
517
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
518
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
519
+ }
520
+ };
521
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
522
+ React8.useEffect(() => {
523
+ return () => {
524
+ if (!node) return;
525
+ context.layers.delete(node);
526
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
527
+ dispatchUpdate();
528
+ };
529
+ }, [node, context]);
530
+ React8.useEffect(() => {
531
+ const handleUpdate = () => force({});
532
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
533
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
534
+ }, []);
535
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
536
+ Primitive.div,
537
+ {
538
+ ...layerProps,
539
+ ref: composedRefs,
540
+ style: {
541
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
542
+ ...props.style
543
+ },
544
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
545
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
546
+ onPointerDownCapture: composeEventHandlers(
547
+ props.onPointerDownCapture,
548
+ pointerDownOutside.onPointerDownCapture
549
+ )
550
+ }
551
+ );
552
+ }
553
+ );
554
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
555
+ var BRANCH_NAME = "DismissableLayerBranch";
556
+ var DismissableLayerBranch = React8.forwardRef((props, forwardedRef) => {
557
+ const context = React8.useContext(DismissableLayerContext);
558
+ const ref = React8.useRef(null);
559
+ const composedRefs = useComposedRefs(forwardedRef, ref);
560
+ React8.useEffect(() => {
561
+ const node = ref.current;
562
+ if (node) {
563
+ context.branches.add(node);
564
+ return () => {
565
+ context.branches.delete(node);
566
+ };
567
+ }
568
+ }, [context.branches]);
569
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Primitive.div, { ...props, ref: composedRefs });
570
+ });
571
+ DismissableLayerBranch.displayName = BRANCH_NAME;
572
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
573
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
574
+ const isPointerInsideReactTreeRef = React8.useRef(false);
575
+ const handleClickRef = React8.useRef(() => {
576
+ });
577
+ React8.useEffect(() => {
578
+ const handlePointerDown = (event) => {
579
+ if (event.target && !isPointerInsideReactTreeRef.current) {
580
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
581
+ handleAndDispatchCustomEvent(
582
+ POINTER_DOWN_OUTSIDE,
583
+ handlePointerDownOutside,
584
+ eventDetail,
585
+ { discrete: true }
586
+ );
587
+ };
588
+ var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
589
+ const eventDetail = { originalEvent: event };
590
+ if (event.pointerType === "touch") {
591
+ ownerDocument.removeEventListener("click", handleClickRef.current);
592
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
593
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
594
+ } else {
595
+ handleAndDispatchPointerDownOutsideEvent2();
596
+ }
597
+ } else {
598
+ ownerDocument.removeEventListener("click", handleClickRef.current);
599
+ }
600
+ isPointerInsideReactTreeRef.current = false;
601
+ };
602
+ const timerId = window.setTimeout(() => {
603
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
604
+ }, 0);
605
+ return () => {
606
+ window.clearTimeout(timerId);
607
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
608
+ ownerDocument.removeEventListener("click", handleClickRef.current);
609
+ };
610
+ }, [ownerDocument, handlePointerDownOutside]);
611
+ return {
612
+ // ensures we check React component tree (not just DOM tree)
613
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
614
+ };
615
+ }
616
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
617
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
618
+ const isFocusInsideReactTreeRef = React8.useRef(false);
619
+ React8.useEffect(() => {
620
+ const handleFocus = (event) => {
621
+ if (event.target && !isFocusInsideReactTreeRef.current) {
622
+ const eventDetail = { originalEvent: event };
623
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
624
+ discrete: false
625
+ });
626
+ }
627
+ };
628
+ ownerDocument.addEventListener("focusin", handleFocus);
629
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
630
+ }, [ownerDocument, handleFocusOutside]);
631
+ return {
632
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
633
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
634
+ };
635
+ }
636
+ function dispatchUpdate() {
637
+ const event = new CustomEvent(CONTEXT_UPDATE);
638
+ document.dispatchEvent(event);
639
+ }
640
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
641
+ const target = detail.originalEvent.target;
642
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
643
+ if (handler) target.addEventListener(name, handler, { once: true });
644
+ if (discrete) {
645
+ dispatchDiscreteCustomEvent(target, event);
646
+ } else {
647
+ target.dispatchEvent(event);
648
+ }
649
+ }
650
+
651
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
652
+ init_react_import();
653
+ var React9 = __toESM(require("react"), 1);
654
+ var count = 0;
655
+ function useFocusGuards() {
656
+ React9.useEffect(() => {
657
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
658
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
659
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
660
+ count++;
661
+ return () => {
662
+ if (count === 1) {
663
+ document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
664
+ }
665
+ count--;
666
+ };
667
+ }, []);
668
+ }
669
+ function createFocusGuard() {
670
+ const element = document.createElement("span");
671
+ element.setAttribute("data-radix-focus-guard", "");
672
+ element.tabIndex = 0;
673
+ element.style.outline = "none";
674
+ element.style.opacity = "0";
675
+ element.style.position = "fixed";
676
+ element.style.pointerEvents = "none";
677
+ return element;
678
+ }
679
+
680
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.2.0_@types+react@19.2.0__@types+r_432f7c191b0104b6af97209524a0df56/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
681
+ init_react_import();
682
+ var React10 = __toESM(require("react"), 1);
683
+ var import_jsx_runtime5 = require("react/jsx-runtime");
684
+ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
685
+ var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
686
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
687
+ var FOCUS_SCOPE_NAME = "FocusScope";
688
+ var FocusScope = React10.forwardRef((props, forwardedRef) => {
689
+ const {
690
+ loop = false,
691
+ trapped = false,
692
+ onMountAutoFocus: onMountAutoFocusProp,
693
+ onUnmountAutoFocus: onUnmountAutoFocusProp,
694
+ ...scopeProps
695
+ } = props;
696
+ const [container, setContainer] = React10.useState(null);
697
+ const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
698
+ const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
699
+ const lastFocusedElementRef = React10.useRef(null);
700
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
701
+ const focusScope = React10.useRef({
702
+ paused: false,
703
+ pause() {
704
+ this.paused = true;
705
+ },
706
+ resume() {
707
+ this.paused = false;
708
+ }
709
+ }).current;
710
+ React10.useEffect(() => {
711
+ if (trapped) {
712
+ let handleFocusIn2 = function(event) {
713
+ if (focusScope.paused || !container) return;
714
+ const target = event.target;
715
+ if (container.contains(target)) {
716
+ lastFocusedElementRef.current = target;
717
+ } else {
718
+ focus(lastFocusedElementRef.current, { select: true });
719
+ }
720
+ }, handleFocusOut2 = function(event) {
721
+ if (focusScope.paused || !container) return;
722
+ const relatedTarget = event.relatedTarget;
723
+ if (relatedTarget === null) return;
724
+ if (!container.contains(relatedTarget)) {
725
+ focus(lastFocusedElementRef.current, { select: true });
726
+ }
727
+ }, handleMutations2 = function(mutations) {
728
+ const focusedElement = document.activeElement;
729
+ if (focusedElement !== document.body) return;
730
+ for (const mutation of mutations) {
731
+ if (mutation.removedNodes.length > 0) focus(container);
732
+ }
733
+ };
734
+ var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
735
+ document.addEventListener("focusin", handleFocusIn2);
736
+ document.addEventListener("focusout", handleFocusOut2);
737
+ const mutationObserver = new MutationObserver(handleMutations2);
738
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
739
+ return () => {
740
+ document.removeEventListener("focusin", handleFocusIn2);
741
+ document.removeEventListener("focusout", handleFocusOut2);
742
+ mutationObserver.disconnect();
743
+ };
744
+ }
745
+ }, [trapped, container, focusScope.paused]);
746
+ React10.useEffect(() => {
747
+ if (container) {
748
+ focusScopesStack.add(focusScope);
749
+ const previouslyFocusedElement = document.activeElement;
750
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
751
+ if (!hasFocusedCandidate) {
752
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
753
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
754
+ container.dispatchEvent(mountEvent);
755
+ if (!mountEvent.defaultPrevented) {
756
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
757
+ if (document.activeElement === previouslyFocusedElement) {
758
+ focus(container);
759
+ }
760
+ }
761
+ }
762
+ return () => {
763
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
764
+ setTimeout(() => {
765
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
766
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
767
+ container.dispatchEvent(unmountEvent);
768
+ if (!unmountEvent.defaultPrevented) {
769
+ focus(previouslyFocusedElement ?? document.body, { select: true });
770
+ }
771
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
772
+ focusScopesStack.remove(focusScope);
773
+ }, 0);
774
+ };
775
+ }
776
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
777
+ const handleKeyDown = React10.useCallback(
778
+ (event) => {
779
+ if (!loop && !trapped) return;
780
+ if (focusScope.paused) return;
781
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
782
+ const focusedElement = document.activeElement;
783
+ if (isTabKey && focusedElement) {
784
+ const container2 = event.currentTarget;
785
+ const [first, last] = getTabbableEdges(container2);
786
+ const hasTabbableElementsInside = first && last;
787
+ if (!hasTabbableElementsInside) {
788
+ if (focusedElement === container2) event.preventDefault();
789
+ } else {
790
+ if (!event.shiftKey && focusedElement === last) {
791
+ event.preventDefault();
792
+ if (loop) focus(first, { select: true });
793
+ } else if (event.shiftKey && focusedElement === first) {
794
+ event.preventDefault();
795
+ if (loop) focus(last, { select: true });
796
+ }
797
+ }
798
+ }
799
+ },
800
+ [loop, trapped, focusScope.paused]
801
+ );
802
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
803
+ });
804
+ FocusScope.displayName = FOCUS_SCOPE_NAME;
805
+ function focusFirst(candidates, { select = false } = {}) {
806
+ const previouslyFocusedElement = document.activeElement;
807
+ for (const candidate of candidates) {
808
+ focus(candidate, { select });
809
+ if (document.activeElement !== previouslyFocusedElement) return;
810
+ }
811
+ }
812
+ function getTabbableEdges(container) {
813
+ const candidates = getTabbableCandidates(container);
814
+ const first = findVisible(candidates, container);
815
+ const last = findVisible(candidates.reverse(), container);
816
+ return [first, last];
817
+ }
818
+ function getTabbableCandidates(container) {
819
+ const nodes = [];
820
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
821
+ acceptNode: (node) => {
822
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
823
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
824
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
825
+ }
826
+ });
827
+ while (walker.nextNode()) nodes.push(walker.currentNode);
828
+ return nodes;
829
+ }
830
+ function findVisible(elements, container) {
831
+ for (const element of elements) {
832
+ if (!isHidden(element, { upTo: container })) return element;
833
+ }
834
+ }
835
+ function isHidden(node, { upTo }) {
836
+ if (getComputedStyle(node).visibility === "hidden") return true;
837
+ while (node) {
838
+ if (upTo !== void 0 && node === upTo) return false;
839
+ if (getComputedStyle(node).display === "none") return true;
840
+ node = node.parentElement;
841
+ }
842
+ return false;
843
+ }
844
+ function isSelectableInput(element) {
845
+ return element instanceof HTMLInputElement && "select" in element;
846
+ }
847
+ function focus(element, { select = false } = {}) {
848
+ if (element && element.focus) {
849
+ const previouslyFocusedElement = document.activeElement;
850
+ element.focus({ preventScroll: true });
851
+ if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
852
+ element.select();
853
+ }
854
+ }
855
+ var focusScopesStack = createFocusScopesStack();
856
+ function createFocusScopesStack() {
857
+ let stack = [];
858
+ return {
859
+ add(focusScope) {
860
+ const activeFocusScope = stack[0];
861
+ if (focusScope !== activeFocusScope) {
862
+ activeFocusScope?.pause();
863
+ }
864
+ stack = arrayRemove(stack, focusScope);
865
+ stack.unshift(focusScope);
866
+ },
867
+ remove(focusScope) {
868
+ stack = arrayRemove(stack, focusScope);
869
+ stack[0]?.resume();
870
+ }
871
+ };
872
+ }
873
+ function arrayRemove(array, item) {
874
+ const updatedArray = [...array];
875
+ const index2 = updatedArray.indexOf(item);
876
+ if (index2 !== -1) {
877
+ updatedArray.splice(index2, 1);
878
+ }
879
+ return updatedArray;
880
+ }
881
+ function removeLinks(items) {
882
+ return items.filter((item) => item.tagName !== "A");
883
+ }
884
+
885
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-id/dist/index.mjs
886
+ init_react_import();
887
+ var React12 = __toESM(require("react"), 1);
888
+
889
+ // ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
890
+ init_react_import();
891
+ var React11 = __toESM(require("react"), 1);
892
+ var useLayoutEffect2 = globalThis?.document ? React11.useLayoutEffect : () => {
893
+ };
894
+
895
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-id/dist/index.mjs
896
+ var useReactId = React12[" useId ".trim().toString()] || (() => void 0);
897
+ var count2 = 0;
898
+ function useId(deterministicId) {
899
+ const [id, setId] = React12.useState(useReactId());
900
+ useLayoutEffect2(() => {
901
+ if (!deterministicId) setId((reactId) => reactId ?? String(count2++));
902
+ }, [deterministicId]);
903
+ return deterministicId || (id ? `radix-${id}` : "");
904
+ }
905
+
906
+ // ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_a6a7fea0f37d2b2529626c9011032658/node_modules/@radix-ui/react-popper/dist/index.mjs
907
+ init_react_import();
908
+ var React16 = __toESM(require("react"), 1);
909
+
910
+ // ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
911
+ init_react_import();
912
+
913
+ // ../../node_modules/.pnpm/@floating-ui+dom@1.7.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
914
+ init_react_import();
915
+
916
+ // ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
917
+ init_react_import();
918
+
919
+ // ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
920
+ init_react_import();
921
+ var sides = ["top", "right", "bottom", "left"];
922
+ var min = Math.min;
923
+ var max = Math.max;
924
+ var round = Math.round;
925
+ var floor = Math.floor;
926
+ var createCoords = (v) => ({
927
+ x: v,
928
+ y: v
929
+ });
930
+ var oppositeSideMap = {
931
+ left: "right",
932
+ right: "left",
933
+ bottom: "top",
934
+ top: "bottom"
935
+ };
936
+ var oppositeAlignmentMap = {
937
+ start: "end",
938
+ end: "start"
939
+ };
940
+ function clamp(start, value, end) {
941
+ return max(start, min(value, end));
942
+ }
943
+ function evaluate(value, param) {
944
+ return typeof value === "function" ? value(param) : value;
945
+ }
946
+ function getSide(placement) {
947
+ return placement.split("-")[0];
948
+ }
949
+ function getAlignment(placement) {
950
+ return placement.split("-")[1];
951
+ }
952
+ function getOppositeAxis(axis) {
953
+ return axis === "x" ? "y" : "x";
954
+ }
955
+ function getAxisLength(axis) {
956
+ return axis === "y" ? "height" : "width";
957
+ }
958
+ var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
959
+ function getSideAxis(placement) {
960
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
961
+ }
962
+ function getAlignmentAxis(placement) {
963
+ return getOppositeAxis(getSideAxis(placement));
964
+ }
965
+ function getAlignmentSides(placement, rects, rtl) {
966
+ if (rtl === void 0) {
967
+ rtl = false;
968
+ }
969
+ const alignment = getAlignment(placement);
970
+ const alignmentAxis = getAlignmentAxis(placement);
971
+ const length = getAxisLength(alignmentAxis);
972
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
973
+ if (rects.reference[length] > rects.floating[length]) {
974
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
975
+ }
976
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
977
+ }
978
+ function getExpandedPlacements(placement) {
979
+ const oppositePlacement = getOppositePlacement(placement);
980
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
981
+ }
982
+ function getOppositeAlignmentPlacement(placement) {
983
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
984
+ }
985
+ var lrPlacement = ["left", "right"];
986
+ var rlPlacement = ["right", "left"];
987
+ var tbPlacement = ["top", "bottom"];
988
+ var btPlacement = ["bottom", "top"];
989
+ function getSideList(side, isStart, rtl) {
990
+ switch (side) {
991
+ case "top":
992
+ case "bottom":
993
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
994
+ return isStart ? lrPlacement : rlPlacement;
995
+ case "left":
996
+ case "right":
997
+ return isStart ? tbPlacement : btPlacement;
998
+ default:
999
+ return [];
1000
+ }
1001
+ }
1002
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
1003
+ const alignment = getAlignment(placement);
1004
+ let list = getSideList(getSide(placement), direction === "start", rtl);
1005
+ if (alignment) {
1006
+ list = list.map((side) => side + "-" + alignment);
1007
+ if (flipAlignment) {
1008
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
1009
+ }
1010
+ }
1011
+ return list;
1012
+ }
1013
+ function getOppositePlacement(placement) {
1014
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
1015
+ }
1016
+ function expandPaddingObject(padding) {
1017
+ return {
1018
+ top: 0,
1019
+ right: 0,
1020
+ bottom: 0,
1021
+ left: 0,
1022
+ ...padding
1023
+ };
1024
+ }
1025
+ function getPaddingObject(padding) {
1026
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
1027
+ top: padding,
1028
+ right: padding,
1029
+ bottom: padding,
1030
+ left: padding
1031
+ };
1032
+ }
1033
+ function rectToClientRect(rect) {
1034
+ const {
1035
+ x,
1036
+ y,
1037
+ width,
1038
+ height
1039
+ } = rect;
1040
+ return {
1041
+ width,
1042
+ height,
1043
+ top: y,
1044
+ left: x,
1045
+ right: x + width,
1046
+ bottom: y + height,
1047
+ x,
1048
+ y
1049
+ };
1050
+ }
1051
+
1052
+ // ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1053
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
1054
+ let {
1055
+ reference,
1056
+ floating
1057
+ } = _ref;
1058
+ const sideAxis = getSideAxis(placement);
1059
+ const alignmentAxis = getAlignmentAxis(placement);
1060
+ const alignLength = getAxisLength(alignmentAxis);
1061
+ const side = getSide(placement);
1062
+ const isVertical = sideAxis === "y";
1063
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
1064
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
1065
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1066
+ let coords;
1067
+ switch (side) {
1068
+ case "top":
1069
+ coords = {
1070
+ x: commonX,
1071
+ y: reference.y - floating.height
1072
+ };
1073
+ break;
1074
+ case "bottom":
1075
+ coords = {
1076
+ x: commonX,
1077
+ y: reference.y + reference.height
1078
+ };
1079
+ break;
1080
+ case "right":
1081
+ coords = {
1082
+ x: reference.x + reference.width,
1083
+ y: commonY
1084
+ };
1085
+ break;
1086
+ case "left":
1087
+ coords = {
1088
+ x: reference.x - floating.width,
1089
+ y: commonY
1090
+ };
1091
+ break;
1092
+ default:
1093
+ coords = {
1094
+ x: reference.x,
1095
+ y: reference.y
1096
+ };
1097
+ }
1098
+ switch (getAlignment(placement)) {
1099
+ case "start":
1100
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1101
+ break;
1102
+ case "end":
1103
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1104
+ break;
1105
+ }
1106
+ return coords;
1107
+ }
1108
+ var computePosition = async (reference, floating, config) => {
1109
+ const {
1110
+ placement = "bottom",
1111
+ strategy = "absolute",
1112
+ middleware = [],
1113
+ platform: platform2
1114
+ } = config;
1115
+ const validMiddleware = middleware.filter(Boolean);
1116
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
1117
+ let rects = await platform2.getElementRects({
1118
+ reference,
1119
+ floating,
1120
+ strategy
1121
+ });
1122
+ let {
1123
+ x,
1124
+ y
1125
+ } = computeCoordsFromPlacement(rects, placement, rtl);
1126
+ let statefulPlacement = placement;
1127
+ let middlewareData = {};
1128
+ let resetCount = 0;
1129
+ for (let i = 0; i < validMiddleware.length; i++) {
1130
+ const {
1131
+ name,
1132
+ fn
1133
+ } = validMiddleware[i];
1134
+ const {
1135
+ x: nextX,
1136
+ y: nextY,
1137
+ data,
1138
+ reset
1139
+ } = await fn({
1140
+ x,
1141
+ y,
1142
+ initialPlacement: placement,
1143
+ placement: statefulPlacement,
1144
+ strategy,
1145
+ middlewareData,
1146
+ rects,
1147
+ platform: platform2,
1148
+ elements: {
1149
+ reference,
1150
+ floating
1151
+ }
1152
+ });
1153
+ x = nextX != null ? nextX : x;
1154
+ y = nextY != null ? nextY : y;
1155
+ middlewareData = {
1156
+ ...middlewareData,
1157
+ [name]: {
1158
+ ...middlewareData[name],
1159
+ ...data
1160
+ }
1161
+ };
1162
+ if (reset && resetCount <= 50) {
1163
+ resetCount++;
1164
+ if (typeof reset === "object") {
1165
+ if (reset.placement) {
1166
+ statefulPlacement = reset.placement;
1167
+ }
1168
+ if (reset.rects) {
1169
+ rects = reset.rects === true ? await platform2.getElementRects({
1170
+ reference,
1171
+ floating,
1172
+ strategy
1173
+ }) : reset.rects;
1174
+ }
1175
+ ({
1176
+ x,
1177
+ y
1178
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1179
+ }
1180
+ i = -1;
1181
+ }
1182
+ }
1183
+ return {
1184
+ x,
1185
+ y,
1186
+ placement: statefulPlacement,
1187
+ strategy,
1188
+ middlewareData
1189
+ };
1190
+ };
1191
+ async function detectOverflow(state, options) {
1192
+ var _await$platform$isEle;
1193
+ if (options === void 0) {
1194
+ options = {};
1195
+ }
1196
+ const {
1197
+ x,
1198
+ y,
1199
+ platform: platform2,
1200
+ rects,
1201
+ elements,
1202
+ strategy
1203
+ } = state;
1204
+ const {
1205
+ boundary = "clippingAncestors",
1206
+ rootBoundary = "viewport",
1207
+ elementContext = "floating",
1208
+ altBoundary = false,
1209
+ padding = 0
1210
+ } = evaluate(options, state);
1211
+ const paddingObject = getPaddingObject(padding);
1212
+ const altContext = elementContext === "floating" ? "reference" : "floating";
1213
+ const element = elements[altBoundary ? altContext : elementContext];
1214
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
1215
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
1216
+ boundary,
1217
+ rootBoundary,
1218
+ strategy
1219
+ }));
1220
+ const rect = elementContext === "floating" ? {
1221
+ x,
1222
+ y,
1223
+ width: rects.floating.width,
1224
+ height: rects.floating.height
1225
+ } : rects.reference;
1226
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
1227
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
1228
+ x: 1,
1229
+ y: 1
1230
+ } : {
1231
+ x: 1,
1232
+ y: 1
1233
+ };
1234
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
1235
+ elements,
1236
+ rect,
1237
+ offsetParent,
1238
+ strategy
1239
+ }) : rect);
1240
+ return {
1241
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1242
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1243
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1244
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1245
+ };
1246
+ }
1247
+ var arrow = (options) => ({
1248
+ name: "arrow",
1249
+ options,
1250
+ async fn(state) {
1251
+ const {
1252
+ x,
1253
+ y,
1254
+ placement,
1255
+ rects,
1256
+ platform: platform2,
1257
+ elements,
1258
+ middlewareData
1259
+ } = state;
1260
+ const {
1261
+ element,
1262
+ padding = 0
1263
+ } = evaluate(options, state) || {};
1264
+ if (element == null) {
1265
+ return {};
1266
+ }
1267
+ const paddingObject = getPaddingObject(padding);
1268
+ const coords = {
1269
+ x,
1270
+ y
1271
+ };
1272
+ const axis = getAlignmentAxis(placement);
1273
+ const length = getAxisLength(axis);
1274
+ const arrowDimensions = await platform2.getDimensions(element);
1275
+ const isYAxis = axis === "y";
1276
+ const minProp = isYAxis ? "top" : "left";
1277
+ const maxProp = isYAxis ? "bottom" : "right";
1278
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
1279
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1280
+ const startDiff = coords[axis] - rects.reference[axis];
1281
+ const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
1282
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1283
+ if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
1284
+ clientSize = elements.floating[clientProp] || rects.floating[length];
1285
+ }
1286
+ const centerToReference = endDiff / 2 - startDiff / 2;
1287
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1288
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
1289
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
1290
+ const min$1 = minPadding;
1291
+ const max2 = clientSize - arrowDimensions[length] - maxPadding;
1292
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1293
+ const offset4 = clamp(min$1, center, max2);
1294
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1295
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
1296
+ return {
1297
+ [axis]: coords[axis] + alignmentOffset,
1298
+ data: {
1299
+ [axis]: offset4,
1300
+ centerOffset: center - offset4 - alignmentOffset,
1301
+ ...shouldAddOffset && {
1302
+ alignmentOffset
1303
+ }
1304
+ },
1305
+ reset: shouldAddOffset
1306
+ };
1307
+ }
1308
+ });
1309
+ var flip = function(options) {
1310
+ if (options === void 0) {
1311
+ options = {};
1312
+ }
1313
+ return {
1314
+ name: "flip",
1315
+ options,
1316
+ async fn(state) {
1317
+ var _middlewareData$arrow, _middlewareData$flip;
1318
+ const {
1319
+ placement,
1320
+ middlewareData,
1321
+ rects,
1322
+ initialPlacement,
1323
+ platform: platform2,
1324
+ elements
1325
+ } = state;
1326
+ const {
1327
+ mainAxis: checkMainAxis = true,
1328
+ crossAxis: checkCrossAxis = true,
1329
+ fallbackPlacements: specifiedFallbackPlacements,
1330
+ fallbackStrategy = "bestFit",
1331
+ fallbackAxisSideDirection = "none",
1332
+ flipAlignment = true,
1333
+ ...detectOverflowOptions
1334
+ } = evaluate(options, state);
1335
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
1336
+ return {};
1337
+ }
1338
+ const side = getSide(placement);
1339
+ const initialSideAxis = getSideAxis(initialPlacement);
1340
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1341
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1342
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1343
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
1344
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1345
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1346
+ }
1347
+ const placements2 = [initialPlacement, ...fallbackPlacements];
1348
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1349
+ const overflows = [];
1350
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
1351
+ if (checkMainAxis) {
1352
+ overflows.push(overflow[side]);
1353
+ }
1354
+ if (checkCrossAxis) {
1355
+ const sides2 = getAlignmentSides(placement, rects, rtl);
1356
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
1357
+ }
1358
+ overflowsData = [...overflowsData, {
1359
+ placement,
1360
+ overflows
1361
+ }];
1362
+ if (!overflows.every((side2) => side2 <= 0)) {
1363
+ var _middlewareData$flip2, _overflowsData$filter;
1364
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
1365
+ const nextPlacement = placements2[nextIndex];
1366
+ if (nextPlacement) {
1367
+ const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
1368
+ if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
1369
+ // overflows the main axis.
1370
+ overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
1371
+ return {
1372
+ data: {
1373
+ index: nextIndex,
1374
+ overflows: overflowsData
1375
+ },
1376
+ reset: {
1377
+ placement: nextPlacement
1378
+ }
1379
+ };
1380
+ }
1381
+ }
1382
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
1383
+ if (!resetPlacement) {
1384
+ switch (fallbackStrategy) {
1385
+ case "bestFit": {
1386
+ var _overflowsData$filter2;
1387
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
1388
+ if (hasFallbackAxisSideDirection) {
1389
+ const currentSideAxis = getSideAxis(d.placement);
1390
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
1391
+ // reading directions favoring greater width.
1392
+ currentSideAxis === "y";
1393
+ }
1394
+ return true;
1395
+ }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
1396
+ if (placement2) {
1397
+ resetPlacement = placement2;
1398
+ }
1399
+ break;
1400
+ }
1401
+ case "initialPlacement":
1402
+ resetPlacement = initialPlacement;
1403
+ break;
1404
+ }
1405
+ }
1406
+ if (placement !== resetPlacement) {
1407
+ return {
1408
+ reset: {
1409
+ placement: resetPlacement
1410
+ }
1411
+ };
1412
+ }
1413
+ }
1414
+ return {};
1415
+ }
1416
+ };
1417
+ };
1418
+ function getSideOffsets(overflow, rect) {
1419
+ return {
1420
+ top: overflow.top - rect.height,
1421
+ right: overflow.right - rect.width,
1422
+ bottom: overflow.bottom - rect.height,
1423
+ left: overflow.left - rect.width
1424
+ };
1425
+ }
1426
+ function isAnySideFullyClipped(overflow) {
1427
+ return sides.some((side) => overflow[side] >= 0);
1428
+ }
1429
+ var hide = function(options) {
1430
+ if (options === void 0) {
1431
+ options = {};
1432
+ }
1433
+ return {
1434
+ name: "hide",
1435
+ options,
1436
+ async fn(state) {
1437
+ const {
1438
+ rects
1439
+ } = state;
1440
+ const {
1441
+ strategy = "referenceHidden",
1442
+ ...detectOverflowOptions
1443
+ } = evaluate(options, state);
1444
+ switch (strategy) {
1445
+ case "referenceHidden": {
1446
+ const overflow = await detectOverflow(state, {
1447
+ ...detectOverflowOptions,
1448
+ elementContext: "reference"
1449
+ });
1450
+ const offsets = getSideOffsets(overflow, rects.reference);
1451
+ return {
1452
+ data: {
1453
+ referenceHiddenOffsets: offsets,
1454
+ referenceHidden: isAnySideFullyClipped(offsets)
1455
+ }
1456
+ };
1457
+ }
1458
+ case "escaped": {
1459
+ const overflow = await detectOverflow(state, {
1460
+ ...detectOverflowOptions,
1461
+ altBoundary: true
1462
+ });
1463
+ const offsets = getSideOffsets(overflow, rects.floating);
1464
+ return {
1465
+ data: {
1466
+ escapedOffsets: offsets,
1467
+ escaped: isAnySideFullyClipped(offsets)
1468
+ }
1469
+ };
1470
+ }
1471
+ default: {
1472
+ return {};
1473
+ }
1474
+ }
1475
+ }
1476
+ };
1477
+ };
1478
+ var originSides = /* @__PURE__ */ new Set(["left", "top"]);
1479
+ async function convertValueToCoords(state, options) {
1480
+ const {
1481
+ placement,
1482
+ platform: platform2,
1483
+ elements
1484
+ } = state;
1485
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1486
+ const side = getSide(placement);
1487
+ const alignment = getAlignment(placement);
1488
+ const isVertical = getSideAxis(placement) === "y";
1489
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
1490
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
1491
+ const rawValue = evaluate(options, state);
1492
+ let {
1493
+ mainAxis,
1494
+ crossAxis,
1495
+ alignmentAxis
1496
+ } = typeof rawValue === "number" ? {
1497
+ mainAxis: rawValue,
1498
+ crossAxis: 0,
1499
+ alignmentAxis: null
1500
+ } : {
1501
+ mainAxis: rawValue.mainAxis || 0,
1502
+ crossAxis: rawValue.crossAxis || 0,
1503
+ alignmentAxis: rawValue.alignmentAxis
1504
+ };
1505
+ if (alignment && typeof alignmentAxis === "number") {
1506
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
1507
+ }
1508
+ return isVertical ? {
1509
+ x: crossAxis * crossAxisMulti,
1510
+ y: mainAxis * mainAxisMulti
1511
+ } : {
1512
+ x: mainAxis * mainAxisMulti,
1513
+ y: crossAxis * crossAxisMulti
1514
+ };
1515
+ }
1516
+ var offset = function(options) {
1517
+ if (options === void 0) {
1518
+ options = 0;
1519
+ }
1520
+ return {
1521
+ name: "offset",
1522
+ options,
1523
+ async fn(state) {
1524
+ var _middlewareData$offse, _middlewareData$arrow;
1525
+ const {
1526
+ x,
1527
+ y,
1528
+ placement,
1529
+ middlewareData
1530
+ } = state;
1531
+ const diffCoords = await convertValueToCoords(state, options);
1532
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
1533
+ return {};
1534
+ }
1535
+ return {
1536
+ x: x + diffCoords.x,
1537
+ y: y + diffCoords.y,
1538
+ data: {
1539
+ ...diffCoords,
1540
+ placement
1541
+ }
1542
+ };
1543
+ }
1544
+ };
1545
+ };
1546
+ var shift = function(options) {
1547
+ if (options === void 0) {
1548
+ options = {};
1549
+ }
1550
+ return {
1551
+ name: "shift",
1552
+ options,
1553
+ async fn(state) {
1554
+ const {
1555
+ x,
1556
+ y,
1557
+ placement
1558
+ } = state;
1559
+ const {
1560
+ mainAxis: checkMainAxis = true,
1561
+ crossAxis: checkCrossAxis = false,
1562
+ limiter = {
1563
+ fn: (_ref) => {
1564
+ let {
1565
+ x: x2,
1566
+ y: y2
1567
+ } = _ref;
1568
+ return {
1569
+ x: x2,
1570
+ y: y2
1571
+ };
1572
+ }
1573
+ },
1574
+ ...detectOverflowOptions
1575
+ } = evaluate(options, state);
1576
+ const coords = {
1577
+ x,
1578
+ y
1579
+ };
1580
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1581
+ const crossAxis = getSideAxis(getSide(placement));
1582
+ const mainAxis = getOppositeAxis(crossAxis);
1583
+ let mainAxisCoord = coords[mainAxis];
1584
+ let crossAxisCoord = coords[crossAxis];
1585
+ if (checkMainAxis) {
1586
+ const minSide = mainAxis === "y" ? "top" : "left";
1587
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
1588
+ const min2 = mainAxisCoord + overflow[minSide];
1589
+ const max2 = mainAxisCoord - overflow[maxSide];
1590
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
1591
+ }
1592
+ if (checkCrossAxis) {
1593
+ const minSide = crossAxis === "y" ? "top" : "left";
1594
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
1595
+ const min2 = crossAxisCoord + overflow[minSide];
1596
+ const max2 = crossAxisCoord - overflow[maxSide];
1597
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
1598
+ }
1599
+ const limitedCoords = limiter.fn({
1600
+ ...state,
1601
+ [mainAxis]: mainAxisCoord,
1602
+ [crossAxis]: crossAxisCoord
1603
+ });
1604
+ return {
1605
+ ...limitedCoords,
1606
+ data: {
1607
+ x: limitedCoords.x - x,
1608
+ y: limitedCoords.y - y,
1609
+ enabled: {
1610
+ [mainAxis]: checkMainAxis,
1611
+ [crossAxis]: checkCrossAxis
1612
+ }
1613
+ }
1614
+ };
1615
+ }
1616
+ };
1617
+ };
1618
+ var limitShift = function(options) {
1619
+ if (options === void 0) {
1620
+ options = {};
1621
+ }
1622
+ return {
1623
+ options,
1624
+ fn(state) {
1625
+ const {
1626
+ x,
1627
+ y,
1628
+ placement,
1629
+ rects,
1630
+ middlewareData
1631
+ } = state;
1632
+ const {
1633
+ offset: offset4 = 0,
1634
+ mainAxis: checkMainAxis = true,
1635
+ crossAxis: checkCrossAxis = true
1636
+ } = evaluate(options, state);
1637
+ const coords = {
1638
+ x,
1639
+ y
1640
+ };
1641
+ const crossAxis = getSideAxis(placement);
1642
+ const mainAxis = getOppositeAxis(crossAxis);
1643
+ let mainAxisCoord = coords[mainAxis];
1644
+ let crossAxisCoord = coords[crossAxis];
1645
+ const rawOffset = evaluate(offset4, state);
1646
+ const computedOffset = typeof rawOffset === "number" ? {
1647
+ mainAxis: rawOffset,
1648
+ crossAxis: 0
1649
+ } : {
1650
+ mainAxis: 0,
1651
+ crossAxis: 0,
1652
+ ...rawOffset
1653
+ };
1654
+ if (checkMainAxis) {
1655
+ const len = mainAxis === "y" ? "height" : "width";
1656
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1657
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1658
+ if (mainAxisCoord < limitMin) {
1659
+ mainAxisCoord = limitMin;
1660
+ } else if (mainAxisCoord > limitMax) {
1661
+ mainAxisCoord = limitMax;
1662
+ }
1663
+ }
1664
+ if (checkCrossAxis) {
1665
+ var _middlewareData$offse, _middlewareData$offse2;
1666
+ const len = mainAxis === "y" ? "width" : "height";
1667
+ const isOriginSide = originSides.has(getSide(placement));
1668
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
1669
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
1670
+ if (crossAxisCoord < limitMin) {
1671
+ crossAxisCoord = limitMin;
1672
+ } else if (crossAxisCoord > limitMax) {
1673
+ crossAxisCoord = limitMax;
1674
+ }
1675
+ }
1676
+ return {
1677
+ [mainAxis]: mainAxisCoord,
1678
+ [crossAxis]: crossAxisCoord
1679
+ };
1680
+ }
1681
+ };
1682
+ };
1683
+ var size = function(options) {
1684
+ if (options === void 0) {
1685
+ options = {};
1686
+ }
1687
+ return {
1688
+ name: "size",
1689
+ options,
1690
+ async fn(state) {
1691
+ var _state$middlewareData, _state$middlewareData2;
1692
+ const {
1693
+ placement,
1694
+ rects,
1695
+ platform: platform2,
1696
+ elements
1697
+ } = state;
1698
+ const {
1699
+ apply = () => {
1700
+ },
1701
+ ...detectOverflowOptions
1702
+ } = evaluate(options, state);
1703
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1704
+ const side = getSide(placement);
1705
+ const alignment = getAlignment(placement);
1706
+ const isYAxis = getSideAxis(placement) === "y";
1707
+ const {
1708
+ width,
1709
+ height
1710
+ } = rects.floating;
1711
+ let heightSide;
1712
+ let widthSide;
1713
+ if (side === "top" || side === "bottom") {
1714
+ heightSide = side;
1715
+ widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
1716
+ } else {
1717
+ widthSide = side;
1718
+ heightSide = alignment === "end" ? "top" : "bottom";
1719
+ }
1720
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
1721
+ const maximumClippingWidth = width - overflow.left - overflow.right;
1722
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
1723
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
1724
+ const noShift = !state.middlewareData.shift;
1725
+ let availableHeight = overflowAvailableHeight;
1726
+ let availableWidth = overflowAvailableWidth;
1727
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
1728
+ availableWidth = maximumClippingWidth;
1729
+ }
1730
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
1731
+ availableHeight = maximumClippingHeight;
1732
+ }
1733
+ if (noShift && !alignment) {
1734
+ const xMin = max(overflow.left, 0);
1735
+ const xMax = max(overflow.right, 0);
1736
+ const yMin = max(overflow.top, 0);
1737
+ const yMax = max(overflow.bottom, 0);
1738
+ if (isYAxis) {
1739
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
1740
+ } else {
1741
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
1742
+ }
1743
+ }
1744
+ await apply({
1745
+ ...state,
1746
+ availableWidth,
1747
+ availableHeight
1748
+ });
1749
+ const nextDimensions = await platform2.getDimensions(elements.floating);
1750
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
1751
+ return {
1752
+ reset: {
1753
+ rects: true
1754
+ }
1755
+ };
1756
+ }
1757
+ return {};
1758
+ }
1759
+ };
1760
+ };
1761
+
1762
+ // ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1763
+ init_react_import();
1764
+ function hasWindow() {
1765
+ return typeof window !== "undefined";
1766
+ }
1767
+ function getNodeName(node) {
1768
+ if (isNode(node)) {
1769
+ return (node.nodeName || "").toLowerCase();
1770
+ }
1771
+ return "#document";
1772
+ }
1773
+ function getWindow(node) {
1774
+ var _node$ownerDocument;
1775
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1776
+ }
1777
+ function getDocumentElement(node) {
1778
+ var _ref;
1779
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1780
+ }
1781
+ function isNode(value) {
1782
+ if (!hasWindow()) {
1783
+ return false;
1784
+ }
1785
+ return value instanceof Node || value instanceof getWindow(value).Node;
1786
+ }
1787
+ function isElement(value) {
1788
+ if (!hasWindow()) {
1789
+ return false;
1790
+ }
1791
+ return value instanceof Element || value instanceof getWindow(value).Element;
1792
+ }
1793
+ function isHTMLElement(value) {
1794
+ if (!hasWindow()) {
1795
+ return false;
1796
+ }
1797
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1798
+ }
1799
+ function isShadowRoot(value) {
1800
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
1801
+ return false;
1802
+ }
1803
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1804
+ }
1805
+ var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
1806
+ function isOverflowElement(element) {
1807
+ const {
1808
+ overflow,
1809
+ overflowX,
1810
+ overflowY,
1811
+ display
1812
+ } = getComputedStyle2(element);
1813
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1814
+ }
1815
+ var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
1816
+ function isTableElement(element) {
1817
+ return tableElements.has(getNodeName(element));
1818
+ }
1819
+ var topLayerSelectors = [":popover-open", ":modal"];
1820
+ function isTopLayer(element) {
1821
+ return topLayerSelectors.some((selector) => {
1822
+ try {
1823
+ return element.matches(selector);
1824
+ } catch (_e) {
1825
+ return false;
1826
+ }
1827
+ });
1828
+ }
1829
+ var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
1830
+ var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
1831
+ var containValues = ["paint", "layout", "strict", "content"];
1832
+ function isContainingBlock(elementOrCss) {
1833
+ const webkit = isWebKit();
1834
+ const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
1835
+ return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
1836
+ }
1837
+ function getContainingBlock(element) {
1838
+ let currentNode = getParentNode(element);
1839
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1840
+ if (isContainingBlock(currentNode)) {
1841
+ return currentNode;
1842
+ } else if (isTopLayer(currentNode)) {
1843
+ return null;
1844
+ }
1845
+ currentNode = getParentNode(currentNode);
1846
+ }
1847
+ return null;
1848
+ }
1849
+ function isWebKit() {
1850
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
1851
+ return CSS.supports("-webkit-backdrop-filter", "none");
1852
+ }
1853
+ var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1854
+ function isLastTraversableNode(node) {
1855
+ return lastTraversableNodeNames.has(getNodeName(node));
1856
+ }
1857
+ function getComputedStyle2(element) {
1858
+ return getWindow(element).getComputedStyle(element);
1859
+ }
1860
+ function getNodeScroll(element) {
1861
+ if (isElement(element)) {
1862
+ return {
1863
+ scrollLeft: element.scrollLeft,
1864
+ scrollTop: element.scrollTop
1865
+ };
1866
+ }
1867
+ return {
1868
+ scrollLeft: element.scrollX,
1869
+ scrollTop: element.scrollY
1870
+ };
1871
+ }
1872
+ function getParentNode(node) {
1873
+ if (getNodeName(node) === "html") {
1874
+ return node;
1875
+ }
1876
+ const result = (
1877
+ // Step into the shadow DOM of the parent of a slotted node.
1878
+ node.assignedSlot || // DOM Element detected.
1879
+ node.parentNode || // ShadowRoot detected.
1880
+ isShadowRoot(node) && node.host || // Fallback.
1881
+ getDocumentElement(node)
1882
+ );
1883
+ return isShadowRoot(result) ? result.host : result;
1884
+ }
1885
+ function getNearestOverflowAncestor(node) {
1886
+ const parentNode = getParentNode(node);
1887
+ if (isLastTraversableNode(parentNode)) {
1888
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
1889
+ }
1890
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1891
+ return parentNode;
1892
+ }
1893
+ return getNearestOverflowAncestor(parentNode);
1894
+ }
1895
+ function getOverflowAncestors(node, list, traverseIframes) {
1896
+ var _node$ownerDocument2;
1897
+ if (list === void 0) {
1898
+ list = [];
1899
+ }
1900
+ if (traverseIframes === void 0) {
1901
+ traverseIframes = true;
1902
+ }
1903
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1904
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1905
+ const win = getWindow(scrollableAncestor);
1906
+ if (isBody) {
1907
+ const frameElement = getFrameElement(win);
1908
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1909
+ }
1910
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1911
+ }
1912
+ function getFrameElement(win) {
1913
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1914
+ }
1915
+
1916
+ // ../../node_modules/.pnpm/@floating-ui+dom@1.7.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
1917
+ function getCssDimensions(element) {
1918
+ const css = getComputedStyle2(element);
1919
+ let width = parseFloat(css.width) || 0;
1920
+ let height = parseFloat(css.height) || 0;
1921
+ const hasOffset = isHTMLElement(element);
1922
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1923
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1924
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1925
+ if (shouldFallback) {
1926
+ width = offsetWidth;
1927
+ height = offsetHeight;
1928
+ }
1929
+ return {
1930
+ width,
1931
+ height,
1932
+ $: shouldFallback
1933
+ };
1934
+ }
1935
+ function unwrapElement(element) {
1936
+ return !isElement(element) ? element.contextElement : element;
1937
+ }
1938
+ function getScale(element) {
1939
+ const domElement = unwrapElement(element);
1940
+ if (!isHTMLElement(domElement)) {
1941
+ return createCoords(1);
1942
+ }
1943
+ const rect = domElement.getBoundingClientRect();
1944
+ const {
1945
+ width,
1946
+ height,
1947
+ $
1948
+ } = getCssDimensions(domElement);
1949
+ let x = ($ ? round(rect.width) : rect.width) / width;
1950
+ let y = ($ ? round(rect.height) : rect.height) / height;
1951
+ if (!x || !Number.isFinite(x)) {
1952
+ x = 1;
1953
+ }
1954
+ if (!y || !Number.isFinite(y)) {
1955
+ y = 1;
1956
+ }
1957
+ return {
1958
+ x,
1959
+ y
1960
+ };
1961
+ }
1962
+ var noOffsets = /* @__PURE__ */ createCoords(0);
1963
+ function getVisualOffsets(element) {
1964
+ const win = getWindow(element);
1965
+ if (!isWebKit() || !win.visualViewport) {
1966
+ return noOffsets;
1967
+ }
1968
+ return {
1969
+ x: win.visualViewport.offsetLeft,
1970
+ y: win.visualViewport.offsetTop
1971
+ };
1972
+ }
1973
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1974
+ if (isFixed === void 0) {
1975
+ isFixed = false;
1976
+ }
1977
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1978
+ return false;
1979
+ }
1980
+ return isFixed;
1981
+ }
1982
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1983
+ if (includeScale === void 0) {
1984
+ includeScale = false;
1985
+ }
1986
+ if (isFixedStrategy === void 0) {
1987
+ isFixedStrategy = false;
1988
+ }
1989
+ const clientRect = element.getBoundingClientRect();
1990
+ const domElement = unwrapElement(element);
1991
+ let scale = createCoords(1);
1992
+ if (includeScale) {
1993
+ if (offsetParent) {
1994
+ if (isElement(offsetParent)) {
1995
+ scale = getScale(offsetParent);
1996
+ }
1997
+ } else {
1998
+ scale = getScale(element);
1999
+ }
2000
+ }
2001
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
2002
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
2003
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
2004
+ let width = clientRect.width / scale.x;
2005
+ let height = clientRect.height / scale.y;
2006
+ if (domElement) {
2007
+ const win = getWindow(domElement);
2008
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2009
+ let currentWin = win;
2010
+ let currentIFrame = getFrameElement(currentWin);
2011
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
2012
+ const iframeScale = getScale(currentIFrame);
2013
+ const iframeRect = currentIFrame.getBoundingClientRect();
2014
+ const css = getComputedStyle2(currentIFrame);
2015
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
2016
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
2017
+ x *= iframeScale.x;
2018
+ y *= iframeScale.y;
2019
+ width *= iframeScale.x;
2020
+ height *= iframeScale.y;
2021
+ x += left;
2022
+ y += top;
2023
+ currentWin = getWindow(currentIFrame);
2024
+ currentIFrame = getFrameElement(currentWin);
2025
+ }
2026
+ }
2027
+ return rectToClientRect({
2028
+ width,
2029
+ height,
2030
+ x,
2031
+ y
2032
+ });
2033
+ }
2034
+ function getWindowScrollBarX(element, rect) {
2035
+ const leftScroll = getNodeScroll(element).scrollLeft;
2036
+ if (!rect) {
2037
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
2038
+ }
2039
+ return rect.left + leftScroll;
2040
+ }
2041
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
2042
+ if (ignoreScrollbarX === void 0) {
2043
+ ignoreScrollbarX = false;
2044
+ }
2045
+ const htmlRect = documentElement.getBoundingClientRect();
2046
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
2047
+ // RTL <body> scrollbar.
2048
+ getWindowScrollBarX(documentElement, htmlRect)
2049
+ ));
2050
+ const y = htmlRect.top + scroll.scrollTop;
2051
+ return {
2052
+ x,
2053
+ y
2054
+ };
2055
+ }
2056
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2057
+ let {
2058
+ elements,
2059
+ rect,
2060
+ offsetParent,
2061
+ strategy
2062
+ } = _ref;
2063
+ const isFixed = strategy === "fixed";
2064
+ const documentElement = getDocumentElement(offsetParent);
2065
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
2066
+ if (offsetParent === documentElement || topLayer && isFixed) {
2067
+ return rect;
2068
+ }
2069
+ let scroll = {
2070
+ scrollLeft: 0,
2071
+ scrollTop: 0
2072
+ };
2073
+ let scale = createCoords(1);
2074
+ const offsets = createCoords(0);
2075
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2076
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2077
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2078
+ scroll = getNodeScroll(offsetParent);
2079
+ }
2080
+ if (isHTMLElement(offsetParent)) {
2081
+ const offsetRect = getBoundingClientRect(offsetParent);
2082
+ scale = getScale(offsetParent);
2083
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2084
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2085
+ }
2086
+ }
2087
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
2088
+ return {
2089
+ width: rect.width * scale.x,
2090
+ height: rect.height * scale.y,
2091
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
2092
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
2093
+ };
2094
+ }
2095
+ function getClientRects(element) {
2096
+ return Array.from(element.getClientRects());
2097
+ }
2098
+ function getDocumentRect(element) {
2099
+ const html = getDocumentElement(element);
2100
+ const scroll = getNodeScroll(element);
2101
+ const body = element.ownerDocument.body;
2102
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
2103
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
2104
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2105
+ const y = -scroll.scrollTop;
2106
+ if (getComputedStyle2(body).direction === "rtl") {
2107
+ x += max(html.clientWidth, body.clientWidth) - width;
2108
+ }
2109
+ return {
2110
+ width,
2111
+ height,
2112
+ x,
2113
+ y
2114
+ };
2115
+ }
2116
+ function getViewportRect(element, strategy) {
2117
+ const win = getWindow(element);
2118
+ const html = getDocumentElement(element);
2119
+ const visualViewport = win.visualViewport;
2120
+ let width = html.clientWidth;
2121
+ let height = html.clientHeight;
2122
+ let x = 0;
2123
+ let y = 0;
2124
+ if (visualViewport) {
2125
+ width = visualViewport.width;
2126
+ height = visualViewport.height;
2127
+ const visualViewportBased = isWebKit();
2128
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
2129
+ x = visualViewport.offsetLeft;
2130
+ y = visualViewport.offsetTop;
2131
+ }
2132
+ }
2133
+ return {
2134
+ width,
2135
+ height,
2136
+ x,
2137
+ y
2138
+ };
2139
+ }
2140
+ var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2141
+ function getInnerBoundingClientRect(element, strategy) {
2142
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
2143
+ const top = clientRect.top + element.clientTop;
2144
+ const left = clientRect.left + element.clientLeft;
2145
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2146
+ const width = element.clientWidth * scale.x;
2147
+ const height = element.clientHeight * scale.y;
2148
+ const x = left * scale.x;
2149
+ const y = top * scale.y;
2150
+ return {
2151
+ width,
2152
+ height,
2153
+ x,
2154
+ y
2155
+ };
2156
+ }
2157
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2158
+ let rect;
2159
+ if (clippingAncestor === "viewport") {
2160
+ rect = getViewportRect(element, strategy);
2161
+ } else if (clippingAncestor === "document") {
2162
+ rect = getDocumentRect(getDocumentElement(element));
2163
+ } else if (isElement(clippingAncestor)) {
2164
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2165
+ } else {
2166
+ const visualOffsets = getVisualOffsets(element);
2167
+ rect = {
2168
+ x: clippingAncestor.x - visualOffsets.x,
2169
+ y: clippingAncestor.y - visualOffsets.y,
2170
+ width: clippingAncestor.width,
2171
+ height: clippingAncestor.height
2172
+ };
2173
+ }
2174
+ return rectToClientRect(rect);
2175
+ }
2176
+ function hasFixedPositionAncestor(element, stopNode) {
2177
+ const parentNode = getParentNode(element);
2178
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
2179
+ return false;
2180
+ }
2181
+ return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
2182
+ }
2183
+ function getClippingElementAncestors(element, cache) {
2184
+ const cachedResult = cache.get(element);
2185
+ if (cachedResult) {
2186
+ return cachedResult;
2187
+ }
2188
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
2189
+ let currentContainingBlockComputedStyle = null;
2190
+ const elementIsFixed = getComputedStyle2(element).position === "fixed";
2191
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
2192
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2193
+ const computedStyle = getComputedStyle2(currentNode);
2194
+ const currentNodeIsContaining = isContainingBlock(currentNode);
2195
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
2196
+ currentContainingBlockComputedStyle = null;
2197
+ }
2198
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2199
+ if (shouldDropCurrentNode) {
2200
+ result = result.filter((ancestor) => ancestor !== currentNode);
2201
+ } else {
2202
+ currentContainingBlockComputedStyle = computedStyle;
2203
+ }
2204
+ currentNode = getParentNode(currentNode);
2205
+ }
2206
+ cache.set(element, result);
2207
+ return result;
2208
+ }
2209
+ function getClippingRect(_ref) {
2210
+ let {
2211
+ element,
2212
+ boundary,
2213
+ rootBoundary,
2214
+ strategy
2215
+ } = _ref;
2216
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2217
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2218
+ const firstClippingAncestor = clippingAncestors[0];
2219
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2220
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2221
+ accRect.top = max(rect.top, accRect.top);
2222
+ accRect.right = min(rect.right, accRect.right);
2223
+ accRect.bottom = min(rect.bottom, accRect.bottom);
2224
+ accRect.left = max(rect.left, accRect.left);
2225
+ return accRect;
2226
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2227
+ return {
2228
+ width: clippingRect.right - clippingRect.left,
2229
+ height: clippingRect.bottom - clippingRect.top,
2230
+ x: clippingRect.left,
2231
+ y: clippingRect.top
2232
+ };
2233
+ }
2234
+ function getDimensions(element) {
2235
+ const {
2236
+ width,
2237
+ height
2238
+ } = getCssDimensions(element);
2239
+ return {
2240
+ width,
2241
+ height
2242
+ };
2243
+ }
2244
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2245
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2246
+ const documentElement = getDocumentElement(offsetParent);
2247
+ const isFixed = strategy === "fixed";
2248
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2249
+ let scroll = {
2250
+ scrollLeft: 0,
2251
+ scrollTop: 0
2252
+ };
2253
+ const offsets = createCoords(0);
2254
+ function setLeftRTLScrollbarOffset() {
2255
+ offsets.x = getWindowScrollBarX(documentElement);
2256
+ }
2257
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2258
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2259
+ scroll = getNodeScroll(offsetParent);
2260
+ }
2261
+ if (isOffsetParentAnElement) {
2262
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2263
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2264
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2265
+ } else if (documentElement) {
2266
+ setLeftRTLScrollbarOffset();
2267
+ }
2268
+ }
2269
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
2270
+ setLeftRTLScrollbarOffset();
2271
+ }
2272
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2273
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
2274
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
2275
+ return {
2276
+ x,
2277
+ y,
2278
+ width: rect.width,
2279
+ height: rect.height
2280
+ };
2281
+ }
2282
+ function isStaticPositioned(element) {
2283
+ return getComputedStyle2(element).position === "static";
2284
+ }
2285
+ function getTrueOffsetParent(element, polyfill) {
2286
+ if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
2287
+ return null;
2288
+ }
2289
+ if (polyfill) {
2290
+ return polyfill(element);
2291
+ }
2292
+ let rawOffsetParent = element.offsetParent;
2293
+ if (getDocumentElement(element) === rawOffsetParent) {
2294
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
2295
+ }
2296
+ return rawOffsetParent;
2297
+ }
2298
+ function getOffsetParent(element, polyfill) {
2299
+ const win = getWindow(element);
2300
+ if (isTopLayer(element)) {
2301
+ return win;
2302
+ }
2303
+ if (!isHTMLElement(element)) {
2304
+ let svgOffsetParent = getParentNode(element);
2305
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2306
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2307
+ return svgOffsetParent;
2308
+ }
2309
+ svgOffsetParent = getParentNode(svgOffsetParent);
2310
+ }
2311
+ return win;
2312
+ }
2313
+ let offsetParent = getTrueOffsetParent(element, polyfill);
2314
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2315
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2316
+ }
2317
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2318
+ return win;
2319
+ }
2320
+ return offsetParent || getContainingBlock(element) || win;
2321
+ }
2322
+ var getElementRects = async function(data) {
2323
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2324
+ const getDimensionsFn = this.getDimensions;
2325
+ const floatingDimensions = await getDimensionsFn(data.floating);
2326
+ return {
2327
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2328
+ floating: {
2329
+ x: 0,
2330
+ y: 0,
2331
+ width: floatingDimensions.width,
2332
+ height: floatingDimensions.height
2333
+ }
2334
+ };
2335
+ };
2336
+ function isRTL(element) {
2337
+ return getComputedStyle2(element).direction === "rtl";
2338
+ }
2339
+ var platform = {
2340
+ convertOffsetParentRelativeRectToViewportRelativeRect,
2341
+ getDocumentElement,
2342
+ getClippingRect,
2343
+ getOffsetParent,
2344
+ getElementRects,
2345
+ getClientRects,
2346
+ getDimensions,
2347
+ getScale,
2348
+ isElement,
2349
+ isRTL
2350
+ };
2351
+ function rectsAreEqual(a, b) {
2352
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
2353
+ }
2354
+ function observeMove(element, onMove) {
2355
+ let io = null;
2356
+ let timeoutId;
2357
+ const root = getDocumentElement(element);
2358
+ function cleanup() {
2359
+ var _io;
2360
+ clearTimeout(timeoutId);
2361
+ (_io = io) == null || _io.disconnect();
2362
+ io = null;
2363
+ }
2364
+ function refresh(skip, threshold) {
2365
+ if (skip === void 0) {
2366
+ skip = false;
2367
+ }
2368
+ if (threshold === void 0) {
2369
+ threshold = 1;
2370
+ }
2371
+ cleanup();
2372
+ const elementRectForRootMargin = element.getBoundingClientRect();
2373
+ const {
2374
+ left,
2375
+ top,
2376
+ width,
2377
+ height
2378
+ } = elementRectForRootMargin;
2379
+ if (!skip) {
2380
+ onMove();
2381
+ }
2382
+ if (!width || !height) {
2383
+ return;
2384
+ }
2385
+ const insetTop = floor(top);
2386
+ const insetRight = floor(root.clientWidth - (left + width));
2387
+ const insetBottom = floor(root.clientHeight - (top + height));
2388
+ const insetLeft = floor(left);
2389
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2390
+ const options = {
2391
+ rootMargin,
2392
+ threshold: max(0, min(1, threshold)) || 1
2393
+ };
2394
+ let isFirstUpdate = true;
2395
+ function handleObserve(entries) {
2396
+ const ratio = entries[0].intersectionRatio;
2397
+ if (ratio !== threshold) {
2398
+ if (!isFirstUpdate) {
2399
+ return refresh();
2400
+ }
2401
+ if (!ratio) {
2402
+ timeoutId = setTimeout(() => {
2403
+ refresh(false, 1e-7);
2404
+ }, 1e3);
2405
+ } else {
2406
+ refresh(false, ratio);
2407
+ }
2408
+ }
2409
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
2410
+ refresh();
2411
+ }
2412
+ isFirstUpdate = false;
2413
+ }
2414
+ try {
2415
+ io = new IntersectionObserver(handleObserve, {
2416
+ ...options,
2417
+ // Handle <iframe>s
2418
+ root: root.ownerDocument
2419
+ });
2420
+ } catch (_e) {
2421
+ io = new IntersectionObserver(handleObserve, options);
2422
+ }
2423
+ io.observe(element);
2424
+ }
2425
+ refresh(true);
2426
+ return cleanup;
2427
+ }
2428
+ function autoUpdate(reference, floating, update, options) {
2429
+ if (options === void 0) {
2430
+ options = {};
2431
+ }
2432
+ const {
2433
+ ancestorScroll = true,
2434
+ ancestorResize = true,
2435
+ elementResize = typeof ResizeObserver === "function",
2436
+ layoutShift = typeof IntersectionObserver === "function",
2437
+ animationFrame = false
2438
+ } = options;
2439
+ const referenceEl = unwrapElement(reference);
2440
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
2441
+ ancestors.forEach((ancestor) => {
2442
+ ancestorScroll && ancestor.addEventListener("scroll", update, {
2443
+ passive: true
2444
+ });
2445
+ ancestorResize && ancestor.addEventListener("resize", update);
2446
+ });
2447
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2448
+ let reobserveFrame = -1;
2449
+ let resizeObserver = null;
2450
+ if (elementResize) {
2451
+ resizeObserver = new ResizeObserver((_ref) => {
2452
+ let [firstEntry] = _ref;
2453
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2454
+ resizeObserver.unobserve(floating);
2455
+ cancelAnimationFrame(reobserveFrame);
2456
+ reobserveFrame = requestAnimationFrame(() => {
2457
+ var _resizeObserver;
2458
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
2459
+ });
2460
+ }
2461
+ update();
2462
+ });
2463
+ if (referenceEl && !animationFrame) {
2464
+ resizeObserver.observe(referenceEl);
2465
+ }
2466
+ resizeObserver.observe(floating);
2467
+ }
2468
+ let frameId;
2469
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
2470
+ if (animationFrame) {
2471
+ frameLoop();
2472
+ }
2473
+ function frameLoop() {
2474
+ const nextRefRect = getBoundingClientRect(reference);
2475
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
2476
+ update();
2477
+ }
2478
+ prevRefRect = nextRefRect;
2479
+ frameId = requestAnimationFrame(frameLoop);
2480
+ }
2481
+ update();
2482
+ return () => {
2483
+ var _resizeObserver2;
2484
+ ancestors.forEach((ancestor) => {
2485
+ ancestorScroll && ancestor.removeEventListener("scroll", update);
2486
+ ancestorResize && ancestor.removeEventListener("resize", update);
2487
+ });
2488
+ cleanupIo == null || cleanupIo();
2489
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
2490
+ resizeObserver = null;
2491
+ if (animationFrame) {
2492
+ cancelAnimationFrame(frameId);
2493
+ }
2494
+ };
2495
+ }
2496
+ var offset2 = offset;
2497
+ var shift2 = shift;
2498
+ var flip2 = flip;
2499
+ var size2 = size;
2500
+ var hide2 = hide;
2501
+ var arrow2 = arrow;
2502
+ var limitShift2 = limitShift;
2503
+ var computePosition2 = (reference, floating, options) => {
2504
+ const cache = /* @__PURE__ */ new Map();
2505
+ const mergedOptions = {
2506
+ platform,
2507
+ ...options
2508
+ };
2509
+ const platformWithCache = {
2510
+ ...mergedOptions.platform,
2511
+ _c: cache
2512
+ };
2513
+ return computePosition(reference, floating, {
2514
+ ...mergedOptions,
2515
+ platform: platformWithCache
2516
+ });
2517
+ };
2518
+
2519
+ // ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
2520
+ var React13 = __toESM(require("react"), 1);
2521
+ var import_react3 = require("react");
2522
+ var ReactDOM2 = __toESM(require("react-dom"), 1);
2523
+ var isClient = typeof document !== "undefined";
2524
+ var noop = function noop2() {
2525
+ };
2526
+ var index = isClient ? import_react3.useLayoutEffect : noop;
2527
+ function deepEqual(a, b) {
2528
+ if (a === b) {
2529
+ return true;
2530
+ }
2531
+ if (typeof a !== typeof b) {
2532
+ return false;
2533
+ }
2534
+ if (typeof a === "function" && a.toString() === b.toString()) {
2535
+ return true;
2536
+ }
2537
+ let length;
2538
+ let i;
2539
+ let keys;
2540
+ if (a && b && typeof a === "object") {
2541
+ if (Array.isArray(a)) {
2542
+ length = a.length;
2543
+ if (length !== b.length) return false;
2544
+ for (i = length; i-- !== 0; ) {
2545
+ if (!deepEqual(a[i], b[i])) {
2546
+ return false;
2547
+ }
2548
+ }
2549
+ return true;
2550
+ }
2551
+ keys = Object.keys(a);
2552
+ length = keys.length;
2553
+ if (length !== Object.keys(b).length) {
2554
+ return false;
2555
+ }
2556
+ for (i = length; i-- !== 0; ) {
2557
+ if (!{}.hasOwnProperty.call(b, keys[i])) {
2558
+ return false;
2559
+ }
2560
+ }
2561
+ for (i = length; i-- !== 0; ) {
2562
+ const key = keys[i];
2563
+ if (key === "_owner" && a.$$typeof) {
2564
+ continue;
2565
+ }
2566
+ if (!deepEqual(a[key], b[key])) {
2567
+ return false;
2568
+ }
2569
+ }
2570
+ return true;
2571
+ }
2572
+ return a !== a && b !== b;
2573
+ }
2574
+ function getDPR(element) {
2575
+ if (typeof window === "undefined") {
2576
+ return 1;
2577
+ }
2578
+ const win = element.ownerDocument.defaultView || window;
2579
+ return win.devicePixelRatio || 1;
2580
+ }
2581
+ function roundByDPR(element, value) {
2582
+ const dpr = getDPR(element);
2583
+ return Math.round(value * dpr) / dpr;
2584
+ }
2585
+ function useLatestRef(value) {
2586
+ const ref = React13.useRef(value);
2587
+ index(() => {
2588
+ ref.current = value;
2589
+ });
2590
+ return ref;
2591
+ }
2592
+ function useFloating(options) {
2593
+ if (options === void 0) {
2594
+ options = {};
2595
+ }
2596
+ const {
2597
+ placement = "bottom",
2598
+ strategy = "absolute",
2599
+ middleware = [],
2600
+ platform: platform2,
2601
+ elements: {
2602
+ reference: externalReference,
2603
+ floating: externalFloating
2604
+ } = {},
2605
+ transform = true,
2606
+ whileElementsMounted,
2607
+ open
2608
+ } = options;
2609
+ const [data, setData] = React13.useState({
2610
+ x: 0,
2611
+ y: 0,
2612
+ strategy,
2613
+ placement,
2614
+ middlewareData: {},
2615
+ isPositioned: false
2616
+ });
2617
+ const [latestMiddleware, setLatestMiddleware] = React13.useState(middleware);
2618
+ if (!deepEqual(latestMiddleware, middleware)) {
2619
+ setLatestMiddleware(middleware);
2620
+ }
2621
+ const [_reference, _setReference] = React13.useState(null);
2622
+ const [_floating, _setFloating] = React13.useState(null);
2623
+ const setReference = React13.useCallback((node) => {
2624
+ if (node !== referenceRef.current) {
2625
+ referenceRef.current = node;
2626
+ _setReference(node);
2627
+ }
2628
+ }, []);
2629
+ const setFloating = React13.useCallback((node) => {
2630
+ if (node !== floatingRef.current) {
2631
+ floatingRef.current = node;
2632
+ _setFloating(node);
2633
+ }
2634
+ }, []);
2635
+ const referenceEl = externalReference || _reference;
2636
+ const floatingEl = externalFloating || _floating;
2637
+ const referenceRef = React13.useRef(null);
2638
+ const floatingRef = React13.useRef(null);
2639
+ const dataRef = React13.useRef(data);
2640
+ const hasWhileElementsMounted = whileElementsMounted != null;
2641
+ const whileElementsMountedRef = useLatestRef(whileElementsMounted);
2642
+ const platformRef = useLatestRef(platform2);
2643
+ const openRef = useLatestRef(open);
2644
+ const update = React13.useCallback(() => {
2645
+ if (!referenceRef.current || !floatingRef.current) {
2646
+ return;
2647
+ }
2648
+ const config = {
2649
+ placement,
2650
+ strategy,
2651
+ middleware: latestMiddleware
2652
+ };
2653
+ if (platformRef.current) {
2654
+ config.platform = platformRef.current;
2655
+ }
2656
+ computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
2657
+ const fullData = {
2658
+ ...data2,
2659
+ // The floating element's position may be recomputed while it's closed
2660
+ // but still mounted (such as when transitioning out). To ensure
2661
+ // `isPositioned` will be `false` initially on the next open, avoid
2662
+ // setting it to `true` when `open === false` (must be specified).
2663
+ isPositioned: openRef.current !== false
2664
+ };
2665
+ if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
2666
+ dataRef.current = fullData;
2667
+ ReactDOM2.flushSync(() => {
2668
+ setData(fullData);
2669
+ });
2670
+ }
2671
+ });
2672
+ }, [latestMiddleware, placement, strategy, platformRef, openRef]);
2673
+ index(() => {
2674
+ if (open === false && dataRef.current.isPositioned) {
2675
+ dataRef.current.isPositioned = false;
2676
+ setData((data2) => ({
2677
+ ...data2,
2678
+ isPositioned: false
2679
+ }));
2680
+ }
2681
+ }, [open]);
2682
+ const isMountedRef = React13.useRef(false);
2683
+ index(() => {
2684
+ isMountedRef.current = true;
2685
+ return () => {
2686
+ isMountedRef.current = false;
2687
+ };
2688
+ }, []);
2689
+ index(() => {
2690
+ if (referenceEl) referenceRef.current = referenceEl;
2691
+ if (floatingEl) floatingRef.current = floatingEl;
2692
+ if (referenceEl && floatingEl) {
2693
+ if (whileElementsMountedRef.current) {
2694
+ return whileElementsMountedRef.current(referenceEl, floatingEl, update);
2695
+ }
2696
+ update();
2697
+ }
2698
+ }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
2699
+ const refs = React13.useMemo(() => ({
2700
+ reference: referenceRef,
2701
+ floating: floatingRef,
2702
+ setReference,
2703
+ setFloating
2704
+ }), [setReference, setFloating]);
2705
+ const elements = React13.useMemo(() => ({
2706
+ reference: referenceEl,
2707
+ floating: floatingEl
2708
+ }), [referenceEl, floatingEl]);
2709
+ const floatingStyles = React13.useMemo(() => {
2710
+ const initialStyles = {
2711
+ position: strategy,
2712
+ left: 0,
2713
+ top: 0
2714
+ };
2715
+ if (!elements.floating) {
2716
+ return initialStyles;
2717
+ }
2718
+ const x = roundByDPR(elements.floating, data.x);
2719
+ const y = roundByDPR(elements.floating, data.y);
2720
+ if (transform) {
2721
+ return {
2722
+ ...initialStyles,
2723
+ transform: "translate(" + x + "px, " + y + "px)",
2724
+ ...getDPR(elements.floating) >= 1.5 && {
2725
+ willChange: "transform"
2726
+ }
2727
+ };
2728
+ }
2729
+ return {
2730
+ position: strategy,
2731
+ left: x,
2732
+ top: y
2733
+ };
2734
+ }, [strategy, transform, elements.floating, data.x, data.y]);
2735
+ return React13.useMemo(() => ({
2736
+ ...data,
2737
+ update,
2738
+ refs,
2739
+ elements,
2740
+ floatingStyles
2741
+ }), [data, update, refs, elements, floatingStyles]);
2742
+ }
2743
+ var arrow$1 = (options) => {
2744
+ function isRef(value) {
2745
+ return {}.hasOwnProperty.call(value, "current");
2746
+ }
2747
+ return {
2748
+ name: "arrow",
2749
+ options,
2750
+ fn(state) {
2751
+ const {
2752
+ element,
2753
+ padding
2754
+ } = typeof options === "function" ? options(state) : options;
2755
+ if (element && isRef(element)) {
2756
+ if (element.current != null) {
2757
+ return arrow2({
2758
+ element: element.current,
2759
+ padding
2760
+ }).fn(state);
2761
+ }
2762
+ return {};
2763
+ }
2764
+ if (element) {
2765
+ return arrow2({
2766
+ element,
2767
+ padding
2768
+ }).fn(state);
2769
+ }
2770
+ return {};
2771
+ }
2772
+ };
2773
+ };
2774
+ var offset3 = (options, deps) => ({
2775
+ ...offset2(options),
2776
+ options: [options, deps]
2777
+ });
2778
+ var shift3 = (options, deps) => ({
2779
+ ...shift2(options),
2780
+ options: [options, deps]
2781
+ });
2782
+ var limitShift3 = (options, deps) => ({
2783
+ ...limitShift2(options),
2784
+ options: [options, deps]
2785
+ });
2786
+ var flip3 = (options, deps) => ({
2787
+ ...flip2(options),
2788
+ options: [options, deps]
2789
+ });
2790
+ var size3 = (options, deps) => ({
2791
+ ...size2(options),
2792
+ options: [options, deps]
2793
+ });
2794
+ var hide3 = (options, deps) => ({
2795
+ ...hide2(options),
2796
+ options: [options, deps]
2797
+ });
2798
+ var arrow3 = (options, deps) => ({
2799
+ ...arrow$1(options),
2800
+ options: [options, deps]
2801
+ });
2802
+
2803
+ // ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@1_fbfac9ffba7da2430c67e19ffbb04d38/node_modules/@radix-ui/react-arrow/dist/index.mjs
2804
+ init_react_import();
2805
+ var React14 = __toESM(require("react"), 1);
2806
+ var import_jsx_runtime6 = require("react/jsx-runtime");
2807
+ var NAME = "Arrow";
2808
+ var Arrow = React14.forwardRef((props, forwardedRef) => {
2809
+ const { children, width = 10, height = 5, ...arrowProps } = props;
2810
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2811
+ Primitive.svg,
2812
+ {
2813
+ ...arrowProps,
2814
+ ref: forwardedRef,
2815
+ width,
2816
+ height,
2817
+ viewBox: "0 0 30 10",
2818
+ preserveAspectRatio: "none",
2819
+ children: props.asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("polygon", { points: "0,0 30,0 15,10" })
2820
+ }
2821
+ );
2822
+ });
2823
+ Arrow.displayName = NAME;
2824
+ var Root = Arrow;
2825
+
2826
+ // ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-size/dist/index.mjs
2827
+ init_react_import();
2828
+ var React15 = __toESM(require("react"), 1);
2829
+ function useSize(element) {
2830
+ const [size4, setSize] = React15.useState(void 0);
2831
+ useLayoutEffect2(() => {
2832
+ if (element) {
2833
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
2834
+ const resizeObserver = new ResizeObserver((entries) => {
2835
+ if (!Array.isArray(entries)) {
2836
+ return;
2837
+ }
2838
+ if (!entries.length) {
2839
+ return;
2840
+ }
2841
+ const entry = entries[0];
2842
+ let width;
2843
+ let height;
2844
+ if ("borderBoxSize" in entry) {
2845
+ const borderSizeEntry = entry["borderBoxSize"];
2846
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
2847
+ width = borderSize["inlineSize"];
2848
+ height = borderSize["blockSize"];
2849
+ } else {
2850
+ width = element.offsetWidth;
2851
+ height = element.offsetHeight;
2852
+ }
2853
+ setSize({ width, height });
2854
+ });
2855
+ resizeObserver.observe(element, { box: "border-box" });
2856
+ return () => resizeObserver.unobserve(element);
2857
+ } else {
2858
+ setSize(void 0);
2859
+ }
2860
+ }, [element]);
2861
+ return size4;
2862
+ }
2863
+
2864
+ // ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_a6a7fea0f37d2b2529626c9011032658/node_modules/@radix-ui/react-popper/dist/index.mjs
2865
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2866
+ var POPPER_NAME = "Popper";
2867
+ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
2868
+ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
2869
+ var Popper = (props) => {
2870
+ const { __scopePopper, children } = props;
2871
+ const [anchor, setAnchor] = React16.useState(null);
2872
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
2873
+ };
2874
+ Popper.displayName = POPPER_NAME;
2875
+ var ANCHOR_NAME = "PopperAnchor";
2876
+ var PopperAnchor = React16.forwardRef(
2877
+ (props, forwardedRef) => {
2878
+ const { __scopePopper, virtualRef, ...anchorProps } = props;
2879
+ const context = usePopperContext(ANCHOR_NAME, __scopePopper);
2880
+ const ref = React16.useRef(null);
2881
+ const composedRefs = useComposedRefs(forwardedRef, ref);
2882
+ const anchorRef = React16.useRef(null);
2883
+ React16.useEffect(() => {
2884
+ const previousAnchor = anchorRef.current;
2885
+ anchorRef.current = virtualRef?.current || ref.current;
2886
+ if (previousAnchor !== anchorRef.current) {
2887
+ context.onAnchorChange(anchorRef.current);
2888
+ }
2889
+ });
2890
+ return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.div, { ...anchorProps, ref: composedRefs });
2891
+ }
2892
+ );
2893
+ PopperAnchor.displayName = ANCHOR_NAME;
2894
+ var CONTENT_NAME = "PopperContent";
2895
+ var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
2896
+ var PopperContent = React16.forwardRef(
2897
+ (props, forwardedRef) => {
2898
+ const {
2899
+ __scopePopper,
2900
+ side = "bottom",
2901
+ sideOffset = 0,
2902
+ align = "center",
2903
+ alignOffset = 0,
2904
+ arrowPadding = 0,
2905
+ avoidCollisions = true,
2906
+ collisionBoundary = [],
2907
+ collisionPadding: collisionPaddingProp = 0,
2908
+ sticky = "partial",
2909
+ hideWhenDetached = false,
2910
+ updatePositionStrategy = "optimized",
2911
+ onPlaced,
2912
+ ...contentProps
2913
+ } = props;
2914
+ const context = usePopperContext(CONTENT_NAME, __scopePopper);
2915
+ const [content, setContent] = React16.useState(null);
2916
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
2917
+ const [arrow4, setArrow] = React16.useState(null);
2918
+ const arrowSize = useSize(arrow4);
2919
+ const arrowWidth = arrowSize?.width ?? 0;
2920
+ const arrowHeight = arrowSize?.height ?? 0;
2921
+ const desiredPlacement = side + (align !== "center" ? "-" + align : "");
2922
+ const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
2923
+ const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
2924
+ const hasExplicitBoundaries = boundary.length > 0;
2925
+ const detectOverflowOptions = {
2926
+ padding: collisionPadding,
2927
+ boundary: boundary.filter(isNotNull),
2928
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2929
+ altBoundary: hasExplicitBoundaries
2930
+ };
2931
+ const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
2932
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2933
+ strategy: "fixed",
2934
+ placement: desiredPlacement,
2935
+ whileElementsMounted: (...args) => {
2936
+ const cleanup = autoUpdate(...args, {
2937
+ animationFrame: updatePositionStrategy === "always"
2938
+ });
2939
+ return cleanup;
2940
+ },
2941
+ elements: {
2942
+ reference: context.anchor
2943
+ },
2944
+ middleware: [
2945
+ offset3({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
2946
+ avoidCollisions && shift3({
2947
+ mainAxis: true,
2948
+ crossAxis: false,
2949
+ limiter: sticky === "partial" ? limitShift3() : void 0,
2950
+ ...detectOverflowOptions
2951
+ }),
2952
+ avoidCollisions && flip3({ ...detectOverflowOptions }),
2953
+ size3({
2954
+ ...detectOverflowOptions,
2955
+ apply: ({ elements, rects, availableWidth, availableHeight }) => {
2956
+ const { width: anchorWidth, height: anchorHeight } = rects.reference;
2957
+ const contentStyle = elements.floating.style;
2958
+ contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
2959
+ contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
2960
+ contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
2961
+ contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
2962
+ }
2963
+ }),
2964
+ arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
2965
+ transformOrigin({ arrowWidth, arrowHeight }),
2966
+ hideWhenDetached && hide3({ strategy: "referenceHidden", ...detectOverflowOptions })
2967
+ ]
2968
+ });
2969
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
2970
+ const handlePlaced = useCallbackRef(onPlaced);
2971
+ useLayoutEffect2(() => {
2972
+ if (isPositioned) {
2973
+ handlePlaced?.();
2974
+ }
2975
+ }, [isPositioned, handlePlaced]);
2976
+ const arrowX = middlewareData.arrow?.x;
2977
+ const arrowY = middlewareData.arrow?.y;
2978
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
2979
+ const [contentZIndex, setContentZIndex] = React16.useState();
2980
+ useLayoutEffect2(() => {
2981
+ if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
2982
+ }, [content]);
2983
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2984
+ "div",
2985
+ {
2986
+ ref: refs.setFloating,
2987
+ "data-radix-popper-content-wrapper": "",
2988
+ style: {
2989
+ ...floatingStyles,
2990
+ transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
2991
+ // keep off the page when measuring
2992
+ minWidth: "max-content",
2993
+ zIndex: contentZIndex,
2994
+ ["--radix-popper-transform-origin"]: [
2995
+ middlewareData.transformOrigin?.x,
2996
+ middlewareData.transformOrigin?.y
2997
+ ].join(" "),
2998
+ // hide the content if using the hide middleware and should be hidden
2999
+ // set visibility to hidden and disable pointer events so the UI behaves
3000
+ // as if the PopperContent isn't there at all
3001
+ ...middlewareData.hide?.referenceHidden && {
3002
+ visibility: "hidden",
3003
+ pointerEvents: "none"
3004
+ }
3005
+ },
3006
+ dir: props.dir,
3007
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3008
+ PopperContentProvider,
3009
+ {
3010
+ scope: __scopePopper,
3011
+ placedSide,
3012
+ onArrowChange: setArrow,
3013
+ arrowX,
3014
+ arrowY,
3015
+ shouldHideArrow: cannotCenterArrow,
3016
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3017
+ Primitive.div,
3018
+ {
3019
+ "data-side": placedSide,
3020
+ "data-align": placedAlign,
3021
+ ...contentProps,
3022
+ ref: composedRefs,
3023
+ style: {
3024
+ ...contentProps.style,
3025
+ // if the PopperContent hasn't been placed yet (not all measurements done)
3026
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
3027
+ animation: !isPositioned ? "none" : void 0
3028
+ }
3029
+ }
3030
+ )
3031
+ }
3032
+ )
3033
+ }
3034
+ );
3035
+ }
3036
+ );
3037
+ PopperContent.displayName = CONTENT_NAME;
3038
+ var ARROW_NAME = "PopperArrow";
3039
+ var OPPOSITE_SIDE = {
3040
+ top: "bottom",
3041
+ right: "left",
3042
+ bottom: "top",
3043
+ left: "right"
3044
+ };
3045
+ var PopperArrow = React16.forwardRef(function PopperArrow2(props, forwardedRef) {
3046
+ const { __scopePopper, ...arrowProps } = props;
3047
+ const contentContext = useContentContext(ARROW_NAME, __scopePopper);
3048
+ const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
3049
+ return (
3050
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
3051
+ // doesn't report size as we'd expect on SVG elements.
3052
+ // it reports their bounding box which is effectively the largest path inside the SVG.
3053
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3054
+ "span",
3055
+ {
3056
+ ref: contentContext.onArrowChange,
3057
+ style: {
3058
+ position: "absolute",
3059
+ left: contentContext.arrowX,
3060
+ top: contentContext.arrowY,
3061
+ [baseSide]: 0,
3062
+ transformOrigin: {
3063
+ top: "",
3064
+ right: "0 0",
3065
+ bottom: "center 0",
3066
+ left: "100% 0"
3067
+ }[contentContext.placedSide],
3068
+ transform: {
3069
+ top: "translateY(100%)",
3070
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
3071
+ bottom: `rotate(180deg)`,
3072
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
3073
+ }[contentContext.placedSide],
3074
+ visibility: contentContext.shouldHideArrow ? "hidden" : void 0
3075
+ },
3076
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3077
+ Root,
3078
+ {
3079
+ ...arrowProps,
3080
+ ref: forwardedRef,
3081
+ style: {
3082
+ ...arrowProps.style,
3083
+ // ensures the element can be measured correctly (mostly for if SVG)
3084
+ display: "block"
3085
+ }
3086
+ }
3087
+ )
3088
+ }
3089
+ )
3090
+ );
3091
+ });
3092
+ PopperArrow.displayName = ARROW_NAME;
3093
+ function isNotNull(value) {
3094
+ return value !== null;
3095
+ }
3096
+ var transformOrigin = (options) => ({
3097
+ name: "transformOrigin",
3098
+ options,
3099
+ fn(data) {
3100
+ const { placement, rects, middlewareData } = data;
3101
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
3102
+ const isArrowHidden = cannotCenterArrow;
3103
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
3104
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
3105
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
3106
+ const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
3107
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
3108
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
3109
+ let x = "";
3110
+ let y = "";
3111
+ if (placedSide === "bottom") {
3112
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
3113
+ y = `${-arrowHeight}px`;
3114
+ } else if (placedSide === "top") {
3115
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
3116
+ y = `${rects.floating.height + arrowHeight}px`;
3117
+ } else if (placedSide === "right") {
3118
+ x = `${-arrowHeight}px`;
3119
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
3120
+ } else if (placedSide === "left") {
3121
+ x = `${rects.floating.width + arrowHeight}px`;
3122
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
3123
+ }
3124
+ return { data: { x, y } };
3125
+ }
3126
+ });
3127
+ function getSideAndAlignFromPlacement(placement) {
3128
+ const [side, align = "center"] = placement.split("-");
3129
+ return [side, align];
3130
+ }
3131
+ var Root2 = Popper;
3132
+ var Anchor = PopperAnchor;
3133
+ var Content = PopperContent;
3134
+ var Arrow2 = PopperArrow;
3135
+
3136
+ // ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.0_@types+react@19.2.0__@types+react@_d5762485d50ad8dfa8cb627e2e59c867/node_modules/@radix-ui/react-portal/dist/index.mjs
3137
+ init_react_import();
3138
+ var React17 = __toESM(require("react"), 1);
3139
+ var import_react_dom2 = __toESM(require("react-dom"), 1);
3140
+ var import_jsx_runtime8 = require("react/jsx-runtime");
3141
+ var PORTAL_NAME = "Portal";
3142
+ var Portal = React17.forwardRef((props, forwardedRef) => {
3143
+ const { container: containerProp, ...portalProps } = props;
3144
+ const [mounted, setMounted] = React17.useState(false);
3145
+ useLayoutEffect2(() => setMounted(true), []);
3146
+ const container = containerProp || mounted && globalThis?.document?.body;
3147
+ return container ? import_react_dom2.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
3148
+ });
3149
+ Portal.displayName = PORTAL_NAME;
3150
+
3151
+ // ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_2bd60694cdd2d52fd7a4d143c1d68333/node_modules/@radix-ui/react-presence/dist/index.mjs
3152
+ init_react_import();
3153
+ var React22 = __toESM(require("react"), 1);
3154
+ var React18 = __toESM(require("react"), 1);
3155
+ function useStateMachine(initialState, machine) {
3156
+ return React18.useReducer((state, event) => {
3157
+ const nextState = machine[state][event];
3158
+ return nextState ?? state;
3159
+ }, initialState);
3160
+ }
3161
+ var Presence = (props) => {
3162
+ const { present, children } = props;
3163
+ const presence = usePresence(present);
3164
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
3165
+ const ref = useComposedRefs(presence.ref, getElementRef2(child));
3166
+ const forceMount = typeof children === "function";
3167
+ return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
3168
+ };
3169
+ Presence.displayName = "Presence";
3170
+ function usePresence(present) {
3171
+ const [node, setNode] = React22.useState();
3172
+ const stylesRef = React22.useRef(null);
3173
+ const prevPresentRef = React22.useRef(present);
3174
+ const prevAnimationNameRef = React22.useRef("none");
3175
+ const initialState = present ? "mounted" : "unmounted";
3176
+ const [state, send] = useStateMachine(initialState, {
3177
+ mounted: {
3178
+ UNMOUNT: "unmounted",
3179
+ ANIMATION_OUT: "unmountSuspended"
3180
+ },
3181
+ unmountSuspended: {
3182
+ MOUNT: "mounted",
3183
+ ANIMATION_END: "unmounted"
3184
+ },
3185
+ unmounted: {
3186
+ MOUNT: "mounted"
3187
+ }
3188
+ });
3189
+ React22.useEffect(() => {
3190
+ const currentAnimationName = getAnimationName(stylesRef.current);
3191
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
3192
+ }, [state]);
3193
+ useLayoutEffect2(() => {
3194
+ const styles = stylesRef.current;
3195
+ const wasPresent = prevPresentRef.current;
3196
+ const hasPresentChanged = wasPresent !== present;
3197
+ if (hasPresentChanged) {
3198
+ const prevAnimationName = prevAnimationNameRef.current;
3199
+ const currentAnimationName = getAnimationName(styles);
3200
+ if (present) {
3201
+ send("MOUNT");
3202
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
3203
+ send("UNMOUNT");
3204
+ } else {
3205
+ const isAnimating = prevAnimationName !== currentAnimationName;
3206
+ if (wasPresent && isAnimating) {
3207
+ send("ANIMATION_OUT");
3208
+ } else {
3209
+ send("UNMOUNT");
3210
+ }
3211
+ }
3212
+ prevPresentRef.current = present;
3213
+ }
3214
+ }, [present, send]);
3215
+ useLayoutEffect2(() => {
3216
+ if (node) {
3217
+ let timeoutId;
3218
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
3219
+ const handleAnimationEnd = (event) => {
3220
+ const currentAnimationName = getAnimationName(stylesRef.current);
3221
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
3222
+ if (event.target === node && isCurrentAnimation) {
3223
+ send("ANIMATION_END");
3224
+ if (!prevPresentRef.current) {
3225
+ const currentFillMode = node.style.animationFillMode;
3226
+ node.style.animationFillMode = "forwards";
3227
+ timeoutId = ownerWindow.setTimeout(() => {
3228
+ if (node.style.animationFillMode === "forwards") {
3229
+ node.style.animationFillMode = currentFillMode;
3230
+ }
3231
+ });
3232
+ }
3233
+ }
3234
+ };
3235
+ const handleAnimationStart = (event) => {
3236
+ if (event.target === node) {
3237
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
3238
+ }
3239
+ };
3240
+ node.addEventListener("animationstart", handleAnimationStart);
3241
+ node.addEventListener("animationcancel", handleAnimationEnd);
3242
+ node.addEventListener("animationend", handleAnimationEnd);
3243
+ return () => {
3244
+ ownerWindow.clearTimeout(timeoutId);
3245
+ node.removeEventListener("animationstart", handleAnimationStart);
3246
+ node.removeEventListener("animationcancel", handleAnimationEnd);
3247
+ node.removeEventListener("animationend", handleAnimationEnd);
3248
+ };
3249
+ } else {
3250
+ send("ANIMATION_END");
3251
+ }
3252
+ }, [node, send]);
3253
+ return {
3254
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
3255
+ ref: React22.useCallback((node2) => {
3256
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
3257
+ setNode(node2);
3258
+ }, [])
3259
+ };
3260
+ }
3261
+ function getAnimationName(styles) {
3262
+ return styles?.animationName || "none";
3263
+ }
3264
+ function getElementRef2(element) {
3265
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
3266
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3267
+ if (mayWarn) {
3268
+ return element.ref;
3269
+ }
3270
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
3271
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3272
+ if (mayWarn) {
3273
+ return element.props.ref;
3274
+ }
3275
+ return element.props.ref || element.ref;
3276
+ }
3277
+
3278
+ // ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.0_react@19.2.8/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
3279
+ init_react_import();
3280
+ var React19 = __toESM(require("react"), 1);
3281
+ var React23 = __toESM(require("react"), 1);
3282
+ var useInsertionEffect = React19[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
3283
+ function useControllableState({
3284
+ prop,
3285
+ defaultProp,
3286
+ onChange = () => {
3287
+ },
3288
+ caller
3289
+ }) {
3290
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
3291
+ defaultProp,
3292
+ onChange
3293
+ });
3294
+ const isControlled = prop !== void 0;
3295
+ const value = isControlled ? prop : uncontrolledProp;
3296
+ if (true) {
3297
+ const isControlledRef = React19.useRef(prop !== void 0);
3298
+ React19.useEffect(() => {
3299
+ const wasControlled = isControlledRef.current;
3300
+ if (wasControlled !== isControlled) {
3301
+ const from = wasControlled ? "controlled" : "uncontrolled";
3302
+ const to = isControlled ? "controlled" : "uncontrolled";
3303
+ console.warn(
3304
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
3305
+ );
3306
+ }
3307
+ isControlledRef.current = isControlled;
3308
+ }, [isControlled, caller]);
3309
+ }
3310
+ const setValue = React19.useCallback(
3311
+ (nextValue) => {
3312
+ if (isControlled) {
3313
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
3314
+ if (value2 !== prop) {
3315
+ onChangeRef.current?.(value2);
3316
+ }
3317
+ } else {
3318
+ setUncontrolledProp(nextValue);
3319
+ }
3320
+ },
3321
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
3322
+ );
3323
+ return [value, setValue];
3324
+ }
3325
+ function useUncontrolledState({
3326
+ defaultProp,
3327
+ onChange
3328
+ }) {
3329
+ const [value, setValue] = React19.useState(defaultProp);
3330
+ const prevValueRef = React19.useRef(value);
3331
+ const onChangeRef = React19.useRef(onChange);
3332
+ useInsertionEffect(() => {
3333
+ onChangeRef.current = onChange;
3334
+ }, [onChange]);
3335
+ React19.useEffect(() => {
3336
+ if (prevValueRef.current !== value) {
3337
+ onChangeRef.current?.(value);
3338
+ prevValueRef.current = value;
3339
+ }
3340
+ }, [value, prevValueRef]);
3341
+ return [value, setValue, onChangeRef];
3342
+ }
3343
+ function isFunction(value) {
3344
+ return typeof value === "function";
3345
+ }
3346
+ var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
3347
+
3348
+ // ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
3349
+ init_react_import();
3350
+ var getDefaultParent = function(originalTarget) {
3351
+ if (typeof document === "undefined") {
3352
+ return null;
3353
+ }
3354
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
3355
+ return sampleTarget.ownerDocument.body;
3356
+ };
3357
+ var counterMap = /* @__PURE__ */ new WeakMap();
3358
+ var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
3359
+ var markerMap = {};
3360
+ var lockCount = 0;
3361
+ var unwrapHost = function(node) {
3362
+ return node && (node.host || unwrapHost(node.parentNode));
3363
+ };
3364
+ var correctTargets = function(parent, targets) {
3365
+ return targets.map(function(target) {
3366
+ if (parent.contains(target)) {
3367
+ return target;
3368
+ }
3369
+ var correctedTarget = unwrapHost(target);
3370
+ if (correctedTarget && parent.contains(correctedTarget)) {
3371
+ return correctedTarget;
3372
+ }
3373
+ console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
3374
+ return null;
3375
+ }).filter(function(x) {
3376
+ return Boolean(x);
3377
+ });
3378
+ };
3379
+ var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
3380
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
3381
+ if (!markerMap[markerName]) {
3382
+ markerMap[markerName] = /* @__PURE__ */ new WeakMap();
3383
+ }
3384
+ var markerCounter = markerMap[markerName];
3385
+ var hiddenNodes = [];
3386
+ var elementsToKeep = /* @__PURE__ */ new Set();
3387
+ var elementsToStop = new Set(targets);
3388
+ var keep = function(el) {
3389
+ if (!el || elementsToKeep.has(el)) {
3390
+ return;
3391
+ }
3392
+ elementsToKeep.add(el);
3393
+ keep(el.parentNode);
3394
+ };
3395
+ targets.forEach(keep);
3396
+ var deep = function(parent) {
3397
+ if (!parent || elementsToStop.has(parent)) {
3398
+ return;
3399
+ }
3400
+ Array.prototype.forEach.call(parent.children, function(node) {
3401
+ if (elementsToKeep.has(node)) {
3402
+ deep(node);
3403
+ } else {
3404
+ try {
3405
+ var attr = node.getAttribute(controlAttribute);
3406
+ var alreadyHidden = attr !== null && attr !== "false";
3407
+ var counterValue = (counterMap.get(node) || 0) + 1;
3408
+ var markerValue = (markerCounter.get(node) || 0) + 1;
3409
+ counterMap.set(node, counterValue);
3410
+ markerCounter.set(node, markerValue);
3411
+ hiddenNodes.push(node);
3412
+ if (counterValue === 1 && alreadyHidden) {
3413
+ uncontrolledNodes.set(node, true);
3414
+ }
3415
+ if (markerValue === 1) {
3416
+ node.setAttribute(markerName, "true");
3417
+ }
3418
+ if (!alreadyHidden) {
3419
+ node.setAttribute(controlAttribute, "true");
3420
+ }
3421
+ } catch (e) {
3422
+ console.error("aria-hidden: cannot operate on ", node, e);
3423
+ }
3424
+ }
3425
+ });
3426
+ };
3427
+ deep(parentNode);
3428
+ elementsToKeep.clear();
3429
+ lockCount++;
3430
+ return function() {
3431
+ hiddenNodes.forEach(function(node) {
3432
+ var counterValue = counterMap.get(node) - 1;
3433
+ var markerValue = markerCounter.get(node) - 1;
3434
+ counterMap.set(node, counterValue);
3435
+ markerCounter.set(node, markerValue);
3436
+ if (!counterValue) {
3437
+ if (!uncontrolledNodes.has(node)) {
3438
+ node.removeAttribute(controlAttribute);
3439
+ }
3440
+ uncontrolledNodes.delete(node);
3441
+ }
3442
+ if (!markerValue) {
3443
+ node.removeAttribute(markerName);
3444
+ }
3445
+ });
3446
+ lockCount--;
3447
+ if (!lockCount) {
3448
+ counterMap = /* @__PURE__ */ new WeakMap();
3449
+ counterMap = /* @__PURE__ */ new WeakMap();
3450
+ uncontrolledNodes = /* @__PURE__ */ new WeakMap();
3451
+ markerMap = {};
3452
+ }
3453
+ };
3454
+ };
3455
+ var hideOthers = function(originalTarget, parentNode, markerName) {
3456
+ if (markerName === void 0) {
3457
+ markerName = "data-aria-hidden";
3458
+ }
3459
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
3460
+ var activeParentNode = parentNode || getDefaultParent(originalTarget);
3461
+ if (!activeParentNode) {
3462
+ return function() {
3463
+ return null;
3464
+ };
3465
+ }
3466
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
3467
+ return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
3468
+ };
3469
+
3470
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/index.js
3471
+ init_react_import();
3472
+
3473
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
3474
+ init_react_import();
3475
+
3476
+ // ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
3477
+ init_react_import();
3478
+ var __assign = function() {
3479
+ __assign = Object.assign || function __assign2(t) {
3480
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3481
+ s = arguments[i];
3482
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3483
+ }
3484
+ return t;
3485
+ };
3486
+ return __assign.apply(this, arguments);
3487
+ };
3488
+ function __rest(s, e) {
3489
+ var t = {};
3490
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3491
+ t[p] = s[p];
3492
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
3493
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3494
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3495
+ t[p[i]] = s[p[i]];
3496
+ }
3497
+ return t;
3498
+ }
3499
+ function __spreadArray(to, from, pack) {
3500
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3501
+ if (ar || !(i in from)) {
3502
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3503
+ ar[i] = from[i];
3504
+ }
3505
+ }
3506
+ return to.concat(ar || Array.prototype.slice.call(from));
3507
+ }
3508
+
3509
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
3510
+ var React28 = __toESM(require("react"));
3511
+
3512
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/UI.js
3513
+ init_react_import();
3514
+ var React24 = __toESM(require("react"));
3515
+
3516
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
3517
+ init_react_import();
3518
+ var zeroRightClassName = "right-scroll-bar-position";
3519
+ var fullWidthClassName = "width-before-scroll-bar";
3520
+ var noScrollbarsClassName = "with-scroll-bars-hidden";
3521
+ var removedBarSizeVariable = "--removed-body-scroll-bar-size";
3522
+
3523
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/index.js
3524
+ init_react_import();
3525
+
3526
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/assignRef.js
3527
+ init_react_import();
3528
+ function assignRef(ref, value) {
3529
+ if (typeof ref === "function") {
3530
+ ref(value);
3531
+ } else if (ref) {
3532
+ ref.current = value;
3533
+ }
3534
+ return ref;
3535
+ }
3536
+
3537
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useRef.js
3538
+ init_react_import();
3539
+ var import_react4 = require("react");
3540
+ function useCallbackRef2(initialValue, callback) {
3541
+ var ref = (0, import_react4.useState)(function() {
3542
+ return {
3543
+ // value
3544
+ value: initialValue,
3545
+ // last callback
3546
+ callback,
3547
+ // "memoized" public interface
3548
+ facade: {
3549
+ get current() {
3550
+ return ref.value;
3551
+ },
3552
+ set current(value) {
3553
+ var last = ref.value;
3554
+ if (last !== value) {
3555
+ ref.value = value;
3556
+ ref.callback(value, last);
3557
+ }
3558
+ }
3559
+ }
3560
+ };
3561
+ })[0];
3562
+ ref.callback = callback;
3563
+ return ref.facade;
3564
+ }
3565
+
3566
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
3567
+ init_react_import();
3568
+ var React20 = __toESM(require("react"));
3569
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React20.useLayoutEffect : React20.useEffect;
3570
+ var currentValues = /* @__PURE__ */ new WeakMap();
3571
+ function useMergeRefs(refs, defaultValue) {
3572
+ var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
3573
+ return refs.forEach(function(ref) {
3574
+ return assignRef(ref, newValue);
3575
+ });
3576
+ });
3577
+ useIsomorphicLayoutEffect(function() {
3578
+ var oldValue = currentValues.get(callbackRef);
3579
+ if (oldValue) {
3580
+ var prevRefs_1 = new Set(oldValue);
3581
+ var nextRefs_1 = new Set(refs);
3582
+ var current_1 = callbackRef.current;
3583
+ prevRefs_1.forEach(function(ref) {
3584
+ if (!nextRefs_1.has(ref)) {
3585
+ assignRef(ref, null);
3586
+ }
3587
+ });
3588
+ nextRefs_1.forEach(function(ref) {
3589
+ if (!prevRefs_1.has(ref)) {
3590
+ assignRef(ref, current_1);
3591
+ }
3592
+ });
3593
+ }
3594
+ currentValues.set(callbackRef, refs);
3595
+ }, [refs]);
3596
+ return callbackRef;
3597
+ }
3598
+
3599
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/medium.js
3600
+ init_react_import();
3601
+
3602
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/index.js
3603
+ init_react_import();
3604
+
3605
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/medium.js
3606
+ init_react_import();
3607
+ function ItoI(a) {
3608
+ return a;
3609
+ }
3610
+ function innerCreateMedium(defaults, middleware) {
3611
+ if (middleware === void 0) {
3612
+ middleware = ItoI;
3613
+ }
3614
+ var buffer = [];
3615
+ var assigned = false;
3616
+ var medium = {
3617
+ read: function() {
3618
+ if (assigned) {
3619
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
3620
+ }
3621
+ if (buffer.length) {
3622
+ return buffer[buffer.length - 1];
3623
+ }
3624
+ return defaults;
3625
+ },
3626
+ useMedium: function(data) {
3627
+ var item = middleware(data, assigned);
3628
+ buffer.push(item);
3629
+ return function() {
3630
+ buffer = buffer.filter(function(x) {
3631
+ return x !== item;
3632
+ });
3633
+ };
3634
+ },
3635
+ assignSyncMedium: function(cb) {
3636
+ assigned = true;
3637
+ while (buffer.length) {
3638
+ var cbs = buffer;
3639
+ buffer = [];
3640
+ cbs.forEach(cb);
3641
+ }
3642
+ buffer = {
3643
+ push: function(x) {
3644
+ return cb(x);
3645
+ },
3646
+ filter: function() {
3647
+ return buffer;
3648
+ }
3649
+ };
3650
+ },
3651
+ assignMedium: function(cb) {
3652
+ assigned = true;
3653
+ var pendingQueue = [];
3654
+ if (buffer.length) {
3655
+ var cbs = buffer;
3656
+ buffer = [];
3657
+ cbs.forEach(cb);
3658
+ pendingQueue = buffer;
3659
+ }
3660
+ var executeQueue = function() {
3661
+ var cbs2 = pendingQueue;
3662
+ pendingQueue = [];
3663
+ cbs2.forEach(cb);
3664
+ };
3665
+ var cycle = function() {
3666
+ return Promise.resolve().then(executeQueue);
3667
+ };
3668
+ cycle();
3669
+ buffer = {
3670
+ push: function(x) {
3671
+ pendingQueue.push(x);
3672
+ cycle();
3673
+ },
3674
+ filter: function(filter) {
3675
+ pendingQueue = pendingQueue.filter(filter);
3676
+ return buffer;
3677
+ }
3678
+ };
3679
+ }
3680
+ };
3681
+ return medium;
3682
+ }
3683
+ function createSidecarMedium(options) {
3684
+ if (options === void 0) {
3685
+ options = {};
3686
+ }
3687
+ var medium = innerCreateMedium(null);
3688
+ medium.options = __assign({ async: true, ssr: false }, options);
3689
+ return medium;
3690
+ }
3691
+
3692
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.0_react@19.2.8/node_modules/use-sidecar/dist/es2015/exports.js
3693
+ init_react_import();
3694
+ var React21 = __toESM(require("react"));
3695
+ var SideCar = function(_a) {
3696
+ var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
3697
+ if (!sideCar) {
3698
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
3699
+ }
3700
+ var Target = sideCar.read();
3701
+ if (!Target) {
3702
+ throw new Error("Sidecar medium not found");
3703
+ }
3704
+ return React21.createElement(Target, __assign({}, rest));
3705
+ };
3706
+ SideCar.isSideCarExport = true;
3707
+ function exportSidecar(medium, exported) {
3708
+ medium.useMedium(exported);
3709
+ return SideCar;
3710
+ }
3711
+
3712
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/medium.js
3713
+ var effectCar = createSidecarMedium();
3714
+
3715
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/UI.js
3716
+ var nothing = function() {
3717
+ return;
3718
+ };
3719
+ var RemoveScroll = React24.forwardRef(function(props, parentRef) {
3720
+ var ref = React24.useRef(null);
3721
+ var _a = React24.useState({
3722
+ onScrollCapture: nothing,
3723
+ onWheelCapture: nothing,
3724
+ onTouchMoveCapture: nothing
3725
+ }), callbacks = _a[0], setCallbacks = _a[1];
3726
+ 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, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
3727
+ var SideCar2 = sideCar;
3728
+ var containerRef = useMergeRefs([ref, parentRef]);
3729
+ var containerProps = __assign(__assign({}, rest), callbacks);
3730
+ return React24.createElement(
3731
+ React24.Fragment,
3732
+ null,
3733
+ enabled && React24.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
3734
+ forwardProps ? React24.cloneElement(React24.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React24.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
3735
+ );
3736
+ });
3737
+ RemoveScroll.defaultProps = {
3738
+ enabled: true,
3739
+ removeScrollBar: true,
3740
+ inert: false
3741
+ };
3742
+ RemoveScroll.classNames = {
3743
+ fullWidth: fullWidthClassName,
3744
+ zeroRight: zeroRightClassName
3745
+ };
3746
+
3747
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/sidecar.js
3748
+ init_react_import();
3749
+
3750
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
3751
+ init_react_import();
3752
+ var React27 = __toESM(require("react"));
3753
+
3754
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/index.js
3755
+ init_react_import();
3756
+
3757
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/component.js
3758
+ init_react_import();
3759
+ var React26 = __toESM(require("react"));
3760
+
3761
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/index.js
3762
+ init_react_import();
3763
+
3764
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/component.js
3765
+ init_react_import();
3766
+
3767
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/hook.js
3768
+ init_react_import();
3769
+ var React25 = __toESM(require("react"));
3770
+
3771
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/singleton.js
3772
+ init_react_import();
3773
+
3774
+ // ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
3775
+ init_react_import();
3776
+ var currentNonce;
3777
+ var getNonce = function() {
3778
+ if (currentNonce) {
3779
+ return currentNonce;
3780
+ }
3781
+ if (typeof __webpack_nonce__ !== "undefined") {
3782
+ return __webpack_nonce__;
3783
+ }
3784
+ return void 0;
3785
+ };
3786
+
3787
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/singleton.js
3788
+ function makeStyleTag() {
3789
+ if (!document)
3790
+ return null;
3791
+ var tag = document.createElement("style");
3792
+ tag.type = "text/css";
3793
+ var nonce = getNonce();
3794
+ if (nonce) {
3795
+ tag.setAttribute("nonce", nonce);
3796
+ }
3797
+ return tag;
3798
+ }
3799
+ function injectStyles(tag, css) {
3800
+ if (tag.styleSheet) {
3801
+ tag.styleSheet.cssText = css;
3802
+ } else {
3803
+ tag.appendChild(document.createTextNode(css));
3804
+ }
3805
+ }
3806
+ function insertStyleTag(tag) {
3807
+ var head = document.head || document.getElementsByTagName("head")[0];
3808
+ head.appendChild(tag);
3809
+ }
3810
+ var stylesheetSingleton = function() {
3811
+ var counter = 0;
3812
+ var stylesheet = null;
3813
+ return {
3814
+ add: function(style) {
3815
+ if (counter == 0) {
3816
+ if (stylesheet = makeStyleTag()) {
3817
+ injectStyles(stylesheet, style);
3818
+ insertStyleTag(stylesheet);
3819
+ }
3820
+ }
3821
+ counter++;
3822
+ },
3823
+ remove: function() {
3824
+ counter--;
3825
+ if (!counter && stylesheet) {
3826
+ stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
3827
+ stylesheet = null;
3828
+ }
3829
+ }
3830
+ };
3831
+ };
3832
+
3833
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/hook.js
3834
+ var styleHookSingleton = function() {
3835
+ var sheet = stylesheetSingleton();
3836
+ return function(styles, isDynamic) {
3837
+ React25.useEffect(function() {
3838
+ sheet.add(styles);
3839
+ return function() {
3840
+ sheet.remove();
3841
+ };
3842
+ }, [styles && isDynamic]);
3843
+ };
3844
+ };
3845
+
3846
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.0_react@19.2.8/node_modules/react-style-singleton/dist/es2015/component.js
3847
+ var styleSingleton = function() {
3848
+ var useStyle = styleHookSingleton();
3849
+ var Sheet = function(_a) {
3850
+ var styles = _a.styles, dynamic = _a.dynamic;
3851
+ useStyle(styles, dynamic);
3852
+ return null;
3853
+ };
3854
+ return Sheet;
3855
+ };
3856
+
3857
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
3858
+ init_react_import();
3859
+ var zeroGap = {
3860
+ left: 0,
3861
+ top: 0,
3862
+ right: 0,
3863
+ gap: 0
3864
+ };
3865
+ var parse = function(x) {
3866
+ return parseInt(x || "", 10) || 0;
3867
+ };
3868
+ var getOffset = function(gapMode) {
3869
+ var cs = window.getComputedStyle(document.body);
3870
+ var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
3871
+ var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
3872
+ var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
3873
+ return [parse(left), parse(top), parse(right)];
3874
+ };
3875
+ var getGapWidth = function(gapMode) {
3876
+ if (gapMode === void 0) {
3877
+ gapMode = "margin";
3878
+ }
3879
+ if (typeof window === "undefined") {
3880
+ return zeroGap;
3881
+ }
3882
+ var offsets = getOffset(gapMode);
3883
+ var documentWidth = document.documentElement.clientWidth;
3884
+ var windowWidth = window.innerWidth;
3885
+ return {
3886
+ left: offsets[0],
3887
+ top: offsets[1],
3888
+ right: offsets[2],
3889
+ gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
3890
+ };
3891
+ };
3892
+
3893
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll-bar/dist/es2015/component.js
3894
+ var Style = styleSingleton();
3895
+ var lockAttribute = "data-scroll-locked";
3896
+ var getStyles = function(_a, allowRelative, gapMode, important) {
3897
+ var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
3898
+ if (gapMode === void 0) {
3899
+ gapMode = "margin";
3900
+ }
3901
+ 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([
3902
+ allowRelative && "position: relative ".concat(important, ";"),
3903
+ 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 "),
3904
+ gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
3905
+ ].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");
3906
+ };
3907
+ var getCurrentUseCounter = function() {
3908
+ var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
3909
+ return isFinite(counter) ? counter : 0;
3910
+ };
3911
+ var useLockAttribute = function() {
3912
+ React26.useEffect(function() {
3913
+ document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
3914
+ return function() {
3915
+ var newCounter = getCurrentUseCounter() - 1;
3916
+ if (newCounter <= 0) {
3917
+ document.body.removeAttribute(lockAttribute);
3918
+ } else {
3919
+ document.body.setAttribute(lockAttribute, newCounter.toString());
3920
+ }
3921
+ };
3922
+ }, []);
3923
+ };
3924
+ var RemoveScrollBar = function(_a) {
3925
+ var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
3926
+ useLockAttribute();
3927
+ var gap = React26.useMemo(function() {
3928
+ return getGapWidth(gapMode);
3929
+ }, [gapMode]);
3930
+ return React26.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
3931
+ };
3932
+
3933
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
3934
+ init_react_import();
3935
+ var passiveSupported = false;
3936
+ if (typeof window !== "undefined") {
3937
+ try {
3938
+ options = Object.defineProperty({}, "passive", {
3939
+ get: function() {
3940
+ passiveSupported = true;
3941
+ return true;
3942
+ }
3943
+ });
3944
+ window.addEventListener("test", options, options);
3945
+ window.removeEventListener("test", options, options);
3946
+ } catch (err) {
3947
+ passiveSupported = false;
3948
+ }
3949
+ }
3950
+ var options;
3951
+ var nonPassive = passiveSupported ? { passive: false } : false;
3952
+
3953
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
3954
+ init_react_import();
3955
+ var alwaysContainsScroll = function(node) {
3956
+ return node.tagName === "TEXTAREA";
3957
+ };
3958
+ var elementCanBeScrolled = function(node, overflow) {
3959
+ if (!(node instanceof Element)) {
3960
+ return false;
3961
+ }
3962
+ var styles = window.getComputedStyle(node);
3963
+ return (
3964
+ // not-not-scrollable
3965
+ styles[overflow] !== "hidden" && // contains scroll inside self
3966
+ !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
3967
+ );
3968
+ };
3969
+ var elementCouldBeVScrolled = function(node) {
3970
+ return elementCanBeScrolled(node, "overflowY");
3971
+ };
3972
+ var elementCouldBeHScrolled = function(node) {
3973
+ return elementCanBeScrolled(node, "overflowX");
3974
+ };
3975
+ var locationCouldBeScrolled = function(axis, node) {
3976
+ var ownerDocument = node.ownerDocument;
3977
+ var current = node;
3978
+ do {
3979
+ if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
3980
+ current = current.host;
3981
+ }
3982
+ var isScrollable = elementCouldBeScrolled(axis, current);
3983
+ if (isScrollable) {
3984
+ var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
3985
+ if (scrollHeight > clientHeight) {
3986
+ return true;
3987
+ }
3988
+ }
3989
+ current = current.parentNode;
3990
+ } while (current && current !== ownerDocument.body);
3991
+ return false;
3992
+ };
3993
+ var getVScrollVariables = function(_a) {
3994
+ var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
3995
+ return [
3996
+ scrollTop,
3997
+ scrollHeight,
3998
+ clientHeight
3999
+ ];
4000
+ };
4001
+ var getHScrollVariables = function(_a) {
4002
+ var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
4003
+ return [
4004
+ scrollLeft,
4005
+ scrollWidth,
4006
+ clientWidth
4007
+ ];
4008
+ };
4009
+ var elementCouldBeScrolled = function(axis, node) {
4010
+ return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
4011
+ };
4012
+ var getScrollVariables = function(axis, node) {
4013
+ return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
4014
+ };
4015
+ var getDirectionFactor = function(axis, direction) {
4016
+ return axis === "h" && direction === "rtl" ? -1 : 1;
4017
+ };
4018
+ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
4019
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
4020
+ var delta = directionFactor * sourceDelta;
4021
+ var target = event.target;
4022
+ var targetInLock = endTarget.contains(target);
4023
+ var shouldCancelScroll = false;
4024
+ var isDeltaPositive = delta > 0;
4025
+ var availableScroll = 0;
4026
+ var availableScrollTop = 0;
4027
+ do {
4028
+ if (!target) {
4029
+ break;
4030
+ }
4031
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
4032
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
4033
+ if (position || elementScroll) {
4034
+ if (elementCouldBeScrolled(axis, target)) {
4035
+ availableScroll += elementScroll;
4036
+ availableScrollTop += position;
4037
+ }
4038
+ }
4039
+ var parent_1 = target.parentNode;
4040
+ target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
4041
+ } while (
4042
+ // portaled content
4043
+ !targetInLock && target !== document.body || // self content
4044
+ targetInLock && (endTarget.contains(target) || endTarget === target)
4045
+ );
4046
+ if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
4047
+ shouldCancelScroll = true;
4048
+ } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
4049
+ shouldCancelScroll = true;
4050
+ }
4051
+ return shouldCancelScroll;
4052
+ };
4053
+
4054
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
4055
+ var getTouchXY = function(event) {
4056
+ return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
4057
+ };
4058
+ var getDeltaXY = function(event) {
4059
+ return [event.deltaX, event.deltaY];
4060
+ };
4061
+ var extractRef = function(ref) {
4062
+ return ref && "current" in ref ? ref.current : ref;
4063
+ };
4064
+ var deltaCompare = function(x, y) {
4065
+ return x[0] === y[0] && x[1] === y[1];
4066
+ };
4067
+ var generateStyle = function(id) {
4068
+ return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
4069
+ };
4070
+ var idCounter = 0;
4071
+ var lockStack = [];
4072
+ function RemoveScrollSideCar(props) {
4073
+ var shouldPreventQueue = React27.useRef([]);
4074
+ var touchStartRef = React27.useRef([0, 0]);
4075
+ var activeAxis = React27.useRef();
4076
+ var id = React27.useState(idCounter++)[0];
4077
+ var Style2 = React27.useState(styleSingleton)[0];
4078
+ var lastProps = React27.useRef(props);
4079
+ React27.useEffect(function() {
4080
+ lastProps.current = props;
4081
+ }, [props]);
4082
+ React27.useEffect(function() {
4083
+ if (props.inert) {
4084
+ document.body.classList.add("block-interactivity-".concat(id));
4085
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
4086
+ allow_1.forEach(function(el) {
4087
+ return el.classList.add("allow-interactivity-".concat(id));
4088
+ });
4089
+ return function() {
4090
+ document.body.classList.remove("block-interactivity-".concat(id));
4091
+ allow_1.forEach(function(el) {
4092
+ return el.classList.remove("allow-interactivity-".concat(id));
4093
+ });
4094
+ };
4095
+ }
4096
+ return;
4097
+ }, [props.inert, props.lockRef.current, props.shards]);
4098
+ var shouldCancelEvent = React27.useCallback(function(event, parent) {
4099
+ if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
4100
+ return !lastProps.current.allowPinchZoom;
4101
+ }
4102
+ var touch = getTouchXY(event);
4103
+ var touchStart = touchStartRef.current;
4104
+ var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
4105
+ var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
4106
+ var currentAxis;
4107
+ var target = event.target;
4108
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
4109
+ if ("touches" in event && moveDirection === "h" && target.type === "range") {
4110
+ return false;
4111
+ }
4112
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4113
+ if (!canBeScrolledInMainDirection) {
4114
+ return true;
4115
+ }
4116
+ if (canBeScrolledInMainDirection) {
4117
+ currentAxis = moveDirection;
4118
+ } else {
4119
+ currentAxis = moveDirection === "v" ? "h" : "v";
4120
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
4121
+ }
4122
+ if (!canBeScrolledInMainDirection) {
4123
+ return false;
4124
+ }
4125
+ if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
4126
+ activeAxis.current = currentAxis;
4127
+ }
4128
+ if (!currentAxis) {
4129
+ return true;
4130
+ }
4131
+ var cancelingAxis = activeAxis.current || currentAxis;
4132
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
4133
+ }, []);
4134
+ var shouldPrevent = React27.useCallback(function(_event) {
4135
+ var event = _event;
4136
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
4137
+ return;
4138
+ }
4139
+ var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
4140
+ var sourceEvent = shouldPreventQueue.current.filter(function(e) {
4141
+ return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
4142
+ })[0];
4143
+ if (sourceEvent && sourceEvent.should) {
4144
+ if (event.cancelable) {
4145
+ event.preventDefault();
4146
+ }
4147
+ return;
4148
+ }
4149
+ if (!sourceEvent) {
4150
+ var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
4151
+ return node.contains(event.target);
4152
+ });
4153
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
4154
+ if (shouldStop) {
4155
+ if (event.cancelable) {
4156
+ event.preventDefault();
4157
+ }
4158
+ }
4159
+ }
4160
+ }, []);
4161
+ var shouldCancel = React27.useCallback(function(name, delta, target, should) {
4162
+ var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
4163
+ shouldPreventQueue.current.push(event);
4164
+ setTimeout(function() {
4165
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
4166
+ return e !== event;
4167
+ });
4168
+ }, 1);
4169
+ }, []);
4170
+ var scrollTouchStart = React27.useCallback(function(event) {
4171
+ touchStartRef.current = getTouchXY(event);
4172
+ activeAxis.current = void 0;
4173
+ }, []);
4174
+ var scrollWheel = React27.useCallback(function(event) {
4175
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4176
+ }, []);
4177
+ var scrollTouchMove = React27.useCallback(function(event) {
4178
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
4179
+ }, []);
4180
+ React27.useEffect(function() {
4181
+ lockStack.push(Style2);
4182
+ props.setCallbacks({
4183
+ onScrollCapture: scrollWheel,
4184
+ onWheelCapture: scrollWheel,
4185
+ onTouchMoveCapture: scrollTouchMove
4186
+ });
4187
+ document.addEventListener("wheel", shouldPrevent, nonPassive);
4188
+ document.addEventListener("touchmove", shouldPrevent, nonPassive);
4189
+ document.addEventListener("touchstart", scrollTouchStart, nonPassive);
4190
+ return function() {
4191
+ lockStack = lockStack.filter(function(inst) {
4192
+ return inst !== Style2;
4193
+ });
4194
+ document.removeEventListener("wheel", shouldPrevent, nonPassive);
4195
+ document.removeEventListener("touchmove", shouldPrevent, nonPassive);
4196
+ document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
4197
+ };
4198
+ }, []);
4199
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
4200
+ return React27.createElement(
4201
+ React27.Fragment,
4202
+ null,
4203
+ inert ? React27.createElement(Style2, { styles: generateStyle(id) }) : null,
4204
+ removeScrollBar ? React27.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
4205
+ );
4206
+ }
4207
+ function getOutermostShadowParent(node) {
4208
+ var shadowParent = null;
4209
+ while (node !== null) {
4210
+ if (node instanceof ShadowRoot) {
4211
+ shadowParent = node.host;
4212
+ node = node.host;
4213
+ }
4214
+ node = node.parentNode;
4215
+ }
4216
+ return shadowParent;
4217
+ }
4218
+
4219
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/sidecar.js
4220
+ var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
4221
+
4222
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.0_react@19.2.8/node_modules/react-remove-scroll/dist/es2015/Combination.js
4223
+ var ReactRemoveScroll = React28.forwardRef(function(props, ref) {
4224
+ return React28.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
4225
+ });
4226
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
4227
+ var Combination_default = ReactRemoveScroll;
4228
+
4229
+ // ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
4230
+ var import_jsx_runtime9 = require("react/jsx-runtime");
4231
+ var POPOVER_NAME = "Popover";
4232
+ var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
4233
+ createPopperScope
4234
+ ]);
4235
+ var usePopperScope = createPopperScope();
4236
+ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
4237
+ var Popover = (props) => {
4238
+ const {
4239
+ __scopePopover,
4240
+ children,
4241
+ open: openProp,
4242
+ defaultOpen,
4243
+ onOpenChange,
4244
+ modal = false
4245
+ } = props;
4246
+ const popperScope = usePopperScope(__scopePopover);
4247
+ const triggerRef = React29.useRef(null);
4248
+ const [hasCustomAnchor, setHasCustomAnchor] = React29.useState(false);
4249
+ const [open, setOpen] = useControllableState({
4250
+ prop: openProp,
4251
+ defaultProp: defaultOpen ?? false,
4252
+ onChange: onOpenChange,
4253
+ caller: POPOVER_NAME
4254
+ });
4255
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Root2, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4256
+ PopoverProvider,
4257
+ {
4258
+ scope: __scopePopover,
4259
+ contentId: useId(),
4260
+ triggerRef,
4261
+ open,
4262
+ onOpenChange: setOpen,
4263
+ onOpenToggle: React29.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
4264
+ hasCustomAnchor,
4265
+ onCustomAnchorAdd: React29.useCallback(() => setHasCustomAnchor(true), []),
4266
+ onCustomAnchorRemove: React29.useCallback(() => setHasCustomAnchor(false), []),
4267
+ modal,
4268
+ children
4269
+ }
4270
+ ) });
4271
+ };
4272
+ Popover.displayName = POPOVER_NAME;
4273
+ var ANCHOR_NAME2 = "PopoverAnchor";
4274
+ var PopoverAnchor = React29.forwardRef(
4275
+ (props, forwardedRef) => {
4276
+ const { __scopePopover, ...anchorProps } = props;
4277
+ const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
4278
+ const popperScope = usePopperScope(__scopePopover);
4279
+ const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
4280
+ React29.useEffect(() => {
4281
+ onCustomAnchorAdd();
4282
+ return () => onCustomAnchorRemove();
4283
+ }, [onCustomAnchorAdd, onCustomAnchorRemove]);
4284
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
4285
+ }
4286
+ );
4287
+ PopoverAnchor.displayName = ANCHOR_NAME2;
4288
+ var TRIGGER_NAME = "PopoverTrigger";
4289
+ var PopoverTrigger = React29.forwardRef(
4290
+ (props, forwardedRef) => {
4291
+ const { __scopePopover, ...triggerProps } = props;
4292
+ const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
4293
+ const popperScope = usePopperScope(__scopePopover);
4294
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
4295
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4296
+ Primitive.button,
4297
+ {
4298
+ type: "button",
4299
+ "aria-haspopup": "dialog",
4300
+ "aria-expanded": context.open,
4301
+ "aria-controls": context.contentId,
4302
+ "data-state": getState(context.open),
4303
+ ...triggerProps,
4304
+ ref: composedTriggerRef,
4305
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
4306
+ }
4307
+ );
4308
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Anchor, { asChild: true, ...popperScope, children: trigger });
4309
+ }
4310
+ );
4311
+ PopoverTrigger.displayName = TRIGGER_NAME;
4312
+ var PORTAL_NAME2 = "PopoverPortal";
4313
+ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
4314
+ forceMount: void 0
4315
+ });
4316
+ var PopoverPortal = (props) => {
4317
+ const { __scopePopover, forceMount, children, container } = props;
4318
+ const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
4319
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Portal, { asChild: true, container, children }) }) });
4320
+ };
4321
+ PopoverPortal.displayName = PORTAL_NAME2;
4322
+ var CONTENT_NAME2 = "PopoverContent";
4323
+ var PopoverContent = React29.forwardRef(
4324
+ (props, forwardedRef) => {
4325
+ const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
4326
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
4327
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4328
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
4329
+ }
4330
+ );
4331
+ PopoverContent.displayName = CONTENT_NAME2;
4332
+ var Slot = createSlot("PopoverContent.RemoveScroll");
4333
+ var PopoverContentModal = React29.forwardRef(
4334
+ (props, forwardedRef) => {
4335
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4336
+ const contentRef = React29.useRef(null);
4337
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
4338
+ const isRightClickOutsideRef = React29.useRef(false);
4339
+ React29.useEffect(() => {
4340
+ const content = contentRef.current;
4341
+ if (content) return hideOthers(content);
4342
+ }, []);
4343
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4344
+ PopoverContentImpl,
4345
+ {
4346
+ ...props,
4347
+ ref: composedRefs,
4348
+ trapFocus: context.open,
4349
+ disableOutsidePointerEvents: true,
4350
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
4351
+ event.preventDefault();
4352
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
4353
+ }),
4354
+ onPointerDownOutside: composeEventHandlers(
4355
+ props.onPointerDownOutside,
4356
+ (event) => {
4357
+ const originalEvent = event.detail.originalEvent;
4358
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
4359
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
4360
+ isRightClickOutsideRef.current = isRightClick;
4361
+ },
4362
+ { checkForDefaultPrevented: false }
4363
+ ),
4364
+ onFocusOutside: composeEventHandlers(
4365
+ props.onFocusOutside,
4366
+ (event) => event.preventDefault(),
4367
+ { checkForDefaultPrevented: false }
4368
+ )
4369
+ }
4370
+ ) });
4371
+ }
4372
+ );
4373
+ var PopoverContentNonModal = React29.forwardRef(
4374
+ (props, forwardedRef) => {
4375
+ const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
4376
+ const hasInteractedOutsideRef = React29.useRef(false);
4377
+ const hasPointerDownOutsideRef = React29.useRef(false);
4378
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4379
+ PopoverContentImpl,
4380
+ {
4381
+ ...props,
4382
+ ref: forwardedRef,
4383
+ trapFocus: false,
4384
+ disableOutsidePointerEvents: false,
4385
+ onCloseAutoFocus: (event) => {
4386
+ props.onCloseAutoFocus?.(event);
4387
+ if (!event.defaultPrevented) {
4388
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
4389
+ event.preventDefault();
4390
+ }
4391
+ hasInteractedOutsideRef.current = false;
4392
+ hasPointerDownOutsideRef.current = false;
4393
+ },
4394
+ onInteractOutside: (event) => {
4395
+ props.onInteractOutside?.(event);
4396
+ if (!event.defaultPrevented) {
4397
+ hasInteractedOutsideRef.current = true;
4398
+ if (event.detail.originalEvent.type === "pointerdown") {
4399
+ hasPointerDownOutsideRef.current = true;
4400
+ }
4401
+ }
4402
+ const target = event.target;
4403
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
4404
+ if (targetIsTrigger) event.preventDefault();
4405
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
4406
+ event.preventDefault();
4407
+ }
4408
+ }
4409
+ }
4410
+ );
4411
+ }
4412
+ );
4413
+ var PopoverContentImpl = React29.forwardRef(
4414
+ (props, forwardedRef) => {
4415
+ const {
4416
+ __scopePopover,
4417
+ trapFocus,
4418
+ onOpenAutoFocus,
4419
+ onCloseAutoFocus,
4420
+ disableOutsidePointerEvents,
4421
+ onEscapeKeyDown,
4422
+ onPointerDownOutside,
4423
+ onFocusOutside,
4424
+ onInteractOutside,
4425
+ ...contentProps
4426
+ } = props;
4427
+ const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
4428
+ const popperScope = usePopperScope(__scopePopover);
4429
+ useFocusGuards();
4430
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4431
+ FocusScope,
4432
+ {
4433
+ asChild: true,
4434
+ loop: true,
4435
+ trapped: trapFocus,
4436
+ onMountAutoFocus: onOpenAutoFocus,
4437
+ onUnmountAutoFocus: onCloseAutoFocus,
4438
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4439
+ DismissableLayer,
4440
+ {
4441
+ asChild: true,
4442
+ disableOutsidePointerEvents,
4443
+ onInteractOutside,
4444
+ onEscapeKeyDown,
4445
+ onPointerDownOutside,
4446
+ onFocusOutside,
4447
+ onDismiss: () => context.onOpenChange(false),
4448
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4449
+ Content,
4450
+ {
4451
+ "data-state": getState(context.open),
4452
+ role: "dialog",
4453
+ id: context.contentId,
4454
+ ...popperScope,
4455
+ ...contentProps,
4456
+ ref: forwardedRef,
4457
+ style: {
4458
+ ...contentProps.style,
4459
+ // re-namespace exposed content custom properties
4460
+ ...{
4461
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
4462
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
4463
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
4464
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
4465
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
4466
+ }
4467
+ }
4468
+ }
4469
+ )
4470
+ }
4471
+ )
4472
+ }
4473
+ );
4474
+ }
4475
+ );
4476
+ var CLOSE_NAME = "PopoverClose";
4477
+ var PopoverClose = React29.forwardRef(
4478
+ (props, forwardedRef) => {
4479
+ const { __scopePopover, ...closeProps } = props;
4480
+ const context = usePopoverContext(CLOSE_NAME, __scopePopover);
4481
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4482
+ Primitive.button,
4483
+ {
4484
+ type: "button",
4485
+ ...closeProps,
4486
+ ref: forwardedRef,
4487
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
4488
+ }
4489
+ );
4490
+ }
4491
+ );
4492
+ PopoverClose.displayName = CLOSE_NAME;
4493
+ var ARROW_NAME2 = "PopoverArrow";
4494
+ var PopoverArrow = React29.forwardRef(
4495
+ (props, forwardedRef) => {
4496
+ const { __scopePopover, ...arrowProps } = props;
4497
+ const popperScope = usePopperScope(__scopePopover);
4498
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
4499
+ }
4500
+ );
4501
+ PopoverArrow.displayName = ARROW_NAME2;
4502
+ function getState(open) {
4503
+ return open ? "open" : "closed";
4504
+ }
4505
+
4506
+ // ../platform-client/components/Menu/index.tsx
4507
+ var import_jsx_runtime10 = require("react/jsx-runtime");
4508
+ var getClassName = get_class_name_factory_default("Menu", styles_module_default);
4509
+ var itemClassName = get_class_name_factory_default("Menu-item", styles_module_default);
4510
+ var Menu = ({
4511
+ children,
4512
+ sections,
4513
+ disabled = false,
4514
+ ariaLabel,
4515
+ renderLink
4516
+ }) => {
4517
+ const [open, setOpen] = (0, import_react5.useState)(false);
4518
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassName(), children: [
4519
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4520
+ "button",
4521
+ {
4522
+ className: getClassName("action"),
4523
+ "aria-haspopup": "menu",
4524
+ "aria-label": ariaLabel,
4525
+ disabled,
4526
+ type: "button",
4527
+ children
4528
+ }
4529
+ ) }),
4530
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4531
+ PopoverContent,
4532
+ {
4533
+ align: "end",
4534
+ className: getClassName("content"),
4535
+ collisionPadding: 8,
4536
+ sideOffset: 4,
4537
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassName("sections"), role: "menu", children: sections.map((section, sectionIdx) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: getClassName("list"), children: section.map((item, itemIdx) => {
4538
+ const content = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4539
+ item.icon,
4540
+ item.label
4541
+ ] });
4542
+ if (item.disabled) {
4543
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4544
+ "span",
4545
+ {
4546
+ "aria-disabled": "true",
4547
+ className: itemClassName({
4548
+ disabled: true
4549
+ }),
4550
+ role: "menuitem",
4551
+ children: content
4552
+ }
4553
+ ) }, itemIdx);
4554
+ }
4555
+ if (item.href) {
4556
+ const onClick = () => {
4557
+ setOpen(false);
4558
+ };
4559
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: renderLink ? renderLink({
4560
+ href: item.href,
4561
+ className: getClassName("item"),
4562
+ children: content,
4563
+ onClick
4564
+ }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4565
+ "a",
4566
+ {
4567
+ className: getClassName("item"),
4568
+ href: item.href,
4569
+ onClick,
4570
+ role: "menuitem",
4571
+ children: content
4572
+ }
4573
+ ) }, itemIdx);
4574
+ }
4575
+ if (item.onClick) {
4576
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4577
+ "button",
4578
+ {
4579
+ className: getClassName("item"),
4580
+ onClick: () => {
4581
+ setOpen(false);
4582
+ void item.onClick?.();
4583
+ },
4584
+ role: "menuitem",
4585
+ type: "button",
4586
+ children: content
4587
+ }
4588
+ ) }, itemIdx);
4589
+ }
4590
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: getClassName("item"), role: "menuitem", children: content }) }, itemIdx);
4591
+ }) }, sectionIdx)) })
4592
+ }
4593
+ ) })
4594
+ ] }) });
4595
+ };
4596
+
4597
+ // ../utils/lib/get-class-name-factory.ts
4598
+ init_react_import();
4599
+ var import_classnames2 = __toESM(require_classnames());
4600
+ var getClassNameFactory2 = (rootClass, styles, { baseClass = "" } = {}) => (options = {}) => {
4601
+ let descendant = false;
4602
+ let modifiers = false;
4603
+ if (typeof options === "string") {
4604
+ descendant = options;
4605
+ } else if (typeof options === "object") {
4606
+ modifiers = options;
4607
+ }
4608
+ if (descendant) {
4609
+ const style = styles[`${rootClass}-${descendant}`];
4610
+ if (style) {
4611
+ return baseClass + styles[`${rootClass}-${descendant}`] || "";
4612
+ }
4613
+ return "";
4614
+ } else if (modifiers) {
4615
+ const prefixedModifiers = {};
4616
+ for (let modifier in modifiers) {
4617
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
4618
+ }
4619
+ const c = styles[rootClass];
4620
+ return baseClass + (0, import_classnames2.default)({
4621
+ [c]: !!c,
4622
+ // only apply the class if it exists
4623
+ ...prefixedModifiers
4624
+ });
4625
+ } else {
4626
+ return baseClass + styles[rootClass] || "";
4627
+ }
4628
+ };
4629
+
4630
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/lucide-react.js
4631
+ init_react_import();
4632
+
4633
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
4634
+ init_react_import();
4635
+ var import_react7 = require("react");
4636
+
4637
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/shared/src/utils.js
4638
+ init_react_import();
4639
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4640
+ var toCamelCase = (string) => string.replace(
4641
+ /^([A-Z])|[\s-_]+(\w)/g,
4642
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
4643
+ );
4644
+ var toPascalCase = (string) => {
4645
+ const camelCase = toCamelCase(string);
4646
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
4647
+ };
4648
+ var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
4649
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
4650
+ }).join(" ").trim();
4651
+ var hasA11yProp = (props) => {
4652
+ for (const prop in props) {
4653
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
4654
+ return true;
4655
+ }
4656
+ }
4657
+ };
4658
+
4659
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
4660
+ init_react_import();
4661
+ var import_react6 = require("react");
4662
+
4663
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/defaultAttributes.js
4664
+ init_react_import();
4665
+ var defaultAttributes = {
4666
+ xmlns: "http://www.w3.org/2000/svg",
4667
+ width: 24,
4668
+ height: 24,
4669
+ viewBox: "0 0 24 24",
4670
+ fill: "none",
4671
+ stroke: "currentColor",
4672
+ strokeWidth: 2,
4673
+ strokeLinecap: "round",
4674
+ strokeLinejoin: "round"
4675
+ };
4676
+
4677
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
4678
+ var Icon = (0, import_react6.forwardRef)(
4679
+ ({
4680
+ color = "currentColor",
4681
+ size: size4 = 24,
4682
+ strokeWidth = 2,
4683
+ absoluteStrokeWidth,
4684
+ className = "",
4685
+ children,
4686
+ iconNode,
4687
+ ...rest
4688
+ }, ref) => (0, import_react6.createElement)(
4689
+ "svg",
4690
+ {
4691
+ ref,
4692
+ ...defaultAttributes,
4693
+ width: size4,
4694
+ height: size4,
4695
+ stroke: color,
4696
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
4697
+ className: mergeClasses("lucide", className),
4698
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
4699
+ ...rest
4700
+ },
4701
+ [
4702
+ ...iconNode.map(([tag, attrs]) => (0, import_react6.createElement)(tag, attrs)),
4703
+ ...Array.isArray(children) ? children : [children]
4704
+ ]
4705
+ )
4706
+ );
4707
+
4708
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
4709
+ var createLucideIcon = (iconName, iconNode) => {
4710
+ const Component = (0, import_react7.forwardRef)(
4711
+ ({ className, ...props }, ref) => (0, import_react7.createElement)(Icon, {
4712
+ ref,
4713
+ iconNode,
4714
+ className: mergeClasses(
4715
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
4716
+ `lucide-${iconName}`,
4717
+ className
4718
+ ),
4719
+ ...props
4720
+ })
4721
+ );
4722
+ Component.displayName = toPascalCase(iconName);
4723
+ return Component;
4724
+ };
4725
+
4726
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/git-branch.js
4727
+ init_react_import();
4728
+ var __iconNode = [
4729
+ ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
4730
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
4731
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
4732
+ ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
4733
+ ];
4734
+ var GitBranch = createLucideIcon("git-branch", __iconNode);
4735
+
4736
+ // ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/log-out.js
4737
+ init_react_import();
4738
+ var __iconNode2 = [
4739
+ ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
4740
+ ["path", { d: "M21 12H9", key: "dn1m92" }],
4741
+ ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
4742
+ ];
4743
+ var LogOut = createLucideIcon("log-out", __iconNode2);
4744
+
4745
+ // src/components/SessionMenu/index.tsx
4746
+ var import_react8 = require("react");
4747
+
4748
+ // css-module:/home/runner/work/platform/platform/packages/plugin-auth/src/components/SessionMenu/styles.module.css#css-module
4749
+ init_react_import();
4750
+ var styles_module_default2 = { "SessionMenu-avatar": "_SessionMenu-avatar_j6dlr_1", "SessionMenu-placeholder": "_SessionMenu-placeholder_j6dlr_16", "SessionMenu-identity": "_SessionMenu-identity_j6dlr_30", "SessionMenu-name": "_SessionMenu-name_j6dlr_37", "SessionMenu-email": "_SessionMenu-email_j6dlr_41" };
4751
+
4752
+ // src/components/SessionMenu/index.tsx
4753
+ var import_jsx_runtime11 = require("react/jsx-runtime");
4754
+ var cx = getClassNameFactory2("SessionMenu", styles_module_default2);
4755
+ var initials = (name) => name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0].toUpperCase()).join("");
4756
+ var SessionMenu = ({
4757
+ authHost,
4758
+ showBranch
4759
+ }) => {
4760
+ const [session, setSession] = (0, import_react8.useState)();
4761
+ (0, import_react8.useEffect)(() => {
4762
+ let cancelled = false;
4763
+ fetch(`${authHost}/session`, { cache: "no-store" }).then((response) => response.ok ? response.json() : null).then((data) => {
4764
+ if (!cancelled) setSession(data?.user ? data : null);
4765
+ }).catch(() => {
4766
+ if (!cancelled) setSession(null);
4767
+ });
4768
+ return () => {
4769
+ cancelled = true;
4770
+ };
4771
+ }, [authHost]);
4772
+ if (session === void 0) {
4773
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", className: cx("placeholder") });
4774
+ }
4775
+ if (!session) return null;
4776
+ const signOut = () => {
4777
+ const form = document.createElement("form");
4778
+ form.method = "post";
4779
+ form.action = `${authHost}/logout`;
4780
+ document.body.appendChild(form);
4781
+ form.submit();
4782
+ };
4783
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4784
+ Menu,
4785
+ {
4786
+ ariaLabel: "Account",
4787
+ sections: [
4788
+ [
4789
+ {
4790
+ disabled: true,
4791
+ label: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: cx("identity"), children: [
4792
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: cx("name"), children: session.user.name }),
4793
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: cx("email"), children: session.user.email })
4794
+ ] })
4795
+ },
4796
+ ...showBranch ? [
4797
+ {
4798
+ disabled: true,
4799
+ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GitBranch, { size: 16 }),
4800
+ label: `Editing ${session.branch}`
4801
+ }
4802
+ ] : []
4803
+ ],
4804
+ [{ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }]
4805
+ ],
4806
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: cx("avatar"), title: session.user.name, children: session.user.image ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { alt: "", src: session.user.image }) : initials(session.user.name) || "?" })
4807
+ }
4808
+ );
4809
+ };
4810
+
4811
+ // src/index.tsx
4812
+ var import_jsx_runtime12 = require("react/jsx-runtime");
4813
+ var AuthHeaderActions = markHeaderActions(
4814
+ ({
4815
+ children,
4816
+ authHost,
4817
+ showBranch
4818
+ }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
4819
+ children,
4820
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SessionMenu, { authHost, showBranch })
4821
+ ] })
4822
+ );
4823
+ function createAuthPlugin({
4824
+ host = "/api/puck/auth",
4825
+ showBranch = process.env.NODE_ENV === "development"
4826
+ } = {}) {
4827
+ return {
4828
+ name: "auth",
4829
+ overrides: {
4830
+ headerActions: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4831
+ AuthHeaderActions,
4832
+ {
4833
+ authHost: host.replace(/\/+$/, ""),
4834
+ showBranch,
4835
+ children
4836
+ }
4837
+ )
4838
+ }
4839
+ };
4840
+ }
4841
+ // Annotate the CommonJS export names for ESM import in node:
4842
+ 0 && (module.exports = {
4843
+ createAuthPlugin
4844
+ });
4845
+ /*! Bundled license information:
4846
+
4847
+ classnames/index.js:
4848
+ (*!
4849
+ Copyright (c) 2018 Jed Watson.
4850
+ Licensed under the MIT License (MIT), see
4851
+ http://jedwatson.github.io/classnames
4852
+ *)
4853
+
4854
+ lucide-react/dist/esm/shared/src/utils.js:
4855
+ lucide-react/dist/esm/defaultAttributes.js:
4856
+ lucide-react/dist/esm/Icon.js:
4857
+ lucide-react/dist/esm/createLucideIcon.js:
4858
+ lucide-react/dist/esm/icons/git-branch.js:
4859
+ lucide-react/dist/esm/icons/log-out.js:
4860
+ lucide-react/dist/esm/lucide-react.js:
4861
+ (**
4862
+ * @license lucide-react v0.554.0 - ISC
4863
+ *
4864
+ * This source code is licensed under the ISC license.
4865
+ * See the LICENSE file in the root directory of this source tree.
4866
+ *)
4867
+ */