@sovereignfs/ui 0.107.3 → 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") {
@@ -5297,16 +5284,16 @@ function Popover({
5297
5284
  "aria-label": ariaLabel,
5298
5285
  children
5299
5286
  }) {
5300
- const containerRef = useRef4(null);
5301
- const panelRef = useRef4(null);
5302
- const [triggerWidth, setTriggerWidth] = useState11(null);
5303
- const [openUpward, setOpenUpward] = useState11(false);
5304
- const [maxHeight, setMaxHeight] = useState11(null);
5305
- const [horizontalOffset, setHorizontalOffset] = useState11(null);
5306
- const [autoSide, setAutoSide] = useState11("right");
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");
5307
5294
  const side = align === "auto" ? autoSide : align;
5308
- const overlayIdRef = useRef4(null);
5309
- useEffect2(() => {
5295
+ const overlayIdRef = useRef5(null);
5296
+ useEffect3(() => {
5310
5297
  if (!open) return;
5311
5298
  const id = registerOpenOverlay();
5312
5299
  overlayIdRef.current = id;
@@ -5315,7 +5302,7 @@ function Popover({
5315
5302
  overlayIdRef.current = null;
5316
5303
  };
5317
5304
  }, [open]);
5318
- useEffect2(() => {
5305
+ useEffect3(() => {
5319
5306
  if (width !== "trigger") return;
5320
5307
  const el = containerRef.current?.firstElementChild;
5321
5308
  if (!el) return;
@@ -5375,7 +5362,7 @@ function Popover({
5375
5362
  );
5376
5363
  setHorizontalOffset(clampedLeft !== naturalLeft ? clampedLeft - containerRect.left : null);
5377
5364
  }, [open, children, align]);
5378
- useEffect2(() => {
5365
+ useEffect3(() => {
5379
5366
  if (!open) return;
5380
5367
  function handleMouseDown(e) {
5381
5368
  if (!containerRef.current?.contains(e.target)) {
@@ -5385,7 +5372,7 @@ function Popover({
5385
5372
  document.addEventListener("mousedown", handleMouseDown);
5386
5373
  return () => document.removeEventListener("mousedown", handleMouseDown);
5387
5374
  }, [open, onClose]);
5388
- useEffect2(() => {
5375
+ useEffect3(() => {
5389
5376
  if (!open) return;
5390
5377
  function handleKeyDown(e) {
5391
5378
  if (e.key !== "Escape") return;
@@ -5419,11 +5406,11 @@ function Popover({
5419
5406
  }
5420
5407
 
5421
5408
  // src/components/Textarea/Textarea.tsx
5422
- import { useLayoutEffect as useLayoutEffect2, useRef as useRef5 } from "react";
5409
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
5423
5410
  import styles35 from "./Textarea.module.css";
5424
5411
  import { jsx as jsx178 } from "react/jsx-runtime";
5425
5412
  function Textarea({ className, rows = 4, autoGrow = false, ...rest }) {
5426
- const ref = useRef5(null);
5413
+ const ref = useRef6(null);
5427
5414
  useLayoutEffect2(() => {
5428
5415
  const el = ref.current;
5429
5416
  if (!autoGrow || !el) return;
@@ -5504,7 +5491,7 @@ function StatusBadge({
5504
5491
  }
5505
5492
 
5506
5493
  // src/components/SplitPane/SplitPane.tsx
5507
- 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";
5508
5495
  import styles38 from "./SplitPane.module.css";
5509
5496
  import { jsx as jsx181, jsxs as jsxs150 } from "react/jsx-runtime";
5510
5497
  var clampSize = (value, min, max) => Math.min(Math.max(value, min), max);
@@ -5521,9 +5508,9 @@ function SplitPane({
5521
5508
  className
5522
5509
  }) {
5523
5510
  const initialSize = clampSize(defaultPrimarySize, minPrimarySize, maxPrimarySize);
5524
- const [primarySize, setPrimarySize] = useState12(initialSize);
5525
- const containerRef = useRef6(null);
5526
- const dragState = useRef6(null);
5511
+ const [primarySize, setPrimarySize] = useState9(initialSize);
5512
+ const containerRef = useRef7(null);
5513
+ const dragState = useRef7(null);
5527
5514
  const updateFromClientX = useCallback(
5528
5515
  (clientX) => {
5529
5516
  const rect = containerRef.current?.getBoundingClientRect();
@@ -5535,7 +5522,7 @@ function SplitPane({
5535
5522
  },
5536
5523
  [maxPrimarySize, minPrimarySize]
5537
5524
  );
5538
- useEffect3(() => {
5525
+ useEffect4(() => {
5539
5526
  const handlePointerMove = (event) => {
5540
5527
  if (!dragState.current || event.pointerId !== dragState.current.pointerId) {
5541
5528
  return;
@@ -5617,7 +5604,7 @@ function SplitPane({
5617
5604
  }
5618
5605
 
5619
5606
  // src/components/TagInput/TagInput.tsx
5620
- import { useMemo, useState as useState13 } from "react";
5607
+ import { useMemo, useState as useState10 } from "react";
5621
5608
  import styles39 from "./TagInput.module.css";
5622
5609
  import { jsx as jsx182, jsxs as jsxs151 } from "react/jsx-runtime";
5623
5610
  var DEFAULT_SEPARATORS = /[\n,]+/;
@@ -5639,8 +5626,8 @@ function TagInput({
5639
5626
  "aria-invalid": ariaInvalid,
5640
5627
  "aria-label": ariaLabel
5641
5628
  }) {
5642
- const [draft, setDraft] = useState13("");
5643
- const [localError, setLocalError] = useState13();
5629
+ const [draft, setDraft] = useState10("");
5630
+ const [localError, setLocalError] = useState10();
5644
5631
  const message = error ?? localError ?? hint;
5645
5632
  const messageId = message && id ? `${id}-tag-message` : void 0;
5646
5633
  const describedBy = [ariaDescribedBy, messageId].filter(Boolean).join(" ") || void 0;
@@ -5752,7 +5739,7 @@ function TagInput({
5752
5739
  }
5753
5740
 
5754
5741
  // src/components/Dialog/Dialog.tsx
5755
- 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";
5756
5743
  import { createPortal } from "react-dom";
5757
5744
 
5758
5745
  // src/components/OverlayHeader/OverlayHeader.tsx
@@ -5787,7 +5774,7 @@ var OverlaySecondRowContext = createContext(
5787
5774
  );
5788
5775
  function useOverlaySecondRow(node) {
5789
5776
  const setSecondRow = useContext(OverlaySecondRowContext);
5790
- useEffect4(() => {
5777
+ useEffect5(() => {
5791
5778
  if (!setSecondRow) return;
5792
5779
  setSecondRow(node);
5793
5780
  return () => setSecondRow(null);
@@ -5807,13 +5794,13 @@ function Dialog({
5807
5794
  flush = false,
5808
5795
  children
5809
5796
  }) {
5810
- const panelRef = useRef7(null);
5797
+ const panelRef = useRef8(null);
5811
5798
  const reducedMotion = usePrefersReducedMotion();
5812
5799
  const { mounted, phase } = useMountTransition(
5813
5800
  open,
5814
5801
  reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
5815
5802
  );
5816
- const [secondRow, setSecondRow] = useState14(null);
5803
+ const [secondRow, setSecondRow] = useState11(null);
5817
5804
  const portalTarget = useOverlayPortalTarget();
5818
5805
  useOverlayScrollLock(mounted);
5819
5806
  useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
@@ -5890,7 +5877,7 @@ function Dialog({
5890
5877
  }
5891
5878
 
5892
5879
  // src/components/Drawer/Drawer.tsx
5893
- import { useRef as useRef8 } from "react";
5880
+ import { useRef as useRef9 } from "react";
5894
5881
  import { createPortal as createPortal2 } from "react-dom";
5895
5882
  import styles42 from "./Drawer.module.css";
5896
5883
  import { jsx as jsx185, jsxs as jsxs154 } from "react/jsx-runtime";
@@ -5903,13 +5890,13 @@ function Drawer({
5903
5890
  title,
5904
5891
  children
5905
5892
  }) {
5906
- const panelRef = useRef8(null);
5893
+ const panelRef = useRef9(null);
5907
5894
  const reducedMotion = usePrefersReducedMotion();
5908
5895
  const { mounted, phase } = useMountTransition(
5909
5896
  open,
5910
5897
  reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
5911
5898
  );
5912
- const dragStartY = useRef8(null);
5899
+ const dragStartY = useRef9(null);
5913
5900
  const portalTarget = useOverlayPortalTarget();
5914
5901
  useOverlayScrollLock(mounted);
5915
5902
  useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
@@ -5992,7 +5979,7 @@ function Drawer({
5992
5979
  }
5993
5980
 
5994
5981
  // src/components/Sheet/Sheet.tsx
5995
- import { useRef as useRef9 } from "react";
5982
+ import { useRef as useRef10 } from "react";
5996
5983
  import { createPortal as createPortal3 } from "react-dom";
5997
5984
  import styles43 from "./Sheet.module.css";
5998
5985
  import { jsx as jsx186, jsxs as jsxs155 } from "react/jsx-runtime";
@@ -6006,7 +5993,7 @@ function Sheet({
6006
5993
  slideFrom = "bottom",
6007
5994
  children
6008
5995
  }) {
6009
- const panelRef = useRef9(null);
5996
+ const panelRef = useRef10(null);
6010
5997
  const reducedMotion = usePrefersReducedMotion();
6011
5998
  const { mounted, phase } = useMountTransition(
6012
5999
  open,
@@ -6042,7 +6029,7 @@ function Sheet({
6042
6029
  }
6043
6030
 
6044
6031
  // src/components/ConfirmDialog/ConfirmDialog.tsx
6045
- import { useEffect as useEffect5, useRef as useRef10 } from "react";
6032
+ import { useEffect as useEffect6, useRef as useRef11 } from "react";
6046
6033
  import styles44 from "./ConfirmDialog.module.css";
6047
6034
  import { jsx as jsx187, jsxs as jsxs156 } from "react/jsx-runtime";
6048
6035
  function ConfirmDialog({
@@ -6057,19 +6044,19 @@ function ConfirmDialog({
6057
6044
  pending = false,
6058
6045
  error
6059
6046
  }) {
6060
- const dialogRef = useRef10(null);
6061
- useEffect5(() => {
6047
+ const dialogRef = useRef11(null);
6048
+ useEffect6(() => {
6062
6049
  if (!open) return;
6063
6050
  const id = registerOpenOverlay();
6064
6051
  return () => unregisterOpenOverlay(id);
6065
6052
  }, [open]);
6066
- useEffect5(() => {
6053
+ useEffect6(() => {
6067
6054
  const el = dialogRef.current;
6068
6055
  if (!el) return;
6069
6056
  if (open) el.showModal();
6070
6057
  else el.close();
6071
6058
  }, [open]);
6072
- useEffect5(() => {
6059
+ useEffect6(() => {
6073
6060
  const el = dialogRef.current;
6074
6061
  if (!el) return;
6075
6062
  const handleClose = () => onClose();
@@ -6129,7 +6116,7 @@ function ConfirmDialog({
6129
6116
  }
6130
6117
 
6131
6118
  // src/components/ExportPanel/ExportPanel.tsx
6132
- 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";
6133
6120
  import styles45 from "./ExportPanel.module.css";
6134
6121
  import { jsx as jsx188, jsxs as jsxs157 } from "react/jsx-runtime";
6135
6122
  function size(bytes) {
@@ -6159,8 +6146,8 @@ function ExportPanel({
6159
6146
  passwordHint = "We ask again because the export holds everything listed above.",
6160
6147
  timeZone = "UTC"
6161
6148
  }) {
6162
- const [password, setPassword] = useState15("");
6163
- const [open, setOpen] = useState15(false);
6149
+ const box = useRef12(null);
6150
+ const [open, setOpen] = useState12(false);
6164
6151
  const [state, start, pending] = useActionState2(
6165
6152
  async (_previous, typed) => {
6166
6153
  let result;
@@ -6174,14 +6161,14 @@ function ExportPanel({
6174
6161
  }
6175
6162
  if (result.ok) {
6176
6163
  setOpen(false);
6177
- setPassword("");
6164
+ if (box.current) box.current.value = "";
6178
6165
  onRefresh?.();
6179
6166
  }
6180
6167
  return result;
6181
6168
  },
6182
6169
  null
6183
6170
  );
6184
- useEffect6(() => {
6171
+ useEffect7(() => {
6185
6172
  if (status.state !== "making" || !onRefresh) return void 0;
6186
6173
  const timer = setInterval(onRefresh, 5e3);
6187
6174
  return () => clearInterval(timer);
@@ -6227,7 +6214,7 @@ function ExportPanel({
6227
6214
  className: styles45.form,
6228
6215
  onSubmit: (event) => {
6229
6216
  event.preventDefault();
6230
- if (password !== "" && !disabled) setOpen(true);
6217
+ if (box.current?.value && !disabled) setOpen(true);
6231
6218
  },
6232
6219
  children: [
6233
6220
  disabledReason ? /* @__PURE__ */ jsx188("p", { className: styles45.hint, children: disabledReason }) : null,
@@ -6238,11 +6225,10 @@ function ExportPanel({
6238
6225
  type: "password",
6239
6226
  autoComplete: "current-password",
6240
6227
  disabled,
6241
- value: password,
6242
- onChange: (event) => setPassword(event.target.value)
6228
+ ref: box
6243
6229
  }
6244
6230
  ) }),
6245
- /* @__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 }) }),
6246
6232
  state && !state.ok && !open ? /* @__PURE__ */ jsx188(Alert, { variant: "error", children: state.error }) : null,
6247
6233
  /* @__PURE__ */ jsx188(
6248
6234
  ConfirmDialog,
@@ -6254,7 +6240,10 @@ function ExportPanel({
6254
6240
  confirmLabel: pending ? "Starting\u2026" : startLabel,
6255
6241
  pending,
6256
6242
  error: state && !state.ok ? state.error : void 0,
6257
- onConfirm: () => startTransition(() => start(password))
6243
+ onConfirm: () => {
6244
+ const typed = box.current?.value ?? "";
6245
+ startTransition(() => start(typed));
6246
+ }
6258
6247
  }
6259
6248
  )
6260
6249
  ]
@@ -6264,13 +6253,13 @@ function ExportPanel({
6264
6253
  }
6265
6254
 
6266
6255
  // src/hooks/useLongPress.ts
6267
- 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";
6268
6257
  var DEFAULT_DELAY_MS = 500;
6269
6258
  var DEFAULT_MOVE_TOLERANCE_PX = 10;
6270
6259
  var DEFAULT_SUPPRESS_CLICK_MS = 700;
6271
6260
  function usePrefersCoarsePointer() {
6272
- const [coarse, setCoarse] = useState16(false);
6273
- useEffect7(() => {
6261
+ const [coarse, setCoarse] = useState13(false);
6262
+ useEffect8(() => {
6274
6263
  const mql = window.matchMedia("(pointer: coarse)");
6275
6264
  setCoarse(mql.matches);
6276
6265
  function handleChange(e) {
@@ -6289,16 +6278,16 @@ function useLongPress({
6289
6278
  vibrate = true,
6290
6279
  disabled = false
6291
6280
  }) {
6292
- const timerRef = useRef11(null);
6293
- const startRef = useRef11(null);
6294
- const suppressUntilRef = useRef11(0);
6281
+ const timerRef = useRef13(null);
6282
+ const startRef = useRef13(null);
6283
+ const suppressUntilRef = useRef13(0);
6295
6284
  const clearTimer = useCallback2(() => {
6296
6285
  if (timerRef.current) {
6297
6286
  clearTimeout(timerRef.current);
6298
6287
  timerRef.current = null;
6299
6288
  }
6300
6289
  }, []);
6301
- useEffect7(() => clearTimer, [clearTimer]);
6290
+ useEffect8(() => clearTimer, [clearTimer]);
6302
6291
  const onPointerDown = useCallback2(
6303
6292
  (e) => {
6304
6293
  if (disabled || e.pointerType !== "touch") return;
@@ -6358,10 +6347,10 @@ function useLongPress({
6358
6347
  }
6359
6348
 
6360
6349
  // src/hooks/useDoubleTap.ts
6361
- import { useRef as useRef12 } from "react";
6350
+ import { useRef as useRef14 } from "react";
6362
6351
  var DOUBLE_TAP_MS = 350;
6363
6352
  function useDoubleTapHandler(onDoubleTap) {
6364
- const lastTime = useRef12(0);
6353
+ const lastTime = useRef14(0);
6365
6354
  return (e) => {
6366
6355
  if (e.detail === 2) {
6367
6356
  onDoubleTap(e);
@@ -6377,7 +6366,7 @@ function useDoubleTapHandler(onDoubleTap) {
6377
6366
  };
6378
6367
  }
6379
6368
  function useSingleOrDoubleTap(onSingle, onDouble) {
6380
- const timer = useRef12(null);
6369
+ const timer = useRef14(null);
6381
6370
  return (e) => {
6382
6371
  if (e.detail === 2) {
6383
6372
  if (timer.current) {
@@ -6401,11 +6390,11 @@ function useSingleOrDoubleTap(onSingle, onDouble) {
6401
6390
  }
6402
6391
 
6403
6392
  // src/hooks/useIsMobile.ts
6404
- import { useEffect as useEffect8, useState as useState17 } from "react";
6393
+ import { useEffect as useEffect9, useState as useState14 } from "react";
6405
6394
  var MOBILE_BREAKPOINT_PX = 768;
6406
6395
  function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
6407
- const [isMobile, setIsMobile] = useState17(false);
6408
- useEffect8(() => {
6396
+ const [isMobile, setIsMobile] = useState14(false);
6397
+ useEffect9(() => {
6409
6398
  const mql = window.matchMedia(`(max-width: ${breakpointPx}px)`);
6410
6399
  setIsMobile(mql.matches);
6411
6400
  function handleChange(e) {
@@ -6418,10 +6407,10 @@ function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
6418
6407
  }
6419
6408
 
6420
6409
  // src/hooks/useIsOffline.ts
6421
- import { useEffect as useEffect9, useState as useState18 } from "react";
6410
+ import { useEffect as useEffect10, useState as useState15 } from "react";
6422
6411
  function useIsOffline() {
6423
- const [isOffline, setIsOffline] = useState18(false);
6424
- useEffect9(() => {
6412
+ const [isOffline, setIsOffline] = useState15(false);
6413
+ useEffect10(() => {
6425
6414
  setIsOffline(!navigator.onLine);
6426
6415
  const handleOffline = () => setIsOffline(true);
6427
6416
  const handleOnline = () => setIsOffline(false);
@@ -6454,7 +6443,7 @@ function useCommitOnEnterOrBlur(onCommit) {
6454
6443
  }
6455
6444
 
6456
6445
  // src/hooks/useSwipeReveal.ts
6457
- import { useRef as useRef13 } from "react";
6446
+ import { useRef as useRef15 } from "react";
6458
6447
  function useSwipeReveal({
6459
6448
  revealWidth,
6460
6449
  open,
@@ -6462,8 +6451,8 @@ function useSwipeReveal({
6462
6451
  onClose,
6463
6452
  disabled = false
6464
6453
  }) {
6465
- const rowRef = useRef13(null);
6466
- const dragState = useRef13(null);
6454
+ const rowRef = useRef15(null);
6455
+ const dragState = useRef15(null);
6467
6456
  function onPointerDown(e) {
6468
6457
  if (disabled) return;
6469
6458
  e.currentTarget.setPointerCapture(e.pointerId);
@@ -6507,23 +6496,23 @@ function useSwipeReveal({
6507
6496
  }
6508
6497
 
6509
6498
  // src/hooks/useSnapCarousel.ts
6510
- 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";
6511
6500
  function useSnapCarousel({
6512
6501
  itemCount,
6513
6502
  onSettle,
6514
6503
  debounceMs = 120,
6515
6504
  initialIndex = 0
6516
6505
  }) {
6517
- const scrollRef = useRef14(null);
6518
- const timerRef = useRef14(null);
6519
- const lastIndexRef = useRef14(null);
6520
- const restoreSnapRef = useRef14(null);
6521
- const [liveIndex, setLiveIndex] = useState19(initialIndex);
6522
- 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);
6523
6512
  onSettleRef.current = onSettle;
6524
- const lastGestureAtRef = useRef14(0);
6525
- const chainTrustedRef = useRef14(false);
6526
- useEffect10(() => {
6513
+ const lastGestureAtRef = useRef16(0);
6514
+ const chainTrustedRef = useRef16(false);
6515
+ useEffect11(() => {
6527
6516
  const el = scrollRef.current;
6528
6517
  if (!el) return;
6529
6518
  function noteGesture() {
@@ -6627,23 +6616,23 @@ function useResponsiveLayout({
6627
6616
  }
6628
6617
 
6629
6618
  // src/hooks/useCarouselRouteSync.ts
6630
- 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";
6631
6620
  function useCarouselRouteSync({
6632
6621
  indexForPathname,
6633
6622
  pathForIndex,
6634
6623
  pathname,
6635
6624
  onNavigate
6636
6625
  }) {
6637
- const indexForPathnameRef = useRef15(indexForPathname);
6626
+ const indexForPathnameRef = useRef17(indexForPathname);
6638
6627
  indexForPathnameRef.current = indexForPathname;
6639
- const pathForIndexRef = useRef15(pathForIndex);
6628
+ const pathForIndexRef = useRef17(pathForIndex);
6640
6629
  pathForIndexRef.current = pathForIndex;
6641
- const onNavigateRef = useRef15(onNavigate);
6630
+ const onNavigateRef = useRef17(onNavigate);
6642
6631
  onNavigateRef.current = onNavigate;
6643
- const [activeIndex, setActiveIndex] = useState20(() => indexForPathname(pathname));
6644
- const isInternalNavRef = useRef15(false);
6645
- const didMountRef = useRef15(false);
6646
- useEffect11(() => {
6632
+ const [activeIndex, setActiveIndex] = useState17(() => indexForPathname(pathname));
6633
+ const isInternalNavRef = useRef17(false);
6634
+ const didMountRef = useRef17(false);
6635
+ useEffect12(() => {
6647
6636
  if (!didMountRef.current) {
6648
6637
  didMountRef.current = true;
6649
6638
  return;
@@ -6714,7 +6703,7 @@ function useReorderSensors(options = {}) {
6714
6703
  }
6715
6704
 
6716
6705
  // src/hooks/useSwipeStack.ts
6717
- import { useRef as useRef16 } from "react";
6706
+ import { useRef as useRef18 } from "react";
6718
6707
  var DEADZONE_PX = 8;
6719
6708
  var ROTATION_RANGE_PX = 240;
6720
6709
  var ROTATION_MAX_DEG = 12;
@@ -6747,9 +6736,9 @@ function useSwipeStack({
6747
6736
  onCommit,
6748
6737
  disabled = false
6749
6738
  }) {
6750
- const cardRef = useRef16(null);
6751
- const wrapRef = useRef16(null);
6752
- const dragState = useRef16(null);
6739
+ const cardRef = useRef18(null);
6740
+ const wrapRef = useRef18(null);
6741
+ const dragState = useRef18(null);
6753
6742
  const live = new Set(directions);
6754
6743
  function writeProgress(direction, progress) {
6755
6744
  const wrap = wrapRef.current;
@@ -6925,7 +6914,7 @@ function Menu({
6925
6914
  }
6926
6915
 
6927
6916
  // src/components/UserMenu/UserMenu.tsx
6928
- import { useState as useState21 } from "react";
6917
+ import { useState as useState18 } from "react";
6929
6918
  import styles47 from "./UserMenu.module.css";
6930
6919
  import { jsx as jsx190, jsxs as jsxs159 } from "react/jsx-runtime";
6931
6920
  function initials(value) {
@@ -6943,7 +6932,7 @@ function UserMenu({
6943
6932
  align = "right",
6944
6933
  size: size2 = "md"
6945
6934
  }) {
6946
- const [open, setOpen] = useState21(false);
6935
+ const [open, setOpen] = useState18(false);
6947
6936
  const displayName = name || email || "";
6948
6937
  return /* @__PURE__ */ jsxs159(
6949
6938
  Popover,
@@ -6992,7 +6981,7 @@ function UserMenu({
6992
6981
  }
6993
6982
 
6994
6983
  // src/components/AppsLauncher/AppsLauncher.tsx
6995
- import { useState as useState22 } from "react";
6984
+ import { useState as useState19 } from "react";
6996
6985
 
6997
6986
  // src/components/Spinner/Spinner.tsx
6998
6987
  import styles48 from "./Spinner.module.css";
@@ -7043,7 +7032,7 @@ function AppsLauncher({
7043
7032
  "aria-label": ariaLabel = "Apps",
7044
7033
  align = "right"
7045
7034
  }) {
7046
- const [open, setOpen] = useState22(false);
7035
+ const [open, setOpen] = useState19(false);
7047
7036
  return /* @__PURE__ */ jsxs160(
7048
7037
  Popover,
7049
7038
  {
@@ -7073,7 +7062,7 @@ function AppsLauncher({
7073
7062
  }
7074
7063
 
7075
7064
  // src/components/NotificationsPanel/NotificationsPanel.tsx
7076
- import { useState as useState23 } from "react";
7065
+ import { useState as useState20 } from "react";
7077
7066
  import styles50 from "./NotificationsPanel.module.css";
7078
7067
  import { Fragment as Fragment10, jsx as jsx193, jsxs as jsxs161 } from "react/jsx-runtime";
7079
7068
  function NotificationRow({ item }) {
@@ -7118,7 +7107,7 @@ function NotificationsPanel({
7118
7107
  align = "right",
7119
7108
  viewAllHref
7120
7109
  }) {
7121
- const [open, setOpen] = useState23(false);
7110
+ const [open, setOpen] = useState20(false);
7122
7111
  return /* @__PURE__ */ jsxs161(
7123
7112
  Popover,
7124
7113
  {
@@ -7177,11 +7166,11 @@ import {
7177
7166
  createContext as createContext2,
7178
7167
  useCallback as useCallback4,
7179
7168
  useContext as useContext2,
7180
- useEffect as useEffect12,
7169
+ useEffect as useEffect13,
7181
7170
  useId as useId4,
7182
7171
  useMemo as useMemo2,
7183
- useRef as useRef17,
7184
- useState as useState24
7172
+ useRef as useRef19,
7173
+ useState as useState21
7185
7174
  } from "react";
7186
7175
  import styles51 from "./Toast.module.css";
7187
7176
  import { jsx as jsx194, jsxs as jsxs162 } from "react/jsx-runtime";
@@ -7192,10 +7181,10 @@ function useToast() {
7192
7181
  return ctx;
7193
7182
  }
7194
7183
  function ToastProvider({ children }) {
7195
- const [toasts, setToasts] = useState24([]);
7196
- const timers = useRef17(/* @__PURE__ */ new Map());
7184
+ const [toasts, setToasts] = useState21([]);
7185
+ const timers = useRef19(/* @__PURE__ */ new Map());
7197
7186
  const seedId = useId4();
7198
- const counter = useRef17(0);
7187
+ const counter = useRef19(0);
7199
7188
  const dismiss = useCallback4((id) => {
7200
7189
  setToasts((prev) => prev.map((t) => t.id === id ? { ...t, exiting: true } : t));
7201
7190
  setTimeout(() => {
@@ -7215,7 +7204,7 @@ function ToastProvider({ children }) {
7215
7204
  },
7216
7205
  [seedId, dismiss]
7217
7206
  );
7218
- useEffect12(() => {
7207
+ useEffect13(() => {
7219
7208
  const currentTimers = timers.current;
7220
7209
  return () => {
7221
7210
  currentTimers.forEach((t) => clearTimeout(t));
@@ -7576,7 +7565,7 @@ function Header({
7576
7565
  }
7577
7566
 
7578
7567
  // src/components/MobileHeader/MobileHeader.tsx
7579
- import { useRef as useRef18 } from "react";
7568
+ import { useRef as useRef20 } from "react";
7580
7569
 
7581
7570
  // src/hooks/usePublishShellChromeHeight.ts
7582
7571
  import { useLayoutEffect as useLayoutEffect3 } from "react";
@@ -7619,7 +7608,7 @@ function MobileHeader({
7619
7608
  className,
7620
7609
  ...rest
7621
7610
  }) {
7622
- const headerRef = useRef18(null);
7611
+ const headerRef = useRef20(null);
7623
7612
  usePublishShellChromeHeight(headerRef, "--sv-shell-header-height");
7624
7613
  const cls = [styles57.header, className].filter(Boolean).join(" ");
7625
7614
  return /* @__PURE__ */ jsxs167("div", { className: cls, ...rest, ref: headerRef, children: [
@@ -7635,7 +7624,7 @@ function MobileHeader({
7635
7624
  }
7636
7625
 
7637
7626
  // src/components/MobileFooter/MobileFooter.tsx
7638
- import { useRef as useRef19 } from "react";
7627
+ import { useRef as useRef21 } from "react";
7639
7628
  import styles58 from "./MobileFooter.module.css";
7640
7629
  import { jsx as jsx202, jsxs as jsxs168 } from "react/jsx-runtime";
7641
7630
  function FooterNavItem({ icon, label, href, onClick, active }) {
@@ -7669,7 +7658,7 @@ function MobileFooter({
7669
7658
  `MobileFooter: leftIcons (${leftIcons.length}) and rightIcons (${rightIcons.length}) must have the same length so the launcher stays visually centered.`
7670
7659
  );
7671
7660
  }
7672
- const navRef = useRef19(null);
7661
+ const navRef = useRef21(null);
7673
7662
  usePublishShellChromeHeight(navRef, "--sv-shell-footer-height");
7674
7663
  const cls = [styles58.footer, className].filter(Boolean).join(" ");
7675
7664
  const launcherClassName = [
@@ -7753,7 +7742,7 @@ function LockedState({ reason, appName, sharedBy, action, className }) {
7753
7742
  }
7754
7743
 
7755
7744
  // src/components/RecoveryKit/RecoveryKit.tsx
7756
- import { useState as useState25 } from "react";
7745
+ import { useState as useState22 } from "react";
7757
7746
 
7758
7747
  // src/components/Checkbox/Checkbox.tsx
7759
7748
  import styles61 from "./Checkbox.module.css";
@@ -7834,7 +7823,7 @@ function RecoveryKit({
7834
7823
  ownerCanRecover = false,
7835
7824
  className
7836
7825
  }) {
7837
- const [kept2, setKept] = useState25(false);
7826
+ const [kept2, setKept] = useState22(false);
7838
7827
  const groups = kit.split(/[\s-]+/).filter(Boolean);
7839
7828
  const save = () => {
7840
7829
  const url = URL.createObjectURL(
@@ -7921,7 +7910,7 @@ function OfflineGate({ children, surfaceName, className }) {
7921
7910
  }
7922
7911
 
7923
7912
  // src/components/InstallPrompt/InstallPrompt.tsx
7924
- 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";
7925
7914
  import styles63 from "./InstallPrompt.module.css";
7926
7915
  import { jsx as jsx209, jsxs as jsxs173 } from "react/jsx-runtime";
7927
7916
  var IOS_INSTALL_STEPS = "tap Share, then Add to Home Screen.";
@@ -7973,9 +7962,9 @@ function writeDismissed(key) {
7973
7962
  }
7974
7963
  }
7975
7964
  function useInstallPrompt(storageKey = "sv-install-dismissed") {
7976
- const [kind, setKind] = useState26(null);
7977
- const [deferred, setDeferred] = useState26(null);
7978
- useEffect13(() => {
7965
+ const [kind, setKind] = useState23(null);
7966
+ const [deferred, setDeferred] = useState23(null);
7967
+ useEffect14(() => {
7979
7968
  if (isInstalledDisplay() || readDismissed(storageKey)) return;
7980
7969
  if (isAppleMobile()) setKind("ios");
7981
7970
  const offered = (event) => {
@@ -8445,7 +8434,7 @@ function Barcode({
8445
8434
  }
8446
8435
 
8447
8436
  // src/components/AppFrame/AppFrame.tsx
8448
- import { useRef as useRef20, useState as useState28 } from "react";
8437
+ import { useRef as useRef22, useState as useState25 } from "react";
8449
8438
 
8450
8439
  // src/components/AppSidebar/AppSidebar.tsx
8451
8440
  import styles67 from "./AppSidebar.module.css";
@@ -8631,7 +8620,7 @@ function ActionRow({
8631
8620
  }
8632
8621
 
8633
8622
  // src/components/AppSidebar/useAppSidebar.ts
8634
- 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";
8635
8624
 
8636
8625
  // src/components/AppSidebar/sidebar-state.ts
8637
8626
  var STATES = ["full", "rail", "hidden"];
@@ -8687,8 +8676,8 @@ function read(key) {
8687
8676
  function useAppSidebar(appId, pageKind, fallback = "full") {
8688
8677
  const key = sidebarStorageKey(appId);
8689
8678
  const mobile = useIsMobile();
8690
- const [stored, setStored] = useState27({});
8691
- useEffect14(() => {
8679
+ const [stored, setStored] = useState24({});
8680
+ useEffect15(() => {
8692
8681
  const load = () => setStored(parseSidebarStored(read(key)));
8693
8682
  load();
8694
8683
  const onStorage = (event) => {
@@ -8750,7 +8739,7 @@ function AppFrame({
8750
8739
  const words = { ...LABELS, ...labels };
8751
8740
  const mobile = useIsMobile();
8752
8741
  const sidebar = useAppSidebar(appId, pageKind, defaultSidebar);
8753
- const [navOpen, setNavOpen] = useState28(false);
8742
+ const [navOpen, setNavOpen] = useState25(false);
8754
8743
  const hidden = sidebar.state === "hidden";
8755
8744
  const sidebarButton = /* @__PURE__ */ jsx214(
8756
8745
  "button",
@@ -8846,13 +8835,13 @@ function AppFrame({
8846
8835
  ] });
8847
8836
  }
8848
8837
  function HeaderRow({ children }) {
8849
- const ref = useRef20(null);
8838
+ const ref = useRef22(null);
8850
8839
  usePublishShellChromeHeight(ref, "--sv-shell-header-height");
8851
8840
  return /* @__PURE__ */ jsx214("div", { ref, className: styles68.headerRow, children });
8852
8841
  }
8853
8842
 
8854
8843
  // src/components/SettingsDialog/SettingsDialog.tsx
8855
- import { useId as useId6, useState as useState29 } from "react";
8844
+ import { useId as useId6, useState as useState26 } from "react";
8856
8845
  import styles69 from "./SettingsDialog.module.css";
8857
8846
  import { Fragment as Fragment17, jsx as jsx215, jsxs as jsxs179 } from "react/jsx-runtime";
8858
8847
  function SettingsDialog({
@@ -8868,7 +8857,7 @@ function SettingsDialog({
8868
8857
  size: size2 = "lg",
8869
8858
  renderLink
8870
8859
  }) {
8871
- const [query, setQuery] = useState29("");
8860
+ const [query, setQuery] = useState26("");
8872
8861
  const navId = useId6();
8873
8862
  const all = groups.flatMap((group) => group.sections);
8874
8863
  const shown = all.find((section) => section.id === active) ?? all[0];
@@ -9035,7 +9024,7 @@ function DeviceStorageKeyGate({
9035
9024
  }
9036
9025
 
9037
9026
  // src/components/Avatar/Avatar.tsx
9038
- import { useState as useState30 } from "react";
9027
+ import { useState as useState27 } from "react";
9039
9028
  import styles70 from "./Avatar.module.css";
9040
9029
  import { jsx as jsx218 } from "react/jsx-runtime";
9041
9030
  function initials2(name) {
@@ -9049,7 +9038,7 @@ var sizeClass2 = {
9049
9038
  lg: styles70.lg
9050
9039
  };
9051
9040
  function Avatar({ name, src, size: size2 = "md", className }) {
9052
- const [imgFailed, setImgFailed] = useState30(false);
9041
+ const [imgFailed, setImgFailed] = useState27(false);
9053
9042
  const cls = [styles70.avatar, sizeClass2[size2], className].filter(Boolean).join(" ");
9054
9043
  if (src && !imgFailed) {
9055
9044
  return /* @__PURE__ */ jsx218("span", { className: cls, "aria-label": name, children: /* @__PURE__ */ jsx218("img", { src, alt: name, className: styles70.img, onError: () => setImgFailed(true) }) });
@@ -9585,14 +9574,14 @@ function FloatingActionButton({
9585
9574
  }
9586
9575
 
9587
9576
  // src/components/PhotoViewer/PhotoGrid.tsx
9588
- import { useState as useState32 } from "react";
9577
+ import { useState as useState29 } from "react";
9589
9578
 
9590
9579
  // src/components/PhotoViewer/PhotoViewer.tsx
9591
9580
  import {
9592
9581
  useCallback as useCallback7,
9593
- useEffect as useEffect15,
9594
- useRef as useRef21,
9595
- useState as useState31
9582
+ useEffect as useEffect16,
9583
+ useRef as useRef23,
9584
+ useState as useState28
9596
9585
  } from "react";
9597
9586
  import { createPortal as createPortal4 } from "react-dom";
9598
9587
 
@@ -9661,9 +9650,9 @@ function PhotoViewer({
9661
9650
  onClose,
9662
9651
  label = "Photos"
9663
9652
  }) {
9664
- const panelRef = useRef21(null);
9665
- const stageRef = useRef21(null);
9666
- const imageRef = useRef21(null);
9653
+ const panelRef = useRef23(null);
9654
+ const stageRef = useRef23(null);
9655
+ const imageRef = useRef23(null);
9667
9656
  const reducedMotion = usePrefersReducedMotion();
9668
9657
  const { mounted, phase } = useMountTransition(
9669
9658
  open,
@@ -9676,13 +9665,13 @@ function PhotoViewer({
9676
9665
  const count = photos.length;
9677
9666
  const current2 = clamp2(index, 0, Math.max(0, count - 1));
9678
9667
  const photo = photos[current2];
9679
- const [scale, setScale] = useState31(MIN_SCALE);
9680
- const [pan, setPan] = useState31({ x: 0, y: 0 });
9681
- const [drag, setDrag] = useState31({ x: 0, y: 0 });
9682
- const [dragging, setDragging] = useState31(false);
9683
- const [failed, setFailed] = useState31(false);
9684
- const pointers = useRef21(/* @__PURE__ */ new Map());
9685
- 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({
9686
9675
  startScale: 1,
9687
9676
  startPan: { x: 0, y: 0 },
9688
9677
  startDistance: 0,
@@ -9692,14 +9681,14 @@ function PhotoViewer({
9692
9681
  moved: false,
9693
9682
  pinched: false
9694
9683
  });
9695
- const lastTap = useRef21(void 0);
9696
- useEffect15(() => {
9684
+ const lastTap = useRef23(void 0);
9685
+ useEffect16(() => {
9697
9686
  setScale(MIN_SCALE);
9698
9687
  setPan({ x: 0, y: 0 });
9699
9688
  setDrag({ x: 0, y: 0 });
9700
9689
  setFailed(false);
9701
9690
  }, [current2, open]);
9702
- useEffect15(() => {
9691
+ useEffect16(() => {
9703
9692
  if (!open) return;
9704
9693
  for (const next of [photos[current2 - 1], photos[current2 + 1]]) {
9705
9694
  if (next) new Image().src = next.src;
@@ -9732,7 +9721,7 @@ function PhotoViewer({
9732
9721
  },
9733
9722
  [scale, sizes]
9734
9723
  );
9735
- useEffect15(() => {
9724
+ useEffect16(() => {
9736
9725
  if (!open) return;
9737
9726
  function onKey(event) {
9738
9727
  if (event.key === "ArrowRight") go(1);
@@ -9977,8 +9966,8 @@ function PhotoGrid({ photos, onOpen, label = "Photos", className }) {
9977
9966
  ) }, photo.id)) });
9978
9967
  }
9979
9968
  function PhotoGallery({ photos, label, className, onView }) {
9980
- const [open, setOpen] = useState32(false);
9981
- const [index, setIndex] = useState32(0);
9969
+ const [open, setOpen] = useState29(false);
9970
+ const [index, setIndex] = useState29(0);
9982
9971
  return /* @__PURE__ */ jsxs190(Fragment23, { children: [
9983
9972
  /* @__PURE__ */ jsx239(
9984
9973
  PhotoGrid,
@@ -10036,15 +10025,15 @@ function Message({ sender, children, pending, actions, className }) {
10036
10025
  }
10037
10026
 
10038
10027
  // src/components/MessageScroller/MessageScroller.tsx
10039
- 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";
10040
10029
  import styles94 from "./MessageScroller.module.css";
10041
10030
  import { jsx as jsx242, jsxs as jsxs192 } from "react/jsx-runtime";
10042
10031
  var NEAR_BOTTOM_THRESHOLD_PX = 80;
10043
10032
  function MessageScroller({ children, className }) {
10044
- const containerRef = useRef22(null);
10045
- const isNearBottomRef = useRef22(true);
10046
- const [hasNewMessages, setHasNewMessages] = useState33(false);
10047
- useEffect16(() => {
10033
+ const containerRef = useRef24(null);
10034
+ const isNearBottomRef = useRef24(true);
10035
+ const [hasNewMessages, setHasNewMessages] = useState30(false);
10036
+ useEffect17(() => {
10048
10037
  const el = containerRef.current;
10049
10038
  if (!el) return;
10050
10039
  if (isNearBottomRef.current) {
@@ -10079,14 +10068,14 @@ function MessageScroller({ children, className }) {
10079
10068
  }
10080
10069
 
10081
10070
  // src/components/HoverCard/HoverCard.tsx
10082
- 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";
10083
10072
  import styles95 from "./HoverCard.module.css";
10084
10073
  import { jsx as jsx243 } from "react/jsx-runtime";
10085
10074
  var OPEN_DELAY_MS = 400;
10086
10075
  var CLOSE_DELAY_MS = 150;
10087
10076
  function useHoverCapable() {
10088
- const [hoverCapable, setHoverCapable] = useState34(true);
10089
- useEffect17(() => {
10077
+ const [hoverCapable, setHoverCapable] = useState31(true);
10078
+ useEffect18(() => {
10090
10079
  const mql = window.matchMedia("(hover: hover)");
10091
10080
  setHoverCapable(mql.matches);
10092
10081
  function handleChange(e) {
@@ -10104,10 +10093,10 @@ function HoverCard({
10104
10093
  width,
10105
10094
  "aria-label": ariaLabel
10106
10095
  }) {
10107
- const [open, setOpen] = useState34(false);
10096
+ const [open, setOpen] = useState31(false);
10108
10097
  const hoverCapable = useHoverCapable();
10109
- const openTimer = useRef23(void 0);
10110
- const closeTimer = useRef23(void 0);
10098
+ const openTimer = useRef25(void 0);
10099
+ const closeTimer = useRef25(void 0);
10111
10100
  function scheduleOpen() {
10112
10101
  clearTimeout(closeTimer.current);
10113
10102
  openTimer.current = setTimeout(() => setOpen(true), OPEN_DELAY_MS);
@@ -10149,12 +10138,12 @@ function HoverCard({
10149
10138
  }
10150
10139
 
10151
10140
  // src/components/ContextMenu/ContextMenu.tsx
10152
- import { cloneElement as cloneElement2, useState as useState35 } from "react";
10141
+ import { cloneElement as cloneElement2, useState as useState32 } from "react";
10153
10142
  import { Fragment as Fragment24, jsx as jsx244, jsxs as jsxs193 } from "react/jsx-runtime";
10154
10143
  function ContextMenu({ children, items, "aria-label": ariaLabel }) {
10155
10144
  const isMobile = useIsMobile();
10156
- const [open, setOpen] = useState35(false);
10157
- const [point, setPoint] = useState35({ x: 0, y: 0 });
10145
+ const [open, setOpen] = useState32(false);
10146
+ const [point, setPoint] = useState32({ x: 0, y: 0 });
10158
10147
  const longPressHandlers = useLongPress({
10159
10148
  onLongPress: () => setOpen(true),
10160
10149
  disabled: !isMobile
@@ -10200,7 +10189,7 @@ function ContextMenu({ children, items, "aria-label": ariaLabel }) {
10200
10189
  }
10201
10190
 
10202
10191
  // src/components/NavigationMenu/NavigationMenu.tsx
10203
- import { useRef as useRef24, useState as useState36 } from "react";
10192
+ import { useRef as useRef26, useState as useState33 } from "react";
10204
10193
  import styles96 from "./NavigationMenu.module.css";
10205
10194
  import { jsx as jsx245 } from "react/jsx-runtime";
10206
10195
  function NavigationMenu({
@@ -10208,8 +10197,8 @@ function NavigationMenu({
10208
10197
  renderLink,
10209
10198
  "aria-label": ariaLabel
10210
10199
  }) {
10211
- const [openIndex, setOpenIndex] = useState36(null);
10212
- const triggerRefs = useRef24([]);
10200
+ const [openIndex, setOpenIndex] = useState33(null);
10201
+ const triggerRefs = useRef26([]);
10213
10202
  function handleKeyDown(e, index) {
10214
10203
  if (e.key === "Escape") {
10215
10204
  setOpenIndex(null);
@@ -10283,7 +10272,7 @@ function Menubar({ menus, "aria-label": ariaLabel = "Menu bar" }) {
10283
10272
  }
10284
10273
 
10285
10274
  // src/components/Command/Command.tsx
10286
- 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";
10287
10276
  import styles97 from "./Command.module.css";
10288
10277
  import { jsx as jsx247, jsxs as jsxs194 } from "react/jsx-runtime";
10289
10278
  function matches(item, query) {
@@ -10298,15 +10287,15 @@ function Command({
10298
10287
  placeholder = "Type a command\u2026",
10299
10288
  "aria-label": ariaLabel = "Command palette"
10300
10289
  }) {
10301
- const [query, setQuery] = useState37("");
10302
- const [highlightedIndex, setHighlightedIndex] = useState37(0);
10303
- const inputRef = useRef25(null);
10290
+ const [query, setQuery] = useState34("");
10291
+ const [highlightedIndex, setHighlightedIndex] = useState34(0);
10292
+ const inputRef = useRef27(null);
10304
10293
  const listId = useId11();
10305
10294
  const filtered = useMemo3(() => items.filter((item) => matches(item, query)), [items, query]);
10306
- useEffect18(() => {
10295
+ useEffect19(() => {
10307
10296
  setHighlightedIndex(0);
10308
10297
  }, [query, open]);
10309
- useEffect18(() => {
10298
+ useEffect19(() => {
10310
10299
  if (open) {
10311
10300
  setQuery("");
10312
10301
  requestAnimationFrame(() => inputRef.current?.focus());
@@ -10394,7 +10383,7 @@ function Command({
10394
10383
  }
10395
10384
 
10396
10385
  // src/components/Resizable/Resizable.tsx
10397
- 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";
10398
10387
  import styles98 from "./Resizable.module.css";
10399
10388
  import { jsx as jsx248 } from "react/jsx-runtime";
10400
10389
  function ResizablePanel({ children, className, style }) {
@@ -10440,16 +10429,16 @@ function ResizablePanelGroup({ direction, children, className }) {
10440
10429
  maxSize: props.maxSize ?? 90
10441
10430
  };
10442
10431
  });
10443
- const [sizes, setSizes] = useState38(() => constraints.map((c) => c.defaultSize));
10432
+ const [sizes, setSizes] = useState35(() => constraints.map((c) => c.defaultSize));
10444
10433
  if (sizes.length !== constraints.length) {
10445
10434
  setSizes(constraints.map((c) => c.defaultSize));
10446
10435
  }
10447
- const containerRef = useRef26(null);
10448
- const constraintsRef = useRef26(constraints);
10436
+ const containerRef = useRef28(null);
10437
+ const constraintsRef = useRef28(constraints);
10449
10438
  constraintsRef.current = constraints;
10450
- const directionRef = useRef26(direction);
10439
+ const directionRef = useRef28(direction);
10451
10440
  directionRef.current = direction;
10452
- const dragState = useRef26(null);
10441
+ const dragState = useRef28(null);
10453
10442
  function applyResize(handleIndex2, nextA, combined) {
10454
10443
  const a = constraintsRef.current[handleIndex2];
10455
10444
  const b = constraintsRef.current[handleIndex2 + 1];
@@ -10466,7 +10455,7 @@ function ResizablePanelGroup({ direction, children, className }) {
10466
10455
  return next;
10467
10456
  });
10468
10457
  }
10469
- useEffect19(() => {
10458
+ useEffect20(() => {
10470
10459
  function handlePointerMove(event) {
10471
10460
  const drag = dragState.current;
10472
10461
  const rect = containerRef.current?.getBoundingClientRect();
@@ -10586,7 +10575,7 @@ function ResizableHandleClone({
10586
10575
  }
10587
10576
 
10588
10577
  // src/components/DataTable/DataTable.tsx
10589
- import { useMemo as useMemo4, useState as useState39 } from "react";
10578
+ import { useMemo as useMemo4, useState as useState36 } from "react";
10590
10579
  import styles99 from "./DataTable.module.css";
10591
10580
  import { jsx as jsx249, jsxs as jsxs195 } from "react/jsx-runtime";
10592
10581
  function compareValues(a, b) {
@@ -10602,8 +10591,8 @@ function DataTable({
10602
10591
  emptyMessage = "No results.",
10603
10592
  className
10604
10593
  }) {
10605
- const [sortKey, setSortKey] = useState39(defaultSortKey);
10606
- const [sortDirection, setSortDirection] = useState39(defaultSortDirection);
10594
+ const [sortKey, setSortKey] = useState36(defaultSortKey);
10595
+ const [sortDirection, setSortDirection] = useState36(defaultSortDirection);
10607
10596
  const sortColumn = columns.find((c) => c.key === sortKey);
10608
10597
  const sortedData = useMemo4(() => {
10609
10598
  if (!sortColumn) return data;
@@ -10670,7 +10659,7 @@ function DataTable({
10670
10659
  }
10671
10660
 
10672
10661
  // src/components/Combobox/Combobox.tsx
10673
- 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";
10674
10663
  import styles100 from "./Combobox.module.css";
10675
10664
  import { Fragment as Fragment25, jsx as jsx250, jsxs as jsxs196 } from "react/jsx-runtime";
10676
10665
  function matches2(option, query) {
@@ -10688,21 +10677,21 @@ function Combobox({
10688
10677
  disabled = false,
10689
10678
  className
10690
10679
  }) {
10691
- const [open, setOpen] = useState40(false);
10692
- const [query, setQuery] = useState40("");
10693
- const [highlightedIndex, setHighlightedIndex] = useState40(0);
10680
+ const [open, setOpen] = useState37(false);
10681
+ const [query, setQuery] = useState37("");
10682
+ const [highlightedIndex, setHighlightedIndex] = useState37(0);
10694
10683
  const isMobile = useIsMobile();
10695
- const inputRef = useRef27(null);
10684
+ const inputRef = useRef29(null);
10696
10685
  const listId = useId12();
10697
10686
  const selected = options.find((o) => o.value === value) ?? null;
10698
10687
  const filtered = useMemo5(
10699
10688
  () => options.filter((option) => matches2(option, query)),
10700
10689
  [options, query]
10701
10690
  );
10702
- useEffect20(() => {
10691
+ useEffect21(() => {
10703
10692
  setHighlightedIndex(0);
10704
10693
  }, [query, open]);
10705
- useEffect20(() => {
10694
+ useEffect21(() => {
10706
10695
  if (open) {
10707
10696
  setQuery("");
10708
10697
  requestAnimationFrame(() => inputRef.current?.focus());
@@ -10897,7 +10886,7 @@ function StepStrip({
10897
10886
  }
10898
10887
 
10899
10888
  // src/components/FileDropzone/FileDropzone.tsx
10900
- import { useRef as useRef28, useState as useState41 } from "react";
10889
+ import { useRef as useRef30, useState as useState38 } from "react";
10901
10890
  import styles103 from "./FileDropzone.module.css";
10902
10891
  import { jsx as jsx254, jsxs as jsxs199 } from "react/jsx-runtime";
10903
10892
  function FileDropzone({
@@ -10911,8 +10900,8 @@ function FileDropzone({
10911
10900
  disabled,
10912
10901
  className
10913
10902
  }) {
10914
- const [dragging, setDragging] = useState41(false);
10915
- const inputRef = useRef28(null);
10903
+ const [dragging, setDragging] = useState38(false);
10904
+ const inputRef = useRef30(null);
10916
10905
  return /* @__PURE__ */ jsxs199(
10917
10906
  "label",
10918
10907
  {
@@ -10966,7 +10955,7 @@ function FileDropzone({
10966
10955
  }
10967
10956
 
10968
10957
  // src/components/Calendar/Calendar.tsx
10969
- import { useRef as useRef29, useState as useState42 } from "react";
10958
+ import { useRef as useRef31, useState as useState39 } from "react";
10970
10959
 
10971
10960
  // src/components/Calendar/dateUtils.ts
10972
10961
  function startOfMonth(date) {
@@ -11042,9 +11031,9 @@ function Calendar({
11042
11031
  maxDate,
11043
11032
  "aria-label": ariaLabel
11044
11033
  }) {
11045
- const [displayedMonth, setDisplayedMonth] = useState42(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
11046
- const [focusedDate, setFocusedDate] = useState42(() => value ?? /* @__PURE__ */ new Date());
11047
- 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);
11048
11037
  const weeks = getMonthGrid(displayedMonth);
11049
11038
  function goToMonth(next) {
11050
11039
  setDisplayedMonth(startOfMonth(next));
@@ -11175,7 +11164,7 @@ function Calendar({
11175
11164
  }
11176
11165
 
11177
11166
  // src/components/DatePicker/DatePicker.tsx
11178
- import { useState as useState43 } from "react";
11167
+ import { useState as useState40 } from "react";
11179
11168
  import styles105 from "./DatePicker.module.css";
11180
11169
  import { Fragment as Fragment26, jsx as jsx256, jsxs as jsxs201 } from "react/jsx-runtime";
11181
11170
  var POPOVER_WIDTH = 320;
@@ -11188,7 +11177,7 @@ function DatePicker({
11188
11177
  "aria-label": ariaLabel,
11189
11178
  disabled = false
11190
11179
  }) {
11191
- const [open, setOpen] = useState43(false);
11180
+ const [open, setOpen] = useState40(false);
11192
11181
  const isMobile = useIsMobile();
11193
11182
  function handleSelect(date) {
11194
11183
  onChange(date);
@@ -11240,11 +11229,11 @@ function DatePicker({
11240
11229
  }
11241
11230
 
11242
11231
  // src/components/DateRangePicker/DateRangePicker.tsx
11243
- import { useState as useState45 } from "react";
11232
+ import { useState as useState42 } from "react";
11244
11233
  import pickerStyles from "./DatePicker.module.css";
11245
11234
 
11246
11235
  // src/components/DateRangePicker/RangeCalendar.tsx
11247
- import { useRef as useRef30, useState as useState44 } from "react";
11236
+ import { useRef as useRef32, useState as useState41 } from "react";
11248
11237
  import calendarStyles from "./Calendar.module.css";
11249
11238
 
11250
11239
  // src/components/DateRangePicker/rangeUtils.ts
@@ -11283,13 +11272,13 @@ function RangeCalendar({
11283
11272
  maxDate,
11284
11273
  "aria-label": ariaLabel
11285
11274
  }) {
11286
- const [displayedMonth, setDisplayedMonth] = useState44(
11275
+ const [displayedMonth, setDisplayedMonth] = useState41(
11287
11276
  () => startOfMonth(value?.start ?? /* @__PURE__ */ new Date())
11288
11277
  );
11289
- const [focusedDate, setFocusedDate] = useState44(() => value?.start ?? /* @__PURE__ */ new Date());
11290
- const [first, setFirst] = useState44(null);
11291
- const [hover, setHover] = useState44(null);
11292
- 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);
11293
11282
  const weeks = getMonthGrid(displayedMonth);
11294
11283
  const shown = first ? rangeOf(first, hover ?? first) : value;
11295
11284
  function goToMonth(next) {
@@ -11469,7 +11458,7 @@ function DateRangePicker({
11469
11458
  "aria-label": ariaLabel,
11470
11459
  disabled = false
11471
11460
  }) {
11472
- const [open, setOpen] = useState45(false);
11461
+ const [open, setOpen] = useState42(false);
11473
11462
  const isMobile = useIsMobile();
11474
11463
  const start = parseIso(value.start);
11475
11464
  const end = parseIso(value.end);
@@ -11524,7 +11513,7 @@ function DateRangePicker({
11524
11513
  }
11525
11514
 
11526
11515
  // src/components/SuggestionInput/SuggestionInput.tsx
11527
- 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";
11528
11517
  import styles107 from "./SuggestionInput.module.css";
11529
11518
  import { Fragment as Fragment28, jsx as jsx259, jsxs as jsxs204 } from "react/jsx-runtime";
11530
11519
  function SuggestionInput({
@@ -11544,9 +11533,9 @@ function SuggestionInput({
11544
11533
  const generatedId = useId13();
11545
11534
  const inputId = id ?? generatedId;
11546
11535
  const listId = `${inputId}-suggestions`;
11547
- const inputRef = useRef31(null);
11548
- const [focused, setFocused] = useState46(false);
11549
- const [activeIndex, setActiveIndex] = useState46(-1);
11536
+ const inputRef = useRef33(null);
11537
+ const [focused, setFocused] = useState43(false);
11538
+ const [activeIndex, setActiveIndex] = useState43(-1);
11550
11539
  const showCreateRow = Boolean(onCreate && createLabel && value.trim());
11551
11540
  const rowCount = options.length + (showCreateRow ? 1 : 0);
11552
11541
  const open = focused && (rowCount > 0 || loading);
@@ -11664,7 +11653,7 @@ function SuggestionInput({
11664
11653
  }
11665
11654
 
11666
11655
  // src/components/IconPicker/IconPicker.tsx
11667
- import { useState as useState47 } from "react";
11656
+ import { useState as useState44 } from "react";
11668
11657
  import styles108 from "./IconPicker.module.css";
11669
11658
  import { jsx as jsx260, jsxs as jsxs205 } from "react/jsx-runtime";
11670
11659
  function IconPicker({
@@ -11677,7 +11666,7 @@ function IconPicker({
11677
11666
  className,
11678
11667
  align = "auto"
11679
11668
  }) {
11680
- const [open, setOpen] = useState47(false);
11669
+ const [open, setOpen] = useState44(false);
11681
11670
  const trigger = /* @__PURE__ */ jsxs205(
11682
11671
  "button",
11683
11672
  {
@@ -11944,7 +11933,7 @@ function CheckableListRow({
11944
11933
  }
11945
11934
 
11946
11935
  // src/components/CurrencyInput/CurrencyInput.tsx
11947
- import { useState as useState48 } from "react";
11936
+ import { useState as useState45 } from "react";
11948
11937
  import { jsx as jsx264 } from "react/jsx-runtime";
11949
11938
  function minorToText(minor, decimals) {
11950
11939
  return (minor / 10 ** decimals).toFixed(decimals);
@@ -11962,7 +11951,7 @@ function CurrencyInput({
11962
11951
  decimals = 2,
11963
11952
  ...rest
11964
11953
  }) {
11965
- const [text, setText] = useState48(
11954
+ const [text, setText] = useState45(
11966
11955
  () => valueCents != null ? minorToText(valueCents, decimals) : ""
11967
11956
  );
11968
11957
  if (textToMinor(text, decimals) !== valueCents) {
@@ -12096,10 +12085,10 @@ function SwipableMobileCarouselDots({
12096
12085
  import {
12097
12086
  Children as Children2,
12098
12087
  isValidElement as isValidElement2,
12099
- useEffect as useEffect21,
12088
+ useEffect as useEffect22,
12100
12089
  useLayoutEffect as useLayoutEffect4,
12101
12090
  useMemo as useMemo6,
12102
- useRef as useRef32
12091
+ useRef as useRef34
12103
12092
  } from "react";
12104
12093
 
12105
12094
  // src/components/SwipableMobileCarousel/SwipableMobileCarouselSlide.tsx
@@ -12168,7 +12157,7 @@ function SwipableMobileCarousel({
12168
12157
  const slides = useMemo6(() => resolveSlides(children), [children]);
12169
12158
  const count = slides.length;
12170
12159
  const clampedActiveIndex = count === 0 ? 0 : Math.max(0, Math.min(count - 1, activeIndex));
12171
- const initialActiveIndexRef = useRef32(clampedActiveIndex);
12160
+ const initialActiveIndexRef = useRef34(clampedActiveIndex);
12172
12161
  const { scrollRef, scrollToIndex, liveIndex } = useSnapCarousel({
12173
12162
  itemCount: count,
12174
12163
  onSettle,
@@ -12178,15 +12167,15 @@ function SwipableMobileCarousel({
12178
12167
  useLayoutEffect4(() => {
12179
12168
  scrollToIndex(initialActiveIndexRef.current, "instant");
12180
12169
  }, []);
12181
- const didMountActiveIndexSyncRef = useRef32(false);
12182
- useEffect21(() => {
12170
+ const didMountActiveIndexSyncRef = useRef34(false);
12171
+ useEffect22(() => {
12183
12172
  if (!didMountActiveIndexSyncRef.current) {
12184
12173
  didMountActiveIndexSyncRef.current = true;
12185
12174
  return;
12186
12175
  }
12187
12176
  scrollToIndex(clampedActiveIndex, "smooth");
12188
12177
  }, [clampedActiveIndex, scrollToIndex]);
12189
- const prevKeysRef = useRef32(null);
12178
+ const prevKeysRef = useRef34(null);
12190
12179
  useLayoutEffect4(() => {
12191
12180
  const currentKeys = slides.map((s) => s.key);
12192
12181
  const prevKeys = prevKeysRef.current;
@@ -12277,7 +12266,7 @@ function SwipableMobileCarouselSlideFooter({
12277
12266
  }
12278
12267
 
12279
12268
  // src/components/SwipeStack/SwipeStack.tsx
12280
- 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";
12281
12270
 
12282
12271
  // src/components/SwipeStack/SwipeStackCard.tsx
12283
12272
  import { Fragment as Fragment30, jsx as jsx274 } from "react/jsx-runtime";
@@ -12334,10 +12323,10 @@ function SwipeStack({
12334
12323
  children
12335
12324
  }) {
12336
12325
  const cards = resolveCards(children);
12337
- const [dismissed, setDismissed] = useState49(() => /* @__PURE__ */ new Set());
12338
- const [exiting, setExiting] = useState49(null);
12339
- const exitTimerRef = useRef33(null);
12340
- useEffect22(
12326
+ const [dismissed, setDismissed] = useState46(() => /* @__PURE__ */ new Set());
12327
+ const [exiting, setExiting] = useState46(null);
12328
+ const exitTimerRef = useRef35(null);
12329
+ useEffect23(
12341
12330
  () => () => {
12342
12331
  if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
12343
12332
  },
@@ -12657,7 +12646,7 @@ var THEME_PRESETS = {
12657
12646
  };
12658
12647
 
12659
12648
  // src/components/CopyButton/CopyButton.tsx
12660
- import { useState as useState50 } from "react";
12649
+ import { useState as useState47 } from "react";
12661
12650
  import { jsx as jsx281 } from "react/jsx-runtime";
12662
12651
  function CopyButton({
12663
12652
  text,
@@ -12667,7 +12656,7 @@ function CopyButton({
12667
12656
  variant = "secondary",
12668
12657
  size: size2 = "sm"
12669
12658
  }) {
12670
- const [state, setState] = useState50("idle");
12659
+ const [state, setState] = useState47("idle");
12671
12660
  async function copy() {
12672
12661
  try {
12673
12662
  await navigator.clipboard.writeText(text);