@sovereignfs/ui 0.107.0 → 0.107.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -99,6 +99,18 @@ function AuthError({ children }) {
99
99
  return /* @__PURE__ */ jsx6("p", { className: styles6.error, role: "alert", children });
100
100
  }
101
101
 
102
+ // src/hooks/useHydrated.ts
103
+ import { useSyncExternalStore } from "react";
104
+ var never = () => () => {
105
+ };
106
+ function useHydrated() {
107
+ return useSyncExternalStore(
108
+ never,
109
+ () => true,
110
+ () => false
111
+ );
112
+ }
113
+
102
114
  // src/components/Button/Button.tsx
103
115
  import styles7 from "./Button.module.css";
104
116
  import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
@@ -136,15 +148,30 @@ function Button({
136
148
  import styles8 from "./Auth.module.css";
137
149
  import { jsx as jsx8 } from "react/jsx-runtime";
138
150
  var join = (...names) => names.filter(Boolean).join(" ");
139
- function AuthForm({ className, ...rest }) {
140
- return /* @__PURE__ */ jsx8("form", { className: join(styles8.form, className), ...rest });
151
+ function AuthForm({
152
+ className,
153
+ action,
154
+ method,
155
+ ...rest
156
+ }) {
157
+ return /* @__PURE__ */ jsx8(
158
+ "form",
159
+ {
160
+ className: join(styles8.form, className),
161
+ action,
162
+ method: method ?? (action === void 0 ? "post" : void 0),
163
+ ...rest
164
+ }
165
+ );
141
166
  }
142
- function AuthButton({ className, type = "button", ...rest }) {
167
+ function AuthButton({ className, type = "button", disabled, ...rest }) {
168
+ const hydrated = useHydrated();
143
169
  return /* @__PURE__ */ jsx8(
144
170
  Button,
145
171
  {
146
172
  type,
147
173
  className: join(type === "submit" ? styles8.submit : styles8.wide, className),
174
+ disabled: disabled || type === "submit" && !hydrated,
148
175
  ...rest
149
176
  }
150
177
  );
@@ -266,10 +293,15 @@ function SignInForm({
266
293
  renderLink = plainLink
267
294
  }) {
268
295
  const [email, setEmail] = useState("");
269
- const [password, setPassword] = useState("");
270
296
  function submit(event) {
271
297
  event.preventDefault();
272
- onSubmit({ email, password });
298
+ const boxes = new FormData(event.currentTarget);
299
+ const values = {
300
+ email: String(boxes.get("email") ?? ""),
301
+ password: String(boxes.get("password") ?? "")
302
+ };
303
+ setEmail(values.email);
304
+ onSubmit(values);
273
305
  }
274
306
  return /* @__PURE__ */ jsxs6(Fragment, { children: [
275
307
  notice,
@@ -283,7 +315,6 @@ function SignInForm({
283
315
  autoComplete: "username",
284
316
  required: true,
285
317
  disabled: pending,
286
- value: email,
287
318
  onChange: (event) => setEmail(event.target.value)
288
319
  }
289
320
  ) }),
@@ -300,9 +331,7 @@ function SignInForm({
300
331
  name: "password",
301
332
  autoComplete: "current-password",
302
333
  required: true,
303
- disabled: pending,
304
- value: password,
305
- onChange: (event) => setPassword(event.target.value)
334
+ disabled: pending
306
335
  }
307
336
  )
308
337
  }
@@ -383,7 +412,6 @@ function ForgotPasswordForm({
383
412
  }
384
413
 
385
414
  // src/components/Auth/ResetPasswordForm.tsx
386
- import { useState as useState3 } from "react";
387
415
  import styles13 from "./Auth.module.css";
388
416
  import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
389
417
  function ResetPasswordForm({
@@ -396,8 +424,6 @@ function ResetPasswordForm({
396
424
  newLinkHref,
397
425
  renderLink = plainLink
398
426
  }) {
399
- const [password, setPassword] = useState3("");
400
- const [confirm, setConfirm] = useState3("");
401
427
  if (expired) {
402
428
  return /* @__PURE__ */ jsxs8(Fragment3, { children: [
403
429
  /* @__PURE__ */ jsx14(AuthNotice, { tone: "warning", children: "This link has expired or was already used. A link works once, for an hour." }),
@@ -410,7 +436,11 @@ function ResetPasswordForm({
410
436
  }
411
437
  function submit(event) {
412
438
  event.preventDefault();
413
- onSubmit({ password, confirm });
439
+ const boxes = new FormData(event.currentTarget);
440
+ onSubmit({
441
+ password: String(boxes.get("password") ?? ""),
442
+ confirm: String(boxes.get("confirm") ?? "")
443
+ });
414
444
  }
415
445
  return /* @__PURE__ */ jsxs8(Fragment3, { children: [
416
446
  /* @__PURE__ */ jsxs8(AuthForm, { onSubmit: submit, children: [
@@ -422,9 +452,7 @@ function ResetPasswordForm({
422
452
  name: "password",
423
453
  autoComplete: "new-password",
424
454
  required: true,
425
- disabled: pending,
426
- value: password,
427
- onChange: (event) => setPassword(event.target.value)
455
+ disabled: pending
428
456
  }
429
457
  ) }),
430
458
  /* @__PURE__ */ jsx14(AuthField, { label: "Confirm new password", children: (control) => /* @__PURE__ */ jsx14(
@@ -435,9 +463,7 @@ function ResetPasswordForm({
435
463
  name: "confirm",
436
464
  autoComplete: "new-password",
437
465
  required: true,
438
- disabled: pending,
439
- value: confirm,
440
- onChange: (event) => setConfirm(event.target.value)
466
+ disabled: pending
441
467
  }
442
468
  ) }),
443
469
  error ? /* @__PURE__ */ jsx14(AuthError, { children: error }) : null,
@@ -448,7 +474,7 @@ function ResetPasswordForm({
448
474
  }
449
475
 
450
476
  // src/components/Auth/SignUpForm.tsx
451
- import { useState as useState4 } from "react";
477
+ import { useState as useState3 } from "react";
452
478
  import styles14 from "./Auth.module.css";
453
479
  import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
454
480
  function SignUpForm({
@@ -464,11 +490,7 @@ function SignUpForm({
464
490
  signInHref,
465
491
  renderLink = plainLink
466
492
  }) {
467
- const [name, setName] = useState4("");
468
- const [email, setEmail] = useState4(invitedEmail ?? "");
469
- const [password, setPassword] = useState4("");
470
- const [confirm, setConfirm] = useState4("");
471
- const [agreed, setAgreed] = useState4(false);
493
+ const [agreed, setAgreed] = useState3(false);
472
494
  const invited = invitedEmail !== void 0;
473
495
  const signIn = renderLink({
474
496
  href: signInHref,
@@ -488,7 +510,15 @@ function SignUpForm({
488
510
  }
489
511
  function submit(event) {
490
512
  event.preventDefault();
491
- onSubmit({ name, email, password, confirm, agreed: terms === false || agreed });
513
+ const boxes = new FormData(event.currentTarget);
514
+ const typed = (box) => String(boxes.get(box) ?? "");
515
+ onSubmit({
516
+ name: typed("name"),
517
+ email: typed("email"),
518
+ password: typed("password"),
519
+ confirm: typed("confirm"),
520
+ agreed: terms === false || agreed
521
+ });
492
522
  }
493
523
  return /* @__PURE__ */ jsxs9(Fragment4, { children: [
494
524
  invited ? /* @__PURE__ */ jsx15("div", { className: styles14.notice, children: /* @__PURE__ */ jsxs9("p", { className: styles14.inviteTitle, children: [
@@ -496,18 +526,7 @@ function SignUpForm({
496
526
  appName
497
527
  ] }) }) : null,
498
528
  /* @__PURE__ */ jsxs9(AuthForm, { onSubmit: submit, children: [
499
- /* @__PURE__ */ jsx15(AuthField, { label: "Name", children: (control) => /* @__PURE__ */ jsx15(
500
- Input,
501
- {
502
- ...control,
503
- name: "name",
504
- autoComplete: "name",
505
- required: true,
506
- disabled: pending,
507
- value: name,
508
- onChange: (event) => setName(event.target.value)
509
- }
510
- ) }),
529
+ /* @__PURE__ */ jsx15(AuthField, { label: "Name", children: (control) => /* @__PURE__ */ jsx15(Input, { ...control, name: "name", autoComplete: "name", required: true, disabled: pending }) }),
511
530
  /* @__PURE__ */ jsx15(
512
531
  AuthField,
513
532
  {
@@ -523,8 +542,7 @@ function SignUpForm({
523
542
  required: true,
524
543
  disabled: pending,
525
544
  readOnly: invited,
526
- value: email,
527
- onChange: invited ? void 0 : (event) => setEmail(event.target.value)
545
+ defaultValue: invitedEmail
528
546
  }
529
547
  )
530
548
  }
@@ -537,9 +555,7 @@ function SignUpForm({
537
555
  name: "password",
538
556
  autoComplete: "new-password",
539
557
  required: true,
540
- disabled: pending,
541
- value: password,
542
- onChange: (event) => setPassword(event.target.value)
558
+ disabled: pending
543
559
  }
544
560
  ) }),
545
561
  /* @__PURE__ */ jsx15(AuthField, { label: "Confirm password", children: (control) => /* @__PURE__ */ jsx15(
@@ -550,9 +566,7 @@ function SignUpForm({
550
566
  name: "confirm",
551
567
  autoComplete: "new-password",
552
568
  required: true,
553
- disabled: pending,
554
- value: confirm,
555
- onChange: (event) => setConfirm(event.target.value)
569
+ disabled: pending
556
570
  }
557
571
  ) }),
558
572
  terms ? /* @__PURE__ */ jsxs9("label", { className: styles14.terms, children: [
@@ -600,7 +614,7 @@ function SignUpForm({
600
614
  }
601
615
 
602
616
  // src/components/Auth/TwoFactorForm.tsx
603
- import { useState as useState5 } from "react";
617
+ import { useState as useState4 } from "react";
604
618
  import styles15 from "./Auth.module.css";
605
619
  import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
606
620
  function TwoFactorForm({
@@ -613,9 +627,9 @@ function TwoFactorForm({
613
627
  signInAgainHref,
614
628
  renderLink = plainLink
615
629
  }) {
616
- const [useBackup, setUseBackup] = useState5(false);
617
- const [digits, setDigits] = useState5("");
618
- const [backupCode, setBackupCode] = useState5("");
630
+ const [useBackup, setUseBackup] = useState4(false);
631
+ const [digits, setDigits] = useState4("");
632
+ const [backupCode, setBackupCode] = useState4("");
619
633
  if (over) {
620
634
  return /* @__PURE__ */ jsxs10(Fragment5, { children: [
621
635
  /* @__PURE__ */ jsx16(AuthNotice, { tone: "warning", children: "This sign-in can no longer be finished: it timed out, or there were too many wrong codes." }),
@@ -4222,7 +4236,7 @@ function when(milliseconds, timeZone) {
4222
4236
  }
4223
4237
 
4224
4238
  // src/components/Account/ChangePasswordForm.tsx
4225
- import { useState as useState6 } from "react";
4239
+ import { useEffect, useRef as useRef2 } from "react";
4226
4240
 
4227
4241
  // src/components/FormField/FormField.tsx
4228
4242
  import { useId as useId3 } from "react";
@@ -4268,50 +4282,40 @@ function ChangePasswordForm({
4268
4282
  pending = false,
4269
4283
  onSubmit
4270
4284
  }) {
4271
- const [current2, setCurrent] = useState6("");
4272
- const [next, setNext] = useState6("");
4273
- const [cleared, setCleared] = useState6(done);
4274
- if (done && !cleared) {
4275
- setCleared(true);
4276
- setCurrent("");
4277
- setNext("");
4278
- }
4279
- if (!done && cleared) setCleared(false);
4285
+ const form = useRef2(null);
4286
+ const hydrated = useHydrated();
4287
+ useEffect(() => {
4288
+ if (done) form.current?.reset();
4289
+ }, [done]);
4280
4290
  function submit(event) {
4281
4291
  event.preventDefault();
4282
- onSubmit({ current: current2, next });
4292
+ const boxes = new FormData(event.currentTarget);
4293
+ onSubmit({
4294
+ current: String(boxes.get("currentPassword") ?? ""),
4295
+ next: String(boxes.get("newPassword") ?? "")
4296
+ });
4283
4297
  }
4284
- return /* @__PURE__ */ jsxs139("form", { className: styles20.form, onSubmit: submit, children: [
4285
- error ? /* @__PURE__ */ jsx163(Alert, { variant: "error", children: error }) : null,
4286
- done ? /* @__PURE__ */ jsx163(Alert, { variant: "success", children: "Your password is changed. You were signed out everywhere else." }) : null,
4287
- /* @__PURE__ */ jsx163(FormField, { label: "Current password", required: true, children: (field) => /* @__PURE__ */ jsx163(
4288
- Input,
4289
- {
4290
- ...field,
4291
- type: "password",
4292
- name: "currentPassword",
4293
- autoComplete: "current-password",
4294
- value: current2,
4295
- onChange: (event) => setCurrent(event.target.value)
4296
- }
4297
- ) }),
4298
- /* @__PURE__ */ jsx163(FormField, { label: "New password", required: true, children: (field) => /* @__PURE__ */ jsx163(
4299
- Input,
4300
- {
4301
- ...field,
4302
- type: "password",
4303
- name: "newPassword",
4304
- autoComplete: "new-password",
4305
- value: next,
4306
- onChange: (event) => setNext(event.target.value)
4307
- }
4308
- ) }),
4309
- /* @__PURE__ */ jsx163("div", { className: styles20.row, children: /* @__PURE__ */ jsx163(Button, { type: "submit", loading: pending, children: pending ? "Saving\u2026" : "Change password" }) })
4310
- ] });
4298
+ return (
4299
+ // POST, should a script of someone else's send it: nothing of it goes in the address.
4300
+ /* @__PURE__ */ jsxs139("form", { ref: form, className: styles20.form, method: "post", onSubmit: submit, children: [
4301
+ error ? /* @__PURE__ */ jsx163(Alert, { variant: "error", children: error }) : null,
4302
+ done ? /* @__PURE__ */ jsx163(Alert, { variant: "success", children: "Your password is changed. You were signed out everywhere else." }) : null,
4303
+ /* @__PURE__ */ jsx163(FormField, { label: "Current password", required: true, children: (field) => /* @__PURE__ */ jsx163(
4304
+ Input,
4305
+ {
4306
+ ...field,
4307
+ type: "password",
4308
+ name: "currentPassword",
4309
+ autoComplete: "current-password"
4310
+ }
4311
+ ) }),
4312
+ /* @__PURE__ */ jsx163(FormField, { label: "New password", required: true, children: (field) => /* @__PURE__ */ jsx163(Input, { ...field, type: "password", name: "newPassword", autoComplete: "new-password" }) }),
4313
+ /* @__PURE__ */ jsx163("div", { className: styles20.row, children: /* @__PURE__ */ jsx163(Button, { type: "submit", loading: pending, disabled: !hydrated, children: pending ? "Saving\u2026" : "Change password" }) })
4314
+ ] })
4315
+ );
4311
4316
  }
4312
4317
 
4313
4318
  // src/components/Account/LinkSovereignPanel.tsx
4314
- import { useState as useState7 } from "react";
4315
4319
  import styles21 from "./Account.module.css";
4316
4320
  import { jsx as jsx164, jsxs as jsxs140 } from "react/jsx-runtime";
4317
4321
  var OUTCOMES = {
@@ -4336,10 +4340,10 @@ function LinkSovereignPanel({
4336
4340
  pending = false,
4337
4341
  onSubmit
4338
4342
  }) {
4339
- const [password, setPassword] = useState7("");
4343
+ const hydrated = useHydrated();
4340
4344
  function submit(event) {
4341
4345
  event.preventDefault();
4342
- onSubmit({ password });
4346
+ onSubmit({ password: String(new FormData(event.currentTarget).get("password") ?? "") });
4343
4347
  }
4344
4348
  const said = outcome ? OUTCOMES[outcome] : void 0;
4345
4349
  if (linked)
@@ -4351,7 +4355,7 @@ function LinkSovereignPanel({
4351
4355
  " too."
4352
4356
  ] })
4353
4357
  ] });
4354
- return /* @__PURE__ */ jsxs140("form", { className: styles21.form, onSubmit: submit, children: [
4358
+ return /* @__PURE__ */ jsxs140("form", { className: styles21.form, method: "post", onSubmit: submit, children: [
4355
4359
  said ? /* @__PURE__ */ jsx164(Alert, { variant: said.variant, children: said.text(instanceName) }) : null,
4356
4360
  error ? /* @__PURE__ */ jsx164(Alert, { variant: "error", children: error }) : null,
4357
4361
  /* @__PURE__ */ jsxs140("p", { children: [
@@ -4362,23 +4366,13 @@ function LinkSovereignPanel({
4362
4366
  " ",
4363
4367
  "asks you to sign in; that account is then linked to this one."
4364
4368
  ] }),
4365
- /* @__PURE__ */ jsx164(FormField, { label: "Password", required: true, children: (field) => /* @__PURE__ */ jsx164(
4366
- Input,
4367
- {
4368
- ...field,
4369
- type: "password",
4370
- name: "password",
4371
- autoComplete: "current-password",
4372
- value: password,
4373
- onChange: (event) => setPassword(event.target.value)
4374
- }
4375
- ) }),
4376
- /* @__PURE__ */ jsx164("div", { className: styles21.row, children: /* @__PURE__ */ jsx164(Button, { type: "submit", loading: pending, children: pending ? "Opening\u2026" : `Link to ${instanceName}` }) })
4369
+ /* @__PURE__ */ jsx164(FormField, { label: "Password", required: true, children: (field) => /* @__PURE__ */ jsx164(Input, { ...field, type: "password", name: "password", autoComplete: "current-password" }) }),
4370
+ /* @__PURE__ */ jsx164("div", { className: styles21.row, children: /* @__PURE__ */ jsx164(Button, { type: "submit", loading: pending, disabled: !hydrated, children: pending ? "Opening\u2026" : `Link to ${instanceName}` }) })
4377
4371
  ] });
4378
4372
  }
4379
4373
 
4380
4374
  // src/components/Account/TwoFactorPanel.tsx
4381
- import { useState as useState8 } from "react";
4375
+ import { useState as useState5 } from "react";
4382
4376
  import styles22 from "./Account.module.css";
4383
4377
  import { jsx as jsx165, jsxs as jsxs141 } from "react/jsx-runtime";
4384
4378
  function TwoFactorPanel({
@@ -4389,7 +4383,7 @@ function TwoFactorPanel({
4389
4383
  renderQr,
4390
4384
  onDone
4391
4385
  }) {
4392
- const [stage, setStage] = useState8({ kind: "idle" });
4386
+ const [stage, setStage] = useState5({ kind: "idle" });
4393
4387
  if (stage.kind === "password") {
4394
4388
  return /* @__PURE__ */ jsx165(
4395
4389
  PasswordStep,
@@ -4475,12 +4469,12 @@ function PasswordStep({
4475
4469
  onCodes,
4476
4470
  onOff
4477
4471
  }) {
4478
- const [password, setPassword] = useState8("");
4479
- const [error, setError] = useState8();
4480
- const [pending, setPending] = useState8(false);
4472
+ const [error, setError] = useState5();
4473
+ const [pending, setPending] = useState5(false);
4481
4474
  const text = TITLES[action];
4482
4475
  async function onSubmit(event) {
4483
4476
  event.preventDefault();
4477
+ const password = String(new FormData(event.currentTarget).get("password") ?? "");
4484
4478
  setPending(true);
4485
4479
  setError(void 0);
4486
4480
  const result = await start(action, password);
@@ -4490,25 +4484,18 @@ function PasswordStep({
4490
4484
  if ("uri" in result) return onEnrolment(result.uri, result.codes);
4491
4485
  return onCodes(result.codes);
4492
4486
  }
4493
- return /* @__PURE__ */ jsxs141("form", { className: styles22.form, onSubmit: (event) => void onSubmit(event), children: [
4494
- /* @__PURE__ */ jsx165("h2", { className: styles22.heading, children: text.heading }),
4495
- error ? /* @__PURE__ */ jsx165(Alert, { variant: "error", children: error }) : null,
4496
- /* @__PURE__ */ jsx165(FormField, { label: "Password", hint: text.hint, required: true, children: (field) => /* @__PURE__ */ jsx165(
4497
- Input,
4498
- {
4499
- ...field,
4500
- type: "password",
4501
- name: "password",
4502
- autoComplete: "current-password",
4503
- value: password,
4504
- onChange: (event) => setPassword(event.target.value)
4505
- }
4506
- ) }),
4507
- /* @__PURE__ */ jsxs141("div", { className: styles22.row, children: [
4508
- /* @__PURE__ */ jsx165(Button, { type: "submit", loading: pending, children: pending ? text.pending : text.submit }),
4509
- /* @__PURE__ */ jsx165(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })
4487
+ return (
4488
+ // POST, should a script of someone else's send it: nothing of it goes in the address.
4489
+ /* @__PURE__ */ jsxs141("form", { className: styles22.form, method: "post", onSubmit: (event) => void onSubmit(event), children: [
4490
+ /* @__PURE__ */ jsx165("h2", { className: styles22.heading, children: text.heading }),
4491
+ error ? /* @__PURE__ */ jsx165(Alert, { variant: "error", children: error }) : null,
4492
+ /* @__PURE__ */ jsx165(FormField, { label: "Password", hint: text.hint, required: true, children: (field) => /* @__PURE__ */ jsx165(Input, { ...field, type: "password", name: "password", autoComplete: "current-password" }) }),
4493
+ /* @__PURE__ */ jsxs141("div", { className: styles22.row, children: [
4494
+ /* @__PURE__ */ jsx165(Button, { type: "submit", loading: pending, children: pending ? text.pending : text.submit }),
4495
+ /* @__PURE__ */ jsx165(Button, { type: "button", variant: "ghost", onClick: onCancel, children: "Cancel" })
4496
+ ] })
4510
4497
  ] })
4511
- ] });
4498
+ );
4512
4499
  }
4513
4500
  function ConfirmStep({
4514
4501
  uri,
@@ -4517,9 +4504,9 @@ function ConfirmStep({
4517
4504
  onCancel,
4518
4505
  onConfirmed
4519
4506
  }) {
4520
- const [code, setCode] = useState8("");
4521
- const [error, setError] = useState8();
4522
- const [pending, setPending] = useState8(false);
4507
+ const [code, setCode] = useState5("");
4508
+ const [error, setError] = useState5();
4509
+ const [pending, setPending] = useState5(false);
4523
4510
  const key = keyOf(uri);
4524
4511
  async function onSubmit(event) {
4525
4512
  event.preventDefault();
@@ -4581,7 +4568,7 @@ function keyOf(uri) {
4581
4568
  }
4582
4569
 
4583
4570
  // src/components/Account/ProfilePanel.tsx
4584
- import { useRef as useRef2, useState as useState9 } from "react";
4571
+ import { useRef as useRef3, useState as useState6 } from "react";
4585
4572
  import styles23 from "./Account.module.css";
4586
4573
  import { jsx as jsx166, jsxs as jsxs142 } from "react/jsx-runtime";
4587
4574
  var notAPicture = () => "That picture could not be read. Use a PNG, JPEG or WebP picture.";
@@ -4614,10 +4601,10 @@ function ProfilePanel({
4614
4601
  ] });
4615
4602
  }
4616
4603
  function NameSection({ initial, save }) {
4617
- const [name, setName] = useState9(initial);
4618
- const [error, setError] = useState9();
4619
- const [saved, setSaved] = useState9(false);
4620
- const [pending, setPending] = useState9(false);
4604
+ const [name, setName] = useState6(initial);
4605
+ const [error, setError] = useState6();
4606
+ const [saved, setSaved] = useState6(false);
4607
+ const [pending, setPending] = useState6(false);
4621
4608
  async function onSubmit(event) {
4622
4609
  event.preventDefault();
4623
4610
  setPending(true);
@@ -4658,11 +4645,11 @@ function PictureSection({
4658
4645
  describe,
4659
4646
  save
4660
4647
  }) {
4661
- const [current2, setCurrent] = useState9(image);
4662
- const [chosen, setChosen] = useState9();
4663
- const [error, setError] = useState9();
4664
- const [pending, setPending] = useState9(false);
4665
- const picker = useRef2(null);
4648
+ const [current2, setCurrent] = useState6(image);
4649
+ const [chosen, setChosen] = useState6();
4650
+ const [error, setError] = useState6();
4651
+ const [pending, setPending] = useState6(false);
4652
+ const picker = useRef3(null);
4666
4653
  function forget() {
4667
4654
  if (chosen) URL.revokeObjectURL(chosen.preview);
4668
4655
  setChosen(void 0);
@@ -5161,14 +5148,14 @@ function SystemBanner({ variant = "info", onDismiss, children }) {
5161
5148
 
5162
5149
  // src/components/Popover/Popover.tsx
5163
5150
  import {
5164
- useEffect as useEffect2,
5151
+ useEffect as useEffect3,
5165
5152
  useLayoutEffect,
5166
- useRef as useRef4,
5167
- useState as useState11
5153
+ useRef as useRef5,
5154
+ useState as useState8
5168
5155
  } from "react";
5169
5156
 
5170
5157
  // src/overlay-shell.ts
5171
- import { useEffect, useRef as useRef3, useState as useState10 } from "react";
5158
+ import { useEffect as useEffect2, useRef as useRef4, useState as useState7 } from "react";
5172
5159
 
5173
5160
  // src/scroll-lock.ts
5174
5161
  function lockBodyScroll() {
@@ -5200,22 +5187,22 @@ function isTopmostOpenOverlay(id) {
5200
5187
  }
5201
5188
  var SHELL_ROOT_ID = "sv-app-shell";
5202
5189
  function useOverlayPortalTarget() {
5203
- const [target, setTarget] = useState10(null);
5204
- useEffect(() => {
5190
+ const [target, setTarget] = useState7(null);
5191
+ useEffect2(() => {
5205
5192
  setTarget(document.getElementById(SHELL_ROOT_ID) ?? document.body);
5206
5193
  }, []);
5207
5194
  return target;
5208
5195
  }
5209
5196
  function useOverlayScrollLock(mounted) {
5210
- useEffect(() => {
5197
+ useEffect2(() => {
5211
5198
  if (!mounted) return;
5212
5199
  lockBodyScroll();
5213
5200
  return unlockBodyScroll;
5214
5201
  }, [mounted]);
5215
5202
  }
5216
5203
  function useOverlayFocusCapture(panelRef, active) {
5217
- const previouslyFocused = useRef3(null);
5218
- useEffect(() => {
5204
+ const previouslyFocused = useRef4(null);
5205
+ useEffect2(() => {
5219
5206
  if (!active) return;
5220
5207
  previouslyFocused.current = document.activeElement;
5221
5208
  const panel = panelRef.current;
@@ -5225,8 +5212,8 @@ function useOverlayFocusCapture(panelRef, active) {
5225
5212
  }, [active, panelRef]);
5226
5213
  }
5227
5214
  function useOverlayKeyboardTrap(panelRef, open, onClose) {
5228
- const overlayIdRef = useRef3(null);
5229
- useEffect(() => {
5215
+ const overlayIdRef = useRef4(null);
5216
+ useEffect2(() => {
5230
5217
  if (!open) return;
5231
5218
  const id = registerOpenOverlay();
5232
5219
  overlayIdRef.current = id;
@@ -5235,7 +5222,7 @@ function useOverlayKeyboardTrap(panelRef, open, onClose) {
5235
5222
  overlayIdRef.current = null;
5236
5223
  };
5237
5224
  }, [open]);
5238
- useEffect(() => {
5225
+ useEffect2(() => {
5239
5226
  if (!open) return;
5240
5227
  function handleKeyDown(e) {
5241
5228
  if (e.key === "Escape") {
@@ -5274,6 +5261,18 @@ import styles34 from "./Popover.module.css";
5274
5261
  import { jsx as jsx177, jsxs as jsxs148 } from "react/jsx-runtime";
5275
5262
  var TRIGGER_GAP = 8;
5276
5263
  var VIEWPORT_MARGIN = 4;
5264
+ function visibleSpan(element) {
5265
+ let left = 0;
5266
+ let right = window.innerWidth;
5267
+ for (let ancestor = element.parentElement; ancestor && ancestor !== document.documentElement; ancestor = ancestor.parentElement) {
5268
+ const overflow = window.getComputedStyle(ancestor).overflowX;
5269
+ if (overflow === "visible" || overflow === "") continue;
5270
+ const rect = ancestor.getBoundingClientRect();
5271
+ left = Math.max(left, rect.left);
5272
+ right = Math.min(right, rect.right);
5273
+ }
5274
+ return { left, right };
5275
+ }
5277
5276
  function Popover({
5278
5277
  trigger,
5279
5278
  open,
@@ -5285,14 +5284,16 @@ function Popover({
5285
5284
  "aria-label": ariaLabel,
5286
5285
  children
5287
5286
  }) {
5288
- const containerRef = useRef4(null);
5289
- const panelRef = useRef4(null);
5290
- const [triggerWidth, setTriggerWidth] = useState11(null);
5291
- const [openUpward, setOpenUpward] = useState11(false);
5292
- const [maxHeight, setMaxHeight] = useState11(null);
5293
- const [horizontalOffset, setHorizontalOffset] = useState11(null);
5294
- const overlayIdRef = useRef4(null);
5295
- useEffect2(() => {
5287
+ const containerRef = useRef5(null);
5288
+ const panelRef = useRef5(null);
5289
+ const [triggerWidth, setTriggerWidth] = useState8(null);
5290
+ const [openUpward, setOpenUpward] = useState8(false);
5291
+ const [maxHeight, setMaxHeight] = useState8(null);
5292
+ const [horizontalOffset, setHorizontalOffset] = useState8(null);
5293
+ const [autoSide, setAutoSide] = useState8("right");
5294
+ const side = align === "auto" ? autoSide : align;
5295
+ const overlayIdRef = useRef5(null);
5296
+ useEffect3(() => {
5296
5297
  if (!open) return;
5297
5298
  const id = registerOpenOverlay();
5298
5299
  overlayIdRef.current = id;
@@ -5301,7 +5302,7 @@ function Popover({
5301
5302
  overlayIdRef.current = null;
5302
5303
  };
5303
5304
  }, [open]);
5304
- useEffect2(() => {
5305
+ useEffect3(() => {
5305
5306
  if (width !== "trigger") return;
5306
5307
  const el = containerRef.current?.firstElementChild;
5307
5308
  if (!el) return;
@@ -5318,6 +5319,7 @@ function Popover({
5318
5319
  setOpenUpward(false);
5319
5320
  setMaxHeight(null);
5320
5321
  setHorizontalOffset(null);
5322
+ setAutoSide("right");
5321
5323
  return;
5322
5324
  }
5323
5325
  const container = containerRef.current;
@@ -5343,14 +5345,24 @@ function Popover({
5343
5345
  setMaxHeight(panelHeight > available ? Math.max(available, 0) : null);
5344
5346
  const containerRect = container.getBoundingClientRect();
5345
5347
  const panelWidth = panel.getBoundingClientRect().width;
5346
- const naturalLeft = align === "right" ? containerRect.right - panelWidth : containerRect.left;
5348
+ let chosen = align === "left" ? "left" : "right";
5349
+ if (align === "auto" && panelWidth > 0) {
5350
+ const visible = visibleSpan(container);
5351
+ const fitsRight = containerRect.right - panelWidth >= visible.left + VIEWPORT_MARGIN;
5352
+ const fitsLeft = containerRect.left + panelWidth <= visible.right - VIEWPORT_MARGIN;
5353
+ const roomRight = containerRect.right - visible.left;
5354
+ const roomLeft = visible.right - containerRect.left;
5355
+ chosen = !fitsRight && (fitsLeft || roomLeft > roomRight) ? "left" : "right";
5356
+ setAutoSide(chosen);
5357
+ }
5358
+ const naturalLeft = chosen === "right" ? containerRect.right - panelWidth : containerRect.left;
5347
5359
  const clampedLeft = Math.min(
5348
5360
  Math.max(naturalLeft, VIEWPORT_MARGIN),
5349
5361
  window.innerWidth - VIEWPORT_MARGIN - panelWidth
5350
5362
  );
5351
5363
  setHorizontalOffset(clampedLeft !== naturalLeft ? clampedLeft - containerRect.left : null);
5352
5364
  }, [open, children, align]);
5353
- useEffect2(() => {
5365
+ useEffect3(() => {
5354
5366
  if (!open) return;
5355
5367
  function handleMouseDown(e) {
5356
5368
  if (!containerRef.current?.contains(e.target)) {
@@ -5360,7 +5372,7 @@ function Popover({
5360
5372
  document.addEventListener("mousedown", handleMouseDown);
5361
5373
  return () => document.removeEventListener("mousedown", handleMouseDown);
5362
5374
  }, [open, onClose]);
5363
- useEffect2(() => {
5375
+ useEffect3(() => {
5364
5376
  if (!open) return;
5365
5377
  function handleKeyDown(e) {
5366
5378
  if (e.key !== "Escape") return;
@@ -5380,7 +5392,7 @@ function Popover({
5380
5392
  role: "dialog",
5381
5393
  "aria-label": ariaLabel,
5382
5394
  "aria-modal": false,
5383
- className: [styles34.panel, styles34[align], openUpward ? styles34.upward : ""].filter(Boolean).join(" "),
5395
+ className: [styles34.panel, styles34[side], openUpward ? styles34.upward : ""].filter(Boolean).join(" "),
5384
5396
  style: {
5385
5397
  width: width === "trigger" ? triggerWidth ?? void 0 : width,
5386
5398
  maxHeight: maxHeight ?? void 0,
@@ -5394,11 +5406,11 @@ function Popover({
5394
5406
  }
5395
5407
 
5396
5408
  // src/components/Textarea/Textarea.tsx
5397
- import { useLayoutEffect as useLayoutEffect2, useRef as useRef5 } from "react";
5409
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
5398
5410
  import styles35 from "./Textarea.module.css";
5399
5411
  import { jsx as jsx178 } from "react/jsx-runtime";
5400
5412
  function Textarea({ className, rows = 4, autoGrow = false, ...rest }) {
5401
- const ref = useRef5(null);
5413
+ const ref = useRef6(null);
5402
5414
  useLayoutEffect2(() => {
5403
5415
  const el = ref.current;
5404
5416
  if (!autoGrow || !el) return;
@@ -5479,7 +5491,7 @@ function StatusBadge({
5479
5491
  }
5480
5492
 
5481
5493
  // src/components/SplitPane/SplitPane.tsx
5482
- import { useCallback, useEffect as useEffect3, useRef as useRef6, useState as useState12 } from "react";
5494
+ import { useCallback, useEffect as useEffect4, useRef as useRef7, useState as useState9 } from "react";
5483
5495
  import styles38 from "./SplitPane.module.css";
5484
5496
  import { jsx as jsx181, jsxs as jsxs150 } from "react/jsx-runtime";
5485
5497
  var clampSize = (value, min, max) => Math.min(Math.max(value, min), max);
@@ -5496,9 +5508,9 @@ function SplitPane({
5496
5508
  className
5497
5509
  }) {
5498
5510
  const initialSize = clampSize(defaultPrimarySize, minPrimarySize, maxPrimarySize);
5499
- const [primarySize, setPrimarySize] = useState12(initialSize);
5500
- const containerRef = useRef6(null);
5501
- const dragState = useRef6(null);
5511
+ const [primarySize, setPrimarySize] = useState9(initialSize);
5512
+ const containerRef = useRef7(null);
5513
+ const dragState = useRef7(null);
5502
5514
  const updateFromClientX = useCallback(
5503
5515
  (clientX) => {
5504
5516
  const rect = containerRef.current?.getBoundingClientRect();
@@ -5510,7 +5522,7 @@ function SplitPane({
5510
5522
  },
5511
5523
  [maxPrimarySize, minPrimarySize]
5512
5524
  );
5513
- useEffect3(() => {
5525
+ useEffect4(() => {
5514
5526
  const handlePointerMove = (event) => {
5515
5527
  if (!dragState.current || event.pointerId !== dragState.current.pointerId) {
5516
5528
  return;
@@ -5592,7 +5604,7 @@ function SplitPane({
5592
5604
  }
5593
5605
 
5594
5606
  // src/components/TagInput/TagInput.tsx
5595
- import { useMemo, useState as useState13 } from "react";
5607
+ import { useMemo, useState as useState10 } from "react";
5596
5608
  import styles39 from "./TagInput.module.css";
5597
5609
  import { jsx as jsx182, jsxs as jsxs151 } from "react/jsx-runtime";
5598
5610
  var DEFAULT_SEPARATORS = /[\n,]+/;
@@ -5614,8 +5626,8 @@ function TagInput({
5614
5626
  "aria-invalid": ariaInvalid,
5615
5627
  "aria-label": ariaLabel
5616
5628
  }) {
5617
- const [draft, setDraft] = useState13("");
5618
- const [localError, setLocalError] = useState13();
5629
+ const [draft, setDraft] = useState10("");
5630
+ const [localError, setLocalError] = useState10();
5619
5631
  const message = error ?? localError ?? hint;
5620
5632
  const messageId = message && id ? `${id}-tag-message` : void 0;
5621
5633
  const describedBy = [ariaDescribedBy, messageId].filter(Boolean).join(" ") || void 0;
@@ -5727,7 +5739,7 @@ function TagInput({
5727
5739
  }
5728
5740
 
5729
5741
  // src/components/Dialog/Dialog.tsx
5730
- import { createContext, useContext, useEffect as useEffect4, useRef as useRef7, useState as useState14 } from "react";
5742
+ import { createContext, useContext, useEffect as useEffect5, useRef as useRef8, useState as useState11 } from "react";
5731
5743
  import { createPortal } from "react-dom";
5732
5744
 
5733
5745
  // src/components/OverlayHeader/OverlayHeader.tsx
@@ -5762,7 +5774,7 @@ var OverlaySecondRowContext = createContext(
5762
5774
  );
5763
5775
  function useOverlaySecondRow(node) {
5764
5776
  const setSecondRow = useContext(OverlaySecondRowContext);
5765
- useEffect4(() => {
5777
+ useEffect5(() => {
5766
5778
  if (!setSecondRow) return;
5767
5779
  setSecondRow(node);
5768
5780
  return () => setSecondRow(null);
@@ -5782,13 +5794,13 @@ function Dialog({
5782
5794
  flush = false,
5783
5795
  children
5784
5796
  }) {
5785
- const panelRef = useRef7(null);
5797
+ const panelRef = useRef8(null);
5786
5798
  const reducedMotion = usePrefersReducedMotion();
5787
5799
  const { mounted, phase } = useMountTransition(
5788
5800
  open,
5789
5801
  reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
5790
5802
  );
5791
- const [secondRow, setSecondRow] = useState14(null);
5803
+ const [secondRow, setSecondRow] = useState11(null);
5792
5804
  const portalTarget = useOverlayPortalTarget();
5793
5805
  useOverlayScrollLock(mounted);
5794
5806
  useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
@@ -5865,7 +5877,7 @@ function Dialog({
5865
5877
  }
5866
5878
 
5867
5879
  // src/components/Drawer/Drawer.tsx
5868
- import { useRef as useRef8 } from "react";
5880
+ import { useRef as useRef9 } from "react";
5869
5881
  import { createPortal as createPortal2 } from "react-dom";
5870
5882
  import styles42 from "./Drawer.module.css";
5871
5883
  import { jsx as jsx185, jsxs as jsxs154 } from "react/jsx-runtime";
@@ -5878,13 +5890,13 @@ function Drawer({
5878
5890
  title,
5879
5891
  children
5880
5892
  }) {
5881
- const panelRef = useRef8(null);
5893
+ const panelRef = useRef9(null);
5882
5894
  const reducedMotion = usePrefersReducedMotion();
5883
5895
  const { mounted, phase } = useMountTransition(
5884
5896
  open,
5885
5897
  reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
5886
5898
  );
5887
- const dragStartY = useRef8(null);
5899
+ const dragStartY = useRef9(null);
5888
5900
  const portalTarget = useOverlayPortalTarget();
5889
5901
  useOverlayScrollLock(mounted);
5890
5902
  useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
@@ -5967,7 +5979,7 @@ function Drawer({
5967
5979
  }
5968
5980
 
5969
5981
  // src/components/Sheet/Sheet.tsx
5970
- import { useRef as useRef9 } from "react";
5982
+ import { useRef as useRef10 } from "react";
5971
5983
  import { createPortal as createPortal3 } from "react-dom";
5972
5984
  import styles43 from "./Sheet.module.css";
5973
5985
  import { jsx as jsx186, jsxs as jsxs155 } from "react/jsx-runtime";
@@ -5981,7 +5993,7 @@ function Sheet({
5981
5993
  slideFrom = "bottom",
5982
5994
  children
5983
5995
  }) {
5984
- const panelRef = useRef9(null);
5996
+ const panelRef = useRef10(null);
5985
5997
  const reducedMotion = usePrefersReducedMotion();
5986
5998
  const { mounted, phase } = useMountTransition(
5987
5999
  open,
@@ -6017,7 +6029,7 @@ function Sheet({
6017
6029
  }
6018
6030
 
6019
6031
  // src/components/ConfirmDialog/ConfirmDialog.tsx
6020
- import { useEffect as useEffect5, useRef as useRef10 } from "react";
6032
+ import { useEffect as useEffect6, useRef as useRef11 } from "react";
6021
6033
  import styles44 from "./ConfirmDialog.module.css";
6022
6034
  import { jsx as jsx187, jsxs as jsxs156 } from "react/jsx-runtime";
6023
6035
  function ConfirmDialog({
@@ -6032,19 +6044,19 @@ function ConfirmDialog({
6032
6044
  pending = false,
6033
6045
  error
6034
6046
  }) {
6035
- const dialogRef = useRef10(null);
6036
- useEffect5(() => {
6047
+ const dialogRef = useRef11(null);
6048
+ useEffect6(() => {
6037
6049
  if (!open) return;
6038
6050
  const id = registerOpenOverlay();
6039
6051
  return () => unregisterOpenOverlay(id);
6040
6052
  }, [open]);
6041
- useEffect5(() => {
6053
+ useEffect6(() => {
6042
6054
  const el = dialogRef.current;
6043
6055
  if (!el) return;
6044
6056
  if (open) el.showModal();
6045
6057
  else el.close();
6046
6058
  }, [open]);
6047
- useEffect5(() => {
6059
+ useEffect6(() => {
6048
6060
  const el = dialogRef.current;
6049
6061
  if (!el) return;
6050
6062
  const handleClose = () => onClose();
@@ -6104,7 +6116,7 @@ function ConfirmDialog({
6104
6116
  }
6105
6117
 
6106
6118
  // src/components/ExportPanel/ExportPanel.tsx
6107
- import { startTransition, useActionState as useActionState2, useEffect as useEffect6, useState as useState15 } from "react";
6119
+ import { startTransition, useActionState as useActionState2, useEffect as useEffect7, useRef as useRef12, useState as useState12 } from "react";
6108
6120
  import styles45 from "./ExportPanel.module.css";
6109
6121
  import { jsx as jsx188, jsxs as jsxs157 } from "react/jsx-runtime";
6110
6122
  function size(bytes) {
@@ -6134,8 +6146,8 @@ function ExportPanel({
6134
6146
  passwordHint = "We ask again because the export holds everything listed above.",
6135
6147
  timeZone = "UTC"
6136
6148
  }) {
6137
- const [password, setPassword] = useState15("");
6138
- const [open, setOpen] = useState15(false);
6149
+ const box = useRef12(null);
6150
+ const [open, setOpen] = useState12(false);
6139
6151
  const [state, start, pending] = useActionState2(
6140
6152
  async (_previous, typed) => {
6141
6153
  let result;
@@ -6149,14 +6161,14 @@ function ExportPanel({
6149
6161
  }
6150
6162
  if (result.ok) {
6151
6163
  setOpen(false);
6152
- setPassword("");
6164
+ if (box.current) box.current.value = "";
6153
6165
  onRefresh?.();
6154
6166
  }
6155
6167
  return result;
6156
6168
  },
6157
6169
  null
6158
6170
  );
6159
- useEffect6(() => {
6171
+ useEffect7(() => {
6160
6172
  if (status.state !== "making" || !onRefresh) return void 0;
6161
6173
  const timer = setInterval(onRefresh, 5e3);
6162
6174
  return () => clearInterval(timer);
@@ -6202,7 +6214,7 @@ function ExportPanel({
6202
6214
  className: styles45.form,
6203
6215
  onSubmit: (event) => {
6204
6216
  event.preventDefault();
6205
- if (password !== "" && !disabled) setOpen(true);
6217
+ if (box.current?.value && !disabled) setOpen(true);
6206
6218
  },
6207
6219
  children: [
6208
6220
  disabledReason ? /* @__PURE__ */ jsx188("p", { className: styles45.hint, children: disabledReason }) : null,
@@ -6213,11 +6225,10 @@ function ExportPanel({
6213
6225
  type: "password",
6214
6226
  autoComplete: "current-password",
6215
6227
  disabled,
6216
- value: password,
6217
- onChange: (event) => setPassword(event.target.value)
6228
+ ref: box
6218
6229
  }
6219
6230
  ) }),
6220
- /* @__PURE__ */ jsx188("div", { children: /* @__PURE__ */ jsx188(Button, { type: "submit", disabled: password === "" || disabled, children: startLabel }) }),
6231
+ /* @__PURE__ */ jsx188("div", { children: /* @__PURE__ */ jsx188(Button, { type: "submit", disabled, children: startLabel }) }),
6221
6232
  state && !state.ok && !open ? /* @__PURE__ */ jsx188(Alert, { variant: "error", children: state.error }) : null,
6222
6233
  /* @__PURE__ */ jsx188(
6223
6234
  ConfirmDialog,
@@ -6229,7 +6240,10 @@ function ExportPanel({
6229
6240
  confirmLabel: pending ? "Starting\u2026" : startLabel,
6230
6241
  pending,
6231
6242
  error: state && !state.ok ? state.error : void 0,
6232
- onConfirm: () => startTransition(() => start(password))
6243
+ onConfirm: () => {
6244
+ const typed = box.current?.value ?? "";
6245
+ startTransition(() => start(typed));
6246
+ }
6233
6247
  }
6234
6248
  )
6235
6249
  ]
@@ -6239,13 +6253,13 @@ function ExportPanel({
6239
6253
  }
6240
6254
 
6241
6255
  // src/hooks/useLongPress.ts
6242
- import { useCallback as useCallback2, useEffect as useEffect7, useRef as useRef11, useState as useState16 } from "react";
6256
+ import { useCallback as useCallback2, useEffect as useEffect8, useRef as useRef13, useState as useState13 } from "react";
6243
6257
  var DEFAULT_DELAY_MS = 500;
6244
6258
  var DEFAULT_MOVE_TOLERANCE_PX = 10;
6245
6259
  var DEFAULT_SUPPRESS_CLICK_MS = 700;
6246
6260
  function usePrefersCoarsePointer() {
6247
- const [coarse, setCoarse] = useState16(false);
6248
- useEffect7(() => {
6261
+ const [coarse, setCoarse] = useState13(false);
6262
+ useEffect8(() => {
6249
6263
  const mql = window.matchMedia("(pointer: coarse)");
6250
6264
  setCoarse(mql.matches);
6251
6265
  function handleChange(e) {
@@ -6264,16 +6278,16 @@ function useLongPress({
6264
6278
  vibrate = true,
6265
6279
  disabled = false
6266
6280
  }) {
6267
- const timerRef = useRef11(null);
6268
- const startRef = useRef11(null);
6269
- const suppressUntilRef = useRef11(0);
6281
+ const timerRef = useRef13(null);
6282
+ const startRef = useRef13(null);
6283
+ const suppressUntilRef = useRef13(0);
6270
6284
  const clearTimer = useCallback2(() => {
6271
6285
  if (timerRef.current) {
6272
6286
  clearTimeout(timerRef.current);
6273
6287
  timerRef.current = null;
6274
6288
  }
6275
6289
  }, []);
6276
- useEffect7(() => clearTimer, [clearTimer]);
6290
+ useEffect8(() => clearTimer, [clearTimer]);
6277
6291
  const onPointerDown = useCallback2(
6278
6292
  (e) => {
6279
6293
  if (disabled || e.pointerType !== "touch") return;
@@ -6333,10 +6347,10 @@ function useLongPress({
6333
6347
  }
6334
6348
 
6335
6349
  // src/hooks/useDoubleTap.ts
6336
- import { useRef as useRef12 } from "react";
6350
+ import { useRef as useRef14 } from "react";
6337
6351
  var DOUBLE_TAP_MS = 350;
6338
6352
  function useDoubleTapHandler(onDoubleTap) {
6339
- const lastTime = useRef12(0);
6353
+ const lastTime = useRef14(0);
6340
6354
  return (e) => {
6341
6355
  if (e.detail === 2) {
6342
6356
  onDoubleTap(e);
@@ -6352,7 +6366,7 @@ function useDoubleTapHandler(onDoubleTap) {
6352
6366
  };
6353
6367
  }
6354
6368
  function useSingleOrDoubleTap(onSingle, onDouble) {
6355
- const timer = useRef12(null);
6369
+ const timer = useRef14(null);
6356
6370
  return (e) => {
6357
6371
  if (e.detail === 2) {
6358
6372
  if (timer.current) {
@@ -6376,11 +6390,11 @@ function useSingleOrDoubleTap(onSingle, onDouble) {
6376
6390
  }
6377
6391
 
6378
6392
  // src/hooks/useIsMobile.ts
6379
- import { useEffect as useEffect8, useState as useState17 } from "react";
6393
+ import { useEffect as useEffect9, useState as useState14 } from "react";
6380
6394
  var MOBILE_BREAKPOINT_PX = 768;
6381
6395
  function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
6382
- const [isMobile, setIsMobile] = useState17(false);
6383
- useEffect8(() => {
6396
+ const [isMobile, setIsMobile] = useState14(false);
6397
+ useEffect9(() => {
6384
6398
  const mql = window.matchMedia(`(max-width: ${breakpointPx}px)`);
6385
6399
  setIsMobile(mql.matches);
6386
6400
  function handleChange(e) {
@@ -6393,10 +6407,10 @@ function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
6393
6407
  }
6394
6408
 
6395
6409
  // src/hooks/useIsOffline.ts
6396
- import { useEffect as useEffect9, useState as useState18 } from "react";
6410
+ import { useEffect as useEffect10, useState as useState15 } from "react";
6397
6411
  function useIsOffline() {
6398
- const [isOffline, setIsOffline] = useState18(false);
6399
- useEffect9(() => {
6412
+ const [isOffline, setIsOffline] = useState15(false);
6413
+ useEffect10(() => {
6400
6414
  setIsOffline(!navigator.onLine);
6401
6415
  const handleOffline = () => setIsOffline(true);
6402
6416
  const handleOnline = () => setIsOffline(false);
@@ -6429,7 +6443,7 @@ function useCommitOnEnterOrBlur(onCommit) {
6429
6443
  }
6430
6444
 
6431
6445
  // src/hooks/useSwipeReveal.ts
6432
- import { useRef as useRef13 } from "react";
6446
+ import { useRef as useRef15 } from "react";
6433
6447
  function useSwipeReveal({
6434
6448
  revealWidth,
6435
6449
  open,
@@ -6437,8 +6451,8 @@ function useSwipeReveal({
6437
6451
  onClose,
6438
6452
  disabled = false
6439
6453
  }) {
6440
- const rowRef = useRef13(null);
6441
- const dragState = useRef13(null);
6454
+ const rowRef = useRef15(null);
6455
+ const dragState = useRef15(null);
6442
6456
  function onPointerDown(e) {
6443
6457
  if (disabled) return;
6444
6458
  e.currentTarget.setPointerCapture(e.pointerId);
@@ -6482,23 +6496,23 @@ function useSwipeReveal({
6482
6496
  }
6483
6497
 
6484
6498
  // src/hooks/useSnapCarousel.ts
6485
- import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef14, useState as useState19 } from "react";
6499
+ import { useCallback as useCallback3, useEffect as useEffect11, useRef as useRef16, useState as useState16 } from "react";
6486
6500
  function useSnapCarousel({
6487
6501
  itemCount,
6488
6502
  onSettle,
6489
6503
  debounceMs = 120,
6490
6504
  initialIndex = 0
6491
6505
  }) {
6492
- const scrollRef = useRef14(null);
6493
- const timerRef = useRef14(null);
6494
- const lastIndexRef = useRef14(null);
6495
- const restoreSnapRef = useRef14(null);
6496
- const [liveIndex, setLiveIndex] = useState19(initialIndex);
6497
- const onSettleRef = useRef14(onSettle);
6506
+ const scrollRef = useRef16(null);
6507
+ const timerRef = useRef16(null);
6508
+ const lastIndexRef = useRef16(null);
6509
+ const restoreSnapRef = useRef16(null);
6510
+ const [liveIndex, setLiveIndex] = useState16(initialIndex);
6511
+ const onSettleRef = useRef16(onSettle);
6498
6512
  onSettleRef.current = onSettle;
6499
- const lastGestureAtRef = useRef14(0);
6500
- const chainTrustedRef = useRef14(false);
6501
- useEffect10(() => {
6513
+ const lastGestureAtRef = useRef16(0);
6514
+ const chainTrustedRef = useRef16(false);
6515
+ useEffect11(() => {
6502
6516
  const el = scrollRef.current;
6503
6517
  if (!el) return;
6504
6518
  function noteGesture() {
@@ -6602,23 +6616,23 @@ function useResponsiveLayout({
6602
6616
  }
6603
6617
 
6604
6618
  // src/hooks/useCarouselRouteSync.ts
6605
- import { useEffect as useEffect11, useRef as useRef15, useState as useState20 } from "react";
6619
+ import { useEffect as useEffect12, useRef as useRef17, useState as useState17 } from "react";
6606
6620
  function useCarouselRouteSync({
6607
6621
  indexForPathname,
6608
6622
  pathForIndex,
6609
6623
  pathname,
6610
6624
  onNavigate
6611
6625
  }) {
6612
- const indexForPathnameRef = useRef15(indexForPathname);
6626
+ const indexForPathnameRef = useRef17(indexForPathname);
6613
6627
  indexForPathnameRef.current = indexForPathname;
6614
- const pathForIndexRef = useRef15(pathForIndex);
6628
+ const pathForIndexRef = useRef17(pathForIndex);
6615
6629
  pathForIndexRef.current = pathForIndex;
6616
- const onNavigateRef = useRef15(onNavigate);
6630
+ const onNavigateRef = useRef17(onNavigate);
6617
6631
  onNavigateRef.current = onNavigate;
6618
- const [activeIndex, setActiveIndex] = useState20(() => indexForPathname(pathname));
6619
- const isInternalNavRef = useRef15(false);
6620
- const didMountRef = useRef15(false);
6621
- useEffect11(() => {
6632
+ const [activeIndex, setActiveIndex] = useState17(() => indexForPathname(pathname));
6633
+ const isInternalNavRef = useRef17(false);
6634
+ const didMountRef = useRef17(false);
6635
+ useEffect12(() => {
6622
6636
  if (!didMountRef.current) {
6623
6637
  didMountRef.current = true;
6624
6638
  return;
@@ -6689,7 +6703,7 @@ function useReorderSensors(options = {}) {
6689
6703
  }
6690
6704
 
6691
6705
  // src/hooks/useSwipeStack.ts
6692
- import { useRef as useRef16 } from "react";
6706
+ import { useRef as useRef18 } from "react";
6693
6707
  var DEADZONE_PX = 8;
6694
6708
  var ROTATION_RANGE_PX = 240;
6695
6709
  var ROTATION_MAX_DEG = 12;
@@ -6722,9 +6736,9 @@ function useSwipeStack({
6722
6736
  onCommit,
6723
6737
  disabled = false
6724
6738
  }) {
6725
- const cardRef = useRef16(null);
6726
- const wrapRef = useRef16(null);
6727
- const dragState = useRef16(null);
6739
+ const cardRef = useRef18(null);
6740
+ const wrapRef = useRef18(null);
6741
+ const dragState = useRef18(null);
6728
6742
  const live = new Set(directions);
6729
6743
  function writeProgress(direction, progress) {
6730
6744
  const wrap = wrapRef.current;
@@ -6900,7 +6914,7 @@ function Menu({
6900
6914
  }
6901
6915
 
6902
6916
  // src/components/UserMenu/UserMenu.tsx
6903
- import { useState as useState21 } from "react";
6917
+ import { useState as useState18 } from "react";
6904
6918
  import styles47 from "./UserMenu.module.css";
6905
6919
  import { jsx as jsx190, jsxs as jsxs159 } from "react/jsx-runtime";
6906
6920
  function initials(value) {
@@ -6918,7 +6932,7 @@ function UserMenu({
6918
6932
  align = "right",
6919
6933
  size: size2 = "md"
6920
6934
  }) {
6921
- const [open, setOpen] = useState21(false);
6935
+ const [open, setOpen] = useState18(false);
6922
6936
  const displayName = name || email || "";
6923
6937
  return /* @__PURE__ */ jsxs159(
6924
6938
  Popover,
@@ -6967,7 +6981,7 @@ function UserMenu({
6967
6981
  }
6968
6982
 
6969
6983
  // src/components/AppsLauncher/AppsLauncher.tsx
6970
- import { useState as useState22 } from "react";
6984
+ import { useState as useState19 } from "react";
6971
6985
 
6972
6986
  // src/components/Spinner/Spinner.tsx
6973
6987
  import styles48 from "./Spinner.module.css";
@@ -7018,7 +7032,7 @@ function AppsLauncher({
7018
7032
  "aria-label": ariaLabel = "Apps",
7019
7033
  align = "right"
7020
7034
  }) {
7021
- const [open, setOpen] = useState22(false);
7035
+ const [open, setOpen] = useState19(false);
7022
7036
  return /* @__PURE__ */ jsxs160(
7023
7037
  Popover,
7024
7038
  {
@@ -7048,7 +7062,7 @@ function AppsLauncher({
7048
7062
  }
7049
7063
 
7050
7064
  // src/components/NotificationsPanel/NotificationsPanel.tsx
7051
- import { useState as useState23 } from "react";
7065
+ import { useState as useState20 } from "react";
7052
7066
  import styles50 from "./NotificationsPanel.module.css";
7053
7067
  import { Fragment as Fragment10, jsx as jsx193, jsxs as jsxs161 } from "react/jsx-runtime";
7054
7068
  function NotificationRow({ item }) {
@@ -7093,7 +7107,7 @@ function NotificationsPanel({
7093
7107
  align = "right",
7094
7108
  viewAllHref
7095
7109
  }) {
7096
- const [open, setOpen] = useState23(false);
7110
+ const [open, setOpen] = useState20(false);
7097
7111
  return /* @__PURE__ */ jsxs161(
7098
7112
  Popover,
7099
7113
  {
@@ -7152,11 +7166,11 @@ import {
7152
7166
  createContext as createContext2,
7153
7167
  useCallback as useCallback4,
7154
7168
  useContext as useContext2,
7155
- useEffect as useEffect12,
7169
+ useEffect as useEffect13,
7156
7170
  useId as useId4,
7157
7171
  useMemo as useMemo2,
7158
- useRef as useRef17,
7159
- useState as useState24
7172
+ useRef as useRef19,
7173
+ useState as useState21
7160
7174
  } from "react";
7161
7175
  import styles51 from "./Toast.module.css";
7162
7176
  import { jsx as jsx194, jsxs as jsxs162 } from "react/jsx-runtime";
@@ -7167,10 +7181,10 @@ function useToast() {
7167
7181
  return ctx;
7168
7182
  }
7169
7183
  function ToastProvider({ children }) {
7170
- const [toasts, setToasts] = useState24([]);
7171
- const timers = useRef17(/* @__PURE__ */ new Map());
7184
+ const [toasts, setToasts] = useState21([]);
7185
+ const timers = useRef19(/* @__PURE__ */ new Map());
7172
7186
  const seedId = useId4();
7173
- const counter = useRef17(0);
7187
+ const counter = useRef19(0);
7174
7188
  const dismiss = useCallback4((id) => {
7175
7189
  setToasts((prev) => prev.map((t) => t.id === id ? { ...t, exiting: true } : t));
7176
7190
  setTimeout(() => {
@@ -7190,7 +7204,7 @@ function ToastProvider({ children }) {
7190
7204
  },
7191
7205
  [seedId, dismiss]
7192
7206
  );
7193
- useEffect12(() => {
7207
+ useEffect13(() => {
7194
7208
  const currentTimers = timers.current;
7195
7209
  return () => {
7196
7210
  currentTimers.forEach((t) => clearTimeout(t));
@@ -7551,7 +7565,7 @@ function Header({
7551
7565
  }
7552
7566
 
7553
7567
  // src/components/MobileHeader/MobileHeader.tsx
7554
- import { useRef as useRef18 } from "react";
7568
+ import { useRef as useRef20 } from "react";
7555
7569
 
7556
7570
  // src/hooks/usePublishShellChromeHeight.ts
7557
7571
  import { useLayoutEffect as useLayoutEffect3 } from "react";
@@ -7594,7 +7608,7 @@ function MobileHeader({
7594
7608
  className,
7595
7609
  ...rest
7596
7610
  }) {
7597
- const headerRef = useRef18(null);
7611
+ const headerRef = useRef20(null);
7598
7612
  usePublishShellChromeHeight(headerRef, "--sv-shell-header-height");
7599
7613
  const cls = [styles57.header, className].filter(Boolean).join(" ");
7600
7614
  return /* @__PURE__ */ jsxs167("div", { className: cls, ...rest, ref: headerRef, children: [
@@ -7610,7 +7624,7 @@ function MobileHeader({
7610
7624
  }
7611
7625
 
7612
7626
  // src/components/MobileFooter/MobileFooter.tsx
7613
- import { useRef as useRef19 } from "react";
7627
+ import { useRef as useRef21 } from "react";
7614
7628
  import styles58 from "./MobileFooter.module.css";
7615
7629
  import { jsx as jsx202, jsxs as jsxs168 } from "react/jsx-runtime";
7616
7630
  function FooterNavItem({ icon, label, href, onClick, active }) {
@@ -7644,7 +7658,7 @@ function MobileFooter({
7644
7658
  `MobileFooter: leftIcons (${leftIcons.length}) and rightIcons (${rightIcons.length}) must have the same length so the launcher stays visually centered.`
7645
7659
  );
7646
7660
  }
7647
- const navRef = useRef19(null);
7661
+ const navRef = useRef21(null);
7648
7662
  usePublishShellChromeHeight(navRef, "--sv-shell-footer-height");
7649
7663
  const cls = [styles58.footer, className].filter(Boolean).join(" ");
7650
7664
  const launcherClassName = [
@@ -7728,7 +7742,7 @@ function LockedState({ reason, appName, sharedBy, action, className }) {
7728
7742
  }
7729
7743
 
7730
7744
  // src/components/RecoveryKit/RecoveryKit.tsx
7731
- import { useState as useState25 } from "react";
7745
+ import { useState as useState22 } from "react";
7732
7746
 
7733
7747
  // src/components/Checkbox/Checkbox.tsx
7734
7748
  import styles61 from "./Checkbox.module.css";
@@ -7809,7 +7823,7 @@ function RecoveryKit({
7809
7823
  ownerCanRecover = false,
7810
7824
  className
7811
7825
  }) {
7812
- const [kept2, setKept] = useState25(false);
7826
+ const [kept2, setKept] = useState22(false);
7813
7827
  const groups = kit.split(/[\s-]+/).filter(Boolean);
7814
7828
  const save = () => {
7815
7829
  const url = URL.createObjectURL(
@@ -7896,7 +7910,7 @@ function OfflineGate({ children, surfaceName, className }) {
7896
7910
  }
7897
7911
 
7898
7912
  // src/components/InstallPrompt/InstallPrompt.tsx
7899
- import { useCallback as useCallback5, useEffect as useEffect13, useState as useState26 } from "react";
7913
+ import { useCallback as useCallback5, useEffect as useEffect14, useState as useState23 } from "react";
7900
7914
  import styles63 from "./InstallPrompt.module.css";
7901
7915
  import { jsx as jsx209, jsxs as jsxs173 } from "react/jsx-runtime";
7902
7916
  var IOS_INSTALL_STEPS = "tap Share, then Add to Home Screen.";
@@ -7948,9 +7962,9 @@ function writeDismissed(key) {
7948
7962
  }
7949
7963
  }
7950
7964
  function useInstallPrompt(storageKey = "sv-install-dismissed") {
7951
- const [kind, setKind] = useState26(null);
7952
- const [deferred, setDeferred] = useState26(null);
7953
- useEffect13(() => {
7965
+ const [kind, setKind] = useState23(null);
7966
+ const [deferred, setDeferred] = useState23(null);
7967
+ useEffect14(() => {
7954
7968
  if (isInstalledDisplay() || readDismissed(storageKey)) return;
7955
7969
  if (isAppleMobile()) setKind("ios");
7956
7970
  const offered = (event) => {
@@ -8420,7 +8434,7 @@ function Barcode({
8420
8434
  }
8421
8435
 
8422
8436
  // src/components/AppFrame/AppFrame.tsx
8423
- import { useRef as useRef20, useState as useState28 } from "react";
8437
+ import { useRef as useRef22, useState as useState25 } from "react";
8424
8438
 
8425
8439
  // src/components/AppSidebar/AppSidebar.tsx
8426
8440
  import styles67 from "./AppSidebar.module.css";
@@ -8606,7 +8620,7 @@ function ActionRow({
8606
8620
  }
8607
8621
 
8608
8622
  // src/components/AppSidebar/useAppSidebar.ts
8609
- import { useCallback as useCallback6, useEffect as useEffect14, useState as useState27 } from "react";
8623
+ import { useCallback as useCallback6, useEffect as useEffect15, useState as useState24 } from "react";
8610
8624
 
8611
8625
  // src/components/AppSidebar/sidebar-state.ts
8612
8626
  var STATES = ["full", "rail", "hidden"];
@@ -8662,8 +8676,8 @@ function read(key) {
8662
8676
  function useAppSidebar(appId, pageKind, fallback = "full") {
8663
8677
  const key = sidebarStorageKey(appId);
8664
8678
  const mobile = useIsMobile();
8665
- const [stored, setStored] = useState27({});
8666
- useEffect14(() => {
8679
+ const [stored, setStored] = useState24({});
8680
+ useEffect15(() => {
8667
8681
  const load = () => setStored(parseSidebarStored(read(key)));
8668
8682
  load();
8669
8683
  const onStorage = (event) => {
@@ -8725,7 +8739,7 @@ function AppFrame({
8725
8739
  const words = { ...LABELS, ...labels };
8726
8740
  const mobile = useIsMobile();
8727
8741
  const sidebar = useAppSidebar(appId, pageKind, defaultSidebar);
8728
- const [navOpen, setNavOpen] = useState28(false);
8742
+ const [navOpen, setNavOpen] = useState25(false);
8729
8743
  const hidden = sidebar.state === "hidden";
8730
8744
  const sidebarButton = /* @__PURE__ */ jsx214(
8731
8745
  "button",
@@ -8735,7 +8749,7 @@ function AppFrame({
8735
8749
  "aria-label": hidden ? words.showSidebar : words.hideSidebar,
8736
8750
  "aria-expanded": !hidden,
8737
8751
  onClick: sidebar.toggleHidden,
8738
- children: /* @__PURE__ */ jsx214(Icon, { name: "menu", "aria-hidden": true })
8752
+ children: /* @__PURE__ */ jsx214(Icon, { name: "menu", size: "lg", "aria-hidden": true })
8739
8753
  }
8740
8754
  );
8741
8755
  const menuButton = /* @__PURE__ */ jsx214(
@@ -8747,7 +8761,7 @@ function AppFrame({
8747
8761
  "aria-haspopup": "dialog",
8748
8762
  "aria-expanded": navOpen,
8749
8763
  onClick: () => setNavOpen(true),
8750
- children: /* @__PURE__ */ jsx214(Icon, { name: "menu", "aria-hidden": true })
8764
+ children: /* @__PURE__ */ jsx214(Icon, { name: "menu", size: "lg", "aria-hidden": true })
8751
8765
  }
8752
8766
  );
8753
8767
  return /* @__PURE__ */ jsxs178("div", { id: "sv-app-shell", className: styles68.shell, children: [
@@ -8821,13 +8835,13 @@ function AppFrame({
8821
8835
  ] });
8822
8836
  }
8823
8837
  function HeaderRow({ children }) {
8824
- const ref = useRef20(null);
8838
+ const ref = useRef22(null);
8825
8839
  usePublishShellChromeHeight(ref, "--sv-shell-header-height");
8826
8840
  return /* @__PURE__ */ jsx214("div", { ref, className: styles68.headerRow, children });
8827
8841
  }
8828
8842
 
8829
8843
  // src/components/SettingsDialog/SettingsDialog.tsx
8830
- import { useId as useId6, useState as useState29 } from "react";
8844
+ import { useId as useId6, useState as useState26 } from "react";
8831
8845
  import styles69 from "./SettingsDialog.module.css";
8832
8846
  import { Fragment as Fragment17, jsx as jsx215, jsxs as jsxs179 } from "react/jsx-runtime";
8833
8847
  function SettingsDialog({
@@ -8843,7 +8857,7 @@ function SettingsDialog({
8843
8857
  size: size2 = "lg",
8844
8858
  renderLink
8845
8859
  }) {
8846
- const [query, setQuery] = useState29("");
8860
+ const [query, setQuery] = useState26("");
8847
8861
  const navId = useId6();
8848
8862
  const all = groups.flatMap((group) => group.sections);
8849
8863
  const shown = all.find((section) => section.id === active) ?? all[0];
@@ -8852,83 +8866,96 @@ function SettingsDialog({
8852
8866
  ...group,
8853
8867
  sections: needle ? group.sections.filter((section) => section.label.toLocaleLowerCase().includes(needle)) : group.sections
8854
8868
  })).filter((group) => group.sections.length > 0);
8855
- return /* @__PURE__ */ jsx215(Dialog, { open, onClose, size: size2, header: title, "aria-label": title, flush: true, children: /* @__PURE__ */ jsxs179("div", { className: styles69.frame, "data-view": active === null ? "sections" : "section", children: [
8856
- /* @__PURE__ */ jsxs179("div", { className: styles69.sidebar, children: [
8857
- search && /* @__PURE__ */ jsx215("div", { className: styles69.search, children: /* @__PURE__ */ jsx215(
8858
- Input,
8859
- {
8860
- type: "search",
8861
- value: query,
8862
- onChange: (event) => setQuery(event.target.value),
8863
- placeholder: searchLabel,
8864
- "aria-label": searchLabel,
8865
- "aria-controls": navId
8866
- }
8867
- ) }),
8868
- /* @__PURE__ */ jsx215("nav", { id: navId, className: styles69.nav, "aria-label": title, children: visible.map((group) => /* @__PURE__ */ jsx215("ul", { className: styles69.group, children: group.sections.map((section) => {
8869
- const current2 = active !== null && section.id === shown?.id;
8870
- const className = [styles69.row, section.id === shown?.id ? styles69.rowActive : ""].filter(Boolean).join(" ");
8871
- const children = /* @__PURE__ */ jsxs179(Fragment17, { children: [
8872
- /* @__PURE__ */ jsx215(Icon, { name: section.icon, size: "sm", "aria-hidden": true, className: styles69.icon }),
8873
- /* @__PURE__ */ jsx215("span", { className: styles69.label, children: section.label }),
8874
- /* @__PURE__ */ jsx215(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true, className: styles69.chevron })
8875
- ] });
8876
- const select = () => onSelect(section.id);
8877
- let row;
8878
- if (section.href !== void 0 && renderLink) {
8879
- row = renderLink(section, {
8880
- href: section.href,
8881
- className,
8882
- "aria-current": current2 ? "page" : void 0,
8883
- onClick: select,
8884
- children
8885
- });
8886
- } else if (section.href !== void 0) {
8887
- row = /* @__PURE__ */ jsx215(
8888
- "a",
8869
+ return /* @__PURE__ */ jsx215(
8870
+ Dialog,
8871
+ {
8872
+ open,
8873
+ onClose,
8874
+ size: size2,
8875
+ header: title,
8876
+ "aria-label": title,
8877
+ rowClassName: styles69.headerRow,
8878
+ titleClassName: styles69.headerTitle,
8879
+ flush: true,
8880
+ children: /* @__PURE__ */ jsxs179("div", { className: styles69.frame, "data-view": active === null ? "sections" : "section", children: [
8881
+ /* @__PURE__ */ jsxs179("div", { className: styles69.sidebar, children: [
8882
+ search && /* @__PURE__ */ jsx215("div", { className: styles69.search, children: /* @__PURE__ */ jsx215(
8883
+ Input,
8889
8884
  {
8890
- href: section.href,
8891
- className,
8892
- "aria-current": current2 ? "page" : void 0,
8893
- onClick: (event) => {
8894
- event.preventDefault();
8895
- select();
8896
- },
8897
- children
8885
+ type: "search",
8886
+ value: query,
8887
+ onChange: (event) => setQuery(event.target.value),
8888
+ placeholder: searchLabel,
8889
+ "aria-label": searchLabel,
8890
+ "aria-controls": navId
8898
8891
  }
8899
- );
8900
- } else {
8901
- row = /* @__PURE__ */ jsx215(
8902
- "button",
8903
- {
8904
- type: "button",
8905
- className,
8906
- "aria-current": current2 ? "page" : void 0,
8907
- onClick: select,
8908
- children
8892
+ ) }),
8893
+ /* @__PURE__ */ jsx215("nav", { id: navId, className: styles69.nav, "aria-label": title, children: visible.map((group) => /* @__PURE__ */ jsx215("ul", { className: styles69.group, children: group.sections.map((section) => {
8894
+ const current2 = active !== null && section.id === shown?.id;
8895
+ const className = [styles69.row, section.id === shown?.id ? styles69.rowActive : ""].filter(Boolean).join(" ");
8896
+ const children = /* @__PURE__ */ jsxs179(Fragment17, { children: [
8897
+ /* @__PURE__ */ jsx215(Icon, { name: section.icon, size: "sm", "aria-hidden": true, className: styles69.icon }),
8898
+ /* @__PURE__ */ jsx215("span", { className: styles69.label, children: section.label }),
8899
+ /* @__PURE__ */ jsx215(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true, className: styles69.chevron })
8900
+ ] });
8901
+ const select = () => onSelect(section.id);
8902
+ let row;
8903
+ if (section.href !== void 0 && renderLink) {
8904
+ row = renderLink(section, {
8905
+ href: section.href,
8906
+ className,
8907
+ "aria-current": current2 ? "page" : void 0,
8908
+ onClick: select,
8909
+ children
8910
+ });
8911
+ } else if (section.href !== void 0) {
8912
+ row = /* @__PURE__ */ jsx215(
8913
+ "a",
8914
+ {
8915
+ href: section.href,
8916
+ className,
8917
+ "aria-current": current2 ? "page" : void 0,
8918
+ onClick: (event) => {
8919
+ event.preventDefault();
8920
+ select();
8921
+ },
8922
+ children
8923
+ }
8924
+ );
8925
+ } else {
8926
+ row = /* @__PURE__ */ jsx215(
8927
+ "button",
8928
+ {
8929
+ type: "button",
8930
+ className,
8931
+ "aria-current": current2 ? "page" : void 0,
8932
+ onClick: select,
8933
+ children
8934
+ }
8935
+ );
8909
8936
  }
8910
- );
8911
- }
8912
- return /* @__PURE__ */ jsx215("li", { children: row }, section.id);
8913
- }) }, group.id)) })
8914
- ] }),
8915
- shown && /* @__PURE__ */ jsxs179("section", { className: styles69.section, "aria-label": shown.label, children: [
8916
- /* @__PURE__ */ jsxs179("div", { className: styles69.back, children: [
8917
- /* @__PURE__ */ jsx215(
8918
- "button",
8919
- {
8920
- type: "button",
8921
- className: styles69.backButton,
8922
- "aria-label": backLabel,
8923
- onClick: () => onSelect(null),
8924
- children: /* @__PURE__ */ jsx215(Icon, { name: "chevron-left", size: "sm", "aria-hidden": true })
8925
- }
8926
- ),
8927
- /* @__PURE__ */ jsx215("span", { className: styles69.backTitle, children: shown.label })
8928
- ] }),
8929
- /* @__PURE__ */ jsx215("div", { className: styles69.body, children: shown.content })
8930
- ] })
8931
- ] }) });
8937
+ return /* @__PURE__ */ jsx215("li", { children: row }, section.id);
8938
+ }) }, group.id)) })
8939
+ ] }),
8940
+ shown && /* @__PURE__ */ jsxs179("section", { className: styles69.section, "aria-label": shown.label, children: [
8941
+ /* @__PURE__ */ jsxs179("div", { className: styles69.back, children: [
8942
+ /* @__PURE__ */ jsx215(
8943
+ "button",
8944
+ {
8945
+ type: "button",
8946
+ className: styles69.backButton,
8947
+ "aria-label": backLabel,
8948
+ onClick: () => onSelect(null),
8949
+ children: /* @__PURE__ */ jsx215(Icon, { name: "chevron-left", size: "sm", "aria-hidden": true })
8950
+ }
8951
+ ),
8952
+ /* @__PURE__ */ jsx215("span", { className: styles69.backTitle, children: shown.label })
8953
+ ] }),
8954
+ /* @__PURE__ */ jsx215("div", { className: styles69.body, children: shown.content })
8955
+ ] })
8956
+ ] })
8957
+ }
8958
+ );
8932
8959
  }
8933
8960
 
8934
8961
  // src/components/DeviceOnlyGate/DeviceOnlyGate.tsx
@@ -8997,7 +9024,7 @@ function DeviceStorageKeyGate({
8997
9024
  }
8998
9025
 
8999
9026
  // src/components/Avatar/Avatar.tsx
9000
- import { useState as useState30 } from "react";
9027
+ import { useState as useState27 } from "react";
9001
9028
  import styles70 from "./Avatar.module.css";
9002
9029
  import { jsx as jsx218 } from "react/jsx-runtime";
9003
9030
  function initials2(name) {
@@ -9011,7 +9038,7 @@ var sizeClass2 = {
9011
9038
  lg: styles70.lg
9012
9039
  };
9013
9040
  function Avatar({ name, src, size: size2 = "md", className }) {
9014
- const [imgFailed, setImgFailed] = useState30(false);
9041
+ const [imgFailed, setImgFailed] = useState27(false);
9015
9042
  const cls = [styles70.avatar, sizeClass2[size2], className].filter(Boolean).join(" ");
9016
9043
  if (src && !imgFailed) {
9017
9044
  return /* @__PURE__ */ jsx218("span", { className: cls, "aria-label": name, children: /* @__PURE__ */ jsx218("img", { src, alt: name, className: styles70.img, onError: () => setImgFailed(true) }) });
@@ -9547,14 +9574,14 @@ function FloatingActionButton({
9547
9574
  }
9548
9575
 
9549
9576
  // src/components/PhotoViewer/PhotoGrid.tsx
9550
- import { useState as useState32 } from "react";
9577
+ import { useState as useState29 } from "react";
9551
9578
 
9552
9579
  // src/components/PhotoViewer/PhotoViewer.tsx
9553
9580
  import {
9554
9581
  useCallback as useCallback7,
9555
- useEffect as useEffect15,
9556
- useRef as useRef21,
9557
- useState as useState31
9582
+ useEffect as useEffect16,
9583
+ useRef as useRef23,
9584
+ useState as useState28
9558
9585
  } from "react";
9559
9586
  import { createPortal as createPortal4 } from "react-dom";
9560
9587
 
@@ -9623,9 +9650,9 @@ function PhotoViewer({
9623
9650
  onClose,
9624
9651
  label = "Photos"
9625
9652
  }) {
9626
- const panelRef = useRef21(null);
9627
- const stageRef = useRef21(null);
9628
- const imageRef = useRef21(null);
9653
+ const panelRef = useRef23(null);
9654
+ const stageRef = useRef23(null);
9655
+ const imageRef = useRef23(null);
9629
9656
  const reducedMotion = usePrefersReducedMotion();
9630
9657
  const { mounted, phase } = useMountTransition(
9631
9658
  open,
@@ -9638,13 +9665,13 @@ function PhotoViewer({
9638
9665
  const count = photos.length;
9639
9666
  const current2 = clamp2(index, 0, Math.max(0, count - 1));
9640
9667
  const photo = photos[current2];
9641
- const [scale, setScale] = useState31(MIN_SCALE);
9642
- const [pan, setPan] = useState31({ x: 0, y: 0 });
9643
- const [drag, setDrag] = useState31({ x: 0, y: 0 });
9644
- const [dragging, setDragging] = useState31(false);
9645
- const [failed, setFailed] = useState31(false);
9646
- const pointers = useRef21(/* @__PURE__ */ new Map());
9647
- const gesture = useRef21({
9668
+ const [scale, setScale] = useState28(MIN_SCALE);
9669
+ const [pan, setPan] = useState28({ x: 0, y: 0 });
9670
+ const [drag, setDrag] = useState28({ x: 0, y: 0 });
9671
+ const [dragging, setDragging] = useState28(false);
9672
+ const [failed, setFailed] = useState28(false);
9673
+ const pointers = useRef23(/* @__PURE__ */ new Map());
9674
+ const gesture = useRef23({
9648
9675
  startScale: 1,
9649
9676
  startPan: { x: 0, y: 0 },
9650
9677
  startDistance: 0,
@@ -9654,14 +9681,14 @@ function PhotoViewer({
9654
9681
  moved: false,
9655
9682
  pinched: false
9656
9683
  });
9657
- const lastTap = useRef21(void 0);
9658
- useEffect15(() => {
9684
+ const lastTap = useRef23(void 0);
9685
+ useEffect16(() => {
9659
9686
  setScale(MIN_SCALE);
9660
9687
  setPan({ x: 0, y: 0 });
9661
9688
  setDrag({ x: 0, y: 0 });
9662
9689
  setFailed(false);
9663
9690
  }, [current2, open]);
9664
- useEffect15(() => {
9691
+ useEffect16(() => {
9665
9692
  if (!open) return;
9666
9693
  for (const next of [photos[current2 - 1], photos[current2 + 1]]) {
9667
9694
  if (next) new Image().src = next.src;
@@ -9694,7 +9721,7 @@ function PhotoViewer({
9694
9721
  },
9695
9722
  [scale, sizes]
9696
9723
  );
9697
- useEffect15(() => {
9724
+ useEffect16(() => {
9698
9725
  if (!open) return;
9699
9726
  function onKey(event) {
9700
9727
  if (event.key === "ArrowRight") go(1);
@@ -9939,8 +9966,8 @@ function PhotoGrid({ photos, onOpen, label = "Photos", className }) {
9939
9966
  ) }, photo.id)) });
9940
9967
  }
9941
9968
  function PhotoGallery({ photos, label, className, onView }) {
9942
- const [open, setOpen] = useState32(false);
9943
- const [index, setIndex] = useState32(0);
9969
+ const [open, setOpen] = useState29(false);
9970
+ const [index, setIndex] = useState29(0);
9944
9971
  return /* @__PURE__ */ jsxs190(Fragment23, { children: [
9945
9972
  /* @__PURE__ */ jsx239(
9946
9973
  PhotoGrid,
@@ -9998,15 +10025,15 @@ function Message({ sender, children, pending, actions, className }) {
9998
10025
  }
9999
10026
 
10000
10027
  // src/components/MessageScroller/MessageScroller.tsx
10001
- import { useEffect as useEffect16, useRef as useRef22, useState as useState33 } from "react";
10028
+ import { useEffect as useEffect17, useRef as useRef24, useState as useState30 } from "react";
10002
10029
  import styles94 from "./MessageScroller.module.css";
10003
10030
  import { jsx as jsx242, jsxs as jsxs192 } from "react/jsx-runtime";
10004
10031
  var NEAR_BOTTOM_THRESHOLD_PX = 80;
10005
10032
  function MessageScroller({ children, className }) {
10006
- const containerRef = useRef22(null);
10007
- const isNearBottomRef = useRef22(true);
10008
- const [hasNewMessages, setHasNewMessages] = useState33(false);
10009
- useEffect16(() => {
10033
+ const containerRef = useRef24(null);
10034
+ const isNearBottomRef = useRef24(true);
10035
+ const [hasNewMessages, setHasNewMessages] = useState30(false);
10036
+ useEffect17(() => {
10010
10037
  const el = containerRef.current;
10011
10038
  if (!el) return;
10012
10039
  if (isNearBottomRef.current) {
@@ -10041,14 +10068,14 @@ function MessageScroller({ children, className }) {
10041
10068
  }
10042
10069
 
10043
10070
  // src/components/HoverCard/HoverCard.tsx
10044
- import { cloneElement, useEffect as useEffect17, useRef as useRef23, useState as useState34 } from "react";
10071
+ import { cloneElement, useEffect as useEffect18, useRef as useRef25, useState as useState31 } from "react";
10045
10072
  import styles95 from "./HoverCard.module.css";
10046
10073
  import { jsx as jsx243 } from "react/jsx-runtime";
10047
10074
  var OPEN_DELAY_MS = 400;
10048
10075
  var CLOSE_DELAY_MS = 150;
10049
10076
  function useHoverCapable() {
10050
- const [hoverCapable, setHoverCapable] = useState34(true);
10051
- useEffect17(() => {
10077
+ const [hoverCapable, setHoverCapable] = useState31(true);
10078
+ useEffect18(() => {
10052
10079
  const mql = window.matchMedia("(hover: hover)");
10053
10080
  setHoverCapable(mql.matches);
10054
10081
  function handleChange(e) {
@@ -10066,10 +10093,10 @@ function HoverCard({
10066
10093
  width,
10067
10094
  "aria-label": ariaLabel
10068
10095
  }) {
10069
- const [open, setOpen] = useState34(false);
10096
+ const [open, setOpen] = useState31(false);
10070
10097
  const hoverCapable = useHoverCapable();
10071
- const openTimer = useRef23(void 0);
10072
- const closeTimer = useRef23(void 0);
10098
+ const openTimer = useRef25(void 0);
10099
+ const closeTimer = useRef25(void 0);
10073
10100
  function scheduleOpen() {
10074
10101
  clearTimeout(closeTimer.current);
10075
10102
  openTimer.current = setTimeout(() => setOpen(true), OPEN_DELAY_MS);
@@ -10111,12 +10138,12 @@ function HoverCard({
10111
10138
  }
10112
10139
 
10113
10140
  // src/components/ContextMenu/ContextMenu.tsx
10114
- import { cloneElement as cloneElement2, useState as useState35 } from "react";
10141
+ import { cloneElement as cloneElement2, useState as useState32 } from "react";
10115
10142
  import { Fragment as Fragment24, jsx as jsx244, jsxs as jsxs193 } from "react/jsx-runtime";
10116
10143
  function ContextMenu({ children, items, "aria-label": ariaLabel }) {
10117
10144
  const isMobile = useIsMobile();
10118
- const [open, setOpen] = useState35(false);
10119
- const [point, setPoint] = useState35({ x: 0, y: 0 });
10145
+ const [open, setOpen] = useState32(false);
10146
+ const [point, setPoint] = useState32({ x: 0, y: 0 });
10120
10147
  const longPressHandlers = useLongPress({
10121
10148
  onLongPress: () => setOpen(true),
10122
10149
  disabled: !isMobile
@@ -10162,7 +10189,7 @@ function ContextMenu({ children, items, "aria-label": ariaLabel }) {
10162
10189
  }
10163
10190
 
10164
10191
  // src/components/NavigationMenu/NavigationMenu.tsx
10165
- import { useRef as useRef24, useState as useState36 } from "react";
10192
+ import { useRef as useRef26, useState as useState33 } from "react";
10166
10193
  import styles96 from "./NavigationMenu.module.css";
10167
10194
  import { jsx as jsx245 } from "react/jsx-runtime";
10168
10195
  function NavigationMenu({
@@ -10170,8 +10197,8 @@ function NavigationMenu({
10170
10197
  renderLink,
10171
10198
  "aria-label": ariaLabel
10172
10199
  }) {
10173
- const [openIndex, setOpenIndex] = useState36(null);
10174
- const triggerRefs = useRef24([]);
10200
+ const [openIndex, setOpenIndex] = useState33(null);
10201
+ const triggerRefs = useRef26([]);
10175
10202
  function handleKeyDown(e, index) {
10176
10203
  if (e.key === "Escape") {
10177
10204
  setOpenIndex(null);
@@ -10245,7 +10272,7 @@ function Menubar({ menus, "aria-label": ariaLabel = "Menu bar" }) {
10245
10272
  }
10246
10273
 
10247
10274
  // src/components/Command/Command.tsx
10248
- import { useEffect as useEffect18, useId as useId11, useMemo as useMemo3, useRef as useRef25, useState as useState37 } from "react";
10275
+ import { useEffect as useEffect19, useId as useId11, useMemo as useMemo3, useRef as useRef27, useState as useState34 } from "react";
10249
10276
  import styles97 from "./Command.module.css";
10250
10277
  import { jsx as jsx247, jsxs as jsxs194 } from "react/jsx-runtime";
10251
10278
  function matches(item, query) {
@@ -10260,15 +10287,15 @@ function Command({
10260
10287
  placeholder = "Type a command\u2026",
10261
10288
  "aria-label": ariaLabel = "Command palette"
10262
10289
  }) {
10263
- const [query, setQuery] = useState37("");
10264
- const [highlightedIndex, setHighlightedIndex] = useState37(0);
10265
- const inputRef = useRef25(null);
10290
+ const [query, setQuery] = useState34("");
10291
+ const [highlightedIndex, setHighlightedIndex] = useState34(0);
10292
+ const inputRef = useRef27(null);
10266
10293
  const listId = useId11();
10267
10294
  const filtered = useMemo3(() => items.filter((item) => matches(item, query)), [items, query]);
10268
- useEffect18(() => {
10295
+ useEffect19(() => {
10269
10296
  setHighlightedIndex(0);
10270
10297
  }, [query, open]);
10271
- useEffect18(() => {
10298
+ useEffect19(() => {
10272
10299
  if (open) {
10273
10300
  setQuery("");
10274
10301
  requestAnimationFrame(() => inputRef.current?.focus());
@@ -10356,7 +10383,7 @@ function Command({
10356
10383
  }
10357
10384
 
10358
10385
  // src/components/Resizable/Resizable.tsx
10359
- import { Children, isValidElement, useEffect as useEffect19, useRef as useRef26, useState as useState38 } from "react";
10386
+ import { Children, isValidElement, useEffect as useEffect20, useRef as useRef28, useState as useState35 } from "react";
10360
10387
  import styles98 from "./Resizable.module.css";
10361
10388
  import { jsx as jsx248 } from "react/jsx-runtime";
10362
10389
  function ResizablePanel({ children, className, style }) {
@@ -10402,16 +10429,16 @@ function ResizablePanelGroup({ direction, children, className }) {
10402
10429
  maxSize: props.maxSize ?? 90
10403
10430
  };
10404
10431
  });
10405
- const [sizes, setSizes] = useState38(() => constraints.map((c) => c.defaultSize));
10432
+ const [sizes, setSizes] = useState35(() => constraints.map((c) => c.defaultSize));
10406
10433
  if (sizes.length !== constraints.length) {
10407
10434
  setSizes(constraints.map((c) => c.defaultSize));
10408
10435
  }
10409
- const containerRef = useRef26(null);
10410
- const constraintsRef = useRef26(constraints);
10436
+ const containerRef = useRef28(null);
10437
+ const constraintsRef = useRef28(constraints);
10411
10438
  constraintsRef.current = constraints;
10412
- const directionRef = useRef26(direction);
10439
+ const directionRef = useRef28(direction);
10413
10440
  directionRef.current = direction;
10414
- const dragState = useRef26(null);
10441
+ const dragState = useRef28(null);
10415
10442
  function applyResize(handleIndex2, nextA, combined) {
10416
10443
  const a = constraintsRef.current[handleIndex2];
10417
10444
  const b = constraintsRef.current[handleIndex2 + 1];
@@ -10428,7 +10455,7 @@ function ResizablePanelGroup({ direction, children, className }) {
10428
10455
  return next;
10429
10456
  });
10430
10457
  }
10431
- useEffect19(() => {
10458
+ useEffect20(() => {
10432
10459
  function handlePointerMove(event) {
10433
10460
  const drag = dragState.current;
10434
10461
  const rect = containerRef.current?.getBoundingClientRect();
@@ -10548,7 +10575,7 @@ function ResizableHandleClone({
10548
10575
  }
10549
10576
 
10550
10577
  // src/components/DataTable/DataTable.tsx
10551
- import { useMemo as useMemo4, useState as useState39 } from "react";
10578
+ import { useMemo as useMemo4, useState as useState36 } from "react";
10552
10579
  import styles99 from "./DataTable.module.css";
10553
10580
  import { jsx as jsx249, jsxs as jsxs195 } from "react/jsx-runtime";
10554
10581
  function compareValues(a, b) {
@@ -10564,8 +10591,8 @@ function DataTable({
10564
10591
  emptyMessage = "No results.",
10565
10592
  className
10566
10593
  }) {
10567
- const [sortKey, setSortKey] = useState39(defaultSortKey);
10568
- const [sortDirection, setSortDirection] = useState39(defaultSortDirection);
10594
+ const [sortKey, setSortKey] = useState36(defaultSortKey);
10595
+ const [sortDirection, setSortDirection] = useState36(defaultSortDirection);
10569
10596
  const sortColumn = columns.find((c) => c.key === sortKey);
10570
10597
  const sortedData = useMemo4(() => {
10571
10598
  if (!sortColumn) return data;
@@ -10632,7 +10659,7 @@ function DataTable({
10632
10659
  }
10633
10660
 
10634
10661
  // src/components/Combobox/Combobox.tsx
10635
- import { useEffect as useEffect20, useId as useId12, useMemo as useMemo5, useRef as useRef27, useState as useState40 } from "react";
10662
+ import { useEffect as useEffect21, useId as useId12, useMemo as useMemo5, useRef as useRef29, useState as useState37 } from "react";
10636
10663
  import styles100 from "./Combobox.module.css";
10637
10664
  import { Fragment as Fragment25, jsx as jsx250, jsxs as jsxs196 } from "react/jsx-runtime";
10638
10665
  function matches2(option, query) {
@@ -10650,21 +10677,21 @@ function Combobox({
10650
10677
  disabled = false,
10651
10678
  className
10652
10679
  }) {
10653
- const [open, setOpen] = useState40(false);
10654
- const [query, setQuery] = useState40("");
10655
- const [highlightedIndex, setHighlightedIndex] = useState40(0);
10680
+ const [open, setOpen] = useState37(false);
10681
+ const [query, setQuery] = useState37("");
10682
+ const [highlightedIndex, setHighlightedIndex] = useState37(0);
10656
10683
  const isMobile = useIsMobile();
10657
- const inputRef = useRef27(null);
10684
+ const inputRef = useRef29(null);
10658
10685
  const listId = useId12();
10659
10686
  const selected = options.find((o) => o.value === value) ?? null;
10660
10687
  const filtered = useMemo5(
10661
10688
  () => options.filter((option) => matches2(option, query)),
10662
10689
  [options, query]
10663
10690
  );
10664
- useEffect20(() => {
10691
+ useEffect21(() => {
10665
10692
  setHighlightedIndex(0);
10666
10693
  }, [query, open]);
10667
- useEffect20(() => {
10694
+ useEffect21(() => {
10668
10695
  if (open) {
10669
10696
  setQuery("");
10670
10697
  requestAnimationFrame(() => inputRef.current?.focus());
@@ -10859,7 +10886,7 @@ function StepStrip({
10859
10886
  }
10860
10887
 
10861
10888
  // src/components/FileDropzone/FileDropzone.tsx
10862
- import { useRef as useRef28, useState as useState41 } from "react";
10889
+ import { useRef as useRef30, useState as useState38 } from "react";
10863
10890
  import styles103 from "./FileDropzone.module.css";
10864
10891
  import { jsx as jsx254, jsxs as jsxs199 } from "react/jsx-runtime";
10865
10892
  function FileDropzone({
@@ -10873,8 +10900,8 @@ function FileDropzone({
10873
10900
  disabled,
10874
10901
  className
10875
10902
  }) {
10876
- const [dragging, setDragging] = useState41(false);
10877
- const inputRef = useRef28(null);
10903
+ const [dragging, setDragging] = useState38(false);
10904
+ const inputRef = useRef30(null);
10878
10905
  return /* @__PURE__ */ jsxs199(
10879
10906
  "label",
10880
10907
  {
@@ -10928,7 +10955,7 @@ function FileDropzone({
10928
10955
  }
10929
10956
 
10930
10957
  // src/components/Calendar/Calendar.tsx
10931
- import { useRef as useRef29, useState as useState42 } from "react";
10958
+ import { useRef as useRef31, useState as useState39 } from "react";
10932
10959
 
10933
10960
  // src/components/Calendar/dateUtils.ts
10934
10961
  function startOfMonth(date) {
@@ -11004,9 +11031,9 @@ function Calendar({
11004
11031
  maxDate,
11005
11032
  "aria-label": ariaLabel
11006
11033
  }) {
11007
- const [displayedMonth, setDisplayedMonth] = useState42(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
11008
- const [focusedDate, setFocusedDate] = useState42(() => value ?? /* @__PURE__ */ new Date());
11009
- const gridRef = useRef29(null);
11034
+ const [displayedMonth, setDisplayedMonth] = useState39(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
11035
+ const [focusedDate, setFocusedDate] = useState39(() => value ?? /* @__PURE__ */ new Date());
11036
+ const gridRef = useRef31(null);
11010
11037
  const weeks = getMonthGrid(displayedMonth);
11011
11038
  function goToMonth(next) {
11012
11039
  setDisplayedMonth(startOfMonth(next));
@@ -11137,7 +11164,7 @@ function Calendar({
11137
11164
  }
11138
11165
 
11139
11166
  // src/components/DatePicker/DatePicker.tsx
11140
- import { useState as useState43 } from "react";
11167
+ import { useState as useState40 } from "react";
11141
11168
  import styles105 from "./DatePicker.module.css";
11142
11169
  import { Fragment as Fragment26, jsx as jsx256, jsxs as jsxs201 } from "react/jsx-runtime";
11143
11170
  var POPOVER_WIDTH = 320;
@@ -11150,7 +11177,7 @@ function DatePicker({
11150
11177
  "aria-label": ariaLabel,
11151
11178
  disabled = false
11152
11179
  }) {
11153
- const [open, setOpen] = useState43(false);
11180
+ const [open, setOpen] = useState40(false);
11154
11181
  const isMobile = useIsMobile();
11155
11182
  function handleSelect(date) {
11156
11183
  onChange(date);
@@ -11202,11 +11229,11 @@ function DatePicker({
11202
11229
  }
11203
11230
 
11204
11231
  // src/components/DateRangePicker/DateRangePicker.tsx
11205
- import { useState as useState45 } from "react";
11232
+ import { useState as useState42 } from "react";
11206
11233
  import pickerStyles from "./DatePicker.module.css";
11207
11234
 
11208
11235
  // src/components/DateRangePicker/RangeCalendar.tsx
11209
- import { useRef as useRef30, useState as useState44 } from "react";
11236
+ import { useRef as useRef32, useState as useState41 } from "react";
11210
11237
  import calendarStyles from "./Calendar.module.css";
11211
11238
 
11212
11239
  // src/components/DateRangePicker/rangeUtils.ts
@@ -11245,13 +11272,13 @@ function RangeCalendar({
11245
11272
  maxDate,
11246
11273
  "aria-label": ariaLabel
11247
11274
  }) {
11248
- const [displayedMonth, setDisplayedMonth] = useState44(
11275
+ const [displayedMonth, setDisplayedMonth] = useState41(
11249
11276
  () => startOfMonth(value?.start ?? /* @__PURE__ */ new Date())
11250
11277
  );
11251
- const [focusedDate, setFocusedDate] = useState44(() => value?.start ?? /* @__PURE__ */ new Date());
11252
- const [first, setFirst] = useState44(null);
11253
- const [hover, setHover] = useState44(null);
11254
- const gridRef = useRef30(null);
11278
+ const [focusedDate, setFocusedDate] = useState41(() => value?.start ?? /* @__PURE__ */ new Date());
11279
+ const [first, setFirst] = useState41(null);
11280
+ const [hover, setHover] = useState41(null);
11281
+ const gridRef = useRef32(null);
11255
11282
  const weeks = getMonthGrid(displayedMonth);
11256
11283
  const shown = first ? rangeOf(first, hover ?? first) : value;
11257
11284
  function goToMonth(next) {
@@ -11431,7 +11458,7 @@ function DateRangePicker({
11431
11458
  "aria-label": ariaLabel,
11432
11459
  disabled = false
11433
11460
  }) {
11434
- const [open, setOpen] = useState45(false);
11461
+ const [open, setOpen] = useState42(false);
11435
11462
  const isMobile = useIsMobile();
11436
11463
  const start = parseIso(value.start);
11437
11464
  const end = parseIso(value.end);
@@ -11486,7 +11513,7 @@ function DateRangePicker({
11486
11513
  }
11487
11514
 
11488
11515
  // src/components/SuggestionInput/SuggestionInput.tsx
11489
- import { useId as useId13, useRef as useRef31, useState as useState46 } from "react";
11516
+ import { useId as useId13, useRef as useRef33, useState as useState43 } from "react";
11490
11517
  import styles107 from "./SuggestionInput.module.css";
11491
11518
  import { Fragment as Fragment28, jsx as jsx259, jsxs as jsxs204 } from "react/jsx-runtime";
11492
11519
  function SuggestionInput({
@@ -11506,9 +11533,9 @@ function SuggestionInput({
11506
11533
  const generatedId = useId13();
11507
11534
  const inputId = id ?? generatedId;
11508
11535
  const listId = `${inputId}-suggestions`;
11509
- const inputRef = useRef31(null);
11510
- const [focused, setFocused] = useState46(false);
11511
- const [activeIndex, setActiveIndex] = useState46(-1);
11536
+ const inputRef = useRef33(null);
11537
+ const [focused, setFocused] = useState43(false);
11538
+ const [activeIndex, setActiveIndex] = useState43(-1);
11512
11539
  const showCreateRow = Boolean(onCreate && createLabel && value.trim());
11513
11540
  const rowCount = options.length + (showCreateRow ? 1 : 0);
11514
11541
  const open = focused && (rowCount > 0 || loading);
@@ -11626,7 +11653,7 @@ function SuggestionInput({
11626
11653
  }
11627
11654
 
11628
11655
  // src/components/IconPicker/IconPicker.tsx
11629
- import { useState as useState47 } from "react";
11656
+ import { useState as useState44 } from "react";
11630
11657
  import styles108 from "./IconPicker.module.css";
11631
11658
  import { jsx as jsx260, jsxs as jsxs205 } from "react/jsx-runtime";
11632
11659
  function IconPicker({
@@ -11636,9 +11663,10 @@ function IconPicker({
11636
11663
  "aria-label": ariaLabel,
11637
11664
  triggerLabel,
11638
11665
  disabled = false,
11639
- className
11666
+ className,
11667
+ align = "auto"
11640
11668
  }) {
11641
- const [open, setOpen] = useState47(false);
11669
+ const [open, setOpen] = useState44(false);
11642
11670
  const trigger = /* @__PURE__ */ jsxs205(
11643
11671
  "button",
11644
11672
  {
@@ -11661,6 +11689,7 @@ function IconPicker({
11661
11689
  trigger,
11662
11690
  open,
11663
11691
  onClose: () => setOpen(false),
11692
+ align,
11664
11693
  width: 240,
11665
11694
  "aria-label": `${ariaLabel} options`,
11666
11695
  children: /* @__PURE__ */ jsx260("div", { className: styles108.grid, role: "listbox", "aria-label": ariaLabel, children: options.map((name) => /* @__PURE__ */ jsx260(
@@ -11904,7 +11933,7 @@ function CheckableListRow({
11904
11933
  }
11905
11934
 
11906
11935
  // src/components/CurrencyInput/CurrencyInput.tsx
11907
- import { useState as useState48 } from "react";
11936
+ import { useState as useState45 } from "react";
11908
11937
  import { jsx as jsx264 } from "react/jsx-runtime";
11909
11938
  function minorToText(minor, decimals) {
11910
11939
  return (minor / 10 ** decimals).toFixed(decimals);
@@ -11922,7 +11951,7 @@ function CurrencyInput({
11922
11951
  decimals = 2,
11923
11952
  ...rest
11924
11953
  }) {
11925
- const [text, setText] = useState48(
11954
+ const [text, setText] = useState45(
11926
11955
  () => valueCents != null ? minorToText(valueCents, decimals) : ""
11927
11956
  );
11928
11957
  if (textToMinor(text, decimals) !== valueCents) {
@@ -12056,10 +12085,10 @@ function SwipableMobileCarouselDots({
12056
12085
  import {
12057
12086
  Children as Children2,
12058
12087
  isValidElement as isValidElement2,
12059
- useEffect as useEffect21,
12088
+ useEffect as useEffect22,
12060
12089
  useLayoutEffect as useLayoutEffect4,
12061
12090
  useMemo as useMemo6,
12062
- useRef as useRef32
12091
+ useRef as useRef34
12063
12092
  } from "react";
12064
12093
 
12065
12094
  // src/components/SwipableMobileCarousel/SwipableMobileCarouselSlide.tsx
@@ -12128,7 +12157,7 @@ function SwipableMobileCarousel({
12128
12157
  const slides = useMemo6(() => resolveSlides(children), [children]);
12129
12158
  const count = slides.length;
12130
12159
  const clampedActiveIndex = count === 0 ? 0 : Math.max(0, Math.min(count - 1, activeIndex));
12131
- const initialActiveIndexRef = useRef32(clampedActiveIndex);
12160
+ const initialActiveIndexRef = useRef34(clampedActiveIndex);
12132
12161
  const { scrollRef, scrollToIndex, liveIndex } = useSnapCarousel({
12133
12162
  itemCount: count,
12134
12163
  onSettle,
@@ -12138,15 +12167,15 @@ function SwipableMobileCarousel({
12138
12167
  useLayoutEffect4(() => {
12139
12168
  scrollToIndex(initialActiveIndexRef.current, "instant");
12140
12169
  }, []);
12141
- const didMountActiveIndexSyncRef = useRef32(false);
12142
- useEffect21(() => {
12170
+ const didMountActiveIndexSyncRef = useRef34(false);
12171
+ useEffect22(() => {
12143
12172
  if (!didMountActiveIndexSyncRef.current) {
12144
12173
  didMountActiveIndexSyncRef.current = true;
12145
12174
  return;
12146
12175
  }
12147
12176
  scrollToIndex(clampedActiveIndex, "smooth");
12148
12177
  }, [clampedActiveIndex, scrollToIndex]);
12149
- const prevKeysRef = useRef32(null);
12178
+ const prevKeysRef = useRef34(null);
12150
12179
  useLayoutEffect4(() => {
12151
12180
  const currentKeys = slides.map((s) => s.key);
12152
12181
  const prevKeys = prevKeysRef.current;
@@ -12237,7 +12266,7 @@ function SwipableMobileCarouselSlideFooter({
12237
12266
  }
12238
12267
 
12239
12268
  // src/components/SwipeStack/SwipeStack.tsx
12240
- import { Children as Children3, isValidElement as isValidElement3, useEffect as useEffect22, useRef as useRef33, useState as useState49 } from "react";
12269
+ import { Children as Children3, isValidElement as isValidElement3, useEffect as useEffect23, useRef as useRef35, useState as useState46 } from "react";
12241
12270
 
12242
12271
  // src/components/SwipeStack/SwipeStackCard.tsx
12243
12272
  import { Fragment as Fragment30, jsx as jsx274 } from "react/jsx-runtime";
@@ -12294,10 +12323,10 @@ function SwipeStack({
12294
12323
  children
12295
12324
  }) {
12296
12325
  const cards = resolveCards(children);
12297
- const [dismissed, setDismissed] = useState49(() => /* @__PURE__ */ new Set());
12298
- const [exiting, setExiting] = useState49(null);
12299
- const exitTimerRef = useRef33(null);
12300
- useEffect22(
12326
+ const [dismissed, setDismissed] = useState46(() => /* @__PURE__ */ new Set());
12327
+ const [exiting, setExiting] = useState46(null);
12328
+ const exitTimerRef = useRef35(null);
12329
+ useEffect23(
12301
12330
  () => () => {
12302
12331
  if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
12303
12332
  },
@@ -12617,7 +12646,7 @@ var THEME_PRESETS = {
12617
12646
  };
12618
12647
 
12619
12648
  // src/components/CopyButton/CopyButton.tsx
12620
- import { useState as useState50 } from "react";
12649
+ import { useState as useState47 } from "react";
12621
12650
  import { jsx as jsx281 } from "react/jsx-runtime";
12622
12651
  function CopyButton({
12623
12652
  text,
@@ -12627,7 +12656,7 @@ function CopyButton({
12627
12656
  variant = "secondary",
12628
12657
  size: size2 = "sm"
12629
12658
  }) {
12630
- const [state, setState] = useState50("idle");
12659
+ const [state, setState] = useState47("idle");
12631
12660
  async function copy() {
12632
12661
  try {
12633
12662
  await navigator.clipboard.writeText(text);