@windrun-huaiin/third-ui 6.2.2 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/chunk-52YUUCKV.js +3190 -0
  2. package/dist/chunk-52YUUCKV.js.map +1 -0
  3. package/dist/chunk-6MM7HLNX.js +226 -0
  4. package/dist/chunk-6MM7HLNX.js.map +1 -0
  5. package/dist/chunk-6PW67OXW.js +967 -0
  6. package/dist/chunk-6PW67OXW.js.map +1 -0
  7. package/dist/chunk-BZLOMDT7.mjs +90 -0
  8. package/dist/chunk-BZLOMDT7.mjs.map +1 -0
  9. package/dist/chunk-C3MW5ZUN.mjs +967 -0
  10. package/dist/chunk-C3MW5ZUN.mjs.map +1 -0
  11. package/dist/chunk-FOMCGWDM.mjs +17 -0
  12. package/dist/chunk-FOMCGWDM.mjs.map +1 -0
  13. package/dist/chunk-ICXWQI2S.mjs +126 -0
  14. package/dist/chunk-ICXWQI2S.mjs.map +1 -0
  15. package/dist/chunk-IOUCFIRG.mjs +3190 -0
  16. package/dist/chunk-IOUCFIRG.mjs.map +1 -0
  17. package/dist/chunk-J26XFRUS.js +17 -0
  18. package/dist/chunk-J26XFRUS.js.map +1 -0
  19. package/dist/chunk-LZLW5WCC.js +90 -0
  20. package/dist/chunk-LZLW5WCC.js.map +1 -0
  21. package/dist/chunk-NV3UQTCW.mjs +226 -0
  22. package/dist/chunk-NV3UQTCW.mjs.map +1 -0
  23. package/dist/chunk-TBXDOQXP.js +126 -0
  24. package/dist/chunk-TBXDOQXP.js.map +1 -0
  25. package/dist/chunk-TKLIIDBR.mjs +2804 -0
  26. package/dist/chunk-TKLIIDBR.mjs.map +1 -0
  27. package/dist/chunk-W7K5Y2WR.js +2804 -0
  28. package/dist/chunk-W7K5Y2WR.js.map +1 -0
  29. package/dist/clerk/index.js +13 -57
  30. package/dist/clerk/index.js.map +1 -1
  31. package/dist/clerk/index.mjs +7 -27
  32. package/dist/clerk/index.mjs.map +1 -1
  33. package/dist/clerk/server.js +60 -2907
  34. package/dist/clerk/server.js.map +1 -1
  35. package/dist/clerk/server.mjs +33 -2846
  36. package/dist/clerk/server.mjs.map +1 -1
  37. package/dist/fuma/mdx/index.js +7 -4084
  38. package/dist/fuma/mdx/index.js.map +1 -1
  39. package/dist/fuma/mdx/index.mjs +20 -4058
  40. package/dist/fuma/mdx/index.mjs.map +1 -1
  41. package/dist/fuma/server.js +442 -3695
  42. package/dist/fuma/server.js.map +1 -1
  43. package/dist/fuma/server.mjs +232 -3476
  44. package/dist/fuma/server.mjs.map +1 -1
  45. package/dist/lib/server.js +39 -105
  46. package/dist/lib/server.js.map +1 -1
  47. package/dist/lib/server.mjs +4 -24
  48. package/dist/lib/server.mjs.map +1 -1
  49. package/dist/main/index.js +6 -6214
  50. package/dist/main/index.js.map +1 -1
  51. package/dist/main/index.mjs +16 -6184
  52. package/dist/main/index.mjs.map +1 -1
  53. package/dist/main/server.js +184 -6032
  54. package/dist/main/server.js.map +1 -1
  55. package/dist/main/server.mjs +147 -5957
  56. package/dist/main/server.mjs.map +1 -1
  57. package/package.json +2 -2
