@apliteni/apliteni-ui 0.193.0 → 0.196.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2624,7 +2624,7 @@ function evenMonthLabels(format) {
2624
2624
  }
2625
2625
  var clamp = (index, lo, hi) => Math.min(hi ?? index, Math.max(lo ?? index, index));
2626
2626
  function DatePicker({
2627
- mode = "month",
2627
+ mode: mode2 = "month",
2628
2628
  value,
2629
2629
  defaultValue = null,
2630
2630
  onChange,
@@ -2650,8 +2650,8 @@ function DatePicker({
2650
2650
  defaultOpen = false,
2651
2651
  onOpenChange
2652
2652
  }) {
2653
- const grain = mode === "day" || mode === "day-range" ? "day" : "month";
2654
- const picksRange = mode === "range" || mode === "day-range";
2653
+ const grain = mode2 === "day" || mode2 === "day-range" ? "day" : "month";
2654
+ const picksRange = mode2 === "range" || mode2 === "day-range";
2655
2655
  const phone = usePhone();
2656
2656
  const asSheet = sheet ?? phone;
2657
2657
  const root = useRef14(null);
@@ -4118,21 +4118,115 @@ function Timeline({ events, className, ...rest }) {
4118
4118
  )) });
4119
4119
  }
4120
4120
 
4121
+ // src/Wizard.tsx
4122
+ import { useEffect as useEffect16, useId as useId13, useRef as useRef19, useState as useState15 } from "react";
4123
+ import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
4124
+ var words = { done: "Done", current: "Current", blocked: "Blocked", todo: "To do" };
4125
+ var working = (steps) => (steps.find((step) => step.state === "current" || step.state === "blocked") ?? steps[steps.length - 1]).id;
4126
+ function Mark({ state }) {
4127
+ return /* @__PURE__ */ jsxs30("span", { "aria-hidden": "true", className: `ui-wizard__mark ui-wizard__mark--${state}`, children: [
4128
+ state === "done" && /* @__PURE__ */ jsx34(Icon, { name: "check" }),
4129
+ state === "blocked" && /* @__PURE__ */ jsx34(Icon, { name: "circleAlert" })
4130
+ ] });
4131
+ }
4132
+ function Wizard({ label, steps, final, open, onOpenChange, className }) {
4133
+ const uid = useId13();
4134
+ const ready = steps.every((step) => step.state === "done");
4135
+ const finalId = final.id ?? "final";
4136
+ const all = [...steps, { id: finalId, label: final.label, state: final.done ? "done" : ready ? "current" : "todo", content: final.content }];
4137
+ const target = working(all);
4138
+ const [own, setOwn] = useState15(target);
4139
+ const shown = open ?? own;
4140
+ const list = useRef19(null);
4141
+ const button = (id) => list.current?.querySelector(`[data-step="${CSS.escape(id)}"]`) ?? null;
4142
+ const held = typeof document !== "undefined" && Boolean(list.current?.contains(document.activeElement));
4143
+ const last = useRef19(target);
4144
+ useEffect16(() => {
4145
+ const active = document.activeElement;
4146
+ const lost = active === document.body || active === null;
4147
+ if (last.current !== target) {
4148
+ last.current = target;
4149
+ if (open === void 0) setOwn(target);
4150
+ onOpenChange?.(target);
4151
+ if (lost || list.current?.contains(active)) button(target)?.focus();
4152
+ } else if (held && lost) button(shown)?.focus();
4153
+ });
4154
+ const choose = (id) => {
4155
+ if (open === void 0) setOwn(id);
4156
+ onOpenChange?.(id);
4157
+ };
4158
+ const move = (event, index) => {
4159
+ const next = { ArrowDown: (index + 1) % all.length, ArrowUp: (index + all.length - 1) % all.length, Home: 0, End: all.length - 1 }[event.key];
4160
+ if (next === void 0) return;
4161
+ event.preventDefault();
4162
+ button(all[next].id)?.focus();
4163
+ };
4164
+ const position = all.find((step) => step.state === "current" || step.state === "blocked")?.id;
4165
+ return /* @__PURE__ */ jsx34("ol", { ref: list, role: "list", "aria-label": label, className: ["ui-wizard", className].filter(Boolean).join(" "), children: all.map((step, index) => {
4166
+ const isFinal = index === all.length - 1;
4167
+ const panel = `${uid}-panel-${index}`;
4168
+ const head = `${uid}-step-${index}`;
4169
+ return /* @__PURE__ */ jsxs30("li", { className: `ui-wizard__item ui-wizard__item--${step.state}`, children: [
4170
+ /* @__PURE__ */ jsxs30(
4171
+ "button",
4172
+ {
4173
+ type: "button",
4174
+ id: head,
4175
+ "data-step": step.id,
4176
+ className: `ui-nav__item ui-wizard__step${shown === step.id ? " is-active" : ""}`,
4177
+ "aria-label": `${index + 1}. ${step.label}, ${words[step.state]}, step ${index + 1} of ${all.length}`,
4178
+ "aria-expanded": shown === step.id,
4179
+ "aria-controls": panel,
4180
+ "aria-current": position === step.id ? "step" : void 0,
4181
+ onClick: () => choose(step.id),
4182
+ onKeyDown: (event) => move(event, index),
4183
+ children: [
4184
+ /* @__PURE__ */ jsx34(Mark, { state: step.state }),
4185
+ /* @__PURE__ */ jsxs30("span", { className: "ui-wizard__text", children: [
4186
+ /* @__PURE__ */ jsxs30("span", { className: "ui-wizard__name", children: [
4187
+ index + 1,
4188
+ ". ",
4189
+ step.label
4190
+ ] }),
4191
+ " ",
4192
+ /* @__PURE__ */ jsx34("span", { className: "ui-wizard__state", children: words[step.state] })
4193
+ ] })
4194
+ ]
4195
+ }
4196
+ ),
4197
+ /* @__PURE__ */ jsx34("div", { id: panel, role: "region", "aria-labelledby": head, className: "ui-wizard__panel", hidden: shown !== step.id, children: step.content }),
4198
+ isFinal && !final.done && /* @__PURE__ */ jsxs30("div", { className: "ui-wizard__final", children: [
4199
+ !ready && /* @__PURE__ */ jsx34("p", { id: `${uid}-reason`, className: "ui-wizard__reason", children: final.reason }),
4200
+ /* @__PURE__ */ jsx34(
4201
+ Button,
4202
+ {
4203
+ variant: ready ? "primary" : "outline",
4204
+ disabled: !ready,
4205
+ "aria-describedby": ready ? void 0 : `${uid}-reason`,
4206
+ onClick: final.onAction,
4207
+ children: final.action
4208
+ }
4209
+ )
4210
+ ] })
4211
+ ] }, step.id);
4212
+ }) });
4213
+ }
4214
+
4121
4215
  // src/Field.tsx
4122
- import { forwardRef as forwardRef8, useEffect as useEffect16, useId as useId13, useRef as useRef19, useState as useState15 } from "react";
4216
+ import { forwardRef as forwardRef8, useEffect as useEffect17, useId as useId14, useRef as useRef20, useState as useState16 } from "react";
4123
4217
  import { esc, icon as icon5 } from "@apliteni/apliteni-ui";
4124
- import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
4218
+ import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
4125
4219
  function messages(id, hint, error) {
4126
4220
  return [error && `${id}-error`, hint && `${id}-hint`].filter(Boolean).join(" ") || void 0;
4127
4221
  }
