@conscia-labs/design-system 0.4.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3834 @@
1
+ import {
2
+ BASE_UI_SWIPE_IGNORE_SELECTOR,
3
+ BasePopupHandle,
4
+ Button,
5
+ CLICK_TRIGGER_IDENTIFIER,
6
+ COMPOSITE_KEYS,
7
+ Card,
8
+ CardContent,
9
+ CardDescription,
10
+ CardFooter,
11
+ CardHeader,
12
+ CardTitle,
13
+ Checkbox,
14
+ EMPTY_OBJECT,
15
+ FOCUSABLE_POPUP_PROPS,
16
+ FloatingFocusManager,
17
+ FloatingNode,
18
+ FloatingPortal,
19
+ FloatingPortalLite,
20
+ FloatingTree,
21
+ FocusGuard,
22
+ IconButton,
23
+ Input,
24
+ InternalBackdrop,
25
+ LEGACY_SWIPE_IGNORE_SELECTOR,
26
+ NOOP,
27
+ NullStore,
28
+ PATIENT_CLICK_THRESHOLD,
29
+ POPUP_COLLISION_AVOIDANCE,
30
+ PopupHandleAttachment,
31
+ PopupTriggerMap,
32
+ ReactStore,
33
+ Select,
34
+ SelectContent,
35
+ SelectGroup,
36
+ SelectItem,
37
+ SelectTrigger,
38
+ SelectValue,
39
+ Table,
40
+ TableBody,
41
+ TableCell,
42
+ TableHead,
43
+ TableHeader,
44
+ TableRow,
45
+ Timeout,
46
+ activeElement,
47
+ addEventListener,
48
+ attachPreventUnmountOnClose,
49
+ contains,
50
+ createChangeEventDetails,
51
+ createDefaultInitialFocus,
52
+ createInitialPopupStoreState,
53
+ createPopupFloatingRootContext,
54
+ dispatchClickWithModifiers,
55
+ fieldValidityMapping,
56
+ getDisabledMountTransitionStyles,
57
+ getDisplacement,
58
+ getElementTransform,
59
+ getTarget,
60
+ getWindow,
61
+ index_parts_exports,
62
+ inertValue,
63
+ isElement,
64
+ isHTMLElement,
65
+ matchesFocusVisible,
66
+ mergeCleanups,
67
+ ownerDocument,
68
+ popupStateMapping,
69
+ popupStoreSelectors,
70
+ popupTransitionStateMapping,
71
+ popupViewportStateMapping,
72
+ pressableTriggerOpenStateMapping,
73
+ reason_parts_exports,
74
+ safePolygon,
75
+ setPopupOpenState,
76
+ transitionStatusMapping,
77
+ triggerOpenStateMapping,
78
+ useAnchorPositioning,
79
+ useAnchoredPopupScrollLock,
80
+ useAnimationsFinished,
81
+ useAriaLabelledBy,
82
+ useBaseUiId,
83
+ useButton,
84
+ useClick,
85
+ useControlled,
86
+ useDismiss,
87
+ useFieldRootContext,
88
+ useFloatingNodeId,
89
+ useFloatingRootContext,
90
+ useFormContext,
91
+ useHoverFloatingInteraction,
92
+ useHoverReferenceInteraction,
93
+ useId,
94
+ useImplicitActiveTrigger,
95
+ useIsoLayoutEffect,
96
+ useLabelableContext,
97
+ useLabelableId,
98
+ useMergedRefs,
99
+ useOnMount,
100
+ useOpenChangeComplete,
101
+ useOpenMethodTriggerProps,
102
+ useOpenStateTransitions,
103
+ usePopupHandleStore,
104
+ usePopupInteractionProps,
105
+ usePopupRootStore,
106
+ usePopupRootSync,
107
+ usePopupViewport,
108
+ usePositioner,
109
+ useRefWithInit,
110
+ useRegisterFieldControl,
111
+ useRenderElement,
112
+ useStableCallback,
113
+ useTimeout,
114
+ useToolbarRootContext,
115
+ useTriggerDataForwarding,
116
+ useTriggerFocusGuards,
117
+ useValueChanged,
118
+ visuallyHidden,
119
+ visuallyHiddenInput
120
+ } from "./chunk-YAJUTCGD.js";
121
+ import {
122
+ cn
123
+ } from "./chunk-JU5DQXFC.js";
124
+ import {
125
+ __export,
126
+ __publicField
127
+ } from "./chunk-UVKRO5ER.js";
128
+
129
+ // src/primitives/alert.tsx
130
+ import * as React from "react";
131
+ import { cva } from "class-variance-authority";
132
+ import { jsx } from "react/jsx-runtime";
133
+ var AlertContext = React.createContext(null);
134
+ var alertVariants = cva(
135
+ "relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 rounded-[var(--ds-radius-surface)] border px-4 py-3.5 text-sm [&>svg]:mt-0.5 [&>svg]:size-5",
136
+ {
137
+ variants: {
138
+ variant: {
139
+ default: "border-border-default bg-surface text-text-primary",
140
+ information: "border-information-border bg-information-background text-information-foreground",
141
+ success: "border-success-border bg-success-background text-success-foreground",
142
+ warning: "border-warning-border bg-warning-background text-warning-foreground",
143
+ danger: "border-danger-border bg-danger-background text-danger-foreground"
144
+ }
145
+ },
146
+ defaultVariants: {
147
+ variant: "default"
148
+ }
149
+ }
150
+ );
151
+ function Alert({
152
+ children,
153
+ className,
154
+ variant,
155
+ role = "group",
156
+ "aria-labelledby": ariaLabelledby,
157
+ "aria-describedby": ariaDescribedby,
158
+ ...props
159
+ }) {
160
+ const baseId = React.useId();
161
+ const titleId = `${baseId}-title`;
162
+ const descriptionId = `${baseId}-description`;
163
+ const [registeredTitleId, setRegisteredTitleId] = React.useState();
164
+ const [registeredDescriptionId, setRegisteredDescriptionId] = React.useState();
165
+ const registerTitle = React.useCallback((id) => setRegisteredTitleId(id), []);
166
+ const registerDescription = React.useCallback((id) => setRegisteredDescriptionId(id), []);
167
+ return /* @__PURE__ */ jsx(AlertContext.Provider, { value: { titleId, descriptionId, hasTitle: Boolean(registeredTitleId), hasDescription: Boolean(registeredDescriptionId), registerTitle, registerDescription }, children: /* @__PURE__ */ jsx(
168
+ "div",
169
+ {
170
+ "data-slot": "alert",
171
+ role,
172
+ "aria-labelledby": ariaLabelledby ?? registeredTitleId,
173
+ "aria-describedby": ariaDescribedby ?? registeredDescriptionId,
174
+ className: cn(alertVariants({ variant }), className),
175
+ ...props,
176
+ children
177
+ }
178
+ ) });
179
+ }
180
+ function AlertTitle({ className, ...props }) {
181
+ const context = React.useContext(AlertContext);
182
+ const id = props.id ?? context?.titleId;
183
+ React.useEffect(() => {
184
+ if (id) context?.registerTitle(id);
185
+ }, [context, id]);
186
+ return /* @__PURE__ */ jsx(
187
+ "div",
188
+ {
189
+ "data-slot": "alert-title",
190
+ id,
191
+ className: cn("font-medium leading-5", className),
192
+ ...props
193
+ }
194
+ );
195
+ }
196
+ function AlertDescription({ className, ...props }) {
197
+ const context = React.useContext(AlertContext);
198
+ const id = props.id ?? context?.descriptionId;
199
+ React.useEffect(() => {
200
+ if (id) context?.registerDescription(id);
201
+ }, [context, id]);
202
+ return /* @__PURE__ */ jsx(
203
+ "div",
204
+ {
205
+ "data-slot": "alert-description",
206
+ id,
207
+ className: cn("col-start-2 mt-0.5 text-sm leading-5 opacity-80", className),
208
+ ...props
209
+ }
210
+ );
211
+ }
212
+
213
+ // src/primitives/avatar.tsx
214
+ import * as React2 from "react";
215
+ import { jsx as jsx2 } from "react/jsx-runtime";
216
+ var useAvatarEffect = typeof window === "undefined" ? React2.useEffect : React2.useLayoutEffect;
217
+ var AvatarContext = React2.createContext(null);
218
+ function useAvatarContext() {
219
+ const context = React2.useContext(AvatarContext);
220
+ if (!context) {
221
+ throw new Error("AvatarImage and AvatarFallback must be used inside Avatar.");
222
+ }
223
+ return context;
224
+ }
225
+ function Avatar({
226
+ children,
227
+ className,
228
+ ...props
229
+ }) {
230
+ const [status, setStatus] = React2.useState("idle");
231
+ return /* @__PURE__ */ jsx2(AvatarContext.Provider, { value: { status, setStatus }, children: /* @__PURE__ */ jsx2("div", { "data-slot": "avatar", className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className), ...props, children }) });
232
+ }
233
+ function AvatarImage({
234
+ alt = "",
235
+ className,
236
+ onError,
237
+ onLoad,
238
+ src,
239
+ ...props
240
+ }) {
241
+ const { status, setStatus } = useAvatarContext();
242
+ useAvatarEffect(() => {
243
+ setStatus(src ? "loading" : "error");
244
+ }, [src, setStatus]);
245
+ return (
246
+ // The library must use a framework-neutral image element rather than Next's Image component.
247
+ // eslint-disable-next-line @next/next/no-img-element
248
+ /* @__PURE__ */ jsx2(
249
+ "img",
250
+ {
251
+ "data-slot": "avatar-image",
252
+ className: cn("aspect-square size-full", status === "loaded" ? "" : "hidden", className),
253
+ alt,
254
+ src,
255
+ ...props,
256
+ onLoad: (event) => {
257
+ setStatus("loaded");
258
+ onLoad?.(event);
259
+ },
260
+ onError: (event) => {
261
+ setStatus("error");
262
+ onError?.(event);
263
+ }
264
+ }
265
+ )
266
+ );
267
+ }
268
+ function AvatarFallback({
269
+ className,
270
+ ...props
271
+ }) {
272
+ const { status } = useAvatarContext();
273
+ return /* @__PURE__ */ jsx2("div", { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-surface-muted text-xs font-medium text-text-supporting", status === "loaded" ? "hidden" : "", className), ...props });
274
+ }
275
+
276
+ // src/primitives/avatar-group.tsx
277
+ import * as React3 from "react";
278
+ import { jsxs } from "react/jsx-runtime";
279
+ function AvatarGroup({
280
+ children,
281
+ className,
282
+ max,
283
+ size = "default",
284
+ total,
285
+ ...props
286
+ }) {
287
+ const avatars = React3.Children.toArray(children);
288
+ const visibleCount = max === void 0 ? avatars.length : Math.max(0, Math.floor(max));
289
+ const visibleAvatars = avatars.slice(0, visibleCount);
290
+ const totalCount = Math.max(avatars.length, total ?? avatars.length);
291
+ const overflowCount = Math.max(0, totalCount - visibleAvatars.length);
292
+ return /* @__PURE__ */ jsxs(
293
+ "div",
294
+ {
295
+ "data-slot": "avatar-group",
296
+ "data-size": size,
297
+ className: cn(
298
+ "flex items-center [&>[data-slot=avatar]]:relative [&>[data-slot=avatar]]:z-0 [&>[data-slot=avatar]]:shrink-0 [&>[data-slot=avatar]]:ring-2 [&>[data-slot=avatar]]:ring-canvas [&>[data-slot=avatar]]:transition-[margin,z-index] hover:[&>[data-slot=avatar]]:z-10 data-[size=default]:gap-0 data-[size=default]:[&>[data-slot=avatar]]:-ml-2 data-[size=default]:[&>[data-slot=avatar]]:size-8 data-[size=lg]:gap-0 data-[size=lg]:[&>[data-slot=avatar]]:-ml-2.5 data-[size=lg]:[&>[data-slot=avatar]]:size-10 data-[size=sm]:gap-0 data-[size=sm]:[&>[data-slot=avatar]]:-ml-1.5 data-[size=sm]:[&>[data-slot=avatar]]:size-6 [&>[data-slot=avatar]:first-child]:ml-0",
299
+ className
300
+ ),
301
+ role: "group",
302
+ ...props,
303
+ children: [
304
+ visibleAvatars,
305
+ overflowCount > 0 ? /* @__PURE__ */ jsxs(
306
+ "span",
307
+ {
308
+ "data-slot": "avatar-group-overflow",
309
+ className: "relative z-0 inline-flex shrink-0 items-center justify-center rounded-full border-2 border-canvas bg-surface-muted font-medium text-text-supporting data-[size=default]:-ml-2 data-[size=default]:size-8 data-[size=default]:text-xs data-[size=lg]:-ml-2.5 data-[size=lg]:size-10 data-[size=lg]:text-sm data-[size=sm]:-ml-1.5 data-[size=sm]:size-6 data-[size=sm]:text-[0.625rem]",
310
+ "aria-label": `${overflowCount} more ${overflowCount === 1 ? "avatar" : "avatars"}`,
311
+ title: `${overflowCount} more ${overflowCount === 1 ? "avatar" : "avatars"}`,
312
+ children: [
313
+ "+",
314
+ overflowCount
315
+ ]
316
+ }
317
+ ) : null
318
+ ]
319
+ }
320
+ );
321
+ }
322
+
323
+ // src/primitives/badge.tsx
324
+ import { cva as cva2 } from "class-variance-authority";
325
+ import { jsx as jsx3 } from "react/jsx-runtime";
326
+ var badgeVariants = cva2(
327
+ "inline-flex items-center rounded-md border px-1.5 py-0.5 text-[var(--ds-metadata)] font-medium leading-4 transition-colors",
328
+ {
329
+ variants: {
330
+ variant: {
331
+ default: "border-action bg-action text-action-foreground",
332
+ accent: "border-selection-border bg-selection-background text-selection-foreground",
333
+ secondary: "border-neutral-border bg-neutral-background text-neutral-foreground",
334
+ neutral: "border-neutral-border bg-neutral-background text-neutral-foreground",
335
+ outline: "border-border-default text-text-primary",
336
+ information: "border-information-border bg-information-background text-information-foreground",
337
+ info: "border-information-border bg-information-background text-information-foreground",
338
+ success: "border-success-border bg-success-background text-success-foreground",
339
+ warning: "border-warning-border bg-warning-background text-warning-foreground",
340
+ danger: "border-danger-border bg-danger-background text-danger-foreground",
341
+ destructive: "border-danger-border bg-danger-background text-danger-foreground"
342
+ }
343
+ },
344
+ defaultVariants: {
345
+ variant: "neutral"
346
+ }
347
+ }
348
+ );
349
+ function Badge({
350
+ className,
351
+ variant,
352
+ ...props
353
+ }) {
354
+ return /* @__PURE__ */ jsx3("span", { "data-slot": "badge", className: cn(badgeVariants({ variant, className })), ...props });
355
+ }
356
+
357
+ // src/primitives/brand-icon.tsx
358
+ import { jsx as jsx4 } from "react/jsx-runtime";
359
+ var CONSCIA_SYMBOL_PATH = [
360
+ "M171.225 63.8139L173.637 66.1116L203.794 34.4551L201.382 32.1575L171.225 63.8139Z",
361
+ "M184.012 78.9693L185.769 81.8487L223.091 59.076L221.334 56.1966L184.012 78.9693Z",
362
+ "M192.436 96.8858L193.417 100.222L235.362 87.8847L234.381 84.5488L192.436 96.8858Z",
363
+ "M195.949 116.334L196.037 119.987L239.746 118.926L239.657 115.273L195.949 116.334Z",
364
+ "M194.341 135.989L193.42 139.796L235.913 150.084L236.835 146.277L194.341 135.989Z",
365
+ "M187.759 154.526L185.708 158.285L224.091 179.221L226.142 175.461L187.759 154.526Z",
366
+ "M176.683 170.712L173.394 174.165L205.05 204.322L208.34 200.868L176.683 170.712Z",
367
+ "M161.899 183.49L157.288 186.304L180.06 223.626L184.672 220.812L161.899 183.49Z",
368
+ "M144.425 192.058L138.472 193.809L150.809 235.754L156.762 234.003L144.425 192.058Z",
369
+ "M125.438 195.913L118.244 196.088L119.305 239.796L126.499 239.622L125.438 195.913Z",
370
+ "M106.176 194.873L98.0421 192.903L87.754 235.397L95.8882 237.366L106.176 194.873Z",
371
+ "M87.8408 189.056L79.3505 184.425L58.4147 222.808L66.905 227.439L87.8408 189.056Z",
372
+ "M71.5444 178.838L63.5819 171.253L33.4252 202.91L41.3878 210.495L71.5444 178.838Z",
373
+ "M58.2896 164.821L51.9185 154.379L14.5961 177.152L20.9672 187.593L58.2896 164.821Z",
374
+ "M48.9443 147.836L45.1912 135.075L3.24659 147.412L6.99972 160.173L48.9443 147.836Z",
375
+ "M44.1724 128.938L43.8283 114.759L0.119827 115.82L0.463868 129.998L44.1724 128.938Z",
376
+ "M44.3613 109.352L47.8648 94.8809L5.37116 84.5928L1.86766 99.0635L44.3613 109.352Z",
377
+ "M49.563 90.3812L56.9571 76.825L18.5742 55.8893L11.18 69.4455L49.563 90.3812Z",
378
+ "M59.4839 73.314L70.4267 61.8269L38.7702 31.6703L27.8274 43.1574L59.4839 73.314Z",
379
+ "M73.4951 59.3251L87.307 50.8976L64.5343 13.5752L50.7224 22.0027L73.4951 59.3251Z",
380
+ "M90.6772 49.3891L106.414 44.7604L94.0775 2.81575L78.3402 7.44453L90.6772 49.3891Z",
381
+ "M109.88 44.2086L126.426 43.8071L125.366 0.098614L108.82 0.500089L109.88 44.2086Z",
382
+ "M129.802 44.1632L145.967 48.0768L156.255 5.58318L140.09 1.66954L129.802 44.1632Z",
383
+ "M149.087 49.2798L163.709 57.2553L184.645 18.8723L170.023 10.8969L149.087 49.2798Z",
384
+ "M152.448 160.384L141.06 167.332L154.089 188.685L165.477 181.736L152.448 160.384Z",
385
+ "M140.881 167.41L128.103 171.168L135.161 195.165L147.939 191.407L140.881 167.41Z",
386
+ "M127.834 171.202L114.653 171.522L115.26 196.528L128.441 196.209L127.834 171.202Z",
387
+ "M114.192 171.456L101.624 168.413L95.738 192.724L108.306 195.767L114.192 171.456Z",
388
+ "M100.907 168.109L89.889 162.1L77.9114 184.059L88.9296 190.069L100.907 168.109Z",
389
+ "M88.9224 161.353L80.2035 153.047L62.9505 171.158L71.6694 179.464L88.9224 161.353Z",
390
+ "M79.1143 151.631L73.1721 141.893L51.8195 154.921L57.7617 164.66L79.1143 151.631Z",
391
+ "M72.2163 139.615L69.2075 129.385L45.2105 136.444L48.2193 146.673L72.2163 139.615Z",
392
+ "M68.7593 126.163L68.5209 116.339L43.5147 116.946L43.7531 126.77L68.7593 126.163Z",
393
+ "M69.0161 112.256L71.1176 103.576L46.8064 97.6899L44.7049 106.37L69.0161 112.256Z",
394
+ "M72.979 98.9209L76.8146 91.8888L54.8552 79.9112L51.0196 86.9432L72.979 98.9209Z",
395
+ "M80.3506 87.1414L85.2494 81.999L67.1383 64.746L62.2395 69.8884L80.3506 87.1414Z",
396
+ "M90.5762 77.7753L95.9023 74.5255L82.8738 53.1729L77.5476 56.4227L90.5762 77.7753Z",
397
+ "M102.889 71.4875L108.114 69.9508L101.056 45.9537L95.831 47.4905L102.889 71.4875Z",
398
+ "M116.381 68.7043L121.119 68.5894L120.513 43.5832L115.775 43.6981L116.381 68.7043Z",
399
+ "M130.08 69.5886L134.092 70.56L139.978 46.2488L135.966 45.2775L130.08 69.5886Z",
400
+ "M143.01 74.0389L146.183 75.7697L158.161 53.8103L154.988 52.0795L143.01 74.0389Z",
401
+ "M154.273 81.705L156.588 83.9108L173.841 65.7997L171.526 63.5939L154.273 81.705Z",
402
+ "M163.102 92.0197L164.599 94.4735L185.952 81.445L184.455 78.9911L163.102 92.0197Z",
403
+ "M168.91 104.243L169.655 106.775L193.652 99.7164L192.907 97.1844L168.91 104.243Z",
404
+ "M171.325 117.515L171.386 120.001L196.392 119.394L196.331 116.909L171.325 117.515Z",
405
+ "M170.21 130.922L169.644 133.264L193.955 139.15L194.522 136.808L170.21 130.922Z",
406
+ "M165.673 143.549L164.523 145.658L186.482 157.636L187.633 155.527L165.673 143.549Z",
407
+ "M158.032 154.558L156.355 156.318L174.467 173.571L176.143 171.811L158.032 154.558Z"
408
+ ].join(" ");
409
+ function BrandIcon({
410
+ "aria-label": ariaLabel,
411
+ className,
412
+ ...props
413
+ }) {
414
+ return /* @__PURE__ */ jsx4(
415
+ "svg",
416
+ {
417
+ "data-slot": "brand-icon",
418
+ xmlns: "http://www.w3.org/2000/svg",
419
+ width: "240",
420
+ height: "240",
421
+ viewBox: "0 0 240 240",
422
+ fill: "none",
423
+ focusable: "false",
424
+ role: ariaLabel ? "img" : void 0,
425
+ "aria-hidden": ariaLabel ? void 0 : true,
426
+ "aria-label": ariaLabel,
427
+ className: cn("size-6 shrink-0 text-text-primary dark:text-white", className),
428
+ ...props,
429
+ children: /* @__PURE__ */ jsx4("path", { d: CONSCIA_SYMBOL_PATH, fill: "currentColor" })
430
+ }
431
+ );
432
+ }
433
+
434
+ // src/primitives/brand-wordmark.tsx
435
+ import { jsx as jsx5 } from "react/jsx-runtime";
436
+ var CONSCIA_WORDMARK_PATH = [
437
+ "M485.154 47.9722V40.929H495.867V90.529H485.154V83.3866C481.086 89.041 475.333 91.8186 467.794 91.8186C460.949 91.8186 455.195 89.3386 450.334 84.2794C445.474 79.2202 443.093 72.9706 443.093 65.729C443.093 58.3882 445.474 52.2378 450.334 47.1786C455.195 42.1194 460.949 39.6394 467.794 39.6394C475.333 39.6394 481.086 42.417 485.154 47.9722ZM458.27 77.137C461.246 80.113 465.016 81.601 469.48 81.601C473.944 81.601 477.714 80.113 480.69 77.137C483.666 74.0618 485.154 70.2922 485.154 65.729C485.154 61.1658 483.666 57.3962 480.69 54.4202C477.714 51.345 473.944 49.857 469.48 49.857C465.016 49.857 461.246 51.345 458.27 54.4202C455.294 57.3962 453.806 61.1658 453.806 65.729C453.806 70.2922 455.294 74.0618 458.27 77.137Z",
438
+ "M436.308 31.5049C433.63 34.1833 429.463 34.1833 426.686 31.5049C424.007 28.7273 424.007 24.5609 426.686 21.8825C429.364 19.1049 433.729 19.1049 436.407 21.8825C439.086 24.5609 439.086 28.7273 436.308 31.5049ZM436.903 90.5288H426.19V40.9289H436.903V90.5288Z",
439
+ "M399.598 91.8186C392.158 91.8186 385.909 89.3386 380.85 84.2794C375.89 79.2202 373.41 73.0698 373.41 65.729C373.41 58.289 375.89 52.1386 380.85 47.1786C385.909 42.1194 392.158 39.6394 399.598 39.6394C409.221 39.6394 417.752 44.5994 421.72 52.4362L412.494 57.793C410.213 53.0314 405.451 50.1546 399.499 50.1546C395.134 50.1546 391.464 51.6426 388.488 54.6186C385.611 57.5946 384.123 61.265 384.123 65.729C384.123 70.193 385.611 73.8634 388.488 76.8394C391.464 79.8154 395.134 81.3034 399.499 81.3034C405.352 81.3034 410.312 78.3274 412.693 73.665L421.918 78.9226C417.653 86.8586 409.221 91.8186 399.598 91.8186Z",
440
+ "M344.816 54.6186C344.816 57.8922 348.982 59.5786 354.141 61.0666C361.779 62.753 371.699 65.9274 371.501 76.5418C371.501 81.3034 369.616 85.073 365.945 87.7514C362.275 90.4298 357.712 91.8186 352.157 91.8186C342.336 91.8186 335.094 87.4538 331.92 80.2122L341.146 74.8554C342.832 79.617 346.502 81.9978 352.157 81.9978C357.811 81.9978 360.589 80.113 360.589 76.4426C360.589 73.2682 356.422 71.3834 351.165 70.0938C343.725 68.209 333.706 65.233 333.904 54.817C333.904 50.2538 335.59 46.5834 339.062 43.8058C342.534 41.0282 346.899 39.6394 352.058 39.6394C360.291 39.6394 366.937 43.5082 370.409 49.9562L361.382 55.0154C359.696 51.2458 356.522 49.361 352.058 49.361C347.99 49.361 344.816 51.1466 344.816 54.6186Z",
441
+ "M308.082 39.6394C319.49 39.6394 327.129 47.377 327.129 60.0746V90.529H316.415V61.1658C316.415 53.7258 312.149 49.6586 305.305 49.6586C297.765 49.6586 292.706 54.321 292.706 63.9434V90.529H281.993V40.929H292.706V47.2778C295.98 42.2186 301.039 39.6394 308.082 39.6394Z",
442
+ "M249.588 91.8186C242.347 91.8186 236.097 89.3386 231.038 84.2794C225.979 79.2202 223.399 73.0698 223.399 65.729C223.399 58.3882 225.979 52.2378 231.038 47.1786C236.097 42.1194 242.347 39.6394 249.588 39.6394C256.929 39.6394 263.079 42.1194 268.139 47.1786C273.198 52.2378 275.777 58.3882 275.777 65.729C275.777 73.0698 273.198 79.2202 268.139 84.2794C263.079 89.3386 256.929 91.8186 249.588 91.8186ZM238.577 76.9386C241.553 79.9146 245.223 81.4026 249.588 81.4026C253.953 81.4026 257.623 79.9146 260.599 76.9386C263.575 73.9626 265.063 70.193 265.063 65.729C265.063 61.265 263.575 57.4954 260.599 54.5194C257.623 51.5434 253.953 50.0554 249.588 50.0554C245.223 50.0554 241.553 51.5434 238.577 54.5194C235.601 57.4954 234.113 61.265 234.113 65.729C234.113 70.193 235.601 73.9626 238.577 76.9386Z",
443
+ "M191.106 91.8184C180.69 91.8184 171.96 88.3464 165.116 81.5017C158.271 74.5577 154.799 66.0265 154.799 55.8089C154.799 45.5913 158.271 37.0601 165.116 30.2153C171.96 23.2713 180.69 19.7993 191.106 19.7993C203.704 19.7993 215.013 26.1481 220.965 36.3657L211.045 42.1193C207.375 35.2745 199.836 30.9097 191.106 30.9097C183.666 30.9097 177.714 33.2905 173.052 37.9529C168.488 42.6153 166.207 48.5673 166.207 55.8089C166.207 63.0505 168.488 69.0025 173.052 73.6649C177.714 78.3273 183.666 80.7081 191.106 80.7081C199.836 80.7081 207.474 76.3433 211.045 69.4985L220.965 75.1529C218.088 80.2121 213.922 84.2793 208.565 87.3544C203.308 90.3304 197.455 91.8184 191.106 91.8184Z",
444
+ "M80.3374 30.1243L81.463 31.1965L95.536 16.4235L94.4105 15.3512L80.3374 30.1243Z",
445
+ "M86.3032 37.1965L87.1231 38.5402L104.54 27.913L103.72 26.5693L86.3032 37.1965Z",
446
+ "M90.2339 45.5579L90.6918 47.1146L110.266 41.3573L109.808 39.8006L90.2339 45.5579Z",
447
+ "M91.8765 54.6333L91.9179 56.3381L112.315 55.8431L112.274 54.1384L91.8765 54.6333Z",
448
+ "M91.1245 63.8054L90.6944 65.582L110.525 70.3832L110.955 68.6065L91.1245 63.8054Z",
449
+ "M88.0532 72.4561L87.0963 74.2104L105.008 83.9804L105.965 82.2261L88.0532 72.4561Z",
450
+ "M82.8853 80.0098L81.3501 81.6213L96.1232 95.6944L97.6583 94.0829L82.8853 80.0098Z",
451
+ "M75.9854 85.9727L73.8334 87.2857L84.4606 104.703L86.6126 103.39L75.9854 85.9727Z",
452
+ "M67.8301 89.9714L65.0521 90.7885L70.8094 110.363L73.5873 109.546L67.8301 89.9714Z",
453
+ "M58.9707 91.7705L55.6136 91.852L56.1085 112.249L59.4656 112.168L58.9707 91.7705Z",
454
+ "M49.9814 91.2849L46.1855 90.3659L41.3844 110.196L45.1803 111.115L49.9814 91.2849Z",
455
+ "M41.4253 88.5703L37.4631 86.4092L27.6931 104.321L31.6553 106.482L41.4253 88.5703Z",
456
+ "M33.8188 83.8022L30.103 80.2624L16.0299 95.0355L19.7458 98.5753L33.8188 83.8022Z",
457
+ "M27.6348 77.2605L24.6616 72.3878L7.24451 83.015L10.2177 87.8878L27.6348 77.2605Z",
458
+ "M23.271 69.334L21.5195 63.3792L1.94538 69.1364L3.69684 75.0912L23.271 69.334Z",
459
+ "M21.0474 60.5151L20.8868 53.8985L0.489511 54.3934L0.650063 61.0101L21.0474 60.5151Z",
460
+ "M21.1338 51.3752L22.7688 44.6222L2.93837 39.8211L1.30341 46.5741L21.1338 51.3752Z",
461
+ "M23.5605 42.522L27.0111 36.1957L9.09909 26.4258L5.6485 32.752L23.5605 42.522Z",
462
+ "M28.1909 34.5574L33.2976 29.1967L18.5246 15.1236L13.4179 20.4843L28.1909 34.5574Z",
463
+ "M34.7305 28.0295L41.176 24.0967L30.5488 6.67961L24.1032 10.6124L34.7305 28.0295Z",
464
+ "M42.749 23.3923L50.0931 21.2323L44.3358 1.65808L36.9918 3.81818L42.749 23.3923Z",
465
+ "M51.7109 20.9749L59.4323 20.7875L58.9373 0.390197L51.216 0.577552L51.7109 20.9749Z",
466
+ "M61.0078 20.9536L68.5512 22.78L73.3523 2.9496L65.8089 1.12323L61.0078 20.9536Z",
467
+ "M70.0063 23.3413L76.83 27.0632L86.6 9.15115L79.7764 5.42926L70.0063 23.3413Z",
468
+ "M71.5737 75.1902L66.2594 78.4328L72.3393 88.3974L77.6537 85.1547L71.5737 75.1902Z",
469
+ "M66.1782 78.4688L60.2153 80.2226L63.5091 91.4212L69.472 89.6674L66.1782 78.4688Z",
470
+ "M60.0874 80.2388L53.9362 80.388L54.2193 92.0576L60.3706 91.9083L60.0874 80.2388Z",
471
+ "M53.7231 80.3569L47.8581 78.937L45.1113 90.2822L50.9764 91.7021L53.7231 80.3569Z",
472
+ "M47.5229 78.7954L42.3811 75.9908L36.7916 86.2386L41.9334 89.0431L47.5229 78.7954Z",
473
+ "M41.9287 75.6421L37.8599 71.7661L29.8085 80.2179L33.8773 84.0939L41.9287 75.6421Z",
474
+ "M37.3511 71.1057L34.578 66.561L24.6135 72.641L27.3865 77.1857L37.3511 71.1057Z",
475
+ "M34.1333 65.498L32.7292 60.7242L21.5306 64.0181L22.9347 68.7918L34.1333 65.498Z",
476
+ "M32.52 59.2202L32.4088 54.6358L20.7392 54.9189L20.8505 59.5034L32.52 59.2202Z",
477
+ "M32.6411 52.7302L33.6218 48.6797L22.2766 45.9329L21.2959 49.9834L32.6411 52.7302Z",
478
+ "M34.4888 46.5073L36.2787 43.2257L26.031 37.6361L24.241 40.9178L34.4888 46.5073Z",
479
+ "M37.9297 41.0103L40.2158 38.6105L31.7639 30.5591L29.4779 32.9589L37.9297 41.0103Z",
480
+ "M42.7012 36.6394L45.1867 35.1228L39.1067 25.1583L36.6212 26.6749L42.7012 36.6394Z",
481
+ "M48.4478 33.7051L50.8861 32.9879L47.5923 21.7893L45.1539 22.5064L48.4478 33.7051Z",
482
+ "M54.7437 32.4062L56.9548 32.3526L56.6716 20.683L54.4605 20.7367L54.7437 32.4062Z",
483
+ "M61.1377 32.8188L63.01 33.2721L65.7568 21.9269L63.8845 21.4736L61.1377 32.8188Z",
484
+ "M67.1694 34.8958L68.6503 35.7035L74.2398 25.4557L72.759 24.648L67.1694 34.8958Z",
485
+ "M72.4282 38.4731L73.5088 39.5025L81.5602 31.0507L80.4796 30.0213L72.4282 38.4731Z",
486
+ "M76.5459 43.2869L77.2446 44.432L87.2092 38.352L86.5104 37.2069L76.5459 43.2869Z",
487
+ "M79.2554 48.9905L79.6029 50.1721L90.8015 46.8783L90.454 45.6967L79.2554 48.9905Z",
488
+ "M80.3833 55.1848L80.4114 56.3446L92.081 56.0615L92.0528 54.9017L80.3833 55.1848Z",
489
+ "M79.8657 61.4412L79.6012 62.5339L90.9464 65.2807L91.2109 64.188L79.8657 61.4412Z",
490
+ "M77.7466 67.3337L77.2096 68.3182L87.4573 73.9077L87.9943 72.9233L77.7466 67.3337Z",
491
+ "M74.1807 72.4714L73.3984 73.2926L81.8502 81.344L82.6325 80.5228L74.1807 72.4714Z"
492
+ ].join(" ");
493
+ function BrandWordmark({
494
+ "aria-label": ariaLabel,
495
+ className,
496
+ ...props
497
+ }) {
498
+ return /* @__PURE__ */ jsx5(
499
+ "svg",
500
+ {
501
+ "data-slot": "brand-wordmark",
502
+ xmlns: "http://www.w3.org/2000/svg",
503
+ width: "496",
504
+ height: "113",
505
+ viewBox: "0 0 496 113",
506
+ fill: "none",
507
+ focusable: "false",
508
+ role: ariaLabel ? "img" : void 0,
509
+ "aria-hidden": ariaLabel ? void 0 : true,
510
+ "aria-label": ariaLabel,
511
+ className: cn(
512
+ "h-auto w-36 shrink-0 text-text-primary dark:text-white",
513
+ className
514
+ ),
515
+ ...props,
516
+ children: /* @__PURE__ */ jsx5("path", { d: CONSCIA_WORDMARK_PATH, fill: "currentColor" })
517
+ }
518
+ );
519
+ }
520
+
521
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/index.parts.mjs
522
+ var index_parts_exports2 = {};
523
+ __export(index_parts_exports2, {
524
+ Root: () => SwitchRoot,
525
+ Thumb: () => SwitchThumb
526
+ });
527
+
528
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/root/SwitchRoot.mjs
529
+ import * as React5 from "react";
530
+
531
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs
532
+ import * as React4 from "react";
533
+ var SwitchRootContext = /* @__PURE__ */ React4.createContext(void 0);
534
+ if (true) SwitchRootContext.displayName = "SwitchRootContext";
535
+ function useSwitchRootContext() {
536
+ const context = React4.useContext(SwitchRootContext);
537
+ if (context === void 0) {
538
+ throw new Error(true ? "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>." : formatErrorMessage_default(63));
539
+ }
540
+ return context;
541
+ }
542
+
543
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/stateAttributesMapping.mjs
544
+ var stateAttributesMapping = {
545
+ ...fieldValidityMapping,
546
+ checked(value) {
547
+ if (value) {
548
+ return {
549
+ "data-checked": ""
550
+ };
551
+ }
552
+ return {
553
+ "data-unchecked": ""
554
+ };
555
+ }
556
+ };
557
+
558
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/root/SwitchRoot.mjs
559
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
560
+ var SwitchRoot = /* @__PURE__ */ React5.forwardRef(function SwitchRoot2(componentProps, forwardedRef) {
561
+ const {
562
+ checked: checkedProp,
563
+ className,
564
+ defaultChecked,
565
+ "aria-labelledby": ariaLabelledByProp,
566
+ form,
567
+ id: idProp,
568
+ inputRef: externalInputRef,
569
+ name: nameProp,
570
+ nativeButton = false,
571
+ onCheckedChange,
572
+ readOnly = false,
573
+ required = false,
574
+ disabled: disabledProp = false,
575
+ render,
576
+ uncheckedValue,
577
+ value,
578
+ style,
579
+ ...elementProps
580
+ } = componentProps;
581
+ const {
582
+ clearErrors
583
+ } = useFormContext();
584
+ const {
585
+ state: fieldState,
586
+ setTouched,
587
+ setDirty,
588
+ validityData,
589
+ setFilled,
590
+ setFocused,
591
+ validationMode,
592
+ disabled: fieldDisabled,
593
+ name: fieldName,
594
+ validation
595
+ } = useFieldRootContext();
596
+ const {
597
+ labelId
598
+ } = useLabelableContext();
599
+ const disabled = fieldDisabled || disabledProp;
600
+ const name = fieldName ?? nameProp;
601
+ const inputRef = React5.useRef(null);
602
+ const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);
603
+ const switchRef = React5.useRef(null);
604
+ const id = useBaseUiId();
605
+ const controlId = useLabelableId({
606
+ id: idProp,
607
+ implicit: false,
608
+ controlRef: switchRef
609
+ });
610
+ const hiddenInputId = nativeButton ? void 0 : controlId;
611
+ const [checked, setCheckedState] = useControlled({
612
+ controlled: checkedProp,
613
+ default: Boolean(defaultChecked),
614
+ name: "Switch",
615
+ state: "checked"
616
+ });
617
+ useRegisterFieldControl(switchRef, id, checked, void 0, !disabled, nameProp);
618
+ useIsoLayoutEffect(() => {
619
+ if (inputRef.current) {
620
+ setFilled(inputRef.current.checked);
621
+ }
622
+ }, [setFilled]);
623
+ useValueChanged(checked, () => {
624
+ clearErrors(name);
625
+ setDirty(checked !== validityData.initialValue);
626
+ setFilled(checked);
627
+ validation.change(checked);
628
+ });
629
+ const {
630
+ getButtonProps,
631
+ buttonRef
632
+ } = useButton({
633
+ disabled,
634
+ native: nativeButton
635
+ });
636
+ const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);
637
+ const rootProps = {
638
+ id: nativeButton ? controlId : id,
639
+ role: "switch",
640
+ "aria-checked": checked,
641
+ "aria-readonly": readOnly || void 0,
642
+ "aria-required": required || void 0,
643
+ "aria-labelledby": ariaLabelledBy,
644
+ onFocus() {
645
+ if (!disabled) {
646
+ setFocused(true);
647
+ }
648
+ },
649
+ onBlur() {
650
+ const element2 = inputRef.current;
651
+ if (!element2 || disabled) {
652
+ return;
653
+ }
654
+ setTouched(true);
655
+ setFocused(false);
656
+ if (validationMode === "onBlur") {
657
+ validation.commit(element2.checked);
658
+ }
659
+ },
660
+ onClick(event) {
661
+ if (readOnly || disabled) {
662
+ return;
663
+ }
664
+ event.preventDefault();
665
+ const input = inputRef.current;
666
+ if (!input) {
667
+ return;
668
+ }
669
+ dispatchClickWithModifiers(input, event);
670
+ }
671
+ };
672
+ const inputProps = {
673
+ ...validation.getValidationProps(disabled),
674
+ checked,
675
+ disabled,
676
+ form,
677
+ id: hiddenInputId,
678
+ name,
679
+ required,
680
+ style: name ? visuallyHiddenInput : visuallyHidden,
681
+ tabIndex: -1,
682
+ type: "checkbox",
683
+ "aria-hidden": true,
684
+ ref: handleInputRef,
685
+ onChange(event) {
686
+ if (event.nativeEvent.defaultPrevented) {
687
+ return;
688
+ }
689
+ if (readOnly) {
690
+ event.preventDefault();
691
+ return;
692
+ }
693
+ const nextChecked = event.currentTarget.checked;
694
+ const eventDetails = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
695
+ onCheckedChange?.(nextChecked, eventDetails);
696
+ if (eventDetails.isCanceled) {
697
+ return;
698
+ }
699
+ setCheckedState(nextChecked);
700
+ },
701
+ onClick(event) {
702
+ event.stopPropagation();
703
+ },
704
+ onFocus() {
705
+ switchRef.current?.focus();
706
+ },
707
+ // React <19 sets an empty value if `undefined` is passed explicitly
708
+ // To avoid this, we only set the value if it's defined
709
+ ...value !== void 0 ? {
710
+ value
711
+ } : EMPTY_OBJECT
712
+ };
713
+ const state = React5.useMemo(() => ({
714
+ ...fieldState,
715
+ checked,
716
+ disabled,
717
+ readOnly,
718
+ required
719
+ }), [fieldState, checked, disabled, readOnly, required]);
720
+ const element = useRenderElement("span", componentProps, {
721
+ state,
722
+ ref: [forwardedRef, switchRef, buttonRef],
723
+ props: [rootProps, elementProps, getButtonProps, (props) => validation.getValidationProps(disabled, props)],
724
+ stateAttributesMapping
725
+ });
726
+ return /* @__PURE__ */ _jsxs(SwitchRootContext.Provider, {
727
+ value: state,
728
+ children: [element, !checked && name && uncheckedValue !== void 0 && /* @__PURE__ */ _jsx("input", {
729
+ type: "hidden",
730
+ form,
731
+ name,
732
+ value: uncheckedValue,
733
+ disabled
734
+ }), /* @__PURE__ */ _jsx("input", {
735
+ ...inputProps,
736
+ suppressHydrationWarning: true
737
+ })]
738
+ });
739
+ });
740
+ if (true) SwitchRoot.displayName = "SwitchRoot";
741
+
742
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs
743
+ import * as React6 from "react";
744
+ var SwitchThumb = /* @__PURE__ */ React6.forwardRef(function SwitchThumb2(componentProps, forwardedRef) {
745
+ const {
746
+ render,
747
+ className,
748
+ style,
749
+ ...elementProps
750
+ } = componentProps;
751
+ const state = useSwitchRootContext();
752
+ return useRenderElement("span", componentProps, {
753
+ state,
754
+ ref: forwardedRef,
755
+ stateAttributesMapping,
756
+ props: elementProps
757
+ });
758
+ });
759
+ if (true) SwitchThumb.displayName = "SwitchThumb";
760
+
761
+ // src/primitives/switch.tsx
762
+ import { Fragment, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
763
+ function Switch({
764
+ className,
765
+ size = "default",
766
+ onLabel,
767
+ offLabel,
768
+ ...props
769
+ }) {
770
+ const labeled = onLabel != null || offLabel != null;
771
+ return /* @__PURE__ */ jsxs2(
772
+ index_parts_exports2.Root,
773
+ {
774
+ "data-slot": "switch",
775
+ "data-size": size,
776
+ "data-labeled": labeled ? "true" : void 0,
777
+ className: cn(
778
+ "peer group/switch inline-flex shrink-0 items-center border border-transparent shadow-xs transition-all outline-none focus-visible:border-focus focus-visible:ring-[3px] focus-visible:ring-focus/50 disabled:cursor-not-allowed disabled:opacity-50",
779
+ labeled ? "relative rounded-[0.625rem] p-0.5 data-[size=default]:h-6 data-[size=default]:w-20 data-[size=default]:[--switch-thumb-travel:3.75rem] data-[size=sm]:h-5 data-[size=sm]:w-[4.5rem] data-[size=sm]:[--switch-thumb-travel:3.5rem] data-checked:bg-action data-unchecked:bg-control-border" : "rounded-full data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-checked:bg-action data-unchecked:bg-control-border",
780
+ className
781
+ ),
782
+ ...props,
783
+ children: [
784
+ labeled ? /* @__PURE__ */ jsxs2(Fragment, { children: [
785
+ /* @__PURE__ */ jsx6(
786
+ "span",
787
+ {
788
+ "aria-hidden": "true",
789
+ "data-slot": "switch-on-label",
790
+ className: "pointer-events-none absolute inset-y-0.5 left-0 flex w-1/2 items-center justify-center overflow-hidden px-0.5 text-[0.5625rem] font-semibold leading-none tracking-[0.02em] text-action-foreground transition-opacity group-data-checked/switch:opacity-100 group-data-unchecked/switch:opacity-0",
791
+ children: onLabel ?? "ON"
792
+ }
793
+ ),
794
+ /* @__PURE__ */ jsx6(
795
+ "span",
796
+ {
797
+ "aria-hidden": "true",
798
+ "data-slot": "switch-off-label",
799
+ className: "pointer-events-none absolute inset-y-0.5 right-0 flex w-1/2 items-center justify-center overflow-hidden px-0.5 text-[0.5625rem] font-semibold leading-none tracking-[0.02em] text-text-supporting transition-opacity group-data-checked/switch:opacity-0 group-data-unchecked/switch:opacity-100",
800
+ children: offLabel ?? "OFF"
801
+ }
802
+ )
803
+ ] }) : null,
804
+ /* @__PURE__ */ jsx6(
805
+ index_parts_exports2.Thumb,
806
+ {
807
+ "data-slot": "switch-thumb",
808
+ className: cn(
809
+ "pointer-events-none block rounded-full bg-canvas transition-transform",
810
+ labeled ? "absolute top-1/2 left-0.5 z-10 -translate-y-1/2 data-checked:translate-x-[var(--switch-thumb-travel)] data-unchecked:translate-x-0 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3" : "group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0"
811
+ )
812
+ }
813
+ )
814
+ ]
815
+ }
816
+ );
817
+ }
818
+ function LabeledSwitch({ onLabel = "ON", offLabel = "OFF", ...props }) {
819
+ return /* @__PURE__ */ jsx6(Switch, { ...props, onLabel, offLabel });
820
+ }
821
+
822
+ // src/primitives/textarea.tsx
823
+ import { jsx as jsx7 } from "react/jsx-runtime";
824
+ function Textarea({ className, ...props }) {
825
+ return /* @__PURE__ */ jsx7(
826
+ "textarea",
827
+ {
828
+ "data-slot": "textarea",
829
+ className: cn("ds-type-control min-h-28 w-full rounded-[var(--ds-field-control-radius)] border border-control-border bg-surface-control px-[var(--ds-field-control-padding-x)] py-3 outline-none transition-colors placeholder:text-text-supporting focus-visible:border-focus focus-visible:ring-[3px] focus-visible:ring-focus/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 disabled:cursor-not-allowed disabled:opacity-50", className),
830
+ ...props
831
+ }
832
+ );
833
+ }
834
+
835
+ // src/primitives/compat.tsx
836
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
837
+ var ConsciaButton = Button;
838
+ var ConsciaIconButton = IconButton;
839
+ var ConsciaCard = Card;
840
+ var ConsciaCardContent = CardContent;
841
+ var ConsciaCardDescription = CardDescription;
842
+ function ConsciaCardHeader({
843
+ actionRight,
844
+ className,
845
+ children,
846
+ ...props
847
+ }) {
848
+ if (!actionRight) {
849
+ return /* @__PURE__ */ jsx8(CardHeader, { className, ...props, children });
850
+ }
851
+ return /* @__PURE__ */ jsxs3(
852
+ CardHeader,
853
+ {
854
+ className: cn(
855
+ "grid grid-cols-[minmax(0,1fr)_auto] items-start gap-4",
856
+ className
857
+ ),
858
+ ...props,
859
+ children: [
860
+ /* @__PURE__ */ jsx8("div", { className: "grid gap-2", children }),
861
+ /* @__PURE__ */ jsx8("div", { className: "justify-self-end", children: actionRight })
862
+ ]
863
+ }
864
+ );
865
+ }
866
+ var ConsciaCardTitle = CardTitle;
867
+ var ConsciaCardFooter = CardFooter;
868
+ var ConsciaCheckbox = Checkbox;
869
+ var ConsciaInput = Input;
870
+ var ConsciaSwitch = Switch;
871
+ var ConsciaTextarea = Textarea;
872
+ var ConsciaSelect = Select;
873
+ var ConsciaSelectContent = SelectContent;
874
+ var ConsciaSelectGroup = SelectGroup;
875
+ var ConsciaSelectItem = SelectItem;
876
+ var ConsciaSelectTrigger = SelectTrigger;
877
+ var ConsciaSelectValue = SelectValue;
878
+ var ConsciaTable = Table;
879
+ var ConsciaTableBody = TableBody;
880
+ var ConsciaTableCell = TableCell;
881
+ var ConsciaTableHeader = TableHeader;
882
+ var ConsciaTableHead = TableHead;
883
+ var ConsciaTableRow = TableRow;
884
+
885
+ // src/primitives/field.tsx
886
+ import { jsx as jsx9 } from "react/jsx-runtime";
887
+ function Field({
888
+ className,
889
+ ...props
890
+ }) {
891
+ return /* @__PURE__ */ jsx9(
892
+ "div",
893
+ {
894
+ "data-slot": "field",
895
+ className: cn("grid gap-[var(--ds-field-label-gap)]", className),
896
+ ...props
897
+ }
898
+ );
899
+ }
900
+ function FieldGroup({
901
+ className,
902
+ ...props
903
+ }) {
904
+ return /* @__PURE__ */ jsx9(
905
+ "div",
906
+ {
907
+ "data-slot": "field-group",
908
+ className: cn("grid gap-[var(--ds-field-gap)]", className),
909
+ ...props
910
+ }
911
+ );
912
+ }
913
+ function FieldLabel({
914
+ className,
915
+ ...props
916
+ }) {
917
+ return /* @__PURE__ */ jsx9(
918
+ "label",
919
+ {
920
+ "data-slot": "field-label",
921
+ className: cn("ds-type-label text-text-primary", className),
922
+ ...props
923
+ }
924
+ );
925
+ }
926
+ function FieldDescription({
927
+ className,
928
+ ...props
929
+ }) {
930
+ return /* @__PURE__ */ jsx9(
931
+ "p",
932
+ {
933
+ "data-slot": "field-description",
934
+ className: cn("ds-type-metadata mt-[var(--ds-field-message-gap)] text-text-supporting", className),
935
+ ...props
936
+ }
937
+ );
938
+ }
939
+ function FieldError({
940
+ className,
941
+ ...props
942
+ }) {
943
+ return /* @__PURE__ */ jsx9(
944
+ "p",
945
+ {
946
+ "data-slot": "field-error",
947
+ className: cn("ds-type-metadata mt-[var(--ds-field-message-gap)] font-medium text-danger-foreground", className),
948
+ ...props
949
+ }
950
+ );
951
+ }
952
+
953
+ // src/primitives/filter-chip.tsx
954
+ import { XIcon } from "lucide-react";
955
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
956
+ function FilterChip({
957
+ className,
958
+ label,
959
+ onRemove,
960
+ removeLabel,
961
+ value,
962
+ ...props
963
+ }) {
964
+ const fallbackRemoveLabel = typeof label === "string" ? `Remove ${label} filter` : "Remove filter";
965
+ return /* @__PURE__ */ jsxs4(
966
+ "div",
967
+ {
968
+ "data-slot": "filter-chip",
969
+ className: cn(
970
+ "inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-border-default bg-surface-muted px-2 py-1 text-sm text-text-primary",
971
+ className
972
+ ),
973
+ ...props,
974
+ children: [
975
+ /* @__PURE__ */ jsx10("span", { className: "shrink-0 text-text-supporting", children: label }),
976
+ value !== void 0 ? /* @__PURE__ */ jsx10("span", { className: "min-w-0 truncate font-medium", children: value }) : null,
977
+ onRemove ? /* @__PURE__ */ jsx10(
978
+ IconButton,
979
+ {
980
+ type: "button",
981
+ size: "sm",
982
+ variant: "ghost",
983
+ "aria-label": removeLabel ?? fallbackRemoveLabel,
984
+ onClick: onRemove,
985
+ className: "-mr-1 size-5 rounded-full text-text-supporting hover:bg-surface-control-hover hover:text-text-primary",
986
+ children: /* @__PURE__ */ jsx10(XIcon, { "aria-hidden": "true", className: "size-3" })
987
+ }
988
+ ) : null
989
+ ]
990
+ }
991
+ );
992
+ }
993
+
994
+ // src/primitives/form-select.tsx
995
+ import * as React7 from "react";
996
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
997
+ var emptyValue = "__conscia_empty_select_value__";
998
+ function toSelectValue(value) {
999
+ if (value === void 0) {
1000
+ return void 0;
1001
+ }
1002
+ return value === "" ? emptyValue : value;
1003
+ }
1004
+ function fromSelectValue(value) {
1005
+ return value === emptyValue ? "" : value;
1006
+ }
1007
+ function FormSelect({
1008
+ name,
1009
+ id,
1010
+ value,
1011
+ defaultValue,
1012
+ required,
1013
+ disabled,
1014
+ placeholder,
1015
+ options,
1016
+ className,
1017
+ triggerClassName,
1018
+ contentClassName,
1019
+ onValueChange,
1020
+ onClick,
1021
+ "aria-label": ariaLabel
1022
+ }) {
1023
+ const [internalValue, setInternalValue] = React7.useState(defaultValue ?? "");
1024
+ const currentValue = value ?? internalValue;
1025
+ function handleValueChange(nextValue) {
1026
+ const actualValue = fromSelectValue(nextValue);
1027
+ if (value === void 0) {
1028
+ setInternalValue(actualValue);
1029
+ }
1030
+ onValueChange?.(actualValue);
1031
+ }
1032
+ return /* @__PURE__ */ jsx11("div", { className: cn("min-w-0", className), onClick, children: /* @__PURE__ */ jsxs5(
1033
+ Select,
1034
+ {
1035
+ name,
1036
+ value: toSelectValue(currentValue),
1037
+ required,
1038
+ disabled,
1039
+ onValueChange: handleValueChange,
1040
+ children: [
1041
+ /* @__PURE__ */ jsx11(SelectTrigger, { id, "aria-label": ariaLabel, className: triggerClassName, children: /* @__PURE__ */ jsx11(SelectValue, { placeholder }) }),
1042
+ /* @__PURE__ */ jsx11(SelectContent, { className: contentClassName, children: /* @__PURE__ */ jsx11(SelectGroup, { children: options.map((option) => /* @__PURE__ */ jsx11(
1043
+ SelectItem,
1044
+ {
1045
+ value: toSelectValue(option.value) ?? emptyValue,
1046
+ disabled: option.disabled,
1047
+ children: option.label
1048
+ },
1049
+ option.value
1050
+ )) }) })
1051
+ ]
1052
+ }
1053
+ ) });
1054
+ }
1055
+ var ConsciaFormSelect = FormSelect;
1056
+
1057
+ // src/primitives/label.tsx
1058
+ import { jsx as jsx12 } from "react/jsx-runtime";
1059
+ function Label({
1060
+ className,
1061
+ ...props
1062
+ }) {
1063
+ return /* @__PURE__ */ jsx12("label", { "data-slot": "label", className: cn("ds-type-label flex items-center gap-2 text-text-primary select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props });
1064
+ }
1065
+
1066
+ // src/primitives/spinner.tsx
1067
+ import { LoaderCircle } from "lucide-react";
1068
+ import { jsx as jsx13 } from "react/jsx-runtime";
1069
+ function Spinner({
1070
+ "aria-label": ariaLabel,
1071
+ className,
1072
+ label,
1073
+ size = "default",
1074
+ ...props
1075
+ }) {
1076
+ const accessibleLabel = ariaLabel ?? label;
1077
+ return /* @__PURE__ */ jsx13(
1078
+ "span",
1079
+ {
1080
+ "data-slot": "spinner",
1081
+ "data-size": size,
1082
+ className: cn(
1083
+ "inline-flex shrink-0 animate-spin items-center justify-center text-current motion-reduce:animate-none data-[size=default]:size-4 data-[size=lg]:size-5 data-[size=sm]:size-3.5",
1084
+ className
1085
+ ),
1086
+ role: accessibleLabel ? "status" : void 0,
1087
+ "aria-hidden": accessibleLabel ? void 0 : true,
1088
+ "aria-label": accessibleLabel,
1089
+ ...props,
1090
+ children: /* @__PURE__ */ jsx13(LoaderCircle, { "aria-hidden": "true", className: "size-full" })
1091
+ }
1092
+ );
1093
+ }
1094
+
1095
+ // src/primitives/loading-button.tsx
1096
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
1097
+ function LoadingButton({
1098
+ children,
1099
+ pending = false,
1100
+ pendingLabel = "Working\u2026",
1101
+ disabled,
1102
+ ...props
1103
+ }) {
1104
+ return /* @__PURE__ */ jsx14(
1105
+ Button,
1106
+ {
1107
+ ...props,
1108
+ disabled: disabled || pending,
1109
+ "aria-busy": pending || void 0,
1110
+ children: pending ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
1111
+ /* @__PURE__ */ jsx14(Spinner, { "aria-hidden": "true", size: "sm" }),
1112
+ pendingLabel
1113
+ ] }) : children
1114
+ }
1115
+ );
1116
+ }
1117
+
1118
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/index.parts.mjs
1119
+ var index_parts_exports3 = {};
1120
+ __export(index_parts_exports3, {
1121
+ Arrow: () => PopoverArrow,
1122
+ Backdrop: () => PopoverBackdrop,
1123
+ Close: () => PopoverClose,
1124
+ Description: () => PopoverDescription,
1125
+ Handle: () => PopoverHandle,
1126
+ Popup: () => PopoverPopup,
1127
+ Portal: () => PopoverPortal,
1128
+ Positioner: () => PopoverPositioner,
1129
+ Root: () => PopoverRoot,
1130
+ Title: () => PopoverTitle,
1131
+ Trigger: () => PopoverTrigger,
1132
+ Viewport: () => PopoverViewport,
1133
+ createHandle: () => createPopoverHandle
1134
+ });
1135
+
1136
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/root/PopoverRoot.mjs
1137
+ import * as React10 from "react";
1138
+
1139
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/root/PopoverRootContext.mjs
1140
+ import * as React8 from "react";
1141
+ var PopoverRootContext = /* @__PURE__ */ React8.createContext(void 0);
1142
+ if (true) PopoverRootContext.displayName = "PopoverRootContext";
1143
+ function usePopoverRootContext(optional) {
1144
+ const context = React8.useContext(PopoverRootContext);
1145
+ if (context === void 0 && !optional) {
1146
+ throw new Error(true ? "Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>." : formatErrorMessage_default(47));
1147
+ }
1148
+ return context;
1149
+ }
1150
+
1151
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/store/PopoverStore.mjs
1152
+ import * as React9 from "react";
1153
+ import * as ReactDOM from "react-dom";
1154
+ var selectors = {
1155
+ ...popupStoreSelectors,
1156
+ disabled: (state) => state.disabled,
1157
+ instantType: (state) => state.instantType,
1158
+ openMethod: (state) => state.openMethod,
1159
+ openChangeReason: (state) => state.openChangeReason,
1160
+ modal: (state) => state.modal,
1161
+ focusManagerModal: (state) => state.focusManagerModal,
1162
+ stickIfOpen: (state) => state.stickIfOpen,
1163
+ titleElementId: (state) => state.titleElementId,
1164
+ descriptionElementId: (state) => state.descriptionElementId,
1165
+ openOnHover: (state) => state.openOnHover,
1166
+ closeDelay: (state) => state.closeDelay,
1167
+ adaptiveOrigin: (state) => state.adaptiveOrigin
1168
+ };
1169
+ var PopoverStore = class extends ReactStore {
1170
+ constructor(initialState, floatingId, nested) {
1171
+ const triggerElements = new PopupTriggerMap();
1172
+ super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors);
1173
+ __publicField(this, "setOpen", (nextOpen, eventDetails) => {
1174
+ const isHover = eventDetails.reason === reason_parts_exports.triggerHover;
1175
+ const isKeyboardClick = eventDetails.reason === reason_parts_exports.triggerPress && eventDetails.event.detail === 0;
1176
+ const isDismissClose = !nextOpen && (eventDetails.reason === reason_parts_exports.escapeKey || eventDetails.reason == null);
1177
+ const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
1178
+ const activeTriggerId = this.select("activeTriggerId");
1179
+ if (!nextOpen && eventDetails.reason === reason_parts_exports.closePress && eventDetails.trigger == null && activeTriggerId != null) {
1180
+ eventDetails.trigger = this.context.triggerElements.getById(activeTriggerId) ?? this.select("activeTriggerElement") ?? void 0;
1181
+ }
1182
+ this.context.onOpenChange?.(nextOpen, eventDetails);
1183
+ if (eventDetails.isCanceled) {
1184
+ return;
1185
+ }
1186
+ this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
1187
+ const changeState = () => {
1188
+ const updatedState = {
1189
+ open: nextOpen,
1190
+ openChangeReason: eventDetails.reason
1191
+ };
1192
+ setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
1193
+ this.update(updatedState);
1194
+ };
1195
+ if (isHover) {
1196
+ this.set("stickIfOpen", true);
1197
+ this.context.stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {
1198
+ this.set("stickIfOpen", false);
1199
+ });
1200
+ ReactDOM.flushSync(changeState);
1201
+ } else {
1202
+ changeState();
1203
+ }
1204
+ let instantType;
1205
+ if (isKeyboardClick) {
1206
+ instantType = "click";
1207
+ } else if (isDismissClose) {
1208
+ instantType = "dismiss";
1209
+ } else if (eventDetails.reason === reason_parts_exports.focusOut) {
1210
+ instantType = "focus";
1211
+ }
1212
+ this.set("instantType", instantType);
1213
+ });
1214
+ }
1215
+ };
1216
+ function createNullPopoverStore() {
1217
+ const triggerElements = new PopupTriggerMap();
1218
+ const store = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);
1219
+ return Object.assign(store, {
1220
+ setOpen: NOOP
1221
+ });
1222
+ }
1223
+ function createInitialState(initialState, triggerElements, floatingId, nested = false) {
1224
+ const state = {
1225
+ ...createInitialPopupStoreState(),
1226
+ disabled: false,
1227
+ modal: false,
1228
+ focusManagerModal: false,
1229
+ instantType: void 0,
1230
+ openMethod: null,
1231
+ openChangeReason: null,
1232
+ titleElementId: void 0,
1233
+ descriptionElementId: void 0,
1234
+ stickIfOpen: true,
1235
+ openOnHover: false,
1236
+ closeDelay: 0,
1237
+ adaptiveOrigin: void 0,
1238
+ ...initialState
1239
+ };
1240
+ if (state.open && initialState?.mounted === void 0) {
1241
+ state.mounted = true;
1242
+ }
1243
+ state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);
1244
+ return state;
1245
+ }
1246
+ function createInitialContext(triggerElements) {
1247
+ return {
1248
+ popupRef: /* @__PURE__ */ React9.createRef(),
1249
+ onOpenChange: void 0,
1250
+ onOpenChangeComplete: void 0,
1251
+ triggerFocusTargetRef: /* @__PURE__ */ React9.createRef(),
1252
+ beforeContentFocusGuardRef: /* @__PURE__ */ React9.createRef(),
1253
+ stickIfOpenTimeout: new Timeout(),
1254
+ triggerElements
1255
+ };
1256
+ }
1257
+
1258
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/root/PopoverRoot.mjs
1259
+ import { jsx as _jsx2, jsxs as _jsxs2 } from "react/jsx-runtime";
1260
+ function PopoverRootComponent({
1261
+ props
1262
+ }) {
1263
+ const {
1264
+ children,
1265
+ open: openProp,
1266
+ defaultOpen = false,
1267
+ onOpenChange,
1268
+ onOpenChangeComplete,
1269
+ modal = false,
1270
+ handle,
1271
+ triggerId: triggerIdProp,
1272
+ defaultTriggerId: defaultTriggerIdProp = null
1273
+ } = props;
1274
+ const store = usePopoverRootStore(handle, {
1275
+ modal,
1276
+ open: defaultOpen,
1277
+ openProp,
1278
+ activeTriggerId: defaultTriggerIdProp,
1279
+ triggerIdProp
1280
+ });
1281
+ store.useControlledProp("openProp", openProp);
1282
+ store.useControlledProp("triggerIdProp", triggerIdProp);
1283
+ const open = store.useState("open");
1284
+ const mounted = store.useState("mounted");
1285
+ const payload = store.useState("payload");
1286
+ store.useContextCallback("onOpenChange", onOpenChange);
1287
+ store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
1288
+ usePopupRootSync(store, open);
1289
+ useImplicitActiveTrigger(store);
1290
+ const {
1291
+ forceUnmount
1292
+ } = useOpenStateTransitions(open, store, () => {
1293
+ store.update({
1294
+ stickIfOpen: true,
1295
+ openChangeReason: null
1296
+ });
1297
+ });
1298
+ store.useSyncedValues({
1299
+ modal
1300
+ });
1301
+ React10.useEffect(() => {
1302
+ if (!open) {
1303
+ store.context.stickIfOpenTimeout.clear();
1304
+ }
1305
+ }, [store, open]);
1306
+ React10.useImperativeHandle(props.actionsRef, () => ({
1307
+ unmount: forceUnmount,
1308
+ close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
1309
+ }), [forceUnmount, store]);
1310
+ const shouldRenderInteractions = open || mounted;
1311
+ return /* @__PURE__ */ _jsxs2(PopoverRootContext.Provider, {
1312
+ value: store,
1313
+ children: [handle && /* @__PURE__ */ _jsx2(PopupHandleAttachment, {
1314
+ handle,
1315
+ store
1316
+ }), shouldRenderInteractions && /* @__PURE__ */ _jsx2(PopoverInteractions, {
1317
+ store,
1318
+ modal
1319
+ }), typeof children === "function" ? children({
1320
+ payload
1321
+ }) : children]
1322
+ });
1323
+ }
1324
+ function PopoverRoot(props) {
1325
+ if (usePopoverRootContext(true)) {
1326
+ return /* @__PURE__ */ _jsx2(PopoverRootComponent, {
1327
+ props
1328
+ });
1329
+ }
1330
+ return /* @__PURE__ */ _jsx2(FloatingTree, {
1331
+ children: /* @__PURE__ */ _jsx2(PopoverRootComponent, {
1332
+ props
1333
+ })
1334
+ });
1335
+ }
1336
+ function usePopoverRootStore(handle, initialState) {
1337
+ const store = usePopupRootStore((floatingId, nested) => new PopoverStore(initialState, floatingId, nested));
1338
+ React10.useEffect(() => store.context.stickIfOpenTimeout.disposeEffect(), [store]);
1339
+ return store;
1340
+ }
1341
+ function PopoverInteractions({
1342
+ store,
1343
+ modal
1344
+ }) {
1345
+ const floatingRootContext = store.useState("floatingRootContext");
1346
+ const dismiss = useDismiss(floatingRootContext, {
1347
+ outsidePressEvent: {
1348
+ // Ensure `aria-hidden` on outside elements is removed immediately
1349
+ // on outside press when trapping focus.
1350
+ mouse: modal === "trap-focus" ? "sloppy" : "intentional",
1351
+ touch: "sloppy"
1352
+ }
1353
+ });
1354
+ const triggerProps = dismiss.reference;
1355
+ const popupProps = dismiss.floating;
1356
+ usePopupInteractionProps(store, {
1357
+ activeTriggerProps: triggerProps,
1358
+ inactiveTriggerProps: triggerProps,
1359
+ popupProps
1360
+ });
1361
+ return null;
1362
+ }
1363
+
1364
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/trigger/PopoverTrigger.mjs
1365
+ import * as React11 from "react";
1366
+
1367
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/utils/constants.mjs
1368
+ var OPEN_DELAY = 300;
1369
+
1370
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/trigger/PopoverTrigger.mjs
1371
+ import { jsx as _jsx3, jsxs as _jsxs3 } from "react/jsx-runtime";
1372
+ var PopoverTrigger = /* @__PURE__ */ React11.forwardRef(function PopoverTrigger2(componentProps, forwardedRef) {
1373
+ const {
1374
+ render,
1375
+ className,
1376
+ style,
1377
+ disabled = false,
1378
+ nativeButton = true,
1379
+ handle,
1380
+ payload,
1381
+ openOnHover = false,
1382
+ delay = OPEN_DELAY,
1383
+ closeDelay = 0,
1384
+ id: idProp,
1385
+ ...elementProps
1386
+ } = componentProps;
1387
+ const rootStore = usePopoverRootContext(true);
1388
+ const handleStore = usePopupHandleStore(handle);
1389
+ const store = handleStore ?? rootStore;
1390
+ if (!store) {
1391
+ throw new Error(true ? "Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle." : formatErrorMessage_default(74));
1392
+ }
1393
+ const thisTriggerId = useBaseUiId(idProp);
1394
+ const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
1395
+ const floatingContext = store.useState("floatingRootContext");
1396
+ const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
1397
+ const popupId = store.useState("triggerPopupId", thisTriggerId);
1398
+ const triggerElementRef = React11.useRef(null);
1399
+ const {
1400
+ registerTrigger,
1401
+ isMountedByThisTrigger
1402
+ } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
1403
+ payload,
1404
+ disabled,
1405
+ openOnHover,
1406
+ closeDelay
1407
+ });
1408
+ const openReason = store.useState("openChangeReason");
1409
+ const stickIfOpen = store.useState("stickIfOpen");
1410
+ const openMethod = store.useState("openMethod");
1411
+ const focusManagerModal = store.useState("focusManagerModal");
1412
+ const hoverProps = useHoverReferenceInteraction(floatingContext, {
1413
+ enabled: !disabled && openOnHover && (openMethod !== "touch" || openReason !== reason_parts_exports.triggerPress),
1414
+ mouseOnly: true,
1415
+ move: false,
1416
+ handleClose: safePolygon(),
1417
+ restMs: delay,
1418
+ delay: {
1419
+ close: closeDelay
1420
+ },
1421
+ triggerElementRef,
1422
+ isActiveTrigger: isTriggerActive,
1423
+ isClosing: () => store.select("transitionStatus") === "ending"
1424
+ });
1425
+ const click = useClick(floatingContext, {
1426
+ stickIfOpen
1427
+ });
1428
+ const interactionTypeProps = useOpenMethodTriggerProps(() => store.select("open"), (interactionType) => {
1429
+ store.set("openMethod", interactionType);
1430
+ });
1431
+ const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
1432
+ const {
1433
+ getButtonProps,
1434
+ buttonRef
1435
+ } = useButton({
1436
+ disabled,
1437
+ native: nativeButton
1438
+ });
1439
+ const stateAttributesMapping2 = {
1440
+ open(value) {
1441
+ if (value && openReason === reason_parts_exports.triggerPress) {
1442
+ return pressableTriggerOpenStateMapping.open(value);
1443
+ }
1444
+ return triggerOpenStateMapping.open(value);
1445
+ }
1446
+ };
1447
+ const {
1448
+ preFocusGuardRef,
1449
+ handlePreFocusGuardFocus,
1450
+ handleFocusTargetFocus
1451
+ } = useTriggerFocusGuards(store, triggerElementRef);
1452
+ const state = {
1453
+ disabled,
1454
+ open: isOpenedByThisTrigger
1455
+ };
1456
+ const element = useRenderElement("button", componentProps, {
1457
+ state,
1458
+ ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],
1459
+ props: [click.reference, hoverProps, rootTriggerProps, interactionTypeProps, {
1460
+ [CLICK_TRIGGER_IDENTIFIER]: "",
1461
+ id: thisTriggerId,
1462
+ "aria-haspopup": "dialog",
1463
+ "aria-expanded": isOpenedByThisTrigger,
1464
+ "aria-controls": popupId
1465
+ }, elementProps, getButtonProps],
1466
+ stateAttributesMapping: stateAttributesMapping2
1467
+ });
1468
+ const keyedElement = /* @__PURE__ */ _jsx3(React11.Fragment, {
1469
+ children: element
1470
+ }, thisTriggerId);
1471
+ if (isMountedByThisTrigger && !focusManagerModal) {
1472
+ return /* @__PURE__ */ _jsxs3(React11.Fragment, {
1473
+ children: [/* @__PURE__ */ _jsx3(FocusGuard, {
1474
+ ref: preFocusGuardRef,
1475
+ onFocus: handlePreFocusGuardFocus
1476
+ }), keyedElement, /* @__PURE__ */ _jsx3(FocusGuard, {
1477
+ ref: store.context.triggerFocusTargetRef,
1478
+ onFocus: handleFocusTargetFocus
1479
+ })]
1480
+ });
1481
+ }
1482
+ return keyedElement;
1483
+ });
1484
+ if (true) PopoverTrigger.displayName = "PopoverTrigger";
1485
+
1486
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/portal/PopoverPortal.mjs
1487
+ import * as React13 from "react";
1488
+
1489
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/portal/PopoverPortalContext.mjs
1490
+ import * as React12 from "react";
1491
+ var PopoverPortalContext = /* @__PURE__ */ React12.createContext(void 0);
1492
+ if (true) PopoverPortalContext.displayName = "PopoverPortalContext";
1493
+ function usePopoverPortalContext() {
1494
+ const value = React12.useContext(PopoverPortalContext);
1495
+ if (value === void 0) {
1496
+ throw new Error(true ? "Base UI: <Popover.Portal> is missing." : formatErrorMessage_default(45));
1497
+ }
1498
+ return value;
1499
+ }
1500
+
1501
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/portal/PopoverPortal.mjs
1502
+ import { jsx as _jsx4 } from "react/jsx-runtime";
1503
+ var PopoverPortal = /* @__PURE__ */ React13.forwardRef(function PopoverPortal2(props, forwardedRef) {
1504
+ const {
1505
+ keepMounted = false,
1506
+ ...portalProps
1507
+ } = props;
1508
+ const store = usePopoverRootContext();
1509
+ const mounted = store.useState("mounted");
1510
+ const shouldRender = mounted || keepMounted;
1511
+ if (!shouldRender) {
1512
+ return null;
1513
+ }
1514
+ return /* @__PURE__ */ _jsx4(PopoverPortalContext.Provider, {
1515
+ value: keepMounted,
1516
+ children: /* @__PURE__ */ _jsx4(FloatingPortal, {
1517
+ ref: forwardedRef,
1518
+ ...portalProps
1519
+ })
1520
+ });
1521
+ });
1522
+ if (true) PopoverPortal.displayName = "PopoverPortal";
1523
+
1524
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/positioner/PopoverPositioner.mjs
1525
+ import * as React15 from "react";
1526
+
1527
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/positioner/PopoverPositionerContext.mjs
1528
+ import * as React14 from "react";
1529
+ var PopoverPositionerContext = /* @__PURE__ */ React14.createContext(void 0);
1530
+ if (true) PopoverPositionerContext.displayName = "PopoverPositionerContext";
1531
+ function usePopoverPositionerContext() {
1532
+ const context = React14.useContext(PopoverPositionerContext);
1533
+ if (!context) {
1534
+ throw new Error(true ? "Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>." : formatErrorMessage_default(46));
1535
+ }
1536
+ return context;
1537
+ }
1538
+
1539
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/positioner/PopoverPositioner.mjs
1540
+ import { jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
1541
+ var PopoverPositioner = /* @__PURE__ */ React15.forwardRef(function PopoverPositioner2(componentProps, forwardedRef) {
1542
+ const {
1543
+ render,
1544
+ className,
1545
+ style,
1546
+ anchor,
1547
+ // `useAnchorPositioning` applies the same defaults to the undefined values; the names
1548
+ // remain destructured to exclude the props from `elementProps`.
1549
+ positionMethod,
1550
+ side,
1551
+ align,
1552
+ sideOffset,
1553
+ alignOffset,
1554
+ collisionBoundary = "clipping-ancestors",
1555
+ collisionPadding,
1556
+ arrowPadding,
1557
+ sticky,
1558
+ disableAnchorTracking = false,
1559
+ collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
1560
+ ...elementProps
1561
+ } = componentProps;
1562
+ const store = usePopoverRootContext();
1563
+ const keepMounted = usePopoverPortalContext();
1564
+ const nodeId = useFloatingNodeId();
1565
+ const floatingRootContext = store.useState("floatingRootContext");
1566
+ const mounted = store.useState("mounted");
1567
+ const open = store.useState("open");
1568
+ const openReason = store.useState("openChangeReason");
1569
+ const triggerElement = store.useState("activeTriggerElement");
1570
+ const modal = store.useState("modal");
1571
+ const openMethod = store.useState("openMethod");
1572
+ const positionerElement = store.useState("positionerElement");
1573
+ const instantType = store.useState("instantType");
1574
+ const transitionStatus = store.useState("transitionStatus");
1575
+ const adaptiveOrigin = store.useState("adaptiveOrigin");
1576
+ const prevTriggerElementRef = React15.useRef(null);
1577
+ const runOnceAnimationsFinish = useAnimationsFinished(positionerElement);
1578
+ const positioning = useAnchorPositioning({
1579
+ anchor,
1580
+ floatingRootContext,
1581
+ positionMethod,
1582
+ mounted,
1583
+ side,
1584
+ sideOffset,
1585
+ align,
1586
+ alignOffset,
1587
+ arrowPadding,
1588
+ collisionBoundary,
1589
+ collisionPadding,
1590
+ sticky,
1591
+ disableAnchorTracking,
1592
+ keepMounted,
1593
+ nodeId,
1594
+ collisionAvoidance,
1595
+ adaptiveOrigin
1596
+ });
1597
+ const domReference = floatingRootContext.useState("domReferenceElement");
1598
+ useIsoLayoutEffect(() => {
1599
+ const currentTriggerElement = domReference;
1600
+ const prevTriggerElement = prevTriggerElementRef.current;
1601
+ if (currentTriggerElement) {
1602
+ prevTriggerElementRef.current = currentTriggerElement;
1603
+ }
1604
+ if (prevTriggerElement && currentTriggerElement && currentTriggerElement !== prevTriggerElement) {
1605
+ store.set("instantType", void 0);
1606
+ const ac = new AbortController();
1607
+ runOnceAnimationsFinish(() => {
1608
+ store.set("instantType", "trigger-change");
1609
+ }, ac.signal);
1610
+ return () => {
1611
+ ac.abort();
1612
+ };
1613
+ }
1614
+ return void 0;
1615
+ }, [domReference, runOnceAnimationsFinish, store]);
1616
+ const trueModalNonHover = modal === true && openReason !== reason_parts_exports.triggerHover;
1617
+ useAnchoredPopupScrollLock(open && trueModalNonHover, openMethod === "touch", positionerElement, triggerElement);
1618
+ const setPositionerElement = store.useStateSetter("positionerElement");
1619
+ const state = {
1620
+ open,
1621
+ side: positioning.side,
1622
+ align: positioning.align,
1623
+ anchorHidden: positioning.anchorHidden,
1624
+ instant: instantType
1625
+ };
1626
+ const element = usePositioner(componentProps, state, {
1627
+ styles: positioning.positionerStyles,
1628
+ transitionStatus,
1629
+ props: elementProps,
1630
+ refs: [forwardedRef, setPositionerElement],
1631
+ hidden: !mounted,
1632
+ inert: !open
1633
+ });
1634
+ return /* @__PURE__ */ _jsxs4(PopoverPositionerContext.Provider, {
1635
+ value: positioning,
1636
+ children: [mounted && trueModalNonHover && /* @__PURE__ */ _jsx5(InternalBackdrop, {
1637
+ inert: inertValue(!open),
1638
+ cutout: triggerElement
1639
+ }), /* @__PURE__ */ _jsx5(FloatingNode, {
1640
+ id: nodeId,
1641
+ children: element
1642
+ })]
1643
+ });
1644
+ });
1645
+ if (true) PopoverPositioner.displayName = "PopoverPositioner";
1646
+
1647
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/popup/PopoverPopup.mjs
1648
+ import * as React17 from "react";
1649
+
1650
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/utils/closePart.mjs
1651
+ import * as React16 from "react";
1652
+ var ClosePartContext = /* @__PURE__ */ React16.createContext(void 0);
1653
+ if (true) ClosePartContext.displayName = "ClosePartContext";
1654
+ function useClosePartCount() {
1655
+ const [closePartCount, setClosePartCount] = React16.useState(0);
1656
+ const register = useStableCallback(() => {
1657
+ setClosePartCount((count) => count + 1);
1658
+ return () => {
1659
+ setClosePartCount((count) => Math.max(0, count - 1));
1660
+ };
1661
+ });
1662
+ const context = React16.useMemo(() => ({
1663
+ register
1664
+ }), [register]);
1665
+ return {
1666
+ context,
1667
+ hasClosePart: closePartCount > 0
1668
+ };
1669
+ }
1670
+ function useClosePartRegistration() {
1671
+ const context = React16.useContext(ClosePartContext);
1672
+ useIsoLayoutEffect(() => {
1673
+ return context?.register();
1674
+ }, [context]);
1675
+ }
1676
+
1677
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/popup/PopoverPopup.mjs
1678
+ import { jsx as _jsx6 } from "react/jsx-runtime";
1679
+ var PopoverPopup = /* @__PURE__ */ React17.forwardRef(function PopoverPopup2(componentProps, forwardedRef) {
1680
+ const {
1681
+ render,
1682
+ className,
1683
+ style,
1684
+ initialFocus,
1685
+ finalFocus,
1686
+ ...elementProps
1687
+ } = componentProps;
1688
+ const store = usePopoverRootContext();
1689
+ const positioner = usePopoverPositionerContext();
1690
+ const insideToolbar = useToolbarRootContext(true) != null;
1691
+ const {
1692
+ context: closePartContext,
1693
+ hasClosePart
1694
+ } = useClosePartCount();
1695
+ const open = store.useState("open");
1696
+ const openMethod = store.useState("openMethod");
1697
+ const instantType = store.useState("instantType");
1698
+ const transitionStatus = store.useState("transitionStatus");
1699
+ const popupProps = store.useState("popupProps");
1700
+ const titleId = store.useState("titleElementId");
1701
+ const descriptionId = store.useState("descriptionElementId");
1702
+ const modal = store.useState("modal");
1703
+ const mounted = store.useState("mounted");
1704
+ const openReason = store.useState("openChangeReason");
1705
+ const activeTriggerElement = store.useState("activeTriggerElement");
1706
+ const floatingContext = store.useState("floatingRootContext");
1707
+ const floatingId = floatingContext.useState("floatingId");
1708
+ const disabled = store.useState("disabled");
1709
+ const openOnHover = store.useState("openOnHover");
1710
+ const closeDelay = store.useState("closeDelay");
1711
+ useOpenChangeComplete({
1712
+ open,
1713
+ ref: store.context.popupRef,
1714
+ onComplete() {
1715
+ if (open) {
1716
+ store.context.onOpenChangeComplete?.(true);
1717
+ }
1718
+ }
1719
+ });
1720
+ useHoverFloatingInteraction(floatingContext, {
1721
+ enabled: openOnHover && !disabled,
1722
+ closeDelay
1723
+ });
1724
+ const resolvedInitialFocus = initialFocus === void 0 ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;
1725
+ const focusManagerModal = modal !== false && hasClosePart;
1726
+ store.useSyncedValue("focusManagerModal", focusManagerModal);
1727
+ const setPopupElement = store.useStateSetter("popupElement");
1728
+ const state = {
1729
+ open,
1730
+ side: positioner.side,
1731
+ align: positioner.align,
1732
+ instant: instantType,
1733
+ transitionStatus
1734
+ };
1735
+ const element = useRenderElement("div", componentProps, {
1736
+ state,
1737
+ ref: [forwardedRef, store.context.popupRef, setPopupElement],
1738
+ props: [popupProps, {
1739
+ id: floatingId,
1740
+ role: "dialog",
1741
+ ...FOCUSABLE_POPUP_PROPS,
1742
+ "aria-labelledby": titleId,
1743
+ "aria-describedby": descriptionId,
1744
+ onKeyDown(event) {
1745
+ if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {
1746
+ event.stopPropagation();
1747
+ }
1748
+ }
1749
+ }, getDisabledMountTransitionStyles(transitionStatus), elementProps],
1750
+ stateAttributesMapping: popupTransitionStateMapping
1751
+ });
1752
+ return /* @__PURE__ */ _jsx6(FloatingFocusManager, {
1753
+ context: floatingContext,
1754
+ openInteractionType: openMethod,
1755
+ modal: focusManagerModal,
1756
+ disabled: !mounted || openReason === reason_parts_exports.triggerHover,
1757
+ initialFocus: resolvedInitialFocus,
1758
+ returnFocus: finalFocus,
1759
+ restoreFocus: "popup",
1760
+ previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : void 0,
1761
+ nextFocusableElement: store.context.triggerFocusTargetRef,
1762
+ beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,
1763
+ children: /* @__PURE__ */ _jsx6(ClosePartContext.Provider, {
1764
+ value: closePartContext,
1765
+ children: element
1766
+ })
1767
+ });
1768
+ });
1769
+ if (true) PopoverPopup.displayName = "PopoverPopup";
1770
+
1771
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/arrow/PopoverArrow.mjs
1772
+ import * as React18 from "react";
1773
+ var PopoverArrow = /* @__PURE__ */ React18.forwardRef(function PopoverArrow2(componentProps, forwardedRef) {
1774
+ const {
1775
+ render,
1776
+ className,
1777
+ style,
1778
+ ...elementProps
1779
+ } = componentProps;
1780
+ const store = usePopoverRootContext();
1781
+ const open = store.useState("open");
1782
+ const {
1783
+ arrowRef,
1784
+ side,
1785
+ align,
1786
+ arrowUncentered,
1787
+ arrowStyles
1788
+ } = usePopoverPositionerContext();
1789
+ const state = {
1790
+ open,
1791
+ side,
1792
+ align,
1793
+ uncentered: arrowUncentered
1794
+ };
1795
+ const element = useRenderElement("div", componentProps, {
1796
+ state,
1797
+ ref: [forwardedRef, arrowRef],
1798
+ props: [{
1799
+ style: arrowStyles,
1800
+ "aria-hidden": true
1801
+ }, elementProps],
1802
+ stateAttributesMapping: popupStateMapping
1803
+ });
1804
+ return element;
1805
+ });
1806
+ if (true) PopoverArrow.displayName = "PopoverArrow";
1807
+
1808
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/backdrop/PopoverBackdrop.mjs
1809
+ import * as React19 from "react";
1810
+ var PopoverBackdrop = /* @__PURE__ */ React19.forwardRef(function PopoverBackdrop2(props, forwardedRef) {
1811
+ const {
1812
+ render,
1813
+ className,
1814
+ style,
1815
+ ...elementProps
1816
+ } = props;
1817
+ const store = usePopoverRootContext();
1818
+ const open = store.useState("open");
1819
+ const mounted = store.useState("mounted");
1820
+ const transitionStatus = store.useState("transitionStatus");
1821
+ const openReason = store.useState("openChangeReason");
1822
+ const state = {
1823
+ open,
1824
+ transitionStatus
1825
+ };
1826
+ const element = useRenderElement("div", props, {
1827
+ state,
1828
+ ref: forwardedRef,
1829
+ props: [{
1830
+ role: "presentation",
1831
+ hidden: !mounted,
1832
+ style: {
1833
+ pointerEvents: openReason === reason_parts_exports.triggerHover ? "none" : void 0,
1834
+ userSelect: "none",
1835
+ WebkitUserSelect: "none"
1836
+ }
1837
+ }, elementProps],
1838
+ stateAttributesMapping: popupTransitionStateMapping
1839
+ });
1840
+ return element;
1841
+ });
1842
+ if (true) PopoverBackdrop.displayName = "PopoverBackdrop";
1843
+
1844
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/title/PopoverTitle.mjs
1845
+ import * as React20 from "react";
1846
+ var PopoverTitle = /* @__PURE__ */ React20.forwardRef(function PopoverTitle2(componentProps, forwardedRef) {
1847
+ const {
1848
+ render,
1849
+ className,
1850
+ style,
1851
+ ...elementProps
1852
+ } = componentProps;
1853
+ const store = usePopoverRootContext();
1854
+ const id = useBaseUiId(elementProps.id);
1855
+ store.useSyncedValueWithCleanup("titleElementId", id);
1856
+ const element = useRenderElement("h2", componentProps, {
1857
+ ref: forwardedRef,
1858
+ props: [{
1859
+ id
1860
+ }, elementProps]
1861
+ });
1862
+ return element;
1863
+ });
1864
+ if (true) PopoverTitle.displayName = "PopoverTitle";
1865
+
1866
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/description/PopoverDescription.mjs
1867
+ import * as React21 from "react";
1868
+ var PopoverDescription = /* @__PURE__ */ React21.forwardRef(function PopoverDescription2(componentProps, forwardedRef) {
1869
+ const {
1870
+ render,
1871
+ className,
1872
+ style,
1873
+ ...elementProps
1874
+ } = componentProps;
1875
+ const store = usePopoverRootContext();
1876
+ const id = useBaseUiId(elementProps.id);
1877
+ store.useSyncedValueWithCleanup("descriptionElementId", id);
1878
+ const element = useRenderElement("p", componentProps, {
1879
+ ref: forwardedRef,
1880
+ props: [{
1881
+ id
1882
+ }, elementProps]
1883
+ });
1884
+ return element;
1885
+ });
1886
+ if (true) PopoverDescription.displayName = "PopoverDescription";
1887
+
1888
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/close/PopoverClose.mjs
1889
+ import * as React22 from "react";
1890
+ var PopoverClose = /* @__PURE__ */ React22.forwardRef(function PopoverClose2(componentProps, forwardedRef) {
1891
+ const {
1892
+ render,
1893
+ className,
1894
+ style,
1895
+ disabled = false,
1896
+ nativeButton = true,
1897
+ ...elementProps
1898
+ } = componentProps;
1899
+ const {
1900
+ buttonRef,
1901
+ getButtonProps
1902
+ } = useButton({
1903
+ disabled,
1904
+ focusableWhenDisabled: false,
1905
+ native: nativeButton
1906
+ });
1907
+ const store = usePopoverRootContext();
1908
+ useClosePartRegistration();
1909
+ const element = useRenderElement("button", componentProps, {
1910
+ ref: [forwardedRef, buttonRef],
1911
+ props: [{
1912
+ onClick(event) {
1913
+ store.setOpen(false, createChangeEventDetails(reason_parts_exports.closePress, event.nativeEvent));
1914
+ }
1915
+ }, elementProps, getButtonProps]
1916
+ });
1917
+ return element;
1918
+ });
1919
+ if (true) PopoverClose.displayName = "PopoverClose";
1920
+
1921
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/viewport/PopoverViewport.mjs
1922
+ import * as React23 from "react";
1923
+ var PopoverViewport = /* @__PURE__ */ React23.forwardRef(function PopoverViewport2(componentProps, forwardedRef) {
1924
+ const {
1925
+ render,
1926
+ className,
1927
+ style,
1928
+ children,
1929
+ ...elementProps
1930
+ } = componentProps;
1931
+ const store = usePopoverRootContext();
1932
+ const {
1933
+ side
1934
+ } = usePopoverPositionerContext();
1935
+ const instantType = store.useState("instantType");
1936
+ const {
1937
+ children: childrenToRender,
1938
+ state: viewportState
1939
+ } = usePopupViewport({
1940
+ store,
1941
+ side,
1942
+ children
1943
+ });
1944
+ const state = {
1945
+ activationDirection: viewportState.activationDirection,
1946
+ transitioning: viewportState.transitioning,
1947
+ instant: instantType
1948
+ };
1949
+ return useRenderElement("div", componentProps, {
1950
+ state,
1951
+ ref: forwardedRef,
1952
+ props: [elementProps, {
1953
+ children: childrenToRender
1954
+ }],
1955
+ stateAttributesMapping: popupViewportStateMapping
1956
+ });
1957
+ });
1958
+ if (true) PopoverViewport.displayName = "PopoverViewport";
1959
+
1960
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/popover/store/PopoverHandle.mjs
1961
+ var PopoverHandle = class extends BasePopupHandle {
1962
+ constructor() {
1963
+ super(createNullPopoverStore(), "Popover");
1964
+ }
1965
+ /**
1966
+ * Opens the popover and associates it with the trigger with the given id.
1967
+ *
1968
+ * This method should only be called in an event handler or an effect (not during rendering).
1969
+ *
1970
+ * @param triggerId ID of the trigger to associate with the popover. The trigger must be a matching
1971
+ * `Popover.Trigger` with this handle passed as a prop.
1972
+ */
1973
+ open(triggerId) {
1974
+ this.openByTrigger(triggerId);
1975
+ }
1976
+ /**
1977
+ * Closes the popover.
1978
+ *
1979
+ * This method should only be called in an event handler or an effect (not during rendering).
1980
+ */
1981
+ close() {
1982
+ this.closePopup();
1983
+ }
1984
+ /**
1985
+ * Whether the popover is currently open. Returns `false` while no root is attached to the handle.
1986
+ */
1987
+ get isOpen() {
1988
+ return this.attachedStore?.select("open") ?? false;
1989
+ }
1990
+ };
1991
+ function createPopoverHandle() {
1992
+ return new PopoverHandle();
1993
+ }
1994
+
1995
+ // src/primitives/popover.tsx
1996
+ import { jsx as jsx15 } from "react/jsx-runtime";
1997
+ function Popover({ ...props }) {
1998
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Root, { "data-slot": "popover", ...props });
1999
+ }
2000
+ function PopoverTrigger3({ ...props }) {
2001
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Trigger, { "data-slot": "popover-trigger", ...props });
2002
+ }
2003
+ function PopoverPortal3({ ...props }) {
2004
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Portal, { "data-slot": "popover-portal", ...props });
2005
+ }
2006
+ function PopoverPositioner3({ className, ...props }) {
2007
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Positioner, { "data-slot": "popover-positioner", className, ...props });
2008
+ }
2009
+ function PopoverContent({ className, children, ...props }) {
2010
+ return /* @__PURE__ */ jsx15(PopoverPortal3, { children: /* @__PURE__ */ jsx15(PopoverPositioner3, { children: /* @__PURE__ */ jsx15(index_parts_exports3.Popup, { "data-slot": "popover-content", className: cn("z-50 w-72 rounded-md border bg-surface-floating p-4 text-text-primary shadow-[var(--ds-shadow-floating)] outline-none data-open:animate-in data-closed:animate-out", className), ...props, children }) }) });
2011
+ }
2012
+ function PopoverArrow3({ ...props }) {
2013
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Arrow, { "data-slot": "popover-arrow", ...props });
2014
+ }
2015
+ function PopoverTitle3({ className, ...props }) {
2016
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Title, { "data-slot": "popover-title", className: cn("font-semibold", className), ...props });
2017
+ }
2018
+ function PopoverDescription3({ className, ...props }) {
2019
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Description, { "data-slot": "popover-description", className: cn("text-sm text-text-supporting", className), ...props });
2020
+ }
2021
+ function PopoverClose3({ ...props }) {
2022
+ return /* @__PURE__ */ jsx15(index_parts_exports3.Close, { "data-slot": "popover-close", ...props });
2023
+ }
2024
+
2025
+ // src/primitives/searchable-select.tsx
2026
+ import * as React24 from "react";
2027
+ import { Check, ChevronsUpDown, X } from "lucide-react";
2028
+ import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
2029
+ function SearchableSelect({ id, name, value = "", options, onValueChange, placeholder = "Select an option", searchPlaceholder = "Search...", emptyMessage = "No matching options.", disabled = false, clearable = false, clearLabel = "Clear selection", optionsLabel, className, "aria-label": ariaLabel }) {
2030
+ const selected = options.find((option) => option.value === value) ?? null;
2031
+ const items = React24.useMemo(() => options.map((option) => option.value), [options]);
2032
+ const [open, setOpen] = React24.useState(false);
2033
+ const [inputValue, setInputValue] = React24.useState(selected?.label ?? "");
2034
+ const inputRef = React24.useRef(null);
2035
+ React24.useLayoutEffect(() => {
2036
+ if (!open && inputRef.current) inputRef.current.value = selected?.label ?? "";
2037
+ }, [open, selected?.label]);
2038
+ return /* @__PURE__ */ jsx16("div", { "data-slot": "searchable-select", className: cn("relative min-w-0", className), children: /* @__PURE__ */ jsxs7(index_parts_exports.Root, { items, autoHighlight: true, open, onOpenChange: (nextOpen) => {
2039
+ setOpen(nextOpen);
2040
+ if (!nextOpen) setInputValue(selected?.label ?? "");
2041
+ }, value, inputValue: open ? inputValue : selected?.label ?? "", onInputValueChange: setInputValue, onValueChange: (next) => {
2042
+ const nextOption = options.find((option) => option.value === next);
2043
+ setInputValue(nextOption?.label ?? "");
2044
+ onValueChange(next ?? "");
2045
+ }, itemToStringLabel: (item) => options.find((option) => option.value === item)?.label ?? "", itemToStringValue: (item) => item ?? "", name, disabled, children: [
2046
+ /* @__PURE__ */ jsxs7(index_parts_exports.InputGroup, { className: "relative flex items-center", children: [
2047
+ /* @__PURE__ */ jsx16(index_parts_exports.Input, { ref: inputRef, id, "aria-label": ariaLabel, placeholder: searchPlaceholder, onKeyDown: (event) => {
2048
+ if (event.key === "Enter" && open) {
2049
+ const matches = options.filter((option) => !option.disabled && option.label.toLowerCase().includes(inputValue.toLowerCase()));
2050
+ const match = matches.at(-1);
2051
+ if (match && match.value !== value) {
2052
+ event.preventDefault();
2053
+ setOpen(false);
2054
+ onValueChange(match.value);
2055
+ }
2056
+ }
2057
+ }, className: "ds-type-control h-[var(--ds-field-control-height)] w-full rounded-[var(--ds-field-control-radius)] border border-control-border bg-surface-control px-3 pr-16 outline-none focus-visible:border-focus focus-visible:ring-[3px] focus-visible:ring-focus/50 disabled:cursor-not-allowed disabled:opacity-50" }),
2058
+ clearable && selected ? /* @__PURE__ */ jsx16(IconButton, { type: "button", size: "sm", variant: "ghost", "aria-label": clearLabel, onClick: () => onValueChange(""), className: "absolute right-7", children: /* @__PURE__ */ jsx16(X, { className: "size-4" }) }) : null,
2059
+ /* @__PURE__ */ jsx16(index_parts_exports.Trigger, { "aria-label": ariaLabel ?? placeholder, className: "absolute right-1 inline-flex size-8 items-center justify-center rounded-sm text-text-supporting outline-none focus-visible:ring-2 focus-visible:ring-focus", children: /* @__PURE__ */ jsx16(ChevronsUpDown, { className: "size-4" }) })
2060
+ ] }),
2061
+ /* @__PURE__ */ jsx16(index_parts_exports.Portal, { children: /* @__PURE__ */ jsx16(index_parts_exports.Positioner, { className: "z-50 w-[var(--anchor-width)]", children: /* @__PURE__ */ jsxs7(index_parts_exports.Popup, { className: "mt-1 max-h-72 overflow-auto rounded-md border bg-surface-floating p-1 text-text-primary shadow-[var(--ds-shadow-floating)] outline-none", children: [
2062
+ /* @__PURE__ */ jsx16(index_parts_exports.Empty, { className: "px-2 py-3 text-sm text-text-supporting", children: emptyMessage }),
2063
+ /* @__PURE__ */ jsx16(index_parts_exports.List, { "aria-label": optionsLabel ?? "Options", children: (optionValue) => {
2064
+ const option = options.find((candidate) => candidate.value === optionValue);
2065
+ if (!option) return null;
2066
+ return /* @__PURE__ */ jsxs7(index_parts_exports.Item, { value: option.value, disabled: option.disabled, className: "ds-type-menu-item data-highlighted:bg-surface-muted relative flex cursor-default items-start gap-2 rounded-sm px-2 py-2 pr-8 outline-none data-disabled:pointer-events-none data-disabled:opacity-50", children: [
2067
+ /* @__PURE__ */ jsx16("span", { className: "mt-0.5 flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx16(index_parts_exports.ItemIndicator, { children: /* @__PURE__ */ jsx16(Check, { className: "size-4" }) }) }),
2068
+ /* @__PURE__ */ jsxs7("span", { className: "min-w-0", children: [
2069
+ /* @__PURE__ */ jsx16("span", { className: "block truncate text-sm", children: option.label }),
2070
+ option.description ? /* @__PURE__ */ jsx16("span", { className: "block truncate text-xs text-text-supporting", children: option.description }) : null
2071
+ ] })
2072
+ ] }, option.value);
2073
+ } })
2074
+ ] }) }) })
2075
+ ] }) });
2076
+ }
2077
+
2078
+ // src/primitives/toast.tsx
2079
+ import * as React41 from "react";
2080
+
2081
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/index.parts.mjs
2082
+ var index_parts_exports4 = {};
2083
+ __export(index_parts_exports4, {
2084
+ Action: () => ToastAction,
2085
+ Arrow: () => ToastArrow,
2086
+ Close: () => ToastClose,
2087
+ Content: () => ToastContent,
2088
+ Description: () => ToastDescription,
2089
+ Portal: () => ToastPortal,
2090
+ Positioner: () => ToastPositioner,
2091
+ Provider: () => ToastProvider,
2092
+ Root: () => ToastRoot,
2093
+ Title: () => ToastTitle,
2094
+ Viewport: () => ToastViewport,
2095
+ createToastManager: () => createToastManager,
2096
+ useToastManager: () => useToastManager
2097
+ });
2098
+
2099
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/provider/ToastProvider.mjs
2100
+ import * as React26 from "react";
2101
+
2102
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/provider/ToastProviderContext.mjs
2103
+ import * as React25 from "react";
2104
+ var ToastContext = /* @__PURE__ */ React25.createContext(void 0);
2105
+ if (true) ToastContext.displayName = "ToastContext";
2106
+ function useToastProviderContext() {
2107
+ const context = React25.useContext(ToastContext);
2108
+ if (!context) {
2109
+ throw new Error(true ? "Base UI: useToastManager must be used within <Toast.Provider>." : formatErrorMessage_default(73));
2110
+ }
2111
+ return context;
2112
+ }
2113
+
2114
+ // node_modules/.pnpm/@base-ui+utils@0.3.2_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/generateId.mjs
2115
+ var counter = 0;
2116
+ function generateId(prefix) {
2117
+ counter += 1;
2118
+ return `${prefix}-${Math.random().toString(36).slice(2, 6)}-${counter}`;
2119
+ }
2120
+
2121
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/utils/resolvePromiseOptions.mjs
2122
+ function resolvePromiseOptions(options, result) {
2123
+ if (typeof options === "string") {
2124
+ return {
2125
+ description: options
2126
+ };
2127
+ }
2128
+ if (typeof options === "function") {
2129
+ const resolvedOptions = options(result);
2130
+ return typeof resolvedOptions === "string" ? {
2131
+ description: resolvedOptions
2132
+ } : resolvedOptions;
2133
+ }
2134
+ return options;
2135
+ }
2136
+
2137
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/store.mjs
2138
+ function createToastMetadata(toasts) {
2139
+ const metadata = /* @__PURE__ */ new Map();
2140
+ let visibleIndex = 0;
2141
+ let offsetY = 0;
2142
+ toasts.forEach((toast, toastIndex) => {
2143
+ const isEnding = toast.transitionStatus === "ending";
2144
+ metadata.set(toast.id, {
2145
+ value: toast,
2146
+ domIndex: toastIndex,
2147
+ visibleIndex: isEnding ? -1 : visibleIndex,
2148
+ offsetY
2149
+ });
2150
+ offsetY += toast.height || 0;
2151
+ if (!isEnding) {
2152
+ visibleIndex += 1;
2153
+ }
2154
+ });
2155
+ return metadata;
2156
+ }
2157
+ function applyLimited(toasts, limit) {
2158
+ let activeIndex = 0;
2159
+ return toasts.map((toast) => {
2160
+ if (toast.transitionStatus === "ending") {
2161
+ return toast;
2162
+ }
2163
+ const limited = activeIndex >= limit;
2164
+ activeIndex += 1;
2165
+ return toast.limited === limited ? toast : {
2166
+ ...toast,
2167
+ limited
2168
+ };
2169
+ });
2170
+ }
2171
+ var selectors2 = {
2172
+ toasts: (state) => state.toasts,
2173
+ isEmpty: (state) => state.toasts.length === 0,
2174
+ toast: (state, id) => state.toastMetadata.get(id)?.value,
2175
+ toastIndex: (state, id) => state.toastMetadata.get(id)?.domIndex ?? -1,
2176
+ toastOffsetY: (state, id) => state.toastMetadata.get(id)?.offsetY ?? 0,
2177
+ toastVisibleIndex: (state, id) => state.toastMetadata.get(id)?.visibleIndex ?? -1,
2178
+ focused: (state) => state.focused,
2179
+ expanded: (state) => state.hovering || state.focused,
2180
+ expandedOrOutOfFocus: (state) => state.hovering || state.focused || !state.isWindowFocused,
2181
+ prevFocusElement: (state) => state.prevFocusElement
2182
+ };
2183
+ var ToastStore = class extends ReactStore {
2184
+ constructor(initialState) {
2185
+ super({
2186
+ ...initialState,
2187
+ toastMetadata: createToastMetadata(initialState.toasts)
2188
+ }, {}, selectors2);
2189
+ __publicField(this, "timers", /* @__PURE__ */ new Map());
2190
+ __publicField(this, "areTimersPaused", false);
2191
+ __publicField(this, "setViewport", (viewport) => {
2192
+ this.set("viewport", viewport);
2193
+ });
2194
+ __publicField(this, "disposeEffect", () => {
2195
+ return () => {
2196
+ this.timers.forEach((timer) => {
2197
+ timer.timeout?.clear();
2198
+ });
2199
+ this.timers.clear();
2200
+ };
2201
+ });
2202
+ __publicField(this, "addToast", (toast) => {
2203
+ const {
2204
+ timeout,
2205
+ limit
2206
+ } = this.state;
2207
+ const id = toast.id || generateId("toast");
2208
+ if (toast.id) {
2209
+ const existingToast = selectors2.toast(this.state, toast.id);
2210
+ if (existingToast) {
2211
+ if (existingToast.transitionStatus === "ending") {
2212
+ this.removeToast(toast.id, true);
2213
+ } else {
2214
+ const {
2215
+ id: ignoredId,
2216
+ transitionStatus: ignoredTransitionStatus,
2217
+ ...updates
2218
+ } = toast;
2219
+ this.updateToastInternal(toast.id, updates, true, true);
2220
+ return toast.id;
2221
+ }
2222
+ }
2223
+ }
2224
+ const toastToAdd = {
2225
+ ...toast,
2226
+ id,
2227
+ updateKey: 0,
2228
+ transitionStatus: "starting"
2229
+ };
2230
+ const updatedToasts = [toastToAdd, ...this.state.toasts];
2231
+ this.setToasts(applyLimited(updatedToasts, limit));
2232
+ const duration = toastToAdd.timeout ?? timeout;
2233
+ if (toastToAdd.type !== "loading" && duration > 0) {
2234
+ this.scheduleTimer(id, duration, () => this.closeToast(id));
2235
+ }
2236
+ if (selectors2.expandedOrOutOfFocus(this.state)) {
2237
+ this.pauseTimers();
2238
+ }
2239
+ return id;
2240
+ });
2241
+ __publicField(this, "updateToast", (id, updates) => {
2242
+ this.updateToastInternal(id, updates, false, true);
2243
+ });
2244
+ __publicField(this, "updateToastInternal", (id, updates, resetTimer = false, markUpdated = false) => {
2245
+ const {
2246
+ timeout,
2247
+ toasts
2248
+ } = this.state;
2249
+ const prevToast = selectors2.toast(this.state, id);
2250
+ if (!prevToast) {
2251
+ return;
2252
+ }
2253
+ if (prevToast.transitionStatus === "ending") {
2254
+ return;
2255
+ }
2256
+ const nextToast = {
2257
+ ...prevToast,
2258
+ ...updates,
2259
+ ...markUpdated && {
2260
+ updateKey: prevToast.updateKey + 1
2261
+ }
2262
+ };
2263
+ this.setToasts(toasts.map((toast) => toast.id === id ? nextToast : toast));
2264
+ const nextTimeout = nextToast.timeout ?? timeout;
2265
+ const prevTimeout = prevToast.timeout ?? timeout;
2266
+ const timeoutUpdated = Object.hasOwn(updates, "timeout");
2267
+ const shouldHaveTimer = nextToast.transitionStatus !== "ending" && nextToast.type !== "loading" && nextTimeout > 0;
2268
+ const hasTimer = this.timers.has(id);
2269
+ const timeoutChanged = prevTimeout !== nextTimeout;
2270
+ const wasLoading = prevToast.type === "loading";
2271
+ if (!shouldHaveTimer && hasTimer) {
2272
+ this.clearTimer(id);
2273
+ return;
2274
+ }
2275
+ if (shouldHaveTimer && (!hasTimer || timeoutChanged || timeoutUpdated || wasLoading || resetTimer)) {
2276
+ this.clearTimer(id);
2277
+ this.scheduleTimer(id, nextTimeout, () => this.closeToast(id));
2278
+ if (selectors2.expandedOrOutOfFocus(this.state)) {
2279
+ this.pauseTimers();
2280
+ }
2281
+ }
2282
+ });
2283
+ __publicField(this, "closeToast", (toastId) => {
2284
+ const closeAll = toastId === void 0;
2285
+ const {
2286
+ limit,
2287
+ toasts
2288
+ } = this.state;
2289
+ let toastsToClose;
2290
+ if (closeAll) {
2291
+ toastsToClose = toasts;
2292
+ this.clearTimers();
2293
+ } else {
2294
+ const toast = selectors2.toast(this.state, toastId);
2295
+ if (!toast) {
2296
+ return;
2297
+ }
2298
+ toastsToClose = [toast];
2299
+ this.clearTimer(toastId);
2300
+ }
2301
+ const endingToasts = toasts.map((item) => closeAll || item.id === toastId ? {
2302
+ ...item,
2303
+ transitionStatus: "ending",
2304
+ height: 0
2305
+ } : item);
2306
+ const newToasts = applyLimited(endingToasts, limit);
2307
+ this.setToasts(newToasts, !newToasts.some((toast) => toast.transitionStatus !== "ending"));
2308
+ toastsToClose.forEach((toast) => {
2309
+ if (toast.transitionStatus !== "ending") {
2310
+ toast.onClose?.();
2311
+ }
2312
+ });
2313
+ this.handleFocusManagement(toastId);
2314
+ });
2315
+ __publicField(this, "promiseToast", (promiseValue, options) => {
2316
+ const loadingOptions = resolvePromiseOptions(options.loading);
2317
+ const id = this.addToast({
2318
+ ...loadingOptions,
2319
+ type: "loading"
2320
+ });
2321
+ const handledPromise = promiseValue.then((result) => {
2322
+ const successOptions = resolvePromiseOptions(options.success, result);
2323
+ this.updateToast(id, {
2324
+ ...successOptions,
2325
+ type: "success",
2326
+ timeout: successOptions.timeout
2327
+ });
2328
+ return result;
2329
+ }).catch((error) => {
2330
+ const errorOptions = resolvePromiseOptions(options.error, error);
2331
+ this.updateToast(id, {
2332
+ ...errorOptions,
2333
+ type: "error",
2334
+ timeout: errorOptions.timeout
2335
+ });
2336
+ return Promise.reject(error);
2337
+ });
2338
+ if ({}.hasOwnProperty.call(options, "setPromise")) {
2339
+ options.setPromise(handledPromise);
2340
+ }
2341
+ return handledPromise;
2342
+ });
2343
+ __publicField(this, "handleDocumentPointerDown", (event) => {
2344
+ if (event.pointerType !== "touch") {
2345
+ return;
2346
+ }
2347
+ const target = getTarget(event);
2348
+ if (contains(this.state.viewport, target)) {
2349
+ return;
2350
+ }
2351
+ this.resumeTimers();
2352
+ this.update({
2353
+ hovering: false,
2354
+ focused: false
2355
+ });
2356
+ });
2357
+ }
2358
+ syncProviderProps(timeout, limit) {
2359
+ const limitChanged = this.state.limit !== limit;
2360
+ if (this.state.timeout === timeout && !limitChanged) {
2361
+ return;
2362
+ }
2363
+ const updates = {
2364
+ timeout,
2365
+ limit
2366
+ };
2367
+ if (limitChanged) {
2368
+ const newToasts = applyLimited(this.state.toasts, limit);
2369
+ updates.toasts = newToasts;
2370
+ updates.toastMetadata = createToastMetadata(newToasts);
2371
+ }
2372
+ this.update(updates);
2373
+ }
2374
+ removeToast(toastId, skipOnRemove = false) {
2375
+ const index = selectors2.toastIndex(this.state, toastId);
2376
+ if (index === -1) {
2377
+ return;
2378
+ }
2379
+ const toast = this.state.toasts[index];
2380
+ if (!skipOnRemove) {
2381
+ toast?.onRemove?.();
2382
+ }
2383
+ const newToasts = [...this.state.toasts];
2384
+ newToasts.splice(index, 1);
2385
+ this.setToasts(newToasts);
2386
+ }
2387
+ pauseTimers() {
2388
+ if (this.areTimersPaused) {
2389
+ return;
2390
+ }
2391
+ this.areTimersPaused = true;
2392
+ this.timers.forEach((timer) => {
2393
+ if (timer.timeout) {
2394
+ timer.timeout.clear();
2395
+ timer.remaining = Math.max(timer.remaining - (Date.now() - timer.start), 0);
2396
+ }
2397
+ });
2398
+ }
2399
+ resumeTimers() {
2400
+ if (!this.areTimersPaused) {
2401
+ return;
2402
+ }
2403
+ this.areTimersPaused = false;
2404
+ this.timers.forEach((timer, id) => {
2405
+ timer.remaining = timer.remaining > 0 ? timer.remaining : timer.delay;
2406
+ timer.timeout ?? (timer.timeout = Timeout.create());
2407
+ timer.timeout.start(timer.remaining, () => {
2408
+ this.handleTimerFired(id);
2409
+ timer.callback();
2410
+ });
2411
+ timer.start = Date.now();
2412
+ });
2413
+ }
2414
+ restoreFocusToPrevElement() {
2415
+ this.state.prevFocusElement?.focus({
2416
+ preventScroll: true
2417
+ });
2418
+ }
2419
+ scheduleTimer(id, delay, callback) {
2420
+ const start = Date.now();
2421
+ const shouldStartActive = !selectors2.expandedOrOutOfFocus(this.state);
2422
+ const currentTimeout = shouldStartActive ? Timeout.create() : void 0;
2423
+ currentTimeout?.start(delay, () => {
2424
+ this.handleTimerFired(id);
2425
+ callback();
2426
+ });
2427
+ this.timers.set(id, {
2428
+ timeout: currentTimeout,
2429
+ start,
2430
+ delay,
2431
+ remaining: delay,
2432
+ callback
2433
+ });
2434
+ }
2435
+ clearTimers() {
2436
+ this.timers.forEach((timer) => {
2437
+ timer.timeout?.clear();
2438
+ });
2439
+ this.timers.clear();
2440
+ this.areTimersPaused = false;
2441
+ }
2442
+ clearTimer(id) {
2443
+ const timer = this.timers.get(id);
2444
+ timer?.timeout?.clear();
2445
+ this.timers.delete(id);
2446
+ this.resetPausedStateIfNoTimersRemain();
2447
+ }
2448
+ handleTimerFired(id) {
2449
+ this.timers.delete(id);
2450
+ this.resetPausedStateIfNoTimersRemain();
2451
+ }
2452
+ resetPausedStateIfNoTimersRemain() {
2453
+ if (this.timers.size === 0) {
2454
+ this.areTimersPaused = false;
2455
+ }
2456
+ }
2457
+ setToasts(newToasts, clearInteraction = newToasts.length === 0) {
2458
+ const updates = {
2459
+ toasts: newToasts,
2460
+ toastMetadata: createToastMetadata(newToasts)
2461
+ };
2462
+ if (clearInteraction) {
2463
+ updates.hovering = false;
2464
+ updates.focused = false;
2465
+ }
2466
+ this.update(updates);
2467
+ }
2468
+ handleFocusManagement(toastId) {
2469
+ const activeEl = activeElement(ownerDocument(this.state.viewport));
2470
+ if (!this.state.viewport || !contains(this.state.viewport, activeEl) || !matchesFocusVisible(activeEl)) {
2471
+ return;
2472
+ }
2473
+ if (toastId === void 0) {
2474
+ this.restoreFocusToPrevElement();
2475
+ return;
2476
+ }
2477
+ const toasts = selectors2.toasts(this.state);
2478
+ const currentIndex = selectors2.toastIndex(this.state, toastId);
2479
+ const scan = (from, step) => {
2480
+ for (let index = from; index >= 0 && index < toasts.length; index += step) {
2481
+ if (toasts[index].transitionStatus !== "ending") {
2482
+ return toasts[index];
2483
+ }
2484
+ }
2485
+ return null;
2486
+ };
2487
+ const nextToast = scan(currentIndex + 1, 1) ?? scan(currentIndex - 1, -1);
2488
+ if (nextToast) {
2489
+ nextToast.ref?.current?.focus();
2490
+ } else {
2491
+ this.restoreFocusToPrevElement();
2492
+ }
2493
+ }
2494
+ };
2495
+
2496
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/provider/ToastProvider.mjs
2497
+ import { jsx as _jsx7, jsxs as _jsxs5 } from "react/jsx-runtime";
2498
+ var ToastProvider = function ToastProvider2(props) {
2499
+ const {
2500
+ children,
2501
+ timeout = 5e3,
2502
+ limit = 3,
2503
+ toastManager
2504
+ } = props;
2505
+ const store = useRefWithInit(() => new ToastStore({
2506
+ timeout,
2507
+ limit,
2508
+ viewport: null,
2509
+ toasts: [],
2510
+ hovering: false,
2511
+ focused: false,
2512
+ isWindowFocused: true,
2513
+ prevFocusElement: null
2514
+ })).current;
2515
+ useOnMount(store.disposeEffect);
2516
+ React26.useEffect(function subscribeToToastManager() {
2517
+ if (!toastManager) {
2518
+ return void 0;
2519
+ }
2520
+ const unsubscribe = toastManager[" subscribe"](({
2521
+ action,
2522
+ options
2523
+ }) => {
2524
+ const id = options.id;
2525
+ if (action === "promise" && options.promise) {
2526
+ store.promiseToast(options.promise, options);
2527
+ } else if (action === "update" && id) {
2528
+ store.updateToast(id, options);
2529
+ } else if (action === "close") {
2530
+ store.closeToast(id);
2531
+ } else {
2532
+ store.addToast(options);
2533
+ }
2534
+ });
2535
+ return unsubscribe;
2536
+ }, [store, toastManager]);
2537
+ return /* @__PURE__ */ _jsxs5(ToastContext.Provider, {
2538
+ value: store,
2539
+ children: [/* @__PURE__ */ _jsx7(ToastProviderPropsSynchronizer, {
2540
+ store,
2541
+ timeout,
2542
+ limit
2543
+ }), children]
2544
+ });
2545
+ };
2546
+ if (true) ToastProvider.displayName = "ToastProvider";
2547
+ function ToastProviderPropsSynchronizer(props) {
2548
+ const {
2549
+ store,
2550
+ timeout,
2551
+ limit
2552
+ } = props;
2553
+ useIsoLayoutEffect(() => {
2554
+ store.syncProviderProps(timeout, limit);
2555
+ }, [store, timeout, limit]);
2556
+ return null;
2557
+ }
2558
+
2559
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/viewport/ToastViewport.mjs
2560
+ import * as React27 from "react";
2561
+ import { jsx as _jsx8, jsxs as _jsxs6 } from "react/jsx-runtime";
2562
+ var ToastViewport = /* @__PURE__ */ React27.forwardRef(function ToastViewport2(componentProps, forwardedRef) {
2563
+ const {
2564
+ render,
2565
+ className,
2566
+ style,
2567
+ children,
2568
+ ...elementProps
2569
+ } = componentProps;
2570
+ const store = useToastProviderContext();
2571
+ const windowFocusTimeout = useTimeout();
2572
+ const handlingFocusGuardRef = React27.useRef(false);
2573
+ const markedReadyForMouseLeaveRef = React27.useRef(false);
2574
+ const touchActiveRef = React27.useRef(false);
2575
+ const isEmpty = store.useState("isEmpty");
2576
+ const toasts = store.useState("toasts");
2577
+ const focused = store.useState("focused");
2578
+ const expanded = store.useState("expanded");
2579
+ const prevFocusElement = store.useState("prevFocusElement");
2580
+ const frontmostHeight = toasts[0]?.height;
2581
+ const hasTransitioningToasts = toasts.some((toast) => toast.transitionStatus === "ending");
2582
+ const highPriorityToasts = toasts.filter((toast) => toast.priority === "high");
2583
+ React27.useEffect(() => {
2584
+ const viewport = store.state.viewport;
2585
+ if (!viewport || isEmpty) {
2586
+ return void 0;
2587
+ }
2588
+ const win = getWindow(viewport);
2589
+ const doc = ownerDocument(viewport);
2590
+ function handleGlobalKeyDown(event) {
2591
+ if (event.key === "F6" && getTarget(event) !== viewport) {
2592
+ event.preventDefault();
2593
+ store.set("prevFocusElement", activeElement(doc));
2594
+ viewport?.focus({
2595
+ preventScroll: true
2596
+ });
2597
+ store.pauseTimers();
2598
+ store.set("focused", true);
2599
+ }
2600
+ }
2601
+ function handleWindowBlur(event) {
2602
+ if (getTarget(event) !== win) {
2603
+ return;
2604
+ }
2605
+ store.set("isWindowFocused", false);
2606
+ store.pauseTimers();
2607
+ }
2608
+ function handleWindowFocus(event) {
2609
+ if (event.relatedTarget) {
2610
+ return;
2611
+ }
2612
+ const target = getTarget(event);
2613
+ const activeEl = activeElement(ownerDocument(viewport));
2614
+ if (target === win || !contains(viewport, target) || !matchesFocusVisible(activeEl)) {
2615
+ store.resumeTimers();
2616
+ }
2617
+ windowFocusTimeout.start(0, () => store.set("isWindowFocused", true));
2618
+ }
2619
+ return mergeCleanups(addEventListener(win, "keydown", handleGlobalKeyDown), addEventListener(win, "blur", handleWindowBlur, true), addEventListener(win, "focus", handleWindowFocus, true), addEventListener(doc, "pointerdown", store.handleDocumentPointerDown, true));
2620
+ }, [store, windowFocusTimeout, isEmpty]);
2621
+ function handleFocusGuard(event) {
2622
+ handlingFocusGuardRef.current = true;
2623
+ const firstFocusableToast = event.relatedTarget === store.state.viewport ? toasts.find((toast) => toast.transitionStatus !== "ending" && !toast.limited) : void 0;
2624
+ if (firstFocusableToast) {
2625
+ firstFocusableToast.ref?.current?.focus();
2626
+ } else {
2627
+ store.restoreFocusToPrevElement();
2628
+ }
2629
+ }
2630
+ function handleKeyDown(event) {
2631
+ if (event.key === "Tab" && event.shiftKey && getTarget(event.nativeEvent) === store.state.viewport) {
2632
+ event.preventDefault();
2633
+ store.restoreFocusToPrevElement();
2634
+ }
2635
+ }
2636
+ function flushMouseLeave() {
2637
+ const hasEndingToasts = store.state.toasts.some((toast) => toast.transitionStatus === "ending");
2638
+ if (hasEndingToasts || touchActiveRef.current || !markedReadyForMouseLeaveRef.current) {
2639
+ return;
2640
+ }
2641
+ if (store.state.isWindowFocused) {
2642
+ store.resumeTimers();
2643
+ }
2644
+ store.set("hovering", false);
2645
+ markedReadyForMouseLeaveRef.current = false;
2646
+ }
2647
+ React27.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);
2648
+ function handleMouseEnter() {
2649
+ store.pauseTimers();
2650
+ store.set("hovering", true);
2651
+ markedReadyForMouseLeaveRef.current = false;
2652
+ }
2653
+ function resumeTimersIfWindowFocused() {
2654
+ if (store.state.isWindowFocused) {
2655
+ store.resumeTimers();
2656
+ }
2657
+ }
2658
+ function handleMouseLeave() {
2659
+ markedReadyForMouseLeaveRef.current = true;
2660
+ flushMouseLeave();
2661
+ }
2662
+ function handlePointerDown(event) {
2663
+ if (event.pointerType === "touch") {
2664
+ touchActiveRef.current = true;
2665
+ }
2666
+ }
2667
+ function handlePointerEnd(event) {
2668
+ if (event.pointerType !== "touch") {
2669
+ return;
2670
+ }
2671
+ touchActiveRef.current = false;
2672
+ flushMouseLeave();
2673
+ }
2674
+ function handleFocus() {
2675
+ if (handlingFocusGuardRef.current) {
2676
+ handlingFocusGuardRef.current = false;
2677
+ return;
2678
+ }
2679
+ if (focused) {
2680
+ return;
2681
+ }
2682
+ if (matchesFocusVisible(activeElement(ownerDocument(store.state.viewport)))) {
2683
+ store.set("focused", true);
2684
+ store.pauseTimers();
2685
+ }
2686
+ }
2687
+ function handleBlur(event) {
2688
+ if (!focused || contains(store.state.viewport, event.relatedTarget)) {
2689
+ return;
2690
+ }
2691
+ store.set("focused", false);
2692
+ resumeTimersIfWindowFocused();
2693
+ }
2694
+ const defaultProps = {
2695
+ tabIndex: -1,
2696
+ role: "region",
2697
+ "aria-live": "polite",
2698
+ "aria-atomic": false,
2699
+ "aria-relevant": "additions text",
2700
+ "aria-label": "Notifications",
2701
+ onMouseEnter: handleMouseEnter,
2702
+ onMouseMove: handleMouseEnter,
2703
+ onMouseLeave: handleMouseLeave,
2704
+ onFocus: handleFocus,
2705
+ onBlur: handleBlur,
2706
+ onKeyDown: handleKeyDown,
2707
+ onClick: handleFocus,
2708
+ onPointerDown: handlePointerDown,
2709
+ onPointerUp: handlePointerEnd,
2710
+ onPointerCancel: handlePointerEnd,
2711
+ style: {
2712
+ ["--toast-frontmost-height"]: frontmostHeight ? `${frontmostHeight}px` : void 0
2713
+ }
2714
+ };
2715
+ const state = {
2716
+ expanded
2717
+ };
2718
+ const focusGuard = !isEmpty && prevFocusElement && /* @__PURE__ */ _jsx8(FocusGuard, {
2719
+ onFocus: handleFocusGuard
2720
+ });
2721
+ const element = useRenderElement("div", componentProps, {
2722
+ ref: [forwardedRef, store.setViewport],
2723
+ state,
2724
+ props: [defaultProps, elementProps, {
2725
+ children: /* @__PURE__ */ _jsxs6(React27.Fragment, {
2726
+ children: [focusGuard, children, focusGuard]
2727
+ })
2728
+ }]
2729
+ });
2730
+ return /* @__PURE__ */ _jsxs6(React27.Fragment, {
2731
+ children: [focusGuard, element, !focused && highPriorityToasts.length > 0 && /* @__PURE__ */ _jsx8("div", {
2732
+ style: visuallyHidden,
2733
+ children: highPriorityToasts.map((toast) => /* @__PURE__ */ _jsxs6("div", {
2734
+ role: "alert",
2735
+ "aria-atomic": true,
2736
+ children: [/* @__PURE__ */ _jsx8("div", {
2737
+ children: toast.title
2738
+ }), /* @__PURE__ */ _jsx8("div", {
2739
+ children: toast.description
2740
+ })]
2741
+ }, toast.id))
2742
+ })]
2743
+ });
2744
+ });
2745
+ if (true) ToastViewport.displayName = "ToastViewport";
2746
+
2747
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/root/ToastRoot.mjs
2748
+ import * as React29 from "react";
2749
+ import * as ReactDOM2 from "react-dom";
2750
+
2751
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/root/ToastRootContext.mjs
2752
+ import * as React28 from "react";
2753
+ var ToastRootContext = /* @__PURE__ */ React28.createContext(void 0);
2754
+ if (true) ToastRootContext.displayName = "ToastRootContext";
2755
+ function useToastRootContext() {
2756
+ const context = React28.useContext(ToastRootContext);
2757
+ if (!context) {
2758
+ throw new Error(true ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : formatErrorMessage_default(66));
2759
+ }
2760
+ return context;
2761
+ }
2762
+
2763
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/root/ToastRoot.mjs
2764
+ import { jsx as _jsx9 } from "react/jsx-runtime";
2765
+ var toastRootStateAttributesMapping = {
2766
+ ...transitionStatusMapping,
2767
+ swipeDirection(value) {
2768
+ return value ? {
2769
+ "data-swipe-direction": value
2770
+ } : null;
2771
+ }
2772
+ };
2773
+ var SWIPE_THRESHOLD = 40;
2774
+ var REVERSE_CANCEL_THRESHOLD = 10;
2775
+ var OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;
2776
+ var MIN_DRAG_THRESHOLD = 1;
2777
+ var TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;
2778
+ var ToastRoot = /* @__PURE__ */ React29.forwardRef(function ToastRoot2(componentProps, forwardedRef) {
2779
+ const {
2780
+ toast,
2781
+ render,
2782
+ className,
2783
+ swipeDirection = ["down", "right"],
2784
+ style,
2785
+ ...elementProps
2786
+ } = componentProps;
2787
+ const isAnchored = toast.positionerProps?.anchor !== void 0;
2788
+ let swipeDirections = [];
2789
+ if (!isAnchored) {
2790
+ swipeDirections = Array.isArray(swipeDirection) ? swipeDirection : [swipeDirection];
2791
+ }
2792
+ const swipeEnabled = swipeDirections.length > 0;
2793
+ const store = useToastProviderContext();
2794
+ const [currentSwipeDirection, setCurrentSwipeDirection] = React29.useState(void 0);
2795
+ const [isSwiping, setIsSwiping] = React29.useState(false);
2796
+ const [isRealSwipe, setIsRealSwipe] = React29.useState(false);
2797
+ const [dragOffset, setDragOffset] = React29.useState({
2798
+ x: 0,
2799
+ y: 0
2800
+ });
2801
+ const [initialTransform, setInitialTransform] = React29.useState({
2802
+ x: 0,
2803
+ y: 0,
2804
+ scale: 1
2805
+ });
2806
+ const [titleId, setTitleId] = React29.useState();
2807
+ const [descriptionId, setDescriptionId] = React29.useState();
2808
+ const [lockedDirection, setLockedDirection] = React29.useState(null);
2809
+ const rootRef = React29.useRef(null);
2810
+ const lastToastIdRef = React29.useRef(void 0);
2811
+ const dragStartPosRef = React29.useRef({
2812
+ x: 0,
2813
+ y: 0
2814
+ });
2815
+ const initialTransformRef = React29.useRef({
2816
+ x: 0,
2817
+ y: 0,
2818
+ scale: 1
2819
+ });
2820
+ const intendedSwipeDirectionRef = React29.useRef(void 0);
2821
+ const maxSwipeDisplacementRef = React29.useRef(0);
2822
+ const cancelledSwipeRef = React29.useRef(false);
2823
+ const swipeCancelBaselineRef = React29.useRef({
2824
+ x: 0,
2825
+ y: 0
2826
+ });
2827
+ const isFirstPointerMoveRef = React29.useRef(false);
2828
+ const dragOffsetRef = React29.useRef({
2829
+ x: 0,
2830
+ y: 0
2831
+ });
2832
+ const activePointerIdRef = React29.useRef(null);
2833
+ const dragAbortControllerRef = React29.useRef(null);
2834
+ const domIndex = store.useState("toastIndex", toast.id);
2835
+ const visibleIndex = store.useState("toastVisibleIndex", toast.id);
2836
+ const offsetY = store.useState("toastOffsetY", toast.id);
2837
+ const focused = store.useState("focused");
2838
+ const expanded = store.useState("expanded");
2839
+ useOpenChangeComplete({
2840
+ open: toast.transitionStatus !== "ending",
2841
+ ref: rootRef,
2842
+ onComplete() {
2843
+ if (toast.transitionStatus === "ending") {
2844
+ store.removeToast(toast.id);
2845
+ }
2846
+ }
2847
+ });
2848
+ const recalculateHeight = useStableCallback((flushSync3 = false) => {
2849
+ const element2 = rootRef.current;
2850
+ if (!element2) {
2851
+ return;
2852
+ }
2853
+ const previousHeight = element2.style.height;
2854
+ element2.style.height = "auto";
2855
+ const height = element2.offsetHeight;
2856
+ element2.style.height = previousHeight;
2857
+ function update() {
2858
+ store.updateToastInternal(toast.id, {
2859
+ ref: rootRef,
2860
+ height,
2861
+ transitionStatus: void 0
2862
+ });
2863
+ }
2864
+ if (flushSync3) {
2865
+ ReactDOM2.flushSync(update);
2866
+ } else {
2867
+ update();
2868
+ }
2869
+ });
2870
+ useIsoLayoutEffect(() => {
2871
+ const previousToastId = lastToastIdRef.current;
2872
+ if (toast.transitionStatus !== "starting" && previousToastId === toast.id) {
2873
+ return;
2874
+ }
2875
+ if (previousToastId !== void 0) {
2876
+ setCurrentSwipeDirection(void 0);
2877
+ setInitialTransform({
2878
+ x: 0,
2879
+ y: 0,
2880
+ scale: 1
2881
+ });
2882
+ setResolvedDragOffset({
2883
+ x: 0,
2884
+ y: 0
2885
+ });
2886
+ }
2887
+ lastToastIdRef.current = toast.id;
2888
+ recalculateHeight();
2889
+ }, [recalculateHeight, toast.id, toast.transitionStatus]);
2890
+ function setResolvedDragOffset(nextDragOffset) {
2891
+ dragOffsetRef.current = nextDragOffset;
2892
+ setDragOffset(nextDragOffset);
2893
+ }
2894
+ useIsoLayoutEffect(() => {
2895
+ return () => {
2896
+ dragAbortControllerRef.current?.abort();
2897
+ };
2898
+ }, []);
2899
+ function applyDirectionalDamping(deltaX, deltaY) {
2900
+ const damp = (delta) => delta > 0 ? delta ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(delta) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);
2901
+ const dampX = deltaX > 0 && !swipeDirections.includes("right") || deltaX < 0 && !swipeDirections.includes("left");
2902
+ const dampY = deltaY > 0 && !swipeDirections.includes("down") || deltaY < 0 && !swipeDirections.includes("up");
2903
+ return {
2904
+ x: dampX ? damp(deltaX) : deltaX,
2905
+ y: dampY ? damp(deltaY) : deltaY
2906
+ };
2907
+ }
2908
+ const handleSwipeEnd = useStableCallback((event) => {
2909
+ if (event.pointerId !== activePointerIdRef.current) {
2910
+ return;
2911
+ }
2912
+ activePointerIdRef.current = null;
2913
+ dragAbortControllerRef.current?.abort();
2914
+ dragAbortControllerRef.current = null;
2915
+ setIsSwiping(false);
2916
+ setIsRealSwipe(false);
2917
+ setLockedDirection(null);
2918
+ const resolvedInitialTransform = initialTransformRef.current;
2919
+ if (event.type === "pointercancel" || cancelledSwipeRef.current) {
2920
+ setResolvedDragOffset({
2921
+ x: resolvedInitialTransform.x,
2922
+ y: resolvedInitialTransform.y
2923
+ });
2924
+ setCurrentSwipeDirection(void 0);
2925
+ return;
2926
+ }
2927
+ const resolvedDragOffset = dragOffsetRef.current;
2928
+ const deltaX = resolvedDragOffset.x - resolvedInitialTransform.x;
2929
+ const deltaY = resolvedDragOffset.y - resolvedInitialTransform.y;
2930
+ let dismissDirection;
2931
+ for (const direction of swipeDirections) {
2932
+ if (getDisplacement(direction, deltaX, deltaY) > SWIPE_THRESHOLD) {
2933
+ dismissDirection = direction;
2934
+ break;
2935
+ }
2936
+ }
2937
+ if (dismissDirection) {
2938
+ setCurrentSwipeDirection(dismissDirection);
2939
+ store.closeToast(toast.id);
2940
+ } else {
2941
+ setResolvedDragOffset({
2942
+ x: resolvedInitialTransform.x,
2943
+ y: resolvedInitialTransform.y
2944
+ });
2945
+ setCurrentSwipeDirection(void 0);
2946
+ }
2947
+ });
2948
+ function handlePointerDown(event) {
2949
+ if (event.button !== 0) {
2950
+ return;
2951
+ }
2952
+ if (event.pointerType === "touch") {
2953
+ store.pauseTimers();
2954
+ }
2955
+ const target = getTarget(event.nativeEvent);
2956
+ const isInteractiveElement = target?.closest(`button,a,input,textarea,[role="button"],${TOAST_SWIPE_IGNORE_SELECTOR}`);
2957
+ if (isInteractiveElement) {
2958
+ return;
2959
+ }
2960
+ cancelledSwipeRef.current = false;
2961
+ intendedSwipeDirectionRef.current = void 0;
2962
+ maxSwipeDisplacementRef.current = 0;
2963
+ activePointerIdRef.current = event.pointerId;
2964
+ dragStartPosRef.current = {
2965
+ x: event.clientX,
2966
+ y: event.clientY
2967
+ };
2968
+ swipeCancelBaselineRef.current = dragStartPosRef.current;
2969
+ const element2 = event.currentTarget;
2970
+ const transform = getElementTransform(element2);
2971
+ initialTransformRef.current = transform;
2972
+ setInitialTransform(transform);
2973
+ setResolvedDragOffset({
2974
+ x: transform.x,
2975
+ y: transform.y
2976
+ });
2977
+ store.set("hovering", true);
2978
+ setIsSwiping(true);
2979
+ setIsRealSwipe(false);
2980
+ setLockedDirection(null);
2981
+ isFirstPointerMoveRef.current = true;
2982
+ dragAbortControllerRef.current?.abort();
2983
+ const dragAbortController = new AbortController();
2984
+ dragAbortControllerRef.current = dragAbortController;
2985
+ const doc = ownerDocument(element2);
2986
+ doc.addEventListener("pointerup", handleSwipeEnd, {
2987
+ signal: dragAbortController.signal
2988
+ });
2989
+ doc.addEventListener("pointercancel", handleSwipeEnd, {
2990
+ signal: dragAbortController.signal
2991
+ });
2992
+ element2.setPointerCapture?.(event.pointerId);
2993
+ }
2994
+ function handlePointerMove(event) {
2995
+ if (event.pointerId !== activePointerIdRef.current) {
2996
+ return;
2997
+ }
2998
+ event.preventDefault();
2999
+ if (isFirstPointerMoveRef.current) {
3000
+ dragStartPosRef.current = {
3001
+ x: event.clientX,
3002
+ y: event.clientY
3003
+ };
3004
+ isFirstPointerMoveRef.current = false;
3005
+ }
3006
+ const {
3007
+ clientY,
3008
+ clientX,
3009
+ movementX,
3010
+ movementY
3011
+ } = event;
3012
+ if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {
3013
+ swipeCancelBaselineRef.current = {
3014
+ x: swipeCancelBaselineRef.current.x,
3015
+ y: clientY
3016
+ };
3017
+ }
3018
+ if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {
3019
+ swipeCancelBaselineRef.current = {
3020
+ x: clientX,
3021
+ y: swipeCancelBaselineRef.current.y
3022
+ };
3023
+ }
3024
+ const deltaX = clientX - dragStartPosRef.current.x;
3025
+ const deltaY = clientY - dragStartPosRef.current.y;
3026
+ const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;
3027
+ const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;
3028
+ let resolvedLockedDirection = lockedDirection;
3029
+ if (!isRealSwipe) {
3030
+ const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
3031
+ if (movementDistance >= MIN_DRAG_THRESHOLD) {
3032
+ setIsRealSwipe(true);
3033
+ const hasHorizontal = swipeDirections.includes("left") || swipeDirections.includes("right");
3034
+ const hasVertical = swipeDirections.includes("up") || swipeDirections.includes("down");
3035
+ if (hasHorizontal && hasVertical) {
3036
+ const absX = Math.abs(deltaX);
3037
+ const absY = Math.abs(deltaY);
3038
+ resolvedLockedDirection = absX > absY ? "horizontal" : "vertical";
3039
+ setLockedDirection(resolvedLockedDirection);
3040
+ }
3041
+ }
3042
+ }
3043
+ let candidate;
3044
+ if (!intendedSwipeDirectionRef.current) {
3045
+ if (resolvedLockedDirection === "vertical") {
3046
+ if (deltaY > 0) {
3047
+ candidate = "down";
3048
+ } else if (deltaY < 0) {
3049
+ candidate = "up";
3050
+ }
3051
+ } else if (resolvedLockedDirection === "horizontal") {
3052
+ if (deltaX > 0) {
3053
+ candidate = "right";
3054
+ } else if (deltaX < 0) {
3055
+ candidate = "left";
3056
+ }
3057
+ } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {
3058
+ candidate = deltaX > 0 ? "right" : "left";
3059
+ } else {
3060
+ candidate = deltaY > 0 ? "down" : "up";
3061
+ }
3062
+ if (candidate && swipeDirections.includes(candidate)) {
3063
+ intendedSwipeDirectionRef.current = candidate;
3064
+ maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);
3065
+ setCurrentSwipeDirection(candidate);
3066
+ }
3067
+ } else {
3068
+ const direction = intendedSwipeDirectionRef.current;
3069
+ const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);
3070
+ if (currentDisplacement > SWIPE_THRESHOLD) {
3071
+ cancelledSwipeRef.current = false;
3072
+ setCurrentSwipeDirection(direction);
3073
+ } else if (!(swipeDirections.includes("left") && swipeDirections.includes("right")) && !(swipeDirections.includes("up") && swipeDirections.includes("down")) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {
3074
+ cancelledSwipeRef.current = true;
3075
+ }
3076
+ }
3077
+ const dampedDelta = applyDirectionalDamping(deltaX, deltaY);
3078
+ let newOffsetX = initialTransformRef.current.x;
3079
+ let newOffsetY = initialTransformRef.current.y;
3080
+ const hasHorizontalDir = swipeDirections.includes("left") || swipeDirections.includes("right");
3081
+ const hasVerticalDir = swipeDirections.includes("up") || swipeDirections.includes("down");
3082
+ if (resolvedLockedDirection !== "vertical" && hasHorizontalDir) {
3083
+ newOffsetX += dampedDelta.x;
3084
+ }
3085
+ if (resolvedLockedDirection !== "horizontal" && hasVerticalDir) {
3086
+ newOffsetY += dampedDelta.y;
3087
+ }
3088
+ setResolvedDragOffset({
3089
+ x: newOffsetX,
3090
+ y: newOffsetY
3091
+ });
3092
+ }
3093
+ function handleKeyDown(event) {
3094
+ if (event.key === "Escape") {
3095
+ if (!rootRef.current || !contains(rootRef.current, activeElement(ownerDocument(rootRef.current)))) {
3096
+ return;
3097
+ }
3098
+ store.closeToast(toast.id);
3099
+ }
3100
+ }
3101
+ React29.useEffect(() => {
3102
+ const element2 = rootRef.current;
3103
+ if (!swipeEnabled || !element2) {
3104
+ return void 0;
3105
+ }
3106
+ function preventDefaultTouchStart(event) {
3107
+ if (activePointerIdRef.current === null || !contains(element2, getTarget(event))) {
3108
+ return;
3109
+ }
3110
+ event.preventDefault();
3111
+ }
3112
+ return addEventListener(element2, "touchmove", preventDefaultTouchStart, {
3113
+ passive: false
3114
+ });
3115
+ }, [swipeEnabled]);
3116
+ function getDragStyles() {
3117
+ const deltaX = dragOffset.x - initialTransform.x;
3118
+ const deltaY = dragOffset.y - initialTransform.y;
3119
+ return {
3120
+ transition: isSwiping ? "none" : void 0,
3121
+ // While swiping, freeze the element at its current visual transform so it doesn't snap to the
3122
+ // end position.
3123
+ transform: isSwiping ? `translateX(${dragOffset.x}px) translateY(${dragOffset.y}px) scale(${initialTransform.scale})` : void 0,
3124
+ ["--toast-swipe-movement-x"]: `${deltaX}px`,
3125
+ ["--toast-swipe-movement-y"]: `${deltaY}px`
3126
+ };
3127
+ }
3128
+ const isHighPriority = toast.priority === "high";
3129
+ const defaultProps = {
3130
+ role: isHighPriority ? "alertdialog" : "dialog",
3131
+ tabIndex: 0,
3132
+ "aria-modal": false,
3133
+ "aria-labelledby": titleId,
3134
+ "aria-describedby": descriptionId,
3135
+ "aria-hidden": isHighPriority && !focused ? true : void 0,
3136
+ onPointerDown: swipeEnabled ? handlePointerDown : void 0,
3137
+ onPointerMove: swipeEnabled ? handlePointerMove : void 0,
3138
+ onPointerUp: swipeEnabled ? handleSwipeEnd : void 0,
3139
+ onPointerCancel: swipeEnabled ? handleSwipeEnd : void 0,
3140
+ onKeyDown: handleKeyDown,
3141
+ inert: inertValue(toast.limited),
3142
+ style: {
3143
+ ...getDragStyles(),
3144
+ ["--toast-index"]: toast.transitionStatus === "ending" ? domIndex : visibleIndex,
3145
+ ["--toast-offset-y"]: `${offsetY}px`,
3146
+ ["--toast-height"]: toast.height ? `${toast.height}px` : void 0
3147
+ }
3148
+ };
3149
+ const toastRoot = React29.useMemo(() => ({
3150
+ toast,
3151
+ setTitleId,
3152
+ setDescriptionId,
3153
+ recalculateHeight,
3154
+ visibleIndex,
3155
+ expanded
3156
+ }), [toast, setTitleId, setDescriptionId, recalculateHeight, visibleIndex, expanded]);
3157
+ const state = {
3158
+ transitionStatus: toast.transitionStatus,
3159
+ expanded,
3160
+ limited: toast.limited || false,
3161
+ type: toast.type,
3162
+ swiping: isSwiping,
3163
+ swipeDirection: currentSwipeDirection
3164
+ };
3165
+ const element = useRenderElement("div", componentProps, {
3166
+ ref: [forwardedRef, rootRef],
3167
+ state,
3168
+ stateAttributesMapping: toastRootStateAttributesMapping,
3169
+ props: [defaultProps, elementProps]
3170
+ });
3171
+ return /* @__PURE__ */ _jsx9(ToastRootContext.Provider, {
3172
+ value: toastRoot,
3173
+ children: element
3174
+ });
3175
+ });
3176
+ if (true) ToastRoot.displayName = "ToastRoot";
3177
+
3178
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/content/ToastContent.mjs
3179
+ import * as React30 from "react";
3180
+ var ToastContent = /* @__PURE__ */ React30.forwardRef(function ToastContent2(componentProps, forwardedRef) {
3181
+ const {
3182
+ render,
3183
+ className,
3184
+ style,
3185
+ ...elementProps
3186
+ } = componentProps;
3187
+ const {
3188
+ visibleIndex,
3189
+ expanded,
3190
+ recalculateHeight
3191
+ } = useToastRootContext();
3192
+ const contentRef = React30.useRef(null);
3193
+ useIsoLayoutEffect(() => {
3194
+ recalculateHeight();
3195
+ const node = contentRef.current;
3196
+ if (!node || typeof ResizeObserver !== "function" || typeof MutationObserver !== "function") {
3197
+ return void 0;
3198
+ }
3199
+ const resizeObserver = new ResizeObserver(() => recalculateHeight(true));
3200
+ const mutationObserver = new MutationObserver(() => recalculateHeight(true));
3201
+ resizeObserver.observe(node);
3202
+ mutationObserver.observe(node, {
3203
+ childList: true,
3204
+ subtree: true,
3205
+ characterData: true
3206
+ });
3207
+ return () => {
3208
+ resizeObserver.disconnect();
3209
+ mutationObserver.disconnect();
3210
+ };
3211
+ }, [recalculateHeight]);
3212
+ const behind = visibleIndex > 0;
3213
+ const state = {
3214
+ expanded,
3215
+ behind
3216
+ };
3217
+ return useRenderElement("div", componentProps, {
3218
+ ref: [forwardedRef, contentRef],
3219
+ state,
3220
+ props: elementProps
3221
+ });
3222
+ });
3223
+ if (true) ToastContent.displayName = "ToastContent";
3224
+
3225
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/description/ToastDescription.mjs
3226
+ import * as React32 from "react";
3227
+
3228
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/utils/isRenderableNode.mjs
3229
+ import * as React31 from "react";
3230
+ function isRenderableNode(node) {
3231
+ if (node == null || typeof node === "boolean" || node === "") {
3232
+ return false;
3233
+ }
3234
+ if (Array.isArray(node)) {
3235
+ return node.some(isRenderableNode);
3236
+ }
3237
+ return true;
3238
+ }
3239
+ function hasRenderableChildren(element) {
3240
+ return /* @__PURE__ */ React31.isValidElement(element) && isRenderableNode(element.props.children);
3241
+ }
3242
+
3243
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/utils/useToastLabelPart.mjs
3244
+ function useToastLabelPart(idProp, childrenProp, part) {
3245
+ const {
3246
+ toast,
3247
+ setTitleId,
3248
+ setDescriptionId
3249
+ } = useToastRootContext();
3250
+ const setId = part === "title" ? setTitleId : setDescriptionId;
3251
+ const children = childrenProp ?? (part === "title" ? toast.title : toast.description);
3252
+ const id = useId(idProp);
3253
+ return {
3254
+ id,
3255
+ children,
3256
+ type: toast.type,
3257
+ setId
3258
+ };
3259
+ }
3260
+ function useToastLabelElement(element, id, setId) {
3261
+ const shouldRender = hasRenderableChildren(element);
3262
+ useIsoLayoutEffect(() => {
3263
+ if (!shouldRender) {
3264
+ return void 0;
3265
+ }
3266
+ setId(id);
3267
+ return () => {
3268
+ setId((currentId) => currentId === id ? void 0 : currentId);
3269
+ };
3270
+ }, [shouldRender, id, setId]);
3271
+ return shouldRender ? element : null;
3272
+ }
3273
+
3274
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/description/ToastDescription.mjs
3275
+ var ToastDescription = /* @__PURE__ */ React32.forwardRef(function ToastDescription2(componentProps, forwardedRef) {
3276
+ const {
3277
+ render,
3278
+ className,
3279
+ style,
3280
+ id: idProp,
3281
+ children: childrenProp,
3282
+ ...elementProps
3283
+ } = componentProps;
3284
+ const {
3285
+ id,
3286
+ children,
3287
+ type,
3288
+ setId
3289
+ } = useToastLabelPart(idProp, childrenProp, "description");
3290
+ const state = {
3291
+ type
3292
+ };
3293
+ const element = useRenderElement("p", componentProps, {
3294
+ ref: forwardedRef,
3295
+ state,
3296
+ props: {
3297
+ ...elementProps,
3298
+ id,
3299
+ children
3300
+ }
3301
+ });
3302
+ return useToastLabelElement(element, id, setId);
3303
+ });
3304
+ if (true) ToastDescription.displayName = "ToastDescription";
3305
+
3306
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/title/ToastTitle.mjs
3307
+ import * as React33 from "react";
3308
+ var ToastTitle = /* @__PURE__ */ React33.forwardRef(function ToastTitle2(componentProps, forwardedRef) {
3309
+ const {
3310
+ render,
3311
+ className,
3312
+ style,
3313
+ id: idProp,
3314
+ children: childrenProp,
3315
+ ...elementProps
3316
+ } = componentProps;
3317
+ const {
3318
+ id,
3319
+ children,
3320
+ type,
3321
+ setId
3322
+ } = useToastLabelPart(idProp, childrenProp, "title");
3323
+ const state = {
3324
+ type
3325
+ };
3326
+ const element = useRenderElement("h2", componentProps, {
3327
+ ref: forwardedRef,
3328
+ state,
3329
+ props: {
3330
+ ...elementProps,
3331
+ id,
3332
+ children
3333
+ }
3334
+ });
3335
+ return useToastLabelElement(element, id, setId);
3336
+ });
3337
+ if (true) ToastTitle.displayName = "ToastTitle";
3338
+
3339
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/close/ToastClose.mjs
3340
+ import * as React34 from "react";
3341
+ var ToastClose = /* @__PURE__ */ React34.forwardRef(function ToastClose2(componentProps, forwardedRef) {
3342
+ const {
3343
+ render,
3344
+ className,
3345
+ style,
3346
+ disabled,
3347
+ nativeButton = true,
3348
+ ...elementProps
3349
+ } = componentProps;
3350
+ const store = useToastProviderContext();
3351
+ const {
3352
+ toast,
3353
+ expanded
3354
+ } = useToastRootContext();
3355
+ const [hasFocus, setHasFocus] = React34.useState(false);
3356
+ const {
3357
+ getButtonProps,
3358
+ buttonRef
3359
+ } = useButton({
3360
+ disabled,
3361
+ native: nativeButton
3362
+ });
3363
+ const state = {
3364
+ type: toast.type
3365
+ };
3366
+ return useRenderElement("button", componentProps, {
3367
+ ref: [forwardedRef, buttonRef],
3368
+ state,
3369
+ props: [{
3370
+ "aria-hidden": !expanded && !hasFocus,
3371
+ onClick() {
3372
+ store.closeToast(toast.id);
3373
+ },
3374
+ onFocus() {
3375
+ setHasFocus(true);
3376
+ },
3377
+ onBlur() {
3378
+ setHasFocus(false);
3379
+ }
3380
+ }, elementProps, getButtonProps]
3381
+ });
3382
+ });
3383
+ if (true) ToastClose.displayName = "ToastClose";
3384
+
3385
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/action/ToastAction.mjs
3386
+ import * as React35 from "react";
3387
+ var ToastAction = /* @__PURE__ */ React35.forwardRef(function ToastAction2(componentProps, forwardedRef) {
3388
+ const {
3389
+ render,
3390
+ className,
3391
+ style,
3392
+ disabled,
3393
+ nativeButton = true,
3394
+ ...elementProps
3395
+ } = componentProps;
3396
+ const {
3397
+ toast
3398
+ } = useToastRootContext();
3399
+ const computedChildren = toast.actionProps?.children ?? elementProps.children;
3400
+ const {
3401
+ getButtonProps,
3402
+ buttonRef
3403
+ } = useButton({
3404
+ disabled,
3405
+ native: nativeButton
3406
+ });
3407
+ const state = {
3408
+ type: toast.type
3409
+ };
3410
+ const element = useRenderElement("button", componentProps, {
3411
+ ref: [forwardedRef, buttonRef],
3412
+ state,
3413
+ props: [elementProps, toast.actionProps, getButtonProps, {
3414
+ children: computedChildren
3415
+ }]
3416
+ });
3417
+ return hasRenderableChildren(element) ? element : null;
3418
+ });
3419
+ if (true) ToastAction.displayName = "ToastAction";
3420
+
3421
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/portal/ToastPortal.mjs
3422
+ import * as React36 from "react";
3423
+ import { jsx as _jsx10 } from "react/jsx-runtime";
3424
+ var ToastPortal = /* @__PURE__ */ React36.forwardRef(function ToastPortal2(props, forwardedRef) {
3425
+ return /* @__PURE__ */ _jsx10(FloatingPortalLite, {
3426
+ ref: forwardedRef,
3427
+ ...props
3428
+ });
3429
+ });
3430
+ if (true) ToastPortal.displayName = "ToastPortal";
3431
+
3432
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/positioner/ToastPositioner.mjs
3433
+ import * as React38 from "react";
3434
+
3435
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/positioner/ToastPositionerContext.mjs
3436
+ import * as React37 from "react";
3437
+ var ToastPositionerContext = /* @__PURE__ */ React37.createContext(void 0);
3438
+ if (true) ToastPositionerContext.displayName = "ToastPositionerContext";
3439
+ function useToastPositionerContext() {
3440
+ const context = React37.useContext(ToastPositionerContext);
3441
+ if (context === void 0) {
3442
+ throw new Error(true ? "Base UI: ToastPositionerContext is missing. ToastPositioner parts must be placed within <Toast.Positioner>." : formatErrorMessage_default(84));
3443
+ }
3444
+ return context;
3445
+ }
3446
+
3447
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/positioner/ToastPositioner.mjs
3448
+ import { jsx as _jsx11 } from "react/jsx-runtime";
3449
+ var ToastPositioner = /* @__PURE__ */ React38.forwardRef(function ToastPositioner2(componentProps, forwardedRef) {
3450
+ const {
3451
+ toast,
3452
+ ...props
3453
+ } = componentProps;
3454
+ const store = useToastProviderContext();
3455
+ const positionerProps = toast.positionerProps ?? EMPTY_OBJECT;
3456
+ const {
3457
+ render,
3458
+ className,
3459
+ anchor: anchorProp = positionerProps.anchor,
3460
+ positionMethod = positionerProps.positionMethod ?? "absolute",
3461
+ side = positionerProps.side ?? "top",
3462
+ align = positionerProps.align ?? "center",
3463
+ sideOffset = positionerProps.sideOffset ?? 0,
3464
+ alignOffset = positionerProps.alignOffset ?? 0,
3465
+ collisionBoundary = positionerProps.collisionBoundary ?? "clipping-ancestors",
3466
+ collisionPadding = positionerProps.collisionPadding ?? 5,
3467
+ arrowPadding = positionerProps.arrowPadding ?? 5,
3468
+ sticky = positionerProps.sticky ?? false,
3469
+ disableAnchorTracking = positionerProps.disableAnchorTracking ?? false,
3470
+ collisionAvoidance = positionerProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE,
3471
+ style,
3472
+ ...elementProps
3473
+ } = props;
3474
+ const [positionerElement, setPositionerElement] = React38.useState(null);
3475
+ const domIndex = store.useState("toastIndex", toast.id);
3476
+ const visibleIndex = store.useState("toastVisibleIndex", toast.id);
3477
+ const anchor = isElement(anchorProp) ? anchorProp : null;
3478
+ const floatingRootContext = useFloatingRootContext({
3479
+ open: true,
3480
+ onOpenChange: NOOP,
3481
+ elements: {
3482
+ floating: positionerElement,
3483
+ reference: anchor
3484
+ }
3485
+ });
3486
+ const positioning = useAnchorPositioning({
3487
+ anchor,
3488
+ positionMethod,
3489
+ floatingRootContext,
3490
+ mounted: true,
3491
+ side,
3492
+ sideOffset,
3493
+ align,
3494
+ alignOffset,
3495
+ collisionBoundary,
3496
+ collisionPadding,
3497
+ sticky,
3498
+ arrowPadding,
3499
+ disableAnchorTracking,
3500
+ keepMounted: true,
3501
+ collisionAvoidance
3502
+ });
3503
+ const state = {
3504
+ side: positioning.side,
3505
+ align: positioning.align,
3506
+ anchorHidden: positioning.anchorHidden
3507
+ };
3508
+ const element = usePositioner(componentProps, state, {
3509
+ styles: {
3510
+ ...positioning.positionerStyles,
3511
+ ["--toast-index"]: toast.transitionStatus === "ending" ? domIndex : visibleIndex
3512
+ },
3513
+ transitionStatus: toast.transitionStatus,
3514
+ props: elementProps,
3515
+ refs: [forwardedRef, setPositionerElement]
3516
+ });
3517
+ return /* @__PURE__ */ _jsx11(ToastPositionerContext.Provider, {
3518
+ value: positioning,
3519
+ children: element
3520
+ });
3521
+ });
3522
+ if (true) ToastPositioner.displayName = "ToastPositioner";
3523
+
3524
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/arrow/ToastArrow.mjs
3525
+ import * as React39 from "react";
3526
+ var ToastArrow = /* @__PURE__ */ React39.forwardRef(function ToastArrow2(componentProps, forwardedRef) {
3527
+ const {
3528
+ className,
3529
+ render,
3530
+ style,
3531
+ ...elementProps
3532
+ } = componentProps;
3533
+ const {
3534
+ arrowRef,
3535
+ side,
3536
+ align,
3537
+ arrowUncentered,
3538
+ arrowStyles
3539
+ } = useToastPositionerContext();
3540
+ const state = {
3541
+ side,
3542
+ align,
3543
+ uncentered: arrowUncentered
3544
+ };
3545
+ return useRenderElement("div", componentProps, {
3546
+ state,
3547
+ ref: [forwardedRef, arrowRef],
3548
+ props: [{
3549
+ style: arrowStyles,
3550
+ "aria-hidden": true
3551
+ }, elementProps]
3552
+ });
3553
+ });
3554
+ if (true) ToastArrow.displayName = "ToastArrow";
3555
+
3556
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/useToastManager.mjs
3557
+ import * as React40 from "react";
3558
+ function useToastManager() {
3559
+ const store = useToastProviderContext();
3560
+ const toasts = store.useState("toasts");
3561
+ return React40.useMemo(() => ({
3562
+ toasts,
3563
+ add: store.addToast,
3564
+ close: store.closeToast,
3565
+ update: store.updateToast,
3566
+ promise: store.promiseToast
3567
+ }), [toasts, store]);
3568
+ }
3569
+
3570
+ // node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/toast/createToastManager.mjs
3571
+ function createToastManager() {
3572
+ const listeners = /* @__PURE__ */ new Set();
3573
+ function emit(data) {
3574
+ listeners.forEach((listener) => listener(data));
3575
+ }
3576
+ return {
3577
+ // This should be private aside from ToastProvider needing to access it.
3578
+ // https://x.com/drosenwasser/status/1816947740032872664
3579
+ " subscribe": function subscribe(listener) {
3580
+ listeners.add(listener);
3581
+ return () => {
3582
+ listeners.delete(listener);
3583
+ };
3584
+ },
3585
+ add(options) {
3586
+ const id = options.id || generateId("toast");
3587
+ const toastToAdd = {
3588
+ ...options,
3589
+ id,
3590
+ transitionStatus: "starting"
3591
+ };
3592
+ emit({
3593
+ action: "add",
3594
+ options: toastToAdd
3595
+ });
3596
+ return id;
3597
+ },
3598
+ close(id) {
3599
+ emit({
3600
+ action: "close",
3601
+ options: {
3602
+ id
3603
+ }
3604
+ });
3605
+ },
3606
+ update(id, updates) {
3607
+ emit({
3608
+ action: "update",
3609
+ options: {
3610
+ ...updates,
3611
+ id
3612
+ }
3613
+ });
3614
+ },
3615
+ promise(promiseValue, options) {
3616
+ let handledPromise = promiseValue;
3617
+ emit({
3618
+ action: "promise",
3619
+ options: {
3620
+ ...options,
3621
+ promise: promiseValue,
3622
+ setPromise(promise) {
3623
+ handledPromise = promise;
3624
+ }
3625
+ }
3626
+ });
3627
+ return handledPromise;
3628
+ }
3629
+ };
3630
+ }
3631
+
3632
+ // src/primitives/toast.tsx
3633
+ import { XIcon as XIcon2 } from "lucide-react";
3634
+ import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
3635
+ function toBaseToastOptions(options) {
3636
+ const { action, variant, ...rest } = options;
3637
+ return {
3638
+ ...rest,
3639
+ ...variant !== void 0 ? { type: variant, data: { variant } } : {},
3640
+ ...action !== void 0 ? {
3641
+ actionProps: {
3642
+ children: action.label,
3643
+ onClick: action.onClick
3644
+ }
3645
+ } : {}
3646
+ };
3647
+ }
3648
+ function toBasePromiseOption(option) {
3649
+ return typeof option === "string" ? option : toBaseToastOptions(option);
3650
+ }
3651
+ function ToastProvider3({ children, limit = 3, timeout = 5e3 }) {
3652
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Provider, { limit, timeout, children });
3653
+ }
3654
+ function useToast() {
3655
+ const manager = index_parts_exports4.useToastManager();
3656
+ return React41.useMemo(
3657
+ () => ({
3658
+ add(options) {
3659
+ const variant = options.variant ?? "default";
3660
+ return manager.add({
3661
+ ...toBaseToastOptions({ ...options, variant }),
3662
+ id: options.id
3663
+ });
3664
+ },
3665
+ close(id) {
3666
+ manager.close(id);
3667
+ },
3668
+ update(id, options) {
3669
+ manager.update(id, toBaseToastOptions(options));
3670
+ },
3671
+ promise(promise, options) {
3672
+ return manager.promise(promise, {
3673
+ loading: toBasePromiseOption(options.loading),
3674
+ success: (result) => {
3675
+ const next = typeof options.success === "function" ? options.success(result) : options.success;
3676
+ return toBasePromiseOption(next);
3677
+ },
3678
+ error: (error) => {
3679
+ const next = typeof options.error === "function" ? options.error(error) : options.error;
3680
+ return toBasePromiseOption(next);
3681
+ }
3682
+ });
3683
+ }
3684
+ }),
3685
+ [manager]
3686
+ );
3687
+ }
3688
+ function ToastViewport3({ className, placement = "bottom-end", ...props }) {
3689
+ const { toasts } = index_parts_exports4.useToastManager();
3690
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Portal, { children: /* @__PURE__ */ jsx17(
3691
+ index_parts_exports4.Viewport,
3692
+ {
3693
+ "data-slot": "toast-viewport",
3694
+ className: cn(
3695
+ "pointer-events-none fixed z-[100] flex w-[min(24rem,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex-col gap-2 p-4 outline-none",
3696
+ placement === "bottom-end" && "right-0 bottom-0 items-end",
3697
+ placement === "bottom-start" && "bottom-0 left-0 items-start",
3698
+ placement === "top-end" && "top-0 right-0 items-end",
3699
+ placement === "top-start" && "top-0 left-0 items-start",
3700
+ className
3701
+ ),
3702
+ ...props,
3703
+ children: toasts.map((toast) => /* @__PURE__ */ jsx17(Toast, { toast }, toast.id))
3704
+ }
3705
+ ) });
3706
+ }
3707
+ function Toast({
3708
+ children,
3709
+ className,
3710
+ toast,
3711
+ ...props
3712
+ }) {
3713
+ const variant = toast.data?.variant ?? toast.type ?? "default";
3714
+ return /* @__PURE__ */ jsx17(
3715
+ index_parts_exports4.Root,
3716
+ {
3717
+ toast,
3718
+ "data-slot": "toast",
3719
+ "data-variant": variant,
3720
+ className: cn(
3721
+ "pointer-events-auto relative grid w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-[var(--ds-radius-surface)] border bg-surface p-4 text-sm text-text-primary shadow-[var(--ds-shadow-floating)] outline-none data-ending:animate-out data-starting:animate-in data-[variant=error]:border-danger-border data-[variant=error]:bg-danger-background data-[variant=error]:text-danger-foreground data-[variant=information]:border-information-border data-[variant=information]:bg-information-background data-[variant=information]:text-information-foreground data-[variant=success]:border-success-border data-[variant=success]:bg-success-background data-[variant=success]:text-success-foreground data-[variant=warning]:border-warning-border data-[variant=warning]:bg-warning-background data-[variant=warning]:text-warning-foreground",
3722
+ className
3723
+ ),
3724
+ ...props,
3725
+ children: children ?? /* @__PURE__ */ jsxs8(ToastContent3, { children: [
3726
+ /* @__PURE__ */ jsxs8("div", { className: "min-w-0", children: [
3727
+ /* @__PURE__ */ jsx17(ToastTitle3, {}),
3728
+ /* @__PURE__ */ jsx17(ToastDescription3, {})
3729
+ ] }),
3730
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-1", children: [
3731
+ /* @__PURE__ */ jsx17(ToastAction3, {}),
3732
+ /* @__PURE__ */ jsx17(ToastClose3, {})
3733
+ ] })
3734
+ ] })
3735
+ }
3736
+ );
3737
+ }
3738
+ function ToastContent3({ className, ...props }) {
3739
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Content, { "data-slot": "toast-content", className: cn("contents", className), ...props });
3740
+ }
3741
+ function ToastTitle3({ className, ...props }) {
3742
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Title, { "data-slot": "toast-title", className: cn("font-semibold", className), ...props });
3743
+ }
3744
+ function ToastDescription3({ className, ...props }) {
3745
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Description, { "data-slot": "toast-description", className: cn("mt-1 text-text-supporting", className), ...props });
3746
+ }
3747
+ function ToastAction3({ className, ...props }) {
3748
+ return /* @__PURE__ */ jsx17(index_parts_exports4.Action, { "data-slot": "toast-action", className: cn("rounded px-2 py-1 text-xs font-medium text-text-link outline-none hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-focus", className), ...props });
3749
+ }
3750
+ function ToastClose3({ "aria-label": ariaLabel = "Dismiss notification", children, className, ...props }) {
3751
+ return /* @__PURE__ */ jsx17(
3752
+ index_parts_exports4.Close,
3753
+ {
3754
+ "data-slot": "toast-close",
3755
+ "aria-label": ariaLabel,
3756
+ className: cn("rounded p-1 text-text-supporting outline-none hover:bg-surface-muted hover:text-text-primary focus-visible:ring-2 focus-visible:ring-focus", className),
3757
+ ...props,
3758
+ children: children ?? /* @__PURE__ */ jsx17(XIcon2, { "aria-hidden": "true", className: "size-4" })
3759
+ }
3760
+ );
3761
+ }
3762
+
3763
+ export {
3764
+ alertVariants,
3765
+ Alert,
3766
+ AlertTitle,
3767
+ AlertDescription,
3768
+ Avatar,
3769
+ AvatarImage,
3770
+ AvatarFallback,
3771
+ AvatarGroup,
3772
+ badgeVariants,
3773
+ Badge,
3774
+ BrandIcon,
3775
+ BrandWordmark,
3776
+ Switch,
3777
+ LabeledSwitch,
3778
+ Textarea,
3779
+ ConsciaButton,
3780
+ ConsciaIconButton,
3781
+ ConsciaCard,
3782
+ ConsciaCardContent,
3783
+ ConsciaCardDescription,
3784
+ ConsciaCardHeader,
3785
+ ConsciaCardTitle,
3786
+ ConsciaCardFooter,
3787
+ ConsciaCheckbox,
3788
+ ConsciaInput,
3789
+ ConsciaSwitch,
3790
+ ConsciaTextarea,
3791
+ ConsciaSelect,
3792
+ ConsciaSelectContent,
3793
+ ConsciaSelectGroup,
3794
+ ConsciaSelectItem,
3795
+ ConsciaSelectTrigger,
3796
+ ConsciaSelectValue,
3797
+ ConsciaTable,
3798
+ ConsciaTableBody,
3799
+ ConsciaTableCell,
3800
+ ConsciaTableHeader,
3801
+ ConsciaTableHead,
3802
+ ConsciaTableRow,
3803
+ Field,
3804
+ FieldGroup,
3805
+ FieldLabel,
3806
+ FieldDescription,
3807
+ FieldError,
3808
+ FilterChip,
3809
+ FormSelect,
3810
+ ConsciaFormSelect,
3811
+ Label,
3812
+ Spinner,
3813
+ LoadingButton,
3814
+ Popover,
3815
+ PopoverTrigger3 as PopoverTrigger,
3816
+ PopoverPortal3 as PopoverPortal,
3817
+ PopoverPositioner3 as PopoverPositioner,
3818
+ PopoverContent,
3819
+ PopoverArrow3 as PopoverArrow,
3820
+ PopoverTitle3 as PopoverTitle,
3821
+ PopoverDescription3 as PopoverDescription,
3822
+ PopoverClose3 as PopoverClose,
3823
+ SearchableSelect,
3824
+ ToastProvider3 as ToastProvider,
3825
+ useToast,
3826
+ ToastViewport3 as ToastViewport,
3827
+ Toast,
3828
+ ToastContent3 as ToastContent,
3829
+ ToastTitle3 as ToastTitle,
3830
+ ToastDescription3 as ToastDescription,
3831
+ ToastAction3 as ToastAction,
3832
+ ToastClose3 as ToastClose
3833
+ };
3834
+ //# sourceMappingURL=chunk-XQSBTQRR.js.map