@@ -0,0 +1,3190 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* eslint-disable */
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunk6MM7HLNXjs = require('./chunk-6MM7HLNX.js');
9
+
10
+
11
+ var _chunkW7K5Y2WRjs = require('./chunk-W7K5Y2WR.js');
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkLZLW5WCCjs = require('./chunk-LZLW5WCC.js');
18
+
19
+ // src/main/go-to-top.tsx
20
+ var _react = require('react'); var React24 = _interopRequireWildcard(_react); var React21 = _interopRequireWildcard(_react); var React = _interopRequireWildcard(_react); var React20 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React22 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react); var React9 = _interopRequireWildcard(_react); var React10 = _interopRequireWildcard(_react); var React23 = _interopRequireWildcard(_react); var React11 = _interopRequireWildcard(_react); var React12 = _interopRequireWildcard(_react); var React19 = _interopRequireWildcard(_react); var React15 = _interopRequireWildcard(_react); var React13 = _interopRequireWildcard(_react); var React14 = _interopRequireWildcard(_react); var React18 = _interopRequireWildcard(_react); var React17 = _interopRequireWildcard(_react); var React16 = _interopRequireWildcard(_react);
21
+ var _jsxruntime = require('react/jsx-runtime');
22
+ function GoToTop() {
23
+ const [isVisible, setIsVisible] = _react.useState.call(void 0, false);
24
+ _react.useEffect.call(void 0, () => {
25
+ const toggleVisibility = () => {
26
+ if (window.scrollY > 300) {
27
+ setIsVisible(true);
28
+ } else {
29
+ setIsVisible(false);
30
+ }
31
+ };
32
+ window.addEventListener("scroll", toggleVisibility);
33
+ return () => window.removeEventListener("scroll", toggleVisibility);
34
+ }, []);
35
+ const scrollToTop = () => {
36
+ window.scrollTo({
37
+ top: 0,
38
+ behavior: "smooth"
39
+ });
40
+ };
41
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: isVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
42
+ "button",
43
+ {
44
+ onClick: scrollToTop,
45
+ className: "fixed bottom-6 right-6 p-3 bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-300 z-50",
46
+ "aria-label": "Go to top",
47
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.ArrowUp, { size: 20, className: "text-white" })
48
+ }
49
+ ) });
50
+ }
51
+
52
+ // src/main/loading.tsx
53
+
54
+ var NUM_ROWS = 15;
55
+ var NUM_COLS = 15;
56
+ var DOT_SIZE = 6;
57
+ var SPACING = 12;
58
+ var ANIMATION_DURATION = 1.8;
59
+ var STAGGER_DELAY_FACTOR = 0.08;
60
+ var COLORS = [
61
+ "#AC62FD",
62
+ // Base Purple
63
+ "#C364FA",
64
+ "#DD59F7",
65
+ "#FF4FF2",
66
+ // Bright Pink/Magenta
67
+ "#F067DD",
68
+ "#E26AF8",
69
+ "#DA70D6",
70
+ // Orchid
71
+ "#BA55D3",
72
+ // Medium Orchid
73
+ "#9370DB",
74
+ // Medium Purple
75
+ "#8A2BE2"
76
+ // Blue Violet
77
+ ];
78
+ function Loading() {
79
+ const dots = [];
80
+ const centerX = (NUM_COLS - 1) / 2;
81
+ const centerY = (NUM_ROWS - 1) / 2;
82
+ for (let i = 0; i < NUM_ROWS; i++) {
83
+ for (let j = 0; j < NUM_COLS; j++) {
84
+ const distance = Math.sqrt(Math.pow(i - centerY, 2) + Math.pow(j - centerX, 2));
85
+ dots.push({
86
+ id: `${i}-${j}`,
87
+ row: i,
88
+ col: j,
89
+ // Animation delay based on distance, creating a ripple effect
90
+ delay: distance * STAGGER_DELAY_FACTOR,
91
+ // Color selection based on distance rings
92
+ color: COLORS[Math.floor(distance) % COLORS.length]
93
+ });
94
+ }
95
+ }
96
+ const containerWidth = (NUM_COLS - 1) * SPACING + DOT_SIZE;
97
+ const containerHeight = (NUM_ROWS - 1) * SPACING + DOT_SIZE;
98
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col items-center justify-center min-h-screen bg-neutral-900", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
99
+ "div",
100
+ {
101
+ style: {
102
+ width: containerWidth,
103
+ height: containerHeight,
104
+ position: "relative",
105
+ borderRadius: "50%",
106
+ // Make the container circular
107
+ overflow: "hidden"
108
+ // Clip dots outside the circle
109
+ },
110
+ children: [
111
+ dots.map((dot) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
112
+ "div",
113
+ {
114
+ style: {
115
+ position: "absolute",
116
+ left: dot.col * SPACING,
117
+ top: dot.row * SPACING,
118
+ width: DOT_SIZE,
119
+ height: DOT_SIZE,
120
+ backgroundColor: dot.color,
121
+ borderRadius: "50%",
122
+ animationName: "loading-dot-pulse",
123
+ animationDuration: `${ANIMATION_DURATION}s`,
124
+ animationTimingFunction: "cubic-bezier(0.45, 0, 0.55, 1)",
125
+ animationIterationCount: "infinite",
126
+ animationDelay: `${dot.delay}s`,
127
+ opacity: 0,
128
+ transform: "scale(0)"
129
+ }
130
+ },
131
+ dot.id
132
+ )),
133
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
134
+ "div",
135
+ {
136
+ className: "absolute inset-0 flex items-center justify-center",
137
+ style: { pointerEvents: "none" },
138
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-semibold text-white", children: "Loading..." })
139
+ }
140
+ )
141
+ ]
142
+ }
143
+ ) });
144
+ }
145
+
146
+ // src/main/nprogress-bar.tsx
147
+ var _nprogress = require('nprogress'); var _nprogress2 = _interopRequireDefault(_nprogress);
148
+ var _navigation = require('next/navigation');
149
+
150
+ _nprogress2.default.configure({ showSpinner: false });
151
+ function NProgressBar() {
152
+ const pathname = _navigation.usePathname.call(void 0, );
153
+ const previousPath = _react.useRef.call(void 0, pathname);
154
+ _react.useEffect.call(void 0, () => {
155
+ if (previousPath.current !== pathname) {
156
+ _nprogress2.default.start();
157
+ setTimeout(() => {
158
+ _nprogress2.default.done();
159
+ }, 100);
160
+ previousPath.current = pathname;
161
+ }
162
+ }, [pathname]);
163
+ return null;
164
+ }
165
+
166
+ // src/main/ads-alert-dialog.tsx
167
+
168
+ var _image = require('next/image'); var _image2 = _interopRequireDefault(_image);
169
+
170
+ // ../base-ui/src/ui/alert-dialog.tsx
171
+
172
+
173
+ // ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
174
+
175
+
176
+ // ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
177
+
178
+
179
+ function createContext2(rootComponentName, defaultContext) {
180
+ const Context = React.createContext(defaultContext);
181
+ const Provider = (props) => {
182
+ const _a = props, { children } = _a, context = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["children"]);
183
+ const value = React.useMemo(() => context, Object.values(context));
184
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Context.Provider, { value, children });
185
+ };
186
+ Provider.displayName = rootComponentName + "Provider";
187
+ function useContext22(consumerName) {
188
+ const context = React.useContext(Context);
189
+ if (context) return context;
190
+ if (defaultContext !== void 0) return defaultContext;
191
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
192
+ }
193
+ return [Provider, useContext22];
194
+ }
195
+ function createContextScope(scopeName, createContextScopeDeps = []) {
196
+ let defaultContexts = [];
197
+ function createContext32(rootComponentName, defaultContext) {
198
+ const BaseContext = React.createContext(defaultContext);
199
+ const index = defaultContexts.length;
200
+ defaultContexts = [...defaultContexts, defaultContext];
201
+ const Provider = (props) => {
202
+ var _b;
203
+ const _a = props, { scope, children } = _a, context = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["scope", "children"]);
204
+ const Context = ((_b = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _b[index]) || BaseContext;
205
+ const value = React.useMemo(() => context, Object.values(context));
206
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Context.Provider, { value, children });
207
+ };
208
+ Provider.displayName = rootComponentName + "Provider";
209
+ function useContext22(consumerName, scope) {
210
+ var _a;
211
+ const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
212
+ const context = React.useContext(Context);
213
+ if (context) return context;
214
+ if (defaultContext !== void 0) return defaultContext;
215
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
216
+ }
217
+ return [Provider, useContext22];
218
+ }
219
+ const createScope = () => {
220
+ const scopeContexts = defaultContexts.map((defaultContext) => {
221
+ return React.createContext(defaultContext);
222
+ });
223
+ return function useScope(scope) {
224
+ const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
225
+ return React.useMemo(
226
+ () => ({ [`__scope${scopeName}`]: _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, scope), { [scopeName]: contexts }) }),
227
+ [scope, contexts]
228
+ );
229
+ };
230
+ };
231
+ createScope.scopeName = scopeName;
232
+ return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
233
+ }
234
+ function composeContextScopes(...scopes) {
235
+ const baseScope = scopes[0];
236
+ if (scopes.length === 1) return baseScope;
237
+ const createScope = () => {
238
+ const scopeHooks = scopes.map((createScope2) => ({
239
+ useScope: createScope2(),
240
+ scopeName: createScope2.scopeName
241
+ }));
242
+ return function useComposedScopes(overrideScopes) {
243
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
244
+ const scopeProps = useScope(overrideScopes);
245
+ const currentScope = scopeProps[`__scope${scopeName}`];
246
+ return _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, nextScopes2), currentScope);
247
+ }, {});
248
+ return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
249
+ };
250
+ };
251
+ createScope.scopeName = baseScope.scopeName;
252
+ return createScope;
253
+ }
254
+
255
+ // ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
256
+
257
+
258
+ // ../../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
259
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
260
+ return function handleEvent(event) {
261
+ originalEventHandler == null ? void 0 : originalEventHandler(event);
262
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
263
+ return ourEventHandler == null ? void 0 : ourEventHandler(event);
264
+ }
265
+ };
266
+ }
267
+
268
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
269
+
270
+
271
+ // ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
272
+
273
+ var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React2.useLayoutEffect : () => {
274
+ };
275
+
276
+ // ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
277
+ var useReactId = React3[" useId ".trim().toString()] || (() => void 0);
278
+ var count = 0;
279
+ function useId(deterministicId) {
280
+ const [id, setId] = React3.useState(useReactId());
281
+ useLayoutEffect2(() => {
282
+ if (!deterministicId) setId((reactId) => reactId != null ? reactId : String(count++));
283
+ }, [deterministicId]);
284
+ return deterministicId || (id ? `radix-${id}` : "");
285
+ }
286
+
287
+ // ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
288
+
289
+
290
+ var useInsertionEffect = React4[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
291
+ function useControllableState({
292
+ prop,
293
+ defaultProp,
294
+ onChange = () => {
295
+ },
296
+ caller
297
+ }) {
298
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
299
+ defaultProp,
300
+ onChange
301
+ });
302
+ const isControlled = prop !== void 0;
303
+ const value = isControlled ? prop : uncontrolledProp;
304
+ if (true) {
305
+ const isControlledRef = React4.useRef(prop !== void 0);
306
+ React4.useEffect(() => {
307
+ const wasControlled = isControlledRef.current;
308
+ if (wasControlled !== isControlled) {
309
+ const from = wasControlled ? "controlled" : "uncontrolled";
310
+ const to = isControlled ? "controlled" : "uncontrolled";
311
+ console.warn(
312
+ `${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.`
313
+ );
314
+ }
315
+ isControlledRef.current = isControlled;
316
+ }, [isControlled, caller]);
317
+ }
318
+ const setValue = React4.useCallback(
319
+ (nextValue) => {
320
+ var _a;
321
+ if (isControlled) {
322
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
323
+ if (value2 !== prop) {
324
+ (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
325
+ }
326
+ } else {
327
+ setUncontrolledProp(nextValue);
328
+ }
329
+ },
330
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
331
+ );
332
+ return [value, setValue];
333
+ }
334
+ function useUncontrolledState({
335
+ defaultProp,
336
+ onChange
337
+ }) {
338
+ const [value, setValue] = React4.useState(defaultProp);
339
+ const prevValueRef = React4.useRef(value);
340
+ const onChangeRef = React4.useRef(onChange);
341
+ useInsertionEffect(() => {
342
+ onChangeRef.current = onChange;
343
+ }, [onChange]);
344
+ React4.useEffect(() => {
345
+ var _a;
346
+ if (prevValueRef.current !== value) {
347
+ (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
348
+ prevValueRef.current = value;
349
+ }
350
+ }, [value, prevValueRef]);
351
+ return [value, setValue, onChangeRef];
352
+ }
353
+ function isFunction(value) {
354
+ return typeof value === "function";
355
+ }
356
+ var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
357
+
358
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
359
+
360
+
361
+ // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.3_@types+react@19.1.2__@types+rea_43250ccbc78c27b15284efcf829a65d5/node_modules/@radix-ui/react-primitive/dist/index.mjs
362
+
363
+ var _reactdom = require('react-dom'); var ReactDOM = _interopRequireWildcard(_reactdom);
364
+
365
+ var NODES = [
366
+ "a",
367
+ "button",
368
+ "div",
369
+ "form",
370
+ "h2",
371
+ "h3",
372
+ "img",
373
+ "input",
374
+ "label",
375
+ "li",
376
+ "nav",
377
+ "ol",
378
+ "p",
379
+ "select",
380
+ "span",
381
+ "svg",
382
+ "ul"
383
+ ];
384
+ var Primitive = NODES.reduce((primitive, node) => {
385
+ const Slot2 = _chunk6MM7HLNXjs.createSlot.call(void 0, `Primitive.${node}`);
386
+ const Node2 = React5.forwardRef((props, forwardedRef) => {
387
+ const _a = props, { asChild } = _a, primitiveProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["asChild"]);
388
+ const Comp = asChild ? Slot2 : node;
389
+ if (typeof window !== "undefined") {
390
+ window[Symbol.for("radix-ui")] = true;
391
+ }
392
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, primitiveProps), { ref: forwardedRef }));
393
+ });
394
+ Node2.displayName = `Primitive.${node}`;
395
+ return _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, primitive), { [node]: Node2 });
396
+ }, {});
397
+ function dispatchDiscreteCustomEvent(target, event) {
398
+ if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
399
+ }
400
+
401
+ // ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
402
+
403
+ function useCallbackRef(callback) {
404
+ const callbackRef = React6.useRef(callback);
405
+ React6.useEffect(() => {
406
+ callbackRef.current = callback;
407
+ });
408
+ return React6.useMemo(() => (...args) => {
409
+ var _a;
410
+ return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
411
+ }, []);
412
+ }
413
+
414
+ // ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
415
+
416
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
417
+ const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
418
+ React7.useEffect(() => {
419
+ const handleKeyDown = (event) => {
420
+ if (event.key === "Escape") {
421
+ onEscapeKeyDown(event);
422
+ }
423
+ };
424
+ ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
425
+ return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
426
+ }, [onEscapeKeyDown, ownerDocument]);
427
+ }
428
+
429
+ // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
430
+
431
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
432
+ var CONTEXT_UPDATE = "dismissableLayer.update";
433
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
434
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
435
+ var originalBodyPointerEvents;
436
+ var DismissableLayerContext = React8.createContext({
437
+ layers: /* @__PURE__ */ new Set(),
438
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
439
+ branches: /* @__PURE__ */ new Set()
440
+ });
441
+ var DismissableLayer = React8.forwardRef(
442
+ (props, forwardedRef) => {
443
+ var _b;
444
+ const _a = props, {
445
+ disableOutsidePointerEvents = false,
446
+ onEscapeKeyDown,
447
+ onPointerDownOutside,
448
+ onFocusOutside,
449
+ onInteractOutside,
450
+ onDismiss
451
+ } = _a, layerProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, [
452
+ "disableOutsidePointerEvents",
453
+ "onEscapeKeyDown",
454
+ "onPointerDownOutside",
455
+ "onFocusOutside",
456
+ "onInteractOutside",
457
+ "onDismiss"
458
+ ]);
459
+ const context = React8.useContext(DismissableLayerContext);
460
+ const [node, setNode] = React8.useState(null);
461
+ const ownerDocument = (_b = node == null ? void 0 : node.ownerDocument) != null ? _b : globalThis == null ? void 0 : globalThis.document;
462
+ const [, force] = React8.useState({});
463
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, (node2) => setNode(node2));
464
+ const layers = Array.from(context.layers);
465
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
466
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
467
+ const index = node ? layers.indexOf(node) : -1;
468
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
469
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
470
+ const pointerDownOutside = usePointerDownOutside((event) => {
471
+ const target = event.target;
472
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
473
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
474
+ onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
475
+ onInteractOutside == null ? void 0 : onInteractOutside(event);
476
+ if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
477
+ }, ownerDocument);
478
+ const focusOutside = useFocusOutside((event) => {
479
+ const target = event.target;
480
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
481
+ if (isFocusInBranch) return;
482
+ onFocusOutside == null ? void 0 : onFocusOutside(event);
483
+ onInteractOutside == null ? void 0 : onInteractOutside(event);
484
+ if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
485
+ }, ownerDocument);
486
+ useEscapeKeydown((event) => {
487
+ const isHighestLayer = index === context.layers.size - 1;
488
+ if (!isHighestLayer) return;
489
+ onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
490
+ if (!event.defaultPrevented && onDismiss) {
491
+ event.preventDefault();
492
+ onDismiss();
493
+ }
494
+ }, ownerDocument);
495
+ React8.useEffect(() => {
496
+ if (!node) return;
497
+ if (disableOutsidePointerEvents) {
498
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
499
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
500
+ ownerDocument.body.style.pointerEvents = "none";
501
+ }
502
+ context.layersWithOutsidePointerEventsDisabled.add(node);
503
+ }
504
+ context.layers.add(node);
505
+ dispatchUpdate();
506
+ return () => {
507
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
508
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
509
+ }
510
+ };
511
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
512
+ React8.useEffect(() => {
513
+ return () => {
514
+ if (!node) return;
515
+ context.layers.delete(node);
516
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
517
+ dispatchUpdate();
518
+ };
519
+ }, [node, context]);
520
+ React8.useEffect(() => {
521
+ const handleUpdate = () => force({});
522
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
523
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
524
+ }, []);
525
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
526
+ Primitive.div,
527
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, layerProps), {
528
+ ref: composedRefs,
529
+ style: _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
530
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0
531
+ }, props.style),
532
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
533
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
534
+ onPointerDownCapture: composeEventHandlers(
535
+ props.onPointerDownCapture,
536
+ pointerDownOutside.onPointerDownCapture
537
+ )
538
+ })
539
+ );
540
+ }
541
+ );
542
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
543
+ var BRANCH_NAME = "DismissableLayerBranch";
544
+ var DismissableLayerBranch = React8.forwardRef((props, forwardedRef) => {
545
+ const context = React8.useContext(DismissableLayerContext);
546
+ const ref = React8.useRef(null);
547
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, ref);
548
+ React8.useEffect(() => {
549
+ const node = ref.current;
550
+ if (node) {
551
+ context.branches.add(node);
552
+ return () => {
553
+ context.branches.delete(node);
554
+ };
555
+ }
556
+ }, [context.branches]);
557
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Primitive.div, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, props), { ref: composedRefs }));
558
+ });
559
+ DismissableLayerBranch.displayName = BRANCH_NAME;
560
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
561
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
562
+ const isPointerInsideReactTreeRef = React8.useRef(false);
563
+ const handleClickRef = React8.useRef(() => {
564
+ });
565
+ React8.useEffect(() => {
566
+ const handlePointerDown = (event) => {
567
+ if (event.target && !isPointerInsideReactTreeRef.current) {
568
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
569
+ handleAndDispatchCustomEvent(
570
+ POINTER_DOWN_OUTSIDE,
571
+ handlePointerDownOutside,
572
+ eventDetail,
573
+ { discrete: true }
574
+ );
575
+ };
576
+ var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
577
+ const eventDetail = { originalEvent: event };
578
+ if (event.pointerType === "touch") {
579
+ ownerDocument.removeEventListener("click", handleClickRef.current);
580
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
581
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
582
+ } else {
583
+ handleAndDispatchPointerDownOutsideEvent2();
584
+ }
585
+ } else {
586
+ ownerDocument.removeEventListener("click", handleClickRef.current);
587
+ }
588
+ isPointerInsideReactTreeRef.current = false;
589
+ };
590
+ const timerId = window.setTimeout(() => {
591
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
592
+ }, 0);
593
+ return () => {
594
+ window.clearTimeout(timerId);
595
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
596
+ ownerDocument.removeEventListener("click", handleClickRef.current);
597
+ };
598
+ }, [ownerDocument, handlePointerDownOutside]);
599
+ return {
600
+ // ensures we check React component tree (not just DOM tree)
601
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
602
+ };
603
+ }
604
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
605
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
606
+ const isFocusInsideReactTreeRef = React8.useRef(false);
607
+ React8.useEffect(() => {
608
+ const handleFocus = (event) => {
609
+ if (event.target && !isFocusInsideReactTreeRef.current) {
610
+ const eventDetail = { originalEvent: event };
611
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
612
+ discrete: false
613
+ });
614
+ }
615
+ };
616
+ ownerDocument.addEventListener("focusin", handleFocus);
617
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
618
+ }, [ownerDocument, handleFocusOutside]);
619
+ return {
620
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
621
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
622
+ };
623
+ }
624
+ function dispatchUpdate() {
625
+ const event = new CustomEvent(CONTEXT_UPDATE);
626
+ document.dispatchEvent(event);
627
+ }
628
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
629
+ const target = detail.originalEvent.target;
630
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
631
+ if (handler) target.addEventListener(name, handler, { once: true });
632
+ if (discrete) {
633
+ dispatchDiscreteCustomEvent(target, event);
634
+ } else {
635
+ target.dispatchEvent(event);
636
+ }
637
+ }
638
+
639
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.3_@types+react@19.1.2__@types+r_1ff7b04b7c975087a2da2b1568ac976e/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
640
+
641
+
642
+ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
643
+ var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
644
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
645
+ var FOCUS_SCOPE_NAME = "FocusScope";
646
+ var FocusScope = React9.forwardRef((props, forwardedRef) => {
647
+ const _a = props, {
648
+ loop = false,
649
+ trapped = false,
650
+ onMountAutoFocus: onMountAutoFocusProp,
651
+ onUnmountAutoFocus: onUnmountAutoFocusProp
652
+ } = _a, scopeProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, [
653
+ "loop",
654
+ "trapped",
655
+ "onMountAutoFocus",
656
+ "onUnmountAutoFocus"
657
+ ]);
658
+ const [container, setContainer] = React9.useState(null);
659
+ const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
660
+ const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
661
+ const lastFocusedElementRef = React9.useRef(null);
662
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, (node) => setContainer(node));
663
+ const focusScope = React9.useRef({
664
+ paused: false,
665
+ pause() {
666
+ this.paused = true;
667
+ },
668
+ resume() {
669
+ this.paused = false;
670
+ }
671
+ }).current;
672
+ React9.useEffect(() => {
673
+ if (trapped) {
674
+ let handleFocusIn2 = function(event) {
675
+ if (focusScope.paused || !container) return;
676
+ const target = event.target;
677
+ if (container.contains(target)) {
678
+ lastFocusedElementRef.current = target;
679
+ } else {
680
+ focus(lastFocusedElementRef.current, { select: true });
681
+ }
682
+ }, handleFocusOut2 = function(event) {
683
+ if (focusScope.paused || !container) return;
684
+ const relatedTarget = event.relatedTarget;
685
+ if (relatedTarget === null) return;
686
+ if (!container.contains(relatedTarget)) {
687
+ focus(lastFocusedElementRef.current, { select: true });
688
+ }
689
+ }, handleMutations2 = function(mutations) {
690
+ const focusedElement = document.activeElement;
691
+ if (focusedElement !== document.body) return;
692
+ for (const mutation of mutations) {
693
+ if (mutation.removedNodes.length > 0) focus(container);
694
+ }
695
+ };
696
+ var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
697
+ document.addEventListener("focusin", handleFocusIn2);
698
+ document.addEventListener("focusout", handleFocusOut2);
699
+ const mutationObserver = new MutationObserver(handleMutations2);
700
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
701
+ return () => {
702
+ document.removeEventListener("focusin", handleFocusIn2);
703
+ document.removeEventListener("focusout", handleFocusOut2);
704
+ mutationObserver.disconnect();
705
+ };
706
+ }
707
+ }, [trapped, container, focusScope.paused]);
708
+ React9.useEffect(() => {
709
+ if (container) {
710
+ focusScopesStack.add(focusScope);
711
+ const previouslyFocusedElement = document.activeElement;
712
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
713
+ if (!hasFocusedCandidate) {
714
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
715
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
716
+ container.dispatchEvent(mountEvent);
717
+ if (!mountEvent.defaultPrevented) {
718
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
719
+ if (document.activeElement === previouslyFocusedElement) {
720
+ focus(container);
721
+ }
722
+ }
723
+ }
724
+ return () => {
725
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
726
+ setTimeout(() => {
727
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
728
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
729
+ container.dispatchEvent(unmountEvent);
730
+ if (!unmountEvent.defaultPrevented) {
731
+ focus(previouslyFocusedElement != null ? previouslyFocusedElement : document.body, { select: true });
732
+ }
733
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
734
+ focusScopesStack.remove(focusScope);
735
+ }, 0);
736
+ };
737
+ }
738
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
739
+ const handleKeyDown = React9.useCallback(
740
+ (event) => {
741
+ if (!loop && !trapped) return;
742
+ if (focusScope.paused) return;
743
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
744
+ const focusedElement = document.activeElement;
745
+ if (isTabKey && focusedElement) {
746
+ const container2 = event.currentTarget;
747
+ const [first, last] = getTabbableEdges(container2);
748
+ const hasTabbableElementsInside = first && last;
749
+ if (!hasTabbableElementsInside) {
750
+ if (focusedElement === container2) event.preventDefault();
751
+ } else {
752
+ if (!event.shiftKey && focusedElement === last) {
753
+ event.preventDefault();
754
+ if (loop) focus(first, { select: true });
755
+ } else if (event.shiftKey && focusedElement === first) {
756
+ event.preventDefault();
757
+ if (loop) focus(last, { select: true });
758
+ }
759
+ }
760
+ }
761
+ },
762
+ [loop, trapped, focusScope.paused]
763
+ );
764
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Primitive.div, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, { tabIndex: -1 }, scopeProps), { ref: composedRefs, onKeyDown: handleKeyDown }));
765
+ });
766
+ FocusScope.displayName = FOCUS_SCOPE_NAME;
767
+ function focusFirst(candidates, { select = false } = {}) {
768
+ const previouslyFocusedElement = document.activeElement;
769
+ for (const candidate of candidates) {
770
+ focus(candidate, { select });
771
+ if (document.activeElement !== previouslyFocusedElement) return;
772
+ }
773
+ }
774
+ function getTabbableEdges(container) {
775
+ const candidates = getTabbableCandidates(container);
776
+ const first = findVisible(candidates, container);
777
+ const last = findVisible(candidates.reverse(), container);
778
+ return [first, last];
779
+ }
780
+ function getTabbableCandidates(container) {
781
+ const nodes = [];
782
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
783
+ acceptNode: (node) => {
784
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
785
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
786
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
787
+ }
788
+ });
789
+ while (walker.nextNode()) nodes.push(walker.currentNode);
790
+ return nodes;
791
+ }
792
+ function findVisible(elements, container) {
793
+ for (const element of elements) {
794
+ if (!isHidden(element, { upTo: container })) return element;
795
+ }
796
+ }
797
+ function isHidden(node, { upTo }) {
798
+ if (getComputedStyle(node).visibility === "hidden") return true;
799
+ while (node) {
800
+ if (upTo !== void 0 && node === upTo) return false;
801
+ if (getComputedStyle(node).display === "none") return true;
802
+ node = node.parentElement;
803
+ }
804
+ return false;
805
+ }
806
+ function isSelectableInput(element) {
807
+ return element instanceof HTMLInputElement && "select" in element;
808
+ }
809
+ function focus(element, { select = false } = {}) {
810
+ if (element && element.focus) {
811
+ const previouslyFocusedElement = document.activeElement;
812
+ element.focus({ preventScroll: true });
813
+ if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
814
+ element.select();
815
+ }
816
+ }
817
+ var focusScopesStack = createFocusScopesStack();
818
+ function createFocusScopesStack() {
819
+ let stack = [];
820
+ return {
821
+ add(focusScope) {
822
+ const activeFocusScope = stack[0];
823
+ if (focusScope !== activeFocusScope) {
824
+ activeFocusScope == null ? void 0 : activeFocusScope.pause();
825
+ }
826
+ stack = arrayRemove(stack, focusScope);
827
+ stack.unshift(focusScope);
828
+ },
829
+ remove(focusScope) {
830
+ var _a;
831
+ stack = arrayRemove(stack, focusScope);
832
+ (_a = stack[0]) == null ? void 0 : _a.resume();
833
+ }
834
+ };
835
+ }
836
+ function arrayRemove(array, item) {
837
+ const updatedArray = [...array];
838
+ const index = updatedArray.indexOf(item);
839
+ if (index !== -1) {
840
+ updatedArray.splice(index, 1);
841
+ }
842
+ return updatedArray;
843
+ }
844
+ function removeLinks(items) {
845
+ return items.filter((item) => item.tagName !== "A");
846
+ }
847
+
848
+ // ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react@_a0745de0839b0b019298ec068509a840/node_modules/@radix-ui/react-portal/dist/index.mjs
849
+
850
+
851
+
852
+ var PORTAL_NAME = "Portal";
853
+ var Portal = React10.forwardRef((props, forwardedRef) => {
854
+ var _b;
855
+ const _a = props, { container: containerProp } = _a, portalProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["container"]);
856
+ const [mounted, setMounted] = React10.useState(false);
857
+ useLayoutEffect2(() => setMounted(true), []);
858
+ const container = containerProp || mounted && ((_b = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _b.body);
859
+ return container ? ReactDOM.default.createPortal(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Primitive.div, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, portalProps), { ref: forwardedRef })), container) : null;
860
+ });
861
+ Portal.displayName = PORTAL_NAME;
862
+
863
+ // ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.3_@types+react@19.1.2__@types+reac_dbbe976722e7c3e02883ea31c3bbbf14/node_modules/@radix-ui/react-presence/dist/index.mjs
864
+
865
+
866
+ function useStateMachine(initialState, machine) {
867
+ return React11.useReducer((state, event) => {
868
+ const nextState = machine[state][event];
869
+ return nextState != null ? nextState : state;
870
+ }, initialState);
871
+ }
872
+ var Presence = (props) => {
873
+ const { present, children } = props;
874
+ const presence = usePresence(present);
875
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
876
+ const ref = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, presence.ref, getElementRef(child));
877
+ const forceMount = typeof children === "function";
878
+ return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
879
+ };
880
+ Presence.displayName = "Presence";
881
+ function usePresence(present) {
882
+ const [node, setNode] = React23.useState();
883
+ const stylesRef = React23.useRef(null);
884
+ const prevPresentRef = React23.useRef(present);
885
+ const prevAnimationNameRef = React23.useRef("none");
886
+ const initialState = present ? "mounted" : "unmounted";
887
+ const [state, send] = useStateMachine(initialState, {
888
+ mounted: {
889
+ UNMOUNT: "unmounted",
890
+ ANIMATION_OUT: "unmountSuspended"
891
+ },
892
+ unmountSuspended: {
893
+ MOUNT: "mounted",
894
+ ANIMATION_END: "unmounted"
895
+ },
896
+ unmounted: {
897
+ MOUNT: "mounted"
898
+ }
899
+ });
900
+ React23.useEffect(() => {
901
+ const currentAnimationName = getAnimationName(stylesRef.current);
902
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
903
+ }, [state]);
904
+ useLayoutEffect2(() => {
905
+ const styles = stylesRef.current;
906
+ const wasPresent = prevPresentRef.current;
907
+ const hasPresentChanged = wasPresent !== present;
908
+ if (hasPresentChanged) {
909
+ const prevAnimationName = prevAnimationNameRef.current;
910
+ const currentAnimationName = getAnimationName(styles);
911
+ if (present) {
912
+ send("MOUNT");
913
+ } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
914
+ send("UNMOUNT");
915
+ } else {
916
+ const isAnimating = prevAnimationName !== currentAnimationName;
917
+ if (wasPresent && isAnimating) {
918
+ send("ANIMATION_OUT");
919
+ } else {
920
+ send("UNMOUNT");
921
+ }
922
+ }
923
+ prevPresentRef.current = present;
924
+ }
925
+ }, [present, send]);
926
+ useLayoutEffect2(() => {
927
+ var _a;
928
+ if (node) {
929
+ let timeoutId;
930
+ const ownerWindow = (_a = node.ownerDocument.defaultView) != null ? _a : window;
931
+ const handleAnimationEnd = (event) => {
932
+ const currentAnimationName = getAnimationName(stylesRef.current);
933
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
934
+ if (event.target === node && isCurrentAnimation) {
935
+ send("ANIMATION_END");
936
+ if (!prevPresentRef.current) {
937
+ const currentFillMode = node.style.animationFillMode;
938
+ node.style.animationFillMode = "forwards";
939
+ timeoutId = ownerWindow.setTimeout(() => {
940
+ if (node.style.animationFillMode === "forwards") {
941
+ node.style.animationFillMode = currentFillMode;
942
+ }
943
+ });
944
+ }
945
+ }
946
+ };
947
+ const handleAnimationStart = (event) => {
948
+ if (event.target === node) {
949
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
950
+ }
951
+ };
952
+ node.addEventListener("animationstart", handleAnimationStart);
953
+ node.addEventListener("animationcancel", handleAnimationEnd);
954
+ node.addEventListener("animationend", handleAnimationEnd);
955
+ return () => {
956
+ ownerWindow.clearTimeout(timeoutId);
957
+ node.removeEventListener("animationstart", handleAnimationStart);
958
+ node.removeEventListener("animationcancel", handleAnimationEnd);
959
+ node.removeEventListener("animationend", handleAnimationEnd);
960
+ };
961
+ } else {
962
+ send("ANIMATION_END");
963
+ }
964
+ }, [node, send]);
965
+ return {
966
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
967
+ ref: React23.useCallback((node2) => {
968
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
969
+ setNode(node2);
970
+ }, [])
971
+ };
972
+ }
973
+ function getAnimationName(styles) {
974
+ return (styles == null ? void 0 : styles.animationName) || "none";
975
+ }
976
+ function getElementRef(element) {
977
+ var _a, _b;
978
+ let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
979
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
980
+ if (mayWarn) {
981
+ return element.ref;
982
+ }
983
+ getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
984
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
985
+ if (mayWarn) {
986
+ return element.props.ref;
987
+ }
988
+ return element.props.ref || element.ref;
989
+ }
990
+
991
+ // ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
992
+
993
+ var count2 = 0;
994
+ function useFocusGuards() {
995
+ React12.useEffect(() => {
996
+ var _a, _b;
997
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
998
+ document.body.insertAdjacentElement("afterbegin", (_a = edgeGuards[0]) != null ? _a : createFocusGuard());
999
+ document.body.insertAdjacentElement("beforeend", (_b = edgeGuards[1]) != null ? _b : createFocusGuard());
1000
+ count2++;
1001
+ return () => {
1002
+ if (count2 === 1) {
1003
+ document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
1004
+ }
1005
+ count2--;
1006
+ };
1007
+ }, []);
1008
+ }
1009
+ function createFocusGuard() {
1010
+ const element = document.createElement("span");
1011
+ element.setAttribute("data-radix-focus-guard", "");
1012
+ element.tabIndex = 0;
1013
+ element.style.outline = "none";
1014
+ element.style.opacity = "0";
1015
+ element.style.position = "fixed";
1016
+ element.style.pointerEvents = "none";
1017
+ return element;
1018
+ }
1019
+
1020
+ // ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
1021
+ var __assign = function() {
1022
+ __assign = Object.assign || function __assign2(t) {
1023
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1024
+ s = arguments[i];
1025
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
1026
+ }
1027
+ return t;
1028
+ };
1029
+ return __assign.apply(this, arguments);
1030
+ };
1031
+ function __rest(s, e) {
1032
+ var t = {};
1033
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1034
+ t[p] = s[p];
1035
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1036
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1037
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1038
+ t[p[i]] = s[p[i]];
1039
+ }
1040
+ return t;
1041
+ }
1042
+ function __spreadArray(to, from, pack) {
1043
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1044
+ if (ar || !(i in from)) {
1045
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1046
+ ar[i] = from[i];
1047
+ }
1048
+ }
1049
+ return to.concat(ar || Array.prototype.slice.call(from));
1050
+ }
1051
+
1052
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
1053
+
1054
+
1055
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
1056
+
1057
+
1058
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
1059
+ var zeroRightClassName = "right-scroll-bar-position";
1060
+ var fullWidthClassName = "width-before-scroll-bar";
1061
+ var noScrollbarsClassName = "with-scroll-bars-hidden";
1062
+ var removedBarSizeVariable = "--removed-body-scroll-bar-size";
1063
+
1064
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
1065
+ function assignRef(ref, value) {
1066
+ if (typeof ref === "function") {
1067
+ ref(value);
1068
+ } else if (ref) {
1069
+ ref.current = value;
1070
+ }
1071
+ return ref;
1072
+ }
1073
+
1074
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js
1075
+
1076
+ function useCallbackRef2(initialValue, callback) {
1077
+ var ref = _react.useState.call(void 0, function() {
1078
+ return {
1079
+ // value
1080
+ value: initialValue,
1081
+ // last callback
1082
+ callback,
1083
+ // "memoized" public interface
1084
+ facade: {
1085
+ get current() {
1086
+ return ref.value;
1087
+ },
1088
+ set current(value) {
1089
+ var last = ref.value;
1090
+ if (last !== value) {
1091
+ ref.value = value;
1092
+ ref.callback(value, last);
1093
+ }
1094
+ }
1095
+ }
1096
+ };
1097
+ })[0];
1098
+ ref.callback = callback;
1099
+ return ref.facade;
1100
+ }
1101
+
1102
+ // ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
1103
+
1104
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React13.useLayoutEffect : React13.useEffect;
1105
+ var currentValues = /* @__PURE__ */ new WeakMap();
1106
+ function useMergeRefs(refs, defaultValue) {
1107
+ var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
1108
+ return refs.forEach(function(ref) {
1109
+ return assignRef(ref, newValue);
1110
+ });
1111
+ });
1112
+ useIsomorphicLayoutEffect(function() {
1113
+ var oldValue = currentValues.get(callbackRef);
1114
+ if (oldValue) {
1115
+ var prevRefs_1 = new Set(oldValue);
1116
+ var nextRefs_1 = new Set(refs);
1117
+ var current_1 = callbackRef.current;
1118
+ prevRefs_1.forEach(function(ref) {
1119
+ if (!nextRefs_1.has(ref)) {
1120
+ assignRef(ref, null);
1121
+ }
1122
+ });
1123
+ nextRefs_1.forEach(function(ref) {
1124
+ if (!prevRefs_1.has(ref)) {
1125
+ assignRef(ref, current_1);
1126
+ }
1127
+ });
1128
+ }
1129
+ currentValues.set(callbackRef, refs);
1130
+ }, [refs]);
1131
+ return callbackRef;
1132
+ }
1133
+
1134
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js
1135
+ function ItoI(a) {
1136
+ return a;
1137
+ }
1138
+ function innerCreateMedium(defaults, middleware) {
1139
+ if (middleware === void 0) {
1140
+ middleware = ItoI;
1141
+ }
1142
+ var buffer = [];
1143
+ var assigned = false;
1144
+ var medium = {
1145
+ read: function() {
1146
+ if (assigned) {
1147
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
1148
+ }
1149
+ if (buffer.length) {
1150
+ return buffer[buffer.length - 1];
1151
+ }
1152
+ return defaults;
1153
+ },
1154
+ useMedium: function(data) {
1155
+ var item = middleware(data, assigned);
1156
+ buffer.push(item);
1157
+ return function() {
1158
+ buffer = buffer.filter(function(x) {
1159
+ return x !== item;
1160
+ });
1161
+ };
1162
+ },
1163
+ assignSyncMedium: function(cb) {
1164
+ assigned = true;
1165
+ while (buffer.length) {
1166
+ var cbs = buffer;
1167
+ buffer = [];
1168
+ cbs.forEach(cb);
1169
+ }
1170
+ buffer = {
1171
+ push: function(x) {
1172
+ return cb(x);
1173
+ },
1174
+ filter: function() {
1175
+ return buffer;
1176
+ }
1177
+ };
1178
+ },
1179
+ assignMedium: function(cb) {
1180
+ assigned = true;
1181
+ var pendingQueue = [];
1182
+ if (buffer.length) {
1183
+ var cbs = buffer;
1184
+ buffer = [];
1185
+ cbs.forEach(cb);
1186
+ pendingQueue = buffer;
1187
+ }
1188
+ var executeQueue = function() {
1189
+ var cbs2 = pendingQueue;
1190
+ pendingQueue = [];
1191
+ cbs2.forEach(cb);
1192
+ };
1193
+ var cycle = function() {
1194
+ return Promise.resolve().then(executeQueue);
1195
+ };
1196
+ cycle();
1197
+ buffer = {
1198
+ push: function(x) {
1199
+ pendingQueue.push(x);
1200
+ cycle();
1201
+ },
1202
+ filter: function(filter) {
1203
+ pendingQueue = pendingQueue.filter(filter);
1204
+ return buffer;
1205
+ }
1206
+ };
1207
+ }
1208
+ };
1209
+ return medium;
1210
+ }
1211
+ function createSidecarMedium(options) {
1212
+ if (options === void 0) {
1213
+ options = {};
1214
+ }
1215
+ var medium = innerCreateMedium(null);
1216
+ medium.options = __assign({ async: true, ssr: false }, options);
1217
+ return medium;
1218
+ }
1219
+
1220
+ // ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js
1221
+
1222
+ var SideCar = function(_a) {
1223
+ var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
1224
+ if (!sideCar) {
1225
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
1226
+ }
1227
+ var Target = sideCar.read();
1228
+ if (!Target) {
1229
+ throw new Error("Sidecar medium not found");
1230
+ }
1231
+ return React14.createElement(Target, __assign({}, rest));
1232
+ };
1233
+ SideCar.isSideCarExport = true;
1234
+ function exportSidecar(medium, exported) {
1235
+ medium.useMedium(exported);
1236
+ return SideCar;
1237
+ }
1238
+
1239
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js
1240
+ var effectCar = createSidecarMedium();
1241
+
1242
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
1243
+ var nothing = function() {
1244
+ return;
1245
+ };
1246
+ var RemoveScroll = React15.forwardRef(function(props, parentRef) {
1247
+ var ref = React15.useRef(null);
1248
+ var _a = React15.useState({
1249
+ onScrollCapture: nothing,
1250
+ onWheelCapture: nothing,
1251
+ onTouchMoveCapture: nothing
1252
+ }), callbacks = _a[0], setCallbacks = _a[1];
1253
+ 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"]);
1254
+ var SideCar2 = sideCar;
1255
+ var containerRef = useMergeRefs([ref, parentRef]);
1256
+ var containerProps = __assign(__assign({}, rest), callbacks);
1257
+ return React15.createElement(
1258
+ React15.Fragment,
1259
+ null,
1260
+ enabled && React15.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
1261
+ forwardProps ? React15.cloneElement(React15.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React15.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
1262
+ );
1263
+ });
1264
+ RemoveScroll.defaultProps = {
1265
+ enabled: true,
1266
+ removeScrollBar: true,
1267
+ inert: false
1268
+ };
1269
+ RemoveScroll.classNames = {
1270
+ fullWidth: fullWidthClassName,
1271
+ zeroRight: zeroRightClassName
1272
+ };
1273
+
1274
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1275
+
1276
+
1277
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
1278
+
1279
+
1280
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
1281
+
1282
+
1283
+ // ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
1284
+ var currentNonce;
1285
+ var getNonce = function() {
1286
+ if (currentNonce) {
1287
+ return currentNonce;
1288
+ }
1289
+ if (typeof __webpack_nonce__ !== "undefined") {
1290
+ return __webpack_nonce__;
1291
+ }
1292
+ return void 0;
1293
+ };
1294
+
1295
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js
1296
+ function makeStyleTag() {
1297
+ if (!document)
1298
+ return null;
1299
+ var tag = document.createElement("style");
1300
+ tag.type = "text/css";
1301
+ var nonce = getNonce();
1302
+ if (nonce) {
1303
+ tag.setAttribute("nonce", nonce);
1304
+ }
1305
+ return tag;
1306
+ }
1307
+ function injectStyles(tag, css) {
1308
+ if (tag.styleSheet) {
1309
+ tag.styleSheet.cssText = css;
1310
+ } else {
1311
+ tag.appendChild(document.createTextNode(css));
1312
+ }
1313
+ }
1314
+ function insertStyleTag(tag) {
1315
+ var head = document.head || document.getElementsByTagName("head")[0];
1316
+ head.appendChild(tag);
1317
+ }
1318
+ var stylesheetSingleton = function() {
1319
+ var counter = 0;
1320
+ var stylesheet = null;
1321
+ return {
1322
+ add: function(style) {
1323
+ if (counter == 0) {
1324
+ if (stylesheet = makeStyleTag()) {
1325
+ injectStyles(stylesheet, style);
1326
+ insertStyleTag(stylesheet);
1327
+ }
1328
+ }
1329
+ counter++;
1330
+ },
1331
+ remove: function() {
1332
+ counter--;
1333
+ if (!counter && stylesheet) {
1334
+ stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
1335
+ stylesheet = null;
1336
+ }
1337
+ }
1338
+ };
1339
+ };
1340
+
1341
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
1342
+ var styleHookSingleton = function() {
1343
+ var sheet = stylesheetSingleton();
1344
+ return function(styles, isDynamic) {
1345
+ React16.useEffect(function() {
1346
+ sheet.add(styles);
1347
+ return function() {
1348
+ sheet.remove();
1349
+ };
1350
+ }, [styles && isDynamic]);
1351
+ };
1352
+ };
1353
+
1354
+ // ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js
1355
+ var styleSingleton = function() {
1356
+ var useStyle = styleHookSingleton();
1357
+ var Sheet = function(_a) {
1358
+ var styles = _a.styles, dynamic = _a.dynamic;
1359
+ useStyle(styles, dynamic);
1360
+ return null;
1361
+ };
1362
+ return Sheet;
1363
+ };
1364
+
1365
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
1366
+ var zeroGap = {
1367
+ left: 0,
1368
+ top: 0,
1369
+ right: 0,
1370
+ gap: 0
1371
+ };
1372
+ var parse = function(x) {
1373
+ return parseInt(x || "", 10) || 0;
1374
+ };
1375
+ var getOffset = function(gapMode) {
1376
+ var cs = window.getComputedStyle(document.body);
1377
+ var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
1378
+ var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
1379
+ var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
1380
+ return [parse(left), parse(top), parse(right)];
1381
+ };
1382
+ var getGapWidth = function(gapMode) {
1383
+ if (gapMode === void 0) {
1384
+ gapMode = "margin";
1385
+ }
1386
+ if (typeof window === "undefined") {
1387
+ return zeroGap;
1388
+ }
1389
+ var offsets = getOffset(gapMode);
1390
+ var documentWidth = document.documentElement.clientWidth;
1391
+ var windowWidth = window.innerWidth;
1392
+ return {
1393
+ left: offsets[0],
1394
+ top: offsets[1],
1395
+ right: offsets[2],
1396
+ gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
1397
+ };
1398
+ };
1399
+
1400
+ // ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
1401
+ var Style = styleSingleton();
1402
+ var lockAttribute = "data-scroll-locked";
1403
+ var getStyles = function(_a, allowRelative, gapMode, important) {
1404
+ var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
1405
+ if (gapMode === void 0) {
1406
+ gapMode = "margin";
1407
+ }
1408
+ 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([
1409
+ allowRelative && "position: relative ".concat(important, ";"),
1410
+ 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 "),
1411
+ gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
1412
+ ].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");
1413
+ };
1414
+ var getCurrentUseCounter = function() {
1415
+ var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
1416
+ return isFinite(counter) ? counter : 0;
1417
+ };
1418
+ var useLockAttribute = function() {
1419
+ React17.useEffect(function() {
1420
+ document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
1421
+ return function() {
1422
+ var newCounter = getCurrentUseCounter() - 1;
1423
+ if (newCounter <= 0) {
1424
+ document.body.removeAttribute(lockAttribute);
1425
+ } else {
1426
+ document.body.setAttribute(lockAttribute, newCounter.toString());
1427
+ }
1428
+ };
1429
+ }, []);
1430
+ };
1431
+ var RemoveScrollBar = function(_a) {
1432
+ var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
1433
+ useLockAttribute();
1434
+ var gap = React17.useMemo(function() {
1435
+ return getGapWidth(gapMode);
1436
+ }, [gapMode]);
1437
+ return React17.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
1438
+ };
1439
+
1440
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
1441
+ var passiveSupported = false;
1442
+ if (typeof window !== "undefined") {
1443
+ try {
1444
+ options = Object.defineProperty({}, "passive", {
1445
+ get: function() {
1446
+ passiveSupported = true;
1447
+ return true;
1448
+ }
1449
+ });
1450
+ window.addEventListener("test", options, options);
1451
+ window.removeEventListener("test", options, options);
1452
+ } catch (err) {
1453
+ passiveSupported = false;
1454
+ }
1455
+ }
1456
+ var options;
1457
+ var nonPassive = passiveSupported ? { passive: false } : false;
1458
+
1459
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
1460
+ var alwaysContainsScroll = function(node) {
1461
+ return node.tagName === "TEXTAREA";
1462
+ };
1463
+ var elementCanBeScrolled = function(node, overflow) {
1464
+ if (!(node instanceof Element)) {
1465
+ return false;
1466
+ }
1467
+ var styles = window.getComputedStyle(node);
1468
+ return (
1469
+ // not-not-scrollable
1470
+ styles[overflow] !== "hidden" && // contains scroll inside self
1471
+ !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
1472
+ );
1473
+ };
1474
+ var elementCouldBeVScrolled = function(node) {
1475
+ return elementCanBeScrolled(node, "overflowY");
1476
+ };
1477
+ var elementCouldBeHScrolled = function(node) {
1478
+ return elementCanBeScrolled(node, "overflowX");
1479
+ };
1480
+ var locationCouldBeScrolled = function(axis, node) {
1481
+ var ownerDocument = node.ownerDocument;
1482
+ var current = node;
1483
+ do {
1484
+ if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
1485
+ current = current.host;
1486
+ }
1487
+ var isScrollable = elementCouldBeScrolled(axis, current);
1488
+ if (isScrollable) {
1489
+ var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
1490
+ if (scrollHeight > clientHeight) {
1491
+ return true;
1492
+ }
1493
+ }
1494
+ current = current.parentNode;
1495
+ } while (current && current !== ownerDocument.body);
1496
+ return false;
1497
+ };
1498
+ var getVScrollVariables = function(_a) {
1499
+ var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
1500
+ return [
1501
+ scrollTop,
1502
+ scrollHeight,
1503
+ clientHeight
1504
+ ];
1505
+ };
1506
+ var getHScrollVariables = function(_a) {
1507
+ var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
1508
+ return [
1509
+ scrollLeft,
1510
+ scrollWidth,
1511
+ clientWidth
1512
+ ];
1513
+ };
1514
+ var elementCouldBeScrolled = function(axis, node) {
1515
+ return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
1516
+ };
1517
+ var getScrollVariables = function(axis, node) {
1518
+ return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
1519
+ };
1520
+ var getDirectionFactor = function(axis, direction) {
1521
+ return axis === "h" && direction === "rtl" ? -1 : 1;
1522
+ };
1523
+ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
1524
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
1525
+ var delta = directionFactor * sourceDelta;
1526
+ var target = event.target;
1527
+ var targetInLock = endTarget.contains(target);
1528
+ var shouldCancelScroll = false;
1529
+ var isDeltaPositive = delta > 0;
1530
+ var availableScroll = 0;
1531
+ var availableScrollTop = 0;
1532
+ do {
1533
+ if (!target) {
1534
+ break;
1535
+ }
1536
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
1537
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
1538
+ if (position || elementScroll) {
1539
+ if (elementCouldBeScrolled(axis, target)) {
1540
+ availableScroll += elementScroll;
1541
+ availableScrollTop += position;
1542
+ }
1543
+ }
1544
+ var parent_1 = target.parentNode;
1545
+ target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
1546
+ } while (
1547
+ // portaled content
1548
+ !targetInLock && target !== document.body || // self content
1549
+ targetInLock && (endTarget.contains(target) || endTarget === target)
1550
+ );
1551
+ if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
1552
+ shouldCancelScroll = true;
1553
+ } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
1554
+ shouldCancelScroll = true;
1555
+ }
1556
+ return shouldCancelScroll;
1557
+ };
1558
+
1559
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1560
+ var getTouchXY = function(event) {
1561
+ return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
1562
+ };
1563
+ var getDeltaXY = function(event) {
1564
+ return [event.deltaX, event.deltaY];
1565
+ };
1566
+ var extractRef = function(ref) {
1567
+ return ref && "current" in ref ? ref.current : ref;
1568
+ };
1569
+ var deltaCompare = function(x, y) {
1570
+ return x[0] === y[0] && x[1] === y[1];
1571
+ };
1572
+ var generateStyle = function(id) {
1573
+ return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
1574
+ };
1575
+ var idCounter = 0;
1576
+ var lockStack = [];
1577
+ function RemoveScrollSideCar(props) {
1578
+ var shouldPreventQueue = React18.useRef([]);
1579
+ var touchStartRef = React18.useRef([0, 0]);
1580
+ var activeAxis = React18.useRef();
1581
+ var id = React18.useState(idCounter++)[0];
1582
+ var Style2 = React18.useState(styleSingleton)[0];
1583
+ var lastProps = React18.useRef(props);
1584
+ React18.useEffect(function() {
1585
+ lastProps.current = props;
1586
+ }, [props]);
1587
+ React18.useEffect(function() {
1588
+ if (props.inert) {
1589
+ document.body.classList.add("block-interactivity-".concat(id));
1590
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
1591
+ allow_1.forEach(function(el) {
1592
+ return el.classList.add("allow-interactivity-".concat(id));
1593
+ });
1594
+ return function() {
1595
+ document.body.classList.remove("block-interactivity-".concat(id));
1596
+ allow_1.forEach(function(el) {
1597
+ return el.classList.remove("allow-interactivity-".concat(id));
1598
+ });
1599
+ };
1600
+ }
1601
+ return;
1602
+ }, [props.inert, props.lockRef.current, props.shards]);
1603
+ var shouldCancelEvent = React18.useCallback(function(event, parent) {
1604
+ if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
1605
+ return !lastProps.current.allowPinchZoom;
1606
+ }
1607
+ var touch = getTouchXY(event);
1608
+ var touchStart = touchStartRef.current;
1609
+ var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
1610
+ var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
1611
+ var currentAxis;
1612
+ var target = event.target;
1613
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
1614
+ if ("touches" in event && moveDirection === "h" && target.type === "range") {
1615
+ return false;
1616
+ }
1617
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1618
+ if (!canBeScrolledInMainDirection) {
1619
+ return true;
1620
+ }
1621
+ if (canBeScrolledInMainDirection) {
1622
+ currentAxis = moveDirection;
1623
+ } else {
1624
+ currentAxis = moveDirection === "v" ? "h" : "v";
1625
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1626
+ }
1627
+ if (!canBeScrolledInMainDirection) {
1628
+ return false;
1629
+ }
1630
+ if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
1631
+ activeAxis.current = currentAxis;
1632
+ }
1633
+ if (!currentAxis) {
1634
+ return true;
1635
+ }
1636
+ var cancelingAxis = activeAxis.current || currentAxis;
1637
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
1638
+ }, []);
1639
+ var shouldPrevent = React18.useCallback(function(_event) {
1640
+ var event = _event;
1641
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
1642
+ return;
1643
+ }
1644
+ var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
1645
+ var sourceEvent = shouldPreventQueue.current.filter(function(e) {
1646
+ return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
1647
+ })[0];
1648
+ if (sourceEvent && sourceEvent.should) {
1649
+ if (event.cancelable) {
1650
+ event.preventDefault();
1651
+ }
1652
+ return;
1653
+ }
1654
+ if (!sourceEvent) {
1655
+ var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
1656
+ return node.contains(event.target);
1657
+ });
1658
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
1659
+ if (shouldStop) {
1660
+ if (event.cancelable) {
1661
+ event.preventDefault();
1662
+ }
1663
+ }
1664
+ }
1665
+ }, []);
1666
+ var shouldCancel = React18.useCallback(function(name, delta, target, should) {
1667
+ var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
1668
+ shouldPreventQueue.current.push(event);
1669
+ setTimeout(function() {
1670
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
1671
+ return e !== event;
1672
+ });
1673
+ }, 1);
1674
+ }, []);
1675
+ var scrollTouchStart = React18.useCallback(function(event) {
1676
+ touchStartRef.current = getTouchXY(event);
1677
+ activeAxis.current = void 0;
1678
+ }, []);
1679
+ var scrollWheel = React18.useCallback(function(event) {
1680
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1681
+ }, []);
1682
+ var scrollTouchMove = React18.useCallback(function(event) {
1683
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1684
+ }, []);
1685
+ React18.useEffect(function() {
1686
+ lockStack.push(Style2);
1687
+ props.setCallbacks({
1688
+ onScrollCapture: scrollWheel,
1689
+ onWheelCapture: scrollWheel,
1690
+ onTouchMoveCapture: scrollTouchMove
1691
+ });
1692
+ document.addEventListener("wheel", shouldPrevent, nonPassive);
1693
+ document.addEventListener("touchmove", shouldPrevent, nonPassive);
1694
+ document.addEventListener("touchstart", scrollTouchStart, nonPassive);
1695
+ return function() {
1696
+ lockStack = lockStack.filter(function(inst) {
1697
+ return inst !== Style2;
1698
+ });
1699
+ document.removeEventListener("wheel", shouldPrevent, nonPassive);
1700
+ document.removeEventListener("touchmove", shouldPrevent, nonPassive);
1701
+ document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
1702
+ };
1703
+ }, []);
1704
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
1705
+ return React18.createElement(
1706
+ React18.Fragment,
1707
+ null,
1708
+ inert ? React18.createElement(Style2, { styles: generateStyle(id) }) : null,
1709
+ removeScrollBar ? React18.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
1710
+ );
1711
+ }
1712
+ function getOutermostShadowParent(node) {
1713
+ var shadowParent = null;
1714
+ while (node !== null) {
1715
+ if (node instanceof ShadowRoot) {
1716
+ shadowParent = node.host;
1717
+ node = node.host;
1718
+ }
1719
+ node = node.parentNode;
1720
+ }
1721
+ return shadowParent;
1722
+ }
1723
+
1724
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
1725
+ var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
1726
+
1727
+ // ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
1728
+ var ReactRemoveScroll = React19.forwardRef(function(props, ref) {
1729
+ return React19.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
1730
+ });
1731
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
1732
+ var Combination_default = ReactRemoveScroll;
1733
+
1734
+ // ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
1735
+ var getDefaultParent = function(originalTarget) {
1736
+ if (typeof document === "undefined") {
1737
+ return null;
1738
+ }
1739
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
1740
+ return sampleTarget.ownerDocument.body;
1741
+ };
1742
+ var counterMap = /* @__PURE__ */ new WeakMap();
1743
+ var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
1744
+ var markerMap = {};
1745
+ var lockCount = 0;
1746
+ var unwrapHost = function(node) {
1747
+ return node && (node.host || unwrapHost(node.parentNode));
1748
+ };
1749
+ var correctTargets = function(parent, targets) {
1750
+ return targets.map(function(target) {
1751
+ if (parent.contains(target)) {
1752
+ return target;
1753
+ }
1754
+ var correctedTarget = unwrapHost(target);
1755
+ if (correctedTarget && parent.contains(correctedTarget)) {
1756
+ return correctedTarget;
1757
+ }
1758
+ console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
1759
+ return null;
1760
+ }).filter(function(x) {
1761
+ return Boolean(x);
1762
+ });
1763
+ };
1764
+ var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
1765
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1766
+ if (!markerMap[markerName]) {
1767
+ markerMap[markerName] = /* @__PURE__ */ new WeakMap();
1768
+ }
1769
+ var markerCounter = markerMap[markerName];
1770
+ var hiddenNodes = [];
1771
+ var elementsToKeep = /* @__PURE__ */ new Set();
1772
+ var elementsToStop = new Set(targets);
1773
+ var keep = function(el) {
1774
+ if (!el || elementsToKeep.has(el)) {
1775
+ return;
1776
+ }
1777
+ elementsToKeep.add(el);
1778
+ keep(el.parentNode);
1779
+ };
1780
+ targets.forEach(keep);
1781
+ var deep = function(parent) {
1782
+ if (!parent || elementsToStop.has(parent)) {
1783
+ return;
1784
+ }
1785
+ Array.prototype.forEach.call(parent.children, function(node) {
1786
+ if (elementsToKeep.has(node)) {
1787
+ deep(node);
1788
+ } else {
1789
+ try {
1790
+ var attr = node.getAttribute(controlAttribute);
1791
+ var alreadyHidden = attr !== null && attr !== "false";
1792
+ var counterValue = (counterMap.get(node) || 0) + 1;
1793
+ var markerValue = (markerCounter.get(node) || 0) + 1;
1794
+ counterMap.set(node, counterValue);
1795
+ markerCounter.set(node, markerValue);
1796
+ hiddenNodes.push(node);
1797
+ if (counterValue === 1 && alreadyHidden) {
1798
+ uncontrolledNodes.set(node, true);
1799
+ }
1800
+ if (markerValue === 1) {
1801
+ node.setAttribute(markerName, "true");
1802
+ }
1803
+ if (!alreadyHidden) {
1804
+ node.setAttribute(controlAttribute, "true");
1805
+ }
1806
+ } catch (e) {
1807
+ console.error("aria-hidden: cannot operate on ", node, e);
1808
+ }
1809
+ }
1810
+ });
1811
+ };
1812
+ deep(parentNode);
1813
+ elementsToKeep.clear();
1814
+ lockCount++;
1815
+ return function() {
1816
+ hiddenNodes.forEach(function(node) {
1817
+ var counterValue = counterMap.get(node) - 1;
1818
+ var markerValue = markerCounter.get(node) - 1;
1819
+ counterMap.set(node, counterValue);
1820
+ markerCounter.set(node, markerValue);
1821
+ if (!counterValue) {
1822
+ if (!uncontrolledNodes.has(node)) {
1823
+ node.removeAttribute(controlAttribute);
1824
+ }
1825
+ uncontrolledNodes.delete(node);
1826
+ }
1827
+ if (!markerValue) {
1828
+ node.removeAttribute(markerName);
1829
+ }
1830
+ });
1831
+ lockCount--;
1832
+ if (!lockCount) {
1833
+ counterMap = /* @__PURE__ */ new WeakMap();
1834
+ counterMap = /* @__PURE__ */ new WeakMap();
1835
+ uncontrolledNodes = /* @__PURE__ */ new WeakMap();
1836
+ markerMap = {};
1837
+ }
1838
+ };
1839
+ };
1840
+ var hideOthers = function(originalTarget, parentNode, markerName) {
1841
+ if (markerName === void 0) {
1842
+ markerName = "data-aria-hidden";
1843
+ }
1844
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1845
+ var activeParentNode = parentNode || getDefaultParent(originalTarget);
1846
+ if (!activeParentNode) {
1847
+ return function() {
1848
+ return null;
1849
+ };
1850
+ }
1851
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
1852
+ return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
1853
+ };
1854
+
1855
+ // ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
1856
+
1857
+ var DIALOG_NAME = "Dialog";
1858
+ var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
1859
+ var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
1860
+ var Dialog = (props) => {
1861
+ const {
1862
+ __scopeDialog,
1863
+ children,
1864
+ open: openProp,
1865
+ defaultOpen,
1866
+ onOpenChange,
1867
+ modal = true
1868
+ } = props;
1869
+ const triggerRef = React20.useRef(null);
1870
+ const contentRef = React20.useRef(null);
1871
+ const [open, setOpen] = useControllableState({
1872
+ prop: openProp,
1873
+ defaultProp: defaultOpen != null ? defaultOpen : false,
1874
+ onChange: onOpenChange,
1875
+ caller: DIALOG_NAME
1876
+ });
1877
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1878
+ DialogProvider,
1879
+ {
1880
+ scope: __scopeDialog,
1881
+ triggerRef,
1882
+ contentRef,
1883
+ contentId: useId(),
1884
+ titleId: useId(),
1885
+ descriptionId: useId(),
1886
+ open,
1887
+ onOpenChange: setOpen,
1888
+ onOpenToggle: React20.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
1889
+ modal,
1890
+ children
1891
+ }
1892
+ );
1893
+ };
1894
+ Dialog.displayName = DIALOG_NAME;
1895
+ var TRIGGER_NAME = "DialogTrigger";
1896
+ var DialogTrigger = React20.forwardRef(
1897
+ (props, forwardedRef) => {
1898
+ const _a = props, { __scopeDialog } = _a, triggerProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog"]);
1899
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
1900
+ const composedTriggerRef = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, context.triggerRef);
1901
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1902
+ Primitive.button,
1903
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
1904
+ type: "button",
1905
+ "aria-haspopup": "dialog",
1906
+ "aria-expanded": context.open,
1907
+ "aria-controls": context.contentId,
1908
+ "data-state": getState(context.open)
1909
+ }, triggerProps), {
1910
+ ref: composedTriggerRef,
1911
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
1912
+ })
1913
+ );
1914
+ }
1915
+ );
1916
+ DialogTrigger.displayName = TRIGGER_NAME;
1917
+ var PORTAL_NAME2 = "DialogPortal";
1918
+ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
1919
+ forceMount: void 0
1920
+ });
1921
+ var DialogPortal = (props) => {
1922
+ const { __scopeDialog, forceMount, children, container } = props;
1923
+ const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
1924
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PortalProvider, { scope: __scopeDialog, forceMount, children: React20.Children.map(children, (child) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Presence, { present: forceMount || context.open, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Portal, { asChild: true, container, children: child }) })) });
1925
+ };
1926
+ DialogPortal.displayName = PORTAL_NAME2;
1927
+ var OVERLAY_NAME = "DialogOverlay";
1928
+ var DialogOverlay = React20.forwardRef(
1929
+ (props, forwardedRef) => {
1930
+ const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
1931
+ const _a = props, { forceMount = portalContext.forceMount } = _a, overlayProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["forceMount"]);
1932
+ const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
1933
+ return context.modal ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Presence, { present: forceMount || context.open, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DialogOverlayImpl, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, overlayProps), { ref: forwardedRef })) }) : null;
1934
+ }
1935
+ );
1936
+ DialogOverlay.displayName = OVERLAY_NAME;
1937
+ var Slot = _chunk6MM7HLNXjs.createSlot.call(void 0, "DialogOverlay.RemoveScroll");
1938
+ var DialogOverlayImpl = React20.forwardRef(
1939
+ (props, forwardedRef) => {
1940
+ const _a = props, { __scopeDialog } = _a, overlayProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog"]);
1941
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
1942
+ return (
1943
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1944
+ // ie. when `Overlay` and `Content` are siblings
1945
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Combination_default, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1946
+ Primitive.div,
1947
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
1948
+ "data-state": getState(context.open)
1949
+ }, overlayProps), {
1950
+ ref: forwardedRef,
1951
+ style: _chunkLZLW5WCCjs.__spreadValues.call(void 0, { pointerEvents: "auto" }, overlayProps.style)
1952
+ })
1953
+ ) })
1954
+ );
1955
+ }
1956
+ );
1957
+ var CONTENT_NAME = "DialogContent";
1958
+ var DialogContent = React20.forwardRef(
1959
+ (props, forwardedRef) => {
1960
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
1961
+ const _a = props, { forceMount = portalContext.forceMount } = _a, contentProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["forceMount"]);
1962
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
1963
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DialogContentModal, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DialogContentNonModal, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, contentProps), { ref: forwardedRef })) });
1964
+ }
1965
+ );
1966
+ DialogContent.displayName = CONTENT_NAME;
1967
+ var DialogContentModal = React20.forwardRef(
1968
+ (props, forwardedRef) => {
1969
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
1970
+ const contentRef = React20.useRef(null);
1971
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, context.contentRef, contentRef);
1972
+ React20.useEffect(() => {
1973
+ const content = contentRef.current;
1974
+ if (content) return hideOthers(content);
1975
+ }, []);
1976
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1977
+ DialogContentImpl,
1978
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, props), {
1979
+ ref: composedRefs,
1980
+ trapFocus: context.open,
1981
+ disableOutsidePointerEvents: true,
1982
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
1983
+ var _a;
1984
+ event.preventDefault();
1985
+ (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
1986
+ }),
1987
+ onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
1988
+ const originalEvent = event.detail.originalEvent;
1989
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
1990
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
1991
+ if (isRightClick) event.preventDefault();
1992
+ }),
1993
+ onFocusOutside: composeEventHandlers(
1994
+ props.onFocusOutside,
1995
+ (event) => event.preventDefault()
1996
+ )
1997
+ })
1998
+ );
1999
+ }
2000
+ );
2001
+ var DialogContentNonModal = React20.forwardRef(
2002
+ (props, forwardedRef) => {
2003
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2004
+ const hasInteractedOutsideRef = React20.useRef(false);
2005
+ const hasPointerDownOutsideRef = React20.useRef(false);
2006
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2007
+ DialogContentImpl,
2008
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, props), {
2009
+ ref: forwardedRef,
2010
+ trapFocus: false,
2011
+ disableOutsidePointerEvents: false,
2012
+ onCloseAutoFocus: (event) => {
2013
+ var _a, _b;
2014
+ (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
2015
+ if (!event.defaultPrevented) {
2016
+ if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
2017
+ event.preventDefault();
2018
+ }
2019
+ hasInteractedOutsideRef.current = false;
2020
+ hasPointerDownOutsideRef.current = false;
2021
+ },
2022
+ onInteractOutside: (event) => {
2023
+ var _a, _b;
2024
+ (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
2025
+ if (!event.defaultPrevented) {
2026
+ hasInteractedOutsideRef.current = true;
2027
+ if (event.detail.originalEvent.type === "pointerdown") {
2028
+ hasPointerDownOutsideRef.current = true;
2029
+ }
2030
+ }
2031
+ const target = event.target;
2032
+ const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
2033
+ if (targetIsTrigger) event.preventDefault();
2034
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
2035
+ event.preventDefault();
2036
+ }
2037
+ }
2038
+ })
2039
+ );
2040
+ }
2041
+ );
2042
+ var DialogContentImpl = React20.forwardRef(
2043
+ (props, forwardedRef) => {
2044
+ const _a = props, { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus } = _a, contentProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog", "trapFocus", "onOpenAutoFocus", "onCloseAutoFocus"]);
2045
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
2046
+ const contentRef = React20.useRef(null);
2047
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, contentRef);
2048
+ useFocusGuards();
2049
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2050
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2051
+ FocusScope,
2052
+ {
2053
+ asChild: true,
2054
+ loop: true,
2055
+ trapped: trapFocus,
2056
+ onMountAutoFocus: onOpenAutoFocus,
2057
+ onUnmountAutoFocus: onCloseAutoFocus,
2058
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2059
+ DismissableLayer,
2060
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2061
+ role: "dialog",
2062
+ id: context.contentId,
2063
+ "aria-describedby": context.descriptionId,
2064
+ "aria-labelledby": context.titleId,
2065
+ "data-state": getState(context.open)
2066
+ }, contentProps), {
2067
+ ref: composedRefs,
2068
+ onDismiss: () => context.onOpenChange(false)
2069
+ })
2070
+ )
2071
+ }
2072
+ ),
2073
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2074
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TitleWarning, { titleId: context.titleId }),
2075
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
2076
+ ] })
2077
+ ] });
2078
+ }
2079
+ );
2080
+ var TITLE_NAME = "DialogTitle";
2081
+ var DialogTitle = React20.forwardRef(
2082
+ (props, forwardedRef) => {
2083
+ const _a = props, { __scopeDialog } = _a, titleProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog"]);
2084
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
2085
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Primitive.h2, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, { id: context.titleId }, titleProps), { ref: forwardedRef }));
2086
+ }
2087
+ );
2088
+ DialogTitle.displayName = TITLE_NAME;
2089
+ var DESCRIPTION_NAME = "DialogDescription";
2090
+ var DialogDescription = React20.forwardRef(
2091
+ (props, forwardedRef) => {
2092
+ const _a = props, { __scopeDialog } = _a, descriptionProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog"]);
2093
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
2094
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Primitive.p, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, { id: context.descriptionId }, descriptionProps), { ref: forwardedRef }));
2095
+ }
2096
+ );
2097
+ DialogDescription.displayName = DESCRIPTION_NAME;
2098
+ var CLOSE_NAME = "DialogClose";
2099
+ var DialogClose = React20.forwardRef(
2100
+ (props, forwardedRef) => {
2101
+ const _a = props, { __scopeDialog } = _a, closeProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeDialog"]);
2102
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
2103
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2104
+ Primitive.button,
2105
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2106
+ type: "button"
2107
+ }, closeProps), {
2108
+ ref: forwardedRef,
2109
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
2110
+ })
2111
+ );
2112
+ }
2113
+ );
2114
+ DialogClose.displayName = CLOSE_NAME;
2115
+ function getState(open) {
2116
+ return open ? "open" : "closed";
2117
+ }
2118
+ var TITLE_WARNING_NAME = "DialogTitleWarning";
2119
+ var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
2120
+ contentName: CONTENT_NAME,
2121
+ titleName: TITLE_NAME,
2122
+ docsSlug: "dialog"
2123
+ });
2124
+ var TitleWarning = ({ titleId }) => {
2125
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
2126
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
2127
+
2128
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
2129
+
2130
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
2131
+ React20.useEffect(() => {
2132
+ if (titleId) {
2133
+ const hasTitle = document.getElementById(titleId);
2134
+ if (!hasTitle) console.error(MESSAGE);
2135
+ }
2136
+ }, [MESSAGE, titleId]);
2137
+ return null;
2138
+ };
2139
+ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
2140
+ var DescriptionWarning = ({ contentRef, descriptionId }) => {
2141
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
2142
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
2143
+ React20.useEffect(() => {
2144
+ var _a;
2145
+ const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
2146
+ if (descriptionId && describedById) {
2147
+ const hasDescription = document.getElementById(descriptionId);
2148
+ if (!hasDescription) console.warn(MESSAGE);
2149
+ }
2150
+ }, [MESSAGE, contentRef, descriptionId]);
2151
+ return null;
2152
+ };
2153
+ var Root = Dialog;
2154
+ var Trigger = DialogTrigger;
2155
+ var Portal2 = DialogPortal;
2156
+ var Overlay = DialogOverlay;
2157
+ var Content = DialogContent;
2158
+ var Title = DialogTitle;
2159
+ var Description = DialogDescription;
2160
+ var Close = DialogClose;
2161
+
2162
+ // ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
2163
+
2164
+ var ROOT_NAME = "AlertDialog";
2165
+ var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
2166
+ createDialogScope
2167
+ ]);
2168
+ var useDialogScope = createDialogScope();
2169
+ var AlertDialog = (props) => {
2170
+ const _a = props, { __scopeAlertDialog } = _a, alertDialogProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2171
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2172
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Root, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), alertDialogProps), { modal: true }));
2173
+ };
2174
+ AlertDialog.displayName = ROOT_NAME;
2175
+ var TRIGGER_NAME2 = "AlertDialogTrigger";
2176
+ var AlertDialogTrigger = React21.forwardRef(
2177
+ (props, forwardedRef) => {
2178
+ const _a = props, { __scopeAlertDialog } = _a, triggerProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2179
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2180
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Trigger, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), triggerProps), { ref: forwardedRef }));
2181
+ }
2182
+ );
2183
+ AlertDialogTrigger.displayName = TRIGGER_NAME2;
2184
+ var PORTAL_NAME3 = "AlertDialogPortal";
2185
+ var AlertDialogPortal = (props) => {
2186
+ const _a = props, { __scopeAlertDialog } = _a, portalProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2187
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2188
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Portal2, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), portalProps));
2189
+ };
2190
+ AlertDialogPortal.displayName = PORTAL_NAME3;
2191
+ var OVERLAY_NAME2 = "AlertDialogOverlay";
2192
+ var AlertDialogOverlay = React21.forwardRef(
2193
+ (props, forwardedRef) => {
2194
+ const _a = props, { __scopeAlertDialog } = _a, overlayProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2195
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2196
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Overlay, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), overlayProps), { ref: forwardedRef }));
2197
+ }
2198
+ );
2199
+ AlertDialogOverlay.displayName = OVERLAY_NAME2;
2200
+ var CONTENT_NAME2 = "AlertDialogContent";
2201
+ var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME2);
2202
+ var Slottable = _chunk6MM7HLNXjs.createSlottable.call(void 0, "AlertDialogContent");
2203
+ var AlertDialogContent = React21.forwardRef(
2204
+ (props, forwardedRef) => {
2205
+ const _a = props, { __scopeAlertDialog, children } = _a, contentProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog", "children"]);
2206
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2207
+ const contentRef = React21.useRef(null);
2208
+ const composedRefs = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, contentRef);
2209
+ const cancelRef = React21.useRef(null);
2210
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2211
+ WarningProvider,
2212
+ {
2213
+ contentName: CONTENT_NAME2,
2214
+ titleName: TITLE_NAME2,
2215
+ docsSlug: "alert-dialog",
2216
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2217
+ Content,
2218
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2219
+ role: "alertdialog"
2220
+ }, dialogScope), contentProps), {
2221
+ ref: composedRefs,
2222
+ onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
2223
+ var _a2;
2224
+ event.preventDefault();
2225
+ (_a2 = cancelRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
2226
+ }),
2227
+ onPointerDownOutside: (event) => event.preventDefault(),
2228
+ onInteractOutside: (event) => event.preventDefault(),
2229
+ children: [
2230
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Slottable, { children }),
2231
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DescriptionWarning2, { contentRef })
2232
+ ]
2233
+ })
2234
+ ) })
2235
+ }
2236
+ );
2237
+ }
2238
+ );
2239
+ AlertDialogContent.displayName = CONTENT_NAME2;
2240
+ var TITLE_NAME2 = "AlertDialogTitle";
2241
+ var AlertDialogTitle = React21.forwardRef(
2242
+ (props, forwardedRef) => {
2243
+ const _a = props, { __scopeAlertDialog } = _a, titleProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2244
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2245
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Title, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), titleProps), { ref: forwardedRef }));
2246
+ }
2247
+ );
2248
+ AlertDialogTitle.displayName = TITLE_NAME2;
2249
+ var DESCRIPTION_NAME2 = "AlertDialogDescription";
2250
+ var AlertDialogDescription = React21.forwardRef((props, forwardedRef) => {
2251
+ const _a = props, { __scopeAlertDialog } = _a, descriptionProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2252
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2253
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Description, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), descriptionProps), { ref: forwardedRef }));
2254
+ });
2255
+ AlertDialogDescription.displayName = DESCRIPTION_NAME2;
2256
+ var ACTION_NAME = "AlertDialogAction";
2257
+ var AlertDialogAction = React21.forwardRef(
2258
+ (props, forwardedRef) => {
2259
+ const _a = props, { __scopeAlertDialog } = _a, actionProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2260
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2261
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Close, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), actionProps), { ref: forwardedRef }));
2262
+ }
2263
+ );
2264
+ AlertDialogAction.displayName = ACTION_NAME;
2265
+ var CANCEL_NAME = "AlertDialogCancel";
2266
+ var AlertDialogCancel = React21.forwardRef(
2267
+ (props, forwardedRef) => {
2268
+ const _a = props, { __scopeAlertDialog } = _a, cancelProps = _chunkLZLW5WCCjs.__objRest.call(void 0, _a, ["__scopeAlertDialog"]);
2269
+ const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
2270
+ const dialogScope = useDialogScope(__scopeAlertDialog);
2271
+ const ref = _chunk6MM7HLNXjs.useComposedRefs.call(void 0, forwardedRef, cancelRef);
2272
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Close, _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, dialogScope), cancelProps), { ref }));
2273
+ }
2274
+ );
2275
+ AlertDialogCancel.displayName = CANCEL_NAME;
2276
+ var DescriptionWarning2 = ({ contentRef }) => {
2277
+ const MESSAGE = `\`${CONTENT_NAME2}\` requires a description for the component to be accessible for screen reader users.
2278
+
2279
+ You can add a description to the \`${CONTENT_NAME2}\` by passing a \`${DESCRIPTION_NAME2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
2280
+
2281
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME2}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
2282
+
2283
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
2284
+ React21.useEffect(() => {
2285
+ var _a;
2286
+ const hasDescription = document.getElementById(
2287
+ (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby")
2288
+ );
2289
+ if (!hasDescription) console.warn(MESSAGE);
2290
+ }, [MESSAGE, contentRef]);
2291
+ return null;
2292
+ };
2293
+ var Root2 = AlertDialog;
2294
+ var Portal22 = AlertDialogPortal;
2295
+ var Overlay2 = AlertDialogOverlay;
2296
+ var Content2 = AlertDialogContent;
2297
+ var Action = AlertDialogAction;
2298
+ var Cancel = AlertDialogCancel;
2299
+ var Title2 = AlertDialogTitle;
2300
+ var Description2 = AlertDialogDescription;
2301
+
2302
+ // ../base-ui/src/ui/alert-dialog.tsx
2303
+
2304
+ var AlertDialog2 = Root2;
2305
+ var AlertDialogPortal2 = Portal22;
2306
+ var AlertDialogOverlay2 = React24.forwardRef((_a, ref) => {
2307
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2308
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2309
+ Overlay2,
2310
+ _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2311
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2312
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
2313
+ className
2314
+ )
2315
+ }, props), {
2316
+ ref
2317
+ })
2318
+ );
2319
+ });
2320
+ AlertDialogOverlay2.displayName = Overlay2.displayName;
2321
+ var AlertDialogContent2 = React24.forwardRef((_a, ref) => {
2322
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2323
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, AlertDialogPortal2, { children: [
2324
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDialogOverlay2, {}),
2325
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2326
+ Content2,
2327
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2328
+ ref,
2329
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2330
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
2331
+ className
2332
+ )
2333
+ }, props)
2334
+ )
2335
+ ] });
2336
+ });
2337
+ AlertDialogContent2.displayName = Content2.displayName;
2338
+ var AlertDialogHeader = (_a) => {
2339
+ var _b = _a, {
2340
+ className
2341
+ } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, [
2342
+ "className"
2343
+ ]);
2344
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2345
+ "div",
2346
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2347
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2348
+ "flex flex-col space-y-2 text-center sm:text-left",
2349
+ className
2350
+ )
2351
+ }, props)
2352
+ );
2353
+ };
2354
+ AlertDialogHeader.displayName = "AlertDialogHeader";
2355
+ var AlertDialogFooter = (_a) => {
2356
+ var _b = _a, {
2357
+ className
2358
+ } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, [
2359
+ "className"
2360
+ ]);
2361
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2362
+ "div",
2363
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2364
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2365
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
2366
+ className
2367
+ )
2368
+ }, props)
2369
+ );
2370
+ };
2371
+ AlertDialogFooter.displayName = "AlertDialogFooter";
2372
+ var AlertDialogTitle2 = React24.forwardRef((_a, ref) => {
2373
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2374
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2375
+ Title2,
2376
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2377
+ ref,
2378
+ className: _chunk6MM7HLNXjs.cn.call(void 0, "text-lg font-semibold", className)
2379
+ }, props)
2380
+ );
2381
+ });
2382
+ AlertDialogTitle2.displayName = Title2.displayName;
2383
+ var AlertDialogDescription2 = React24.forwardRef((_a, ref) => {
2384
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2385
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2386
+ Description2,
2387
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2388
+ ref,
2389
+ className: _chunk6MM7HLNXjs.cn.call(void 0, "text-sm text-muted-foreground", className)
2390
+ }, props)
2391
+ );
2392
+ });
2393
+ AlertDialogDescription2.displayName = Description2.displayName;
2394
+ var AlertDialogAction2 = React24.forwardRef((_a, ref) => {
2395
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2396
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2397
+ Action,
2398
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2399
+ ref,
2400
+ className: _chunk6MM7HLNXjs.cn.call(void 0, _chunk6MM7HLNXjs.buttonVariants.call(void 0, ), className)
2401
+ }, props)
2402
+ );
2403
+ });
2404
+ AlertDialogAction2.displayName = Action.displayName;
2405
+ var AlertDialogCancel2 = React24.forwardRef((_a, ref) => {
2406
+ var _b = _a, { className } = _b, props = _chunkLZLW5WCCjs.__objRest.call(void 0, _b, ["className"]);
2407
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2408
+ Cancel,
2409
+ _chunkLZLW5WCCjs.__spreadValues.call(void 0, {
2410
+ ref,
2411
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2412
+ _chunk6MM7HLNXjs.buttonVariants.call(void 0, { variant: "outline" }),
2413
+ "mt-2 sm:mt-0",
2414
+ className
2415
+ )
2416
+ }, props)
2417
+ );
2418
+ });
2419
+ AlertDialogCancel2.displayName = Cancel.displayName;
2420
+
2421
+ // src/main/ads-alert-dialog.tsx
2422
+
2423
+ function AdsAlertDialog({
2424
+ open,
2425
+ onOpenChange,
2426
+ title,
2427
+ description,
2428
+ imgSrc,
2429
+ imgHref,
2430
+ cancelText,
2431
+ onCancel,
2432
+ confirmText,
2433
+ onConfirm
2434
+ }) {
2435
+ const [imgError, setImgError] = _react.useState.call(void 0, false);
2436
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDialog2, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2437
+ AlertDialogContent2,
2438
+ {
2439
+ className: "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white dark:bg-neutral-900 rounded-2xl shadow-2xl border border-neutral-200 dark:border-neutral-700 max-w-md w-full min-w-[320px] p-4 flex flex-col items-stretch",
2440
+ children: [
2441
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center justify-between mb-2", children: [
2442
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDialogTitle2, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center gap-1 min-w-0 text-xl font-semibold", children: [
2443
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.Info, { className: "w-5 h-5" }),
2444
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate", children: title })
2445
+ ] }) }),
2446
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2447
+ "button",
2448
+ {
2449
+ className: "text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 text-xl ml-4",
2450
+ onClick: () => onOpenChange(false),
2451
+ "aria-label": "Close",
2452
+ tabIndex: 0,
2453
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.X, { className: "w-5 h-5" })
2454
+ }
2455
+ )
2456
+ ] }),
2457
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDialogDescription2, { className: "text-base font-medium text-neutral-800 dark:text-neutral-100 mb-2", children: description }),
2458
+ imgSrc && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full max-w-[400px] h-[220px] relative flex items-center justify-center mb-2", children: imgError ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-gray-100 dark:bg-neutral-800 border border-dashed border-neutral-300 dark:border-neutral-700 rounded-lg text-neutral-400 text-sm", children: [
2459
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.ImageOff, { className: "w-12 h-12 mb-2" }),
2460
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Image loading failed" })
2461
+ ] }) : imgHref ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: imgHref, target: "_blank", rel: "noopener noreferrer", className: "block w-full h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2462
+ _image2.default,
2463
+ {
2464
+ src: imgSrc,
2465
+ alt: "image",
2466
+ fill: true,
2467
+ className: "object-contain rounded-lg",
2468
+ priority: false,
2469
+ placeholder: "empty",
2470
+ unoptimized: true,
2471
+ onError: () => setImgError(true),
2472
+ sizes: "(max-width: 400px) 100vw, 400px"
2473
+ }
2474
+ ) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2475
+ _image2.default,
2476
+ {
2477
+ src: imgSrc,
2478
+ alt: "image",
2479
+ fill: true,
2480
+ className: "object-contain rounded-lg",
2481
+ priority: false,
2482
+ placeholder: "empty",
2483
+ unoptimized: true,
2484
+ onError: () => setImgError(true),
2485
+ sizes: "(max-width: 400px) 100vw, 400px"
2486
+ }
2487
+ ) }),
2488
+ (cancelText || confirmText) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-2 mt-2", children: [
2489
+ cancelText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2490
+ "button",
2491
+ {
2492
+ onClick: () => {
2493
+ onOpenChange(false);
2494
+ onCancel == null ? void 0 : onCancel();
2495
+ },
2496
+ className: "px-6 py-2 rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 font-semibold hover:bg-neutral-100 dark:hover:bg-neutral-700 transition",
2497
+ children: cancelText
2498
+ }
2499
+ ),
2500
+ confirmText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2501
+ AlertDialogAction2,
2502
+ {
2503
+ onClick: () => {
2504
+ onOpenChange(false);
2505
+ onConfirm == null ? void 0 : onConfirm();
2506
+ },
2507
+ className: "px-6 py-2 rounded-lg bg-purple-500 text-white font-semibold hover:bg-purple-600 transition",
2508
+ children: confirmText
2509
+ }
2510
+ )
2511
+ ] })
2512
+ ]
2513
+ }
2514
+ ) });
2515
+ }
2516
+
2517
+ // src/main/x-button.tsx
2518
+
2519
+
2520
+ function XButton(props) {
2521
+ var _a, _b;
2522
+ const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
2523
+ const [menuOpen, setMenuOpen] = _react.useState.call(void 0, false);
2524
+ const menuRef = _react.useRef.call(void 0, null);
2525
+ _react.useEffect.call(void 0, () => {
2526
+ if (props.type === "split") {
2527
+ const handleClickOutside = (event) => {
2528
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
2529
+ setMenuOpen(false);
2530
+ }
2531
+ };
2532
+ if (menuOpen) {
2533
+ document.addEventListener("mousedown", handleClickOutside);
2534
+ }
2535
+ return () => {
2536
+ document.removeEventListener("mousedown", handleClickOutside);
2537
+ };
2538
+ }
2539
+ }, [menuOpen, props.type]);
2540
+ const handleButtonClick = (onClick) => _chunkLZLW5WCCjs.__async.call(void 0, null, null, function* () {
2541
+ if (isLoading) return;
2542
+ setIsLoading(true);
2543
+ try {
2544
+ yield onClick();
2545
+ } catch (error) {
2546
+ console.error("Button click error:", error);
2547
+ } finally {
2548
+ setIsLoading(false);
2549
+ }
2550
+ });
2551
+ const baseButtonClass = "flex items-center justify-center px-4 py-2 bg-neutral-200 dark:bg-neutral-800 text-neutral-700 dark:text-white text-sm font-semibold transition-colors hover:bg-neutral-300 dark:hover:bg-neutral-700";
2552
+ const disabledClass = "opacity-60 cursor-not-allowed";
2553
+ if (props.type === "single") {
2554
+ const { button, loadingText: loadingText2, minWidth = "min-w-[110px]", className: className2 = "" } = props;
2555
+ const isDisabled = button.disabled || isLoading;
2556
+ const actualLoadingText2 = loadingText2 || ((_a = button.text) == null ? void 0 : _a.trim()) || "Loading...";
2557
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2558
+ "button",
2559
+ {
2560
+ onClick: () => handleButtonClick(button.onClick),
2561
+ disabled: isDisabled,
2562
+ className: `${minWidth} ${baseButtonClass} rounded-full ${isDisabled ? disabledClass : ""} ${className2}`,
2563
+ title: button.text,
2564
+ children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2565
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.Loader2, { className: "w-5 h-5 mr-1 animate-spin" }),
2566
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: actualLoadingText2 })
2567
+ ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2568
+ button.icon,
2569
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: button.text })
2570
+ ] })
2571
+ }
2572
+ );
2573
+ }
2574
+ const { mainButton, menuItems, loadingText, menuWidth = "w-40", className = "", mainButtonClassName = "", dropdownButtonClassName = "" } = props;
2575
+ const isMainDisabled = mainButton.disabled || isLoading;
2576
+ const actualLoadingText = loadingText || ((_b = mainButton.text) == null ? void 0 : _b.trim()) || "Loading...";
2577
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `relative flex bg-neutral-200 dark:bg-neutral-800 rounded-full ${className}`, children: [
2578
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2579
+ "button",
2580
+ {
2581
+ onClick: () => handleButtonClick(mainButton.onClick),
2582
+ disabled: isMainDisabled,
2583
+ className: `flex-1 ${baseButtonClass} rounded-l-full ${isMainDisabled ? disabledClass : ""} ${mainButtonClassName}`,
2584
+ onMouseDown: (e) => {
2585
+ if (e.button === 2) e.preventDefault();
2586
+ },
2587
+ style: { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
2588
+ children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2589
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.Loader2, { className: "w-5 h-5 mr-1 animate-spin" }),
2590
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: actualLoadingText })
2591
+ ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2592
+ mainButton.icon,
2593
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: mainButton.text })
2594
+ ] })
2595
+ }
2596
+ ),
2597
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2598
+ "span",
2599
+ {
2600
+ className: `flex items-center justify-center w-10 py-2 cursor-pointer transition hover:bg-neutral-300 dark:hover:bg-neutral-700 rounded-r-full ${dropdownButtonClassName}`,
2601
+ onClick: (e) => {
2602
+ e.stopPropagation();
2603
+ setMenuOpen((v) => !v);
2604
+ },
2605
+ tabIndex: 0,
2606
+ style: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
2607
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7K5Y2WRjs.globalLucideIcons.ChevronDown, { className: "w-6 h-6" })
2608
+ }
2609
+ ),
2610
+ menuOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2611
+ "div",
2612
+ {
2613
+ ref: menuRef,
2614
+ className: `absolute right-0 top-full ${menuWidth} bg-white dark:bg-neutral-800 text-neutral-800 dark:text-white text-sm rounded-xl shadow-lg z-50 border border-neutral-200 dark:border-neutral-700 overflow-hidden animate-fade-in`,
2615
+ children: menuItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2616
+ "button",
2617
+ {
2618
+ onClick: () => {
2619
+ handleButtonClick(item.onClick);
2620
+ setMenuOpen(false);
2621
+ },
2622
+ disabled: item.disabled,
2623
+ className: `flex items-center w-full px-4 py-3 transition hover:bg-neutral-300 dark:hover:bg-neutral-600 text-left relative ${item.disabled ? disabledClass : ""}`,
2624
+ style: item.splitTopBorder ? { borderTop: "1px solid #AC62FD" } : void 0,
2625
+ children: [
2626
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center", children: [
2627
+ item.icon,
2628
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: item.text })
2629
+ ] }),
2630
+ item.tag && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2631
+ "span",
2632
+ {
2633
+ className: "absolute right-3 top-1 text-[10px] font-semibold",
2634
+ style: { color: item.tag.color || "#A855F7", pointerEvents: "none" },
2635
+ children: item.tag.text
2636
+ }
2637
+ )
2638
+ ]
2639
+ },
2640
+ index
2641
+ ))
2642
+ }
2643
+ )
2644
+ ] });
2645
+ }
2646
+
2647
+ // src/main/ai-prompt-textarea.tsx
2648
+
2649
+
2650
+ function AIPromptTextarea({
2651
+ value,
2652
+ onChange,
2653
+ placeholder = "Enter your prompt...",
2654
+ disabled = false,
2655
+ maxWords = 400,
2656
+ wordUnitTitle = "words",
2657
+ minHeight = 150,
2658
+ maxHeight = 300,
2659
+ className = "",
2660
+ showWordCount = true,
2661
+ autoScroll = true,
2662
+ extraScrollSpace = 100,
2663
+ isWordLimit,
2664
+ onWordLimitChange,
2665
+ title,
2666
+ description,
2667
+ embed = false
2668
+ }) {
2669
+ const textareaRef = _react.useRef.call(void 0, null);
2670
+ const wordArray = value.trim().split(/\s+/).filter(Boolean);
2671
+ const wordCount = wordArray.length;
2672
+ const adjustTextareaHeight = () => {
2673
+ if (textareaRef.current) {
2674
+ const textarea = textareaRef.current;
2675
+ const oldHeight = textarea.style.height;
2676
+ textarea.style.height = "auto";
2677
+ const contentHeight = textarea.scrollHeight;
2678
+ let newHeight = Math.max(contentHeight, minHeight);
2679
+ newHeight = Math.min(newHeight, maxHeight);
2680
+ textarea.style.height = `${newHeight}px`;
2681
+ if (contentHeight > maxHeight) {
2682
+ textarea.style.overflowY = "auto";
2683
+ } else {
2684
+ textarea.style.overflowY = "hidden";
2685
+ }
2686
+ if (autoScroll && (newHeight > parseInt(oldHeight) || !oldHeight)) {
2687
+ setTimeout(() => {
2688
+ const rect = textarea.getBoundingClientRect();
2689
+ window.scrollTo({
2690
+ top: window.pageYOffset + rect.bottom + extraScrollSpace - window.innerHeight,
2691
+ behavior: "smooth"
2692
+ });
2693
+ }, 0);
2694
+ }
2695
+ }
2696
+ };
2697
+ _react.useEffect.call(void 0, () => {
2698
+ const timer = setTimeout(() => {
2699
+ adjustTextareaHeight();
2700
+ }, 0);
2701
+ return () => clearTimeout(timer);
2702
+ }, [value, minHeight, maxHeight, autoScroll, extraScrollSpace]);
2703
+ const handleInputChange = (e) => {
2704
+ const inputValue = e.target.value;
2705
+ const words = inputValue.trim().split(/\s+/).filter(Boolean);
2706
+ if (wordCount >= maxWords && words.length > maxWords) {
2707
+ onWordLimitChange(true);
2708
+ return;
2709
+ }
2710
+ if (words.length > maxWords) {
2711
+ onChange(words.slice(0, maxWords).join(" "));
2712
+ onWordLimitChange(true);
2713
+ } else {
2714
+ onChange(inputValue);
2715
+ onWordLimitChange(false);
2716
+ }
2717
+ };
2718
+ const handlePaste = (e) => {
2719
+ const paste = e.clipboardData.getData("text");
2720
+ const currentWords = value.trim().split(/\s+/).filter(Boolean);
2721
+ const pasteWords = paste.trim().split(/\s+/).filter(Boolean);
2722
+ if (currentWords.length >= maxWords) {
2723
+ e.preventDefault();
2724
+ onWordLimitChange(true);
2725
+ return;
2726
+ }
2727
+ const allowed = maxWords - currentWords.length;
2728
+ if (pasteWords.length > allowed) {
2729
+ e.preventDefault();
2730
+ const newWords = currentWords.concat(pasteWords.slice(0, allowed));
2731
+ onChange(newWords.join(" "));
2732
+ onWordLimitChange(true);
2733
+ }
2734
+ };
2735
+ const renderTitle = () => {
2736
+ if (!(title == null ? void 0 : title.trim())) return null;
2737
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-1", children: [
2738
+ title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xl font-semibold text-foreground", children: title }),
2739
+ (description == null ? void 0 : description.trim()) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-gray-400 ml-2", children: description })
2740
+ ] });
2741
+ };
2742
+ const renderTextarea = (isEmbedded = false) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2743
+ "textarea",
2744
+ {
2745
+ ref: textareaRef,
2746
+ value,
2747
+ onChange: handleInputChange,
2748
+ onPaste: handlePaste,
2749
+ placeholder,
2750
+ disabled,
2751
+ className: _chunk6MM7HLNXjs.cn.call(void 0,
2752
+ "w-full p-4 bg-transparent transition-colors text-foreground placeholder-muted-foreground placeholder:text-base disabled:bg-muted disabled:cursor-not-allowed resize-none",
2753
+ isEmbedded ? "border-0 hover:border-2 hover:border-purple-500 focus:outline-none focus:border-2 focus:border-purple-500" : "border-2 border-border rounded-lg hover:border-purple-500 focus:outline-none focus:border-purple-500",
2754
+ className
2755
+ ),
2756
+ style: { minHeight: `${minHeight}px` }
2757
+ }
2758
+ );
2759
+ const renderWordCount = () => {
2760
+ if (!showWordCount) return null;
2761
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2762
+ "span",
2763
+ {
2764
+ className: `text-sm ${wordCount >= maxWords ? "text-red-500" : wordCount > maxWords * 0.75 ? "text-orange-500" : "text-muted-foreground"} ${isWordLimit ? "animate-bounce" : ""}`,
2765
+ onAnimationEnd: () => onWordLimitChange(false),
2766
+ children: [
2767
+ wordCount,
2768
+ "/",
2769
+ maxWords,
2770
+ " ",
2771
+ wordUnitTitle
2772
+ ]
2773
+ }
2774
+ ) });
2775
+ };
2776
+ if (embed && title) {
2777
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
2778
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border-2 border-border rounded-lg bg-transparent", children: [
2779
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4 pb-2", children: renderTitle() }),
2780
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "hr", { className: "border-t-1 border-border" }),
2781
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-1", children: renderTextarea(true) })
2782
+ ] }),
2783
+ renderWordCount()
2784
+ ] });
2785
+ }
2786
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
2787
+ renderTitle(),
2788
+ renderTextarea(),
2789
+ renderWordCount()
2790
+ ] });
2791
+ }
2792
+
2793
+ // src/main/rich-text-expert.tsx
2794
+
2795
+ var defaultTagRenderers = {
2796
+ // text Stong
2797
+ strong: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }),
2798
+ // text Emphasis
2799
+ em: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "em", { children: chunks }),
2800
+ // text Underline
2801
+ u: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "u", { children: chunks }),
2802
+ // text Mark
2803
+ mark: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "mark", { className: "bg-purple-300 dark:bg-purple-500 text-neutral-800 dark:text-neutral-300 px-1 rounded", children: chunks }),
2804
+ // text Delete
2805
+ del: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "del", { children: chunks }),
2806
+ // text Subscript
2807
+ sub: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "sub", { children: chunks }),
2808
+ // text Superscript
2809
+ sup: (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "sup", { children: chunks })
2810
+ };
2811
+ function createRichTextRenderer(customRenderers) {
2812
+ const renderers = _chunkLZLW5WCCjs.__spreadValues.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, defaultTagRenderers), customRenderers);
2813
+ return function richText2(t, key) {
2814
+ return t.rich(key, renderers);
2815
+ };
2816
+ }
2817
+ var richText = createRichTextRenderer();
2818
+
2819
+ // src/main/faq-interactive.tsx
2820
+
2821
+ function FAQInteractive({ data }) {
2822
+ const [openStates, setOpenStates] = _react.useState.call(void 0, {});
2823
+ _react.useEffect.call(void 0, () => {
2824
+ data.items.forEach((item) => {
2825
+ const toggleButton = document.querySelector(`[data-faq-toggle="${item.id}"]`);
2826
+ const contentDiv = document.querySelector(`[data-faq-content="${item.id}"]`);
2827
+ const iconSvg = document.querySelector(`[data-faq-icon="${item.id}"]`);
2828
+ if (toggleButton && contentDiv && iconSvg) {
2829
+ const handleClick = () => {
2830
+ const isOpen = openStates[item.id] || false;
2831
+ const newOpenState = !isOpen;
2832
+ setOpenStates((prev) => _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, prev), {
2833
+ [item.id]: newOpenState
2834
+ }));
2835
+ if (newOpenState) {
2836
+ contentDiv.classList.remove("hidden");
2837
+ toggleButton.setAttribute("aria-expanded", "true");
2838
+ iconSvg.style.transform = "rotate(90deg)";
2839
+ } else {
2840
+ contentDiv.classList.add("hidden");
2841
+ toggleButton.setAttribute("aria-expanded", "false");
2842
+ iconSvg.style.transform = "rotate(0deg)";
2843
+ }
2844
+ };
2845
+ toggleButton.addEventListener("click", handleClick);
2846
+ }
2847
+ });
2848
+ return () => {
2849
+ data.items.forEach((item) => {
2850
+ var _a;
2851
+ const toggleButton = document.querySelector(`[data-faq-toggle="${item.id}"]`);
2852
+ if (toggleButton) {
2853
+ const newButton = toggleButton.cloneNode(true);
2854
+ (_a = toggleButton.parentNode) == null ? void 0 : _a.replaceChild(newButton, toggleButton);
2855
+ }
2856
+ });
2857
+ };
2858
+ }, [data, openStates]);
2859
+ return null;
2860
+ }
2861
+
2862
+ // src/main/price-plan-interactive.tsx
2863
+
2864
+
2865
+
2866
+ function PricePlanInteractive({ data }) {
2867
+ const [billingKey, setBillingKey] = _react.useState.call(void 0, data.billingSwitch.defaultKey);
2868
+ const [tooltip, setTooltip] = _react.useState.call(void 0, { show: false, content: "", x: 0, y: 0 });
2869
+ const router = _navigation.useRouter.call(void 0, );
2870
+ _react.useEffect.call(void 0, () => {
2871
+ const monthlyButton = document.querySelector('[data-billing-button="monthly"]');
2872
+ const yearlyButton = document.querySelector('[data-billing-button="yearly"]');
2873
+ const handleBillingSwitch = (newBillingKey) => {
2874
+ setBillingKey(newBillingKey);
2875
+ updatePrices(newBillingKey);
2876
+ updateDiscountInfo(newBillingKey);
2877
+ updateButtonStyles(newBillingKey);
2878
+ };
2879
+ if (monthlyButton) {
2880
+ monthlyButton.addEventListener("click", () => handleBillingSwitch("monthly"));
2881
+ }
2882
+ if (yearlyButton) {
2883
+ yearlyButton.addEventListener("click", () => handleBillingSwitch("yearly"));
2884
+ }
2885
+ data.plans.forEach((plan) => {
2886
+ var _a;
2887
+ (_a = plan.features) == null ? void 0 : _a.forEach((feature, i) => {
2888
+ if (feature == null ? void 0 : feature.tooltip) {
2889
+ const tooltipTrigger = document.querySelector(`[data-tooltip-trigger="${plan.key}-${i}"]`);
2890
+ if (tooltipTrigger) {
2891
+ const handleMouseEnter = (e) => {
2892
+ setTooltip({
2893
+ show: true,
2894
+ content: feature.tooltip,
2895
+ x: e.clientX,
2896
+ y: e.clientY
2897
+ });
2898
+ };
2899
+ const handleMouseMove = (e) => {
2900
+ setTooltip((prev) => _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, prev), { x: e.clientX, y: e.clientY }));
2901
+ };
2902
+ const handleMouseLeave = () => {
2903
+ setTooltip((prev) => _chunkLZLW5WCCjs.__spreadProps.call(void 0, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, prev), { show: false }));
2904
+ };
2905
+ tooltipTrigger.addEventListener("mouseenter", handleMouseEnter);
2906
+ tooltipTrigger.addEventListener("mousemove", handleMouseMove);
2907
+ tooltipTrigger.addEventListener("mouseleave", handleMouseLeave);
2908
+ }
2909
+ }
2910
+ });
2911
+ });
2912
+ data.plans.forEach((plan) => {
2913
+ var _a;
2914
+ const planButton = document.querySelector(`[data-plan-button="${plan.key}"]`);
2915
+ if (planButton && !((_a = plan.button) == null ? void 0 : _a.disabled)) {
2916
+ planButton.addEventListener("click", () => {
2917
+ router.push("/");
2918
+ });
2919
+ }
2920
+ });
2921
+ return () => {
2922
+ var _a, _b;
2923
+ if (monthlyButton) {
2924
+ const newButton = monthlyButton.cloneNode(true);
2925
+ (_a = monthlyButton.parentNode) == null ? void 0 : _a.replaceChild(newButton, monthlyButton);
2926
+ }
2927
+ if (yearlyButton) {
2928
+ const newButton = yearlyButton.cloneNode(true);
2929
+ (_b = yearlyButton.parentNode) == null ? void 0 : _b.replaceChild(newButton, yearlyButton);
2930
+ }
2931
+ data.plans.forEach((plan) => {
2932
+ var _a2;
2933
+ (_a2 = plan.features) == null ? void 0 : _a2.forEach((_feature, i) => {
2934
+ var _a3;
2935
+ const tooltipTrigger = document.querySelector(`[data-tooltip-trigger="${plan.key}-${i}"]`);
2936
+ if (tooltipTrigger) {
2937
+ const newTrigger = tooltipTrigger.cloneNode(true);
2938
+ (_a3 = tooltipTrigger.parentNode) == null ? void 0 : _a3.replaceChild(newTrigger, tooltipTrigger);
2939
+ }
2940
+ });
2941
+ });
2942
+ };
2943
+ }, [data, router]);
2944
+ const updatePrices = (newBillingKey) => {
2945
+ const currentBilling = data.pricePlanConfig.billingOptions.find((opt) => opt.key === newBillingKey) || data.pricePlanConfig.billingOptions[0];
2946
+ const currentBillingDisplay = data.billingSwitch.options.find((opt) => opt.key === newBillingKey) || data.billingSwitch.options[0];
2947
+ data.plans.forEach((plan) => {
2948
+ const priceContainer = document.querySelector(`[data-price-container="${plan.key}"]`);
2949
+ const priceValue = data.pricePlanConfig.prices[plan.key];
2950
+ if (priceContainer) {
2951
+ const priceValueElement = document.querySelector(`[data-price-value="${plan.key}"]`);
2952
+ const priceUnitElement = document.querySelector(`[data-price-unit="${plan.key}"]`);
2953
+ const priceOriginalElement = document.querySelector(`[data-price-original="${plan.key}"]`);
2954
+ const priceDiscountElement = document.querySelector(`[data-price-discount="${plan.key}"]`);
2955
+ const priceSubtitleElement = document.querySelector(`[data-price-subtitle="${plan.key}"]`);
2956
+ if (typeof priceValue !== "number" || isNaN(priceValue)) {
2957
+ if (priceValueElement) priceValueElement.textContent = String(priceValue);
2958
+ if (priceSubtitleElement) priceSubtitleElement.textContent = plan.showBillingSubTitle === false ? "" : (currentBillingDisplay == null ? void 0 : currentBillingDisplay.subTitle) || "";
2959
+ } else {
2960
+ const originValue = Number(priceValue);
2961
+ const discount = currentBilling.discount;
2962
+ const hasDiscount = discount !== 0;
2963
+ const saleValue = originValue * (1 - discount);
2964
+ const formatPrice = (v) => Number(v.toFixed(2)).toString();
2965
+ const showNaN = saleValue < 0;
2966
+ if (priceValueElement) {
2967
+ priceValueElement.textContent = `${data.currency}${showNaN ? "NaN" : hasDiscount ? formatPrice(saleValue) : formatPrice(originValue)}`;
2968
+ }
2969
+ if (priceUnitElement) {
2970
+ priceUnitElement.textContent = currentBillingDisplay.unit || "";
2971
+ }
2972
+ if (hasDiscount) {
2973
+ if (priceOriginalElement) {
2974
+ priceOriginalElement.textContent = `${data.currency}${showNaN ? "NaN" : formatPrice(originValue)}`;
2975
+ priceOriginalElement.style.display = "inline";
2976
+ }
2977
+ if (priceDiscountElement && currentBillingDisplay.discountText) {
2978
+ const discountText = currentBillingDisplay.discountText.replace("{percent}", String(Math.round(Math.abs(discount) * 100)));
2979
+ priceDiscountElement.textContent = discountText;
2980
+ priceDiscountElement.style.display = "inline";
2981
+ }
2982
+ } else {
2983
+ if (priceOriginalElement) priceOriginalElement.style.display = "none";
2984
+ if (priceDiscountElement) priceDiscountElement.style.display = "none";
2985
+ }
2986
+ if (priceSubtitleElement) {
2987
+ priceSubtitleElement.textContent = plan.showBillingSubTitle === false ? "" : (currentBillingDisplay == null ? void 0 : currentBillingDisplay.subTitle) || "";
2988
+ }
2989
+ }
2990
+ }
2991
+ });
2992
+ };
2993
+ const updateDiscountInfo = (newBillingKey) => {
2994
+ const discountInfoElement = document.querySelector("[data-discount-info]");
2995
+ if (discountInfoElement) {
2996
+ const opt = data.billingSwitch.options.find((opt2) => opt2.key === newBillingKey);
2997
+ const bOpt = data.pricePlanConfig.billingOptions.find((opt2) => opt2.key === newBillingKey);
2998
+ if (opt && bOpt && opt.discountText && bOpt.discount !== 0) {
2999
+ const discountText = opt.discountText.replace("{percent}", String(Math.round(Math.abs(bOpt.discount) * 100)));
3000
+ discountInfoElement.innerHTML = `
3001
+ <span class="px-2 py-1 text-xs rounded bg-yellow-100 text-yellow-800 font-semibold align-middle text-center inline-flex items-center justify-center whitespace-nowrap">
3002
+ ${discountText}
3003
+ </span>
3004
+ `;
3005
+ } else {
3006
+ discountInfoElement.innerHTML = "";
3007
+ }
3008
+ }
3009
+ };
3010
+ const updateButtonStyles = (newBillingKey) => {
3011
+ const monthlyButton = document.querySelector('[data-billing-button="monthly"]');
3012
+ const yearlyButton = document.querySelector('[data-billing-button="yearly"]');
3013
+ if (monthlyButton) {
3014
+ if (newBillingKey === "monthly") {
3015
+ monthlyButton.className = _chunk6MM7HLNXjs.cn.call(void 0,
3016
+ "min-w-[120px] px-6 py-2 font-medium transition text-lg relative",
3017
+ "text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm"
3018
+ );
3019
+ } else {
3020
+ monthlyButton.className = _chunk6MM7HLNXjs.cn.call(void 0,
3021
+ "min-w-[120px] px-6 py-2 font-medium transition text-lg relative",
3022
+ "text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full"
3023
+ );
3024
+ }
3025
+ }
3026
+ if (yearlyButton) {
3027
+ if (newBillingKey === "yearly") {
3028
+ yearlyButton.className = _chunk6MM7HLNXjs.cn.call(void 0,
3029
+ "min-w-[120px] px-6 py-2 font-medium transition text-lg relative",
3030
+ "text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm"
3031
+ );
3032
+ } else {
3033
+ yearlyButton.className = _chunk6MM7HLNXjs.cn.call(void 0,
3034
+ "min-w-[120px] px-6 py-2 font-medium transition text-lg relative",
3035
+ "text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full"
3036
+ );
3037
+ }
3038
+ }
3039
+ };
3040
+ const Tooltip = ({ show, content, x, y }) => {
3041
+ if (!show) return null;
3042
+ const style = {
3043
+ position: "fixed",
3044
+ left: Math.max(8, x),
3045
+ top: Math.max(8, y),
3046
+ zIndex: 9999,
3047
+ maxWidth: 200,
3048
+ transform: "translateY(-50%)",
3049
+ pointerEvents: "none",
3050
+ whiteSpace: "pre-line"
3051
+ };
3052
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3053
+ "div",
3054
+ {
3055
+ style,
3056
+ className: "bg-gray-700 dark:bg-gray-200 text-gray-100 dark:text-gray-800 text-xs leading-relaxed px-3 py-2 rounded-lg shadow-lg border border-gray-300 dark:border-gray-600 backdrop-blur-sm",
3057
+ children: content
3058
+ }
3059
+ );
3060
+ };
3061
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, _chunkLZLW5WCCjs.__spreadValues.call(void 0, {}, tooltip));
3062
+ }
3063
+
3064
+ // src/main/gallery-interactive.tsx
3065
+
3066
+ function GalleryInteractive({ data }) {
3067
+ const [imageErrors, setImageErrors] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
3068
+ const [downloadingItems, setDownloadingItems] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
3069
+ const cdnProxyUrl = process.env.NEXT_PUBLIC_STYLE_CDN_PROXY_URL;
3070
+ _react.useEffect.call(void 0, () => {
3071
+ data.items.forEach((item, index) => {
3072
+ const downloadButton = document.querySelector(`[data-gallery-download="${item.id}"]`);
3073
+ const imageElement = document.querySelector(`[data-gallery-image="${item.id}"]`);
3074
+ if (downloadButton) {
3075
+ const handleDownload = () => _chunkLZLW5WCCjs.__async.call(void 0, null, null, function* () {
3076
+ var _a;
3077
+ if (downloadingItems.has(item.id)) {
3078
+ return;
3079
+ }
3080
+ setDownloadingItems((prev) => new Set(prev).add(item.id));
3081
+ try {
3082
+ if (!cdnProxyUrl) {
3083
+ throw new Error("CDN proxy URL not configured");
3084
+ }
3085
+ const originalUrl = new URL(item.url);
3086
+ const filename = originalUrl.pathname.substring(1);
3087
+ const proxyUrl = `${cdnProxyUrl}/${encodeURIComponent(filename)}`;
3088
+ const urlExtension = (_a = item.url.split(".").pop()) == null ? void 0 : _a.toLowerCase();
3089
+ let extension = ".webp";
3090
+ if (urlExtension && ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(urlExtension)) {
3091
+ extension = `.${urlExtension}`;
3092
+ }
3093
+ const response = yield fetch(proxyUrl);
3094
+ if (!response.ok) {
3095
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
3096
+ }
3097
+ const blob = yield response.blob();
3098
+ const blobUrl = URL.createObjectURL(blob);
3099
+ const a = document.createElement("a");
3100
+ a.href = blobUrl;
3101
+ a.download = `${data.downloadPrefix}-${index + 1}${extension}`;
3102
+ a.style.display = "none";
3103
+ document.body.appendChild(a);
3104
+ a.click();
3105
+ setTimeout(() => {
3106
+ document.body.removeChild(a);
3107
+ URL.revokeObjectURL(blobUrl);
3108
+ }, 100);
3109
+ } catch (error) {
3110
+ console.error("Download failed:", error);
3111
+ } finally {
3112
+ setDownloadingItems((prev) => {
3113
+ const newSet = new Set(prev);
3114
+ newSet.delete(item.id);
3115
+ return newSet;
3116
+ });
3117
+ }
3118
+ });
3119
+ downloadButton.addEventListener("click", handleDownload);
3120
+ }
3121
+ if (imageElement) {
3122
+ const handleImageError = () => {
3123
+ setImageErrors((prev) => new Set(prev).add(item.id));
3124
+ imageElement.src = data.defaultImgUrl;
3125
+ };
3126
+ imageElement.addEventListener("error", handleImageError);
3127
+ }
3128
+ });
3129
+ const updateDownloadStates = () => {
3130
+ data.items.forEach((item) => {
3131
+ const downloadButton = document.querySelector(`[data-gallery-download="${item.id}"]`);
3132
+ if (downloadButton) {
3133
+ const isDownloading = downloadingItems.has(item.id);
3134
+ if (isDownloading) {
3135
+ downloadButton.disabled = true;
3136
+ downloadButton.classList.add("bg-black/30", "text-white/50");
3137
+ downloadButton.classList.remove("bg-black/50", "hover:bg-black/70", "text-white/80", "hover:text-white");
3138
+ downloadButton.innerHTML = `
3139
+ <svg class="h-5 w-5 text-white animate-spin" fill="none" viewBox="0 0 24 24">
3140
+ <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
3141
+ <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
3142
+ </svg>
3143
+ `;
3144
+ } else {
3145
+ downloadButton.disabled = false;
3146
+ downloadButton.classList.remove("bg-black/30", "text-white/50");
3147
+ downloadButton.classList.add("bg-black/50", "hover:bg-black/70", "text-white/80", "hover:text-white");
3148
+ downloadButton.innerHTML = `
3149
+ <svg class="h-5 w-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
3150
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
3151
+ </svg>
3152
+ `;
3153
+ }
3154
+ }
3155
+ });
3156
+ };
3157
+ updateDownloadStates();
3158
+ return () => {
3159
+ data.items.forEach((item) => {
3160
+ var _a, _b;
3161
+ const downloadButton = document.querySelector(`[data-gallery-download="${item.id}"]`);
3162
+ const imageElement = document.querySelector(`[data-gallery-image="${item.id}"]`);
3163
+ if (downloadButton) {
3164
+ const newButton = downloadButton.cloneNode(true);
3165
+ (_a = downloadButton.parentNode) == null ? void 0 : _a.replaceChild(newButton, downloadButton);
3166
+ }
3167
+ if (imageElement) {
3168
+ const newImage = imageElement.cloneNode(true);
3169
+ (_b = imageElement.parentNode) == null ? void 0 : _b.replaceChild(newImage, imageElement);
3170
+ }
3171
+ });
3172
+ };
3173
+ }, [data, downloadingItems, imageErrors, cdnProxyUrl]);
3174
+ return null;
3175
+ }
3176
+
3177
+
3178
+
3179
+
3180
+
3181
+
3182
+
3183
+
3184
+
3185
+
3186
+
3187
+
3188
+
3189
+ exports.GoToTop = GoToTop; exports.Loading = Loading; exports.NProgressBar = NProgressBar; exports.AdsAlertDialog = AdsAlertDialog; exports.XButton = XButton; exports.AIPromptTextarea = AIPromptTextarea; exports.createRichTextRenderer = createRichTextRenderer; exports.richText = richText; exports.FAQInteractive = FAQInteractive; exports.PricePlanInteractive = PricePlanInteractive; exports.GalleryInteractive = GalleryInteractive;
3190
+ //# sourceMappingURL=chunk-52YUUCKV.js.map