4128
4222
  function Frame({ id, labelId, label, hint, error, required, children }) {
4129
- return /* @__PURE__ */ jsxs30("div", { className: "ui-field", children: [
4130
- /* @__PURE__ */ jsxs30("label", { className: "ui-field__label", id: labelId, htmlFor: id, children: [
4223
+ return /* @__PURE__ */ jsxs31("div", { className: "ui-field", children: [
4224
+ /* @__PURE__ */ jsxs31("label", { className: "ui-field__label", id: labelId, htmlFor: id, children: [
4131
4225
  label,
4132
- required && /* @__PURE__ */ jsx34("span", { className: "ui-field__req", "aria-hidden": "true", children: "*" })
4226
+ required && /* @__PURE__ */ jsx35("span", { className: "ui-field__req", "aria-hidden": "true", children: "*" })
4133
4227
  ] }),
4134
4228
  children,
4135
- error && /* @__PURE__ */ jsx34(
4229
+ error && /* @__PURE__ */ jsx35(
4136
4230
  "div",
4137
4231
  {
4138
4232
  id: `${id}-error`,
@@ -4141,23 +4235,23 @@ function Frame({ id, labelId, label, hint, error, required, children }) {
4141
4235
  dangerouslySetInnerHTML: { __html: icon5("alert") + esc(error) }
4142
4236
  }
4143
4237
  ),
4144
- hint && /* @__PURE__ */ jsx34("div", { id: `${id}-hint`, className: "ui-field__hint", children: hint })
4238
+ hint && /* @__PURE__ */ jsx35("div", { id: `${id}-hint`, className: "ui-field__hint", children: hint })
4145
4239
  ] });
4146
4240
  }
4147
4241
  function wiring(id, hint, error) {
4148
4242
  return { id, "aria-describedby": messages(id, hint, error), "aria-invalid": error ? true : void 0 };
4149
4243
  }
4150
4244
  function Field({ id: suppliedId, label, hint, error, required, children }) {
4151
- const generatedId = useId13();
4245
+ const generatedId = useId14();
4152
4246
  const id = suppliedId ?? generatedId;
4153
4247
  const labelId = `${id}-label`;
4154
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId, label }, children: children({ ...wiring(id, hint, error), required }) }) });
4248
+ return /* @__PURE__ */ jsx35(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx35(FieldContext.Provider, { value: { id, labelId, label }, children: children({ ...wiring(id, hint, error), required }) }) });
4155
4249
  }
4156
4250
  var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph2, className = "", ...props }, ref) {
4157
- const id = useId13();
4251
+ const id = useId14();
4158
4252
  const hasUnit = type === "number" && !!unit;
4159
4253
  const describedBy = [messages(id, hint, error), hasUnit ? `${id}-unit` : ""].filter(Boolean).join(" ") || void 0;
4160
- const control = /* @__PURE__ */ jsx34(
4254
+ const control = /* @__PURE__ */ jsx35(
4161
4255
  "input",
4162
4256
  {
4163
4257
  ref,
@@ -4170,19 +4264,19 @@ var TextField = forwardRef8(function TextField2({ label, hint, error, required,
4170
4264
  className: `ui-input${error ? " is-invalid" : ""} ${className}`
4171
4265
  }
4172
4266
  );
4173
- const unitSpan = hasUnit ? /* @__PURE__ */ jsx34("span", { id: `${id}-unit`, className: "ui-field-number__unit", children: unit }) : null;
4174
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: glyph2 ? /* @__PURE__ */ jsxs30("div", { className: `ui-input-group${hasUnit ? " ui-field-number" : ""}`, children: [
4175
- /* @__PURE__ */ jsx34("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon5(glyph2) } }),
4267
+ const unitSpan = hasUnit ? /* @__PURE__ */ jsx35("span", { id: `${id}-unit`, className: "ui-field-number__unit", children: unit }) : null;
4268
+ return /* @__PURE__ */ jsx35(Frame, { ...{ id, label, hint, error, required }, children: glyph2 ? /* @__PURE__ */ jsxs31("div", { className: `ui-input-group${hasUnit ? " ui-field-number" : ""}`, children: [
4269
+ /* @__PURE__ */ jsx35("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon5(glyph2) } }),
4176
4270
  control,
4177
4271
  unitSpan
4178
- ] }) : hasUnit ? /* @__PURE__ */ jsxs30("div", { className: "ui-field-number", children: [
4272
+ ] }) : hasUnit ? /* @__PURE__ */ jsxs31("div", { className: "ui-field-number", children: [
4179
4273
  control,
4180
4274
  unitSpan
4181
4275
  ] }) : control });
4182
4276
  });
4183
4277
  function TextArea({ label, hint, error, required, className = "", ...props }) {
4184
- const id = useId13();
4185
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
4278
+ const id = useId14();
4279
+ return /* @__PURE__ */ jsx35(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx35(
4186
4280
  "textarea",
4187
4281
  {
4188
4282
  rows: 4,
@@ -4194,8 +4288,8 @@ function TextArea({ label, hint, error, required, className = "", ...props }) {
4194
4288
  ) });
4195
4289
  }
4196
4290
  function SelectField({ label, hint, error, required, className = "", children, ...props }) {
4197
- const id = useId13();
4198
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
4291
+ const id = useId14();
4292
+ return /* @__PURE__ */ jsx35(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx35(
4199
4293
  "select",
4200
4294
  {
4201
4295
  ...props,
@@ -4207,11 +4301,11 @@ function SelectField({ label, hint, error, required, className = "", children, .
4207
4301
  ) });
4208
4302
  }
4209
4303
  function FileField({ label, hint, error, required, disabled, onFileChange, className = "", ...props }) {
4210
- const id = useId13();
4211
- const input = useRef19(null);
4212
- const [file, setFile] = useState15(null);
4213
- const [dragging, setDragging] = useState15(false);
4214
- useEffect16(() => {
4304
+ const id = useId14();
4305
+ const input = useRef20(null);
4306
+ const [file, setFile] = useState16(null);
4307
+ const [dragging, setDragging] = useState16(false);
4308
+ useEffect17(() => {
4215
4309
  const form = input.current?.form;
4216
4310
  const reset = () => {
4217
4311
  setFile(null);
@@ -4224,7 +4318,7 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
4224
4318
  setFile(next);
4225
4319
  onFileChange?.(next);
4226
4320
  };
4227
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsxs30(
4321
+ return /* @__PURE__ */ jsx35(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsxs31(
4228
4322
  "div",
4229
4323
  {
4230
4324
  className: `ui-file${dragging && !disabled ? " is-dragging" : ""}${file ? " has-file" : ""}${error ? " is-invalid" : ""}${disabled ? " is-disabled" : ""}`,
@@ -4245,12 +4339,12 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
4245
4339
  update(transfer.files[0]);
4246
4340
  },
4247
4341
  children: [
4248
- /* @__PURE__ */ jsx34("span", { className: "ui-file__glyph", children: /* @__PURE__ */ jsx34(Icon, { name: "upload" }) }),
4249
- /* @__PURE__ */ jsx34("div", { "aria-live": "polite", children: file ? file.name : "Drop a file here" }),
4250
- /* @__PURE__ */ jsx34("div", { children: "or choose one from your device" }),
4251
- /* @__PURE__ */ jsxs30("span", { className: "ui-file__choose", children: [
4252
- /* @__PURE__ */ jsx34("span", { className: "ui-btn ui-btn--secondary ui-btn--sm", "aria-hidden": "true", "aria-disabled": disabled || void 0, children: file ? "Replace file" : "Choose file" }),
4253
- /* @__PURE__ */ jsx34(
4342
+ /* @__PURE__ */ jsx35("span", { className: "ui-file__glyph", children: /* @__PURE__ */ jsx35(Icon, { name: "upload" }) }),
4343
+ /* @__PURE__ */ jsx35("div", { "aria-live": "polite", children: file ? file.name : "Drop a file here" }),
4344
+ /* @__PURE__ */ jsx35("div", { children: "or choose one from your device" }),
4345
+ /* @__PURE__ */ jsxs31("span", { className: "ui-file__choose", children: [
4346
+ /* @__PURE__ */ jsx35("span", { className: "ui-btn ui-btn--secondary ui-btn--sm", "aria-hidden": "true", "aria-disabled": disabled || void 0, children: file ? "Replace file" : "Choose file" }),
4347
+ /* @__PURE__ */ jsx35(
4254
4348
  "input",
4255
4349
  {
4256
4350
  ...props,
@@ -4270,11 +4364,11 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
4270
4364
  }
4271
4365
 
4272
4366
  // src/FileDrop.tsx
4273
- import { useRef as useRef20, useState as useState16 } from "react";
4367
+ import { useRef as useRef21, useState as useState17 } from "react";
4274
4368
 
4275
4369
  // src/EmptyState.tsx
4276
4370
  import { icon as kitIcon3, illo } from "@apliteni/apliteni-ui";
4277
- import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
4371
+ import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
4278
4372
  var cases = {
4279
4373
  "first-run": { title: "Nothing needs you yet", sub: "New items will appear here when they need your attention.", icon: "check" },
4280
4374
  "no-matches": { title: "No results in this view", sub: "Try another search or clear your filters.", icon: "search" },
@@ -4287,16 +4381,16 @@ function EmptyState({ variant = "first-run", title, sub, icon: icon9, art, actio
4287
4381
  const guidance = sub ?? preset.sub;
4288
4382
  const glyph2 = icon9 ?? preset.icon;
4289
4383
  const Title = [2, 3, 4, 5, 6].includes(level) ? `h${level}` : "div";
4290
- return /* @__PURE__ */ jsxs31("div", { className: ["ui-empty", className].filter(Boolean).join(" "), children: [
4291
- art ? typeof art === "string" ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph2 ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph2) } }) : null,
4292
- heading && /* @__PURE__ */ jsx35(Title, { className: "ui-empty__title", children: heading }),
4293
- guidance && /* @__PURE__ */ jsx35("div", { className: "ui-empty__sub", children: guidance }),
4294
- actions && /* @__PURE__ */ jsx35("div", { className: "ui-empty__actions", children: actions })
4384
+ return /* @__PURE__ */ jsxs32("div", { className: ["ui-empty", className].filter(Boolean).join(" "), children: [
4385
+ art ? typeof art === "string" ? /* @__PURE__ */ jsx36("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx36("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph2 ? /* @__PURE__ */ jsx36("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph2) } }) : null,
4386
+ heading && /* @__PURE__ */ jsx36(Title, { className: "ui-empty__title", children: heading }),
4387
+ guidance && /* @__PURE__ */ jsx36("div", { className: "ui-empty__sub", children: guidance }),
4388
+ actions && /* @__PURE__ */ jsx36("div", { className: "ui-empty__actions", children: actions })
4295
4389
  ] });
4296
4390
  }
4297
4391
 
4298
4392
  // src/FileDrop.tsx
4299
- import { Fragment as Fragment17, jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
4393
+ import { Fragment as Fragment17, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
4300
4394
  var MARKS = {
4301
4395
  uploading: "clock",
4302
4396
  done: "circleCheck",
@@ -4332,8 +4426,8 @@ function FileDrop({
4332
4426
  children,
4333
4427
  className
4334
4428
  }) {
4335
- const input = useRef20(null);
4336
- const [over, setOver] = useState16(false);
4429
+ const input = useRef21(null);
4430
+ const [over, setOver] = useState17(false);
4337
4431
  const status = file?.status ?? "uploading";
4338
4432
  const word = status === "error" ? file?.error ?? WORDS.error : file?.state ?? WORDS[status];
4339
4433
  const [stem, ext] = splitName(file?.name ?? "");
@@ -4349,7 +4443,7 @@ function FileDrop({
4349
4443
  const pick = () => {
4350
4444
  if (!disabled) input.current?.click();
4351
4445
  };
4352
- const picker = /* @__PURE__ */ jsx36(
4446
+ const picker = /* @__PURE__ */ jsx37(
4353
4447
  "input",
4354
4448
  {
4355
4449
  ref: input,
@@ -4382,20 +4476,20 @@ function FileDrop({
4382
4476
  take(Array.from(event.dataTransfer.files));
4383
4477
  }
4384
4478
  };
4385
- if (title !== void 0) return /* @__PURE__ */ jsxs32(
4479
+ if (title !== void 0) return /* @__PURE__ */ jsxs33(
4386
4480
  "div",
4387
4481
  {
4388
4482
  className: cx7("ui-drop", "ui-drop--area", showTarget && "is-dragging", disabled && "is-disabled", className),
4389
4483
  onClick: pick,
4390
4484
  ...drag,
4391
4485
  children: [
4392
- /* @__PURE__ */ jsx36(
4486
+ /* @__PURE__ */ jsx37(
4393
4487
  EmptyState,
4394
4488
  {
4395
4489
  icon: "upload",
4396
4490
  title,
4397
4491
  sub: note ?? "",
4398
- actions: /* @__PURE__ */ jsx36(
4492
+ actions: /* @__PURE__ */ jsx37(
4399
4493
  Button,
4400
4494
  {
4401
4495
  variant: "primary",
@@ -4415,28 +4509,28 @@ function FileDrop({
4415
4509
  ]
4416
4510
  }
4417
4511
  );
4418
- return /* @__PURE__ */ jsxs32("div", { className: cx7("ui-drop", disabled && "is-disabled", className), ...drag, children: [
4512
+ return /* @__PURE__ */ jsxs33("div", { className: cx7("ui-drop", disabled && "is-disabled", className), ...drag, children: [
4419
4513
  children,
4420
- /* @__PURE__ */ jsxs32("div", { className: "ui-drop__row", children: [
4421
- file ? /* @__PURE__ */ jsxs32("div", { className: cx7("ui-drop__file", status === "error" && "ui-drop__file--failed"), children: [
4422
- /* @__PURE__ */ jsxs32("div", { className: "ui-drop__line", children: [
4423
- /* @__PURE__ */ jsxs32("span", { className: "ui-drop__name", title: file.name, children: [
4424
- /* @__PURE__ */ jsx36("span", { className: "ui-drop__stem", children: stem }),
4425
- /* @__PURE__ */ jsx36("span", { className: "ui-drop__ext", children: ext })
4514
+ /* @__PURE__ */ jsxs33("div", { className: "ui-drop__row", children: [
4515
+ file ? /* @__PURE__ */ jsxs33("div", { className: cx7("ui-drop__file", status === "error" && "ui-drop__file--failed"), children: [
4516
+ /* @__PURE__ */ jsxs33("div", { className: "ui-drop__line", children: [
4517
+ /* @__PURE__ */ jsxs33("span", { className: "ui-drop__name", title: file.name, children: [
4518
+ /* @__PURE__ */ jsx37("span", { className: "ui-drop__stem", children: stem }),
4519
+ /* @__PURE__ */ jsx37("span", { className: "ui-drop__ext", children: ext })
4426
4520
  ] }),
4427
- showSize && /* @__PURE__ */ jsx36("span", { className: "ui-drop__size", children: file.size }),
4428
- showWord && /* @__PURE__ */ jsxs32(
4521
+ showSize && /* @__PURE__ */ jsx37("span", { className: "ui-drop__size", children: file.size }),
4522
+ showWord && /* @__PURE__ */ jsxs33(
4429
4523
  "span",
4430
4524
  {
4431
4525
  className: cx7("ui-drop__state", status === "error" && "ui-drop__error"),
4432
4526
  role: status === "error" ? "alert" : void 0,
4433
4527
  children: [
4434
- /* @__PURE__ */ jsx36(Icon, { name: MARKS[status] }),
4435
- /* @__PURE__ */ jsx36("span", { className: "ui-drop__word", title: word, children: word })
4528
+ /* @__PURE__ */ jsx37(Icon, { name: MARKS[status] }),
4529
+ /* @__PURE__ */ jsx37("span", { className: "ui-drop__word", title: word, children: word })
4436
4530
  ]
4437
4531
  }
4438
4532
  ),
4439
- hasBar && /* @__PURE__ */ jsx36(
4533
+ hasBar && /* @__PURE__ */ jsx37(
4440
4534
  "span",
4441
4535
  {
4442
4536
  className: "ui-drop__bar",
@@ -4445,13 +4539,13 @@ function FileDrop({
4445
4539
  "aria-valuenow": file.progress,
4446
4540
  "aria-valuemin": 0,
4447
4541
  "aria-valuemax": 100,
4448
- children: /* @__PURE__ */ jsx36("span", { style: { width: `${file.progress}%` } })
4542
+ children: /* @__PURE__ */ jsx37("span", { style: { width: `${file.progress}%` } })
4449
4543
  }
4450
4544
  )
4451
4545
  ] }),
4452
- (onRemove || status === "error" && onRetry) && /* @__PURE__ */ jsxs32("span", { className: "ui-drop__actions", children: [
4453
- status === "error" && onRetry && /* @__PURE__ */ jsx36(Button, { size: "sm", icon: "refresh", onClick: onRetry, disabled, children: retryLabel }),
4454
- onRemove && /* @__PURE__ */ jsx36(
4546
+ (onRemove || status === "error" && onRetry) && /* @__PURE__ */ jsxs33("span", { className: "ui-drop__actions", children: [
4547
+ status === "error" && onRetry && /* @__PURE__ */ jsx37(Button, { size: "sm", icon: "refresh", onClick: onRetry, disabled, children: retryLabel }),
4548
+ onRemove && /* @__PURE__ */ jsx37(
4455
4549
  Button,
4456
4550
  {
4457
4551
  variant: "ghost",
@@ -4462,8 +4556,8 @@ function FileDrop({
4462
4556
  }
4463
4557
  )
4464
4558
  ] })
4465
- ] }) : /* @__PURE__ */ jsxs32(Fragment17, { children: [
4466
- /* @__PURE__ */ jsx36(
4559
+ ] }) : /* @__PURE__ */ jsxs33(Fragment17, { children: [
4560
+ /* @__PURE__ */ jsx37(
4467
4561
  Button,
4468
4562
  {
4469
4563
  size: "sm",
@@ -4473,22 +4567,22 @@ function FileDrop({
4473
4567
  children: label
4474
4568
  }
4475
4569
  ),
4476
- note && /* @__PURE__ */ jsx36("p", { className: "ui-drop__note", children: note })
4570
+ note && /* @__PURE__ */ jsx37("p", { className: "ui-drop__note", children: note })
4477
4571
  ] }),
4478
4572
  picker
4479
4573
  ] }),
4480
- showTarget && /* @__PURE__ */ jsx36("div", { className: "ui-drop__target", "aria-hidden": "true", children: dropLabel })
4574
+ showTarget && /* @__PURE__ */ jsx37("div", { className: "ui-drop__target", "aria-hidden": "true", children: dropLabel })
4481
4575
  ] });
4482
4576
  }
4483
4577
 
4484
4578
  // src/SearchField.tsx
4485
4579
  import { forwardRef as forwardRef9 } from "react";
4486
4580
  import { icon as icon6 } from "@apliteni/apliteni-ui";
4487
- import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
4581
+ import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
4488
4582
  var SearchField = forwardRef9(function SearchField2({ ariaLabel, size, width, className, ...props }, ref) {
4489
- return /* @__PURE__ */ jsxs33("div", { className: "ui-input-group", style: width ? { width, flex: "none" } : void 0, children: [
4490
- /* @__PURE__ */ jsx37("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon6("search") } }),
4491
- /* @__PURE__ */ jsx37(
4583
+ return /* @__PURE__ */ jsxs34("div", { className: "ui-input-group", style: width ? { width, flex: "none" } : void 0, children: [
4584
+ /* @__PURE__ */ jsx38("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon6("search") } }),
4585
+ /* @__PURE__ */ jsx38(
4492
4586
  "input",
4493
4587
  {
4494
4588
  ref,
@@ -4502,7 +4596,7 @@ var SearchField = forwardRef9(function SearchField2({ ariaLabel, size, width, cl
4502
4596
  });
4503
4597
 
4504
4598
  // src/Toast.tsx
4505
- import { createContext as createContext4, useCallback as useCallback7, useContext as useContext4, useEffect as useEffect17, useLayoutEffect as useLayoutEffect4, useRef as useRef21, useState as useState17 } from "react";
4599
+ import { createContext as createContext4, useCallback as useCallback7, useContext as useContext4, useEffect as useEffect18, useLayoutEffect as useLayoutEffect4, useRef as useRef22, useState as useState18 } from "react";
4506
4600
  import { createPortal as createPortal6 } from "react-dom";
4507
4601
 
4508
4602
  // src/lib/toast-stack.ts
@@ -4612,7 +4706,7 @@ function watchToastPile(stack2) {
4612
4706
  }
4613
4707
 
4614
4708
  // src/Toast.tsx
4615
- import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
4709
+ import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
4616
4710
  var Context = createContext4(null);
4617
4711
  var PileHoldContext = createContext4(false);
4618
4712
  var glyphs = { success: "circleCheck", danger: "circleX", warn: "circleAlert", info: "info", neutral: "bolt" };
@@ -4622,24 +4716,24 @@ function useToast() {
4622
4716
  return push;
4623
4717
  }
4624
4718
  function Notice({ notice, remove }) {
4625
- const root = useRef21(null);
4626
- const [leaving2, setLeaving] = useState17(false);
4627
- const dismissed = useRef21(false);
4628
- const [hovered, setHovered] = useState17(false);
4629
- const [focused, setFocused] = useState17(false);
4719
+ const root = useRef22(null);
4720
+ const [leaving2, setLeaving] = useState18(false);
4721
+ const dismissed = useRef22(false);
4722
+ const [hovered, setHovered] = useState18(false);
4723
+ const [focused, setFocused] = useState18(false);
4630
4724
  const pileHeld = useContext4(PileHoldContext);
4631
4725
  const paused = hovered || focused || pileHeld;
4632
4726
  const tone2 = notice.tone ?? "success";
4633
4727
  const timed = !notice.action && notice.timer !== false && notice.timer !== 0;
4634
4728
  const duration = typeof notice.timer === "number" ? notice.timer * 1e3 : 5e3;
4635
- const remaining = useRef21(duration);
4729
+ const remaining = useRef22(duration);
4636
4730
  const dismiss = useCallback7(() => {
4637
4731
  if (dismissed.current) return;
4638
4732
  dismissed.current = true;
4639
4733
  if (typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) remove();
4640
4734
  else setLeaving(true);
4641
4735
  }, [remove]);
4642
- useEffect17(() => {
4736
+ useEffect18(() => {
4643
4737
  if (leaving2) {
4644
4738
  const element = root.current;
4645
4739
  const finish = (event) => {
@@ -4653,7 +4747,7 @@ function Notice({ notice, remove }) {
4653
4747
  };
4654
4748
  }
4655
4749
  }, [leaving2, remove]);
4656
- useEffect17(() => {
4750
+ useEffect18(() => {
4657
4751
  if (leaving2 || !timed || paused) return;
4658
4752
  const started = Date.now();
4659
4753
  const timer = setTimeout(dismiss, remaining.current);
@@ -4662,7 +4756,7 @@ function Notice({ notice, remove }) {
4662
4756
  remaining.current = Math.max(0, remaining.current - (Date.now() - started));
4663
4757
  };
4664
4758
  }, [dismiss, leaving2, paused, timed]);
4665
- return /* @__PURE__ */ jsxs34(
4759
+ return /* @__PURE__ */ jsxs35(
4666
4760
  "div",
4667
4761
  {
4668
4762
  ref: root,
@@ -4676,12 +4770,12 @@ function Notice({ notice, remove }) {
4676
4770
  if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
4677
4771
  },
4678
4772
  children: [
4679
- /* @__PURE__ */ jsx38("span", { className: "ui-toast__icon", children: /* @__PURE__ */ jsx38(Icon, { name: glyphs[tone2] }) }),
4680
- /* @__PURE__ */ jsxs34("div", { className: "ui-toast__body", children: [
4681
- /* @__PURE__ */ jsx38("div", { className: "ui-toast__title", children: notice.title }),
4682
- !notice.compact && notice.text && /* @__PURE__ */ jsx38("div", { className: "ui-toast__text", children: notice.text })
4773
+ /* @__PURE__ */ jsx39("span", { className: "ui-toast__icon", children: /* @__PURE__ */ jsx39(Icon, { name: glyphs[tone2] }) }),
4774
+ /* @__PURE__ */ jsxs35("div", { className: "ui-toast__body", children: [
4775
+ /* @__PURE__ */ jsx39("div", { className: "ui-toast__title", children: notice.title }),
4776
+ !notice.compact && notice.text && /* @__PURE__ */ jsx39("div", { className: "ui-toast__text", children: notice.text })
4683
4777
  ] }),
4684
- notice.action && /* @__PURE__ */ jsx38(
4778
+ notice.action && /* @__PURE__ */ jsx39(
4685
4779
  "button",
4686
4780
  {
4687
4781
  type: "button",
@@ -4696,8 +4790,8 @@ function Notice({ notice, remove }) {
4696
4790
  children: notice.action.label
4697
4791
  }
4698
4792
  ),
4699
- notice.dismissible !== false && /* @__PURE__ */ jsx38("button", { type: "button", className: "ui-toast__close", "aria-label": "Dismiss", disabled: leaving2, onClick: dismiss, children: /* @__PURE__ */ jsx38(Icon, { name: "x" }) }),
4700
- timed && /* @__PURE__ */ jsx38(
4793
+ notice.dismissible !== false && /* @__PURE__ */ jsx39("button", { type: "button", className: "ui-toast__close", "aria-label": "Dismiss", disabled: leaving2, onClick: dismiss, children: /* @__PURE__ */ jsx39(Icon, { name: "x" }) }),
4794
+ timed && /* @__PURE__ */ jsx39(
4701
4795
  "span",
4702
4796
  {
4703
4797
  className: "ui-toast__timer is-running",
@@ -4741,11 +4835,11 @@ function usePile(stack2, piled, count) {
4741
4835
  }, [stack2, piled, count]);
4742
4836
  }
4743
4837
  function Toast({ children, collapse = false }) {
4744
- const [entries, setEntries] = useState17([]);
4745
- const [pileHovered, setPileHovered] = useState17(false);
4746
- const [pileFocused, setPileFocused] = useState17(false);
4747
- const nextId = useRef21(0);
4748
- const stack2 = useRef21(null);
4838
+ const [entries, setEntries] = useState18([]);
4839
+ const [pileHovered, setPileHovered] = useState18(false);
4840
+ const [pileFocused, setPileFocused] = useState18(false);
4841
+ const nextId = useRef22(0);
4842
+ const stack2 = useRef22(null);
4749
4843
  const push = useCallback7((notice) => {
4750
4844
  const id = nextId.current++;
4751
4845
  const remove = () => setEntries((current) => current.filter((entry) => entry.id !== id));
@@ -4758,10 +4852,10 @@ function Toast({ children, collapse = false }) {
4758
4852
  const leavePileFocus = (event) => {
4759
4853
  if (!event.currentTarget.contains(event.relatedTarget)) setPileFocused(false);
4760
4854
  };
4761
- return /* @__PURE__ */ jsxs34(Context.Provider, { value: push, children: [
4855
+ return /* @__PURE__ */ jsxs35(Context.Provider, { value: push, children: [
4762
4856
  children,
4763
4857
  typeof document !== "undefined" && createPortal6(
4764
- /* @__PURE__ */ jsx38(
4858
+ /* @__PURE__ */ jsx39(
4765
4859
  "div",
4766
4860
  {
4767
4861
  className: `ui-toast-stack rx-toast-stack${piled ? " ui-toast-stack--collapsed" : ""}`,
@@ -4773,7 +4867,7 @@ function Toast({ children, collapse = false }) {
4773
4867
  onMouseLeave: () => setPileHovered(false),
4774
4868
  onFocus: () => setPileFocused(true),
4775
4869
  onBlur: leavePileFocus,
4776
- children: /* @__PURE__ */ jsx38(PileHoldContext.Provider, { value: pileHeld, children: entries.map((entry) => /* @__PURE__ */ jsx38(Notice, { notice: entry.notice, remove: entry.remove }, entry.id)) })
4870
+ children: /* @__PURE__ */ jsx39(PileHoldContext.Provider, { value: pileHeld, children: entries.map((entry) => /* @__PURE__ */ jsx39(Notice, { notice: entry.notice, remove: entry.remove }, entry.id)) })
4777
4871
  }
4778
4872
  ),
4779
4873
  document.body
@@ -4782,7 +4876,7 @@ function Toast({ children, collapse = false }) {
4782
4876
  }
4783
4877
 
4784
4878
  // src/AppShell.tsx
4785
- import { useEffect as useEffect19, useId as useId14, useMemo as useMemo5, useRef as useRef23, useState as useState19 } from "react";
4879
+ import { useEffect as useEffect20, useId as useId15, useMemo as useMemo5, useRef as useRef24, useState as useState20 } from "react";
4786
4880
  import { prism } from "@apliteni/apliteni-ui";
4787
4881
 
4788
4882
  // src/lib/palette-hotkey.ts
@@ -4812,14 +4906,14 @@ function storeRailCollapsed(collapsed) {
4812
4906
  }
4813
4907
 
4814
4908
  // src/AccountMenu.tsx
4815
- import { useEffect as useEffect18, useRef as useRef22, useState as useState18 } from "react";
4909
+ import { useEffect as useEffect19, useRef as useRef23, useState as useState19 } from "react";
4816
4910
  import { createPortal as createPortal7 } from "react-dom";
4817
4911
  import { icon as icon7, themeIcon as themeIcon2, transitionMs as transitionMs3 } from "@apliteni/apliteni-ui";
4818
4912
 
4819
4913
  // src/ThemeToggle.tsx
4820
4914
  import { useSyncExternalStore } from "react";
4821
4915
  import { themeIcon } from "@apliteni/apliteni-ui";
4822
- import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
4916
+ import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4823
4917
  var STORAGE_KEY = "apliteni-strategy-theme";
4824
4918
  var CHOICE_EVENT = "apliteni-theme-choice";
4825
4919
  var THEME_INIT_SCRIPT = `(()=>{let t;try{t=localStorage.getItem('apliteni-strategy-theme')}catch{}document.documentElement.setAttribute('data-theme',t==='dark'||t==='light'?t:window.matchMedia?.('(prefers-color-scheme: light)').matches?'light':'dark')})()`;
@@ -4882,10 +4976,10 @@ function useThemeChoice() {
4882
4976
  }
4883
4977
  function ThemeToggle({ labelled = false }) {
4884
4978
  const { theme, label, name, toggle } = useThemeChoice();
4885
- const button = /* @__PURE__ */ jsx39("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx39("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
4886
- return labelled ? /* @__PURE__ */ jsxs35("span", { className: "ui-theme-toggle", children: [
4979
+ const button = /* @__PURE__ */ jsx40("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx40("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
4980
+ return labelled ? /* @__PURE__ */ jsxs36("span", { className: "ui-theme-toggle", children: [
4887
4981
  button,
4888
- /* @__PURE__ */ jsxs35("span", { children: [
4982
+ /* @__PURE__ */ jsxs36("span", { children: [
4889
4983
  label,
4890
4984
  " theme"
4891
4985
  ] })
@@ -4893,18 +4987,18 @@ function ThemeToggle({ labelled = false }) {
4893
4987
  }
4894
4988
 
4895
4989
  // src/AccountMenu.tsx
4896
- import { Fragment as Fragment18, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4990
+ import { Fragment as Fragment18, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
4897
4991
  var THEMES = [["auto", "Auto"], ["light", "Light"], ["dark", "Dark"]];
4898
- var glyph = (svg, className) => /* @__PURE__ */ jsx40("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: svg } });
4992
+ var glyph = (svg, className) => /* @__PURE__ */ jsx41("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: svg } });
4899
4993
  function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4900
4994
  const theme = useThemeChoice();
4901
- const [open, setOpen] = useState18(false);
4902
- const [sub, setSub] = useState18(false);
4903
- const block = useRef22(null);
4904
- const themeRow = useRef22(null);
4905
- const list = useRef22(null);
4906
- const flyout = useRef22(null);
4907
- const refocus = useRef22(false);
4995
+ const [open, setOpen] = useState19(false);
4996
+ const [sub, setSub] = useState19(false);
4997
+ const block = useRef23(null);
4998
+ const themeRow = useRef23(null);
4999
+ const list = useRef23(null);
5000
+ const flyout = useRef23(null);
5001
+ const refocus = useRef23(false);
4908
5002
  const close = () => {
4909
5003
  refocus.current = true;
4910
5004
  setSub(false);
@@ -4934,7 +5028,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4934
5028
  clearTimeout(landed);
4935
5029
  };
4936
5030
  }, [sub, inPlace]);
4937
- useEffect18(() => {
5031
+ useEffect19(() => {
4938
5032
  if (!open || !away) return;
4939
5033
  const gone = () => {
4940
5034
  if (block.current?.getClientRects().length) return;
@@ -4947,7 +5041,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4947
5041
  window.addEventListener("resize", gone);
4948
5042
  return () => window.removeEventListener("resize", gone);
4949
5043
  }, [open, away]);
4950
- useEffect18(() => {
5044
+ useEffect19(() => {
4951
5045
  if (sub) list.current?.querySelector('[role="menuitemradio"]')?.focus();
4952
5046
  else if (refocus.current) {
4953
5047
  refocus.current = false;
@@ -4968,7 +5062,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4968
5062
  e.preventDefault();
4969
5063
  e.stopPropagation();
4970
5064
  };
4971
- const choices = /* @__PURE__ */ jsxs36(
5065
+ const choices = /* @__PURE__ */ jsxs37(
4972
5066
  "div",
4973
5067
  {
4974
5068
  ref: list,
@@ -4978,11 +5072,11 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4978
5072
  onKeyDown: subKeys,
4979
5073
  onClick: (e) => e.stopPropagation(),
4980
5074
  children: [
4981
- inPlace && /* @__PURE__ */ jsxs36("div", { role: "menuitem", tabIndex: -1, className: "ui-dropdown__item", "aria-label": "Back from Theme", onClick: close, children: [
5075
+ inPlace && /* @__PURE__ */ jsxs37("div", { role: "menuitem", tabIndex: -1, className: "ui-dropdown__item", "aria-label": "Back from Theme", onClick: close, children: [
4982
5076
  glyph(icon7("chevronLeft"), "ui-dropdown__ic"),
4983
- /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: "Theme" }) })
5077
+ /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__label", children: "Theme" }) })
4984
5078
  ] }),
4985
- THEMES.map(([value, label]) => /* @__PURE__ */ jsxs36(
5079
+ THEMES.map(([value, label]) => /* @__PURE__ */ jsxs37(
4986
5080
  "div",
4987
5081
  {
4988
5082
  role: "menuitemradio",
@@ -4995,7 +5089,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4995
5089
  },
4996
5090
  children: [
4997
5091
  glyph(themeIcon2(value), "ui-dropdown__ic"),
4998
- /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: label }) }),
5092
+ /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__label", children: label }) }),
4999
5093
  glyph(icon7("check"), "ui-dropdown__tick")
5000
5094
  ]
5001
5095
  },
@@ -5004,7 +5098,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
5004
5098
  ]
5005
5099
  }
5006
5100
  );
5007
- return /* @__PURE__ */ jsx40("div", { ref: block, className: "ui-app__user", children: /* @__PURE__ */ jsx40(
5101
+ return /* @__PURE__ */ jsx41("div", { ref: block, className: "ui-app__user", children: /* @__PURE__ */ jsx41(
5008
5102
  Dropdown,
5009
5103
  {
5010
5104
  variant: "menu",
@@ -5018,17 +5112,17 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
5018
5112
  setOpen(next);
5019
5113
  if (!next) setSub(false);
5020
5114
  },
5021
- triggerContent: /* @__PURE__ */ jsxs36(Fragment18, { children: [
5022
- /* @__PURE__ */ jsx40("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
5023
- /* @__PURE__ */ jsx40("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx40(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
5024
- /* @__PURE__ */ jsxs36("span", { className: "ui-app__who", "aria-hidden": "true", children: [
5025
- /* @__PURE__ */ jsx40("b", { children: account.name }),
5026
- /* @__PURE__ */ jsx40("span", { children: account.email })
5115
+ triggerContent: /* @__PURE__ */ jsxs37(Fragment18, { children: [
5116
+ /* @__PURE__ */ jsx41("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
5117
+ /* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
5118
+ /* @__PURE__ */ jsxs37("span", { className: "ui-app__who", "aria-hidden": "true", children: [
5119
+ /* @__PURE__ */ jsx41("b", { children: account.name }),
5120
+ /* @__PURE__ */ jsx41("span", { children: account.email })
5027
5121
  ] })
5028
5122
  ] }),
5029
5123
  items: [...items, ...withTheme ? [{ label: "Theme", value: "theme" }, "---"] : [], { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
5030
- row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs36(Fragment18, { children: [
5031
- /* @__PURE__ */ jsxs36(
5124
+ row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs37(Fragment18, { children: [
5125
+ /* @__PURE__ */ jsxs37(
5032
5126
  "div",
5033
5127
  {
5034
5128
  ...props,
@@ -5045,13 +5139,13 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
5045
5139
  },
5046
5140
  children: [
5047
5141
  glyph(themeIcon2(theme.theme), "ui-dropdown__ic"),
5048
- /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: "Theme" }) }),
5049
- /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__aside", children: theme.label }),
5142
+ /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__label", children: "Theme" }) }),
5143
+ /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__aside", children: theme.label }),
5050
5144
  glyph(icon7("chevronRight"), "ui-dropdown__more")
5051
5145
  ]
5052
5146
  }
5053
5147
  ),
5054
- sub && (inPlace ? choices : createPortal7(/* @__PURE__ */ jsx40(
5148
+ sub && (inPlace ? choices : createPortal7(/* @__PURE__ */ jsx41(
5055
5149
  "div",
5056
5150
  {
5057
5151
  ref: flyout,
@@ -5059,14 +5153,14 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
5059
5153
  children: choices
5060
5154
  }
5061
5155
  ), document.body))
5062
- ] }) : props.href ? /* @__PURE__ */ jsx40("a", { ...props }) : /* @__PURE__ */ jsx40("div", { ...props }),
5156
+ ] }) : props.href ? /* @__PURE__ */ jsx41("a", { ...props }) : /* @__PURE__ */ jsx41("div", { ...props }),
5063
5157
  onSelect
5064
5158
  }
5065
5159
  ) });
5066
5160
  }
5067
5161
 
5068
5162
  // src/AppShell.tsx
5069
- import { Fragment as Fragment19, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
5163
+ import { Fragment as Fragment19, jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
5070
5164
  var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
5071
5165
  function AppShell({
5072
5166
  sections,
@@ -5096,12 +5190,12 @@ function AppShell({
5096
5190
  onNavigate,
5097
5191
  renderLink
5098
5192
  }) {
5099
- const uid = useId14();
5100
- const [collapsed, setCollapsed] = useState19(defaultCollapsed);
5101
- const [search, setSearch] = useState19(false);
5102
- const [menu, setMenu] = useState19(false);
5103
- const menuButton = useRef23(null);
5104
- const menuBody = useRef23(null);
5193
+ const uid = useId15();
5194
+ const [collapsed, setCollapsed] = useState20(defaultCollapsed);
5195
+ const [search, setSearch] = useState20(false);
5196
+ const [menu, setMenu] = useState20(false);
5197
+ const menuButton = useRef24(null);
5198
+ const menuBody = useRef24(null);
5105
5199
  const firstRow = useMemo5(() => ({ get current() {
5106
5200
  return menuBody.current?.querySelector(".ui-nav__item") ?? null;
5107
5201
  } }), []);
@@ -5109,14 +5203,14 @@ function AppShell({
5109
5203
  const links = rows.flatMap((row2) => row2.items?.length ? row2.items : [row2]);
5110
5204
  const current = path(pathname);
5111
5205
  const active = links.filter((link) => current === path(link.href) || path(link.href) !== "/" && current.startsWith(`${path(link.href)}/`)).sort((a, b) => path(b.href).length - path(a.href).length)[0];
5112
- useEffect19(() => {
5206
+ useEffect20(() => {
5113
5207
  setCollapsed(railCollapsed() ?? defaultCollapsed);
5114
5208
  }, [defaultCollapsed]);
5115
- useEffect19(() => {
5209
+ useEffect20(() => {
5116
5210
  setMenu(false);
5117
5211
  setSearch(false);
5118
5212
  }, [pathname]);
5119
- useEffect19(() => {
5213
+ useEffect20(() => {
5120
5214
  if (!menu) return;
5121
5215
  const grown = () => {
5122
5216
  const button = menuButton.current;
@@ -5125,7 +5219,7 @@ function AppShell({
5125
5219
  window.addEventListener("resize", grown);
5126
5220
  return () => window.removeEventListener("resize", grown);
5127
5221
  }, [menu]);
5128
- useEffect19(() => {
5222
+ useEffect20(() => {
5129
5223
  if (layout === "rail") return;
5130
5224
  const hotkey = (event) => {
5131
5225
  if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "k") return;
@@ -5144,7 +5238,7 @@ function AppShell({
5144
5238
  };
5145
5239
  const row = ({ href, label, icon: icon9, count }) => ({ id: href, href, label, icon: icon9, badge: layout === "rail" ? void 0 : count });
5146
5240
  const nav = groups ? groups.map((group) => ({ label: group.label, items: group.sections.map(row) })) : [{ items: sections.map((section) => ({ ...row(section), items: section.items?.map(row) })) }];
5147
- const sidebar = (label) => /* @__PURE__ */ jsx41(
5241
+ const sidebar = (label) => /* @__PURE__ */ jsx42(
5148
5242
  SidebarNav,
5149
5243
  {
5150
5244
  "aria-label": label,
@@ -5156,22 +5250,23 @@ function AppShell({
5156
5250
  const linkProps = { ...props, onClick: (event) => {
5157
5251
  if (!event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey) setMenu(false);
5158
5252
  } };
5159
- return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */ jsx41("a", { ...linkProps });
5253
+ return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */ jsx42("a", { ...linkProps });
5160
5254
  }
5161
5255
  }
5162
5256
  );
5163
5257
  const foldLabel = collapsed ? "Expand sidebar" : "Collapse sidebar";
5164
5258
  const navigable = links.length > 1 || Boolean(back);
5165
- const lockup = /* @__PURE__ */ jsxs37("a", { className: "ui-app__brand", href: brandHref, "aria-label": word, children: [
5166
- brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
5167
- /* @__PURE__ */ jsx41("span", { children: word })
5259
+ const bandTitle = width === "full" && layout === "topbar" && navigable && title != null;
5260
+ const lockup = /* @__PURE__ */ jsxs38("a", { className: "ui-app__brand", href: brandHref, "aria-label": word, children: [
5261
+ brand ?? /* @__PURE__ */ jsx42("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
5262
+ /* @__PURE__ */ jsx42("span", { children: word })
5168
5263
  ] });
5169
5264
  const ownItems = accountItems.map(({ label, icon: icon9, href }, i) => ({ label, icon: icon9, href, value: `item-${i}` }));
5170
5265
  const pick = (value) => {
5171
5266
  if (value === "sign-out") onSignOut();
5172
5267
  else accountItems[Number(String(value).slice(5))]?.onSelect?.();
5173
5268
  };
5174
- const accountBlock = (withTheme = false, inPlace = false) => /* @__PURE__ */ jsx41(
5269
+ const accountBlock = (withTheme = false, inPlace = false) => /* @__PURE__ */ jsx42(
5175
5270
  AccountMenu,
5176
5271
  {
5177
5272
  account,
@@ -5182,10 +5277,10 @@ function AppShell({
5182
5277
  away: menuButton
5183
5278
  }
5184
5279
  );
5185
- const headSlot = layout === "topbar" && headControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__head-control", children: headControl });
5186
- const foldControl = /* @__PURE__ */ jsxs37("div", { className: "ui-app__fold-row", children: [
5280
+ const headSlot = layout === "topbar" && headControl && /* @__PURE__ */ jsx42("div", { className: "ui-react-app__head-control", children: headControl });
5281
+ const foldControl = /* @__PURE__ */ jsxs38("div", { className: "ui-app__fold-row", children: [
5187
5282
  headSlot,
5188
- /* @__PURE__ */ jsxs37(
5283
+ /* @__PURE__ */ jsxs38(
5189
5284
  "button",
5190
5285
  {
5191
5286
  type: "button",
@@ -5194,37 +5289,37 @@ function AppShell({
5194
5289
  "aria-label": foldLabel,
5195
5290
  onClick: fold,
5196
5291
  children: [
5197
- /* @__PURE__ */ jsx41("span", { className: "ui-nav__ic", children: /* @__PURE__ */ jsxs37("svg", { className: "ui-icon", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
5198
- /* @__PURE__ */ jsx41("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
5199
- /* @__PURE__ */ jsx41("path", { className: "ui-app__fold-seam", d: "M9 3v18" }),
5200
- /* @__PURE__ */ jsx41("path", { className: "ui-app__fold-arrow", d: "m16 15-3-3 3-3" })
5292
+ /* @__PURE__ */ jsx42("span", { className: "ui-nav__ic", children: /* @__PURE__ */ jsxs38("svg", { className: "ui-icon", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
5293
+ /* @__PURE__ */ jsx42("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
5294
+ /* @__PURE__ */ jsx42("path", { className: "ui-app__fold-seam", d: "M9 3v18" }),
5295
+ /* @__PURE__ */ jsx42("path", { className: "ui-app__fold-arrow", d: "m16 15-3-3 3-3" })
5201
5296
  ] }) }),
5202
- /* @__PURE__ */ jsx41("span", { className: "ui-nav__label", children: foldLabel })
5297
+ /* @__PURE__ */ jsx42("span", { className: "ui-nav__label", children: foldLabel })
5203
5298
  ]
5204
5299
  }
5205
5300
  )
5206
5301
  ] });
5207
- const page = /* @__PURE__ */ jsxs37("main", { className: `ui-app__main${width === "wide" ? " ui-app__main--wide" : ""}`, children: [
5208
- back && /* @__PURE__ */ jsx41(BackLink, { ...back }),
5209
- title != null && (tools ? /* @__PURE__ */ jsxs37("div", { className: "ui-app__title-row", children: [
5210
- /* @__PURE__ */ jsx41("h1", { children: title }),
5211
- /* @__PURE__ */ jsx41("div", { className: "ui-app__tools", children: tools })
5212
- ] }) : /* @__PURE__ */ jsx41("h1", { children: title })),
5213
- lede && /* @__PURE__ */ jsx41("p", { className: "ui-app__sub", children: lede }),
5214
- actions && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__actions", children: actions }),
5215
- /* @__PURE__ */ jsx41("div", { className: "ui-app__body", children })
5302
+ const page = /* @__PURE__ */ jsxs38("main", { className: `ui-app__main${width === "centered" ? "" : ` ui-app__main--${width}`}`, children: [
5303
+ back && /* @__PURE__ */ jsx42(BackLink, { ...back }),
5304
+ title != null && !bandTitle && (tools ? /* @__PURE__ */ jsxs38("div", { className: "ui-app__title-row", children: [
5305
+ /* @__PURE__ */ jsx42("h1", { children: title }),
5306
+ /* @__PURE__ */ jsx42("div", { className: "ui-app__tools", children: tools })
5307
+ ] }) : /* @__PURE__ */ jsx42("h1", { children: title })),
5308
+ lede && /* @__PURE__ */ jsx42("p", { className: "ui-app__sub", children: lede }),
5309
+ actions && /* @__PURE__ */ jsx42("div", { className: "ui-react-app__actions", children: actions }),
5310
+ /* @__PURE__ */ jsx42("div", { className: "ui-app__body", children })
5216
5311
  ] });
5217
- if (layout === "rail") return /* @__PURE__ */ jsxs37("div", { className: `ui-app ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
5218
- /* @__PURE__ */ jsxs37("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
5219
- /* @__PURE__ */ jsxs37("div", { className: "ui-app__head", children: [
5312
+ if (layout === "rail") return /* @__PURE__ */ jsxs38("div", { className: `ui-app ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
5313
+ /* @__PURE__ */ jsxs38("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
5314
+ /* @__PURE__ */ jsxs38("div", { className: "ui-app__head", children: [
5220
5315
  lockup,
5221
5316
  foldControl
5222
5317
  ] }),
5223
5318
  sidebar("Sections"),
5224
5319
  accountBlock()
5225
5320
  ] }),
5226
- /* @__PURE__ */ jsxs37("header", { className: "ui-app__bar ui-app__bar--phone", children: [
5227
- /* @__PURE__ */ jsx41(
5321
+ /* @__PURE__ */ jsxs38("header", { className: "ui-app__bar ui-app__bar--phone", children: [
5322
+ /* @__PURE__ */ jsx42(
5228
5323
  Button,
5229
5324
  {
5230
5325
  ref: menuButton,
@@ -5238,10 +5333,10 @@ function AppShell({
5238
5333
  onClick: () => setMenu(true)
5239
5334
  }
5240
5335
  ),
5241
- /* @__PURE__ */ jsx41("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) })
5336
+ /* @__PURE__ */ jsx42("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx42("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) })
5242
5337
  ] }),
5243
5338
  page,
5244
- /* @__PURE__ */ jsx41(
5339
+ /* @__PURE__ */ jsx42(
5245
5340
  Drawer,
5246
5341
  {
5247
5342
  open: menu,
@@ -5249,16 +5344,16 @@ function AppShell({
5249
5344
  title: word,
5250
5345
  side: drawerSide ?? "left",
5251
5346
  size: "sm",
5252
- footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock() }),
5253
- children: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: sidebar("Menu sections") })
5347
+ footer: /* @__PURE__ */ jsx42("div", { className: "ui-app__drawer", children: accountBlock() }),
5348
+ children: /* @__PURE__ */ jsx42("div", { className: "ui-app__drawer", children: sidebar("Menu sections") })
5254
5349
  }
5255
5350
  )
5256
5351
  ] });
5257
- const ends = bandActions && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__band-actions", children: bandActions });
5258
- const control = bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", inert: collapsed, children: bandControl });
5259
- return /* @__PURE__ */ jsxs37("div", { className: `ui-app ui-app--topbar ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
5260
- navigable && /* @__PURE__ */ jsxs37("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
5261
- /* @__PURE__ */ jsxs37("div", { className: "ui-app__head", children: [
5352
+ const ends = bandActions && /* @__PURE__ */ jsx42("div", { className: "ui-react-app__band-actions", children: bandActions });
5353
+ const control = bandControl && /* @__PURE__ */ jsx42("div", { className: "ui-react-app__control", inert: collapsed, children: bandControl });
5354
+ return /* @__PURE__ */ jsxs38("div", { className: `ui-app ui-app--topbar ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
5355
+ navigable && /* @__PURE__ */ jsxs38("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
5356
+ /* @__PURE__ */ jsxs38("div", { className: "ui-app__head", children: [
5262
5357
  lockup,
5263
5358
  foldControl
5264
5359
  ] }),
@@ -5266,20 +5361,23 @@ function AppShell({
5266
5361
  sidebar("Sections"),
5267
5362
  accountBlock(true)
5268
5363
  ] }),
5269
- /* @__PURE__ */ jsxs37("div", { className: "ui-app__well", children: [
5270
- /* @__PURE__ */ jsxs37("header", { className: "ui-app__bar", children: [
5271
- navigable ? /* @__PURE__ */ jsxs37(Fragment19, { children: [
5272
- /* @__PURE__ */ jsx41("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) }),
5273
- /* @__PURE__ */ jsx41("span", { className: "ui-react-app__title", "aria-hidden": "true", children: title })
5364
+ /* @__PURE__ */ jsxs38("div", { className: "ui-app__well", children: [
5365
+ /* @__PURE__ */ jsxs38("header", { className: "ui-app__bar", children: [
5366
+ navigable ? /* @__PURE__ */ jsxs38(Fragment19, { children: [
5367
+ /* @__PURE__ */ jsx42("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx42("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) }),
5368
+ bandTitle ? /* @__PURE__ */ jsxs38(Fragment19, { children: [
5369
+ /* @__PURE__ */ jsx42("h1", { className: "ui-react-app__title ui-react-app__title--page", children: title }),
5370
+ tools && /* @__PURE__ */ jsx42("div", { className: "ui-app__tools ui-react-app__band-tools", children: tools })
5371
+ ] }) : /* @__PURE__ */ jsx42("span", { className: "ui-react-app__title", "aria-hidden": "true", children: title })
5274
5372
  ] }) : lockup,
5275
- /* @__PURE__ */ jsxs37("button", { type: "button", className: "ui-app__search", "aria-haspopup": "dialog", onClick: () => setSearch(true), children: [
5276
- /* @__PURE__ */ jsx41("span", { className: "ui-app__search-ic", children: /* @__PURE__ */ jsx41(Icon, { name: "search" }) }),
5277
- /* @__PURE__ */ jsx41("span", { className: "ui-app__search-txt", children: searchLabel }),
5278
- /* @__PURE__ */ jsx41("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
5373
+ /* @__PURE__ */ jsxs38("button", { type: "button", className: "ui-app__search", "aria-haspopup": "dialog", onClick: () => setSearch(true), children: [
5374
+ /* @__PURE__ */ jsx42("span", { className: "ui-app__search-ic", children: /* @__PURE__ */ jsx42(Icon, { name: "search" }) }),
5375
+ /* @__PURE__ */ jsx42("span", { className: "ui-app__search-txt", children: searchLabel }),
5376
+ /* @__PURE__ */ jsx42("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
5279
5377
  ] }),
5280
- /* @__PURE__ */ jsx41("span", { className: "ui-app__bar-gap" }),
5378
+ /* @__PURE__ */ jsx42("span", { className: "ui-app__bar-gap" }),
5281
5379
  navigable && ends,
5282
- navigable ? /* @__PURE__ */ jsx41(
5380
+ navigable ? /* @__PURE__ */ jsx42(
5283
5381
  Button,
5284
5382
  {
5285
5383
  ref: menuButton,
@@ -5292,12 +5390,12 @@ function AppShell({
5292
5390
  "aria-expanded": menu,
5293
5391
  onClick: () => setMenu(true)
5294
5392
  }
5295
- ) : /* @__PURE__ */ jsxs37(Fragment19, { children: [
5296
- bandControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: bandControl }),
5297
- headControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: headControl }),
5393
+ ) : /* @__PURE__ */ jsxs38(Fragment19, { children: [
5394
+ bandControl && /* @__PURE__ */ jsx42("span", { className: "ui-react-app__band-control", children: bandControl }),
5395
+ headControl && /* @__PURE__ */ jsx42("span", { className: "ui-react-app__band-control", children: headControl }),
5298
5396
  ends,
5299
- /* @__PURE__ */ jsx41(ThemeToggle, {}),
5300
- /* @__PURE__ */ jsx41("div", { className: "ui-app__user ui-app__user--bar", children: /* @__PURE__ */ jsx41(
5397
+ /* @__PURE__ */ jsx42(ThemeToggle, {}),
5398
+ /* @__PURE__ */ jsx42("div", { className: "ui-app__user ui-app__user--bar", children: /* @__PURE__ */ jsx42(
5301
5399
  Dropdown,
5302
5400
  {
5303
5401
  variant: "menu",
@@ -5306,13 +5404,13 @@ function AppShell({
5306
5404
  title: `Signed in as ${account.name}, ${account.email}`,
5307
5405
  triggerClass: "ui-app__user-trigger",
5308
5406
  panelClass: "ui-app__user-panel",
5309
- triggerContent: /* @__PURE__ */ jsxs37(Fragment19, { children: [
5310
- /* @__PURE__ */ jsx41("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
5311
- /* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) })
5407
+ triggerContent: /* @__PURE__ */ jsxs38(Fragment19, { children: [
5408
+ /* @__PURE__ */ jsx42("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
5409
+ /* @__PURE__ */ jsx42("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx42(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) })
5312
5410
  ] }),
5313
- header: /* @__PURE__ */ jsxs37("div", { className: "ui-dropdown__head", children: [
5314
- /* @__PURE__ */ jsx41("b", { children: account.name }),
5315
- /* @__PURE__ */ jsx41("span", { children: account.email })
5411
+ header: /* @__PURE__ */ jsxs38("div", { className: "ui-dropdown__head", children: [
5412
+ /* @__PURE__ */ jsx42("b", { children: account.name }),
5413
+ /* @__PURE__ */ jsx42("span", { children: account.email })
5316
5414
  ] }),
5317
5415
  items: [...ownItems, { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
5318
5416
  onSelect: pick
@@ -5322,7 +5420,7 @@ function AppShell({
5322
5420
  ] }),
5323
5421
  page
5324
5422
  ] }),
5325
- navigable && /* @__PURE__ */ jsx41(
5423
+ navigable && /* @__PURE__ */ jsx42(
5326
5424
  Drawer,
5327
5425
  {
5328
5426
  open: menu,
@@ -5332,47 +5430,155 @@ function AppShell({
5332
5430
  size: "sm",
5333
5431
  initialFocusRef: firstRow,
5334
5432
  headerActions: headSlot,
5335
- footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock(true, true) }),
5336
- children: /* @__PURE__ */ jsxs37("div", { className: "ui-react-app__menu", ref: menuBody, children: [
5337
- bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", children: bandControl }),
5433
+ footer: /* @__PURE__ */ jsx42("div", { className: "ui-app__drawer", children: accountBlock(true, true) }),
5434
+ children: /* @__PURE__ */ jsxs38("div", { className: "ui-react-app__menu", ref: menuBody, children: [
5435
+ bandControl && /* @__PURE__ */ jsx42("div", { className: "ui-react-app__control", children: bandControl }),
5338
5436
  sidebar("Menu sections")
5339
5437
  ] })
5340
5438
  }
5341
5439
  ),
5342
- /* @__PURE__ */ jsx41(CommandPalette, { ...palette ?? { groups: groups ? groups.map((group) => ({ label: group.label, items: group.sections.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 })) })) : [{ items: sections.flatMap((section) => section.items?.length ? section.items.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 ?? section.icon, description: section.label })) : [{ id: section.href, href: section.href, label: section.label, icon: section.icon }]) }] }, onNavigate: palette?.onNavigate ?? onNavigate, open: search, onClose: () => setSearch(false) })
5440
+ /* @__PURE__ */ jsx42(CommandPalette, { ...palette ?? { groups: groups ? groups.map((group) => ({ label: group.label, items: group.sections.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 })) })) : [{ items: sections.flatMap((section) => section.items?.length ? section.items.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 ?? section.icon, description: section.label })) : [{ id: section.href, href: section.href, label: section.label, icon: section.icon }]) }] }, onNavigate: palette?.onNavigate ?? onNavigate, open: search, onClose: () => setSearch(false) })
5343
5441
  ] });
5344
5442
  }
5345
5443
 
5346
5444
  // src/AuthShell.tsx
5347
5445
  import { forwardRef as forwardRef10 } from "react";
5348
- import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
5446
+ import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
5349
5447
  var AuthShell = forwardRef10(function AuthShell2({ brand, children, split, tagline, brandAbove, className, ...rest }, ref) {
5350
5448
  const cls = ["ui-auth", split && "ui-auth--split", brandAbove && "ui-auth--brand-above", className].filter(Boolean).join(" ");
5351
5449
  if (!split && brandAbove) {
5352
- return /* @__PURE__ */ jsxs38("div", { ...rest, ref, className: cls, children: [
5353
- /* @__PURE__ */ jsx42("div", { className: "ui-auth__brand", children: brand }),
5354
- /* @__PURE__ */ jsx42("div", { className: "ui-auth__card", children })
5450
+ return /* @__PURE__ */ jsxs39("div", { ...rest, ref, className: cls, children: [
5451
+ /* @__PURE__ */ jsx43("div", { className: "ui-auth__brand", children: brand }),
5452
+ /* @__PURE__ */ jsx43("div", { className: "ui-auth__card", children })
5355
5453
  ] });
5356
5454
  }
5357
5455
  if (!split) {
5358
- return /* @__PURE__ */ jsx42("div", { ...rest, ref, className: cls, children: /* @__PURE__ */ jsxs38("div", { className: "ui-auth__card", children: [
5359
- /* @__PURE__ */ jsx42("div", { className: "ui-auth__brand", children: brand }),
5456
+ return /* @__PURE__ */ jsx43("div", { ...rest, ref, className: cls, children: /* @__PURE__ */ jsxs39("div", { className: "ui-auth__card", children: [
5457
+ /* @__PURE__ */ jsx43("div", { className: "ui-auth__brand", children: brand }),
5360
5458
  children
5361
5459
  ] }) });
5362
5460
  }
5363
- return /* @__PURE__ */ jsxs38("div", { ...rest, ref, className: cls, children: [
5364
- /* @__PURE__ */ jsxs38("aside", { className: "ui-auth__brand-pane", children: [
5365
- /* @__PURE__ */ jsx42("div", { className: "ui-auth__brand", children: brand }),
5366
- tagline && /* @__PURE__ */ jsx42("p", { className: "ui-auth__tagline", children: tagline })
5461
+ return /* @__PURE__ */ jsxs39("div", { ...rest, ref, className: cls, children: [
5462
+ /* @__PURE__ */ jsxs39("aside", { className: "ui-auth__brand-pane", children: [
5463
+ /* @__PURE__ */ jsx43("div", { className: "ui-auth__brand", children: brand }),
5464
+ tagline && /* @__PURE__ */ jsx43("p", { className: "ui-auth__tagline", children: tagline })
5367
5465
  ] }),
5368
- /* @__PURE__ */ jsx42("div", { className: "ui-auth__pane", children })
5466
+ /* @__PURE__ */ jsx43("div", { className: "ui-auth__pane", children })
5369
5467
  ] });
5370
5468
  });
5371
5469
 
5470
+ // src/ThreeColumnPage.tsx
5471
+ import { useEffect as useEffect21, useId as useId16, useLayoutEffect as useLayoutEffect5, useRef as useRef25, useState as useState21, useSyncExternalStore as useSyncExternalStore2 } from "react";
5472
+ import { Fragment as Fragment20, jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
5473
+ var choiceRow = (item, props) => item.selected === void 0 ? props.href ? /* @__PURE__ */ jsx44("a", { ...props }) : /* @__PURE__ */ jsx44("div", { ...props }) : /* @__PURE__ */ jsxs40("div", { ...props, role: "menuitemradio", "aria-checked": item.selected, children: [
5474
+ props.children,
5475
+ /* @__PURE__ */ jsx44("span", { className: "ui-dropdown__tick", children: /* @__PURE__ */ jsx44(Icon, { name: "check" }) })
5476
+ ] });
5477
+ var AREA = 860;
5478
+ var QUERIES = ["(max-width: 560px)", "(max-width: 860px)"];
5479
+ var lists = () => typeof window === "undefined" || !window.matchMedia ? null : QUERIES.map((q) => window.matchMedia(q));
5480
+ var subscribe2 = (fn) => {
5481
+ const all = lists();
5482
+ all?.forEach((q) => q.addEventListener?.("change", fn));
5483
+ return () => all?.forEach((q) => q.removeEventListener?.("change", fn));
5484
+ };
5485
+ var mode = () => {
5486
+ const [phone, tablet] = lists() ?? [];
5487
+ return phone?.matches ? "phone" : tablet?.matches ? "tablet" : "wide";
5488
+ };
5489
+ var firstShown = (at, depth) => at === "wide" ? 1 : at === "tablet" ? depth === 3 ? 2 : 1 : depth;
5490
+ function ThreeColumnPage({ columns, depth, defaultDepth = 2, onDepthChange, depthHref, className }) {
5491
+ const uid = useId16();
5492
+ const [own, setOwn] = useState21(defaultDepth);
5493
+ const count = columns[2] ? 3 : 2;
5494
+ const at = Math.min(depth ?? own, count);
5495
+ const query = useSyncExternalStore2(subscribe2, mode, () => "wide");
5496
+ const root = useRef25(null);
5497
+ const [area, setArea] = useState21(null);
5498
+ useLayoutEffect5(() => {
5499
+ const el = root.current?.parentElement;
5500
+ if (!el || typeof ResizeObserver === "undefined") return;
5501
+ const observer = new ResizeObserver(([entry]) => setArea(entry?.contentRect.width || null));
5502
+ observer.observe(el);
5503
+ return () => observer.disconnect();
5504
+ }, []);
5505
+ const shown = query === "phone" || area === null ? query : area > AREA ? "wide" : "tablet";
5506
+ const first = firstShown(shown, at);
5507
+ const held = typeof document !== "undefined" && Boolean(root.current?.contains(document.activeElement));
5508
+ useEffect21(() => {
5509
+ const active = document.activeElement;
5510
+ const lost = !active || active === document.body || (active.checkVisibility ? !active.checkVisibility() : false);
5511
+ if (!held || !lost) return;
5512
+ const col = root.current?.querySelector(`[data-column="${at}"] .ui-columns__head`);
5513
+ const title = col?.querySelector(".ui-columns__menu") ?? col?.querySelector("h2");
5514
+ title?.focus({ preventScroll: true });
5515
+ });
5516
+ const up = at - 1;
5517
+ const go = (to) => {
5518
+ if (depth === void 0) setOwn(to);
5519
+ onDepthChange?.(to);
5520
+ };
5521
+ const back = () => go(up);
5522
+ const column = (col, n) => /* @__PURE__ */ jsxs40(
5523
+ "section",
5524
+ {
5525
+ "data-column": n,
5526
+ className: `ui-columns__col ui-columns__col--${n}`,
5527
+ "aria-labelledby": `${uid}-${n}`,
5528
+ children: [
5529
+ /* @__PURE__ */ jsxs40("header", { className: "ui-columns__head", children: [
5530
+ /* @__PURE__ */ jsx44("h2", { id: `${uid}-${n}`, className: col.menu ? "ui-sr" : "ui-card__title", tabIndex: -1, children: col.menu ? col.title : /* @__PURE__ */ jsx44("span", { className: "ui-columns__words", children: col.title }) }),
5531
+ col.menu && /* @__PURE__ */ jsx44(
5532
+ Dropdown,
5533
+ {
5534
+ variant: "menu",
5535
+ align: "start",
5536
+ triggerContent: col.title,
5537
+ triggerClass: "ui-columns__menu",
5538
+ items: col.menu.items,
5539
+ sections: col.menu.sections,
5540
+ header: col.menu.header,
5541
+ onSelect: col.menu.onSelect,
5542
+ scroll: col.menu.scroll,
5543
+ row: choiceRow
5544
+ }
5545
+ ),
5546
+ col.count !== void 0 && /* @__PURE__ */ jsxs40(Fragment20, { children: [
5547
+ /* @__PURE__ */ jsx44("span", { className: "ui-columns__count", "aria-hidden": col.countLabel ? true : void 0, children: col.count }),
5548
+ col.countLabel && /* @__PURE__ */ jsx44("span", { className: "ui-sr", children: col.countLabel })
5549
+ ] }),
5550
+ col.tools && /* @__PURE__ */ jsx44("div", { className: "ui-card__tools", children: col.tools })
5551
+ ] }),
5552
+ /* @__PURE__ */ jsx44("div", { className: "ui-columns__scroll", children: typeof col.children === "function" ? col.children(() => go(Math.min(n + 1, count))) : col.children })
5553
+ ]
5554
+ },
5555
+ n
5556
+ );
5557
+ return /* @__PURE__ */ jsx44("div", { className: "ui-columns-area", children: /* @__PURE__ */ jsxs40("div", { ref: root, className: ["ui-columns", className].filter(Boolean).join(" "), "data-depth": at, children: [
5558
+ first > 1 && /* @__PURE__ */ jsx44("div", { className: "ui-columns__up", children: /* @__PURE__ */ jsx44(
5559
+ BackLink,
5560
+ {
5561
+ href: depthHref?.(up) ?? "#",
5562
+ label: columns[first - 2].title,
5563
+ onClick: (event) => {
5564
+ if (!depthHref) {
5565
+ event.preventDefault();
5566
+ back();
5567
+ return;
5568
+ }
5569
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
5570
+ setTimeout(back);
5571
+ }
5572
+ }
5573
+ ) }),
5574
+ columns.map((col, i) => col && column(col, i + 1))
5575
+ ] }) });
5576
+ }
5577
+
5372
5578
  // src/Footer.tsx
5373
- import { useId as useId15 } from "react";
5579
+ import { useId as useId17 } from "react";
5374
5580
  import { prism as prism2, safeUrl as safeUrl5 } from "@apliteni/apliteni-ui";
5375
- import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
5581
+ import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
5376
5582
  var SOCIAL_GLYPHS = {
5377
5583
  github: '<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.64 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.37.2 2.39.1 2.64.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
5378
5584
  x: '<path d="M4 3h4.5l4 5.5L17.5 3H21l-6.5 8.5L21 21h-4.5l-4.3-5.9L7 21H3.5l6.8-8.9z"/>',
@@ -5381,10 +5587,10 @@ var SOCIAL_GLYPHS = {
5381
5587
  };
5382
5588
  var escapeText = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
5383
5589
  function Legal({ legal, legalLinks, switcher }) {
5384
- return /* @__PURE__ */ jsxs39("div", { className: "ui-footer__bar", children: [
5385
- /* @__PURE__ */ jsx43("span", { className: "ui-footer__legal", children: legal }),
5386
- legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx43("a", { href: safeUrl5(to ?? "#"), children: label }, label)) }),
5387
- switcher ? /* @__PURE__ */ jsx43("div", { className: "ui-footer__switcher", children: switcher }) : null
5590
+ return /* @__PURE__ */ jsxs41("div", { className: "ui-footer__bar", children: [
5591
+ /* @__PURE__ */ jsx45("span", { className: "ui-footer__legal", children: legal }),
5592
+ legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx45("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx45("a", { href: safeUrl5(to ?? "#"), children: label }, label)) }),
5593
+ switcher ? /* @__PURE__ */ jsx45("div", { className: "ui-footer__switcher", children: switcher }) : null
5388
5594
  ] });
5389
5595
  }
5390
5596
  function Footer({
@@ -5402,14 +5608,14 @@ function Footer({
5402
5608
  className,
5403
5609
  ...rest
5404
5610
  }) {
5405
- const uid = useId15();
5611
+ const uid = useId17();
5406
5612
  const cls = ["ui-footer", `ui-footer--${variant}`, className].filter(Boolean).join(" ");
5407
- const bar = /* @__PURE__ */ jsx43(Legal, { legal, legalLinks, switcher });
5613
+ const bar = /* @__PURE__ */ jsx45(Legal, { legal, legalLinks, switcher });
5408
5614
  if (variant !== "full") {
5409
- return /* @__PURE__ */ jsx43("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsx43("div", { className: "ui-footer__in", children: bar }) });
5615
+ return /* @__PURE__ */ jsx45("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsx45("div", { className: "ui-footer__in", children: bar }) });
5410
5616
  }
5411
5617
  const mark = prism2(uid.replace(/:/g, ""), 22);
5412
- const lockup = brand ?? /* @__PURE__ */ jsx43(
5618
+ const lockup = brand ?? /* @__PURE__ */ jsx45(
5413
5619
  "a",
5414
5620
  {
5415
5621
  className: "brand",
@@ -5418,21 +5624,21 @@ function Footer({
5418
5624
  dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
5419
5625
  }
5420
5626
  );
5421
- return /* @__PURE__ */ jsx43("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsxs39("div", { className: "ui-footer__in", children: [
5422
- /* @__PURE__ */ jsxs39("div", { className: "ui-footer__top", children: [
5423
- brand !== false && /* @__PURE__ */ jsxs39("div", { className: "ui-footer__brand", children: [
5627
+ return /* @__PURE__ */ jsx45("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsxs41("div", { className: "ui-footer__in", children: [
5628
+ /* @__PURE__ */ jsxs41("div", { className: "ui-footer__top", children: [
5629
+ brand !== false && /* @__PURE__ */ jsxs41("div", { className: "ui-footer__brand", children: [
5424
5630
  lockup,
5425
- tagline && /* @__PURE__ */ jsx43("p", { className: "ui-footer__tagline", children: tagline }),
5426
- social.length > 0 && /* @__PURE__ */ jsx43("div", { className: "ui-footer__socials", children: social.map(({ label, href: to, icon: icon9 = "github" }) => {
5631
+ tagline && /* @__PURE__ */ jsx45("p", { className: "ui-footer__tagline", children: tagline }),
5632
+ social.length > 0 && /* @__PURE__ */ jsx45("div", { className: "ui-footer__socials", children: social.map(({ label, href: to, icon: icon9 = "github" }) => {
5427
5633
  const markup = SOCIAL_GLYPHS[icon9];
5428
5634
  const fill = icon9 === "mail" ? "none" : "currentColor";
5429
5635
  const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
5430
- return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href: safeUrl5(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx43("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
5636
+ return /* @__PURE__ */ jsx45("a", { className: "ui-footer__social", href: safeUrl5(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx45("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
5431
5637
  }) })
5432
5638
  ] }),
5433
- (links || columns.length > 0) && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs39("div", { className: "ui-footer__col", children: [
5434
- title && /* @__PURE__ */ jsx43("h2", { className: "ui-footer__col-title", children: title }),
5435
- /* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href: safeUrl5(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
5639
+ (links || columns.length > 0) && /* @__PURE__ */ jsx45("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs41("div", { className: "ui-footer__col", children: [
5640
+ title && /* @__PURE__ */ jsx45("h2", { className: "ui-footer__col-title", children: title }),
5641
+ /* @__PURE__ */ jsx45("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx45("li", { children: /* @__PURE__ */ jsx45("a", { href: safeUrl5(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
5436
5642
  ] }, title ?? i)) })
5437
5643
  ] }),
5438
5644
  bar
@@ -5440,32 +5646,32 @@ function Footer({
5440
5646
  }
5441
5647
 
5442
5648
  // src/ThemeChoice.tsx
5443
- import { useId as useId16 } from "react";
5444
- import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
5649
+ import { useId as useId18 } from "react";
5650
+ import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
5445
5651
  var OPTIONS = [
5446
5652
  { value: "auto", name: "System" },
5447
5653
  { value: "light", name: "Light" },
5448
5654
  { value: "dark", name: "Dark" }
5449
5655
  ];
5450
- var Scene = ({ theme }) => /* @__PURE__ */ jsxs40("span", { className: `ui-theme-choice__scene ui-theme-choice__scene--${theme}`, children: [
5451
- /* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__rail", children: [
5452
- /* @__PURE__ */ jsx44("span", {}),
5453
- /* @__PURE__ */ jsx44("span", {}),
5454
- /* @__PURE__ */ jsx44("span", {})
5656
+ var Scene = ({ theme }) => /* @__PURE__ */ jsxs42("span", { className: `ui-theme-choice__scene ui-theme-choice__scene--${theme}`, children: [
5657
+ /* @__PURE__ */ jsxs42("span", { className: "ui-theme-choice__rail", children: [
5658
+ /* @__PURE__ */ jsx46("span", {}),
5659
+ /* @__PURE__ */ jsx46("span", {}),
5660
+ /* @__PURE__ */ jsx46("span", {})
5455
5661
  ] }),
5456
- /* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__main", children: [
5457
- /* @__PURE__ */ jsx44("span", { className: "ui-theme-choice__title" }),
5458
- /* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__card", children: [
5459
- /* @__PURE__ */ jsx44("span", {}),
5460
- /* @__PURE__ */ jsx44("span", {})
5662
+ /* @__PURE__ */ jsxs42("span", { className: "ui-theme-choice__main", children: [
5663
+ /* @__PURE__ */ jsx46("span", { className: "ui-theme-choice__title" }),
5664
+ /* @__PURE__ */ jsxs42("span", { className: "ui-theme-choice__card", children: [
5665
+ /* @__PURE__ */ jsx46("span", {}),
5666
+ /* @__PURE__ */ jsx46("span", {})
5461
5667
  ] })
5462
5668
  ] })
5463
5669
  ] });
5464
5670
  function ThemeChoice({ label = "Theme" }) {
5465
5671
  const { theme, set } = useThemeChoice();
5466
- const name = useId16();
5467
- return /* @__PURE__ */ jsx44("div", { className: "ui-theme-choice", role: "radiogroup", "aria-label": label, children: OPTIONS.map(({ value, name: text2 }) => /* @__PURE__ */ jsxs40("label", { className: "ui-theme-choice__option", children: [
5468
- /* @__PURE__ */ jsx44(
5672
+ const name = useId18();
5673
+ return /* @__PURE__ */ jsx46("div", { className: "ui-theme-choice", role: "radiogroup", "aria-label": label, children: OPTIONS.map(({ value, name: text2 }) => /* @__PURE__ */ jsxs42("label", { className: "ui-theme-choice__option", children: [
5674
+ /* @__PURE__ */ jsx46(
5469
5675
  "input",
5470
5676
  {
5471
5677
  type: "radio",
@@ -5476,20 +5682,20 @@ function ThemeChoice({ label = "Theme" }) {
5476
5682
  onChange: () => set(value)
5477
5683
  }
5478
5684
  ),
5479
- /* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__pic", "aria-hidden": "true", children: [
5480
- value === "dark" ? /* @__PURE__ */ jsx44(Scene, { theme: "dark" }) : /* @__PURE__ */ jsx44(Scene, { theme: "light" }),
5481
- value === "auto" && /* @__PURE__ */ jsx44(Scene, { theme: "dark" })
5685
+ /* @__PURE__ */ jsxs42("span", { className: "ui-theme-choice__pic", "aria-hidden": "true", children: [
5686
+ value === "dark" ? /* @__PURE__ */ jsx46(Scene, { theme: "dark" }) : /* @__PURE__ */ jsx46(Scene, { theme: "light" }),
5687
+ value === "auto" && /* @__PURE__ */ jsx46(Scene, { theme: "dark" })
5482
5688
  ] }),
5483
- /* @__PURE__ */ jsx44("span", { className: "ui-theme-choice__name", children: text2 })
5689
+ /* @__PURE__ */ jsx46("span", { className: "ui-theme-choice__name", children: text2 })
5484
5690
  ] }, value)) });
5485
5691
  }
5486
5692
 
5487
5693
  // src/Success.tsx
5488
- import { forwardRef as forwardRef11, useEffect as useEffect20, useRef as useRef24, useState as useState20 } from "react";
5489
- import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
5694
+ import { forwardRef as forwardRef11, useEffect as useEffect22, useRef as useRef26, useState as useState22 } from "react";
5695
+ import { jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
5490
5696
  var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
5491
5697
  const circled = variant === "circled";
5492
- return /* @__PURE__ */ jsxs41(
5698
+ return /* @__PURE__ */ jsxs43(
5493
5699
  "svg",
5494
5700
  {
5495
5701
  ...rest,
@@ -5501,18 +5707,18 @@ var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", class
5501
5707
  "aria-hidden": "true",
5502
5708
  focusable: "false",
5503
5709
  children: [
5504
- circled && /* @__PURE__ */ jsx45("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
5505
- /* @__PURE__ */ jsx45("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
5710
+ circled && /* @__PURE__ */ jsx47("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
5711
+ /* @__PURE__ */ jsx47("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
5506
5712
  ]
5507
5713
  }
5508
5714
  );
5509
5715
  });
5510
5716
  var SuccessPanel = forwardRef11(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
5511
5717
  const circled = check === "circled";
5512
- return /* @__PURE__ */ jsxs41("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
5513
- /* @__PURE__ */ jsx45("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx45(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
5514
- /* @__PURE__ */ jsx45("div", { className: "ui-success__title", children: title }),
5515
- sub && /* @__PURE__ */ jsx45("div", { className: "ui-success__sub", children: sub })
5718
+ return /* @__PURE__ */ jsxs43("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
5719
+ /* @__PURE__ */ jsx47("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx47(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
5720
+ /* @__PURE__ */ jsx47("div", { className: "ui-success__title", children: title }),
5721
+ sub && /* @__PURE__ */ jsx47("div", { className: "ui-success__sub", children: sub })
5516
5722
  ] });
5517
5723
  });
5518
5724
  var pieces = [
@@ -5532,12 +5738,12 @@ var pieces = [
5532
5738
  [80, 0.36, -20, "c", 1.05]
5533
5739
  ];
5534
5740
  function Countdown({ seconds, label = "Redirecting", onDone }) {
5535
- const [remaining, setRemaining] = useState20(seconds);
5536
- const callback = useRef24(onDone);
5537
- useEffect20(() => {
5741
+ const [remaining, setRemaining] = useState22(seconds);
5742
+ const callback = useRef26(onDone);
5743
+ useEffect22(() => {
5538
5744
  callback.current = onDone;
5539
5745
  }, [onDone]);
5540
- useEffect20(() => {
5746
+ useEffect22(() => {
5541
5747
  let count = seconds;
5542
5748
  const timer = setInterval(() => {
5543
5749
  count -= 1;
@@ -5549,12 +5755,12 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
5549
5755
  }, 1e3);
5550
5756
  return () => clearInterval(timer);
5551
5757
  }, [seconds]);
5552
- return /* @__PURE__ */ jsxs41("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
5553
- /* @__PURE__ */ jsx45("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
5554
- /* @__PURE__ */ jsxs41("span", { className: "ui-sx__count-text", children: [
5758
+ return /* @__PURE__ */ jsxs43("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
5759
+ /* @__PURE__ */ jsx47("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
5760
+ /* @__PURE__ */ jsxs43("span", { className: "ui-sx__count-text", children: [
5555
5761
  label,
5556
5762
  " in ",
5557
- /* @__PURE__ */ jsx45("b", { "data-sx-num": "", children: remaining }),
5763
+ /* @__PURE__ */ jsx47("b", { "data-sx-num": "", children: remaining }),
5558
5764
  "s"
5559
5765
  ] })
5560
5766
  ] });
@@ -5581,7 +5787,7 @@ var Success = forwardRef11(function Success2({
5581
5787
  const seconds = countdown?.seconds;
5582
5788
  const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
5583
5789
  const mark = check === "circled" ? "circled" : "line";
5584
- return /* @__PURE__ */ jsxs41(
5790
+ return /* @__PURE__ */ jsxs43(
5585
5791
  "div",
5586
5792
  {
5587
5793
  role: "status",
@@ -5590,16 +5796,16 @@ var Success = forwardRef11(function Success2({
5590
5796
  ref,
5591
5797
  className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
5592
5798
  children: [
5593
- confetti && /* @__PURE__ */ jsx45("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
5594
- ([x, d, r, t, s], index) => /* @__PURE__ */ jsx45("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
5799
+ confetti && /* @__PURE__ */ jsx47("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
5800
+ ([x, d, r, t, s], index) => /* @__PURE__ */ jsx47("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
5595
5801
  ) }),
5596
- /* @__PURE__ */ jsxs41("div", { className: "ui-sx__inner", children: [
5597
- /* @__PURE__ */ jsx45("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx45(SuccessCheck, { variant: mark }) }),
5598
- /* @__PURE__ */ jsxs41("div", { className: "ui-sx__content", children: [
5599
- /* @__PURE__ */ jsx45(Heading, { className: "ui-sx__title", children: title }),
5600
- body && /* @__PURE__ */ jsx45("p", { className: "ui-sx__body", children: body }),
5601
- hasActions && /* @__PURE__ */ jsx45("div", { className: "ui-sx__actions", children: actions }),
5602
- countdown && /* @__PURE__ */ jsx45(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
5802
+ /* @__PURE__ */ jsxs43("div", { className: "ui-sx__inner", children: [
5803
+ /* @__PURE__ */ jsx47("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx47(SuccessCheck, { variant: mark }) }),
5804
+ /* @__PURE__ */ jsxs43("div", { className: "ui-sx__content", children: [
5805
+ /* @__PURE__ */ jsx47(Heading, { className: "ui-sx__title", children: title }),
5806
+ body && /* @__PURE__ */ jsx47("p", { className: "ui-sx__body", children: body }),
5807
+ hasActions && /* @__PURE__ */ jsx47("div", { className: "ui-sx__actions", children: actions }),
5808
+ countdown && /* @__PURE__ */ jsx47(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
5603
5809
  ] })
5604
5810
  ] })
5605
5811
  ]
@@ -5611,18 +5817,18 @@ var Success = forwardRef11(function Success2({
5611
5817
  import {
5612
5818
  useCallback as useCallback8,
5613
5819
  useContext as useContext5,
5614
- useEffect as useEffect21,
5615
- useId as useId17,
5616
- useLayoutEffect as useLayoutEffect5,
5820
+ useEffect as useEffect23,
5821
+ useId as useId19,
5822
+ useLayoutEffect as useLayoutEffect6,
5617
5823
  useMemo as useMemo6,
5618
- useRef as useRef25,
5619
- useState as useState21
5824
+ useRef as useRef27,
5825
+ useState as useState23
5620
5826
  } from "react";
5621
5827
  import { createPortal as createPortal8 } from "react-dom";
5622
5828
  import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
5623
5829
 
5624
5830
  // src/chart-looks.tsx
5625
- import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
5831
+ import { Fragment as Fragment21, jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
5626
5832
  var LOOK_DEFAULT = {
5627
5833
  line: "thin",
5628
5834
  area: "stacked",
@@ -5844,7 +6050,7 @@ function linesDrawing(g, open) {
5844
6050
  const [a, b] = [run[0], run[run.length - 1]];
5845
6051
  return `M${px(centre(a))} ${px(y(layer.from[a]))}L${px(centre(a))} ${px(y(at(layer, a)))}${run.slice(0, -1).map((i) => bend(k, i)).join("")}L${px(centre(b))} ${px(y(layer.from[b]))}Z`;
5846
6052
  }).join("");
5847
- return d && /* @__PURE__ */ jsx46(
6053
+ return d && /* @__PURE__ */ jsx48(
5848
6054
  "path",
5849
6055
  {
5850
6056
  className: cx8("ui-chart__area", tone(layer.tone)),
@@ -5854,7 +6060,7 @@ function linesDrawing(g, open) {
5854
6060
  `fill-${layer.id}`
5855
6061
  );
5856
6062
  }
5857
- return /* @__PURE__ */ jsx46(
6063
+ return /* @__PURE__ */ jsx48(
5858
6064
  "path",
5859
6065
  {
5860
6066
  className: cx8(look.share ? "ui-chart__segment" : "ui-chart__area", tone(layer.tone)),
@@ -5864,7 +6070,7 @@ function linesDrawing(g, open) {
5864
6070
  `fill-${layer.id}`
5865
6071
  );
5866
6072
  });
5867
- const edges = curves ? look.layers.flatMap((layer, k) => layer.to.slice(1).map((_, i) => finite(layer, i) && finite(layer, i + 1) ? /* @__PURE__ */ jsx46(
6073
+ const edges = curves ? look.layers.flatMap((layer, k) => layer.to.slice(1).map((_, i) => finite(layer, i) && finite(layer, i + 1) ? /* @__PURE__ */ jsx48(
5868
6074
  "path",
5869
6075
  {
5870
6076
  className: cx8(
@@ -5875,7 +6081,7 @@ function linesDrawing(g, open) {
5875
6081
  d: `M${px(centre(i))} ${px(y(at(layer, i)))}${bend(k, i)}`
5876
6082
  },
5877
6083
  `edge-${layer.id}-${i}`
5878
- ) : null)) : !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */ jsx46(
6084
+ ) : null)) : !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */ jsx48(
5879
6085
  "line",
5880
6086
  {
5881
6087
  className: cx8(
@@ -5897,7 +6103,7 @@ function linesDrawing(g, open) {
5897
6103
  const shown = i === open || points || lonely && !look.share;
5898
6104
  if (!shown || look.share && i !== open) return null;
5899
6105
  if (look.share && layer !== look.layers[look.layers.length - 1]) return null;
5900
- return /* @__PURE__ */ jsx46(
6106
+ return /* @__PURE__ */ jsx48(
5901
6107
  "circle",
5902
6108
  {
5903
6109
  className: cx8("ui-chart__dot", tone(layer.tone)),
@@ -5925,8 +6131,8 @@ function linesDrawing(g, open) {
5925
6131
  base = at2 + Math.max(drop, fall + gap + ascent);
5926
6132
  }
5927
6133
  }
5928
- return /* @__PURE__ */ jsxs42("g", { children: [
5929
- /* @__PURE__ */ jsx46(
6134
+ return /* @__PURE__ */ jsxs44("g", { children: [
6135
+ /* @__PURE__ */ jsx48(
5930
6136
  "circle",
5931
6137
  {
5932
6138
  className: cx8("ui-chart__dot", tone(layer.tone)),
@@ -5935,7 +6141,7 @@ function linesDrawing(g, open) {
5935
6141
  r: "4"
5936
6142
  }
5937
6143
  ),
5938
- /* @__PURE__ */ jsx46(
6144
+ /* @__PURE__ */ jsx48(
5939
6145
  "text",
5940
6146
  {
5941
6147
  className: "ui-chart__text ui-chart__text--strong",
@@ -5947,8 +6153,8 @@ function linesDrawing(g, open) {
5947
6153
  )
5948
6154
  ] }, `end-${layer.id}`);
5949
6155
  });
5950
- return /* @__PURE__ */ jsxs42(Fragment20, { children: [
5951
- ramps.some(Boolean) && /* @__PURE__ */ jsx46("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs42(
6156
+ return /* @__PURE__ */ jsxs44(Fragment21, { children: [
6157
+ ramps.some(Boolean) && /* @__PURE__ */ jsx48("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs44(
5952
6158
  "linearGradient",
5953
6159
  {
5954
6160
  id: ramp.id,
@@ -5959,14 +6165,14 @@ function linesDrawing(g, open) {
5959
6165
  y1: px(y(ramp.lo)),
5960
6166
  y2: px(y(ramp.hi)),
5961
6167
  children: [
5962
- /* @__PURE__ */ jsx46("stop", { className: curves ? "ui-chart__wash-floor" : "ui-chart__fade-base", offset: "0" }),
5963
- /* @__PURE__ */ jsx46("stop", { className: curves ? "ui-chart__wash-top" : "ui-chart__fade-end", offset: "1" })
6168
+ /* @__PURE__ */ jsx48("stop", { className: curves ? "ui-chart__wash-floor" : "ui-chart__fade-base", offset: "0" }),
6169
+ /* @__PURE__ */ jsx48("stop", { className: curves ? "ui-chart__wash-top" : "ui-chart__fade-end", offset: "1" })
5964
6170
  ]
5965
6171
  },
5966
6172
  ramp.id
5967
6173
  )) }),
5968
6174
  fills,
5969
- open !== null && /* @__PURE__ */ jsx46(
6175
+ open !== null && /* @__PURE__ */ jsx48(
5970
6176
  "line",
5971
6177
  {
5972
6178
  className: "ui-chart__cross",
@@ -5991,7 +6197,7 @@ function columnsDrawing(g) {
5991
6197
  const y1 = y(layer.to[i]);
5992
6198
  const x = centre(i) - w / 2;
5993
6199
  const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, 4) : square(x, y1, w, y0 - y1);
5994
- return /* @__PURE__ */ jsx46(
6200
+ return /* @__PURE__ */ jsx48(
5995
6201
  "path",
5996
6202
  {
5997
6203
  className: cx8("ui-chart__segment", tone(layer.tone), label.estimated && "is-estimated"),
@@ -6006,10 +6212,10 @@ function rowsDrawing(g, pick) {
6006
6212
  const { look, labels, format, formatAxis, scale } = g;
6007
6213
  const rows = rowsOf(g);
6008
6214
  const bottom = rows.row * labels.length;
6009
- return /* @__PURE__ */ jsxs42(Fragment20, { children: [
6010
- pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx46("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
6011
- scale.ticks.map((tick) => /* @__PURE__ */ jsxs42("g", { children: [
6012
- /* @__PURE__ */ jsx46(
6215
+ return /* @__PURE__ */ jsxs44(Fragment21, { children: [
6216
+ pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx48("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
6217
+ scale.ticks.map((tick) => /* @__PURE__ */ jsxs44("g", { children: [
6218
+ /* @__PURE__ */ jsx48(
6013
6219
  "line",
6014
6220
  {
6015
6221
  className: tick === 0 ? "ui-chart__zero" : "ui-chart__grid",
@@ -6019,7 +6225,7 @@ function rowsDrawing(g, pick) {
6019
6225
  y2: px(bottom)
6020
6226
  }
6021
6227
  ),
6022
- /* @__PURE__ */ jsx46(
6228
+ /* @__PURE__ */ jsx48(
6023
6229
  "text",
6024
6230
  {
6025
6231
  className: "ui-chart__caption",
@@ -6034,8 +6240,8 @@ function rowsDrawing(g, pick) {
6034
6240
  labels.map((label, i) => {
6035
6241
  const top = rows.top(i);
6036
6242
  const filled = look.layers.filter((l) => l.to[i] > l.from[i]);
6037
- return /* @__PURE__ */ jsxs42("g", { children: [
6038
- /* @__PURE__ */ jsx46(
6243
+ return /* @__PURE__ */ jsxs44("g", { children: [
6244
+ /* @__PURE__ */ jsx48(
6039
6245
  "text",
6040
6246
  {
6041
6247
  className: "ui-chart__caption",
@@ -6050,7 +6256,7 @@ function rowsDrawing(g, pick) {
6050
6256
  const x0 = rows.x(layer.from[i]);
6051
6257
  const x1 = rows.x(layer.to[i]);
6052
6258
  const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, 4) : square(x0, top, x1 - x0, ROW_BAR);
6053
- return /* @__PURE__ */ jsx46(
6259
+ return /* @__PURE__ */ jsx48(
6054
6260
  "path",
6055
6261
  {
6056
6262
  d,
@@ -6059,7 +6265,7 @@ function rowsDrawing(g, pick) {
6059
6265
  `seg-${layer.id}`
6060
6266
  );
6061
6267
  }),
6062
- /* @__PURE__ */ jsx46(
6268
+ /* @__PURE__ */ jsx48(
6063
6269
  "text",
6064
6270
  {
6065
6271
  className: "ui-chart__text",
@@ -6077,8 +6283,8 @@ function ringDrawing(g) {
6077
6283
  const { look, format } = g;
6078
6284
  const ring = ringOf(g);
6079
6285
  const total = look.totals[0];
6080
- return /* @__PURE__ */ jsxs42(Fragment20, { children: [
6081
- look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx46(
6286
+ return /* @__PURE__ */ jsxs44(Fragment21, { children: [
6287
+ look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx48(
6082
6288
  "path",
6083
6289
  {
6084
6290
  className: cx8("ui-chart__segment", tone(slice.tone)),
@@ -6086,42 +6292,42 @@ function ringDrawing(g) {
6086
6292
  },
6087
6293
  `slice-${slice.id}`
6088
6294
  )),
6089
- look.look === "thin" && /* @__PURE__ */ jsxs42("g", { "aria-hidden": "true", children: [
6090
- /* @__PURE__ */ jsx46("text", { className: "ui-chart__total", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 2), children: format(total) }),
6091
- /* @__PURE__ */ jsx46("text", { className: "ui-chart__caption", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 22), children: look.totalLabel })
6295
+ look.look === "thin" && /* @__PURE__ */ jsxs44("g", { "aria-hidden": "true", children: [
6296
+ /* @__PURE__ */ jsx48("text", { className: "ui-chart__total", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 2), children: format(total) }),
6297
+ /* @__PURE__ */ jsx48("text", { className: "ui-chart__caption", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 22), children: look.totalLabel })
6092
6298
  ] }),
6093
6299
  look.look === "labels" && look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => {
6094
6300
  const mid = angle((slice.from[0] + slice.to[0]) / 2);
6095
6301
  const x = ring.x + (ring.r + 14) * Math.cos(mid);
6096
6302
  const y = ring.y + (ring.r + 14) * Math.sin(mid);
6097
6303
  const anchor = Math.cos(mid) >= 0 ? "start" : "end";
6098
- return /* @__PURE__ */ jsxs42("g", { "aria-hidden": "true", children: [
6099
- /* @__PURE__ */ jsx46("text", { className: "ui-chart__text ui-chart__text--strong", textAnchor: anchor, x: px(x), y: px(y - 2), children: slice.name }),
6100
- /* @__PURE__ */ jsx46("text", { className: "ui-chart__text", textAnchor: anchor, x: px(x), y: px(y + 13), children: `${format(slice.values[0])} ${pct(slice.to[0] - slice.from[0])}` })
6304
+ return /* @__PURE__ */ jsxs44("g", { "aria-hidden": "true", children: [
6305
+ /* @__PURE__ */ jsx48("text", { className: "ui-chart__text ui-chart__text--strong", textAnchor: anchor, x: px(x), y: px(y - 2), children: slice.name }),
6306
+ /* @__PURE__ */ jsx48("text", { className: "ui-chart__text", textAnchor: anchor, x: px(x), y: px(y + 13), children: `${format(slice.values[0])} ${pct(slice.to[0] - slice.from[0])}` })
6101
6307
  ] }, `label-${slice.id}`);
6102
6308
  })
6103
6309
  ] });
6104
6310
  }
6105
6311
  function Shares({ look, format, swatch }) {
6106
6312
  const total = look.totals[0];
6107
- return /* @__PURE__ */ jsxs42("ul", { className: "ui-chart__shares", "aria-hidden": "true", children: [
6108
- look.layers.map((slice) => /* @__PURE__ */ jsxs42("li", { className: tone(slice.tone), children: [
6313
+ return /* @__PURE__ */ jsxs44("ul", { className: "ui-chart__shares", "aria-hidden": "true", children: [
6314
+ look.layers.map((slice) => /* @__PURE__ */ jsxs44("li", { className: tone(slice.tone), children: [
6109
6315
  swatch,
6110
- /* @__PURE__ */ jsx46("span", { children: slice.name }),
6111
- /* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-value", children: format(slice.values[0]) }),
6112
- /* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-pct", children: total > 0 ? pct(slice.to[0] - slice.from[0]) : MISSING })
6316
+ /* @__PURE__ */ jsx48("span", { children: slice.name }),
6317
+ /* @__PURE__ */ jsx48("span", { className: "ui-chart__shares-value", children: format(slice.values[0]) }),
6318
+ /* @__PURE__ */ jsx48("span", { className: "ui-chart__shares-pct", children: total > 0 ? pct(slice.to[0] - slice.from[0]) : MISSING })
6113
6319
  ] }, slice.id)),
6114
- /* @__PURE__ */ jsxs42("li", { className: "ui-chart__shares-total", children: [
6115
- /* @__PURE__ */ jsx46("span", {}),
6116
- /* @__PURE__ */ jsx46("span", { children: look.totalLabel }),
6117
- /* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-value", children: format(total) }),
6118
- /* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-pct", children: "100%" })
6320
+ /* @__PURE__ */ jsxs44("li", { className: "ui-chart__shares-total", children: [
6321
+ /* @__PURE__ */ jsx48("span", {}),
6322
+ /* @__PURE__ */ jsx48("span", { children: look.totalLabel }),
6323
+ /* @__PURE__ */ jsx48("span", { className: "ui-chart__shares-value", children: format(total) }),
6324
+ /* @__PURE__ */ jsx48("span", { className: "ui-chart__shares-pct", children: "100%" })
6119
6325
  ] })
6120
6326
  ] });
6121
6327
  }
6122
6328
 
6123
6329
  // src/Chart.tsx
6124
- import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
6330
+ import { Fragment as Fragment22, jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
6125
6331
  function placeChartTip(mark, tip) {
6126
6332
  const rect = mark.getBoundingClientRect();
6127
6333
  const view = tip.ownerDocument.documentElement;
@@ -6191,8 +6397,8 @@ function barPath(m, corner = m.w / 2) {
6191
6397
  return `M${px2(x)} ${px2(roundBottom ? bottom - r : bottom)}V${px2(roundTop ? top + r : top)}` + (roundTop ? `${arc2(r, -r, 1)}h${px2(w - r * 2)}${arc2(r, r, 1)}` : `h${px2(w)}`) + `V${px2(roundBottom ? bottom - r : bottom)}` + (roundBottom ? `${arc2(-r, r, 1)}h${px2(-(w - r * 2))}${arc2(-r, -r, 1)}` : `h${px2(-w)}`) + "z";
6192
6398
  }
6193
6399
  function useTapFloor() {
6194
- const [floor, setFloor] = useState21(TARGET);
6195
- useEffect21(() => {
6400
+ const [floor, setFloor] = useState23(TARGET);
6401
+ useEffect23(() => {
6196
6402
  const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX2}px) and (pointer: coarse)`);
6197
6403
  if (!query) return;
6198
6404
  const read = () => setFloor(query.matches ? TAP_FLOOR : TARGET);
@@ -6203,9 +6409,9 @@ function useTapFloor() {
6203
6409
  return floor;
6204
6410
  }
6205
6411
  function useTextWidth(host) {
6206
- const [face, setFace] = useState21(null);
6207
- const [loaded, setLoaded] = useState21(0);
6208
- useEffect21(() => {
6412
+ const [face, setFace] = useState23(null);
6413
+ const [loaded, setLoaded] = useState23(0);
6414
+ useEffect23(() => {
6209
6415
  const el = host.current;
6210
6416
  if (!el || typeof OffscreenCanvas === "undefined") return;
6211
6417
  const style = getComputedStyle(el);
@@ -6433,9 +6639,9 @@ function donutFrame(look, slices, totalLabel, format) {
6433
6639
  }
6434
6640
  function KeyMark({ shape }) {
6435
6641
  if (shape === "line") {
6436
- return /* @__PURE__ */ jsx47("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx47("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) });
6642
+ return /* @__PURE__ */ jsx49("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx49("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) });
6437
6643
  }
6438
- return /* @__PURE__ */ jsx47("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: shape === "fill" ? /* @__PURE__ */ jsx47("rect", { className: "ui-chart__key-swatch", x: "1", y: "1", width: "10", height: "10", rx: "2.5" }) : /* @__PURE__ */ jsx47(
6644
+ return /* @__PURE__ */ jsx49("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: shape === "fill" ? /* @__PURE__ */ jsx49("rect", { className: "ui-chart__key-swatch", x: "1", y: "1", width: "10", height: "10", rx: "2.5" }) : /* @__PURE__ */ jsx49(
6439
6645
  "path",
6440
6646
  {
6441
6647
  className: "ui-chart__key-swatch",
@@ -6462,32 +6668,32 @@ function Chart(props) {
6462
6668
  const showValues = fit && "values" in props && props.values === true;
6463
6669
  const plotHeight = height ?? HEIGHT[variant];
6464
6670
  const showTable = table ?? !spark;
6465
- const [view, setView] = useState21("chart");
6671
+ const [view, setView] = useState23("chart");
6466
6672
  const asTable = showTable && view === "table";
6467
- const uid = useId17().replace(/[^\w-]/g, "");
6468
- const frameEl = useRef25(null);
6673
+ const uid = useId19().replace(/[^\w-]/g, "");
6674
+ const frameEl = useRef27(null);
6469
6675
  const card = useContext5(CardTools);
6470
6676
  const claim = card?.claim;
6471
- useLayoutEffect5(() => showTable && claim ? claim(uid) : void 0, [showTable, claim, uid]);
6677
+ useLayoutEffect6(() => showTable && claim ? claim(uid) : void 0, [showTable, claim, uid]);
6472
6678
  const toCard = showTable && card?.owner === uid ? card.slot : null;
6473
- const scroller = useRef25(null);
6474
- const plot = useRef25(null);
6475
- const tipEl = useRef25(null);
6476
- const svgEl = useRef25(null);
6477
- const ignoreMouseUntil = useRef25(0);
6478
- const touchMoved = useRef25(false);
6479
- const dismissed = useRef25(null);
6480
- const opening = useRef25(false);
6481
- const pointerFocus = useRef25(false);
6679
+ const scroller = useRef27(null);
6680
+ const plot = useRef27(null);
6681
+ const tipEl = useRef27(null);
6682
+ const svgEl = useRef27(null);
6683
+ const ignoreMouseUntil = useRef27(0);
6684
+ const touchMoved = useRef27(false);
6685
+ const dismissed = useRef27(null);
6686
+ const opening = useRef27(false);
6687
+ const pointerFocus = useRef27(false);
6482
6688
  const floor = useTapFloor();
6483
6689
  const textWidth = useTextWidth(frameEl);
6484
- const [width, setWidth] = useState21(0);
6485
- const [boxWidth, setBoxWidth] = useState21(0);
6486
- const [overflows, setOverflows] = useState21(false);
6487
- const [openId, setOpenId] = useState21(null);
6488
- const [rawCursor, setCursor] = useState21(0);
6489
- const [said, setSaid] = useState21("");
6490
- const [ownPick, setOwnPick] = useState21(null);
6690
+ const [width, setWidth] = useState23(0);
6691
+ const [boxWidth, setBoxWidth] = useState23(0);
6692
+ const [overflows, setOverflows] = useState23(false);
6693
+ const [openId, setOpenId] = useState23(null);
6694
+ const [rawCursor, setCursor] = useState23(0);
6695
+ const [said, setSaid] = useState23("");
6696
+ const [ownPick, setOwnPick] = useState23(null);
6491
6697
  const pick = selected === void 0 ? ownPick : selected;
6492
6698
  const topLayer = typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype.showPopover === "function";
6493
6699
  const steps = props.variant === "bridge" ? props.steps : void 0;
@@ -6635,7 +6841,7 @@ function Chart(props) {
6635
6841
  const fades = useMemo6(() => new Map(marks.filter((m) => m.kind === "bar").map(fadeFor).filter((f) => f !== null).map((f) => [f.id, f])), [marks, fadeFor]);
6636
6842
  const lead = useCallback8((column) => marks.find((m) => m.column === column), [marks]);
6637
6843
  const open = openId ? byId.get(openId) : void 0;
6638
- useEffect21(() => {
6844
+ useEffect23(() => {
6639
6845
  const el = plot.current;
6640
6846
  const box2 = scroller.current;
6641
6847
  if (!el || !box2) return;
@@ -6652,11 +6858,11 @@ function Chart(props) {
6652
6858
  return () => observer.disconnect();
6653
6859
  }, []);
6654
6860
  const opensAtEnd = Boolean(periods);
6655
- useLayoutEffect5(() => {
6861
+ useLayoutEffect6(() => {
6656
6862
  const el = scroller.current;
6657
6863
  if (opensAtEnd && el) el.scrollLeft = el.scrollWidth - el.clientWidth;
6658
6864
  }, [opensAtEnd, plotWidth, boxWidth, count]);
6659
- useLayoutEffect5(() => {
6865
+ useLayoutEffect6(() => {
6660
6866
  const tip = tipEl.current;
6661
6867
  if (!tip) return;
6662
6868
  const layered = topLayer;
@@ -6671,7 +6877,7 @@ function Chart(props) {
6671
6877
  if (layered) placeChartTip(anchor2, tip);
6672
6878
  else placeTip(frameEl.current, anchor2, tip);
6673
6879
  }, [openId, plotWidth, plotHeight, topLayer]);
6674
- useEffect21(() => {
6880
+ useEffect23(() => {
6675
6881
  if (!openId) return;
6676
6882
  const doc = frameEl.current?.ownerDocument;
6677
6883
  const view2 = doc?.defaultView;
@@ -6758,11 +6964,11 @@ function Chart(props) {
6758
6964
  };
6759
6965
  const hitBand = (band) => band === "up" ? { y: PAD, h: Math.max(zero - PAD, TARGET) } : band === "down" ? { y: zero, h: Math.max(plotHeight - PAD - zero, TARGET) } : { y: PAD, h: Math.max(plotHeight - PAD * 2, TARGET) };
6760
6966
  const legendFirst = !(look?.variant === "donut" && look.look !== "labels");
6761
- const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */ jsx47("ul", { className: "ui-chart__legend", children: keys.map((key) => /* @__PURE__ */ jsxs43("li", { className: cx9("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
6762
- /* @__PURE__ */ jsx47(KeyMark, { shape: key.shape }),
6967
+ const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */ jsx49("ul", { className: "ui-chart__legend", children: keys.map((key) => /* @__PURE__ */ jsxs45("li", { className: cx9("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
6968
+ /* @__PURE__ */ jsx49(KeyMark, { shape: key.shape }),
6763
6969
  key.name
6764
6970
  ] }, key.id)) });
6765
- const viewSwitch = showTable && /* @__PURE__ */ jsx47(
6971
+ const viewSwitch = showTable && /* @__PURE__ */ jsx49(
6766
6972
  Segmented,
6767
6973
  {
6768
6974
  size: "sm",
@@ -6785,7 +6991,7 @@ function Chart(props) {
6785
6991
  return centre(i) - half < 0 ? "is-start" : centre(i) + half > plotWidth ? "is-end" : null;
6786
6992
  };
6787
6993
  const groupX = groupFrom >= 0 ? Math.min(Math.max(groupFrom * colWidth, 1), plotWidth - 1) : 0;
6788
- return /* @__PURE__ */ jsxs43(
6994
+ return /* @__PURE__ */ jsxs45(
6789
6995
  "div",
6790
6996
  {
6791
6997
  className: cx9(
@@ -6805,11 +7011,11 @@ function Chart(props) {
6805
7011
  },
6806
7012
  children: [
6807
7013
  toCard && createPortal8(viewSwitch, toCard),
6808
- (showTable && !toCard || legendFirst && legend) && /* @__PURE__ */ jsxs43("div", { className: "ui-chart__head", children: [
7014
+ (showTable && !toCard || legendFirst && legend) && /* @__PURE__ */ jsxs45("div", { className: "ui-chart__head", children: [
6809
7015
  legendFirst && legend,
6810
7016
  !toCard && viewSwitch
6811
7017
  ] }),
6812
- /* @__PURE__ */ jsxs43(
7018
+ /* @__PURE__ */ jsxs45(
6813
7019
  "div",
6814
7020
  {
6815
7021
  ref: frameEl,
@@ -6837,8 +7043,8 @@ function Chart(props) {
6837
7043
  setSaid("");
6838
7044
  },
6839
7045
  children: [
6840
- !spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */ jsx47("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx47("span", { className: "ui-chart__tick", children: axisFormat(tick) }, tick)) }),
6841
- /* @__PURE__ */ jsx47(
7046
+ !spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */ jsx49("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx49("span", { className: "ui-chart__tick", children: axisFormat(tick) }, tick)) }),
7047
+ /* @__PURE__ */ jsx49(
6842
7048
  "div",
6843
7049
  {
6844
7050
  ref: scroller,
@@ -6854,8 +7060,8 @@ function Chart(props) {
6854
7060
  if (mark.right <= view2.left || mark.left >= view2.right) setOpenId(null);
6855
7061
  else placeTip(frameEl.current, anchor2, tipEl.current);
6856
7062
  },
6857
- children: /* @__PURE__ */ jsxs43("div", { ref: plot, className: "ui-chart__plot", children: [
6858
- /* @__PURE__ */ jsxs43(
7063
+ children: /* @__PURE__ */ jsxs45("div", { ref: plot, className: "ui-chart__plot", children: [
7064
+ /* @__PURE__ */ jsxs45(
6859
7065
  "svg",
6860
7066
  {
6861
7067
  ref: svgEl,
@@ -6917,7 +7123,7 @@ function Chart(props) {
6917
7123
  announce(mark.column, selectable ? mark.column : pick);
6918
7124
  },
6919
7125
  children: [
6920
- !spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx47(
7126
+ !spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx49(
6921
7127
  "rect",
6922
7128
  {
6923
7129
  className: "ui-chart__band",
@@ -6930,7 +7136,7 @@ function Chart(props) {
6930
7136
  frame.links && frame.bars.slice(0, -1).map((bar, i) => {
6931
7137
  const from = byId.get(bar.id);
6932
7138
  const to = byId.get(frame.bars[i + 1].id);
6933
- return from && to ? /* @__PURE__ */ jsx47(
7139
+ return from && to ? /* @__PURE__ */ jsx49(
6934
7140
  "line",
6935
7141
  {
6936
7142
  className: "ui-chart__carry",
@@ -6942,7 +7148,7 @@ function Chart(props) {
6942
7148
  `carry-${bar.id}`
6943
7149
  ) : null;
6944
7150
  }),
6945
- !spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx47(
7151
+ !spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx49(
6946
7152
  "line",
6947
7153
  {
6948
7154
  className: "ui-chart__grid",
@@ -6953,7 +7159,7 @@ function Chart(props) {
6953
7159
  },
6954
7160
  `grid-${tick}`
6955
7161
  )),
6956
- !spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */ jsx47(
7162
+ !spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */ jsx49(
6957
7163
  "line",
6958
7164
  {
6959
7165
  className: "ui-chart__zero",
@@ -6963,8 +7169,8 @@ function Chart(props) {
6963
7169
  y2: px2(y(0))
6964
7170
  }
6965
7171
  ),
6966
- groupFrom >= 0 && /* @__PURE__ */ jsxs43(Fragment21, { children: [
6967
- /* @__PURE__ */ jsx47(
7172
+ groupFrom >= 0 && /* @__PURE__ */ jsxs45(Fragment22, { children: [
7173
+ /* @__PURE__ */ jsx49(
6968
7174
  "line",
6969
7175
  {
6970
7176
  className: "ui-chart__boundary",
@@ -6974,7 +7180,7 @@ function Chart(props) {
6974
7180
  y2: px2(plotHeight - PAD)
6975
7181
  }
6976
7182
  ),
6977
- /* @__PURE__ */ jsx47(
7183
+ /* @__PURE__ */ jsx49(
6978
7184
  "text",
6979
7185
  {
6980
7186
  className: "ui-chart__text ui-chart__group",
@@ -6984,7 +7190,7 @@ function Chart(props) {
6984
7190
  }
6985
7191
  )
6986
7192
  ] }),
6987
- fades.size > 0 && /* @__PURE__ */ jsx47("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs43(
7193
+ fades.size > 0 && /* @__PURE__ */ jsx49("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs45(
6988
7194
  "linearGradient",
6989
7195
  {
6990
7196
  id: fade.id,
@@ -6994,15 +7200,15 @@ function Chart(props) {
6994
7200
  y1: fade.up ? "1" : "0",
6995
7201
  y2: fade.up ? "0" : "1",
6996
7202
  children: [
6997
- /* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-base", offset: "0" }),
6998
- /* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-end", offset: "1" })
7203
+ /* @__PURE__ */ jsx49("stop", { className: "ui-chart__fade-base", offset: "0" }),
7204
+ /* @__PURE__ */ jsx49("stop", { className: "ui-chart__fade-end", offset: "1" })
6999
7205
  ]
7000
7206
  },
7001
7207
  fade.id
7002
7208
  )) }),
7003
7209
  marks.filter((m) => m.kind === "bar").map((mark) => {
7004
7210
  const fade = fadeFor(mark);
7005
- return /* @__PURE__ */ jsx47(
7211
+ return /* @__PURE__ */ jsx49(
7006
7212
  "path",
7007
7213
  {
7008
7214
  className: cx9(
@@ -7019,7 +7225,7 @@ function Chart(props) {
7019
7225
  marks.filter((m) => m.kind === "bar" && printed.has(m.id)).map((mark) => {
7020
7226
  const text2 = formatAxis(mark.value);
7021
7227
  const below = under.has(mark.id);
7022
- return /* @__PURE__ */ jsx47(
7228
+ return /* @__PURE__ */ jsx49(
7023
7229
  "text",
7024
7230
  {
7025
7231
  className: cx9("ui-chart__text", "ui-chart__value", below && "ui-chart__value--below"),
@@ -7031,7 +7237,7 @@ function Chart(props) {
7031
7237
  );
7032
7238
  }),
7033
7239
  ["casing", "stroke"].map((layer) => lines.flatMap(
7034
- (line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx47(
7240
+ (line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx49(
7035
7241
  "line",
7036
7242
  {
7037
7243
  className: layer === "casing" ? "ui-chart__line-casing" : cx9(
@@ -7047,7 +7253,7 @@ function Chart(props) {
7047
7253
  `${line.id}-${layer}-${i}`
7048
7254
  ) : null)
7049
7255
  )),
7050
- lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx47(
7256
+ lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx49(
7051
7257
  "circle",
7052
7258
  {
7053
7259
  className: cx9("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
@@ -7058,8 +7264,8 @@ function Chart(props) {
7058
7264
  `isolated-${line.id}-${i}`
7059
7265
  ) : null)),
7060
7266
  geometry && lookDrawing(geometry, open?.column ?? null, pick),
7061
- marks.map((mark) => /* @__PURE__ */ jsxs43("g", { "data-mark": mark.id, children: [
7062
- mark.hitPath ? /* @__PURE__ */ jsx47("path", { className: "ui-chart__hit", d: mark.hitPath }) : mark.kind === "bar" ? /* @__PURE__ */ jsx47(
7267
+ marks.map((mark) => /* @__PURE__ */ jsxs45("g", { "data-mark": mark.id, children: [
7268
+ mark.hitPath ? /* @__PURE__ */ jsx49("path", { className: "ui-chart__hit", d: mark.hitPath }) : mark.kind === "bar" ? /* @__PURE__ */ jsx49(
7063
7269
  "rect",
7064
7270
  {
7065
7271
  className: "ui-chart__hit",
@@ -7068,7 +7274,7 @@ function Chart(props) {
7068
7274
  y: px2(hitBand(mark.band).y),
7069
7275
  height: px2(hitBand(mark.band).h)
7070
7276
  }
7071
- ) : /* @__PURE__ */ jsx47(
7277
+ ) : /* @__PURE__ */ jsx49(
7072
7278
  "rect",
7073
7279
  {
7074
7280
  className: "ui-chart__hit",
@@ -7078,7 +7284,7 @@ function Chart(props) {
7078
7284
  height: px2(mark.hit?.h ?? TARGET)
7079
7285
  }
7080
7286
  ),
7081
- /* @__PURE__ */ jsx47(
7287
+ /* @__PURE__ */ jsx49(
7082
7288
  "rect",
7083
7289
  {
7084
7290
  "data-anchor": mark.id,
@@ -7093,8 +7299,8 @@ function Chart(props) {
7093
7299
  ]
7094
7300
  }
7095
7301
  ),
7096
- look?.variant === "donut" && look.look === "table" && /* @__PURE__ */ jsx47(Shares, { look, format, swatch: /* @__PURE__ */ jsx47(KeyMark, { shape: "fill" }) }),
7097
- !spark && columnsLayout && /* @__PURE__ */ jsx47("div", { className: cx9("ui-chart__periods", every > 1 && "ui-chart__periods--step"), "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx47(
7302
+ look?.variant === "donut" && look.look === "table" && /* @__PURE__ */ jsx49(Shares, { look, format, swatch: /* @__PURE__ */ jsx49(KeyMark, { shape: "fill" }) }),
7303
+ !spark && columnsLayout && /* @__PURE__ */ jsx49("div", { className: cx9("ui-chart__periods", every > 1 && "ui-chart__periods--step"), "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx49(
7098
7304
  "span",
7099
7305
  {
7100
7306
  className: cx9("ui-chart__period", pick === i && "is-selected", every > 1 && edgeOf(i)),
@@ -7105,46 +7311,46 @@ function Chart(props) {
7105
7311
  ] })
7106
7312
  }
7107
7313
  ),
7108
- /* @__PURE__ */ jsx47("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs43(Fragment21, { children: [
7109
- /* @__PURE__ */ jsx47("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
7110
- open.rows ? /* @__PURE__ */ jsxs43(Fragment21, { children: [
7111
- open.rows.map((row) => /* @__PURE__ */ jsxs43("span", { className: "ui-tip__value ui-chart__row", children: [
7112
- /* @__PURE__ */ jsxs43("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
7113
- /* @__PURE__ */ jsx47(KeyMark, { shape: row.shape }),
7314
+ /* @__PURE__ */ jsx49("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs45(Fragment22, { children: [
7315
+ /* @__PURE__ */ jsx49("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
7316
+ open.rows ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
7317
+ open.rows.map((row) => /* @__PURE__ */ jsxs45("span", { className: "ui-tip__value ui-chart__row", children: [
7318
+ /* @__PURE__ */ jsxs45("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
7319
+ /* @__PURE__ */ jsx49(KeyMark, { shape: row.shape }),
7114
7320
  row.name
7115
7321
  ] }),
7116
- /* @__PURE__ */ jsx47("span", { children: row.text })
7322
+ /* @__PURE__ */ jsx49("span", { children: row.text })
7117
7323
  ] }, row.name)),
7118
- open.total && /* @__PURE__ */ jsxs43("span", { className: "ui-tip__value ui-chart__row", children: [
7119
- /* @__PURE__ */ jsx47("span", { children: totalLabel }),
7120
- /* @__PURE__ */ jsx47("span", { children: open.total })
7324
+ open.total && /* @__PURE__ */ jsxs45("span", { className: "ui-tip__value ui-chart__row", children: [
7325
+ /* @__PURE__ */ jsx49("span", { children: totalLabel }),
7326
+ /* @__PURE__ */ jsx49("span", { children: open.total })
7121
7327
  ] })
7122
- ] }) : /* @__PURE__ */ jsx47("span", { className: "ui-tip__value", children: format(open.value) }),
7123
- (stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx47("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
7328
+ ] }) : /* @__PURE__ */ jsx49("span", { className: "ui-tip__value", children: format(open.value) }),
7329
+ (stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx49("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
7124
7330
  ] }) })
7125
7331
  ]
7126
7332
  }
7127
7333
  ),
7128
7334
  !legendFirst && legend,
7129
- /* @__PURE__ */ jsx47("div", { className: "ui-sr", role: "status", children: said }),
7130
- asTable && /* @__PURE__ */ jsx47("div", { className: "ui-chart__data", children: /* @__PURE__ */ jsx47(
7335
+ /* @__PURE__ */ jsx49("div", { className: "ui-sr", role: "status", children: said }),
7336
+ asTable && /* @__PURE__ */ jsx49("div", { className: "ui-chart__data", children: /* @__PURE__ */ jsx49(
7131
7337
  "div",
7132
7338
  {
7133
7339
  className: "ui-table-scroll",
7134
7340
  role: "region",
7135
7341
  tabIndex: 0,
7136
7342
  "aria-label": `${title}, as a table. Scroll for more columns.`,
7137
- children: /* @__PURE__ */ jsxs43("table", { className: "ui-table", "aria-label": title, children: [
7138
- /* @__PURE__ */ jsx47("thead", { children: /* @__PURE__ */ jsx47("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx47("th", { scope: "col", className: cx9(i > 0 && "ui-table__num"), children: head }, head)) }) }),
7139
- /* @__PURE__ */ jsx47("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs43("tr", { "aria-current": pick === i ? true : void 0, children: [
7140
- /* @__PURE__ */ jsxs43("th", { scope: "row", children: [
7343
+ children: /* @__PURE__ */ jsxs45("table", { className: "ui-table", "aria-label": title, children: [
7344
+ /* @__PURE__ */ jsx49("thead", { children: /* @__PURE__ */ jsx49("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx49("th", { scope: "col", className: cx9(i > 0 && "ui-table__num"), children: head }, head)) }) }),
7345
+ /* @__PURE__ */ jsx49("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs45("tr", { "aria-current": pick === i ? true : void 0, children: [
7346
+ /* @__PURE__ */ jsxs45("th", { scope: "row", children: [
7141
7347
  row.column.label,
7142
- row.column.estimated && /* @__PURE__ */ jsxs43(Fragment21, { children: [
7348
+ row.column.estimated && /* @__PURE__ */ jsxs45(Fragment22, { children: [
7143
7349
  " ",
7144
- /* @__PURE__ */ jsx47("span", { className: "ui-chart__state", children: stateOf(row.column) })
7350
+ /* @__PURE__ */ jsx49("span", { className: "ui-chart__state", children: stateOf(row.column) })
7145
7351
  ] })
7146
7352
  ] }),
7147
- row.cells.map((cell, j) => /* @__PURE__ */ jsx47("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
7353
+ row.cells.map((cell, j) => /* @__PURE__ */ jsx49("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
7148
7354
  ] }, `${row.column.label}-${i}`)) })
7149
7355
  ] })
7150
7356
  }
@@ -7157,7 +7363,7 @@ function Chart(props) {
7157
7363
  // src/AccentPicker.tsx
7158
7364
  import { forwardRef as forwardRef12 } from "react";
7159
7365
  import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
7160
- import { jsx as jsx48 } from "react/jsx-runtime";
7366
+ import { jsx as jsx50 } from "react/jsx-runtime";
7161
7367
  var AccentPicker = forwardRef12(function AccentPicker2({
7162
7368
  value,
7163
7369
  onChange,
@@ -7166,7 +7372,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
7166
7372
  "aria-label": label = "Accent",
7167
7373
  ...rest
7168
7374
  }, ref) {
7169
- return /* @__PURE__ */ jsx48(
7375
+ return /* @__PURE__ */ jsx50(
7170
7376
  "div",
7171
7377
  {
7172
7378
  ...rest,
@@ -7177,7 +7383,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
7177
7383
  "aria-label": label,
7178
7384
  children: options.map((accent) => {
7179
7385
  const title = accent.charAt(0).toUpperCase() + accent.slice(1);
7180
- return /* @__PURE__ */ jsx48(
7386
+ return /* @__PURE__ */ jsx50(
7181
7387
  "button",
7182
7388
  {
7183
7389
  type: "button",
@@ -7196,9 +7402,9 @@ var AccentPicker = forwardRef12(function AccentPicker2({
7196
7402
  });
7197
7403
 
7198
7404
  // src/TopBar.tsx
7199
- import { Fragment as Fragment22 } from "react";
7405
+ import { Fragment as Fragment23 } from "react";
7200
7406
  import { prism as prism3, safeUrl as safeUrl6, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
7201
- import { Fragment as Fragment23, jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
7407
+ import { Fragment as Fragment24, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
7202
7408
  function TopBar({
7203
7409
  brand,
7204
7410
  word = "Strategy",
@@ -7210,20 +7416,20 @@ function TopBar({
7210
7416
  className,
7211
7417
  ...rest
7212
7418
  }) {
7213
- return /* @__PURE__ */ jsx49("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs44("div", { className: "topbar__in", children: [
7214
- brand ?? /* @__PURE__ */ jsxs44("a", { className: "brand", href: safeUrl6(brandHref), "aria-label": `Apliteni ${word}`, children: [
7215
- /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
7216
- /* @__PURE__ */ jsx49("span", { children: word })
7419
+ return /* @__PURE__ */ jsx51("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs46("div", { className: "topbar__in", children: [
7420
+ brand ?? /* @__PURE__ */ jsxs46("a", { className: "brand", href: safeUrl6(brandHref), "aria-label": `Apliteni ${word}`, children: [
7421
+ /* @__PURE__ */ jsx51("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
7422
+ /* @__PURE__ */ jsx51("span", { children: word })
7217
7423
  ] }),
7218
7424
  view,
7219
- /* @__PURE__ */ jsx49("span", { className: "spacer" }),
7425
+ /* @__PURE__ */ jsx51("span", { className: "spacer" }),
7220
7426
  version,
7221
7427
  theme,
7222
7428
  account
7223
7429
  ] }) });
7224
7430
  }
7225
7431
  function ViewSwitch({ items, active, label = "View", renderLink }) {
7226
- return /* @__PURE__ */ jsx49("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
7432
+ return /* @__PURE__ */ jsx51("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
7227
7433
  const current = item.id === active;
7228
7434
  const linkProps = {
7229
7435
  className: current ? "cur" : void 0,
@@ -7232,13 +7438,13 @@ function ViewSwitch({ items, active, label = "View", renderLink }) {
7232
7438
  "aria-current": current ? "page" : void 0,
7233
7439
  children: item.label
7234
7440
  };
7235
- return /* @__PURE__ */ jsx49(Fragment22, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx49("a", { ...linkProps }) }, item.id);
7441
+ return /* @__PURE__ */ jsx51(Fragment23, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx51("a", { ...linkProps }) }, item.id);
7236
7442
  }) });
7237
7443
  }
7238
7444
  var BADGE = { live: "Live", archive: "Archive" };
7239
7445
  function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
7240
7446
  const current = versions.find((v) => v.value === value);
7241
- return /* @__PURE__ */ jsx49("div", { className: "vsw", children: /* @__PURE__ */ jsx49(
7447
+ return /* @__PURE__ */ jsx51("div", { className: "vsw", children: /* @__PURE__ */ jsx51(
7242
7448
  Dropdown,
7243
7449
  {
7244
7450
  variant: "select",
@@ -7249,9 +7455,9 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
7249
7455
  chevron: false,
7250
7456
  defaultOpen,
7251
7457
  ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
7252
- triggerContent: /* @__PURE__ */ jsxs44(Fragment23, { children: [
7253
- /* @__PURE__ */ jsx49("span", { className: "cur", children: current?.label }),
7254
- /* @__PURE__ */ jsx49("span", { className: "car", "aria-hidden": "true" })
7458
+ triggerContent: /* @__PURE__ */ jsxs46(Fragment24, { children: [
7459
+ /* @__PURE__ */ jsx51("span", { className: "cur", children: current?.label }),
7460
+ /* @__PURE__ */ jsx51("span", { className: "car", "aria-hidden": "true" })
7255
7461
  ] }),
7256
7462
  items: versions.map((v) => ({
7257
7463
  label: v.label,
@@ -7259,10 +7465,10 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
7259
7465
  badge: BADGE[v.badge ?? "archive"],
7260
7466
  selected: v.value === value
7261
7467
  })),
7262
- row: (item, props) => /* @__PURE__ */ jsxs44("div", { ...props, className: `${props.className} vopt`, children: [
7263
- /* @__PURE__ */ jsx49("span", { className: "vname", children: item.label }),
7264
- /* @__PURE__ */ jsx49("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
7265
- /* @__PURE__ */ jsx49("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8("check") } })
7468
+ row: (item, props) => /* @__PURE__ */ jsxs46("div", { ...props, className: `${props.className} vopt`, children: [
7469
+ /* @__PURE__ */ jsx51("span", { className: "vname", children: item.label }),
7470
+ /* @__PURE__ */ jsx51("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
7471
+ /* @__PURE__ */ jsx51("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8("check") } })
7266
7472
  ] }),
7267
7473
  onSelect: (picked) => {
7268
7474
  if (picked != null) onChange?.(String(picked));
@@ -7291,7 +7497,7 @@ function AccountMenu2({
7291
7497
  defaultOpen
7292
7498
  }) {
7293
7499
  const mark = initialsOf(name, email);
7294
- return /* @__PURE__ */ jsx49("div", { className: "acct on", children: /* @__PURE__ */ jsx49(
7500
+ return /* @__PURE__ */ jsx51("div", { className: "acct on", children: /* @__PURE__ */ jsx51(
7295
7501
  Dropdown,
7296
7502
  {
7297
7503
  variant: "menu",
@@ -7302,22 +7508,22 @@ function AccountMenu2({
7302
7508
  defaultOpen,
7303
7509
  ariaLabel: "Account",
7304
7510
  triggerContent: mark,
7305
- header: /* @__PURE__ */ jsxs44("div", { className: "ahead", children: [
7306
- /* @__PURE__ */ jsx49("span", { className: "avatar", children: mark }),
7307
- /* @__PURE__ */ jsxs44("span", { className: "aw", children: [
7308
- /* @__PURE__ */ jsx49("span", { className: "anm", children: name }),
7309
- /* @__PURE__ */ jsx49("span", { className: "aem", title: email, children: email })
7511
+ header: /* @__PURE__ */ jsxs46("div", { className: "ahead", children: [
7512
+ /* @__PURE__ */ jsx51("span", { className: "avatar", children: mark }),
7513
+ /* @__PURE__ */ jsxs46("span", { className: "aw", children: [
7514
+ /* @__PURE__ */ jsx51("span", { className: "anm", children: name }),
7515
+ /* @__PURE__ */ jsx51("span", { className: "aem", title: email, children: email })
7310
7516
  ] })
7311
7517
  ] }),
7312
7518
  items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
7313
- row: (item, props) => /* @__PURE__ */ jsxs44(
7519
+ row: (item, props) => /* @__PURE__ */ jsxs46(
7314
7520
  "a",
7315
7521
  {
7316
7522
  ...props,
7317
7523
  href: item.disabled ? void 0 : item.href ? safeUrl6(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl6(item.value === "sign-out" ? "#logout" : `#${item.value}`),
7318
7524
  className: [props.className, !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
7319
7525
  children: [
7320
- item.icon && /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
7526
+ item.icon && /* @__PURE__ */ jsx51("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
7321
7527
  item.label
7322
7528
  ]
7323
7529
  }
@@ -7394,12 +7600,14 @@ export {
7394
7600
  TextField,
7395
7601
  ThemeChoice,
7396
7602
  ThemeToggle,
7603
+ ThreeColumnPage,
7397
7604
  Timeline,
7398
7605
  Toast,
7399
7606
  Tooltip,
7400
7607
  TopBar,
7401
7608
  VersionSwitcher,
7402
7609
  ViewSwitch,
7610
+ Wizard,
7403
7611
  sortTableRows,
7404
7612
  useToast
7405
7613
  };